Skip to content

Commit 0972714

Browse files
committed
feat(category): show category comment in service catalog
closes #394
1 parent 1b28968 commit 0972714

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

inc/category.class.php

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public static function getCategoryTree(): array {
132132
'SELECT' => [
133133
'id',
134134
'name',
135+
'comment',
135136
"$categoryFk as parent",
136137
'level',
137138
new QueryExpression(

inc/knowbase.class.php

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ public static function getCategoryTree() {
129129
'SELECT' => [
130130
KnowbaseItemCategory::getTableField('id'),
131131
KnowbaseItemCategory::getTableField('name'),
132+
KnowbaseItemCategory::getTableField('comment'),
132133
KnowbaseItemCategory::getTableField($cat_fk),
133134
$items_subquery,
134135
],

js/scripts.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@ function buildKbCategoryList(tree) {
343343
if (tree.id != 0) {
344344
html += '<a href="#" data-parent-category-id="' + tree.parent +'"'
345345
+ ' data-category-id="' + tree.id + '"'
346-
+ ' onclick="plugin_formcreator.updateKbitemsView(this)">'
346+
+ ' onclick="plugin_formcreator.updateKbitemsView(this)"'
347+
+ ' title="' + tree.comment + '">'
347348
+ tree.name
348349
+ '</a>';
349350
}
@@ -364,7 +365,7 @@ function buildCategoryList(tree) {
364365
html = '<a href="#" data-parent-category-id="' + tree.parent +'"'
365366
+ ' data-category-id="' + tree.id + '"'
366367
+ ' onclick="plugin_formcreator.updateWizardFormsView(this)"'
367-
+ 'title="' + tree.name + '">'
368+
+ ' title="' + tree.comment + '">'
368369
+ tree.name
369370
+ '</a>';
370371
}

0 commit comments

Comments
 (0)