Ejemplo n.º 1
0
function plugin_simcard_uninstall()
{
    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";
    PluginSimcardProfile::uninstall();
    PluginSimcardSimcard::uninstall();
    PluginSimcardSimcardSize::uninstall();
    PluginSimcardSimcardVoltage::uninstall();
    PluginSimcardSimcardType::uninstall();
    PluginSimcardPhoneOperator::uninstall();
    PluginSimcardSimcard_Item::uninstall();
    PluginSimcardConfig::uninstall();
    return true;
}
Ejemplo n.º 2
0
 /**
  * @since version 0.85
  *
  * @see CommonDBTM::processMassiveActionsForOneItemtype()
  * */
 static function processMassiveActionsForOneItemtype(MassiveAction $ma, CommonDBTM $item, array $ids)
 {
     global $DB;
     switch ($ma->getAction()) {
         case "transfer":
             $input = $ma->getInput();
             if ($item->getType() == 'PluginSimcardSimcard') {
                 foreach ($ids as $key) {
                     // Types
                     $item->getFromDB($key);
                     $type = PluginSimcardSimcardType::transfer($item->fields["plugin_simcard_simcardtypes_id"], $input['entities_id']);
                     if ($type > 0) {
                         $values["id"] = $key;
                         $values["plugin_simcard_simcardtypes_id"] = $type;
                         $item->update($values);
                     }
                     // Size
                     $size = PluginSimcardSimcardSize::transfer($item->fields["plugin_simcard_simcardsizes_id"], $input['entities_id']);
                     if ($size > 0) {
                         $values["id"] = $key;
                         $values["plugin_simcard_simcardsizes_id"] = $size;
                         $item->update($values);
                     }
                     // Voltage
                     $voltage = PluginSimcardSimcardVoltage::transfer($item->fields["plugin_simcard_simcardvoltages_id"], $input['entities_id']);
                     if ($voltage > 0) {
                         $values["id"] = $key;
                         $values["plugin_simcard_simcardvoltages_id"] = $voltage;
                         $item->update($values);
                     }
                     // Phoneoperator
                     $phoneoperator = PluginSimcardPhoneOperator::transfer($item->fields["plugin_simcard_phoneoperators_id"], $input['entities_id']);
                     if ($phoneoperator > 0) {
                         $values["id"] = $key;
                         $values["plugin_simcard_phoneoperators_id"] = $phoneoperator;
                         $item->update($values);
                     }
                     unset($values);
                     $values["id"] = $key;
                     $values["entities_id"] = $input['entities_id'];
                     if ($item->update($values)) {
                         $ma->itemDone($item->getType(), $key, MassiveAction::ACTION_OK);
                     } else {
                         $ma->itemDone($item->getType(), $key, MassiveAction::ACTION_KO);
                     }
                 }
             }
             return;
     }
     parent::processMassiveActionsForOneItemtype($ma, $item, $ids);
 }