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.
128 righe
6.4 KiB
128 righe
6.4 KiB
<? |
|
if (isset($this) && is_a($this,"DGUE") && $this->checkAdminPermission()) { |
|
$criteria = $this->availableCriteria(); |
|
if (!empty($criteria)) { |
|
$selected = $this->selectedCriteria(); |
|
if (!$this->lock) { ?> |
|
<form action="/backend/common/dgue/save.php" method="POST" rel="validate"> |
|
<input id="token" type="hidden" name="token" value="<?= tokenGen() ?>"> |
|
<input id="modulo" type="hidden" name="modulo" value="<?= $this->modulo ?>"> |
|
<input id="codice_elemento" type="hidden" name="codice_elemento" value="<?= $this->elemento ?>"> |
|
<? } ?> |
|
<div id="commands" class="mb-5"> |
|
<div class="commands container-fluid"> |
|
<div class="row"> |
|
<div class="col-12 text-right"> |
|
<? if (!empty($selected)) { ?> |
|
<a href="/backend/common/dgue/getPreview.php?modulo=<?= $this->modulo ?>&codice_elemento=<?= $this->elemento ?>&token=<?= tokenGen() ?>" class="btn btn-primary" target="_blank"> |
|
<span class="fa fa-file-pdf"></span> <?= __("Download Richiesta") ?> - PDF |
|
</a> |
|
<a href="/backend/common/dgue/getXML.php?modulo=<?= $this->modulo ?>&codice_elemento=<?= $this->elemento ?>&token=<?= tokenGen() ?>" class="btn btn-info" target="_blank"> |
|
<span class="fa fa-code"></span> <?= __("Download Richiesta") ?> - XML |
|
</a> |
|
<? if (!$this->lock) { ?> |
|
<? if ($this->abilitaSwitchVersion) { |
|
$versions = self::versions(); |
|
$versionsKey = array_keys($versions); |
|
$otherVersions = array_diff($versionsKey,[$this->version]); |
|
if (!empty($otherVersions)) { |
|
?> |
|
<div class="btn-group" role="group"> |
|
<button id="convertiDGUE" type="button" class="btn btn-warning dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="fa fa-sync"></span> <?= __("Converti a normativa") ?></button> |
|
<div class="dropdown-menu" aria-labelledby="convertiDGUE"> |
|
<? |
|
foreach($otherVersions as $otherVersion) { |
|
$otherVersion = reset($otherVersions); |
|
?> |
|
<button onClick="confirmBeforeSubmit(<?= $this->elemento ?>,'/backend/common/dgue/switch.php','token=<?= tokenGen() ?>&version=<?= $otherVersion ?>&modulo=<?= $this->modulo ?>')" type="button" class="btn dropdown-item"><?= $versions[$otherVersion]["label"] ?></button> |
|
<? |
|
} |
|
?> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
}?> |
|
<button onClick="elimina(<?= $this->elemento ?>,'common/dgue','modulo=<?= $this->modulo ?>')" type="button" class="btn btn-danger"><span class="fa fa-times"></span> <?= __("Elimina") ?></button> |
|
<? } ?> |
|
<? } ?> |
|
<? if (!$this->lock) { ?> |
|
<button class="btn btn-info" type="button" onClick="$('.dgue-checkBox').not('.all-satisfied').prop('checked',true)"><?= __("Seleziona Tutto") ?></button> |
|
<button class="btn btn-secondary" type="button" onClick="$('.dgue-checkBox').not('.all-satisfied').prop('checked',false);"><?= __("Deseleziona Tutto") ?></button> |
|
<button class="btn btn-success"><span class="fa fa-save"></span> <?= __("Salva") ?></button> |
|
<? } ?> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
$gruppo = ""; |
|
$allSatisfied = false; |
|
$first = true; |
|
foreach($criteria AS $criterio) { |
|
if ($criterio["attivo"] == "S") { |
|
if ($criterio["obbligatorio"] == "N") { |
|
$criterio["selezionato"] = false; |
|
$collapse = ($allSatisfied && $criterio["livello1"] == "SELECTION") ? "collapse" : ""; |
|
$change = ""; |
|
$class = $criterio["livello1"]; |
|
$classInput = ""; |
|
if ($criterio["uuid"] == "7e7db838-eeac-46d9-ab39-42927486f22d") { |
|
$change="onClick='$(\".{$criterio["livello1"]}\").slideToggle(); $(\".{$criterio["livello1"]}\").find(\":input\").prop(\"checked\",false);'"; |
|
$class = "all-satisfied"; |
|
$classInput = "all-satisfied"; |
|
} |
|
if (in_array($criterio["codice"],$selected) !== false) { |
|
if ($criterio["uuid"] == "7e7db838-eeac-46d9-ab39-42927486f22d") { |
|
$allSatisfied = true; |
|
$collapse = ""; |
|
} |
|
$criterio["selezionato"] = true; |
|
} |
|
if ($criterio["livello2"] != "") { |
|
if ($gruppo != $criterio["livello1"]) { |
|
$gruppo = $criterio["livello1"]; |
|
if (!$first) { |
|
?> |
|
</div> |
|
</div> |
|
<? |
|
} else { |
|
$first = false; |
|
} |
|
?> |
|
<div class="card my-2"> |
|
<div class="card-header"> |
|
<h3 class="card-title m-0"><?= self::translateGroup($this->version)[$gruppo]['it'] ?></h3> |
|
</div> |
|
<div class="card-body py-0"> |
|
<? |
|
} |
|
?> |
|
<div class="<?= $class ?> <?= $collapse ?>"> |
|
<div class="row border-bottom no-gutter py-2 my-0"> |
|
<div class="col-1 text-center"> |
|
<input class="dgue-checkBox <?= $classInput ?>" type="checkbox" <?= $change ?> title="<?= $criterio["nome"] ?>" <?= ($this->lock) ? "disabled" : "" ?> name="criterio[<?= $criterio["codice"] ?>]" value="<?= $criterio["codice"] ?>" <?= (!empty($criterio["selezionato"])) ? "checked='checked'" : "" ?>></td> |
|
</div> |
|
<div class="col-11"> |
|
<strong class="h5"><?= $criterio["nome"] ?></strong><br> |
|
<?= $criterio["descrizione"] ?> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
?> |
|
</div> |
|
</div> |
|
<? |
|
if (!$this->lock) { ?> |
|
<button class="mt-2 btn btn-block btn-success"><span class="fa fa-save"></span> <?= __("Salva") ?></button> |
|
</form> |
|
<? } |
|
} |
|
} |
|
?>
|