|
70 | 70 | $_form_object['status'] = $_SESSION['plugins']['escalade']['config']['ticket_last_status']; |
71 | 71 | } |
72 | 72 | $updates_ticket = new Ticket(); |
73 | | - $updates_ticket->update($_POST['ticket_details'] + [ |
74 | | - '_actors' => PluginEscaladeTicket::getTicketFieldsWithActors($tickets_id, $group_id), |
75 | | - '_plugin_escalade_no_history' => true, // Prevent a duplicated task to be added |
76 | | - 'actortype' => CommonITILActor::ASSIGN, |
77 | | - 'groups_id' => $group_id, |
78 | | - '_form_object' => $_form_object, |
79 | | - ]); |
80 | | - |
81 | | - $task = new TicketTask(); |
82 | | - $task->add([ |
83 | | - 'tickets_id' => $tickets_id, |
84 | | - 'is_private' => true, |
85 | | - 'state' => Planning::INFO, |
86 | | - // Sanitize before merging with $_POST['comment'] which is already sanitized |
87 | | - 'content' => Sanitizer::sanitize( |
88 | | - '<p><i>' . sprintf(__('Escalation to the group %s.', 'escalade'), Sanitizer::unsanitize($group->getName())) . '</i></p><hr />' |
89 | | - ) . $_POST['comment'] |
90 | | - ]); |
| 73 | + if ( |
| 74 | + $updates_ticket->update( |
| 75 | + $_POST['ticket_details'] + [ |
| 76 | + '_actors' => PluginEscaladeTicket::getTicketFieldsWithActors($tickets_id, $group_id), |
| 77 | + '_plugin_escalade_no_history' => true, // Prevent a duplicated task to be added |
| 78 | + 'actortype' => CommonITILActor::ASSIGN, |
| 79 | + 'groups_id' => $group_id, |
| 80 | + '_form_object' => $_form_object, |
| 81 | + ] |
| 82 | + ) |
| 83 | + ) { |
| 84 | + $task = new TicketTask(); |
| 85 | + $task->add([ |
| 86 | + 'tickets_id' => $tickets_id, |
| 87 | + 'is_private' => true, |
| 88 | + 'state' => Planning::INFO, |
| 89 | + // Sanitize before merging with $_POST['comment'] which is already sanitized |
| 90 | + 'content' => Sanitizer::sanitize( |
| 91 | + '<p><i>' . sprintf(__('Escalation to the group %s.', 'escalade'), Sanitizer::unsanitize($group->getName())) . '</i></p><hr />' |
| 92 | + ) . $_POST['comment'] |
| 93 | + ]); |
| 94 | + } |
91 | 95 | } |
92 | 96 |
|
93 | 97 | $track = new Ticket(); |
|
0 commit comments