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.
122 righe
4.2 KiB
122 righe
4.2 KiB
|
|
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$id_modulo = "contratti.documentale"; |
|
|
|
if (!empty($_GET['codice_contratto']) && !empty($_GET['codice_classe_documentale']) && !empty($_SESSION["utente"]) ) { |
|
$contratto = stipula::init($_GET['codice_contratto']); |
|
|
|
if (!empty($contratto)) { |
|
|
|
$return = array(); |
|
$return["draw"] = (int)$_GET["draw"]; |
|
$return["recordsTotal"] = (int)0; |
|
$return["recordsFiltered"] = (int)0; |
|
|
|
$filters = [ |
|
'codice_contratto' => $contratto->info['codice'], |
|
'codice_classe_documentale' => $_GET['codice_classe_documentale'] |
|
]; |
|
|
|
switch($_GET["order"][0]["column"]) { |
|
case "0": |
|
null ; |
|
break; |
|
case "1": |
|
null ; |
|
break; |
|
case "2": |
|
null ; |
|
break; |
|
case "3": |
|
null; |
|
break; |
|
case "4": |
|
null; |
|
break; |
|
case "5": |
|
$orderKey = 'timestamp_creazione'; |
|
break; |
|
} |
|
|
|
if ($_GET["order"][0]["dir"] == "desc") { |
|
$orders[$orderKey] = "DESC"; |
|
} else { |
|
$orders[$orderKey] = "ASC"; |
|
} |
|
|
|
$richieste = RichiestaDocumentale::getRichieste($filters, $orders); |
|
$classe_documentale = ContrattoDocumentale::getInfo($_GET['codice_classe_documentale'])->info; |
|
|
|
if (!empty($richieste)) { |
|
|
|
$return["recordsTotal"] = (int)count($richieste); |
|
|
|
$richieste = rispostaDocumentale::getBadge($contratto->info['codice'], $richieste, "sa"); |
|
|
|
$countRecordFiltered = 0; |
|
foreach($richieste as $richiesta) { |
|
|
|
$oe = oeManager::getOE($richiesta['codice_oe']); |
|
|
|
$row = array(); |
|
|
|
$row[] = "<span class='pr-2 float-right'><span class='fa fa-circle ". richiestaDocumentale::getBadgeGruppoColore($richiesta)."'></span></span>"; |
|
$row[] = "<strong>". $classe_documentale['titolo'] ."</strong>"; |
|
|
|
if (!empty($oe['codice'])) { |
|
$row[] = "<span>". $oe['ragione_sociale'] ."</span>"; |
|
} |
|
$row[] = "<div>". ($richiesta['bloccante'] == 'S') ? __('Si') : __('No') ."</div>"; |
|
$row[] = "<strong>" . mysql2datetime($richiesta["timestamp_creazione"]) . "</strong>"; |
|
|
|
if (!empty($richiesta['statoLabel'])) { |
|
$row[] = "<span class='text-". $richiesta['statoLabel']['class'] ."' >". __($richiesta['statoLabel']['titolo']) . "</span>"; |
|
}elseif(!empty($richiesta['statoBadges'])){ |
|
|
|
ob_start(); |
|
foreach ($richiesta['statoBadges'] as $stat => $value) { |
|
?> |
|
<a href="javascript:void(0)" class="text-decoration-none" title='<?= $value['titolo'] ?>'> |
|
<span class="mr-1 badge badge-<?= $value['class']?> " style="font-size:1em"> <?= (!empty($value['contatori'])) ? $value['contatori'] : 0 ?></span> |
|
</a> |
|
<? |
|
} |
|
$row[] = ob_get_clean(); |
|
|
|
}else{ |
|
$row[] = "<span class='text-warning'>". __('Errore visualizzazione Stati')."</span>"; |
|
} |
|
|
|
$row[] = "<button type='button' onclick='showModalWithURL(\"/backend/contratti/documentale/gestioneRichieste/managerRichieste.php?codice_contratto={$contratto->info['codice']}&codice_richiesta={$richiesta["codice"]}\")' class='btn btn-primary btn-sm'><span class='fa fa-search'></span></button>"; |
|
|
|
|
|
if(!empty($_GET['stato'])){ |
|
|
|
if (!empty($richiesta['statoLabel']) && $richiesta['statoLabel']['key'] == $_GET['stato'] ) { |
|
$countRecordFiltered++; |
|
$return["data"][] = $row; |
|
}elseif(!empty($richiesta['statoBadges']) && $richiesta['statoBadges'][$_GET['stato']]['contatori'] > 0){ |
|
$countRecordFiltered++; |
|
$return["data"][] = $row; |
|
} |
|
}else{ |
|
$countRecordFiltered++; |
|
$return["data"][] = $row; |
|
} |
|
} |
|
|
|
$return["recordsFiltered"] = (int)$countRecordFiltered; |
|
}else { |
|
$return["data"] = array(); |
|
} |
|
|
|
}else{ |
|
$return["data"] = array(); |
|
} |
|
|
|
echo json_encode($return); |
|
} |
|
|
|
?>
|