Skip to content

Commit

Permalink
change status from taks/fup (missing edition), fix #366, see #247
Browse files Browse the repository at this point in the history
  • Loading branch information
orthagh committed Jan 26, 2016
1 parent 9d10dbb commit 0dc6f3a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
14 changes: 14 additions & 0 deletions inc/commonitiltask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,20 @@ function post_updateItem($history=1) {
$item->updateActionTime($this->input[$item->getForeignKeyField()]);
}

// change ticket status (from splitted button)
$itemtype = $this->getItilObjectItemType();
$this->input['_job'] = new $itemtype();
if (!$this->input['_job']->getFromDB($this->input[$this->input['_job']->getForeignKeyField()])) {
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);
}

if (!empty($this->fields['begin'])
&& $item->isStatusExists(CommonITILObject::PLANNED)
&& (($item->fields["status"] == CommonITILObject::INCOMING)
Expand Down
15 changes: 15 additions & 0 deletions inc/ticketfollowup.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,21 @@ function post_updateItem($history=1) {
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] = '';
Expand Down

0 comments on commit 0dc6f3a

Please sign in to comment.