Correction du schéma de la base de données et des hooks

This commit is contained in:
tips-of-mine
2025-05-31 14:50:31 +02:00
committed by GitHub
parent 4622a1a2cd
commit 80167ce471
3 changed files with 67 additions and 35 deletions

View File

@ -42,13 +42,29 @@ if (isset($_POST["add"])) {
Session::checkRight("plugin_soc_case", UPDATE);
$case = new PluginSocCase();
$case->getFromDB($_POST['plugin_soc_cases_id']);
$tickets_id = $case->createTicket($_POST);
// Link existing ticket to case
if (isset($_POST['tickets_id']) && $_POST['tickets_id'] > 0) {
$case->addTicket($_POST['tickets_id']);
} else {
// Create new ticket from case
$case->createTicket($_POST);
}
Html::back();
} else if (isset($_POST["add_change"])) {
Session::checkRight("plugin_soc_case", UPDATE);
$case = new PluginSocCase();
$case->getFromDB($_POST['plugin_soc_cases_id']);
$changes_id = $case->createChange($_POST);
// Link existing change to case
if (isset($_POST['changes_id']) && $_POST['changes_id'] > 0) {
$case->addChange($_POST['changes_id']);
} else {
// Create new change from case
$case->createChange($_POST);
}
Html::back();
} else {
$id = "";