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.
113 righe
5.3 KiB
113 righe
5.3 KiB
<? |
|
if (isset($id_modulo)) { |
|
$cmd_info = gara::getInfoModulo($id_modulo); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_GET["codice"],$id_modulo) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"]) ) { |
|
$codice_round = $_GET["codice_round"] ?? NULL; |
|
$gara = gara::init($_GET["codice"],$codice_round); |
|
if (!empty($gara)) { |
|
$record = $gara->info; |
|
$round = $gara->round; |
|
$lotto = $gara->lotto; |
|
$lock = $gara->checkLock($cmd_info["id"]); |
|
$titolo_modulo = __($cmd_info["titolo"]); |
|
$idRiferimento = "gare-".$record["codice"]."-".$round["codice"]; |
|
$editor = new editorManager($id_modulo,$idRiferimento); |
|
$breadcrumb = array(); |
|
$breadcrumb["/".$radice."/"] = Modulo::getInfo($radice)["titolo"]; |
|
$breadcrumb["/".$radice."/panel.php?codice=".$record["codice"]."&codice_round=".$round["codice"]] = __("Pannello"); |
|
$breadcrumb["/".$radice."/{$id_modulo}/index.php?codice=".$record["codice"]."&codice_round=".$round["codice"]] = $titolo_modulo; |
|
if (empty($editor->latest()) && (!empty($_GET["codice_modello"]))) { |
|
$compilatore = Compilatore::init($_GET["codice_modello"]); |
|
if (!empty($compilatore->info)) { |
|
$breadcrumb["/".$radice."/{$id_modulo}/questionario.php?codice_modello=".$compilatore->info["codice"]."&codice=".$record["codice"]."&codice_round=".$round["codice"]] = __("Questionario"); |
|
} |
|
} |
|
$breadcrumb[""] = __("Modello"); |
|
include_once ($beRoot."/layout/top.php"); |
|
?> |
|
<h1> |
|
<?= $titolo_modulo ?> |
|
</h1> |
|
<? |
|
|
|
if (!$lock) { |
|
$ids = $editor->getIDS(); |
|
?> |
|
<form rel="validate" method="post" action="save.php" id="edit-form"> |
|
<div id="commands" class="mb-5"> |
|
<div class="commands container-fluid"> |
|
<div class="row"> |
|
<div class="col-12 text-right"> |
|
<button onClick="$('#allega').val('N');" class="btn btn-sm btn-warning"><span class="fa fa-save"></span> <?= __("Salva") ?></button> |
|
<button onClick="$('#allega').val('S');" class="btn btn-sm btn-primary"><span class="fa fa-paperclip"></span> <?= __("Salva ed allega") ?></button> |
|
<? |
|
if (!empty($ids["index"])) { |
|
?> |
|
<button type="button" onclick="elimina('<?= $record["codice"] ?>','gare/<?= $id_modulo ?>','token=<?= tokenGen() ?>&round=<?= $round["codice"] ?>')" class="btn btn-sm btn-danger"><span class="fa fa-times"></span> <?= __("Rielabora documento") ?></button> |
|
<? |
|
} |
|
$editor->printVersionButton(); |
|
?> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<input id="token" type="hidden" name="token" value="<?= tokenGen() ?>"> |
|
<input id="codice" type="hidden" name="codice" value="<?= $record["codice"] ?>"> |
|
<input id="codice_round" type="hidden" name="codice_round" value="<?= $round["codice"] ?>"> |
|
<input id="allega" type="hidden" name="allega" value="N"> |
|
<? } else { ?><div id="edit-form"><?} |
|
if (!empty($editor->latest())) { |
|
$editor->edit(); |
|
} else { |
|
if (!empty($_GET["codice_modello"])) { |
|
if (!isset($compilatore)) { |
|
$compilatore = Compilatore::init($_GET["codice_modello"]); |
|
} |
|
if (!empty($compilatore->info)) { |
|
if (empty($gara->getLottiOEPV())) { |
|
$criterio = "prezzo"; |
|
} else { |
|
if (empty($gara->getLottiMP())) { |
|
$criterio = "vantaggiosa"; |
|
} |
|
} |
|
if (!isset($criterio)) { |
|
$criterio = null; |
|
} |
|
$compilatore->modalita = $gara->info["modalita"]; |
|
$compilatore->criterio = $criterio; |
|
$compilatore->importo = $gara->info["prezzoRiferimento"]; |
|
$compilatore->opzioni = Compilatore::getQuestionario($id_modulo."-".$idRiferimento); |
|
$compilatore->soa = $gara->getDettaglioSOA()["vincoli"] ?? null; |
|
$vocabolario = editorManager::defaultVocabolario(); |
|
include($beRoot."/gare/modelli/vocabolario.php"); |
|
$content = $compilatore->getCorpo(); |
|
$content = editorManager::replacePlaceholder($content,$vocabolario); |
|
editorManager::printEditor($content); |
|
} |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
} |
|
if (!$lock) { ?> |
|
</form> |
|
<? } else { ?> |
|
</div> |
|
<script>$(":input").not(".ignore-lock").attr("disabled","disabled").trigger("chosen:updated");</script> |
|
<? } |
|
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(); |
|
} |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
?>
|
|
|