Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
53 righe
2.0 KiB
53 righe
2.0 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
if (!empty($_POST) && !empty($_SESSION["utente"]) && $_SESSION["utente"]->gerarchia < 100 && tokenVerify()) { |
|
if (!empty($_POST["modulo"]) && !empty($_POST["codice_elemento"])) { |
|
$manager = new Incarichi($_POST["modulo"],$_POST["codice_elemento"]); |
|
if ($manager->checkAdminPermission()) { |
|
if (!$manager->lock) { |
|
$error = false; |
|
$found = []; |
|
if (!empty($_POST["incaricato"])) { |
|
if ($manager->checkSingleRP($_POST["incaricato"])) { |
|
foreach($_POST["incaricato"] as $id_incaricato => $incaricato) { |
|
if (is_numeric($id_incaricato)) { $found[] = $id_incaricato; } else { $incaricato["codice"] = null; } |
|
$found[] = $manager->saveIncaricato($incaricato); |
|
} |
|
} else { |
|
?> |
|
swal({ |
|
title:js_dict.attenzione, |
|
text:`<?= __("La procedura deve contenere un singolo Responsabile Unico del Procedimento (RUP).") ?>`, |
|
type:"error"} |
|
); |
|
<?php |
|
die(); |
|
} |
|
} |
|
if (!$error) { |
|
$manager->deleteUnused($found); |
|
$object = $manager->getObject(NULL); |
|
if (is_object($object)) { |
|
if (is_callable([$object,"addToLog"],true)) { |
|
$object->addToLog("UPDATE","Incaricati"); |
|
} |
|
} |
|
$action = "window.location.reload();"; |
|
if (file_exists("{$beRoot}/{$manager->modulo}/panel.php")) { |
|
$action = "window.location.href='/backend/{$manager->modulo}/panel.php?codice={$manager->elemento}'"; |
|
} |
|
?> |
|
swal({title:js_dict["success-msg"],type:"success"}).then(function(){ <?= $action ?> }); |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|
|
|