function post_deleteFromDB()
 {
     global $CFG_GLPI;
     $donotif = $CFG_GLPI["use_mailing"];
     if (isset($this->input["_no_notif"]) && $this->input["_no_notif"]) {
         $donotif = false;
     }
     $t = new Ticket();
     if ($t->getFromDB($this->fields['tickets_id'])) {
         if ($t->fields["suppliers_id_assign"] == 0 && $t->countUsers(Ticket::ASSIGN) == 0 && $t->countGroups(Ticket::ASSIGN) == 0) {
             $t->update(array('id' => $this->fields['tickets_id'], 'status' => 'new'));
         } else {
             $t->updateDateMod($this->fields['tickets_id']);
             if ($donotif) {
                 NotificationEvent::raiseEvent("update", $t);
             }
         }
     }
     parent::post_deleteFromDB();
 }
예제 #2
0
 function post_deleteFromDB()
 {
     global $CFG_GLPI;
     $donotif = $CFG_GLPI["use_mailing"];
     //       if (isset($this->input["_no_notif"]) && $this->input["_no_notif"]) {
     //          $donotif = false;
     //       }
     $item = $this->getConnexityItem(static::$itemtype_1, static::getItilObjectForeignKey());
     if ($item instanceof CommonDBTM) {
         if ($item->countSuppliers(CommonITILActor::ASSIGN) == 0 && $item->countUsers(CommonITILActor::ASSIGN) == 0 && $item->countGroups(CommonITILActor::ASSIGN) == 0 && $item->fields['status'] != CommonITILObject::CLOSED && $item->fields['status'] != CommonITILObject::SOLVED) {
             $status = CommonITILObject::INCOMING;
             if (in_array($item->fields['status'], Change::getNewStatusArray())) {
                 $status = $item->fields['status'];
             }
             $item->update(array('id' => $this->fields[static::getItilObjectForeignKey()], 'status' => $status));
         } else {
             $item->updateDateMod($this->fields[static::getItilObjectForeignKey()]);
             if ($donotif) {
                 $options = array();
                 if (isset($this->fields['users_id'])) {
                     $options = array('_old_user' => $this->fields);
                 }
                 NotificationEvent::raiseEvent("update", $item, $options);
             }
         }
     }
     parent::post_deleteFromDB();
 }
예제 #3
0
 /**
  * @since version 0.84
  **/
 function post_deleteFromDB()
 {
     global $CFG_GLPI;
     $donotif = $CFG_GLPI["use_mailing"];
     //       if (isset($this->input["_no_notif"]) && $this->input["_no_notif"]) {
     //          $donotif = false;
     //       }
     if ($donotif) {
         $problem = new Problem();
         if ($problem->getFromDB($this->fields["problems_id"])) {
             $options = array();
             NotificationEvent::raiseEvent("delete", $problem, $options);
         }
     }
     parent::post_deleteFromDB();
 }
 function post_deleteFromDB()
 {
     SoftwareLicense::updateValidityIndicator($this->fields['softwarelicenses_id']);
     parent::post_deleteFromDB();
 }
예제 #5
0
 function post_deleteFromDB()
 {
     global $CFG_GLPI;
     $t = new Ticket();
     $t->updateDateMod($this->fields['tickets_id_1']);
     $t->updateDateMod($this->fields['tickets_id_2']);
     parent::post_deleteFromDB();
     $donotif = $CFG_GLPI["use_mailing"];
     if ($donotif) {
         $t->getFromDB($this->fields['tickets_id_1']);
         NotificationEvent::raiseEvent("update", $t);
         $t->getFromDB($this->fields['tickets_id_2']);
         NotificationEvent::raiseEvent("update", $t);
     }
 }
 function post_deleteFromDB()
 {
     $t = new Ticket();
     $t->updateDateMod($this->fields['tickets_id_1']);
     $t->updateDateMod($this->fields['tickets_id_2']);
     parent::post_deleteFromDB();
 }