hasModulo("albi_commissione") && !empty($_GET["codice"]) && !empty($_GET["modulo"]) && !empty($_GET["elemento"])) { $managerCommissione = new Commissione ($_GET["modulo"],$_GET["elemento"],"commissione"); if (!empty($managerCommissione)) { $obj = $managerCommissione->getObject(null); $elenco = AlboCommissione::init($_GET["codice"]); if (!empty($elenco)) { $error = false; $_GET["stato"] = "ammessi"; if (!empty($_GET["order"][0]["column"]) && $_GET["order"][0]["column"] == "2") { $sortNomine = true; unset($_GET["order"][0]["column"]); } $return = $elenco->getPartecipantiDataTableJSON($_GET,true); if (!empty($return["data"])) { parse_str(str_replace("&","&",$_GET["utenti"]), $codiciUtenti); $partecipantiProcedura = []; if (method_exists($obj,"getPartecipanti")) { if (method_exists($obj,"getLotti")) { $lotti = $obj->getLotti(); } else { $lotti = [0]; } foreach($lotti AS $lotto) { if (!empty($lotto)) { $obj->setLotto($lotto["codice"]); } $tmp = $obj->getPartecipanti(); if (!empty($tmp)) { foreach($tmp AS $p) { if (!empty($p["codice_operatore"])) { $userInfo = oeManager::getUser($p["codice_operatore"]); if (!empty($userInfo)) { $partecipantiProcedura[] = $userInfo["codice"]; } } } } } } $codiciUtenti = $codiciUtenti["codiciUtenteCommissari"] ?? []; $tmp = []; foreach($return["data"] AS $record) { $class = "btn-info"; $label = __("Seleziona"); $icon = "fa-check"; if (in_array($record["codice_operatore"],$codiciUtenti) !== false) { $class = "btn-warning"; $label = __("Elimina"); $icon = "fa-times"; } $row = []; $row[] = $record["codice_fiscale"]; $row[] = $record["ragione_sociale"]; $row[] = Commissione::numeroNomine($record["codice_operatore"]); $first = true; if (in_array($record["codice_operatore"],$partecipantiProcedura) === false) { $row[] = ""; } else { $row[] = __("Non selezionabile"); } $tmp[] = $row; } if (!empty($sortNomine)) { if ($_GET["order"][0]["dir"] == "asc") { function sortNomine($a, $b) { return $a[2] > $b[2]; } } else { function sortNomine($a, $b) { return $a[2] < $b[2]; } } usort($tmp, "sortNomine"); } $return["data"] = $tmp; } echo json_encode($return); } } } if ($error) { header('HTTP/1.0 403 Forbidden'); die(); } ?>