File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -127,20 +127,25 @@ function plugin_formcreator_addDefaultWhere($itemtype) {
127
127
$ currentUser = Session::getLoginUserID ();
128
128
switch ($ itemtype ) {
129
129
case PluginFormcreatorIssue::class:
130
+ if (Session::haveRight (Entity::$ rightname , UPDATE )) {
131
+ // The user is a Formcreator administrator
132
+ return '' ;
133
+ }
134
+ // Simplified interface or service catalog
130
135
// Use default where from Tickets
131
136
$ condition = Search::addDefaultWhere (Ticket::class);
132
137
if ($ condition != '' ) {
133
138
// Replace references to ticket tables with issues table
134
139
$ condition = str_replace ('`glpi_tickets` ' , '`glpi_plugin_formcreator_issues` ' , $ condition );
135
140
$ condition = str_replace ('`users_id_recipient` ' , '`requester_id` ' , $ condition );
136
- // $condition .= ' OR ';
141
+ $ condition .= ' OR ' ;
137
142
}
138
143
// condition where current user is a validator of the issue
139
144
if (Plugin::isPluginActive ('advform ' )) {
140
145
$ complexJoinId = Search::computeComplexJoinID (Search::getOptions ($ itemtype )[9 ]['joinparams ' ]);
141
- $ condition .= " OR `glpi_users_$ complexJoinId`.`id` = ' $ currentUser' " ;
146
+ $ condition .= "`glpi_users_ $ complexJoinId`.`id` = ' $ currentUser' " ;
142
147
} else {
143
- $ condition .= " OR `glpi_plugin_formcreator_issues`.`users_id_validator` = '$ currentUser' " ;
148
+ $ condition .= "`glpi_plugin_formcreator_issues`.`users_id_validator` = ' $ currentUser' " ;
144
149
}
145
150
// condition where current user is a member of a validator group of the issue
146
151
$ groupList = [];
Original file line number Diff line number Diff line change @@ -119,10 +119,13 @@ public static function getMenuContent() {
119
119
title=" ' . __ ('Forms waiting for validation ' , 'formcreator ' ) . '"></i> ' ;
120
120
$ import_image = '<i class="fas fa-download"
121
121
title=" ' . __ ('Import forms ' , 'formcreator ' ) . '"></i> ' ;
122
+ $ requests_image = '<i class="fa fa-paper-plane"
123
+ title=" ' . PluginFormcreatorIssue::getTypeName (Session::getPluralNumber ()) . '"></i> ' ;
124
+
122
125
$ menu ['links ' ]['search ' ] = PluginFormcreatorFormList::getSearchURL (false );
123
126
$ menu ['links ' ][$ validation_image ] = PluginFormcreatorFormAnswer::getSearchURL (false );
124
127
$ menu ['links ' ][$ import_image ] = PluginFormcreatorForm::getFormURL (false )."?import_form=1 " ;
125
-
128
+ $ menu [ ' links ' ][ $ requests_image ] = PluginFormcreatorIssue:: getSearchURL ( false );
126
129
return $ menu ;
127
130
}
128
131
Original file line number Diff line number Diff line change @@ -257,4 +257,10 @@ public function testVisibilityByLanguage() {
257
257
$ output = $ this ->crawler ->filter ($ formTileSelector );
258
258
$ this ->integer (count ($ output ))->isEqualTo (0 );
259
259
}
260
+
261
+ public function testAcessToIssuesFromAdmin () {
262
+ $ this ->crawler = $ this ->client ->request ('GET ' , '/ ' . Plugin::getWebDir ('formcreator ' , false ) . '/front/form.php ' );
263
+ $ href = '/ ' . Plugin::getWebDir ('formcreator ' , false ) . '/front/issue.php ' ;
264
+ $ this ->client ->waitForVisibility ('header li.nav-item a[href=" ' . $ href . '"] ' );
265
+ }
260
266
}
You can’t perform that action at this time.
0 commit comments