Skip to content

Commit 3acad96

Browse files
committed
feat(installer): update installer for release"
Signed-off-by: btry <tbugier@teclib.com>
1 parent 65326b8 commit 3acad96

File tree

2 files changed

+41
-83
lines changed

2 files changed

+41
-83
lines changed

install/update_2.6.2_2.6.3.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
function plugin_formcreator_update_2_6_3() {
3737
global $DB;
3838

39+
// Change id of search option for status of form_answer
40+
$table = 'glpi_displaypreferences';
41+
$query = "UPDATE `$table` SET `num`='8' WHERE `itemtype`='PluginFormcreatorForm_Answer' AND `num`='1'";
42+
$DB->query($query);
43+
3944
// Remove abusive encding in sections
4045
$table = 'glpi_plugin_formcreator_sections';
4146
$request = [
@@ -47,4 +52,40 @@ function plugin_formcreator_update_2_6_3() {
4752
$id = $row['id'];
4853
$DB->query("UPDATE `$table` SET `name`='$name' WHERE `id` = '$id'");
4954
}
55+
56+
// Remove abusive encoding in targets
57+
$table = 'glpi_plugin_formcreator_targets';
58+
$request = [
59+
'FROM' => $table,
60+
];
61+
foreach ($DB->request($request) as $row) {
62+
$id = $row['id'];
63+
$name = Toolbox::addslashes_deep(html_entity_decode($row['name'], ENT_QUOTES|ENT_HTML5));
64+
$id = $row['id'];
65+
$DB->query("UPDATE `$table` SET `name`='$name' WHERE `id` = '$id'");
66+
}
67+
68+
// Remove abusive encding in target tickets
69+
$table = 'glpi_plugin_formcreator_targettickets';
70+
$request = [
71+
'FROM' => $table,
72+
];
73+
foreach ($DB->request($request) as $row) {
74+
$id = $row['id'];
75+
$name = Toolbox::addslashes_deep(html_entity_decode($row['name'], ENT_QUOTES|ENT_HTML5));
76+
$id = $row['id'];
77+
$DB->query("UPDATE `$table` SET `name`='$name' WHERE `id` = '$id'");
78+
}
79+
80+
// Remove abusive encding in target changes
81+
$table = 'glpi_plugin_formcreator_targetchanges';
82+
$request = [
83+
'FROM' => $table,
84+
];
85+
foreach ($DB->request($request) as $row) {
86+
$id = $row['id'];
87+
$name = Toolbox::addslashes_deep(html_entity_decode($row['name'], ENT_QUOTES|ENT_HTML5));
88+
$id = $row['id'];
89+
$DB->query("UPDATE `$table` SET `name`='$name' WHERE `id` = '$id'");
90+
}
5091
}

install/update_dev.php

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)