diff --git a/include/class.thread.php b/include/class.thread.php index eb02999f4161070eb369d97fd6f360dccfe4ac01..7572ffdd59047d5bf993aa900627f1f211d28941 100644 --- a/include/class.thread.php +++ b/include/class.thread.php @@ -1522,6 +1522,8 @@ class ThreadEvent extends VerySimpleModel { 'overdue' => 'time', 'transferred' => 'share-alt', 'edited' => 'pencil', + 'closed' => 'thumbs-up-alt', + 'reopened' => 'rotate-right', ); return @$icons[$this->state] ?: 'chevron-sign-right'; } diff --git a/include/class.ticket.php b/include/class.ticket.php index a9b2b0078a2865cc63c0d365ee046bae0758bdbc..ff6c549e4dc5a3a8956cbd453e182a5c6285a7aa 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -1028,8 +1028,6 @@ implements RestrictedAccess, Threadable { if ($this->getStatusId() == $status->getId()) return true; - $this->status = $status; - //TODO: move this up. $ecb = null; switch($status->getState()) { @@ -1069,6 +1067,7 @@ implements RestrictedAccess, Threadable { } + $this->status = $status; if (!$this->save()) return false; @@ -1076,17 +1075,11 @@ implements RestrictedAccess, Threadable { // ticket, the ticket is opened and thereafter the status is set to // the requested status). if ($current_status = $this->getStatus()) { - $note = sprintf(__('Status changed from %1$s to %2$s by %3$s'), - $this->getStatus(), - $status, - $thisstaff ?: 'SYSTEM'); - $alert = false; if ($comments) { - $note .= sprintf('<hr>%s', $comments); // Send out alerts if comments are included $alert = true; - $this->logNote(__('Status Changed'), $note, $thisstaff, $alert); + $this->logNote(__('Status Changed'), $comments, $thisstaff, $alert); } } // Log events via callback @@ -1140,7 +1133,7 @@ implements RestrictedAccess, Threadable { if (!($status=$this->getStatus()->getReopenStatus())) $status = $cfg->getDefaultTicketStatusId(); - return $status ? $this->setStatus($status, 'Reopened') : false; + return $status ? $this->setStatus($status) : false; } function onNewTicket($message, $autorespond=true, $alertstaff=true) { @@ -2381,8 +2374,7 @@ implements RestrictedAccess, Threadable { if ($vars['note_status_id'] && ($status=TicketStatus::lookup($vars['note_status_id'])) ) { - if ($this->setStatus($status)) - $this->reload(); + $this->setStatus($status); } $activity = $vars['activity'] ?: _S('New Internal Note'); @@ -3294,8 +3286,6 @@ implements RestrictedAccess, Threadable { $ticket->logNote(_S('New Ticket'), $vars['note'], $thisstaff, false); } - $ticket->reload(); - if (!$cfg->notifyONNewStaffTicket() || !isset($vars['alertuser']) || !($dept=$ticket->getDept()) diff --git a/scp/tickets.php b/scp/tickets.php index 9e244bcc61115fb39e9817c0f6283ecea41bf438..3f1882217e412bffdb6f770d3bccd7e05cc5a5f8 100644 --- a/scp/tickets.php +++ b/scp/tickets.php @@ -358,8 +358,6 @@ if($_POST && !$errors): default: $errors['err']=__('Unknown action'); endswitch; - if($ticket && is_object($ticket)) - $ticket->reload();//Reload ticket info following post processing }elseif($_POST['a']) { switch($_POST['a']) { diff --git a/tickets.php b/tickets.php index 875fdfec40dc2d4770e4891c8a5cd76832c3a5d7..070cb2567b350d42b3b7af1bbed54e543769b4ef 100644 --- a/tickets.php +++ b/tickets.php @@ -103,7 +103,6 @@ if ($_POST && is_object($ticket) && $ticket->getId()) { default: $errors['err']=__('Unknown action'); } - $ticket->reload(); } elseif (is_object($ticket) && $ticket->getId()) { switch(strtolower($_REQUEST['a'])) {