The Best Web Host!!

osTicket Tips – Keep tickets assigned when closing


-When closing a ticket already assigned to an id_staff you may need to update the ticket with no change id_staff
-When close a ticket unassigned update the ticket assigning it to the id_staff who closed the ticket

MAKE SURE YOUR BACK UP FIRST!!! No WARRANTY ( but worked for me)
\include\class.ticket.php under the “function close ()”

function close(){

if(‘$staff_id’ > 0) {

// $sql= ‘UPDATE ‘.TICKET_TABLE.’ SET status=’.db_input(‘closed’).’,staff_id=0,isoverdue =0,duedate=NULL,updated=NOW(),closed=NOW() ‘.
$sql= ‘UPDATE ‘.TICKET_TABLE.’ SET status=’.db_input(‘closed’).’,isoverdue=0,duedate= NULL,updated=NOW(),closed=NOW() ‘.
‘ WHERE ticket_id=’.db_input($this->getId());
} else {
global $thisuser;
$sql= ‘UPDATE ‘.TICKET_TABLE.’ SET status=’.db_input(‘closed’).’,staff_id=’.db_input( $thisuser->getId()).’,isoverdue=0,duedate=NULL,updated=NOW(), closed=NOW() ‘.
‘ WHERE ticket_id=’.db_input($this->getId());

return (db_query($sql) && db_affected_rows())?true:false;