File tree Expand file tree Collapse file tree 2 files changed +19
-14
lines changed Expand file tree Collapse file tree 2 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -105,18 +105,11 @@ public static function header($title) {
105105 echo '</a></li> ' ;
106106
107107 if (Session::haveRight ("reservation " , ReservationItem::RESERVEANITEM )) {
108- $ found_available_res = $ DB ->request ([
109- 'COUNT ' => 'cpt ' ,
110- 'FROM ' => ReservationItem::getTable (),
111- 'WHERE ' => getEntitiesRestrictCriteria (ReservationItem::getTable (), 'entities_id ' ),
112- ])->next ();
113- if ($ found_available_res ['cpt ' ] > 0 ) {
114- echo '<li class=" ' . ($ activeMenuItem == self ::MENU_RESERVATIONS ? 'plugin_formcreator_selectedMenuItem ' : '' ) . '"> ' ;
115- echo '<a href=" ' . $ CFG_GLPI ["root_doc " ].'/plugins/formcreator/front/reservationitem.php ' . '"> ' ;
116- echo '<span class="fa fa-calendar-check fa-calendar-check-o fc_list_icon" title=" ' .__ ('Book an asset ' , 'formcreator ' ).'"></span> ' ;
117- echo '<span class="label"> ' .__ ('Book an asset ' , 'formcreator ' ).'</span> ' ;
118- echo '</a></li> ' ;
119- }
108+ echo '<li class=" ' . ($ activeMenuItem == self ::MENU_RESERVATIONS ? 'plugin_formcreator_selectedMenuItem ' : '' ) . '"> ' ;
109+ echo '<a href=" ' . $ CFG_GLPI ["root_doc " ].'/plugins/formcreator/front/reservationitem.php ' . '"> ' ;
110+ echo '<span class="fa fa-calendar-check fa-calendar-check-o fc_list_icon" title=" ' .__ ('Book an asset ' , 'formcreator ' ).'"></span> ' ;
111+ echo '<span class="label"> ' .__ ('Book an asset ' , 'formcreator ' ).'</span> ' ;
112+ echo '</a></li> ' ;
120113 }
121114
122115 if (RSSFeed::canView ()) {
Original file line number Diff line number Diff line change @@ -171,8 +171,8 @@ function plugin_init_formcreator() {
171171 }
172172 }
173173 }
174- if (strpos ( $ _SERVER [ ' REQUEST_URI ' ], " front/ticket.form.php " ) !== false ) {
175- if (plugin_formcreator_replaceHelpdesk () ) {
174+ if (plugin_formcreator_replaceHelpdesk () ) {
175+ if (strpos ( $ _SERVER [ ' REQUEST_URI ' ], " front/ticket.form.php " ) !== false ) {
176176 if (!isset ($ _POST ['update ' ])) {
177177 $ decodedUrl = [];
178178 $ forceTab = '' ;
@@ -183,6 +183,18 @@ function plugin_init_formcreator() {
183183 Html::redirect ($ CFG_GLPI ["root_doc " ] . '/plugins/formcreator/front/issue.form.php?id= ' . $ _GET ['id ' ] . '&sub_itemtype=Ticket ' . $ forceTab );
184184 }
185185 }
186+
187+ $ pages = [
188+ 'front/reservationitem.php ' => 'plugins/formcreator/front/reservationitem.php ' ,
189+ 'front/helpdesk.faq.php ' => 'plugins/formcreator/front/wizard.php ' ,
190+ 'front/ticket.php ' => 'plugins/formcreator/front/issue.php ' ,
191+ ];
192+ foreach ($ pages as $ srcPage => $ dstPage ) {
193+ if (strpos ($ _SERVER ['REQUEST_URI ' ], $ srcPage ) !== false && strpos ($ _SERVER ['REQUEST_URI ' ], $ dstPage ) === false ) {
194+ Html::redirect ($ CFG_GLPI ["root_doc " ] . '/ ' . $ dstPage );
195+ break ;
196+ }
197+ }
186198 }
187199
188200 // Massive Action definition
You can’t perform that action at this time.
0 commit comments