From 5106ae7fe059a2c71ba4ad78bceb480d95bdf52a Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Mon, 8 Oct 2012 10:56:22 -0400
Subject: [PATCH] Add routine to get departments 'managed' by the staff

---
 include/class.staff.php | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/class.staff.php b/include/class.staff.php
index 778041e7c..89fdda1b3 100644
--- a/include/class.staff.php
+++ b/include/class.staff.php
@@ -214,6 +214,13 @@ class Staff {
     function getDepts() {
         return $this->getDepartments();
     }
+
+    function getManagedDepartments() {
+
+        return ($depts=Dept::getDepartments(
+                    array('manager' => $this->getId())
+                    ))?array_keys($depts):array();
+    }
      
     function getGroupId() {
         return $this->ht['group_id'];
-- 
GitLab