예제 #1
0
 /**
  * Actions done when a typo is deleted from the database
  *
  * @return nothing
  **/
 function cleanDBonPurge()
 {
     //Clean typology_item
     $temp1 = new PluginTypologyTypology_Item();
     $temp1->deleteByCriteria(array('plugin_typology_typologies_id' => $this->fields['id']));
     //Clean typologycriteria
     $temp2 = new PluginTypologyTypologyCriteria();
     $temp2->deleteByCriteria(array('plugin_typology_typologies_id' => $this->fields['id']));
     //Clean rule
     Rule::cleanForItemAction($this);
 }
예제 #2
0
 function cleanDBonPurge()
 {
     global $DB;
     $supplierjob = new Supplier_Ticket();
     $supplierjob->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $cs = new Contract_Supplier();
     $cs->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $cs = new Contact_Supplier();
     $cs->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     // Ticket rules use suppliers_id_assign
     Rule::cleanForItemAction($this, 'suppliers_id%');
 }
예제 #3
0
 function cleanDBonPurge()
 {
     global $DB;
     $supplierjob = new Supplier_Ticket();
     $supplierjob->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $ps = new Problem_Supplier();
     $ps->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $cs = new Change_Supplier();
     $cs->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $query1 = "DELETE\n                 FROM `glpi_projecttaskteams`\n                 WHERE `items_id` = '" . $this->fields['id'] . "'\n                       AND `itemtype` = '" . __CLASS__ . "'";
     $DB->query($query1);
     $query1 = "DELETE\n                 FROM `glpi_projectteams`\n                 WHERE `items_id` = '" . $this->fields['id'] . "'\n                       AND `itemtype` = '" . __CLASS__ . "'";
     $DB->query($query1);
     $cs = new Contract_Supplier();
     $cs->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $cs = new Contact_Supplier();
     $cs->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     // Ticket rules use suppliers_id_assign
     Rule::cleanForItemAction($this, 'suppliers_id%');
 }
예제 #4
0
 function cleanDBonPurge()
 {
     global $DB;
     $gu = new Group_User();
     $gu->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $gt = new Group_Ticket();
     $gt->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $gp = new Group_Problem();
     $gp->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $gki = new Group_KnowbaseItem();
     $gki->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $gr = new Group_Reminder();
     $gr->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     // Ticket rules use various _groups_id_*
     Rule::cleanForItemAction($this, '_groups_id%');
     Rule::cleanForItemCriteria($this, '_groups_id%');
     // GROUPS for RuleMailcollector
     Rule::cleanForItemCriteria($this, 'GROUPS');
     // Set no group to consumables
     $query = "UPDATE `glpi_consumables`\n                SET `items_id` = '0'\n                WHERE `items_id` = '" . $this->fields['id'] . "'\n                      AND `itemtype` = 'Group'";
     $DB->query($query);
 }
예제 #5
0
 function cleanDBonPurge()
 {
     global $DB;
     $query = "DELETE\n                FROM `glpi_profiles_users`\n                WHERE `users_id` = '" . $this->fields['id'] . "'";
     $DB->query($query);
     if ($this->fields['id'] > 0) {
         // Security
         $query = "DELETE\n                   FROM `glpi_displaypreferences`\n                   WHERE `users_id` = '" . $this->fields['id'] . "'";
         $DB->query($query);
         $query = "DELETE\n                   FROM `glpi_bookmarks_users`\n                   WHERE `users_id` = '" . $this->fields['id'] . "'";
         $DB->query($query);
     }
     // Delete own reminders
     $query = "DELETE\n                FROM `glpi_reminders`\n                WHERE `users_id` = '" . $this->fields['id'] . "'";
     $DB->query($query);
     // Delete private bookmark
     $query = "DELETE\n                FROM `glpi_bookmarks`\n                WHERE `users_id` = '" . $this->fields['id'] . "'\n                      AND `is_private` = '1'";
     $DB->query($query);
     // Set no user to public bookmark
     $query = "UPDATE `glpi_bookmarks`\n                SET `users_id` = '0'\n                WHERE `users_id` = '" . $this->fields['id'] . "'";
     $DB->query($query);
     // Set no user to consumables
     $query = "UPDATE `glpi_consumables`\n                SET `items_id` = '0'\n                WHERE `items_id` = '" . $this->fields['id'] . "'\n                      AND `itemtype` = 'User'";
     $DB->query($query);
     $gu = new Group_User();
     $gu->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $tu = new Ticket_User();
     $tu->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $pu = new Problem_User();
     $pu->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $kiu = new KnowbaseItem_User();
     $kiu->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $ru = new Reminder_User();
     $ru->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $ue = new UserEmail();
     $ue->deleteByCriteria(array('users_id' => $this->fields['id']));
     // Ticket rules use various _users_id_*
     Rule::cleanForItemAction($this, '_users_id%');
     Rule::cleanForItemCriteria($this, '_users_id%');
 }
