From 629554e1244a2336b44caa3fa629a0b87f9b851f Mon Sep 17 00:00:00 2001 From: Peter Rotich <peter@osticket.com> Date: Mon, 8 Oct 2012 10:58:50 -0400 Subject: [PATCH] Give credit to the closing staff - if any. Log close event post closing & reload. --- include/class.ticket.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/class.ticket.php b/include/class.ticket.php index 9f8ce96d5..6133f29ff 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -794,15 +794,19 @@ class Ticket { function close(){ global $thisstaff; - $sql='UPDATE '.TICKET_TABLE.' SET closed=NOW(), isoverdue=0, duedate=NULL, updated=NOW(), status='.db_input('closed'); - + $sql='UPDATE '.TICKET_TABLE.' SET closed=NOW(),isoverdue=0, duedate=NULL, updated=NOW(), status='.db_input('closed'); if($thisstaff) //Give the closing staff credit. $sql.=', staff_id='.db_input($thisstaff->getId()); $sql.=' WHERE ticket_id='.db_input($this->getId()); + if(!db_query($sql) || !db_affected_rows()) + return false; + + $this->reload(); $this->logEvent('closed'); - return (db_query($sql) && db_affected_rows()); + + return true; } //set status to open on a closed ticket. -- GitLab