Skip to content
This repository was archived by the owner on Jul 6, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------------------

Expand Down
1 change: 1 addition & 0 deletions front/simcard.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
@link http://www.glpi-project.org/
@since 2009
---------------------------------------------------------------------- */
use Glpi\Event;

include ('../../../inc/includes.php');

Expand Down
8 changes: 4 additions & 4 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion inc/simcardtype.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down