Skip to content

Commit a375f00

Browse files
committed
Fix uninstall
1 parent 373b0a4 commit a375f00

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

hook.php

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ function plugin_addressing_uninstall() {
149149
$migration = new Migration("2.5.0");
150150
$tables = ["glpi_plugin_addressing_addressings",
151151
"glpi_plugin_addressing_configs",
152-
"glpi_plugin_addressing_filters"];
152+
"glpi_plugin_addressing_filters",
153+
"glpi_plugin_addressing_pinginfos"];
153154

154155
foreach ($tables as $table) {
155156
$migration->dropTable($table);
@@ -187,10 +188,10 @@ function plugin_addressing_getDatabaseRelations() {
187188
$plugin = new Plugin();
188189

189190
if ($plugin->isActivated("addressing")) {
190-
return ["glpi_networks" => ["glpi_plugin_addressing_addressings" => "networks_id"],
191-
"glpi_fqdns" => ["glpi_plugin_addressing_addressings" => "fqdns_id"],
192-
"glpi_locations" => ["glpi_plugin_addressing_addressings" => "locations_id"],
193-
"glpi_entities" => ["glpi_plugin_addressing_addressings" => "entities_id"]];
191+
return ["glpi_networks" => ["glpi_plugin_addressing_addressings" => "networks_id"],
192+
"glpi_fqdns" => ["glpi_plugin_addressing_addressings" => "fqdns_id"],
193+
"glpi_locations" => ["glpi_plugin_addressing_addressings" => "locations_id"],
194+
"glpi_entities" => ["glpi_plugin_addressing_addressings" => "entities_id"]];
194195
}
195196
return [];
196197
}
@@ -200,21 +201,20 @@ function plugin_addressing_getDatabaseRelations() {
200201
*
201202
* @return array
202203
*/
203-
function plugin_addressing_getAddSearchOptions($itemtype)
204-
{
204+
function plugin_addressing_getAddSearchOptions($itemtype) {
205205

206206
$sopt = [];
207207

208208
if (in_array($itemtype, PluginAddressingAddressing::getTypes(true))) {
209209
if (Session::haveRight("plugin_addressing", READ)) {
210-
$sopt[5000]['table'] = 'glpi_plugin_addressing_pinginfos';
211-
$sopt[5000]['field'] = 'ping_response';
212-
$sopt[5000]['name'] = __('Ping result', 'addressing');
213-
$sopt[5000]['forcegroupby'] = true;
214-
$sopt[5000]['linkfield'] = 'id';
210+
$sopt[5000]['table'] = 'glpi_plugin_addressing_pinginfos';
211+
$sopt[5000]['field'] = 'ping_response';
212+
$sopt[5000]['name'] = __('Ping result', 'addressing');
213+
$sopt[5000]['forcegroupby'] = true;
214+
$sopt[5000]['linkfield'] = 'id';
215215
$sopt[5000]['massiveaction'] = false;
216-
$sopt[5000]['joinparams'] = ['beforejoin' => ['table' => 'glpi_plugin_addressing_pinginfos',
217-
'joinparams' => ['jointype' => 'itemtype_item']]];
216+
$sopt[5000]['joinparams'] = ['beforejoin' => ['table' => 'glpi_plugin_addressing_pinginfos',
217+
'joinparams' => ['jointype' => 'itemtype_item']]];
218218
}
219219
}
220220
return $sopt;
@@ -236,20 +236,20 @@ function plugin_addressing_giveItem($type, $ID, $data, $num) {
236236
$searchopt =& Search::getOptions($type);
237237
$table = $searchopt[$ID]["table"];
238238
$field = $searchopt[$ID]["field"];
239-
$out = "";
239+
$out = "";
240240
if (in_array($type, PluginAddressingAddressing::getTypes(true))) {
241-
switch ($table . '.' . $field) {
242-
case "glpi_plugin_addressing_pinginfos.ping_response" :
243-
if ($data[$num][0]['name'] == "1") {
244-
$out .= "<i class=\"fas fa-check-square fa-2x\" style='color: darkgreen'></i><br>".__('Last ping OK', 'addressing');
245-
} elseif ($data[$num][0]['name'] == "0") {
246-
$out .= "<i class=\"fas fa-window-close fa-2x\" style='color: darkred'></i><br>".__('Last ping KO', 'addressing');
247-
} else {
248-
$out .= "<i class=\"fas fa-question fa-2x\" style='color: orange'></i><br>".__("Ping informations not available", 'addressing');
249-
}
250-
return $out;
251-
break;
252-
}
241+
switch ($table . '.' . $field) {
242+
case "glpi_plugin_addressing_pinginfos.ping_response" :
243+
if ($data[$num][0]['name'] == "1") {
244+
$out .= "<i class=\"fas fa-check-square fa-2x\" style='color: darkgreen'></i><br>" . __('Last ping OK', 'addressing');
245+
} elseif ($data[$num][0]['name'] == "0") {
246+
$out .= "<i class=\"fas fa-window-close fa-2x\" style='color: darkred'></i><br>" . __('Last ping KO', 'addressing');
247+
} else {
248+
$out .= "<i class=\"fas fa-question fa-2x\" style='color: orange'></i><br>" . __("Ping informations not available", 'addressing');
249+
}
250+
return $out;
251+
break;
252+
}
253253
}
254254
return "";
255255
}

0 commit comments

Comments
 (0)