From c4bd8099df31bdb36d4b53d8bdc3bcc413a4aeec Mon Sep 17 00:00:00 2001 From: Peter Rotich <peter@osticket.com> Date: Sun, 2 Sep 2012 15:42:18 -0400 Subject: [PATCH] Add %staff and %team to base variables. Change %assigned to mean assignees (staff or/and team) --- include/ajax.content.php | 10 ++++++---- include/class.ticket.php | 11 +++++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/include/ajax.content.php b/include/ajax.content.php index e97e96a5c..7f2bf7d77 100644 --- a/include/ajax.content.php +++ b/include/ajax.content.php @@ -37,7 +37,7 @@ class ContentAjaxAPI extends AjaxController { function ticket_variables() { $content=' -<div style="width:600px;"> +<div style="width:680px;"> <h2>Ticket Variables</h2> Please note that non-base variables depends on the context of use. <br/> @@ -56,7 +56,9 @@ class ContentAjaxAPI extends AjaxController { <tr><td>%status</td><td>Status</td></tr> <tr><td>%priority</td><td>Priority</td></tr> <tr><td>%dept</td><td>Department</td></tr> - <tr><td>%assigned</td><td>Assigned staff or team (if any)</td></tr> + <tr><td>%staff</td><td>Assigned/closing staff</td></tr> + <tr><td>%team</td><td>Assigned/closing team</td></tr> + <tr><td>%assigned</td><td>Assigned staff and/or team</td></tr> <tr><td>%createdate</td><td>Date created</td></tr> <tr><td>%duedate</td><td>Due date</td></tr> <tr><td>%closedate</td><td>Date closed</td></tr> @@ -67,8 +69,8 @@ class ContentAjaxAPI extends AjaxController { <tr><td width="100">%message</td><td>Message (incoming)</td></tr> <tr><td>%response</td><td>Response (outgoing)</td></tr> <tr><td>%note</td><td>Internal/transfer note</td></tr> - <tr><td>%staff</td><td>Staff\'s name (alert/notices)</td></tr> - <tr><td>%assignee</td><td>Assigned staff</td></tr> + <tr><td>%staff.name</td><td>Staff\'s name (alert/notices)</td></tr> + <tr><td>%assignee</td><td>Assigned staff (assignment)</td></tr> <tr><td>%assigner</td><td>Staff assigning the ticket</td></tr> <tr><td>%url</td><td>osTicket\'s base url (FQDN)</td></tr> <tr><td>%auth</td><td>Client authentication token</td></tr> diff --git a/include/class.ticket.php b/include/class.ticket.php index fc7eb1c52..16d55865e 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -419,6 +419,11 @@ class Ticket{ return $assignees; } + function getAssigned($glue='/') { + $assignees = $this->getAssignees(); + return $assignees?implode($glue, $assignees):''; + } + function getTopicId() { return $this->topic_id; } @@ -1106,8 +1111,8 @@ class Ticket{ $search = array('/%id/','/%ticket/','/%email/','/%name/','/%subject/','/%topic/','/%phone/','/%status/','/%priority/', - '/%dept/','/%assigned_staff/','/%createdate/','/%duedate/','/%closedate/','/%url/', - '/%auth/', '/%clientlink/'); + '/%dept/','/%staff/','/%team/','/%assigned/','/%createdate/','/%duedate/','/%closedate/', + '/%url/','/%auth/', '/%clientlink/'); $replace = array($this->getId(), $this->getExtId(), $this->getEmail(), @@ -1119,6 +1124,8 @@ class Ticket{ $this->getPriority(), ($dept?$dept->getName():''), ($staff?$staff->getName():''), + ($team?$team->getName():''), + $this->getAssigned(), Format::db_daydatetime($this->getCreateDate()), Format::db_daydatetime($this->getDueDate()), Format::db_daydatetime($this->getCloseDate()), -- GitLab