diff --git a/inc/closeticket.class.php b/inc/closeticket.class.php index 2f8277ff1..8c586e3fd 100644 --- a/inc/closeticket.class.php +++ b/inc/closeticket.class.php @@ -448,7 +448,9 @@ function showForm($ID, $options = []) // If values are saved in session we retrieve it if (isset($_SESSION['glpi_plugin_moreticket_close'])) { foreach ($_SESSION['glpi_plugin_moreticket_close'] as $key => $value) { - $ticket->fields[$key] = str_replace(['\r\n', '\r', '\n'], '', $value); + if (!is_array($value)) { + $ticket->fields[$key] = str_replace(['\r\n', '\r', '\n'], '', $value); + } } } @@ -564,8 +566,7 @@ static function preAddCloseTicket($item) && in_array($item->input['status'], $solution_status)) { if (self::checkMandatory($item->input)) { // Add followup on immediate ticket closing - if ($config->closeFollowup() - && $item->input['id'] == 0) { + if ($item->input['id'] == 0) { $item->input['statusold'] = $item->input['status']; $item->input['status'] = 0; } diff --git a/inc/config.class.php b/inc/config.class.php index f10039bc1..0780709f5 100644 --- a/inc/config.class.php +++ b/inc/config.class.php @@ -459,7 +459,7 @@ static function getValuesUrgency() { return $values; } - function addFollowupStopWaiting() { + function addTaskStopWaiting() { return $this->fields['add_followup_stop_waiting']; } diff --git a/inc/waitingticket.class.php b/inc/waitingticket.class.php index aae186955..0f0ca626a 100644 --- a/inc/waitingticket.class.php +++ b/inc/waitingticket.class.php @@ -829,8 +829,9 @@ public static function cronMoreticketWaitingTicket($task = null) { 'status' => $waiting['status']]); $waiting_ticket->update(['id' => $waiting['id'], 'date_end_suspension' => date("Y-m-d H:i:s")]); - if ($config->addFollowupStopWaiting()) { + if ($config->addTaskStopWaiting()) { $ticketTask->add(['tickets_id' => $ticket->getID(), + 'is_private' => 1, 'content' => Toolbox::addslashes_deep($content), 'state' => 2]); } $cron_status = 1;