File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -231,6 +231,20 @@ public function displaySimplified($options = []) {
231231
232232 if ($ item instanceof Ticket) {
233233 //Tickets without form associated or single ticket for an answer
234+ $ satisfaction = new TicketSatisfaction ();
235+ if ($ satisfaction ->getFromDB ($ options ['id ' ])) {
236+ // show survey form, if any
237+ // @see Ticket::displayTabContentForItem()
238+ $ duration = Entity::getUsedConfig ('inquest_duration ' , $ item ->fields ['entities_id ' ]);
239+ $ date2 = strtotime ($ satisfaction ->fields ['date_begin ' ]);
240+ if (($ duration == 0 )
241+ || (strtotime ("now " ) - $ date2 ) <= $ duration *DAY_TIMESTAMP ) {
242+ $ satisfaction ->showForm ($ item );
243+ } else {
244+ echo "<p class='center b'> " .__ ('Satisfaction survey expired ' )."</p> " ;
245+ }
246+ }
247+
234248 echo "<div class='timeline_box'> " ;
235249 $ rand = mt_rand ();
236250 $ item ->showTimelineForm ($ rand );
Original file line number Diff line number Diff line change @@ -174,7 +174,13 @@ function plugin_init_formcreator() {
174174 if (strpos ($ _SERVER ['REQUEST_URI ' ], "front/ticket.form.php " ) !== false ) {
175175 if (plugin_formcreator_replaceHelpdesk ()) {
176176 if (!isset ($ _POST ['update ' ])) {
177- Html::redirect ($ CFG_GLPI ["root_doc " ] . '/plugins/formcreator/front/issue.form.php?id= ' . $ _GET ['id ' ] . '&sub_itemtype=Ticket ' );
177+ $ decodedUrl = [];
178+ $ forceTab = '' ;
179+ parse_str ($ _SERVER ['QUERY_STRING ' ], $ decodedUrl );
180+ if (isset ($ decodedUrl ['forcetab ' ])) {
181+ Session::setActiveTab (Ticket::class, $ decodedUrl ['forcetab ' ]);
182+ }
183+ Html::redirect ($ CFG_GLPI ["root_doc " ] . '/plugins/formcreator/front/issue.form.php?id= ' . $ _GET ['id ' ] . '&sub_itemtype=Ticket ' . $ forceTab );
178184 }
179185 }
180186 }
@@ -302,7 +308,7 @@ function plugin_formcreator_decode($string) {
302308
303309/**
304310 * Tells if helpdesk replacement is enabled for the current user
305- *
311+ *
306312 * @return boolean|integer
307313 */
308314function plugin_formcreator_replaceHelpdesk () {
You can’t perform that action at this time.
0 commit comments