File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -240,14 +240,17 @@ public function buildParams($rand = null) {
240240 ];
241241 }
242242 if (Session::haveRight (Ticket::$ rightname , Ticket::READGROUP )) {
243- $ requestersObserversGroupsQuery = new QuerySubQuery ( [
243+ $ sub_query = [
244244 'SELECT ' => 'tickets_id ' ,
245245 'FROM ' => Group_Ticket::getTable (),
246246 'WHERE ' => [
247- 'groups_id ' => $ _SESSION ['glpigroups ' ],
248247 'type ' => [CommonITILActor::REQUESTER , CommonITILActor::OBSERVER ]
249248 ],
250- ]);
249+ ];
250+ if (count ($ _SESSION ['glpigroups ' ]) > '0 ' ) {
251+ $ sub_query ['WHERE ' ]['groups_id ' ] = $ _SESSION ['glpigroups ' ];
252+ }
253+ $ requestersObserversGroupsQuery = new QuerySubQuery ($ sub_query );
251254 if (!isset ($ dparams_cond_crit ['OR ' ]['id ' ])) {
252255 $ dparams_cond_crit ['OR ' ] = [
253256 'id ' => $ requestersObserversGroupsQuery ,
You can’t perform that action at this time.
0 commit comments