This commit is contained in:
yuri
2016-02-12 12:33:19 +02:00
parent edc967c118
commit b29cbec3a1
3 changed files with 13 additions and 4 deletions
@@ -33,6 +33,9 @@
"Article": "Article"
}
},
"tooltips": {
"portals": "If not empty then this article will be available only in specified portals. If empty then it will available in all portals."
},
"presetFilters": {
"published": "Published"
}
@@ -20,7 +20,8 @@
"options": ["Article"]
},
"portals": {
"type": "linkMultiple"
"type": "linkMultiple",
"tooltip": true
},
"publishDate": {
"type": "date"
@@ -46,9 +46,14 @@ class KnowledgeBaseArticle extends \Espo\Core\SelectManagers\Base
$this->filterPublished($result);
$this->setDistinct(true, $result);
$this->addJoin('portals', $result);
$this->addAndWhere(array(
'portals.id' => $this->getUser()->get('portalId')
$this->addLeftJoin('portals', $result);
$this->addOrWhere(array(
array(
'portals.id' => $this->getUser()->get('portalId')
),
array(
'portals.id' => null
)
), $result);
}
}