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) {
240
240
];
241
241
}
242
242
if (Session::haveRight (Ticket::$ rightname , Ticket::READGROUP )) {
243
- $ requestersObserversGroupsQuery = new QuerySubQuery ( [
243
+ $ sub_query = [
244
244
'SELECT ' => 'tickets_id ' ,
245
245
'FROM ' => Group_Ticket::getTable (),
246
246
'WHERE ' => [
247
- 'groups_id ' => $ _SESSION ['glpigroups ' ],
248
247
'type ' => [CommonITILActor::REQUESTER , CommonITILActor::OBSERVER ]
249
248
],
250
- ]);
249
+ ];
250
+ if (count ($ _SESSION ['glpigroups ' ]) > '0 ' ) {
251
+ $ sub_query ['WHERE ' ]['groups_id ' ] = $ _SESSION ['glpigroups ' ];
252
+ }
253
+ $ requestersObserversGroupsQuery = new QuerySubQuery ($ sub_query );
251
254
if (!isset ($ dparams_cond_crit ['OR ' ]['id ' ])) {
252
255
$ dparams_cond_crit ['OR ' ] = [
253
256
'id ' => $ requestersObserversGroupsQuery ,
You can’t perform that action at this time.
0 commit comments