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.
197 righe
8.8 KiB
197 righe
8.8 KiB
<? |
|
$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; |
|
?> |
|
<div id="keyTool" class="float-right text-center"> |
|
<div class="showKeySelect"> |
|
<?= __("Seleziona chiave") ?><br> |
|
<input type="file" id="chiave-show" title="<?= __("chiave privata") ?>" rel="S;0;0;F"/> |
|
</div> |
|
<div class="showKeyOk"> |
|
<div class="alert alert-success"> |
|
<span class="fa fa-key"></span> <?= __("Chiave caricata") ?> |
|
<button type="button" onClick='$("#chiave").val("");$("#private").val("");$(".private").val("");$(".showKeySelect").slideDown();$(".showKeyOk").slideUp();' title="<?= __("Rimuovi chiave") ?>" class="btn btn-sm btn-danger"><span class="fa fa-times"></span></button> |
|
</div> |
|
</div> |
|
</div> |
|
<h2><a href="#" onclick="showCompany(<?= $infoOE["codice"] ?>)"><?= $infoOE["ragione_sociale"] ?></a></h2> |
|
<div class="table-responsive"> |
|
<table class="table table-striped table-hover"> |
|
<? |
|
|
|
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")]; |
|
} |
|
} |
|
|
|
} |
|
} |
|
?> |
|
<tr> |
|
<td><?= $richiesta["titolo"] ?></td> |
|
<td <?= (empty($forms) || count($forms) === 1) ? "colspan='2'" : "" ?> 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"])) { |
|
?> |
|
</td><td class="text-center" width="20%"> |
|
<? |
|
foreach($forms["emendamento"] AS $formInfo) { |
|
if (is_array($formInfo)) { |
|
include __DIR__ . "/partials/form.php"; |
|
} else { |
|
alertManager::printInfoCompact($formInfo); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
?> |
|
</td> |
|
</tr> |
|
<? } ?> |
|
</table> |
|
<script> |
|
<? if ($unlock) { ?> |
|
if ($("#private").val() != "") { |
|
$(".showKeySelect").hide(); |
|
$(".private").val($("#private").val()); |
|
} else { |
|
$(".showKeyOk").hide(); |
|
} |
|
document.getElementById("chiave-show").addEventListener('change', handleFileSelect, false); |
|
<? } else { ?> |
|
$("#keyTool").hide(); |
|
<? } ?> |
|
</script> |
|
</div> |
|
<? |
|
} else { |
|
?> |
|
<div class="alert alert-danger text-center"> |
|
<span class="fa fa-exclamation-triangle fa-5x"></span><br> |
|
<strong><?= __("Impossibile procedere") ?></strong> |
|
</div> |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
}
|