예제 #6
0
 function cleanDBonPurge()
 {
     global $DB;
     $gpr = new ProfileRight();
     $gpr->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $gpu = new Profile_User();
     $gpu->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     Rule::cleanForItemAction($this);
     // PROFILES and UNIQUE_PROFILE in RuleMailcollector
     Rule::cleanForItemCriteria($this, 'PROFILES');
     Rule::cleanForItemCriteria($this, 'UNIQUE_PROFILE');
     $gki = new KnowbaseItem_Profile();
     $gki->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $gr = new Profile_Reminder();
     $gr->cleanDBonItemDelete($this->getType(), $this->fields['id']);
 }
예제 #7
0
 function cleanDBonPurge()
 {
     global $DB;
     // most use entities_id, RuleDictionnarySoftwareCollection use new_entities_id
     Rule::cleanForItemAction($this, '%entities_id');
     Rule::cleanForItemCriteria($this);
     $gki = new Entity_KnowbaseItem();
     $gki->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $gr = new Entity_Reminder();
     $gr->cleanDBonItemDelete($this->getType(), $this->fields['id']);
 }
 function cleanDBonPurge()
 {
     global $DB;
     // Clean sla_levels
     $query = "SELECT `id`\n                FROM `glpi_slalevels`\n                WHERE `slas_id` = '" . $this->fields['id'] . "'";
     if ($result = $DB->query($query)) {
         if ($DB->numrows($result) > 0) {
             $slalevel = new SlaLevel();
             while ($data = $DB->fetch_assoc($result)) {
                 $slalevel->delete($data);
             }
         }
     }
     // Update tickets : clean SLA
     $query = "SELECT `id`\n                FROM `glpi_tickets`\n                WHERE `slas_id` = '" . $this->fields['id'] . "'";
     if ($result = $DB->query($query)) {
         if ($DB->numrows($result) > 0) {
             $ticket = new Ticket();
             while ($data = $DB->fetch_assoc($result)) {
                 $ticket->deleteSLA($data['id']);
             }
         }
     }
     Rule::cleanForItemAction($this);
 }
예제 #9
0
 function cleanDBonPurge()
 {
     Rule::cleanForItemAction($this);
 }
예제 #10
0
 function cleanDBonPurge()
 {
     global $DB, $LANG;
     $query = "DELETE\n                FROM `glpi_entitydatas`\n                WHERE `entities_id` = '" . $this->fields['id'] . "'";
     $result = $DB->query($query);
     Rule::cleanForItemAction($this);
 }
예제 #11
0
 function cleanDBonPurge()
 {
     // Rules use manufacturer intread of manufacturers_id
     Rule::cleanForItemAction($this, 'manufacturer');
 }
예제 #12
0
 function cleanDBonPurge()
 {
     Rule::cleanForItemAction($this);
     Rule::cleanForItemCriteria($this, 'users_locations');
 }
예제 #13
0
 function cleanDBonPurge()
 {
     global $DB;
     $query = "DELETE\n                FROM `glpi_profiles_users`\n                WHERE `profiles_id` = '" . $this->fields['id'] . "'";
     $DB->query($query);
     Rule::cleanForItemAction($this);
     // PROFILES and UNIQUE_PROFILE in RuleMailcollector
     Rule::cleanForItemCriteria($this, 'PROFILES');
     Rule::cleanForItemCriteria($this, 'UNIQUE_PROFILE');
     $gki = new KnowbaseItem_Profile();
     $gki->cleanDBonItemDelete($this->getType(), $this->fields['id']);
     $gr = new Profile_Reminder();
     $gr->cleanDBonItemDelete($this->getType(), $this->fields['id']);
 }