Example #1
0
function plugin_simcard_install()
{
    include_once GLPI_ROOT . "/plugins/simcard/inc/profile.class.php";
    include_once GLPI_ROOT . "/plugins/simcard/inc/simcard.class.php";
    include_once GLPI_ROOT . "/plugins/simcard/inc/simcardsize.class.php";
    include_once GLPI_ROOT . "/plugins/simcard/inc/simcardvoltage.class.php";
    include_once GLPI_ROOT . "/plugins/simcard/inc/simcardtype.class.php";
    include_once GLPI_ROOT . "/plugins/simcard/inc/phoneoperator.class.php";
    include_once GLPI_ROOT . "/plugins/simcard/inc/simcard_item.class.php";
    include_once GLPI_ROOT . "/plugins/simcard/inc/config.class.php";
    $migration = new Migration(PLUGIN_SIMCARD_VERSION);
    if (plugin_simcard_currentVersion() == 0) {
        // Installation of the plugin
        PluginSimcardConfig::install($migration);
        PluginSimcardProfile::install($migration);
        PluginSimcardSimcard::install($migration);
        PluginSimcardSimcardSize::install($migration);
        PluginSimcardSimcardVoltage::install($migration);
        PluginSimcardSimcardType::install($migration);
        PluginSimcardPhoneOperator::install($migration);
        PluginSimcardSimcard_Item::install($migration);
    } else {
        PluginSimcardConfig::upgrade($migration);
        PluginSimcardProfile::upgrade($migration);
        PluginSimcardSimcard::upgrade($migration);
        PluginSimcardSimcardSize::upgrade($migration);
        PluginSimcardSimcardVoltage::upgrade($migration);
        PluginSimcardSimcardType::upgrade($migration);
        PluginSimcardPhoneOperator::upgrade($migration);
        PluginSimcardSimcard_Item::upgrade($migration);
    }
    return true;
}