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.
84 righe
3.6 KiB
84 righe
3.6 KiB
<? |
|
if (isset($this) && is_a($this,"anac") && isset($suggerimenti) && isset($key) && !empty($suggerimenti[$key])) { |
|
$moduli = self::moduliSuggerimenti(); |
|
$modals = []; |
|
$total = 0; |
|
foreach($suggerimenti[$key] AS $suggerimento) { |
|
if (!empty($suggerimento["data"])) { |
|
foreach($suggerimento["data"] AS $chiave => $valore) { |
|
$modals[$chiave][] = ["source" => $suggerimento["source"],"value"=>$valore]; |
|
} |
|
} |
|
} |
|
if (!empty($modals)) { |
|
foreach($modals AS $campo => $valori) { |
|
$currentTotal = $total; |
|
?> |
|
<div id="suggerimentiANAC<?= $campo ?>" class="modal fade" tabindex="-1" aria-labelledby="suggerimentiANACLabel<?= $campo ?>" aria-hidden="true"> |
|
<div class="modal-dialog modal-lg"> |
|
<div class="modal-content"> |
|
<div class="modal-header"> |
|
<h5 class="modal-title" id="alertsModalLabel<?= $campo ?>"><?= __("Suggerimenti") ?></h5> |
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
|
<span aria-hidden="true">×</span> |
|
</button> |
|
</div> |
|
<div class="modal-body"> |
|
<table class="table table-striped"> |
|
<thead> |
|
<tr> |
|
<th><?= __("Origine") ?></th> |
|
<th><?= __("Suggerimento") ?></th> |
|
<th></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<? |
|
$first = true; |
|
foreach($valori AS $valore) { |
|
if (!empty($valore["value"]) || $valore["value"] === "0") { |
|
$total++; |
|
?> |
|
<tr> |
|
<td width="150"><strong><?= $moduli[$valore["source"]]["titolo"] ?></strong></td> |
|
<td class="text-center" id="suggerimento-<?= $valore["source"] ?>-<?= $campo ?>"><?= $valore["value"] ?></td> |
|
<td width="150"> |
|
<button class="btn btn-block btn-sm btn-info <?= ($first) ? "firstButtonSuggerimentoANAC" : "" ?>" onClick="$('#<?= $campo ?>').val($('#suggerimento-<?= $valore["source"] ?>-<?= $campo ?>').html()).trigger('chosen:updated');"> |
|
<span class="fa fa-check"></span> <?= __("Importa") ?> |
|
</button> |
|
</td> |
|
</tr> |
|
<? |
|
$first = false; |
|
} |
|
} |
|
?> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<? if ($currentTotal < $total) { ?> |
|
<div class="d-none" id="buttonSuggerimentiANAC<?= $campo ?>"> |
|
<button type="button" data-toggle="modal" data-target="#suggerimentiANAC<?= $campo ?>" class="btn btn-info btn-sm text-right btn-block p-1"> |
|
<small><span class="fa fa-exclamation-circle"></span> <?= __("Suggerimenti") ?> <span class="badge badge-danger"><?= count($valori) ?></span></small> |
|
</button> |
|
</div> |
|
<script> |
|
$("#<?= $campo ?>").parents(".form-group").append($("#buttonSuggerimentiANAC<?= $campo ?>").html()); |
|
</script> |
|
<? } ?> |
|
<? |
|
} |
|
if (!empty($total)) { |
|
?> |
|
<script> |
|
$("#totaleSuggerimentiANAC").html("<?= $total ?>"); |
|
$("#buttonAllSuggerimentiANAC").show(); |
|
</script> |
|
<? |
|
} |
|
} |
|
} |
|
?>
|