本文整理汇总了PHP中CommonDBChild::post_addItem方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonDBChild::post_addItem方法的具体用法?PHP CommonDBChild::post_addItem怎么用?PHP CommonDBChild::post_addItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonDBChild
的用法示例。
在下文中一共展示了CommonDBChild::post_addItem方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Calendar
function post_addItem()
{
// Update calendar cache
$cal = new Calendar();
$cal->updateDurationCache($this->fields['calendars_id']);
parent::post_addItem();
}
示例2:
/**
* @see CommonDBTM::post_addItem()
**/
function post_addItem()
{
IPAddress_IPNetwork::addIPAddress($this);
parent::post_addItem();
}
示例3: Ticket
function post_addItem()
{
global $CFG_GLPI;
$job = new Ticket();
$mailsend = false;
if ($job->getFromDB($this->fields["tickets_id"])) {
// Set global validation to waiting
if ($job->fields['global_validation'] == 'accepted' || $job->fields['global_validation'] == 'none') {
$input['id'] = $this->fields["tickets_id"];
$input['global_validation'] = 'waiting';
// to fix lastupdater
if (isset($this->input['_auto_update'])) {
$input['_auto_update'] = $this->input['_auto_update'];
}
// to know update by rules
if (isset($this->input["_rule_process"])) {
$input['_rule_process'] = $this->input["_rule_process"];
}
// No update ticket notif on ticket add
if (isset($this->input["_ticket_add"])) {
$input['_disablenotif'] = true;
}
$job->update($input);
}
if ($CFG_GLPI["use_mailing"]) {
$options = array('validation_id' => $this->fields["id"], 'validation_status' => $this->fields["status"]);
$mailsend = NotificationEvent::raiseEvent('validation', $job, $options);
}
if ($mailsend) {
$user = new User();
$user->getFromDB($this->fields["users_id_validate"]);
$email = $user->getDefaultEmail();
if (!empty($email)) {
//TRANS: %s is the user name
Session::addMessageAfterRedirect(sprintf(__('Approval request send to %s'), $user->getName()));
} else {
Session::addMessageAfterRedirect(sprintf(__('The selected user (%s) has no valid email address. The request has been created, without email confirmation.'), $user->getName()), false, ERROR);
}
}
}
parent::post_addItem();
}
示例4:
function post_addItem()
{
global $CFG_GLPI;
if ($CFG_GLPI["use_mailing"]) {
NotificationEvent::raiseEvent("new", $this);
}
parent::post_addItem();
}
示例5:
/**
* @since version 0.84
*
* @see CommonDBChild::post_addItem()
**/
function post_addItem()
{
parent::post_addItem();
if (isset($this->input['rules_id']) && ($realrule = Rule::getRuleObjectByID($this->input['rules_id']))) {
$realrule->update(array('id' => $this->input['rules_id'], 'date_mod' => $_SESSION['glpi_currenttime']));
}
}
示例6:
function post_addItem()
{
Infocom::cloneItem('CartridgeItem', $this->fields["cartridgeitems_id"], $this->fields['id'], $this->getType());
parent::post_addItem();
}
示例7:
function post_addItem()
{
global $DB;
// if default is set : unset others for the users
if (isset($this->fields['is_default']) && $this->fields["is_default"] == 1) {
$query = "UPDATE " . $this->getTable() . "\n SET `is_default` = '0'\n WHERE `id` <> '" . $this->fields['id'] . "'\n AND `users_id` = '" . $this->fields['users_id'] . "'";
$DB->query($query);
}
parent::post_addItem();
}
示例8: array
function post_addItem()
{
global $CFG_GLPI;
$item = new static::$itemtype();
$mailsend = false;
if ($item->getFromDB($this->fields[static::$items_id])) {
// Set global validation to waiting
if ($item->fields['global_validation'] == self::ACCEPTED || $item->fields['global_validation'] == self::NONE) {
$input['id'] = $this->fields[static::$items_id];
$input['global_validation'] = self::WAITING;
// to fix lastupdater
if (isset($this->input['_auto_update'])) {
$input['_auto_update'] = $this->input['_auto_update'];
}
// to know update by rules
if (isset($this->input["_rule_process"])) {
$input['_rule_process'] = $this->input["_rule_process"];
}
// No update ticket notif on ticket add
if (isset($this->input["_ticket_add"])) {
$input['_disablenotif'] = true;
}
$item->update($input);
}
if ($CFG_GLPI["use_mailing"]) {
$options = array('validation_id' => $this->fields["id"], 'validation_status' => $this->fields["status"]);
$mailsend = NotificationEvent::raiseEvent('validation', $item, $options);
}
if ($mailsend) {
$user = new User();
$user->getFromDB($this->fields["users_id_validate"]);
$email = $user->getDefaultEmail();
if (!empty($email)) {
$message[] = sprintf(__('Approval request send to %s'), $user->getName());
} else {
$error[] = sprintf(__('The selected user (%s) has no valid email address. The request has been created, without email confirmation.'), $user->getName());
}
}
}
parent::post_addItem();
}