function post_updateItem($history = 1) { global $CFG_GLPI; $job = new Ticket(); $donotif = $CFG_GLPI["use_mailing"]; if (isset($this->input['_disablenotif'])) { $donotif = false; } if ($job->getFromDB($this->fields["tickets_id"])) { if (count($this->updates) && $donotif) { $options = array('validation_id' => $this->fields["id"], 'validation_status' => $this->fields["status"]); NotificationEvent::raiseEvent('validation_answer', $job, $options); } // Set global validation to accepted to define one if ($job->fields['global_validation'] == 'waiting' || self::getNumberValidationForTicket($this->fields["tickets_id"]) == 1 || self::isAllValidationsHaveSameStatusForTicket($this->fields["tickets_id"])) { $input['id'] = $this->fields["tickets_id"]; $input['global_validation'] = $this->fields["status"]; $job->update($input); } } parent::post_updateItem($history); }
function post_updateItem($history = 1) { global $DB; if (count($this->updates)) { // Update Ticket Tco if (in_array("itemtype", $this->updates) || in_array("items_id", $this->updates)) { $ip = new IPAddress(); // Update IPAddress foreach ($DB->request('glpi_networknames', array('itemtype' => 'NetworkPort', 'items_id' => $this->getID())) as $dataname) { foreach ($DB->request('glpi_ipaddresses', array('itemtype' => 'NetworkName', 'items_id' => $dataname['id'])) as $data) { $ip->update(array('id' => $data['id'], 'mainitemtype' => $this->fields['itemtype'], 'mainitems_id' => $this->fields['items_id'])); } } } } parent::post_updateItem($history); }
/** * @see CommonDBTM::post_updateItem() **/ function post_updateItem($history = 1) { if (isset($this->oldvalues['name']) || isset($this->oldvalues['entities_id'])) { $link = new IPAddress_IPNetwork(); $link->cleanDBonItemDelete($this->getType(), $this->getID()); $link->addIPAddress($this); } parent::post_updateItem($history); }
/** * @see CommonDBTM::post_updateItem() **/ function post_updateItem($history = 1) { global $CFG_GLPI; if (count($this->updates) && $CFG_GLPI["use_mailing"]) { NotificationEvent::raiseEvent("update", $this); //$mail = new MailingResa($this,"update"); //$mail->send(); } parent::post_updateItem($history); }
/** * @see CommonDBTM::post_updateItem() **/ function post_updateItem($history = 1) { $alert = new Alert(); $alert->clear($this->getType(), $this->fields['id'], Alert::ACTION); parent::post_updateItem($history); }
function post_updateItem($history = 1) { if (in_array('pages', $this->updates)) { $printer = new Printer(); if ($printer->getFromDB($this->fields['printers_id']) && ($this->fields['pages'] > $printer->getField('last_pages_counter') || $this->oldvalues['pages'] == $printer->getField('last_pages_counter'))) { $printer->update(array('id' => $printer->getID(), 'last_pages_counter' => $this->fields['pages'])); } } parent::post_updateItem($history); }
function post_updateItem($history = 1) { global $DB; // if default is set : unsed others for the users if (in_array('is_default', $this->updates) && $this->input["is_default"] == 1) { $query = "UPDATE " . $this->getTable() . "\n SET `is_default` = '0'\n WHERE `id` <> '" . $this->input['id'] . "'\n AND `users_id` = '" . $this->fields['users_id'] . "'"; $DB->query($query); } parent::post_updateItem($history); }
function post_updateItem($history = 1) { global $CFG_GLPI; $item = new static::$itemtype(); $donotif = $CFG_GLPI["use_mailing"]; if (isset($this->input['_disablenotif'])) { $donotif = false; } if ($item->getFromDB($this->fields[static::$items_id])) { if (count($this->updates) && $donotif) { $options = array('validation_id' => $this->fields["id"], 'validation_status' => $this->fields["status"]); NotificationEvent::raiseEvent('validation_answer', $item, $options); } //Set global validation to accepted to define one if ($item->fields['global_validation'] == self::WAITING && in_array("status", $this->updates)) { $input['id'] = $this->fields[static::$items_id]; $input['global_validation'] = self::computeValidationStatus($item); $item->update($input); } } parent::post_updateItem($history); }