info["codice_elemento"]) && !empty($this->info["modulo"]) && $this->info["modulo"] == "gare" && isset($_SESSION["utente"]) && $_SESSION["utente"]->permission($this->info["modulo"],$this->info["codice_elemento"])) { $ref = gara::init($this->info["codice_elemento"]); if ($ref) { $extraInfo = $ref->getExtraInfo(); $procedura = $ref->getProcedura(); $moduleSuggestion = [ "__titolo" => $ref->info["oggetto"], "__codice_ente" => $ref->info["codice_ente"], "OBJECT_CONTRACT.TITLE.P" => $ref->info["oggetto"], "OBJECT_CONTRACT.SHORT_DESCR" => $ref->info["oggetto"], "ADDRESS_CONTRACTING_BODY.NUTS" => $extraInfo["gara"]["nuts"], "CONTRACTING_BODY.URL_DOCUMENT" => $ref->getPublicExternalURL(), "CONTRACTING_BODY.URL_PARTICIPATION" => $ref->getPublicExternalURL(), "OBJECT_CONTRACT.VAL_ESTIMATED_TOTAL._value" => number_format($ref->info["prezzoRiferimento"],2,".",""), "PROCEDURE.RADIO_FOR_PROCEDURE_TYPE" => $procedura["guue"], "PROCEDURE.FRAMEWORK.RADIO_FOR_FRAMEWORK_INFO" => ($ref->info["accordo_quadro"] == "S") ? "NOTICE_INVOLVES_FRAMEWORK" : "NOTICE_INVOLVES_NO_FRAMEWORK", "PROCEDURE.RADIO_FOR_DPS_PURCHASERS" => "__£__", "PROCEDURE.REDUCTION_RECOURSE" => (count($procedura["fasi"]) > 1) ? "__£__" : "", "PROCEDURE.RADIO_FOR_EAUCTION" => (isset($ref->getRisposteElaborazione()["asta"]) && $ref->getRisposteElaborazione()["asta"] == "S") ? "EAUCTION_USED" : "__£__", ]; if (!empty($ref->round["scadenza"])) { $scadenza = strtotime($ref->round["scadenza"]); $moduleSuggestion["PROCEDURE.DATE_RECEIPT_TENDERS"] = date('d/m/Y',$scadenza); $moduleSuggestion["PROCEDURE.TIME_RECEIPT_TENDERS"] = date('H:i',$scadenza); } if (!empty($ref->round["pubblicazione"])) { $pubblicazione = strtotime($ref->round["pubblicazione"]); $moduleSuggestion["PROCEDURE.DATE_DISPATCH_INVITATIONS"] = date('d/m/Y',$pubblicazione); } if (!empty($ref->round["apertura"])) { $apertura = strtotime($ref->round["apertura"]); $moduleSuggestion["PROCEDURE.RADIO_FOR_OPENING_CONDITION"] = "OPENING_CONDITION"; $moduleSuggestion["PROCEDURE.OPENING_CONDITION.DATE_OPENING_TENDERS"] = date('d/m/Y',$apertura); $moduleSuggestion["PROCEDURE.OPENING_CONDITION.TIME_OPENING_TENDERS"] = date('H:i',$apertura); } else { $moduleSuggestion["PROCEDURE.RADIO_FOR_OPENING_CONDITION"] = "NO_OPENING_CONDITION"; } switch($ref->info["tipologia"]) { case "S": $moduleSuggestion["OBJECT_CONTRACT.TYPE_CONTRACT"] = "SERVICES"; break; case "F": $moduleSuggestion["OBJECT_CONTRACT.TYPE_CONTRACT"] = "SUPPLIES"; break; default: $moduleSuggestion["OBJECT_CONTRACT.TYPE_CONTRACT"] = "WORKS"; break; } $cpv = $ref->getCategorieMerceologiche()[0] ?? null; if (!empty($cpv)) { $moduleSuggestion["OBJECT_CONTRACT.CPV_MAIN.CPV_CODE"] = $cpv; } $incaricati = $ref->getManagerIncarichi()->getIncaricati(); if (!empty($incaricati)) { foreach($incaricati AS $incaricato) { if ($incaricato["ruolo"] == 14) { // 14: ruolo RUP $moduleSuggestion["ADDRESS_CONTRACTING_BODY.CONTACT_POINT"] = "{$incaricato["extraInfo"]["cognome"]} {$incaricato["extraInfo"]["nome"]}"; } } } $lotti = $ref->getLotti(); $moduleSuggestion["LOT_DIVISION.NUMBER_OF_LOTS"] = count($lotti); $moduleSuggestion["NUMBER_OF_AWARD_CONTRACT"] = count($lotti); $moduleSuggestion["OBJECT_CONTRACT.RADIO_FOR_LOT_DIVISION"] = (count($lotti) > 1) ? "__£__" : "NO_LOT_DIVISION"; $i = 0; $j = 0; foreach($lotti AS $lotto) { $i++; $j++; $lotKey = ""; $awardKey = ".£.{$j}"; if (count($lotti) > 1) { $lotKey = ".£.{$i}"; } $moduleSuggestion["AWARD_CONTRACT{$awardKey}.TITLE.P"] = $moduleSuggestion["OBJECT_DESCR{$lotKey}.TITLE.P"] = $lotto["oggetto"]; $moduleSuggestion["AWARD_CONTRACT{$awardKey}.LOT_NO"] = $moduleSuggestion["OBJECT_DESCR{$lotKey}.LOT_NO"] = $i; $moduleSuggestion["OBJECT_DESCR{$lotKey}.NUTS"] = $extraInfo["gara"]["nuts"]; $moduleSuggestion["OBJECT_DESCR{$lotKey}.SHORT_DESCR"] = $lotto["descrizione"]; $moduleSuggestion["OBJECT_DESCR{$lotKey}.AC.RADIO_FOR_AWARD_CRITERIA_DOC"] = "AC_PROCUREMENT_DOC"; $moduleSuggestion["OBJECT_DESCR{$lotKey}.VAL_OBJECT._attributes.CURRENCY"] = "EUR"; $moduleSuggestion["AWARD_CONTRACT{$awardKey}.AWARDED_CONTRACT.VALUES.VAL_ESTIMATED_TOTAL._value"] = $moduleSuggestion["OBJECT_DESCR{$lotKey}.VAL_OBJECT._value"] = number_format($lotto["importoBase"] + $lotto["importoManodopera"] + $lotto["oneriNoRibasso"],2,".",""); $ref->setLotto($lotto["codice"]); if ($lotto["stato"] == "90") { $moduleSuggestion["AWARD_CONTRACT{$awardKey}.RADIO_FOR_AWARDED_CONTRACT_SECTION"] = "NO_AWARDED_CONTRACT"; $moduleSuggestion["AWARD_CONTRACT{$awardKey}.NO_AWARDED_CONTRACT.RADIO_FOR_NO_AWARD_SECTION"] = "PROCUREMENT_DISCONTINUED"; } else if (($lotto["stato"] == "99") || ($lotto["stato"] == "95")) { $moduleSuggestion["AWARD_CONTRACT{$awardKey}.RADIO_FOR_AWARDED_CONTRACT_SECTION"] = "NO_AWARDED_CONTRACT"; $moduleSuggestion["AWARD_CONTRACT{$awardKey}.NO_AWARDED_CONTRACT.RADIO_FOR_NO_AWARD_SECTION"] = "PROCUREMENT_UNSUCCESSFUL"; } else { $partecipanti = $ref->getPartecipanti(); $aggiudicatari = $ref->getAggiudicatari(); if (!empty($aggiudicatari)) { foreach($aggiudicatari AS $aggiudicatario) { $awardKey = ".£.{$j}"; $moduleSuggestion["AWARD_CONTRACT{$awardKey}.TITLE.P"] = $lotto["oggetto"]; $moduleSuggestion["AWARD_CONTRACT{$awardKey}.LOT_NO"] = $i; $moduleSuggestion["AWARD_CONTRACT{$awardKey}.AWARDED_CONTRACT.VALUES.VAL_ESTIMATED_TOTAL._value"] = $moduleSuggestion["OBJECT_DESCR{$lotKey}.VAL_OBJECT._value"]; $moduleSuggestion["AWARD_CONTRACT{$awardKey}.RADIO_FOR_AWARDED_CONTRACT_SECTION"] = "AWARDED_CONTRACT"; $moduleSuggestion["AWARD_CONTRACT{$awardKey}.AWARDED_CONTRACT.TENDERS.NB_TENDERS_RECEIVED_SME"] = ""; $moduleSuggestion["AWARD_CONTRACT{$awardKey}.AWARDED_CONTRACT.TENDERS.NB_TENDERS_RECEIVED_OTHER_EU"] = ""; $moduleSuggestion["AWARD_CONTRACT{$awardKey}.AWARDED_CONTRACT.TENDERS.NB_TENDERS_RECEIVED_NON_EU"] = ""; $moduleSuggestion["AWARD_CONTRACT{$awardKey}.AWARDED_CONTRACT.TENDERS.NB_TENDERS_RECEIVED_EMEANS"] = ($ref->getModalita()["online"]) ? count($partecipanti) : ""; $moduleSuggestion["AWARD_CONTRACT{$awardKey}.AWARDED_CONTRACT.TENDERS.NB_TENDERS_RECEIVED"] = count($partecipanti); $j++; } $j--; if (count($aggiudicatari) > 1) { $moduleSuggestion["NUMBER_OF_AWARD_CONTRACT"] += (count($aggiudicatari) - 1); } } } } return $moduleSuggestion; } } ?>