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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note: I do not remember you opened any pull request on GLPI in order to get that fixed. Not sure you even open an issue explainning what could be improved.

Also note there have been development for the 9.5 on that point. Maybe you should this time early test those changes and contribute to get it better if needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My wrong. I pulled for merge but I didn't want this.
My point is that I need the way SIM plugin work, threating the items like a computer or device.
Actually, the SIM mode inside GLPI core (imho) need to be completly rewritten, cause, for example, the search mode (using global search for a number doesn't work).

So, if you want, u can delete my (wrong) pull request and we can work together for change the way GLPI threat SIM Card

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/simcard_item.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)',
Expand Down