Skip to content

Commit

Permalink
Remove migration dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Jun 3, 2022
1 parent 1991086 commit 2d91579
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 45 deletions.
2 changes: 0 additions & 2 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function plugin_fields_install() {
'PluginFieldsContainer_Field',
'PluginFieldsValue',
'PluginFieldsProfile',
'PluginFieldsMigration',
'PluginFieldsStatusOverride',
'PluginFieldsContainerDisplayCondition',
];
Expand Down Expand Up @@ -134,7 +133,6 @@ function plugin_fields_uninstall() {
'PluginFieldsField',
'PluginFieldsValue',
'PluginFieldsProfile',
'PluginFieldsMigration',
'PluginFieldsContainerDisplayCondition'
];

Expand Down
43 changes: 0 additions & 43 deletions inc/migration.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,53 +30,10 @@

class PluginFieldsMigration extends Migration {

function __construct($ver = "") {
parent::__construct($ver);
}

static function install(Migration $migration, $version) {
global $DB;

$fields_migration = new self;

if ($DB->tableExists("glpi_plugin_customfields_fields")) {
if (!$fields_migration->updateFromCustomfields()) {
return false;
}
}

return true;
}

static function uninstall() {
return true;
}

function updateFromCustomfields($glpi_version = "0.80") {
//TODO : REWRITE customfield update
return true;
}

function displayMessage($msg) {
Session::addMessageAfterRedirect($msg);
}

function migrateCustomfieldTypes($old_type) {
$types = [
'sectionhead' => 'header',
'general' => 'text',
'money' => 'text',
'note' => 'textarea',
'text' => 'textarea',
'number' => 'number',
'dropdown' => 'dropdown',
'yesno' => 'yesno',
'date' => 'date'
];

return $types[$old_type];
}

/**
* Return SQL fields corresponding to given additionnal field.
*
Expand Down

0 comments on commit 2d91579

Please sign in to comment.