Skip to content

Commit 04374b9

Browse files
committed
feat: compatibility with GLPI's marketplace
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
1 parent 0d7c4dd commit 04374b9

21 files changed

+40
-62
lines changed

ajax/homepage_link.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
include ('../../../inc/includes.php');
3434

3535
echo '<li id="menu5">";
36-
<a href="'.$CFG_GLPI['root_doc'].'/plugins/formcreator/front/formlist.php" class="itemP">'.
36+
<a href="'.FORMCREATOR_ROOTDOC.'/front/formlist.php" class="itemP">'.
3737
_n('Form', 'Forms', 2, 'formcreator').
3838
'</a>
3939
</li>';

front/form.form.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
// Add a new Form
4545
Session::checkRight('entity', UPDATE);
4646
$newID = $form->add($_POST);
47-
Html::redirect($CFG_GLPI['root_doc'] . '/plugins/formcreator/front/form.form.php?id=' . $newID);
47+
Html::redirect(FORMCREATOR_ROOTDOC . '/front/form.form.php?id=' . $newID);
4848

4949
} else if (isset($_POST['update'])) {
5050
// Edit an existing form
@@ -78,7 +78,7 @@
7878
} else if (isset($_POST['delete_target'])) {
7979
Session::checkRight('entity', UPDATE);
8080
$form->deleteTarget($_POST);
81-
Html::redirect($CFG_GLPI['root_doc'] . '/plugins/formcreator/front/form.form.php?id=' . $_POST['plugin_formcreator_forms_id']);
81+
Html::redirect(FORMCREATOR_ROOTDOC . '/front/form.form.php?id=' . $_POST['plugin_formcreator_forms_id']);
8282

8383
} else if (isset($_POST['filetype_create'])) {
8484
$documentType = new DocumentType();

front/issue.form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
if (plugin_formcreator_replaceHelpdesk()) {
5858
PluginFormcreatorWizard::header(__('Service catalog', 'formcreator'));
5959
} else {
60-
Html::redirect($CFG_GLPI["root_doc"]."/front/helpdesk.public.php");
60+
Html::redirect($CFG_GLPI['root_doc']."/front/helpdesk.public.php");
6161
}
6262

6363
$issue->getFromDBByCrit([

front/question.form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@
4242

4343

4444
// Return to form list
45-
Html::redirect($CFG_GLPI['root_doc'] . '/plugins/formcreator/front/form.php');
45+
Html::redirect(FORMCREATOR_ROOTDOC . '/front/form.php');
4646

front/section.form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
} else {
5555
// Return to form list
56-
Html::redirect($CFG_GLPI['root_doc'] . '/plugins/formcreator/front/form.php');
56+
Html::redirect(FORMCREATOR_ROOTDOC . '/front/form.php');
5757
}
5858

5959
// Or display a "Not found" error

front/wizard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
}
4040

4141
if (! plugin_formcreator_replaceHelpdesk()) {
42-
Html::redirect($CFG_GLPI['root_doc'] . '/plugins/formcreator/front/formlist.php');
42+
Html::redirect(FORMCREATOR_ROOTDOC . '/front/formlist.php');
4343
}
4444

4545
PluginFormcreatorWizard::header(__('Service catalog', 'formcreator'));

front/wizardfeeds.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
}
4040

4141
if (! plugin_formcreator_replaceHelpdesk()) {
42-
Html::redirect($CFG_GLPI["root_doc"]."/front/helpdesk.public.php");
42+
Html::redirect($CFG_GLPI['root_doc']."/front/helpdesk.public.php");
4343
}
4444

4545
if (RSSFeed::canView()) {

inc/fields/descriptionfield.class.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@ public function isAnonymousFormCompatible() {
132132
}
133133

134134
public function getHtmlIcon() {
135-
global $CFG_GLPI;
136-
137-
return '<img src="' . $CFG_GLPI['root_doc'] . '/plugins/formcreator/pics/ui-description-field.png" title="" />';
135+
return '<img src="' . FORMCREATOR_ROOTDOC . '/pics/ui-description-field.png" title="" />';
138136
}
139137

140138
public function isVisibleField()

inc/fields/floatfield.class.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,7 @@ public function isAnonymousFormCompatible() {
278278
}
279279

280280
public function getHtmlIcon() {
281-
global $CFG_GLPI;
282-
283-
return '<img src="' . $CFG_GLPI['root_doc'] . '/plugins/formcreator/pics/ui-float-field.png" title="" />';
281+
return '<img src="' . FORMCREATOR_ROOTDOC . '/pics/ui-float-field.png" title="" />';
284282
}
285283

286284
public function isVisibleField()

inc/fields/glpiselectfield.class.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,6 @@ public function isAnonymousFormCompatible() {
183183
}
184184

185185
public function getHtmlIcon() {
186-
global $CFG_GLPI;
187-
188-
return '<img src="' . $CFG_GLPI['root_doc'] . '/plugins/formcreator/pics/ui-glpiselect-field.png" title="" />';
186+
return '<img src="' . FORMCREATOR_ROOTDOC . '/pics/ui-glpiselect-field.png" title="" />';
189187
}
190188
}

0 commit comments

Comments
 (0)