Skip to content

Commit

Permalink
Fix function name
Browse files Browse the repository at this point in the history
Fix add solution on ticket creation
  • Loading branch information
tsmr committed Oct 12, 2023
1 parent 9839c24 commit 728fe31
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions inc/closeticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion inc/config.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ static function getValuesUrgency() {
return $values;
}

function addFollowupStopWaiting() {
function addTaskStopWaiting() {
return $this->fields['add_followup_stop_waiting'];
}

Expand Down
3 changes: 2 additions & 1 deletion inc/waitingticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 728fe31

Please sign in to comment.