Skip to content
Snippets Groups Projects
Commit e01af65e authored by Peter Rotich's avatar Peter Rotich
Browse files

queue: Department Quick Filter Choices

Limit the departments based on Agent's access
parent 12f70249
No related branches found
No related tags found
No related merge requests found
......@@ -702,10 +702,27 @@ class HelpTopicChoiceField extends ChoiceField {
require_once INCLUDE_DIR . 'class.dept.php';
class DepartmentChoiceField extends ChoiceField {
var $_choices = null;
function getChoices($verbose=false) {
return Dept::getDepartments();
}
function getQuickFilterChoices() {
global $thisstaff;
if (!isset($this->_choices)) {
$this->_choices = array();
$depts = $thisstaff ? $thisstaff->getDepts() : array();
foreach ($this->getChoices() as $id => $name) {
if (!$depts || in_array($id, $depts))
$this->_choices[$id] = $name;
}
}
return $this->_choices;
}
function getSearchMethods() {
return array(
'includes' => __('is'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment