File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -151,18 +151,22 @@ function plugin_formcreator_addDefaultWhere($itemtype) {
151
151
} else {
152
152
$ condition .= "`glpi_plugin_formcreator_issues`.`users_id_validator` = ' $ currentUser' " ;
153
153
}
154
+
154
155
// condition where current user is a member of a validator group of the issue
155
156
$ groupList = [];
156
157
foreach (Group_User::getUserGroups ($ currentUser ) as $ group ) {
157
158
$ groupList [] = $ group ['id ' ];
158
159
}
159
- $ groupList = implode ("', ' " , $ groupList );
160
- if (Plugin::isPluginActive ('advform ' )) {
161
- $ complexJoinId = Search::computeComplexJoinID (Search::getOptions ($ itemtype )[9 ]['joinparams ' ]);
162
- $ condition .= " OR `glpi_groups_ $ complexJoinId`.`id` IN (' $ groupList') " ;
163
- } else {
164
- $ condition .= " OR `glpi_plugin_formcreator_issues`.`groups_id_validator` IN (' $ groupList') " ;
160
+ if (count ($ groupList ) > 0 ) {
161
+ $ groupList = implode ("', ' " , $ groupList );
162
+ if (Plugin::isPluginActive ('advform ' )) {
163
+ $ complexJoinId = Search::computeComplexJoinID (Search::getOptions ($ itemtype )[9 ]['joinparams ' ]);
164
+ $ condition .= " OR `glpi_groups_ $ complexJoinId`.`id` IN (' $ groupList') " ;
165
+ } else {
166
+ $ condition .= " OR `glpi_plugin_formcreator_issues`.`groups_id_validator` IN (' $ groupList') " ;
167
+ }
165
168
}
169
+
166
170
// condition where current user is a validator of a issue of type ticket
167
171
$ complexJoinId = Search::computeComplexJoinID (Search::getOptions ($ itemtype )[11 ]['joinparams ' ]);
168
172
$ condition .= " OR `glpi_users_users_id_validate_ $ complexJoinId`.`id` = ' $ currentUser' " ;
You can’t perform that action at this time.
0 commit comments