From aa023156b421fa4dfbb217f93b2c437f78744ccc Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Tue, 18 Aug 2015 09:18:04 -0500
Subject: [PATCH] oops: Fix bad logic deleting tickets

---
 include/ajax.tickets.php | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/ajax.tickets.php b/include/ajax.tickets.php
index cb988f8a5..36e0f6aa8 100644
--- a/include/ajax.tickets.php
+++ b/include/ajax.tickets.php
@@ -575,9 +575,8 @@ class TicketsAjaxAPI extends AjaxController {
             if ($_POST && !$errors) {
                 foreach ($_POST['tids'] as $tid) {
                     if (($t=Ticket::lookup($tid))
-                            && $t->getDeptId() != $_POST['dept_id']
                             && $t->checkStaffPerm($thisstaff, Ticket::PERM_DELETE)
-                            && $t->delete($_POST, $e)
+                            && $t->delete($_POST['comments'], $e)
                             )
                         $i++;
                 }
-- 
GitLab