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) {
151151 } else {
152152 $ condition .= "`glpi_plugin_formcreator_issues`.`users_id_validator` = ' $ currentUser' " ;
153153 }
154+
154155 // condition where current user is a member of a validator group of the issue
155156 $ groupList = [];
156157 foreach (Group_User::getUserGroups ($ currentUser ) as $ group ) {
157158 $ groupList [] = $ group ['id ' ];
158159 }
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+ }
165168 }
169+
166170 // condition where current user is a validator of a issue of type ticket
167171 $ complexJoinId = Search::computeComplexJoinID (Search::getOptions ($ itemtype )[11 ]['joinparams ' ]);
168172 $ condition .= " OR `glpi_users_users_id_validate_ $ complexJoinId`.`id` = ' $ currentUser' " ;
You can’t perform that action at this time.
0 commit comments