From 057b0816d82dc89812ca6c28d05cdeb6529a3379 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Wed, 13 May 2015 20:03:00 +0000
Subject: [PATCH] thread: Add $options to postThreadEntry

---
 include/ajax.thread.php  | 8 +++++++-
 include/class.export.php | 4 ++++
 include/class.task.php   | 6 ++++--
 include/class.thread.php | 2 +-
 4 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/include/ajax.thread.php b/include/ajax.thread.php
index 331600730..4a8b72016 100644
--- a/include/ajax.thread.php
+++ b/include/ajax.thread.php
@@ -120,7 +120,13 @@ class ThreadAjaxAPI extends AjaxController {
                 $thread->getObject()->postThreadEntry('N',
                         array(
                             'title' => __('New Collaborator Added'),
-                            'note' => $note));
+                            'note' => $note
+                            ),
+                        array(
+                            'poster' => $thisstaff,
+                            'alert' => false
+                            )
+                        );
                 $info = array('msg' => sprintf(__('%s added as a collaborator'),
                             Format::htmlchars($c->getName())));
                 return self::_collaborators($thread, $info);
diff --git a/include/class.export.php b/include/class.export.php
index 447435b41..ed9cee15a 100644
--- a/include/class.export.php
+++ b/include/class.export.php
@@ -110,6 +110,10 @@ class Export {
         return false;
     }
 
+    static function saveTasks(sql, $filename, $how='csv') {
+        return false;
+    }
+
     static function saveUsers($sql, $filename, $how='csv') {
 
         $exclude = array('name', 'email');
diff --git a/include/class.task.php b/include/class.task.php
index 5f2f761ba..dd7fadcbd 100644
--- a/include/class.task.php
+++ b/include/class.task.php
@@ -288,12 +288,14 @@ class Task extends TaskModel implements Threadable {
         return $thread;
     }
 
-    function postThreadEntry($type, $vars) {
+    function postThreadEntry($type, $vars, $options=array()) {
         $errors = array();
+        $poster = isset($options['poster']) ? $options['poster'] : null;
+        $alert = isset($options['alert']) ? $options['alert'] : true;
         switch ($type) {
         case 'N':
         default:
-            return $this->postNote($vars, $errors);
+            return $this->postNote($vars, $errors, $poster, $alert);
         }
     }
 
diff --git a/include/class.thread.php b/include/class.thread.php
index 3268c5cc8..75d5a14a3 100644
--- a/include/class.thread.php
+++ b/include/class.thread.php
@@ -1983,6 +1983,6 @@ abstract class ThreadEntryAction {
 interface Threadable {
     function getThreadId();
     function getThread();
-    function postThreadEntry($type, $vars);
+    function postThreadEntry($type, $vars, $options=array());
 }
 ?>
-- 
GitLab