From 56786413c617da70ecb41898048a63a3deb5dfcb Mon Sep 17 00:00:00 2001 From: Kaya84 <35736369+Kaya84@users.noreply.github.com> Date: Fri, 4 Oct 2019 09:27:17 +0200 Subject: [PATCH 1/4] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) 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 ----------------------- From 7afc48f3ebbdba813cabaf92c09381331def0070 Mon Sep 17 00:00:00 2001 From: Kaya84 <35736369+Kaya84@users.noreply.github.com> Date: Fri, 4 Oct 2019 09:28:18 +0200 Subject: [PATCH 2/4] Update simcard.form.php Fix for event logging --- front/simcard.form.php | 1 + 1 file changed, 1 insertion(+) 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'); From cd545ec57fb569165f46be25bb7a676938f157ea Mon Sep 17 00:00:00 2001 From: Kaya84 <35736369+Kaya84@users.noreply.github.com> Date: Fri, 4 Oct 2019 09:29:41 +0200 Subject: [PATCH 3/4] Update hook.php Fixed DB calling for table exist --- hook.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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(); From d22d9b96d45b611cd7c14dd69cb76ce629784802 Mon Sep 17 00:00:00 2001 From: Kaya84 <35736369+Kaya84@users.noreply.github.com> Date: Fri, 4 Oct 2019 09:32:34 +0200 Subject: [PATCH 4/4] Update simcardtype.class.php --- inc/simcardtype.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/simcardtype.class.php b/inc/simcardtype.class.php index 7cc9e21..8e65ce6 100644 --- a/inc/simcardtype.class.php +++ b/inc/simcardtype.class.php @@ -45,7 +45,7 @@ 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, `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,