diff --git a/README.md b/README.md index 281eb40..fde1eda 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,13 @@ Simcard management for GLPI * Updated by Anthony Piesset and Dethegeek for GLPi 0.84 * Updated by Thierry Bugier Pineau for GLPi 0.85 and 0.90 +Integration in GLPI 9.4 +----------------------- + +Beside what they wrote, the way that GLPI handle SIM Card in core modules is really awful. +Plugin is a lot better for Sim Card Management. + + Integration in GLPI 9.2 ----------------------- diff --git a/front/simcard.form.php b/front/simcard.form.php index 49a857a..5c716ab 100644 --- a/front/simcard.form.php +++ b/front/simcard.form.php @@ -27,6 +27,7 @@ @link http://www.glpi-project.org/ @since 2009 ---------------------------------------------------------------------- */ +use Glpi\Event; include ('../../../inc/includes.php'); diff --git a/hook.php b/hook.php index 28a8587..3662f1c 100644 --- a/hook.php +++ b/hook.php @@ -40,20 +40,20 @@ * @return number */ function plugin_simcard_currentVersion() { - + global $DB; // Saves the current version to not re-detect it on multiple calls static $currentVersion = null; if ($currentVersion === null) { // result not cached if ( - !TableExists('glpi_plugin_simcard_simcards_items') && - !TableExists('glpi_plugin_simcard_configs') + !$DB->tableExists('glpi_plugin_simcard_simcards_items') && + !$DB->tableExists('glpi_plugin_simcard_configs') ) { // the plugin seems not installed $currentVersion = 0; } else { - if (TableExists('glpi_plugin_simcard_configs')) { + if ($DB->tTableExists('glpi_plugin_simcard_configs')) { // The plugin is at least 1.3 // Get the current version in the plugin's configuration $pluginSimcardConfig = new PluginSimcardConfig(); diff --git a/inc/simcard_item.class.php b/inc/simcard_item.class.php index 2f414a8..d9c31dd 100644 --- a/inc/simcard_item.class.php +++ b/inc/simcard_item.class.php @@ -135,7 +135,7 @@ static function registerItemtype($itemtype) { static function install(Migration $migration) { global $DB; $table = getTableForItemType(__CLASS__); - if (!TableExists($table)) { + if (!$DB->tableExists($table)) { $query = "CREATE TABLE IF NOT EXISTS `$table` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to various table, according to itemtype (id)',