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.
62 righe
1.4 KiB
62 righe
1.4 KiB
<?php |
|
ob_start(); |
|
$configPath = substr(__DIR__, 0, strpos(__DIR__, "/public_html")) . "/config.php"; |
|
include_once $configPath; |
|
|
|
$codice = intval($_POST["codice"] ?? 0); |
|
$metodo = $_POST["metodo"] ?? ""; |
|
|
|
$full = $metodo === "full"; |
|
$nuclear = $metodo === "nuclear"; |
|
|
|
$npa = NuovaPiattaformaAppalti::init($codice); |
|
// Verifica utente |
|
if(!$npa->verifyUtente()) { |
|
die_forbidden(); |
|
} |
|
|
|
if($_SESSION["utente"]->isSupportoOrRoot() && $nuclear) { |
|
|
|
$filterSchede = [ |
|
"stato" => [">=", 90], |
|
"codice_npa" => $npa->fascicolo["codice"], |
|
]; |
|
|
|
$schedePubblicate = NuovaPiattaformaAppalti::fetchSchede(["*"], $filterSchede); |
|
|
|
if(!empty($schedePubblicate)) { |
|
$canReset = true; |
|
foreach($schedePubblicate as $scheda) { |
|
if($scheda["stato"] >= 110) { |
|
$canReset = false; break; |
|
} |
|
$pubblicazione = unserialize($scheda["pubblicazione"]); |
|
$canReset = empty($pubblicazione->datiPubblicazioneEU) && empty($pubblicazione->datiPubblicazioneIT); |
|
if(!$canReset) break; |
|
} |
|
|
|
if(!$canReset) { |
|
?> |
|
swal({ |
|
title: "Fascicolo non resettabile", |
|
html: "Questo fascicolo è in uno stadio troppo avanzato per essere resettato.", |
|
type: "error", |
|
}); |
|
<?php |
|
die(); |
|
} |
|
} |
|
|
|
$npa->createDossierRevision(); |
|
die("window.location.reload();"); |
|
} |
|
|
|
if($npa->canClearDossier()) { |
|
|
|
$npa->clearDossier($full); |
|
die("window.location.reload();"); |
|
|
|
} |
|
|
|
die_forbidden(); |
|
exit;
|
|
|