Skip to content

Commit

Permalink
fix(faq): errors in FAQ list
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Dec 2, 2019
1 parent 314ff9c commit 380e9ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 6 additions & 3 deletions inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ public function showFormList($rootCategory = 0, $keywords = '', $helpdeskHome =
if (version_compare(GLPI_VERSION, "9.4") > 0) {
$subQuery = new DBMysqlIterator($DB);
$subQuery->buildQuery($query_faqs);
$query_faqs = '(' . $subQuery->getSQL() . ') AS `faqs`';
$query_faqs = '(' . $subQuery->getSQL() . ')';
}

$query_faqs = [
Expand All @@ -933,7 +933,7 @@ public function showFormList($rootCategory = 0, $keywords = '', $helpdeskHome =
'FROM' => $table_cat,
'WHERE' => [
'id' => $selectedCategories,
'knowbaseitemcategories_id' => ['<>, 0'],
'knowbaseitemcategories_id' => ['!=', 0],
],
]),
];
Expand All @@ -947,7 +947,7 @@ public function showFormList($rootCategory = 0, $keywords = '', $helpdeskHome =
]
];
$query_faqs['WHERE'] = [
'faqs.knowbaseitemcategories_id' => ['<>', 0],
'faqs.knowbaseitemcategories_id' => ['!=', 0],
];
}
$result_faqs = $DB->request($query_faqs);
Expand All @@ -957,6 +957,9 @@ public function showFormList($rootCategory = 0, $keywords = '', $helpdeskHome =
$formList[] = [
'id' => $faq['id'],
'name' => $faq['name'],
'icon' => '',
'icon_color' => '',
'background_color' => '',
'description' => '',
'type' => 'faq',
'usage_count' => $faq['view'],
Expand Down
4 changes: 4 additions & 0 deletions js/scripts.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,10 @@ function buildTiles(list) {
item.icon_color = '#999999';
}

if (item.background_color == '') {
item.background_color = '#e7e7e7';
}

if (item.type == 'form') {
forms.push(
'<div style="background-color: ' + item.background_color + '" class="plugin_formcreator_formTile '+item.type+' '+default_class+'" title="'+item.description+'">'
Expand Down

0 comments on commit 380e9ca

Please sign in to comment.