Skip to content

Commit 6639cda

Browse files
committed
fix(wizard): consistent breadcrumb on several pages
1 parent b748182 commit 6639cda

File tree

5 files changed

+34
-6
lines changed

5 files changed

+34
-6
lines changed

front/formlist.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@
4242
if (plugin_formcreator_replaceHelpdesk()) {
4343
Html::redirect('issue.php');
4444
} else {
45-
Html::helpHeader(__('Form list', 'formcreator'));
45+
Html::helpHeader(
46+
__('Form list', 'formcreator'),
47+
'seek_assistance',
48+
PluginFormcreatorForm::class
49+
);
4650
}
4751
} else {
4852
Html::header(__('Form list', 'formcreator'));

front/knowbaseitem.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@
3838
}
3939

4040
if (Session::getCurrentInterface() == 'helpdesk') {
41-
Html::helpHeader(__('Service catalog', 'formcreator'));
41+
Html::helpHeader(
42+
__('Service catalog', 'formcreator'),
43+
'faq',
44+
PluginFormcreatorForm::class
45+
);
4246
} else {
4347
Html::header(__('Service catalog', 'formcreator'));
4448
}

front/wizard.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@
4141
}
4242

4343
if (Session::getCurrentInterface() == "helpdesk") {
44-
Html::helpHeader(__('Service catalog', 'formcreator'));
44+
Html::helpHeader(
45+
__('Service catalog', 'formcreator'),
46+
'seek_assistance',
47+
PluginFormcreatorForm::class
48+
);
4549
} else {
4650
Html::header(__('Service catalog', 'formcreator'));
4751
}

inc/common.class.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,11 @@ public static function header() {
682682
switch (self::getInterface()) {
683683
case "servicecatalog":
684684
case "self-service":
685-
return Html::helpHeader(__('Form list', 'formcreator'), $_SERVER['PHP_SELF']);
685+
return Html::helpHeader(
686+
__('Form list', 'formcreator'),
687+
'seek_assistance',
688+
PluginFormcreatorForm::class
689+
);
686690
case "central":
687691
return Html::header(
688692
__('Form Creator', 'formcreator'),

setup.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,9 @@ function plugin_formcreator_hook(): void {
340340
if (strpos($_SERVER['REQUEST_URI'], 'helpdesk') !== false
341341
|| strpos($_SERVER['REQUEST_URI'], 'central.php') !== false
342342
|| strpos($_SERVER['REQUEST_URI'], 'formcreator/front/formlist.php') !== false
343-
|| strpos($_SERVER['REQUEST_URI'], 'formcreator/front/knowbaseitem.php') !== false
344343
|| strpos($_SERVER['REQUEST_URI'], 'formcreator/front/wizard.php') !== false) {
345344
$PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT]['formcreator'][] = 'lib/jquery-slinky/dist/slinky.min.js';
346-
$CFG_GLPI['javascript']['self-service']['none'] = [
345+
$CFG_GLPI['javascript']['seek_assistance'][PluginFormcreatorForm::class] = [
347346
'dashboard',
348347
'gridstack'
349348
];
@@ -354,6 +353,19 @@ function plugin_formcreator_hook(): void {
354353
'gridstack'
355354
];
356355
}
356+
if (strpos($_SERVER['REQUEST_URI'], 'formdisplay.php') !== false) {
357+
$CFG_GLPI['javascript']['seek_assistance'][PluginFormcreatorForm::class] = [
358+
'dashboard',
359+
'gridstack'
360+
];
361+
}
362+
if (strpos($_SERVER['REQUEST_URI'], 'knowbaseitem.php') !== false) {
363+
$PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT]['formcreator'][] = 'lib/jquery-slinky/dist/slinky.min.js';
364+
$CFG_GLPI['javascript']['faq'][PluginFormcreatorForm::class] = [
365+
'dashboard',
366+
'gridstack'
367+
];
368+
}
357369
}
358370
}
359371

0 commit comments

Comments
 (0)