mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-31 01:35:15 +02:00
fix ticket search when staff hasnt deparments and shows own tickets
This commit is contained in:
parent
42f8be1870
commit
fe31163a8a
@ -245,10 +245,12 @@ class SearchController extends Controller {
|
||||
}
|
||||
|
||||
private function setDepartmentFilter($departments,$allowedDepartments, &$filters){
|
||||
$validDepartments = $this->generateValidDepartmentList($departments, $allowedDepartments);
|
||||
$idStaff = Controller::getLoggedUser()->id ;
|
||||
if ($filters != "") $filters .= " and ";
|
||||
$first = TRUE;
|
||||
|
||||
$validDepartments = $this->generateValidDepartmentList($departments, $allowedDepartments);
|
||||
$first = TRUE;
|
||||
if($validDepartments){
|
||||
foreach($validDepartments as $department) {
|
||||
if($first){
|
||||
$filters .= " ( ";
|
||||
@ -258,7 +260,11 @@ class SearchController extends Controller {
|
||||
}
|
||||
$filters .= "ticket.department_id = " . $department;
|
||||
}
|
||||
$filters .= ")";
|
||||
$filters .= " or ";
|
||||
}else{
|
||||
$filters .= "(";
|
||||
}
|
||||
$filters .= "ticket.author_staff_id = " . $idStaff . ")";
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user