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.
125 righe
5.3 KiB
125 righe
5.3 KiB
<? |
|
$error = true; |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (!empty($_SESSION["utente"]) && !empty($_SESSION["ente"]) && !empty($_GET["codice"])) { |
|
$comunicazione = Communicator::getMessage($_GET["codice"]); |
|
|
|
if (!empty($comunicazione) > 0) { |
|
$error = false; |
|
?> |
|
<div class="text-right"> |
|
<a class="btn btn-sm btn-primary" |
|
href="/comunicazioni/partial/downloadSinglePDF.php?token=<?= tokenGen() ?>&codice=<?= $comunicazione['codice'] ?>&type=single_pdf" |
|
title="<?= __('Download PDF') ?>" |
|
target="_blank"> |
|
<i class="far fa-file-alt mr-2"></i> |
|
<?= __('Download PDF') ?> |
|
</a> |
|
</div> |
|
<? |
|
if (!empty($_SESSION["utente"]->oe)) { |
|
$update = $pdo->prepare("UPDATE r_comunicazioni_utenti SET r_comunicazioni_utenti.letto = 'S' WHERE codice_comunicazione = :codice AND codice_operatore = :codice_operatore "); |
|
$update->bindValue(":codice_operatore",$_SESSION["utente"]->oe["codice"]); |
|
$update->bindValue(":codice",$comunicazione["codice"]); |
|
$update->execute(); |
|
if ($update->rowCount() > 0) { |
|
?> |
|
<script> |
|
tableComunicazioni.draw("page"); |
|
</script> |
|
<? |
|
} |
|
} |
|
$comunicazione["corpo"] = preg_replace('/(http.+)\/allegati\/open\.php\?codice\=/',"/allegati/open.php?codice=", $comunicazione["corpo"]); |
|
if (strpos($comunicazione["corpo"],"https://www.tuttogare.it/documenti/allegati/")) { |
|
// GESTIONE ECCEZIONE PER LINK PRESENTI IN COMUNICAZIONE DERIVANTI DA MIGRAZIONE |
|
$re = '/https:\/\/www\.tuttogare\.it\/documenti\/allegati\/([0-9]+)\/(.+)"/m'; |
|
preg_match_all($re, $comunicazione["corpo"], $matches, PREG_SET_ORDER, 0); |
|
if (!empty($matches)) { |
|
foreach($matches AS $match) { |
|
$newID = getMatchFrom2($match[1],"b_gare"); |
|
if (!empty($newID)) { |
|
$newFile = $pdo->go("SELECT * FROM b_fileManager WHERE sourceID = :id AND name = :titolo ",[":id"=>$newID,":titolo"=>$match[2]])->fetch(PDO::FETCH_ASSOC); |
|
if (!empty($newFile)) { |
|
$url = filesManager::getAttachURL($newFile,$newFile["sourceID"],$newFile["sourceType"],0); |
|
if (!empty($url)) { |
|
$comunicazione["corpo"] = str_replace($match[0],$url.'"',$comunicazione["corpo"]); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if (isset($comunicazione["protocollo_interno"])) { |
|
?> |
|
<div class="text-right"> |
|
<? |
|
if (!empty($comunicazione["protollo"])) { |
|
?> |
|
<span class="badge badge-success text-left"><?= __("Protocollo") ?> <?= $comunicazione["protocollo"] ?> - <?= mysql2date($comunicazione["data_protocollo"]) ?></span> |
|
<? |
|
} else { |
|
?> |
|
<span class="badge badge-info text-left"><?= __("Identificativo interno") ?> <?= $comunicazione["protocollo_interno"] ?> - <?= mysql2date($comunicazione["timestamp_interno"]) ?></span> |
|
<? |
|
} |
|
?> |
|
</div> |
|
<? } ?> |
|
<strong><?= $comunicazione["oggetto"] ?></strong><br> |
|
<?= $comunicazione["corpo"] ?> |
|
<br><br> |
|
<? |
|
if (!empty($comunicazione["sezione"]) && $comunicazione["codice_gara"] > 0) { |
|
$modulo = Modulo::getInfo($comunicazione["sezione"]); |
|
if (!empty($modulo)) { |
|
$codice_gara = $comunicazione["codice_gara"]; |
|
?> |
|
<div class="alert alert-info"> |
|
<a href="/<?= $comunicazione["sezione"] ?>/dettaglio.php?codice=<?= $codice_gara ?>"> |
|
<span class="fa fa-external-link-alt"></span> <?= __("Procedura di riferimento") ?> |
|
</a> |
|
</div> |
|
<? |
|
} |
|
} |
|
|
|
if ($_SESSION["utente"]->gerarchia < 100) { |
|
$sql = "SELECT b_operatori_economici.codice, b_operatori_economici.ragione_sociale, |
|
r_comunicazioni_utenti.codice AS protocollo_interno, |
|
r_comunicazioni_utenti.timestamp AS timestamp_interno, |
|
r_comunicazioni_utenti.protocollo, |
|
r_comunicazioni_utenti.data_protocollo, |
|
r_comunicazioni_utenti.ricevute, |
|
r_comunicazioni_utenti.pec |
|
FROM r_comunicazioni_utenti LEFT JOIN b_operatori_economici ON b_operatori_economici.codice = r_comunicazioni_utenti.codice_operatore |
|
WHERE r_comunicazioni_utenti.codice_comunicazione = :codice "; |
|
$ris = $pdo->go($sql,array(":codice"=>$comunicazione["codice"])); |
|
if ($ris->rowCount() > 0) { |
|
?> |
|
<div class="card"> |
|
<div class="card-body"> |
|
<h3><?= __("Destinatari") ?></h3> |
|
<? |
|
while($operatore = $ris->fetch(PDO::FETCH_ASSOC)) { |
|
if (!empty($operatore["ragione_sociale"])) { ?> |
|
<a href="#" onClick="showCompany(<?= $operatore["codice"] ?>);" title="<?= __('visualizza') ?>"><?= $operatore["ragione_sociale"] ?></a><br> |
|
<? |
|
} else { |
|
echo "{$operatore["pec"]}<br>"; |
|
} |
|
} |
|
?> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|
|
|