From 56f55d2da1a9a08894746136cb3527c15934f41d Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Tue, 25 Feb 2014 04:26:40 +0000
Subject: [PATCH] Expose staff's signature as possible variable in
 collaborator's template

---
 include/class.ticket.php | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/include/class.ticket.php b/include/class.ticket.php
index 50ad197c9..9438b9032 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -979,7 +979,7 @@ class Ticket {
      *
      */
 
-    function  notifyCollaborators($entry) {
+    function  notifyCollaborators($entry, $vars = array()) {
         global $cfg;
 
         if (!$entry instanceof ThreadEntry
@@ -1002,9 +1002,11 @@ class Ticket {
             $uid = $this->getUserId();
         }
 
-        $vars = array(
-                'message' => (string) $entry,
-                'poster' => $poster? $poster : 'A collaborator');
+        $vars = array_merge($vars, array(
+                    'message' => (string) $entry,
+                    'poster' => $poster? $poster : 'A collaborator',
+                    )
+                );
 
         $msg = $this->replaceVars($msg->asArray(), $vars);
 
@@ -1601,7 +1603,7 @@ class Ticket {
             }
         }
 
-        $this->notifyCollaborators($message);
+        $this->notifyCollaborators($message, array('signature' => ''));
 
         return $message;
     }
@@ -1717,7 +1719,8 @@ class Ticket {
         }
 
         if($vars['emailcollab'])
-            $this->notifyCollaborators($response);
+            $this->notifyCollaborators($response,
+                    array('signature' => $signature));
 
         return $response;
     }
-- 
GitLab