$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php";
include_once($configPath);
$id_modulo = "open";
$cmd_info = gara::getInfoModulo($id_modulo);
$error = true;
if (!empty($_SESSION["utente"]) && !empty($_GET["codice_lotto"])
&& (
$_SESSION["utente"]->permission($cmd_info["modulo_riferimento"],$_GET["codice"],$id_modulo)
|| (!empty($_GET["valutazione"]) && !empty($_GET["codice_round"]))
)
&& !empty($_GET["partecipante"])
&& !empty($_GET["busta"])) {
if (empty($_GET["valutazione"])) {
$valutazione = NULL;
$codice_round = $_GET["codice_round"] ?? NULL;
} else {
$valutazione = "commissione";
$codice_round = $_GET["codice_round"];
}
$gara = gara::init($_GET["codice"],$codice_round,$valutazione);
if (!empty($gara) && $gara->setLotto($_GET["codice_lotto"])) {
$record = $gara->info;
$round = $gara->round;
$lotto = $gara->lotto;
$lock = $gara->checkLock($cmd_info["id"]);
$partecipante = $gara->getPartecipante($_GET["partecipante"]);
if (!empty($partecipante)) {
$infoOE = oeManager::getOE($partecipante["codice_operatore"]);
$richieste = $gara->getRichieste($_GET["busta"]);
if (!empty($richieste)) {
foreach($richieste AS $tmp) {
if ($tmp["controllo"] != "N") {
$richiesta = $tmp;
}
}
$error = false;
if (empty($richiesta) || $gara->checkOpeningPermission($partecipante["codice"],$richiesta["codice"])) {
$unlock = false;
?>
function getDecryptFormInfo(array $busta,string $type) {
global $richiesta;
$p7m = ($busta["mime"]=="application/octet-stream" && substr($busta["nomeFile"], -3) == "p7m");
return [
"type" => $type,
"busta" => $busta,
"richiesta" => $richiesta,
"icon" => ($p7m) ? "download" : "file-signature",
"label" => ($p7m) ? "Scarica P7M" : "Scarica Documento",
"p7m" => $p7m
];
}
if ($valutazione) {
addBypassCheckURL("/backend/gare/open/decrypt.php");
}
foreach($richieste AS $richiesta) {
$busta = $gara->getBusta($partecipante["codice"],$richiesta["codice"]);
$forms = [];
if (!empty($busta)) {
$emendamento = $gara->getEmendamento($partecipante["codice"],$richiesta["codice"]);
if (!empty($emendamento) && $emendamento["segreta"] == "S") {
$emendamentoSecretato = $gara->getBustaSecretata($partecipante["codice"],$richiesta["codice"],"emendamento");
if (empty($emendamentoSecretato)) {
$emendamento = null;
$emendamentoSecretato = null;
}
}
if ($valutazione) {
if (!empty($emendamento) && $emendamento["accettata"] == "S") {
$forms[] = getDecryptFormInfo($emendamento,"emendamento");
} else {
$forms[] = getDecryptFormInfo($busta,"busta");
}
} else {
$forms["busta"] = [getDecryptFormInfo($busta,"busta")];
if ($busta["segreta"] == "S") {
$bustaSecretata = $gara->getBustaSecretata($partecipante["codice"],$richiesta["codice"],"busta");
} else {
$bustaSecretata = null;
}
if ($busta["open"] == "S") {
if (!empty($bustaSecretata)) {
$forms["busta"][] = getDecryptFormInfo($bustaSecretata,"bustaSecretata");
}
if (!empty($emendamento)) {
$forms["emendamento"] = [getDecryptFormInfo($emendamento,"emendamento")];
if ($emendamento["open"] == "S") {
if (!empty($emendamentoSecretato) && $emendamento["accettata"] == "S") {
$forms["emendamento"][] = getDecryptFormInfo($emendamentoSecretato,"emendamentoSecretato");
}
} else {
if (!empty($emendamentoSecretato) && $emendamento["accettata"] == "S") {
$forms["emendamento"][] = __("Richiesto oscuramento");
}
}
}
} else {
if (!empty($bustaSecretata)) {
$forms["busta"][] = __("Richiesto oscuramento");
}
if (!empty($emendamento)) {
$forms["emendamento"] = [__("Richiesto emendamento")];
}
}
}
}
?>
| = $richiesta["titolo"] ?> |
class="text-center" width="20%">
if (empty($forms)) {
echo __("Non presentato");
} else {
if ($valutazione) {
$formInfo = reset($forms);
include __DIR__ . "/partials/form.php";
} else {
if (!empty($forms["busta"])) {
foreach($forms["busta"] AS $formInfo) {
if (is_array($formInfo)) {
include __DIR__ . "/partials/form.php";
} else {
alertManager::printInfoCompact($formInfo);
}
}
}
if (!empty($forms["emendamento"])) {
?>
|
foreach($forms["emendamento"] AS $formInfo) {
if (is_array($formInfo)) {
include __DIR__ . "/partials/form.php";
} else {
alertManager::printInfoCompact($formInfo);
}
}
}
}
}
?>
|
} ?>
} else {
?>
= __("Impossibile procedere") ?>
}
}
}
}
}
if ($error) {
header('HTTP/1.0 403 Forbidden');
die();
}