From 0dc6f3ae68bd3e5648c9144258504529cba4f649 Mon Sep 17 00:00:00 2001 From: Alexandre Delaunay Date: Tue, 26 Jan 2016 09:11:39 +0100 Subject: [PATCH] change status from taks/fup (missing edition), fix #366, see #247 --- inc/commonitiltask.class.php | 14 ++++++++++++++ inc/ticketfollowup.class.php | 15 +++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/inc/commonitiltask.class.php b/inc/commonitiltask.class.php index 130cb1e9997..654599c720c 100644 --- a/inc/commonitiltask.class.php +++ b/inc/commonitiltask.class.php @@ -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) diff --git a/inc/ticketfollowup.class.php b/inc/ticketfollowup.class.php index de8f287d5b3..abe08d4236c 100644 --- a/inc/ticketfollowup.class.php +++ b/inc/ticketfollowup.class.php @@ -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] = '';