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.
149 righe
6.1 KiB
149 righe
6.1 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
|
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_GET["codice"])) { |
|
$contratto = stipula::init($_GET["codice"]); |
|
if ($contratto !== false) { |
|
$record = $contratto->info; |
|
$breadcrumb = array(); |
|
$breadcrumb["/".$radice."/"] = Modulo::getInfo($radice)["titolo"]; |
|
$breadcrumb = $contratto->getBreadcrumb($breadcrumb); |
|
$breadcrumb[""] = __("Pannello"); |
|
|
|
include_once ($beRoot."/layout/top.php"); |
|
|
|
$stati = stipula::getStati(); |
|
$stato = $stati[$record["stato"]]; |
|
$alertManager = new alertManager("contratto-{$record["codice"]}"); |
|
?> |
|
<div id="commands" class="mb-5"> |
|
<div class="commands container-fluid clearfix"> |
|
<div class="btn-group flex-wrap float-right"> |
|
<? if ($_SESSION["utente"]->gerarchia <= 9) { ?> |
|
<? if (!empty($record["stato"]) > 0) { ?> |
|
<button class="btn btn-danger" onClick="if (confirm('<?= __("Sei sicuro di voler procedere?") ?>')) { showModalWithURL('/backend/contratti/oneStepBehind.php?codice=<?= $record["codice"] ?>'); }"><span class="fa fa-undo-alt"></span> <?= __("Porta allo step precedente") ?></button> |
|
<? } ?> |
|
<? } ?> |
|
<? if ($_SESSION["utente"]->canAssignPermissions()) { ?> |
|
<button type="button" class="btn btn-danger" onClick="managePermessi('contratti','<?= $record["codice"] ?>','<?= $record["codice_ente"] ?>')"> |
|
<span class="fa fa-lock"></span> <?= __("Permessi") ?> |
|
</button> |
|
<? } ?> |
|
<? $alertManager->printAlertModalButton() ?> |
|
<button type="button" class="btn btn-primary" onClick="openChat('contratti','<?= $record["codice"] ?>','<?= $record["codice_ente"] ?>')"> |
|
<span class="fa fa-envelope"></span> <?= __("Chat interna") ?> |
|
<? $unread = Communicator::countUnreadInitiativeChat('contratti',$record["codice"]); ?> |
|
<span id="badge-chat" class="badge"><?= (!empty($unread)) ? $unread : "" ?></span> |
|
</button> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="mt-5"> |
|
<h1 style="border-bottom: 5px solid <?= $stato["color"] ?>" class="clearfix"> |
|
<?= __("Contratto") ?> #<?= $record["id"] ?> |
|
<small class="float-right"><?= __($stato["titolo"]); ?></small> |
|
</h1> |
|
</div> |
|
<h3><?= $record["oggetto"] ?></h3> |
|
|
|
<? |
|
$filtri = []; |
|
$ris_tipi = stipula::getTipologie(); |
|
if (count($ris_tipi) > 0) { |
|
?> |
|
<div class="card card-body"> |
|
<div class="row"> |
|
<? |
|
foreach($ris_tipi AS $id_tipo => $rec_tipo) { |
|
$filtri["tipo"] = $id_tipo; |
|
$ris_comandi = stipula::getModuli($filtri,$record["stato"]); |
|
if (count($ris_comandi) > 0) { |
|
$class = 12 / count($ris_tipi); |
|
$class= "col-sm-".$class; |
|
$tipo = __($rec_tipo["titolo"]); |
|
?> |
|
<div class="col-12 <?= $class ?>"> |
|
<span class="h3"> |
|
<? echo ucfirst($tipo) ?> |
|
</span> |
|
<? |
|
foreach($ris_comandi AS $id_comando => $rec) { |
|
$badge = ""; |
|
$show = true; |
|
$folder = explode("/",$rec["link"]); |
|
$temp = array_pop($folder); |
|
$folder = implode("/",$folder); |
|
|
|
if (file_exists($root.$folder."/check.php")) { include($root.$folder."/check.php"); } |
|
$hrefComando = $rec["link"]; |
|
$hrefComando .= (strpos($rec["link"], "?") === false) ? "?" : "&"; |
|
$hrefComando .= "codice={$record["codice"]}"; |
|
$lock = $contratto->checkLock($id_comando); |
|
$status = ""; |
|
if (file_exists($root.$folder."/_status.php") && $show) { |
|
include($root.$folder."/_status.php"); |
|
} |
|
if ($show && $_SESSION["utente"]->permission($radice,$_GET["codice"],$id_comando) && $_SESSION["utente"]->permission($rec["modulo_riferimento"])) { |
|
?> |
|
<a class="btn my-1 <?= $status ?> btn-block btn-<?=($lock==true) ? "secondary" : "info"?> text-left" href="<?= $hrefComando ?>" title="<?= __($rec["descrizione"] ?? $rec["titolo"]) ?>"> |
|
<span class=""><?= __($rec["titolo"]) ?></span> |
|
<? |
|
if ($rec["badge"] != "") { |
|
if (file_exists($root.$rec["badge"])) { |
|
include($root.$rec["badge"]); |
|
} |
|
} |
|
?> |
|
<div class="clearfix"></div> |
|
</a> |
|
<? |
|
} |
|
} ?> |
|
</div> |
|
<? } |
|
} |
|
?> |
|
</div> |
|
</div> |
|
<? |
|
|
|
$rogito = $contratto->getCostiSegreteria(); |
|
if(!empty($rogito)) { |
|
?> |
|
<div class="card card-body my-4"> |
|
<div class=""> |
|
<table class="w-100"> |
|
<?foreach($rogito as $titolo => $costo){?> |
|
<tr> |
|
<td> |
|
<b><?=ucfirst(__($titolo))?>: </b> |
|
</td> |
|
<td class="pl-2 text-right">€ <?=number_format($costo, 2, ",", ".")?></td> |
|
</tr> |
|
<?}?> |
|
</table> |
|
</div> |
|
|
|
</div> |
|
<? |
|
} else { |
|
$alertManager->addWarningAlert(__("Dati preliminari per il calcolo dei diritti di segreteria assenti"), "/backend/contratti/edit.php?codice={$record['codice']}"); |
|
|
|
} |
|
?> |
|
<? |
|
if (!empty($alertManager->alerts)) { |
|
$alertManager->printModal(); |
|
} |
|
} |
|
include_once ($beRoot."/layout/bottom.php"); |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/backend/index.php">'; |
|
die(); |
|
} |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/backend/index.php">'; |
|
die(); |
|
} |
|
?>
|
|
|