File tree Expand file tree Collapse file tree 1 file changed +21
-7
lines changed Expand file tree Collapse file tree 1 file changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -1368,13 +1368,27 @@ public function save(PluginFormcreatorFormAnswer $formanswer) {
1368
1368
$ use_mailing = PluginFormcreatorCommon::isNotificationEnabled ();
1369
1369
PluginFormcreatorCommon::setNotification (false );
1370
1370
1371
- $ ticketFollowup = new TicketFollowup ();
1372
- $ ticketFollowup ->add ([
1373
- 'tickets_id ' => $ ticketID ,
1374
- 'date ' => $ _SESSION ['glpi_currenttime ' ],
1375
- 'users_id ' => $ _SESSION ['glpiID ' ],
1376
- 'content ' => $ message
1377
- ]);
1371
+ $ followUpInput = [
1372
+ 'date ' => $ _SESSION ['glpi_currenttime ' ],
1373
+ 'users_id ' => Session::getLoginUserID (),
1374
+ 'content ' => $ message ,
1375
+ ];
1376
+ if (class_exists (ITILFollowup::class)) {
1377
+ // GLPI 9.4+
1378
+ $ followUpInput += [
1379
+ 'items_id ' => $ ticketID ,
1380
+ 'itemtype ' => Ticket::class,
1381
+ ];
1382
+ $ ticketFollowup = new ITILFollowup ();
1383
+ $ ticketFollowup ->add ($ followUpInput );
1384
+ } else {
1385
+ // GLPI < 9.4
1386
+ $ followUpInput += [
1387
+ 'tickets_id ' => $ ticketID ,
1388
+ ];
1389
+ $ ticketFollowup = new TicketFollowup ();
1390
+ $ ticketFollowup ->add ($ followUpInput );
1391
+ }
1378
1392
1379
1393
// Restore mail notification setting
1380
1394
PluginFormcreatorCommon::setNotification ($ use_mailing );
You can’t perform that action at this time.
0 commit comments