File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -146,11 +146,14 @@ function plugin_formcreator_addDefaultWhere($itemtype) {
146
146
$ currentUser = Session::getLoginUserID ();
147
147
// Use default where for Tickets
148
148
$ condition = Search::addDefaultWhere (Ticket::class);
149
- // Replace references to ticket tables with issues table
150
- $ condition = str_replace ('`glpi_tickets` ' , '`glpi_plugin_formcreator_issues` ' , $ condition );
151
- $ condition = str_replace ('`users_id_recipient` ' , '`requester_id` ' , $ condition );
149
+ if ($ condition != '' ) {
150
+ // Replace references to ticket tables with issues table
151
+ $ condition = str_replace ('`glpi_tickets` ' , '`glpi_plugin_formcreator_issues` ' , $ condition );
152
+ $ condition = str_replace ('`users_id_recipient` ' , '`requester_id` ' , $ condition );
153
+ $ condition .= ' OR ' ;
154
+ }
152
155
// condition where current user is 1st validator of the issue
153
- $ condition .= " OR `glpi_plugin_formcreator_issues`.`users_id_validator` = ' $ currentUser' " ;
156
+ $ condition .= " `glpi_plugin_formcreator_issues`.`users_id_validator` = ' $ currentUser' " ;
154
157
// condition where current user is a member of 1st validator group of the issue
155
158
$ groupList = [];
156
159
foreach (Group_User::getUserGroups ($ currentUser ) as $ group ) {
You can’t perform that action at this time.
0 commit comments