kb portals

This commit is contained in:
yuri
2016-02-11 12:29:12 +02:00
parent 79a29531e9
commit db49af84f4
10 changed files with 57 additions and 7 deletions
@@ -13,12 +13,14 @@
"description": "Description",
"body": "Body",
"categories": "Categories",
"language": "Language"
"language": "Language",
"portals": "Portals"
},
"links": {
"cases": "Cases",
"opportunities": "Opportunities",
"categories": "Categories"
"categories": "Categories",
"portals": "Portals"
},
"options": {
"status": {
@@ -0,0 +1,5 @@
{
"links": {
"articles": "Knlowledge Base Articles"
}
}
@@ -4,8 +4,8 @@
"rows":[
[{"name":"name", "fullWidth": true}],
[{"name":"status"}, {"name":"publishDate"}],
[{"name":"type"}, {"name":"expirationDate"}],
[{"name":"categories"}, {"name":"language"}],
[{"name":"categories"}, {"name":"expirationDate"}],
[{"name":"portals"}, {"name":"language"}],
[{"name":"body", "fullWidth": true}],
[{"name":"attachments", "fullWidth": true}]
]
@@ -3,8 +3,8 @@
"label": "",
"rows":[
[{"name":"name", "fullWidth": true}],
[{"name":"status"}, {"name":"type"}],
[{"name":"categories"}, {"name":"language"}],
[{"name":"status"}, {"name":"language"}],
[{"name":"categories"}, {"name":"portals"}],
[{"name":"body", "fullWidth": true}],
[{"name":"attachments", "fullWidth": true}]
]
@@ -2,7 +2,9 @@
"createdAt",
"createdBy",
"expirationDate",
"language",
"type",
"status",
"portals",
"publishDate"
]
@@ -1,5 +1,6 @@
[
"categories"
"status"
"status",
"portals",
"teams"
]
@@ -0,0 +1,17 @@
{
"mandatory": {
"scopeLevel": {
"MassEmail": "Campaign",
"CampaignLogRecord": "Campaign",
"CampaignTrackingUrl": "Campaign",
"EmailQueueItem": false
}
},
"default": {
"scopeFieldLevel": {
"KnowledgeBaseArticle": {
"portals": false
}
}
}
}
@@ -19,6 +19,9 @@
"type": "enum",
"options": ["Article"]
},
"portals": {
"type": "linkMultiple"
},
"publishDate": {
"type": "date"
},
@@ -68,6 +71,11 @@
"entity": "Case",
"foreign": "articles"
},
"portals": {
"type": "hasMany",
"entity": "Portal",
"foreign": "articles"
},
"createdBy": {
"type": "belongsTo",
"entity": "User"
@@ -0,0 +1,9 @@
{
"links": {
"articles": {
"type": "hasMany",
"entity": "KnowledgeBaseArticle",
"foreign": "portals"
}
}
}
@@ -44,6 +44,12 @@ class KnowledgeBaseArticle extends \Espo\Core\SelectManagers\Base
if ($this->checkIsPortal()) {
$this->filterPublished($result);
$this->setDistinct(true, $result);
$this->addJoin('portals', $result);
$this->addAndWhere(array(
'portals.id' => $this->getUser()->get('portalId')
), $result);
}
}