Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ola disabling after esaclation #268

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion front/ticket.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
// Sanitize before merging with $_POST['comment'] which is already sanitized
'content' => Sanitizer::sanitize(
'<p><i>' . sprintf(__('Escalation to the group %s.', 'escalade'), Sanitizer::unsanitize($group->getName())) . '</i></p><hr />'
) . $_POST['comment']
) . $_POST['comment'],
'_do_not_compute_takeintoaccount' => $_SESSION['plugins']['escalade']['config']['do_not_compute_takeintoaccount']
]);
}

Expand Down
15 changes: 14 additions & 1 deletion hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,13 @@ function plugin_escalade_install()
`use_filter_assign_group` INT NOT NULL,
`ticket_last_status` INT NOT NULL,
`remove_requester` INT NOT NULL,
`do_not_compute_takeintoaccount` TINYINT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;";
$DB->doQuery($query);

$query = "INSERT INTO glpi_plugin_escalade_configs
VALUES (NULL, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, '" . Ticket::WAITING . "',0)";
VALUES (NULL, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, '" . Ticket::WAITING . "', 0, 0)";
$DB->doQuery($query);
}

Expand Down Expand Up @@ -382,6 +383,18 @@ function plugin_escalade_install()
$migration->migrationOneTable('glpi_plugin_escalade_configs');
}

//Update to 2.9.11
// add new fields
if (!$DB->fieldExists('glpi_plugin_escalade_configs', 'do_not_compute_takeintoaccount')) {
$migration->addField(
'glpi_plugin_escalade_configs',
'do_not_compute_takeintoaccount',
'bool',
['value' => 0]
);
$migration->migrationOneTable('glpi_plugin_escalade_configs');
}

return true;
}

Expand Down
9 changes: 8 additions & 1 deletion inc/config.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,14 @@ function hide_technician_group(val) {
'rand' => $rand,
]);
echo "</td>";
echo "<td colspan='2'></td>";
echo "<td><label for='dropdown_do_not_compute_takeintoaccount$rand'>";
echo __("Do not take into account time spent in care", "escalade") . "</td>";
echo "<td>";
Dropdown::showYesNo("do_not_compute_takeintoaccount", $this->fields["do_not_compute_takeintoaccount"], -1, [
'width' => '100%',
'rand' => $rand,
]);
echo "</td>";
echo "</tr>";

$options['candel'] = false;
Expand Down
7 changes: 5 additions & 2 deletions inc/ticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ public static function AssignFirstGroupOnSolve(CommonDBTM $item)
'_no_reopen' => true, //prevent reopening ticket
'state' => Planning::INFO,
'content' => __("Solution provided, back to the group", "escalade") . " " .
$group->getName()
$group->getName(),
'_do_not_compute_takeintoaccount' => $_SESSION['plugins']['escalade']['config']['do_not_compute_takeintoaccount']
]);
}
}
Expand Down Expand Up @@ -277,7 +278,8 @@ public static function AssignLastGroupOnRejectedSolution(CommonDBTM $item)
'is_private' => true,
'state' => Planning::INFO,
'content' => __("Solution rejected, return to the group", "escalade") . " " .
$group->getName()
$group->getName(),
'_do_not_compute_takeintoaccount' => $_SESSION['plugins']['escalade']['config']['do_not_compute_takeintoaccount']
]);
}

Expand Down Expand Up @@ -381,6 +383,7 @@ public static function addHistoryOnAddGroup(CommonDBTM $item)
'is_private' => true,
'state' => Planning::INFO,
'content' => Toolbox::addslashes_deep(sprintf(__("Escalation to the group %s.", "escalade"), $group->getName())),
'_do_not_compute_takeintoaccount' => $_SESSION['plugins']['escalade']['config']['do_not_compute_takeintoaccount']
]);
}

Expand Down
Loading