TicketFollowup::post_updateItem PHP Method

post_updateItem() public method

public post_updateItem ( $history = 1 )
    function post_updateItem($history = 1)
    {
        global $CFG_GLPI;
        $job = new Ticket();
        $mailsend = false;
        if ($job->getFromDB($this->fields["tickets_id"])) {
            $job->updateDateMod($this->fields["tickets_id"]);
            if (count($this->updates)) {
                if ($CFG_GLPI["use_mailing"] && (in_array("content", $this->updates) || isset($this->input['_need_send_mail']))) {
                    $options = array('followup_id' => $this->fields["id"], 'is_private' => $this->fields['is_private']);
                    NotificationEvent::raiseEvent("update_followup", $job, $options);
                }
            }
            // change ticket status (from splitted button)
            $this->input['_job'] = new Ticket();
            if (!$this->input['_job']->getFromDB($this->input["tickets_id"])) {
                return false;
            }
            if (isset($this->input['_status']) && $this->input['_status'] != $this->input['_job']->fields['status']) {
                $update['status'] = $this->input['_status'];
                $update['id'] = $this->input['_job']->fields['id'];
                $update['_disablenotif'] = true;
                $this->input['_job']->update($update);
            }
            // Add log entry in the ticket
            $changes[0] = 0;
            $changes[1] = '';
            $changes[2] = $this->fields['id'];
            Log::history($this->getField('tickets_id'), 'Ticket', $changes, $this->getType(), Log::HISTORY_UPDATE_SUBITEM);
        }
    }