本文整理汇总了PHP中CommonDBChild::post_updateItem方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonDBChild::post_updateItem方法的具体用法?PHP CommonDBChild::post_updateItem怎么用?PHP CommonDBChild::post_updateItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonDBChild
的用法示例。
在下文中一共展示了CommonDBChild::post_updateItem方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Ticket
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);
}
示例2: IPAddress
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);
}
示例3:
/**
* @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);
}
示例4:
/**
* @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);
}
示例5: Alert
/**
* @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);
}
示例6: Printer
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);
}
示例7:
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);
}
示例8: array
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);
}