From 7f86bada4e3b0e4c2439a804357c6b170e451aad Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Wed, 10 Oct 2012 22:35:37 -0400
Subject: [PATCH] Add function to check if staff is a manager - take id or
 staff's object

---
 include/class.dept.php | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/class.dept.php b/include/class.dept.php
index 0eae779c9..13be8ff7e 100644
--- a/include/class.dept.php
+++ b/include/class.dept.php
@@ -180,6 +180,14 @@ class Dept {
         return $this->manager;
     }
 
+    function isManager($staff) {
+
+        if(is_object($staff)) $staff=$staff->getId();
+
+        return ($this->getManagerId() && $this->getManagerId()==$staff);
+    }
+
+
     function isPublic() {
          return ($this->ht['ispublic']);
     }
-- 
GitLab