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.
142 righe
6.7 KiB
142 righe
6.7 KiB
<? |
|
$configPath = substr(__DIR__, 0, strpos(__DIR__, "public_html")) . "/config.php"; |
|
include_once($configPath); |
|
$id_modulo = "buste"; |
|
$cmd_info = gara::getInfoModulo($id_modulo); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"], $_GET["codice"], $id_modulo)) { |
|
$codice_round = $_GET["codice_round"] ?? NULL; |
|
$gara = gara::init($_GET["codice"], $codice_round); |
|
if (!empty($gara)) { |
|
$record = $gara->info; |
|
$round = $gara->round; |
|
$lock = $gara->checkLock($cmd_info["id"]); |
|
$lotti = $gara->getLotti(); |
|
$multiLotto = (count($gara->getLotti()) > 1); |
|
$titolo_modulo = __($cmd_info["titolo"]); |
|
$printSelect = true; |
|
if (isset($_GET["codice_lotto"])) { |
|
$printSelect = false; |
|
if (!empty($_GET["codice_lotto"])) { |
|
$gara->setLotto($_GET["codice_lotto"]); |
|
$lotto = $gara->lotto; |
|
} |
|
} |
|
if (!empty($round)) { $titolo_modulo .= " - " . $round["infoFase"]["titolo"]; } |
|
|
|
|
|
$breadcrumb = array(); |
|
$breadcrumb["/" . $radice . "/"] = Modulo::getInfo($radice)["titolo"]; |
|
$breadcrumb["/" . $radice . "/panel.php?codice=" . $record["codice"] . "&codice_round=" . $round["codice"]] = __("Pannello"); |
|
if (isset($_GET["codice_lotto"]) && $multiLotto) { |
|
$breadcrumb["/".$radice."/buste/index.php?codice=".$record["codice"]."&codice_round=".$round["codice"]] = __("Selezione lotto"); |
|
} |
|
$breadcrumb[""] = $titolo_modulo; |
|
|
|
include_once($beRoot . "/layout/top.php"); |
|
if ($printSelect) { |
|
$gara->printSelectLotto("{$_SERVER["PHP_SELF"]}?codice=".$record["codice"]."&codice_round=".$round["codice"],true); |
|
} else { |
|
?> |
|
<h1> |
|
<?= $titolo_modulo ?> |
|
</h1> |
|
<?= (!empty($lotto)) ? "<h4><span class='fa fa-list'></span> {$lotto["oggetto"]}</h4>" : "" ?> |
|
<div class="row mb-2"> |
|
<? |
|
$buste = $gara->busteDisponibili(); |
|
$col = 12 / count($buste); |
|
foreach ($buste as $id_busta => $busta) { |
|
?> |
|
<div class="col-12 col-lg-<?= $col ?>"> |
|
<div class="card"> |
|
<div class="card-header text-center"> |
|
<span class="fa fa-folder fa-2x"></span><br> |
|
<strong><?= __($busta["titolo"]) ?></strong> |
|
</div> |
|
<div class="card-body" id="richieste-<?= $id_busta ?>"> |
|
<? |
|
$richieste = $gara->getRichieste($id_busta); |
|
if (!empty($richieste)) { |
|
$printConfirm = true; |
|
foreach ($richieste as $input) { |
|
$id = $input["codice"]; |
|
include("tr-edit.php"); |
|
} |
|
} else { |
|
$printAuto = true; |
|
} |
|
?> |
|
</div> |
|
<? if (!$lock) { ?> |
|
<div class="card-footer"> |
|
<button onclick="showModalWithURL('edit.php?codice_gara=<?= $record["codice"] ?>&codice_lotto=<?= $lotto["codice"] ?? null ?>&codice_round=<?= $round["codice"] ?>&busta=<?= $id_busta ?>'); return false" class="btn btn-sm btn-info btn-block"><span class="fa fa-plus-circle"></span> <?= __("Aggiungi nuovo") ?></button> |
|
</div> |
|
<? } ?> |
|
</div> |
|
</div> |
|
<? if (!$lock) { ?> |
|
<script> |
|
$("#richieste-<?= $id_busta ?>").sortable({ |
|
handle: ".handle", |
|
update: function(event, ui) { |
|
$(".input-edit", "#richieste-<?= $id_busta ?>").each(function(index, el) { |
|
$(this).find(".ordinamento").val(index); |
|
}); |
|
$.ajax({ |
|
type: "POST", |
|
url: '/backend/gare/buste/save-order.php', |
|
data: $('.ordinamento').serialize(), |
|
async: true |
|
}); |
|
} |
|
}); |
|
// $( "#sortable" ).disableSelection(); |
|
</script> |
|
<? } ?> |
|
<? } ?> |
|
</div> |
|
<? if (!$lock && isset($printAuto) && $gara->round["infoFase"]["graduatoria"]) { ?> |
|
<div> |
|
<? |
|
alertManager::printWarningCompact(__("Integra buste mancanti"),__("Il sistema configurerà in automatico una richiesta cumulativa per ogni tipologia di busta priva di ulteriori istanze.")); |
|
?> |
|
<form rel="validate" method="post" action="/backend/gare/buste/auto.php" id="auto-form"> |
|
<input id="token" type="hidden" name="token" value="<?= tokenGen() ?>"> |
|
<input id="codice_gara" type="hidden" name="codice_gara" value="<?= $record["codice"] ?>"> |
|
<? if (!empty($lotto)) { ?><input id="codice_lotto" type="hidden" name="codice_lotto" value="<?= $lotto["codice"] ?>"><? } ?> |
|
<input id="codice_round" type="hidden" name="codice_round" value="<?= $round["codice"] ?>"> |
|
<button type="button" class="btn btn-block btn-lg btn-warning" onClick="if (confirm('<?= __("Vuoi continuare?") ?>')) { $('#auto-form').submit(); } else { return false; }"> |
|
<span class="fa fa-magic"></span> <?= __("Integra buste mancanti") ?> |
|
</button> |
|
</form> |
|
</div> |
|
<? } ?> |
|
<? if (!$lock && isset($printConfirm) && !$gara->configurazioneBusteConfermata()) { ?> |
|
<div class="card card-body my-2"> |
|
<? |
|
alertManager::printInfoCompact(__("Conferma configurazione richieste"),__("Al fine di evitare problemi in fase di partecipazione degli operatori economici si richiede conferma che la configurazione presente sia corretta.")); |
|
?> |
|
<form rel="validate" method="post" action="/backend/gare/buste/confirm.php" id="confirm-form"> |
|
<input id="token" type="hidden" name="token" value="<?= tokenGen() ?>"> |
|
<input id="codice_gara" type="hidden" name="codice_gara" value="<?= $record["codice"] ?>"> |
|
<? if (!empty($lotto)) { ?><input id="codice_lotto" type="hidden" name="codice_lotto" value="<?= $lotto["codice"] ?>"><? } ?> |
|
<input id="codice_round" type="hidden" name="codice_round" value="<?= $round["codice"] ?>"> |
|
<button type="button" class="btn btn-block btn-lg btn-success" onClick="if (confirm('<?= __("Vuoi continuare?") ?>')) { $('#confirm-form').submit(); } else { return false; }"> |
|
<span class="fa fa-check"></span> <?= __("Conferma configurazione") ?> |
|
</button> |
|
</form> |
|
</div> |
|
<? } ?> |
|
<? |
|
$gara->alertModifichePericolose($id_modulo); |
|
} |
|
include_once($beRoot . "/layout/bottom.php"); |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
?>
|