File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -443,6 +443,18 @@ function plugin_formcreator_hook_add_ticket(CommonDBTM $item) {
443443 ]);
444444}
445445
446+ function plugin_formcreator_hook_update_ticket_actors (CommonITILActor $ item ) {
447+ if ($ item ::$ itemtype_1 == Ticket::class) {
448+ if ($ item ->fields ['type ' ] == CommonITILActor::REQUESTER ) {
449+ $ ticket_id = $ item ->fields ['tickets_id ' ];
450+ $ ticket = new Ticket ();
451+ if ($ ticket ->getFromDB ($ ticket_id )) {
452+ plugin_formcreator_hook_update_ticket ($ ticket );
453+ }
454+ }
455+ }
456+ }
457+
446458function plugin_formcreator_hook_update_ticket (CommonDBTM $ item ) {
447459 global $ DB ;
448460
@@ -490,6 +502,7 @@ function plugin_formcreator_hook_update_ticket(CommonDBTM $item) {
490502 'entities_id ' => $ item ->fields ['entities_id ' ],
491503 'is_recursive ' => '0 ' ,
492504 'requester_id ' => $ requester ,
505+ 'users_id_recipient ' => $ requester ,
493506 'comment ' => $ DB ->escape ($ item ->fields ['content ' ]),
494507 ]);
495508 }
Original file line number Diff line number Diff line change @@ -281,6 +281,7 @@ function plugin_formcreator_permanent_hook(): void {
281281 $ PLUGIN_HOOKS [Hooks::ITEM_ADD ]['formcreator ' ] = [
282282 Ticket::class => 'plugin_formcreator_hook_add_ticket ' ,
283283 ITILFollowup::class => 'plugin_formcreator_hook_update_itilFollowup ' ,
284+ Ticket_User::class => 'plugin_formcreator_hook_update_ticket_actors ' ,
284285 ];
285286 $ PLUGIN_HOOKS [Hooks::PRE_ITEM_UPDATE ]['formcreator ' ] = [
286287 User::class => 'plugin_formcreator_hook_update_user ' ,
@@ -299,6 +300,7 @@ function plugin_formcreator_permanent_hook(): void {
299300 $ PLUGIN_HOOKS [Hooks::ITEM_PURGE ]['formcreator ' ] = [
300301 Ticket::class => 'plugin_formcreator_hook_purge_ticket ' ,
301302 TicketValidation::class => 'plugin_formcreator_hook_purge_ticketvalidation ' ,
303+ Ticket_User::class => 'plugin_formcreator_hook_update_ticket_actors ' ,
302304 ];
303305 $ PLUGIN_HOOKS [Hooks::PRE_ITEM_PURGE ]['formcreator ' ] = [
304306 PluginFormcreatorTargetTicket::class => 'plugin_formcreator_hook_pre_purge_targetTicket ' ,
You can’t perform that action at this time.
0 commit comments