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.
166 righe
8.2 KiB
166 righe
8.2 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_GET["codice"])) { |
|
$codice_round = $_GET["codice_round"] ?? NULL; |
|
$concorso = concorso::init($_GET["codice"],$codice_round); |
|
if ($concorso !== false) { |
|
$record = $concorso->info; |
|
$round = $concorso->round; |
|
$lotti = $concorso->getLotti(); |
|
$breadcrumb = array(); |
|
$breadcrumb["/".$radice."/"] = Modulo::getInfo($radice)["titolo"]; |
|
$breadcrumb[""] = __("Pannello"); |
|
include_once ($beRoot."/layout/top.php"); |
|
$stati = concorso::getStati(); |
|
$stato = $stati[$record["stato"]]; |
|
if ($record["stato"] == 20 && strtotime($round["pubblicazione"]) > time()) { |
|
$stato["titolo"] = "Programmata pubblicazione"; |
|
} |
|
$alertManager = new alertManager("concorso-{$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/concorsi/oneStepBehind.php?codice=<?= $record["codice"] ?>'); }"><span class="fa fa-undo-alt"></span> <?= __("Porta allo step precedente") ?></button> |
|
<? } ?> |
|
<? if (!empty($record["public_key"])) { ?> |
|
<button class="btn btn-danger" onClick="if (confirm('<?= __("Sei sicuro di voler procedere?") ?>')) { showModalWithURL('/backend/concorsi/removePublic.php?codice=<?= $record["codice"] ?>'); }"><span class="fa fa-key"></span> <?= __("Rimuovi chiave") ?></button> |
|
<? } ?> |
|
<? } ?> |
|
<? if ($_SESSION["utente"]->canAssignPermissions()) { ?> |
|
<button type="button" class="btn btn-danger" onClick="managePermessi('concorsi','<?= $record["codice"] ?>','<?= $record["codice_ente"] ?>')"> |
|
<span class="fa fa-lock"></span> <?= __("Permessi") ?> |
|
</button> |
|
<? } ?> |
|
<? $alertManager->printAlertModalButton() ?> |
|
<button type="button" class="btn btn-info" onClick="showModalWithURL('/backend/calendar.php?month=<?= date('m') ?>&year=<?= date('Y') ?>&modal=1&modulo=concorsi&codice_elemento=<?= $record["codice"] ?>')"> |
|
<span class="fa fa-calendar"></span> <?= __("Scadenzario") ?> |
|
</button> |
|
<button type="button" class="btn btn-info" onClick="showModalWithURL('/backend/listAttivita.php?modal=1&modulo=concorsi&codice_elemento=<?= $record["codice"] ?>')"> |
|
<span class="fa fa-road"></span> <?= __("Roadmap") ?> |
|
</button> |
|
<button type="button" class="btn btn-primary" onClick="openChat('concorsi','<?= $record["codice"] ?>','<?= $record["codice_ente"] ?>')"> |
|
<span class="fa fa-envelope"></span> <?= __("Chat interna") ?> |
|
<? $unread = Communicator::countUnreadInitiativeChat('concorsi',$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"> |
|
<?= __("concorso") ?> #<?= $record["id"] ?> |
|
<small class="float-right"><?= __($stato["titolo"]); ?></small> |
|
</h1> |
|
</div> |
|
<h3><?= $record["oggetto"] ?></h3> |
|
<? |
|
$rounds = $concorso->getRounds(); |
|
if (count($rounds) > 1) { |
|
?> |
|
<div class="card card-body p-2 mb-2"> |
|
<div class="d-flex flex-row"> |
|
<? |
|
$class = round(12 / count($rounds)); |
|
$cont = []; |
|
foreach($rounds AS $rnd) { |
|
if (!isset($cont[$rnd["numero"]])) { |
|
$cont[$rnd["numero"]] = 0; |
|
} |
|
$cont[$rnd["numero"]]++; |
|
?> |
|
<div class="mx-2 text-center"> |
|
<a href="/backend/concorsi/panel.php?codice=<?= $record["codice"] ?>&codice_round=<?= $rnd["codice"] ?>" class="btn py-2 px-5 btn-block <?= ($rnd["codice"] == $concorso->round["codice"]) ? "btn-success" : "btn-secondary" ?>"> |
|
<span class="<?= ($rnd["codice"] == $concorso->round["codice"]) ? "fa fa-check-circle" : "far fa-circle" ?>"></span> <?= __("Fase") ?> <?= $rnd["numero"] ?> |
|
</a> |
|
</div> |
|
<? |
|
} |
|
?> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
$filtri = []; |
|
$filtri["scaduta"] = false; |
|
$filtri["apertura"] = false; |
|
if (strtotime($round["scadenza"])<=time()) { unset($filtri["scaduta"]); } |
|
if (strtotime($round["apertura"])<=time()) { unset($filtri["apertura"]); } |
|
$filtri["fase_attiva"] = $concorso->info["fase_attiva"]; |
|
$filtri["fase_selezionata"] = $concorso->round["numero"]; |
|
if ($concorso->lastRound) { |
|
$filtri["lastRound"] = true; |
|
} |
|
$ris_tipi = concorso::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; |
|
$stati = $concorso->getStatoPannello(); |
|
$statoMin = $stati["min"]; |
|
$statoMax = $stati["max"]; |
|
$ris_comandi = concorso::getModuli($filtri,$statoMax); |
|
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); |
|
$hrefComando = $rec["link"]; |
|
$hrefComando .= (strpos($rec["link"], "?") === false) ? "?" : "&"; |
|
$hrefComando .= "codice={$record["codice"]}&codice_round={$round["codice"]}"; |
|
if (file_exists($root.$folder."/check.php")) { include($root.$folder."/check.php"); } |
|
$lock = $concorso->checkLock($id_comando,$statoMin); |
|
$status = ""; |
|
if (file_exists($root.$folder."/_status.php") && ($show || empty($rec["stato_minimo"]) || $rec["stato_minimo"] <= 20)) { |
|
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"?>" href="<?= $hrefComando ?>" title="<?= __($rec["descrizione"] ?? $rec["titolo"]) ?>"> |
|
<span class="float-left"><?= __($rec["titolo"]) ?></span> |
|
<? if ($rec["badge"] != "") { |
|
if (file_exists($root.$rec["badge"])) { include($root.$rec["badge"]); } |
|
} ?> |
|
<div class="clearfix"></div> |
|
</a> |
|
<? |
|
} |
|
} ?> |
|
</div> |
|
<? } |
|
} |
|
if (!empty($alertManager->alerts)) { |
|
$alertManager->printModal(); |
|
} |
|
?> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
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(); |
|
} |
|
?>
|
|
|