Skip to content
Merged
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
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@
"friendsofphp/php-cs-fixer": "^3.70",
"glpi-project/tools": "^0.7.4",
"php-parallel-lint/php-parallel-lint": "^1.4",
"phpstan/phpstan": "^2.1"
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-deprecation-rules": "^2.0"
},
"config": {
"optimize-autoloader": true,
"platform": {
"php": "7.4.0"
},
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"phpstan/extension-installer": true
}
}
}
134 changes: 115 additions & 19 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions inc/container.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static function installBaseData(Migration $migration, $version)
PRIMARY KEY (`id`),
KEY `entities_id` (`entities_id`)
) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;";
$DB->query($query) or die($DB->error());
$DB->doQuery($query) or die($DB->error());
}

// multiple itemtype for one container
Expand Down Expand Up @@ -309,7 +309,7 @@ public static function installUserData(Migration $migration, $version)
}

//drop old table
$DB->query('DROP TABLE ' . $osdata::getTable());
$DB->doQuery('DROP TABLE ' . $osdata::getTable());
} else {
$DB->update(
'glpi_plugin_fields_containers',
Expand Down Expand Up @@ -372,7 +372,7 @@ public static function uninstall()
}

//drop global container table
$DB->query('DROP TABLE IF EXISTS `' . self::getTable() . '`');
$DB->doQuery('DROP TABLE IF EXISTS `' . self::getTable() . '`');

//delete display preferences for this item
$pref = new DisplayPreference();
Expand Down Expand Up @@ -740,7 +740,7 @@ public function pre_deleteItem()
} else {
//class does not exists; try to remove any existing table
$tablename = getTableForItemType($classname);
$DB->query("DROP TABLE IF EXISTS `$tablename`");
$DB->doQuery("DROP TABLE IF EXISTS `$tablename`");
}

//clean session
Expand Down
4 changes: 2 additions & 2 deletions inc/containerdisplaycondition.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static function installBaseData(Migration $migration, $version)
PRIMARY KEY (`id`),
KEY `plugin_fields_containers_id_itemtype` (`plugin_fields_containers_id`, `itemtype`)
) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;";
$DB->query($query) or die($DB->error());
$DB->doQuery($query) or die($DB->error());
}

return true;
Expand Down Expand Up @@ -145,7 +145,7 @@ public static function uninstall()
{
/** @var DBmysql $DB */
global $DB;
$DB->query('DROP TABLE IF EXISTS `' . self::getTable() . '`');
$DB->doQuery('DROP TABLE IF EXISTS `' . self::getTable() . '`');

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions inc/field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static function installBaseData(Migration $migration, $version)
KEY `is_active` (`is_active`),
KEY `is_readonly` (`is_readonly`)
) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;";
$DB->query($query) or die($DB->error());
$DB->doQuery($query) or die($DB->error());
}

$migration->displayMessage("Updating $table");
Expand Down Expand Up @@ -233,7 +233,7 @@ public static function uninstall()
/** @var DBmysql $DB */
global $DB;

$DB->query('DROP TABLE IF EXISTS `' . self::getTable() . '`');
$DB->doQuery('DROP TABLE IF EXISTS `' . self::getTable() . '`');

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions inc/labeltranslation.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static function installBaseData(Migration $migration, $version)
KEY `language` (`language`),
UNIQUE KEY `unicity` (`itemtype`, `items_id`, `language`)
) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;";
$DB->query($query) or die($DB->error());
$DB->doQuery($query) or die($DB->error());
}

if ($DB->fieldExists($table, 'plugin_fields_itemtype')) {
Expand All @@ -94,7 +94,7 @@ public static function uninstall()
/** @var DBmysql $DB */
global $DB;

$DB->query('DROP TABLE IF EXISTS `' . self::getTable() . '`');
$DB->doQuery('DROP TABLE IF EXISTS `' . self::getTable() . '`');

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions inc/profile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static function installBaseData(Migration $migration, $version)
KEY `profiles_id` (`profiles_id`),
KEY `plugin_fields_containers_id` (`plugin_fields_containers_id`)
) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;";
$DB->query($query) or die($DB->error());
$DB->doQuery($query) or die($DB->error());
}

return true;
Expand All @@ -79,7 +79,7 @@ public static function uninstall()
/** @var DBmysql $DB */
global $DB;

$DB->query('DROP TABLE IF EXISTS `' . self::getTable() . '`');
$DB->doQuery('DROP TABLE IF EXISTS `' . self::getTable() . '`');

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions inc/statusoverride.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static function installBaseData(Migration $migration, $version)
PRIMARY KEY (`id`),
KEY `plugin_fields_fields_id` (`plugin_fields_fields_id`)
) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;";
$DB->query($query) or die($DB->error());
$DB->doQuery($query) or die($DB->error());
}

return true;
Expand All @@ -80,7 +80,7 @@ public static function uninstall()
/** @var DBmysql $DB */
global $DB;

$DB->query('DROP TABLE IF EXISTS `' . self::getTable() . '`');
$DB->doQuery('DROP TABLE IF EXISTS `' . self::getTable() . '`');

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
define('PLUGIN_FIELDS_VERSION', '1.21.19');

// Minimal GLPI version, inclusive
define('PLUGIN_FIELDS_MIN_GLPI', '10.0.0');
define('PLUGIN_FIELDS_MIN_GLPI', '10.0.11');
// Maximum GLPI version, exclusive
define('PLUGIN_FIELDS_MAX_GLPI', '10.0.99');

Expand Down