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.
11168 righe
329 KiB
11168 righe
329 KiB
<?php |
|
|
|
use Mtownsend\XmlToArray\XmlToArray; |
|
|
|
/** |
|
* |
|
*/ |
|
trait TedEsenderFieldsManager |
|
{ |
|
/** |
|
* Custom Types |
|
* |
|
* @var array |
|
*/ |
|
private $sizes = [ |
|
"TITLE" => "col-sm-8", |
|
"LOT_NO" => "col-sm-4", |
|
"OFFICIALNAME" => "col-sm-12", |
|
"NATIONALID" => 'col-sm-3', |
|
"ADDRESS" => 'col-sm-6', |
|
"POSTAL_CODE" => 'col-sm-3', |
|
"COUNTRY" => 'col-sm-3', |
|
"PHONE" => 'col-sm-3', |
|
"FAX" => 'col-sm-3', |
|
"EMAIL" => 'col-sm-6', |
|
"URL_GENERAL" => 'col-sm-12', |
|
"URL_BUYER" => 'col', |
|
"URL" => 'col', |
|
"E_MAIL" => 'col-sm-6', |
|
"EU_PROG_RELATED" => 'col-sm-12', |
|
"URL_TOOL" => 'col-sm-12', |
|
"AC_CRITERION" => 'col-sm-8', |
|
"AC_WEIGHTING" => 'col', |
|
"DATE_START" => 'col', |
|
"DATE_END" => 'col', |
|
"DATE_OPENING_TENDERS" => 'col-sm-6', |
|
"TIME_OPENING_TENDERS" => 'col-sm-12', |
|
"LOW" => 'col-sm-6', |
|
"HIGH" => 'col-sm-6', |
|
"NB_TENDERS_RECEIVED" => 'col-sm-6', |
|
"NB_TENDERS_RECEIVED_SME" => 'col-sm-6', |
|
"NB_TENDERS_RECEIVED_OTHER_EU" => 'col-sm-6', |
|
"NB_TENDERS_RECEIVED_NON_EU" => 'col-sm-6', |
|
"NB_TENDERS_RECEIVED_EMEANS" => 'col-sm-6', |
|
"SECTION" => 'col-12' |
|
]; |
|
|
|
public $v = false; |
|
|
|
/** |
|
* Get all fields |
|
* |
|
* @param String $section |
|
* @param SimpleXMLElement $node |
|
* @param Array $name |
|
* @param Bool $isAttribute |
|
* @return void |
|
*/ |
|
public function getField(String $section, SimpleXMLIterator $node, Array $settings = [], Bool $isAttribute = false, bool $apply_title = true) |
|
{ |
|
if($section == $this->sections[0]["name"] && empty($this->check_legal_basis)) { |
|
$this->check_legal_basis = true; |
|
$this->getLegalBasis($settings, $section); |
|
} |
|
|
|
|
|
$input = []; |
|
$child = null; |
|
$ignore = false; |
|
|
|
if(! isset($settings["required"])) { $settings["required"] = true; } |
|
|
|
if(empty($settings["name"]) || ! is_array($settings["name"])) { |
|
$settings["name"] = []; |
|
} |
|
|
|
if(isset($node->annotation->documentation) && strpos($node->annotation->documentation->__toString(), "Possible values:") !== false) { |
|
$settings["restriction"] = str_replace("Possible values:", "", $node->annotation->documentation->__toString()); |
|
$settings["restriction"] = explode(",", $settings["restriction"]); |
|
$settings["restriction"] = array_map('trim', $settings["restriction"]); |
|
} |
|
|
|
if ($apply_title && !$this->deferred) { |
|
$key = null; |
|
if (! empty($node->attributes())) { |
|
if (isset($node->attributes()["minOccurs"]) && !isset($node->attributes()["name"]) && !isset($node->attributes()["ref"]) && !isset($node->attributes()["base"])) { |
|
if (isset($node->element)){ |
|
if(!empty($node->element->attributes()["ref"])) { |
|
$key = "RADIO_{$node->element->attributes()["ref"]->__toString()}"; |
|
} |
|
} |
|
} else if (! empty($node->attributes()["name"])) { |
|
|
|
$key = $node->attributes()["name"]->__toString(); |
|
} else if (! empty($node->attributes()["ref"])) { |
|
$key = $node->attributes()["ref"]->__toString(); |
|
} else if (! empty($node->attributes()["base"])) { |
|
$key = $node->attributes()["base"]->__toString(); |
|
} |
|
} |
|
if ($this->applyTitle($key, $settings, $section)) { |
|
$ignore = $ignore_child_element = true; |
|
$child = null; |
|
$this->getField($section, $node, $settings, $isAttribute, false); |
|
} |
|
} |
|
|
|
if(! empty($node->attributes()["name"])) { |
|
|
|
$name = $node->attributes()["name"]->__toString(); |
|
|
|
if($node->getName() == "element" && ! in_array($name, $settings["name"])) { |
|
|
|
$settings["name"] = array_merge($settings["name"], [$node->attributes()["name"]->__toString()]); |
|
|
|
} else if($node->getName() == "attribute") { |
|
|
|
$settings["name"] = array_merge($settings["name"], ["_attributes", $node->attributes()["name"]->__toString()]); |
|
|
|
} |
|
|
|
if (method_exists($this, "{$name}_node")) { |
|
|
|
$ignore = $ignore_child_element = ! $this->{"{$name}_node"}($node, $settings, $section); |
|
$child = null; |
|
|
|
} |
|
|
|
} |
|
|
|
if ($node->getName() == "sequence") { |
|
|
|
if (! empty($node->element->count())) { |
|
|
|
if (!empty($node->element->attributes()["ref"])) { |
|
|
|
if ((string) $node->element->attributes()["ref"] == "PARTICULAR_PROFESSION") { |
|
|
|
if (empty($settings["skip-particular-profession"])) { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->particular_profession_section($node, $settings, $section); |
|
|
|
} |
|
|
|
} else if ((string) $node->element->attributes()["ref"] == "LIKELY_SUBCONTRACTED") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->likely_subcontracted_section($node, $settings, $section); |
|
|
|
} else if (!empty($node->attributes()) && isset($node->attributes()["minOccurs"]) && (int) $node->attributes()["minOccurs"] == 0) { |
|
#region SEQUENCE FOLLOWED BY GROUP |
|
if(isset($node->group) && (string) $node->group->attributes()["ref"] == "document_url_man") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_document_url_man($node, $settings, $section); |
|
} |
|
#endregion |
|
} |
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if( isset($node->complexType) ) { |
|
|
|
if ((string) ($node->attributes()["name"] ?? "") == "QUALIFICATION" && $settings["name"][count($settings["name"]) - 1] == "QUALIFICATION") { |
|
$child = null; |
|
$ignore = $ignore_child_element = !$this->section_for_qualification($node, $settings, $section); |
|
} |
|
|
|
} |
|
|
|
if($node->getName() == "choice") { |
|
|
|
|
|
#region [CHOICE FOLLOWED BY SEQUENCE WITH GROUP] |
|
|
|
if (!empty($node->sequence) && isset($node->sequence->group)) { |
|
|
|
if ($node->sequence->group->attributes()["ref"] == "receipt_tenders") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = !$this->radio_for_receipt_tenders($node, $settings, $section); |
|
|
|
} else if ($node->sequence->group->attributes()["ref"] == "time_frame") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_time_frame($node, $settings, $section); |
|
|
|
} else if (isset($node->sequence->element) && (string) $node->sequence->element->attributes()["ref"] == "AWARDED_TO_GROUP") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_awarded_to_group($node, $settings, $section); |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
#region [CHOICE FOLLOWED BY SEQUENCE WITH CHOICE] |
|
|
|
else if(! empty($node->sequence) && ! empty($node->sequence->choice->count())) { |
|
|
|
if (isset($node->sequence->choice->element) && (string) $node->sequence->choice->element->attributes()["ref"] == "PT_AWARD_CONTRACT_WITH_PRIOR_PUBLICATION") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = !$this->radio_for_pt_award_contract_with_prior_publication_sequence($node, $settings, $section); |
|
|
|
} else if (isset($node->sequence->choice->element) && (string) $node->sequence->choice->element->attributes()["name"] == "ORIGINAL_ENOTICES") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = !$this->radio_for_original_other_means($node, $settings, $section); |
|
} |
|
|
|
} |
|
|
|
#region [CHOICE FOLLOWED BY SEQUENCE WITH ELEMENTS] |
|
|
|
|
|
else if(! empty($node->sequence) && ! empty($node->sequence->element->count())) { |
|
#region [WHERE FIRST ELEMENT HAS NAME] |
|
|
|
if(! empty($node->sequence->element->attributes()["name"])) { |
|
|
|
if ((string) $node->sequence->element->attributes()["name"] == "LOT_DIVISION") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->lot_division_custom_section($node, $settings, $section); |
|
|
|
} else if ((string) $node->sequence->element->attributes()["name"] == "NB_MIN_PARTICIPANTS") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_nb_participants($node, $settings, $section); |
|
|
|
} else if ((string) $node->sequence->element->attributes()["name"] == "PRIZE_AWARDED") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_prize_awarded($node, $settings, $section); |
|
|
|
} else if ((string) $node->sequence->element->attributes()["name"] == "CHANGE") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->section_for_change($node, $settings, $section); |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
#region [WHERE FIRST ELEMENT HAS REF] |
|
|
|
else if (! empty($node->sequence->element->attributes()["ref"])) { |
|
|
|
if ((string) $node->sequence->element->attributes()["ref"] == "RECURRENT_PROCUREMENT") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->recurrent_procurement_section($node, $settings, $section); |
|
|
|
} else if ((string) $node->sequence->element->attributes()["name"] == "INDEFINITE_DURATION") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_time_frame_indefinite($node, $settings, $section); |
|
|
|
} else if ((string) $node->sequence->element->attributes()["ref"] == "LOT_DIVISION") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->lot_division_custom_section($node, $settings, $section); |
|
|
|
} else if ( |
|
$node->sequence->element->count() > 1 && |
|
(string) $node->sequence->element[0]->attributes()["ref"] == "DATE_START" && |
|
(string) $node->sequence->element[1]->attributes()["ref"] == "DATE_END" && |
|
isset($node->element) && $node->element->attributes()["name"] == "INDEFINITE_DURATION" |
|
) { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_time_frame_indefinite($node, $settings, $section); |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
} |
|
|
|
#endregion |
|
|
|
#region [CHOICE FOLLOWED BY SEQUENCE WITH SEQUENCES] |
|
|
|
else if (! empty($node->sequence) && ! empty($node->sequence->sequence) && ! empty($node->sequence->sequence->count())) { |
|
|
|
if ($node->sequence->count() > 0 && !empty($node->sequence[1]->element) && $node->sequence[1]->element->attributes()["name"] == "ORIGINAL_OTHER_MEANS") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_original_other_means($node, $settings, $section); |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
#region [CHOICE FOLLOWED BY ELEMENT] |
|
|
|
else if (! empty($node->element->count())) { |
|
|
|
if(isset($node->element[1]) && $node->element[1]->attributes()["ref"] == "VAL_RANGE_TOTAL") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_val_total($node, $settings, $section); |
|
|
|
} else if (isset($node->element) && $node->element->attributes()["ref"] == "NO_AWARDED_CONTRACT") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->awarded_contract_section($node, $settings, $section); |
|
|
|
} else if (isset($node->element) && $node->element->attributes()["ref"] == "D_PROC_OPEN") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->d_proc_open_section($node, $settings, $section); |
|
|
|
} else if (isset($node->element) && $node->element->attributes()["ref"] == "D_TECHNICAL") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->d_technical_section($node, $settings, $section); |
|
|
|
} else if (isset($node->element) && $node->element->attributes()["ref"] == "D_ARTISTIC") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->d_artistic_section($node, $settings, $section); |
|
|
|
} else if (isset($node->element) && $node->element->attributes()["ref"] == "D_FROM_WINDING_PROVIDER") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->d_from_winding_provider_section($node, $settings, $section); |
|
|
|
} else if (isset($node->element) && $node->element->attributes()["name"] == "AWARDED_TENDERER_VARIANT") { |
|
|
|
if (in_array($this->form_section,["F06_2014"])) { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_awarded_tenderer_variant($node, $settings, $section); |
|
|
|
} |
|
|
|
} else if (isset($node->element) && $node->element->attributes()["name"] == "TENDERS_EXCLUDED") { |
|
|
|
if (in_array($this->form_section,["F06_2014"])) { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_tenders_excluded($node, $settings, $section); |
|
|
|
} |
|
|
|
} else if (isset($node->element) && $node->element->attributes()["name"] == "VAL_TOTAL") { |
|
|
|
if (in_array($this->form_section, ["F06_2014", "F15_2014"])) { |
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_val_total($node, $settings, $section); |
|
} |
|
|
|
} else if (isset($node->element) && $node->element->attributes()["name"] == "PARTICULAR_PROFESSION") { |
|
|
|
if (empty($settings["skip-particular-profession"])) { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->particular_profession_section($node, $settings, $section); |
|
|
|
} |
|
|
|
} else if (isset($node->element) && $node->element->attributes()["name"] == "FOLLOW_UP_CONTRACTS") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_follow_up_contracts($node, $settings, $section); |
|
|
|
} else if (isset($node->element) && $node->element->attributes()["name"] == "DECISION_BINDING_CONTRACTING") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_decision_binding_contract($node, $settings, $section); |
|
|
|
} else if (isset($node->element) && $node->element->attributes()["name"] == "NO_AWARDED_PRIZE") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_no_awarded_prize($node, $settings, $section); |
|
|
|
} else if (isset($node->element) && $node->element->attributes()["ref"] == "SME") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_sme($node, $settings, $section); |
|
|
|
} else if (isset($node->element) && $node->element->attributes()["name"] == "ORIGINAL_ENOTICES") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_enotices($node, $settings, $section); |
|
|
|
} else if ((string) $node->element->attributes()["name"] == "MODIFICATION_ORIGINAL") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_modification_original($node, $settings, $section); |
|
|
|
} else if ((string) $node->element->attributes()["ref"] == "ADDITIONAL_NEED") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_additional_need($node, $settings, $section); |
|
|
|
} else if ((string) $node->element->attributes()["ref"] == "AC_PROCUREMENT_DOC") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_ac_procurement_doc($node, $settings, $section); |
|
|
|
} else if ((string) $node->element->attributes()["name"] == "CONTRACT_COVERED_GPA") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_gpa($node, $settings, $section); |
|
|
|
} else if ((string) $node->element->attributes()["ref"] == "PT_AWARD_CONTRACT_WITH_PRIOR_PUBLICATION") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_pt_award_contract_with_prior_publication($node, $settings, $section); |
|
|
|
} else if ((string) $node->element->attributes()["name"] == "D_FROM_WINDING_PROVIDER") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_d_from_winding_provider($node, $settings, $section); |
|
|
|
} else if ((string) $node->element->attributes()["name"] == "D_ACCORDANCE_ARTICLE") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = !$this->radio_for_d_accordance_article($node, $settings, $section); |
|
|
|
} else if ((string) $node->element->attributes()["ref"] == "VAL_ESTIMATED_TOTAL") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_val_estimated_total($node, $settings, $section); |
|
|
|
} else if ((string) $node->element->attributes()["name"] == "DIRECTIVE_2014_23_EU") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_directives($node, $settings, $section); |
|
|
|
} else if ((string) $node->element->attributes()["name"] == "AC_PRICE") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_ac_price($node, $settings, $section); |
|
|
|
} else if ((string) $node->element->attributes()["name"] == "PT_AWARD_CONTRACT_WITHOUT_PUBLICATION") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_pt_award_contract_without_prior_publication($node, $settings, $section); |
|
|
|
} else if ((string) $node->element->attributes()["name"] == "PT_NEGOTIATED_WITHOUT_PUBLICATION") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_pt_negotiated_without_publication($node, $settings, $section); |
|
|
|
} else if ((string) $node->element->attributes()["ref"] == "D_PROC_RESTRICTED") { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_d_proc_restricted($node, $settings, $section); |
|
|
|
} |
|
|
|
} |
|
#endregion |
|
|
|
#region [CHOICE FOLLOWED BY GROUP] |
|
else if (! empty($node->group->count())) { |
|
|
|
|
|
if ( (string) $node->group->attributes()["ref"] == "authority" ) { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_authority($node, $settings, $section); |
|
|
|
} else if ( (string) $node->group->attributes()["ref"] == "annex_d4_part1" ) { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_annex_d4_part_1($node, $settings, $section); |
|
|
|
} else if ( (string) $node->group->attributes()["ref"] == "annex_d2_part1" ) { |
|
|
|
$child = null; |
|
$ignore = $ignore_child_element = ! $this->radio_for_annex_d2_part1($node, $settings, $section); |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
} |
|
|
|
if($node->enumeration->count() > 0) { |
|
|
|
$child = $node->enumeration; |
|
$ignore = true; |
|
|
|
} |
|
|
|
if($node->attributes() && ! $ignore) { |
|
|
|
if(isset($node->attributes()["minOccurs"])) { |
|
|
|
if((int) $node->attributes()["minOccurs"] === 0) { |
|
|
|
$settings["required"] = false; |
|
|
|
} |
|
|
|
} |
|
|
|
if(! empty($node->attributes()["ref"])) { |
|
|
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
|
|
} |
|
|
|
if(! empty($node->attributes()["type"]) || ! empty($node->attributes()["base"]) || $node->attributes()["ref"] ) { |
|
|
|
$type = (string) $node->attributes()["type"]; |
|
$base = (string) $node->attributes()["base"]; |
|
$name = (string) $node->attributes()["name"]; |
|
$ref = str_replace(":", "_", (string) $node->attributes()["ref"]); |
|
|
|
if(method_exists($this, "{$type}_fields")) { |
|
|
|
$this->{"{$type}_fields"}($node, $settings, $section); |
|
$child = null; |
|
|
|
} else if (method_exists($this, "{$ref}_ref")) { |
|
|
|
$this->{"{$ref}_ref"}($node, $settings, $section); |
|
$child = null; |
|
|
|
} else if (method_exists($this, "{$base}_base")) { |
|
|
|
$this->{"{$base}_base"}($node, $settings, $section); |
|
$child = null; |
|
|
|
} else { |
|
|
|
|
|
if((! empty($type) && in_array($type, $this->elements)) || (! empty($base) && in_array($base, $this->elements))) { |
|
$key = implode(".", $settings["name"]); |
|
$exist = ! empty(self::get($this->fields, $key)); |
|
|
|
if(! $exist) { |
|
|
|
$settings["object"] = ! empty($type) ? $type : (! empty($base) ? $base : ""); |
|
$input["size"] = $this->estimateSize($settings); |
|
|
|
$input["name"] = $this->arrayName2StringName($settings["name"]); |
|
$input["object"] = $settings["object"]; |
|
$input["required"] = $settings["required"]; |
|
|
|
switch ($input["object"]) { |
|
case 'empty': |
|
$input["type"] = "checkbox"; |
|
break; |
|
case 'phone': |
|
$input["type"] = "text"; |
|
$input["rel"] = ["PN"]; |
|
break; |
|
case 'date': |
|
$input["type"] = "datetime"; |
|
break; |
|
case 'time': |
|
$input["type"] = "datetime"; |
|
$input["class"] = "timepick"; |
|
break; |
|
case "text_ft_multi_lines": |
|
case "text_ft_multi_lines_or_string": |
|
$input["type"] = "textarea"; |
|
break; |
|
case "nonNegativeInteger": |
|
case "decimal": |
|
$input["type"] = "text"; |
|
$input["rel"] = ["S", "1", "0", "N"]; |
|
break; |
|
case "url": |
|
$input["type"] = "url"; |
|
break; |
|
case "email": |
|
$input["type"] = "email"; |
|
break; |
|
case "weight": |
|
$input["type"] = "weight"; |
|
default: |
|
$input["type"] = "text"; |
|
break; |
|
} |
|
|
|
$this->fields = $this->makeArray($settings["name"], $input, $this->fields); |
|
|
|
unset($settings["required"]); |
|
|
|
} |
|
|
|
return; |
|
|
|
} else if(! empty($type)) { |
|
|
|
$child = $this->getTypeElement($type); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if($node->getName() == "restriction") { |
|
|
|
if($node->enumeration) { |
|
|
|
$input["name"] = $this->arrayName2StringName($settings["name"]); |
|
$input["type"] = "select"; |
|
$input["required"] = $settings["required"]; |
|
|
|
foreach ($node as $children) { |
|
if(! empty($settings["restriction"])) { |
|
if(in_array($children["value"], $settings["restriction"])) { |
|
$input["options"][(string) $children["value"]] = (string) $children["value"]; |
|
if(isset($children->annotation->documentation)) { |
|
$input["options"][(string) $children["value"]] = (string) $children->annotation->documentation; |
|
$input["options"][(string) $children["value"]] = str_replace(" / adm.status[current]", "", $input["options"][(string) $children["value"]]); |
|
$input["options"][(string) $children["value"]] = $this->translate($input["options"][(string) $children["value"]], $input["name"]); |
|
$input["options"] = array_map("trim", $input["options"]); |
|
} |
|
} |
|
} else { |
|
$input["options"][(string) $children["value"]] = (string) $children["value"]; |
|
$input["options"][(string) $children["value"]] = $this->translate($input["options"][(string) $children["value"]], $input["name"]); |
|
} |
|
} |
|
$this->fields = $this->makeArray($settings["name"], $input, $this->fields); |
|
unset($settings["required"]); |
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if(! empty($child)) { |
|
$this->getField($section, $child, $settings); |
|
} |
|
|
|
if(is_a($node, "SimpleXMLIterator") && $node->count() > 0 && empty($ignore_child_element)) { |
|
|
|
foreach ($node as $child) { |
|
$this->getField($section, $child, $settings); |
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
/** |
|
* Genera automaticamente una radio nel caso in cui il nodo sia facoltativo |
|
* |
|
* @param SimpleXMLIterator $node |
|
* @param Array $settings |
|
* @param String $section |
|
* @param String $tag |
|
* @param String $title |
|
* |
|
* @return bool |
|
*/ |
|
private function minOccursRadio(SimpleXMLIterator $node, Array $settings = [], String $section, String $tag, String $title, Array $options = null) : bool |
|
{ |
|
$s = $settings; |
|
if (isset($node->attributes()["minOccurs"]) && (int) $node->attributes()["minOccurs"] == 0) { |
|
|
|
$s["name"] = array_merge($s["name"], ["RADIO_FOR_{$tag}"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = $this->getId($name); |
|
|
|
$key = $this->getKeyFromNameString($name); |
|
unset($node->attributes()["minOccurs"]); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $node->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$selected = "empty"; |
|
$value = self::get($this->info["valori"], $key); |
|
|
|
if ($value == "YES_{$tag}") { |
|
$selected = $object; |
|
} |
|
|
|
if ( empty($options["title"]) ) { |
|
$inputs[] = [ |
|
"info" => [ |
|
"title" => $this->translate($title , $name), |
|
"style" => "subtitle", |
|
] |
|
]; |
|
} else { |
|
$inputs[] = $options["title"]; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "YES_$tag", |
|
"title" => $this->translate("YES"), |
|
"required" => false, |
|
"attrs" => [ |
|
"onChange" => "eForms2.add2GUUE('#{$id}', '{$object}')", |
|
] |
|
]; |
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_{$tag}", |
|
"title" => $this->translate("NO"), |
|
"required" => true, |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
]; |
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => !empty($options["container"]) ? $options["container"]["class"] ?? "" : "" , |
|
"id" => $id, |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return true; |
|
} |
|
return false; |
|
} |
|
|
|
/** |
|
* Get currency option |
|
* |
|
* @return array |
|
*/ |
|
private function getCurrencyOptions() : array { |
|
return [ |
|
"EUR" => $this->translate("EUR"), |
|
"AED" => $this->translate("AED"), |
|
"AED" => $this->translate("AED"), |
|
"AFN" => $this->translate("AFN"), |
|
"ALL" => $this->translate("ALL"), |
|
"AMD" => $this->translate("AMD"), |
|
"ANG" => $this->translate("ANG"), |
|
"AOA" => $this->translate("AOA"), |
|
"ARS" => $this->translate("ARS"), |
|
"AUD" => $this->translate("AUD"), |
|
"AWG" => $this->translate("AWG"), |
|
"AZN" => $this->translate("AZN"), |
|
"BAM" => $this->translate("BAM"), |
|
"BBD" => $this->translate("BBD"), |
|
"BDT" => $this->translate("BDT"), |
|
"BGN" => $this->translate("BGN"), |
|
"BHD" => $this->translate("BHD"), |
|
"BIF" => $this->translate("BIF"), |
|
"BMD" => $this->translate("BMD"), |
|
"BND" => $this->translate("BND"), |
|
"BOB" => $this->translate("BOB"), |
|
"BRL" => $this->translate("BRL"), |
|
"BSD" => $this->translate("BSD"), |
|
"BTN" => $this->translate("BTN"), |
|
"BWP" => $this->translate("BWP"), |
|
"BYN" => $this->translate("BYN"), |
|
"BZD" => $this->translate("BZD"), |
|
"CAD" => $this->translate("CAD"), |
|
"CDF" => $this->translate("CDF"), |
|
"CHF" => $this->translate("CHF"), |
|
"CLP" => $this->translate("CLP"), |
|
"CNY" => $this->translate("CNY"), |
|
"COP" => $this->translate("COP"), |
|
"CRC" => $this->translate("CRC"), |
|
"CUC" => $this->translate("CUC"), |
|
"CUP" => $this->translate("CUP"), |
|
"CVE" => $this->translate("CVE"), |
|
"CZK" => $this->translate("CZK"), |
|
"DJF" => $this->translate("DJF"), |
|
"DKK" => $this->translate("DKK"), |
|
"DOP" => $this->translate("DOP"), |
|
"DZD" => $this->translate("DZD"), |
|
"EGP" => $this->translate("EGP"), |
|
"ERN" => $this->translate("ERN"), |
|
"ETB" => $this->translate("ETB"), |
|
"FJD" => $this->translate("FJD"), |
|
"FKP" => $this->translate("FKP"), |
|
"GBP" => $this->translate("GBP"), |
|
"GEL" => $this->translate("GEL"), |
|
"GHS" => $this->translate("GHS"), |
|
"GIP" => $this->translate("GIP"), |
|
"GMD" => $this->translate("GMD"), |
|
"GNF" => $this->translate("GNF"), |
|
"GTQ" => $this->translate("GTQ"), |
|
"GYD" => $this->translate("GYD"), |
|
"HKD" => $this->translate("HKD"), |
|
"HNL" => $this->translate("HNL"), |
|
"HRK" => $this->translate("HRK"), |
|
"HTG" => $this->translate("HTG"), |
|
"HUF" => $this->translate("HUF"), |
|
"IDR" => $this->translate("IDR"), |
|
"ILS" => $this->translate("ILS"), |
|
"INR" => $this->translate("INR"), |
|
"IQD" => $this->translate("IQD"), |
|
"IRR" => $this->translate("IRR"), |
|
"ISK" => $this->translate("ISK"), |
|
"JMD" => $this->translate("JMD"), |
|
"JOD" => $this->translate("JOD"), |
|
"JPY" => $this->translate("JPY"), |
|
"KES" => $this->translate("KES"), |
|
"KGS" => $this->translate("KGS"), |
|
"KHR" => $this->translate("KHR"), |
|
"KMF" => $this->translate("KMF"), |
|
"KPW" => $this->translate("KPW"), |
|
"KRW" => $this->translate("KRW"), |
|
"KWD" => $this->translate("KWD"), |
|
"KYD" => $this->translate("KYD"), |
|
"KZT" => $this->translate("KZT"), |
|
"LAK" => $this->translate("LAK"), |
|
"LBP" => $this->translate("LBP"), |
|
"LKR" => $this->translate("LKR"), |
|
"LRD" => $this->translate("LRD"), |
|
"LSL" => $this->translate("LSL"), |
|
"LYD" => $this->translate("LYD"), |
|
"MAD" => $this->translate("MAD"), |
|
"MDL" => $this->translate("MDL"), |
|
"MGA" => $this->translate("MGA"), |
|
"MKD" => $this->translate("MKD"), |
|
"MMK" => $this->translate("MMK"), |
|
"MNT" => $this->translate("MNT"), |
|
"MOP" => $this->translate("MOP"), |
|
"MRU" => $this->translate("MRU"), |
|
"MUR" => $this->translate("MUR"), |
|
"MVR" => $this->translate("MVR"), |
|
"MWK" => $this->translate("MWK"), |
|
"MXN" => $this->translate("MXN"), |
|
"MYR" => $this->translate("MYR"), |
|
"MZN" => $this->translate("MZN"), |
|
"NAD" => $this->translate("NAD"), |
|
"NGN" => $this->translate("NGN"), |
|
"NIO" => $this->translate("NIO"), |
|
"NOK" => $this->translate("NOK"), |
|
"NPR" => $this->translate("NPR"), |
|
"NZD" => $this->translate("NZD"), |
|
"OMR" => $this->translate("OMR"), |
|
"PAB" => $this->translate("PAB"), |
|
"PEN" => $this->translate("PEN"), |
|
"PGK" => $this->translate("PGK"), |
|
"PHP" => $this->translate("PHP"), |
|
"PKR" => $this->translate("PKR"), |
|
"PLN" => $this->translate("PLN"), |
|
"PYG" => $this->translate("PYG"), |
|
"QAR" => $this->translate("QAR"), |
|
"RON" => $this->translate("RON"), |
|
"RSD" => $this->translate("RSD"), |
|
"RUB" => $this->translate("RUB"), |
|
"RWF" => $this->translate("RWF"), |
|
"SAR" => $this->translate("SAR"), |
|
"SBD" => $this->translate("SBD"), |
|
"SCR" => $this->translate("SCR"), |
|
"SDG" => $this->translate("SDG"), |
|
"SEK" => $this->translate("SEK"), |
|
"SGD" => $this->translate("SGD"), |
|
"SHP" => $this->translate("SHP"), |
|
"SLL" => $this->translate("SLL"), |
|
"SOS" => $this->translate("SOS"), |
|
"SRD" => $this->translate("SRD"), |
|
"SSP" => $this->translate("SSP"), |
|
"STN" => $this->translate("STN"), |
|
"SVC" => $this->translate("SVC"), |
|
"SYP" => $this->translate("SYP"), |
|
"SZL" => $this->translate("SZL"), |
|
"THB" => $this->translate("THB"), |
|
"TJS" => $this->translate("TJS"), |
|
"TMT" => $this->translate("TMT"), |
|
"TND" => $this->translate("TND"), |
|
"TOP" => $this->translate("TOP"), |
|
"TRY" => $this->translate("TRY"), |
|
"TTD" => $this->translate("TTD"), |
|
"TWD" => $this->translate("TWD"), |
|
"TZS" => $this->translate("TZS"), |
|
"UAH" => $this->translate("UAH"), |
|
"UGX" => $this->translate("UGX"), |
|
"USD" => $this->translate("USD"), |
|
"USN" => $this->translate("USN"), |
|
"UYU" => $this->translate("UYU"), |
|
"UZS" => $this->translate("UZS"), |
|
"VES" => $this->translate("VES"), |
|
"VND" => $this->translate("VND"), |
|
"VUV" => $this->translate("VUV"), |
|
"WST" => $this->translate("WST"), |
|
"XAF" => $this->translate("XAF"), |
|
"XCD" => $this->translate("XCD"), |
|
"XOF" => $this->translate("XOF"), |
|
"XPF" => $this->translate("XPF"), |
|
"YER" => $this->translate("YER"), |
|
"ZAR" => $this->translate("ZAR"), |
|
"ZMW" => $this->translate("ZMW") |
|
]; |
|
} |
|
|
|
/** |
|
* Extract form elements |
|
* |
|
* @param SimpleXMLIterator $node |
|
* @param array $name |
|
* @param array $elements |
|
* @return void |
|
*/ |
|
private function extractElements(SimpleXMLIterator $node, Array $name = [], Array $elements = []) |
|
{ |
|
if($node->getName() == "element" && ! empty($node->attributes()["name"])) { |
|
|
|
$name[] = $node->attributes()["name"]->__toString(); |
|
$elements = $this->makeArray($name, null, $elements); |
|
|
|
} |
|
|
|
if($node->attributes()) { |
|
|
|
if(! empty($node->attributes()["type"])) { |
|
|
|
$son = $this->getTypeElement($node->attributes()["type"]->__toString()); |
|
|
|
} |
|
|
|
if(! empty($node->attributes()["ref"])) { |
|
|
|
$son = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
|
|
} |
|
|
|
if(! empty($node->attributes()["base"])) { |
|
|
|
$base = $node->attributes()["base"]->__toString(); |
|
if(! empty($base) && ! in_array($base, $this->elements)) { |
|
|
|
$son = $this->getTypeElement($base); |
|
|
|
} |
|
|
|
} |
|
|
|
if(! empty($son)) { |
|
|
|
$elements = $this->extractElements($son, $name, $elements); |
|
|
|
} |
|
|
|
} |
|
|
|
if(is_a($node, "SimpleXMLIterator") && $node->count() > 0) { |
|
|
|
foreach ($node as $son) { |
|
|
|
$elements = $this->extractElements($son, $name, $elements); |
|
|
|
} |
|
|
|
} |
|
|
|
return $elements; |
|
|
|
} |
|
|
|
/** |
|
* Input array name to string |
|
* |
|
* @param array $name |
|
* @return String |
|
*/ |
|
private function arrayName2StringName(Array $name = []) |
|
{ |
|
if(! empty($name)) { |
|
return "guue[" . implode("][", array_filter($name)) . "]"; |
|
} |
|
return ''; |
|
} |
|
|
|
/** |
|
* Apply a static publication attribute to field |
|
* |
|
* @param array $settings |
|
* @return void |
|
*/ |
|
private function applyStaticPublicationAttribute(array $settings) : void |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["_attributes", "PUBLICATION"]); |
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$inputs = [ |
|
"key" => $key, |
|
"name" => $this->arrayName2StringName($s["name"],["_attributes", "PUBLICATION"]), |
|
"type" => "hidden", |
|
"value" => "NO" |
|
]; |
|
$this->fields[] = $this->makeArray(array_merge($settings["name"]), $inputs, $this->fields); |
|
} |
|
|
|
private function applyTitle(?String $key, array $settings = [], String $section) { |
|
if (!empty($key) && !empty($this->settings["titles"][$this->form_section][$section][$key])) { |
|
$s = $settings; |
|
$inputs = [ |
|
"info" => ["title" => $this->translate($this->settings["titles"][$this->form_section][$section][$key])] |
|
]; |
|
$this->fields = $this->makeArray(array_merge($s["name"],["TITLE_FOR_". $key, "T"]), $inputs, $this->fields); |
|
return true; |
|
} |
|
return false; |
|
} |
|
|
|
/*********************************** |
|
* METODI PER LA PERSONALIZZAZIONE * |
|
* DEI CONTENUTI DEI FORM * |
|
***********************************/ |
|
|
|
private function getLegalBasis(Array $settings = [], String $section) |
|
{ |
|
$n = $this->getTypeElement("LEGAL_BASIS"); |
|
if(! empty($n) && ! empty($n->complexType->attribute->attributes()["name"]) && ! empty($n->complexType->attribute->attributes()["type"])) { |
|
$s = $settings; |
|
array_pop($s["name"]); |
|
|
|
$s1 = $s2 = $s; |
|
$s1["name"][] = "LEGAL_BASIS"; |
|
$s2["name"][] = "LEGAL_BASIS_OTHER"; |
|
$s1["name"][] = "_attributes"; |
|
$s1["name"][] = (String) $n->complexType->attribute->attributes()["name"]; |
|
$keys = array_values($settings["name"]); |
|
|
|
if (in_array($keys[count($keys) - 1], ["CONTRACTING_BODY", "NOTICE"]) && (empty($settings["skip-legal-basis"]) || !$settings["skip-legal-basis"])) { |
|
|
|
switch ($this->form_section) { |
|
|
|
case 'F01_2014': |
|
case 'F02_2014': |
|
case 'F03_2014': |
|
$inputs = [ |
|
"LEGAL_BASIS" => [ |
|
"name" => $this->arrayName2StringName($s1["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "select", |
|
"object" => "empty", |
|
"options" => [ |
|
"32014L0024" => "Directive 2014/24/EU", |
|
], |
|
"title" => $this->translate("LEGAL_BASIS"), |
|
"required" => true |
|
] |
|
]; |
|
break; |
|
case 'F15_2014': |
|
$inputs = [ |
|
"LEGAL_BASIS" => [ |
|
"name" => $this->arrayName2StringName($s1["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "select", |
|
"object" => "empty", |
|
"options" => [ |
|
"32014L0023" => "Directive 2014/23/EU", |
|
"32014L0024" => "Directive 2014/24/EU", |
|
"32014L0025" => "Directive 2014/25/EU", |
|
"32009L0081" => "Directive 2009/81/EC" |
|
], |
|
"title" => $this->translate("LEGAL_BASIS"), |
|
"required" => true |
|
] |
|
]; |
|
break; |
|
case 'F04_2014': |
|
case 'F05_2014': |
|
case 'F06_2014': |
|
case 'F07_2014': |
|
case 'F22_2014': |
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName($s1["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "select", |
|
"object" => "empty", |
|
"options" => ["32014L0025" => "Directive 2014/25/EU"], |
|
"title" => $this->translate("LEGAL_BASIS"), |
|
"required" => true |
|
] |
|
]; |
|
break; |
|
case 'F08_2014': |
|
$inputs = [ |
|
"LEGAL_BASIS" => [ |
|
"name" => $this->arrayName2StringName($s1["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "select", |
|
"object" => "empty", |
|
"options" => [ |
|
"32014L0024" => "Directive 2014/24/EU", |
|
"32014L0025" => "Directive 2014/25/EU", |
|
"32009L0081" => "Directive 2009/81/EC" |
|
], |
|
"title" => $this->translate("LEGAL_BASIS"), |
|
"required" => true |
|
] |
|
]; |
|
break; |
|
case 'F12_2014': |
|
case 'F13_2014': |
|
$inputs = [ |
|
"LEGAL_BASIS" => [ |
|
"name" => $this->arrayName2StringName($s1["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "select", |
|
"object" => "empty", |
|
"options" => [ |
|
"32014L0024" => "Directive 2014/24/EU", |
|
"32014L0025" => "Directive 2014/25/EU", |
|
], |
|
"title" => $this->translate("LEGAL_BASIS"), |
|
"required" => true |
|
] |
|
]; |
|
break; |
|
case 'F14_2014': |
|
case 'F20_2014': |
|
$inputs = [ |
|
"LEGAL_BASIS" => [ |
|
"name" => $this->arrayName2StringName($s1["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "select", |
|
"object" => "empty", |
|
"options" => [ |
|
"32014L0023" => "Directive 2014/23/EU", |
|
"32014L0024" => "Directive 2014/24/EU", |
|
"32014L0025" => "Directive 2014/25/EU", |
|
], |
|
"title" => $this->translate("LEGAL_BASIS"), |
|
"required" => true |
|
] |
|
]; |
|
break; |
|
case 'F21_2014': |
|
$inputs = [ |
|
"LEGAL_BASIS" => [ |
|
"name" => $this->arrayName2StringName($s1["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "select", |
|
"object" => "empty", |
|
"options" => [ |
|
"32014L0024" => "Directive 2014/24/EU", |
|
], |
|
"title" => $this->translate("LEGAL_BASIS"), |
|
"required" => true |
|
] |
|
]; |
|
break; |
|
case 'F23_2014': |
|
case 'F24_2014': |
|
case 'F25_2014': |
|
$inputs = [ |
|
"LEGAL_BASIS" => [ |
|
"name" => $this->arrayName2StringName($s1["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "select", |
|
"object" => "empty", |
|
"options" => [ |
|
"32014L0023" => "Directive 2014/23/EU", |
|
], |
|
"title" => $this->translate("LEGAL_BASIS"), |
|
"required" => true |
|
] |
|
]; |
|
default: |
|
# code... |
|
break; |
|
} |
|
} |
|
|
|
if(! empty($inputs)) { |
|
|
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
private function d_contract_awarded_design_contest_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_D_CONTRACT_AWARDED_DESIGN_CONTEST"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$id = $this->getId($name); |
|
|
|
$key = $this->getKeyFromNameString($name); |
|
$selected = "empty"; |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => "<element name='services'></element>", |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$value = self::get($this->info["valori"],$key); |
|
if ($value == "CHOICE_D_CONTRACT_AWARDED_DESIGN_CONTEST") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "CHOICE_D_CONTRACT_AWARDED_DESIGN_CONTEST", |
|
"title" => $this->translate("YES"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_CHOICE_D_CONTRACT_AWARDED_DESIGN_CONTEST", |
|
"title" => $this->translate("NO"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "d-none", |
|
"id" => $id, |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_D_CONTRACT_AWARDED_DESIGN_CONTEST"]), $inputs, $this->fields); |
|
|
|
return false; |
|
|
|
} |
|
|
|
private function d_commodity_market_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_D_COMMODITY_MARKET"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$id = $this->getId($name); |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => "<element name='supplies'></element>", |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
|
|
|
|
$key = $this->getKeyFromNameString($name); |
|
$selected = "empty"; |
|
|
|
$value = self::get($this->info["valori"],$key); |
|
if ($value == "CHOICE_D_COMMODITY_MARKET") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "CHOICE_D_COMMODITY_MARKET", |
|
"title" => $this->translate("YES"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_CHOICE_COMMODITY_MARKET", |
|
"title" => $this->translate("NO"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "d-none", |
|
"id" => $id, |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_D_COMMODITY_MARKET"]), $inputs, $this->fields); |
|
|
|
return false; |
|
|
|
} |
|
|
|
private function supplies_fields($node, $settings, $section) { |
|
$name = $settings["name"][count($settings["name"])-1]; |
|
$options["title"] = [ |
|
"info" => [ |
|
"title" => $this->translate($name), |
|
"style" => "subtitle", |
|
"hidden" => true |
|
] |
|
]; |
|
$options["container"] = [ |
|
"class" => "d-none" |
|
]; |
|
|
|
if ($this->minOccursRadio($node, $settings, $section, $name, $this->translate($name), $options)) { |
|
return; |
|
} |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["_attributes", "CTYPE"]); |
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$inputs = [ |
|
"key" => $key, |
|
"name" => $this->arrayName2StringName($s["name"],["_attributes", "CTYPE"]), |
|
"type" => "hidden", |
|
"value" => "SUPPLIES" |
|
]; |
|
$this->fields = $this->makeArray(array_merge($settings["name"]), $inputs, $this->fields); |
|
} |
|
|
|
private function services_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["_attributes", "CTYPE"]); |
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$inputs = [ |
|
"key" => $key, |
|
"name" => $this->arrayName2StringName($s["name"],["_attributes", "CTYPE"]), |
|
"type" => "hidden", |
|
"value" => "SERVICES" |
|
]; |
|
$this->fields = $this->makeArray(array_merge($settings["name"]), $inputs, $this->fields); |
|
} |
|
|
|
private function cpv_main_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$settings["name"] = array_merge($settings["name"], ["CPV_MAIN"]); |
|
$name = array_merge($settings["name"], ["CPV_CODE", "@CODE"]); |
|
|
|
$value = $this->get($this->info["valori"], implode(".", $name)); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName($name), |
|
"type" => "cpv", |
|
"title" => $this->translate("CPV_MAIN",$this->arrayName2StringName($name)), |
|
"attrs" => [ |
|
"class" => "row" |
|
], |
|
"val" => $value, |
|
"required" => true, |
|
"rel" => ["S","1","0","A"] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
|
|
} |
|
|
|
private function cpv_additional_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$settings["name"] = array_merge($settings["name"], ["CPV_ADDITIONAL"]); |
|
$name = array_merge($settings["name"], ["CPV_CODE", "@CODE"]); |
|
|
|
$value = $this->get($this->info["valori"], implode(".", $name)); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName($name), |
|
"type" => "cpv", |
|
"minlength" => 3, |
|
"macro" => $this->get($this->info["valori"], "TED_ESENDERS.FORM_SECTION.{$this->form_section}.OBJECT_CONTRACT.CPV_MAIN.CPV_CODE.@CODE"), |
|
"title" => $this->translate("CPV_ADDITIONAL",$this->arrayName2StringName($name)), |
|
"attrs" => [ |
|
"class" => "row" |
|
], |
|
"val" => $value, |
|
"required" => false, |
|
"rel" => ["N", "1", "0", "A"] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
|
|
} |
|
|
|
private function lot_division_choice_custom_section(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_LOT_DIVISION"]); |
|
$name = $this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_LOT_DIVISION"])); |
|
|
|
$id = $this->getId($name); |
|
|
|
$lot_division = $this->arrayName2StringName($settings["name"]); |
|
$lot_division = $this->getKeyFromNameString($lot_division); |
|
|
|
$child = $node->xpath("//*[@name='LOT_DIVISION']"); |
|
$child = $child[count($child) - 1]; |
|
if ($child->attributes()["type"]->__toString() == "empty") { |
|
$child = $this->getTypeElement("lot_numbers")->asXML(); |
|
} else { |
|
$child = $child->asXML(); |
|
} |
|
|
|
$lot_division_object = $this->makeAdd2GUUEObject([ |
|
"child" => $child, |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["OBJECT_DESCR"]); |
|
$search = "//*[@name='OBJECT_DESCR']"; |
|
$object_ftype = $this->dom->xpath($search)[0]->attributes()["type"]->__toString(); |
|
|
|
$no_lot_division = $this->arrayName2StringName($s["name"]); |
|
$no_lot_division = $this->getKeyFromNameString($no_lot_division); |
|
$no_lot_division_object = $this->makeAdd2GUUEObject([ |
|
"child" => $this->getTypeElement($object_ftype)->asXML(), |
|
"settings" => $s, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$value = self::get($this->info["valori"], "TED_ESENDERS.FORM_SECTION.{$this->form_section}.OBJECT_CONTRACT.RADIO_FOR_LOT_DIVISION"); |
|
|
|
$v = "LOT_DIVISION"; |
|
if (in_array($this->form_section,["F01_2014","F02_2014","F04_2014","F05_2014","F21_2014","F22_2014","F23_2014","F24_2014"])) { |
|
$v = "__£__"; |
|
} |
|
|
|
if ($node->sequence->count() == 2 || $node->sequence->element->attributes()["name"] == "LOT_DIVISION") { |
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => $v, |
|
"title" => $this->translate("LOT_DIVISION"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$lot_division_object}');", |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
]; |
|
} |
|
if ($node->sequence->count() == 2 || $node->sequence->element->attributes()["name"] == "NO_LOT_DIVISION" || in_array($this->form_section,["F22_2014"])) { |
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_LOT_DIVISION", |
|
"title" => $this->translate("NO_LOT_DIVISION"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$no_lot_division_object}');" |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
]; |
|
} |
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => ($value == $v) ? $lot_division : $no_lot_division, |
|
"object" => ($value == $v) ? $lot_division_object : $no_lot_division_object, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_LOT_DIVISION"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function lot_division_overrided_single_not_divided(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
$inputs[] = [ |
|
"info" => [ |
|
"title" => $this->translate("OBJECT_DESCR") |
|
] |
|
]; |
|
|
|
if (in_array($this->form_section,["F22_2014"])){ |
|
$this->getField($section, $node->sequence->element[1], $settings); |
|
return; |
|
} |
|
|
|
$inputs[] = [ |
|
"type" => "hidden", |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"],["NO_LOT_DIVISION"])), |
|
"object" => "empty", |
|
"required" => true |
|
]; |
|
$this->fields = $this->makeArray(array_merge($settings["name"],["NO_LOT_DIVISION"]), $inputs, $this->fields); |
|
$this->getField($section, $node->sequence[1]->element[1], $settings); |
|
} |
|
|
|
private function lot_division_custom_section(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
if (in_array($this->form_section,["F04_2014","F21_2014","F22_2014"])) { |
|
return $this->lot_division_overrided_single_not_divided($node, $settings, $section); |
|
} |
|
return $this->lot_division_choice_custom_section($node, $settings, $section); |
|
} |
|
|
|
private function title_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
$this->getField($section, $child, $settings); |
|
|
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$input = self::get($this->fields, $key); |
|
$input["TITLE"]["name"] = "{$input["TITLE"]["name"]}[P]"; |
|
$input["TITLE"]["required"] = true; |
|
$input["TITLE"]["rel"] = ["S","2","380","RT"]; |
|
self::set($this->fields, $key, $input); |
|
} |
|
|
|
private function lot_max_number_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"],["LOT_MAX_NUMBER"]); |
|
$name = $this->arrayName2StringName(array_merge($s["name"], ["LOT_MAX_NUMBER"])); |
|
|
|
$inputs = [ |
|
"title" => $this->translate("LOTS_MAX"), |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "nb_lot", |
|
"value" => "LOT_MAX_NUMBER", |
|
"type" => "text", |
|
"size" => "col-12" |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($s["name"],["LOT_MAX_NUMBER"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function lot_division_f01_fields(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$name = $this->arrayName2StringName(array_merge($s["name"], ["LOT_MAX_NUMBER"])); |
|
$id = $this->getId($name); |
|
$key = trim(str_replace(['][', '[', ']'], '.', str_replace("guue", "", $name)), '.'); |
|
$lot_max_number_object = $this->makeAdd2GUUEObject([ |
|
"child" => '<element ref="LOT_MAX_NUMBER"/>', |
|
"settings" => $s, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
"multiple" => false, |
|
]); |
|
|
|
$s2 = $settings; |
|
array_pop($s2["name"]); |
|
|
|
$inputs[] = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["NUMBER_OF_LOTS"])), |
|
"size" => "col-sm-12", |
|
"type" => "text", |
|
"object" => "empty", |
|
"value" => "", |
|
"rel" => ["S", "1", "0", "N"], |
|
"title" => $this->translate("LOT_COUNT"), |
|
"required" => true, |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_LOT_PARTICIPATION"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "__£__", |
|
"title" => $this->translate("LOT_NONE"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_LOT_PARTICIPATION"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "LOT_ALL", |
|
"title" => $this->translate("LOT_ALL"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_LOT_PARTICIPATION"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "LOT_ONE_ONLY", |
|
"title" => $this->translate("LOT_ONE_ONLY"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_LOT_PARTICIPATION"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "LOT_MAX_NUMBER", |
|
"title" => $this->translate("LOT_MAX_NUMBER"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$lot_max_number_object}');" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"title" => "", |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $lot_max_number_object, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
], |
|
[ |
|
"title" => $this->translate("LOT_MAX_ONE_TENDERER"), |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["LOT_MAX_ONE_TENDERER"])), |
|
"object" => "nb_lot", |
|
"type" => "text", |
|
"rel" => ["N","0","0","N"], |
|
"size" => "col-12" |
|
], |
|
[ |
|
"title" => $this->translate("LOT_COMBINING_CONTRACT_RIGHT"), |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["LOT_COMBINING_CONTRACT_RIGHT"])), |
|
"object" => "text_ft_multi_lines", |
|
"required" => false, |
|
"type" => "textarea", |
|
], |
|
[ |
|
"type" => "hidden", |
|
"name" => $this->arrayName2StringName(array_merge($s2["name"], ["OBJECT_DESCR"])), |
|
"value" => "SUBSECTION-HERE" |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($s["name"], ["RADIO_FOR_LOT_DIVISION"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function lot_division_f02_fields(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$name = $this->arrayName2StringName(array_merge($s["name"], ["LOT_MAX_NUMBER"])); |
|
$id = $this->getId($name); |
|
$key = trim(str_replace(['][', '[', ']'], '.', str_replace("guue", "", $name)), '.'); |
|
$lot_max_number_object = $this->makeAdd2GUUEObject([ |
|
"child" => '<element ref="LOT_MAX_NUMBER"/>', |
|
"settings" => $s, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
"multiple" => false, |
|
]); |
|
|
|
$s2 = $settings; |
|
array_pop($s2["name"]); |
|
|
|
$inputs[] = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["NUMBER_OF_LOTS"])), |
|
"size" => "col-sm-12", |
|
"type" => "text", |
|
"object" => "empty", |
|
"value" => "", |
|
"rel" => ["S", "1", "0", "N"], |
|
"title" => $this->translate("LOT_COUNT"), |
|
"required" => true, |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_LOT_PARTICIPATION"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "LOT_ALL", |
|
"title" => $this->translate("LOT_ALL"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_LOT_PARTICIPATION"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "LOT_ONE_ONLY", |
|
"title" => $this->translate("LOT_ONE_ONLY"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_LOT_PARTICIPATION"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "LOT_MAX_NUMBER", |
|
"title" => $this->translate("LOT_MAX_NUMBER"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$lot_max_number_object}');" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"title" => "", |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $lot_max_number_object, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
], |
|
[ |
|
"title" => $this->translate("LOT_MAX_ONE_TENDERER"), |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["LOT_MAX_ONE_TENDERER"])), |
|
"object" => "nb_lot", |
|
"rel" => ["N","0","0","N"], |
|
"type" => "text", |
|
"size" => "col-12" |
|
], |
|
[ |
|
"title" => $this->translate("LOT_COMBINING_CONTRACT_RIGHT"), |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["LOT_COMBINING_CONTRACT_RIGHT"])), |
|
"object" => "text_ft_multi_lines", |
|
"required" => false, |
|
"type" => "textarea", |
|
], |
|
[ |
|
"type" => "hidden", |
|
"name" => $this->arrayName2StringName(array_merge($s2["name"], ["OBJECT_DESCR"])), |
|
"value" => "SUBSECTION-HERE" |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($s["name"], ["RADIO_FOR_LOT_DIVISION"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function lot_division_f04_fields(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
return $this->lot_division_f01_fields($node, $settings, $section); |
|
} |
|
|
|
private function lot_division_f05_fields(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
return $this->lot_division_f02_fields($node, $settings, $section); |
|
} |
|
|
|
private function lot_division_f21_fields(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
return $this->lot_division_f01_fields($node, $settings, $section); |
|
} |
|
|
|
private function lot_division_f22_fields(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$name = $this->arrayName2StringName(array_merge($s["name"], ["LOT_MAX_NUMBER"])); |
|
$id = $this->getId($name); |
|
$key = trim(str_replace(['][', '[', ']'], '.', str_replace("guue", "", $name)), '.'); |
|
$lot_max_number_object = $this->makeAdd2GUUEObject([ |
|
"child" => '<element ref="LOT_MAX_NUMBER"/>', |
|
"settings" => $s, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
"multiple" => false, |
|
]); |
|
|
|
$s2 = $settings; |
|
array_pop($s2["name"]); |
|
|
|
$inputs[] = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["NUMBER_OF_LOTS"])), |
|
"size" => "col-sm-12", |
|
"type" => "text", |
|
"object" => "empty", |
|
"value" => "", |
|
"rel" => ["S", "1", "0", "N"], |
|
"title" => $this->translate("LOT_COUNT"), |
|
"required" => true, |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_LOT_PARTICIPATION"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "LOT_ALL", |
|
"title" => $this->translate("LOT_ALL"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_LOT_PARTICIPATION"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "LOT_ONE_ONLY", |
|
"title" => $this->translate("LOT_ONE_ONLY"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_LOT_PARTICIPATION"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "LOT_MAX_NUMBER", |
|
"title" => $this->translate("LOT_MAX_NUMBER"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$lot_max_number_object}');" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_LOT_PARTICIPATION"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_LOT", |
|
"title" => $this->translate("NOT_SPECIFIED"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"title" => "", |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $lot_max_number_object, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
], |
|
[ |
|
"title" => $this->translate("LOT_MAX_ONE_TENDERER"), |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["LOT_MAX_ONE_TENDERER"])), |
|
"object" => "nb_lot", |
|
"rel" => ["N","0","0","N"], |
|
"type" => "text", |
|
"size" => "col-12" |
|
], |
|
[ |
|
"title" => $this->translate("LOT_COMBINING_CONTRACT_RIGHT"), |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["LOT_COMBINING_CONTRACT_RIGHT"])), |
|
"object" => "text_ft_multi_lines", |
|
"required" => false, |
|
"type" => "textarea", |
|
], |
|
[ |
|
"type" => "hidden", |
|
"name" => $this->arrayName2StringName(array_merge($s2["name"], ["OBJECT_DESCR"])), |
|
"value" => "SUBSECTION-HERE" |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($s["name"], ["RADIO_FOR_LOT_DIVISION"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function lot_division_f24_fields(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$name = $this->arrayName2StringName(array_merge($s["name"], ["LOT_MAX_NUMBER"])); |
|
$id = $this->getId($name); |
|
$key = trim(str_replace(['][', '[', ']'], '.', str_replace("guue", "", $name)), '.'); |
|
$lot_max_number_object = $this->makeAdd2GUUEObject([ |
|
"child" => '<element ref="LOT_MAX_NUMBER"/>', |
|
"settings" => $s, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
"multiple" => false, |
|
]); |
|
|
|
$inputs[] = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["NUMBER_OF_LOTS"])), |
|
"size" => "col-sm-12", |
|
"type" => "text", |
|
"object" => "empty", |
|
"value" => "", |
|
"rel" => ["S", "1", "0", "N"], |
|
"title" => $this->translate("LOT_COUNT"), |
|
"required" => true, |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_LOT_PARTICIPATION"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "LOT_ALL", |
|
"title" => $this->translate("LOT_ALL"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_LOT_PARTICIPATION"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "LOT_ONE_ONLY", |
|
"title" => $this->translate("LOT_ONE_ONLY"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_LOT_PARTICIPATION"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "LOT_MAX_NUMBER", |
|
"title" => $this->translate("LOT_MAX_NUMBER"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$lot_max_number_object}');" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"title" => "", |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $lot_max_number_object, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
], |
|
[ |
|
"title" => $this->translate("LOT_MAX_ONE_TENDERER"), |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["LOT_MAX_ONE_TENDERER"])), |
|
"object" => "nb_lot", |
|
"rel" => ["N","0","0","N"], |
|
"type" => "text", |
|
"size" => "col-12" |
|
], |
|
[ |
|
"title" => $this->translate("LOT_COMBINING_CONTRACT_RIGHT"), |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["LOT_COMBINING_CONTRACT_RIGHT"])), |
|
"object" => "text_ft_multi_lines", |
|
"required" => false, |
|
"type" => "textarea", |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($s["name"], ["RADIO_FOR_LOT_DIVISION"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function lot_division_f23_fields(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
return $this->lot_division_f01_fields($node, $settings, $section); |
|
} |
|
|
|
private function lot_numbers_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"],["LOT_DIVISION"]); |
|
|
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["NUMBER_OF_LOTS"])), |
|
"size" => "col-sm-12", |
|
"type" => "text", |
|
"object" => "empty", |
|
"value" => "", |
|
"rel" => ["S", "1", "0", "N"], |
|
"title" => $this->translate("LOT_COUNT"), |
|
"required" => true, |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($s["name"], ["RADIO_FOR_LOT_DIVISION"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function radio_for_pt_award_contract_with_prior_publication_sequence(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"], ["RADIO_FOR_PT_AWARD_CONTRACT_WITH_PRIOR_PUBLICATION_SEQUENCE"]); |
|
$id = strtolower(str_replace(["][", "[", "]"], ["_", "", ""], $this->arrayName2StringName($s["name"]))); |
|
|
|
$object1 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->sequence[0]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$object2 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->sequence[1]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
|
|
$value = self::get($this->info["valori"], implode(".", $s["name"])); |
|
|
|
$k = $this->arrayName2StringName($s["name"]); |
|
$k = trim(str_replace(['][', '[', ']'], '.', str_replace("guue", "", $k)), '.'); |
|
|
|
$selected = "empty"; |
|
if ($value == "PT_AWARD_CONTRACT_WITH_PRIOR_PUBLICATION_SEQUENCE") { |
|
$selected = $object1; |
|
} else if ($value == "NO_PT_AWARD_CONTRACT_WITH_PRIOR_PUBLICATION_SEQUENCE") { |
|
$selected = $object2; |
|
} |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_AWARD_CONTRACT_WITH_PRIOR_PUBLICATION_SEQUENCE", |
|
"title" => __guue("Specifica la procedura"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object1}')", |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_PT_AWARD_CONTRACT_WITH_PRIOR_PUBLICATION_SEQUENCE", |
|
"title" => __guue("Specifica le informazioni di carattere amministrativo"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object2}')", |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $k, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function officialname_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
if (!$settings["required"]) { |
|
$settings["required"] = true; |
|
} |
|
$n = $this->getTypeElement((string) $node->attributes()["ref"]); |
|
$this->getField($section, $n, $settings); |
|
} |
|
|
|
private function procurement_address_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$this->applyTitle("RADIO_FOR_PROCUREMENT_ADDRESS", $settings, $section); |
|
#region FACOLTATIVE |
|
$settings["skip-legal-basis"] = true; |
|
if (!empty($node->attributes()) && isset($node->attributes()["minOccurs"]) && (int) $node->attributes()["minOccurs"] == 0) { |
|
$s = $settings; |
|
|
|
$s["name"] = array_merge($s["name"], ["RADIO_FOR_PROCUREMENT_ADDRESS"]); |
|
$id = strtolower(str_replace(["][", "[", "]"], ["_", "", ""], $this->arrayName2StringName($s["name"]))); |
|
unset($node->attributes()["minOccurs"]); |
|
|
|
$settings["required"] = true; |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => $node->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$value = self::get($this->info["valori"], implode(".", $s["name"])); |
|
|
|
$k = $this->arrayName2StringName($s["name"]); |
|
$k = trim(str_replace(['][', '[', ']'], '.', str_replace("guue", "", $k)), '.'); |
|
|
|
$selected = "empty"; |
|
if ($value == "PROCUREMENT_ADDRESS") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PROCUREMENT_ADDRESS", |
|
"title" => $this->translate("YES"), |
|
"attrs" => [ |
|
"onChange" => "eForms2.add2GUUE('#{$id}', '{$object}')", |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_PROCUREMENT_ADDRESS", |
|
"title" => $this->translate("NO"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $k, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
#endregion |
|
#region SINGLE ELEMENT |
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"], ["RADIO_FOR_CONTRACTING_BODY_ADDITIONAL"]); |
|
$id = strtolower(str_replace(["][", "[", "]"], ["_", "", ""], $this->arrayName2StringName($s["name"]))); |
|
|
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString())->sequence->sequence; |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => $child->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$value = self::get($this->info["valori"], implode(".", $s["name"])); |
|
|
|
$k = $this->arrayName2StringName($s["name"]); |
|
$k = $this->getKeyFromNameString($k); |
|
|
|
$selected = "empty"; |
|
if ($value == "CONTRACTING_BODY_ADDITIONAL") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "CONTRACTING_BODY_ADDITIONAL", |
|
"title" => $this->translate("YES"), |
|
"attrs" => [ |
|
"onChange" => "eForms2.add2GUUE('#{$id}', '{$object}')", |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_CONTRACTING_BODY_ADDITIONAL", |
|
"title" => $this->translate("NO"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $k, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
$this->getField($section, $this->getTypeElement($node->attributes()["ref"]->__toString())->sequence->element, $settings); |
|
#endregion |
|
return false; |
|
} |
|
|
|
private function address_contracting_body_additional_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["required"] = true; |
|
$s["name"] = array_merge($settings["name"],["ADDRESS_CONTRACTING_BODY_ADDITIONAL"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString())->asXML(); |
|
if ($this->form_section == "F08_2014") { |
|
$child = $this->getTypeElement("contact_buyer")->asXML(); |
|
} |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => $child, |
|
"settings" => $s, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => true |
|
]); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => !empty($content) ? $object : "empty", |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
], |
|
[ |
|
"name" => "button", |
|
"required" => false, |
|
"type" => "button", |
|
"title" => __guue('Aggiungi i riferimenti di un\'altra stazione appaltante'), |
|
"attrs" => [ |
|
"onClick" => "eForms2.add2GUUE('#{$id}', '{$object}')", |
|
"class" => "btn btn-block btn-primary" |
|
] |
|
], |
|
]; |
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function contact_contracting_body_f14_fields(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$node = $this->getTypeElement($node->attributes()["type"]->__toString())->complexContent->restriction->sequence; |
|
$this->getField($section, $node, $settings); |
|
} |
|
|
|
private function contact_add_contracting_body_f14_fields(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["required"] = true; |
|
$s["name"] = $settings["name"]; |
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => $this->getTypeElement("contact_contracting_body_f14")->asXML(), |
|
"settings" => $s, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => true |
|
]); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => !empty($content) ? $object : "empty", |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
], |
|
[ |
|
"name" => "button", |
|
"required" => false, |
|
"type" => "button", |
|
"title" => __guue('Aggiungi i riferimenti di un\'altra stazione appaltante'), |
|
"attrs" => [ |
|
"onClick" => "eForms2.add2GUUE('#{$id}', '{$object}')", |
|
"class" => "btn btn-block btn-primary" |
|
] |
|
], |
|
]; |
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function information_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["required"] = true; |
|
$settings["skip-legal-basis"] = true; |
|
if ($this->minOccursRadio($node, $settings, $section, "INFORMATION", __guue("Specifica dove sono reperibili ulteriori informazioni"))) { |
|
return; |
|
} |
|
$s["name"] = array_merge($settings["name"], ["ADDRESS_FURTHER_INFO"]); |
|
|
|
$id = strtolower(str_replace(["][", "[", "]"], ["_", "", ""], $this->arrayName2StringName($s["name"]))); |
|
$child = $this->getTypeElement("contact_contracting_body")->asXML(); |
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$value = self::get($this->info["valori"], implode(".", array_merge($settings["name"], ["RADIO_FOR_INFORMATION_OPT"]))); |
|
|
|
$selected = "empty"; |
|
if ($value == "ADDRESS_FURTHER_INFO") { |
|
$selected = $object; |
|
} |
|
|
|
$input = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_INFORMATION_OPT"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "ADDRESS_FURTHER_INFO_IDEM", |
|
"title" => $this->translate("ADDRESS_FURTHER_INFO_IDEM"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_INFORMATION_OPT"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "ADDRESS_FURTHER_INFO", |
|
"title" => $this->translate("ADDRESS_FURTHER_INFO"), |
|
"attrs" => [ |
|
"onChange" => "eForms2.add2GUUE('#{$id}', '{$object}')", |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
], |
|
]; |
|
|
|
$settings["name"][] = "address_furtherinfo"; |
|
$this->fields = $this->makeArray($settings["name"], $input, $this->fields); |
|
|
|
} |
|
|
|
private function tenders_request_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
if ($this->minOccursRadio($node, $settings, $section, "ADDESS_PARTICIPATION", __guue("Specifica l'invio delle offerte o domande di partecipazione"))){ |
|
return; |
|
} |
|
$s = $settings; |
|
unset($s["required"]); |
|
$s["name"] = array_merge($s["name"], ["ADDRESS_PARTICIPATION"]); |
|
|
|
$id = strtolower(str_replace(["][", "[", "]"], ["_", "", ""], $this->arrayName2StringName($s["name"]))); |
|
|
|
$child = $this->getTypeElement("ADDRESS_PARTICIPATION")->asXML(); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$k = $this->arrayName2StringName(array_merge($settings["name"], ["ADDRESS_PARTICIPATION"])); |
|
$k = trim(str_replace(['][', '[', ']'], '.', str_replace("guue", "", $k)), '.'); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["URL_PARTICIPATION"])), |
|
"size" => "col-sm-12", |
|
"type" => "text", |
|
"title" => $this->translate("URL_PARTICIPATION"), |
|
"required" => false, |
|
"rel" => ["N","8","0","L"], |
|
"hidden-label" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_ADDRESS_SEND_TENDERS_REQUEST"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "ADDRESS_PARTICIPATION_IDEM", |
|
"title" => $this->translate("ADDRESS_PARTICIPATION_IDEM"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_ADDRESS_SEND_TENDERS_REQUEST"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "__£__", |
|
"title" => $this->translate("ADDRESS_PARTICIPATION"), |
|
"attrs" => [ |
|
"onChange" => "eForms2.add2GUUE('#{$id}', '{$object}')", |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $k, |
|
"object" => $object, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
], |
|
]; |
|
|
|
$this->ignored_keys[] = ["address_send_tenders_request"]; |
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["address_send_tenders_request"]), $inputs, $this->fields); |
|
} |
|
|
|
private function document_url_man_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
if ($this->debug && isset($node->attributes()["minOccurs"]) && (int) $node->attributes()["minOccurs"] == 0) { |
|
$this->radio_for_document_url_man($node, $settings, $section); |
|
return; |
|
} |
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"],["RADIO_FOR_DOCUMENT_FULL"]); |
|
|
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"title" => $this->translate("DOCUMENT_FULL"), |
|
"value" => "DOCUMENT_FULL", |
|
"group_validate" => true, |
|
"required" => true |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"title" => $this->translate("DOCUMENT_RESTRICTED"), |
|
"value" => "DOCUMENT_RESTRICTED", |
|
"group_validate" => true, |
|
"required" => true |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
$this->getField($section, (($this->getTypeElement($node->attributes()["ref"]->__toString()))->sequence->element), $settings); |
|
return false; |
|
} |
|
|
|
private function radio_for_document_url_man(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$settings["skip-legal-basis"] = true; |
|
$settings["required"] = true; |
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"], ["RADIO_FOR_DOCUMENT_URL_MAN"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = $this->getId($name); |
|
|
|
$key = $this->getKeyFromNameString($name); |
|
if (isset($node->group)) { |
|
$node->group->attributes()["ref"] = "document_url_opt"; |
|
} |
|
unset($node->attributes()["minOccurs"]); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $node->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$selected = "empty"; |
|
$value = self::get($this->info["valori"], $key); |
|
|
|
if ($value == "CHOICE_DOCUMENT_URL_MAN") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs[] = [ |
|
[ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"title" => $this->translate("YES"), |
|
"value" => "CHOICE_DOCUMENT_URL_MAN", |
|
"group_validate" => true, |
|
"required" => false, |
|
"attrs" => [ |
|
"onChange" => "eForms2.add2GUUE('#{$id}', '{$object}')", |
|
] |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "CHOICE_NO_DOCUMENT_URL_MAN", |
|
"title" => $this->translate("NO"), |
|
"group_validate" => true, |
|
"required" => true, |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function document_url_opt_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
|
|
$s = $settings; |
|
if($this->minOccursRadio($node, $settings, $section, "DOCUMENT_URL_OPT_SECTION", __guue("Specifica la comunicazione dei documenti di gara"))) { |
|
return; |
|
} |
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"],["RADIO_FOR_DOCUMENT_FULL"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "DOCUMENT_FULL", |
|
"title" => $this->translate("DOCUMENT_FULL"), |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"],["RADIO_FOR_DOCUMENT_FULL"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "DOCUMENT_RESTRICTED", |
|
"title" => $this->translate("DOCUMENT_RESTRICTED"), |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
"URL_DOCUMENT" => [ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["URL_DOCUMENT"])), |
|
"size" => "col-sm-12", |
|
"type" => "text", |
|
"object" => "empty", |
|
"required" => true, |
|
"rel" => ["S","8","0","L"] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($s["name"],["RADIO_FOR_DOCUMENT_FULL"]), $inputs, $this->fields); |
|
|
|
} |
|
|
|
private function authority_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["CA_TYPE", "_attributes", "VALUE"])), |
|
"size" => "col-sm-4", |
|
"type" => "select", |
|
"object" => "empty", |
|
"options" => [ |
|
"BODY_PUBLIC" => $this->translate("maintype_publicbody"), |
|
"EU_INSTITUTION" => $this->translate("maintype_euinst"), |
|
"MINISTRY" => $this->translate("maintype_ministry"), |
|
"NATIONAL_AGENCY" => $this->translate("maintype_natagency"), |
|
"REGIONAL_AGENCY" => $this->translate("maintype_localagency"), |
|
"REGIONAL_AUTHORITY" => $this->translate("maintype_localauth"), |
|
], |
|
"title" => $this->translate("CA_TYPE"), |
|
"required" => false, |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["CA_TYPE_OTHER"])), |
|
"size" => "col-sm-8", |
|
"type" => "text", |
|
"object" => "empty", |
|
"title" => $this->translate("CA_TYPE_OTHER"), |
|
"required" => true |
|
] |
|
]; |
|
|
|
$this->ignored_keys[] = ["ca_type_selection"]; |
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["ca_type_selection"]), $inputs, $this->fields); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["CA_ACTIVITY", "_attributes", "VALUE"])), |
|
"size" => "col-sm-4", |
|
"type" => "select", |
|
"object" => "empty", |
|
"options" => [ |
|
"DEFENCE" => $this->translate("mainactiv_defence"), |
|
"ECONOMIC_AND_FINANCIAL_AFFAIRS" => $this->translate("mainactiv_economic"), |
|
"EDUCATION" => $this->translate("mainactiv_education"), |
|
"ENVIRONMENT" => $this->translate("mainactiv_environment"), |
|
"GENERAL_PUBLIC_SERVICES" => $this->translate("mainactiv_general"), |
|
"HEALTH" => $this->translate("mainactiv_health"), |
|
"HOUSING_AND_COMMUNITY_AMENITIES" => $this->translate("mainactiv_housing"), |
|
"PUBLIC_ORDER_AND_SAFETY" => $this->translate("mainactiv_safety"), |
|
"RECREATION_CULTURE_AND_RELIGION" => $this->translate("mainactiv_culture"), |
|
"SOCIAL_PROTECTION" => $this->translate("mainactiv_social"), |
|
], |
|
"title" => $this->translate("CA_ACTIVITY"), |
|
"required" => false |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["CA_ACTIVITY_OTHER"])), |
|
"size" => "col-sm-8", |
|
"type" => "text", |
|
"object" => "empty", |
|
"title" => $this->translate("CA_ACTIVITY_OTHER"), |
|
"required" => true |
|
] |
|
]; |
|
|
|
$this->ignored_keys[] = ["ca_activity_selection"]; |
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["ca_activity_selection"]), $inputs, $this->fields); |
|
|
|
} |
|
|
|
private function nuts_fields(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$input["type"] = "select"; |
|
$input["required"] = $settings["required"]; |
|
$settings["object"] = "nuts"; |
|
$input["title"] = $this->translate("NUTS"); |
|
$input["name"] = $this->arrayName2StringName($settings["name"]); |
|
$input["size"] = $this->size["NUTS"] ?? "col-sm-12"; |
|
|
|
$where = null; |
|
if(empty($this->info["codice"])) { |
|
$where = "WHERE data_fine_validita = ''"; |
|
} else if (!empty($this->info["data_creazione"])){ |
|
$where = "WHERE data_fine_validita = '' OR DATE(data_fine_validita) > '{$this->info['data_creazione']}' "; |
|
} |
|
$nuts = $this->pdo->go("SELECT nuts, descrizione, data_fine_validita FROM b_nuts {$where}")->fetchAll(PDO::FETCH_ASSOC); |
|
foreach ($nuts as $nut) { |
|
$validity = ""; |
|
if (!empty($nut["data_fine_validita"])) { |
|
$validity = "(".__guue("scaduto il") . ": " . Datetime::createFromFormat('Y-m-d',$nut["data_fine_validita"])->format("d/m/Y") .")"; |
|
} |
|
$input["options"][$nut["nuts"]] = $nut["descrizione"] . " " . $validity; |
|
} |
|
|
|
$this->fields = $this->makeArray($settings["name"], $input, $this->fields); |
|
} |
|
|
|
private function country_fields(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
if (isset($node->attributes()["maxOccurs"])) { |
|
$s = $settings; |
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($s["name"])))); |
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
unset($node->attributes()["maxOccurs"]); |
|
$object = $this->makeAdd2GUUEObject(["child" => $node->asXML(), "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => true]); |
|
$input = [ |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $object, |
|
"attrs" => [ |
|
"id" => $id, |
|
] |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["NON_COMMUNITY_BODY_ADDITIONAL_BUTTON"])), |
|
"required" => false, |
|
"type" => "button", |
|
"title" => __guue('Aggiungi un paese'), |
|
"attrs" => [ |
|
"onClick" => "eForms2.add2GUUE('#{$id}', '{$object}')", |
|
"class" => "btn btn-block btn-primary" |
|
] |
|
] |
|
]; |
|
} else { |
|
$input["title"] = $this->translate("COUNTRY"); |
|
$input["type"] = "select"; |
|
$input["required"] = $settings["required"]; |
|
$input["name"] = $this->arrayName2StringName(array_merge($settings["name"], ["_attributes", "VALUE"])); |
|
$input["size"] = $this->estimateSize($settings); |
|
$input["attrs"] = ["rel" => [($input["required"] ? "S" : "N"),"A","2","2"]]; |
|
|
|
$stati = $this->pdo->go("SELECT sigla, stato FROM b_stati")->fetchAll(PDO::FETCH_ASSOC); |
|
foreach ($stati as $stato) { |
|
$input["options"][$stato["sigla"]] = $stato["stato"]; |
|
} |
|
} |
|
$this->fields = $this->makeArray($settings["name"], $input, $this->fields); |
|
} |
|
|
|
private function eu_progr_related_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$name = $this->arrayName2StringName($settings["name"]); |
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "textarea", |
|
"title" => $this->translate("EU_PROGR_RELATED",$this->arrayName2StringName($settings["name"])), |
|
"rel" => [$settings["required"] ? "S" : "N", "0", "400", "RT"], |
|
"required" => $settings["required"] |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function short_descr_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$name = $this->arrayName2StringName($settings["name"]); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "textarea", |
|
"title" => $this->translate("SHORT_DESCR",$this->arrayName2StringName($settings["name"])), |
|
"rel" => [$settings["required"] ? "S" : "N", "0", "4000", "RT"], |
|
"required" => $settings["required"] |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function award_criteria_doc_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_AWARD_CRITERIA_DOC"])))); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $this->getTypeElement("award_criteria")->asXML(), "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false, 'force-show' => true]); |
|
|
|
$key = $this->arrayName2StringName(array_merge($s["name"], ["AC_QUALITY_SECTION"])); |
|
$key = trim(str_replace(['][', '[', ']'], '.', str_replace("guue", "", $key)), '.'); |
|
|
|
$content = self::get($this->info["valori"], implode(".", array_merge($s["name"], ["RADIO_FOR_AWARD_CRITERIA_DOC"]))); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_AWARD_CRITERIA_DOC"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "AC_PROCUREMENT_DOC", |
|
"title" => $this->translate("AC_PROCUREMENT_DOC"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_AWARD_CRITERIA_DOC"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "__£__" , |
|
"title" => $this->translate("award_criteria"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}')", |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $content == "__£__" ? $key : null, |
|
"object" => $content == "__£__" ? $object : null, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($s["name"],["RADIO_FOR_AWARD_CRITERIA_DOC"]), $inputs, $this->fields); |
|
|
|
} |
|
|
|
private function ac_weighting_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$inputs[] = [ |
|
"title" => $this->translate("AC_WEIGHTING"), |
|
"name" => $this->arrayName2StringName($settings["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "weight", |
|
"attrs" => [], |
|
"label-attrs" => [ |
|
"class" => "mt-auto mx-auto" |
|
], |
|
"required" => $settings["required"], |
|
"rel" => [ |
|
$settings["required"] ? "S" : "N","0","100","N" |
|
] |
|
]; |
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function award_criteria_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["AC_QUALITY"]); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["AWARD_CRITERIA_NODE"])))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $this->getTypeElement("AC_QUALITY")->asXML(), "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => true]); |
|
|
|
if (in_array($this->form_section, ["F06_2014"]) || in_array($this->form_section,["F15_2014"]) && count($settings["name"]) > 2 && $settings["name"][count($settings["name"]) - 2] != "DIRECTIVE_2014_24_EU") { |
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"],["_attributes","PUBLICATION"])), |
|
"size" => "col-12", |
|
"type" => "select", |
|
"object" => "empty", |
|
"options" => [ |
|
"NO" => $this->translate("NO"), |
|
"YES" => $this->translate("YES"), |
|
], |
|
"title" => $this->translate("PUBLICATION"), |
|
"required" => true |
|
]; |
|
} |
|
|
|
$inputs[] = [ |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => !empty($content) ? $object : "empty", |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
], |
|
[ |
|
"name" => "button", |
|
"required" => false, |
|
"type" => "button", |
|
"title" => __guue('Aggiungi un criterio di qualità'), |
|
"attrs" => [ |
|
"onClick" => "eForms2.add2GUUE('#{$id}', '{$object}')", |
|
"class" => "btn btn-block btn-primary" |
|
] |
|
], |
|
]; |
|
|
|
|
|
$inputs[] = [ |
|
"info" => ["title" => __guue("Criteri sull'offerta economica")] |
|
]; |
|
|
|
$s["name"] = array_merge($settings["name"], ["AC_COST"]); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["AC_COST_PRICE_CRITERION"])))); |
|
|
|
$cost_key = $this->arrayName2StringName($s["name"]); |
|
$cost_key = $this->getKeyFromNameString($cost_key); |
|
|
|
$cost_content = self::get($this->info["valori"], $cost_key); |
|
|
|
$cost_object = $this->makeAdd2GUUEObject(["child" => $this->getTypeElement("AC_COST")->asXML(), "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false, 'force-show' => true]); |
|
|
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_AWARD_CRITERIA_SECTION"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "AC_COST", |
|
"title" => $this->translate("AC_COST"), |
|
"required" => true, |
|
"group-validate" => true, |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$cost_object}');" |
|
] |
|
]; |
|
|
|
$s["name"] = array_merge($settings["name"], ["AC_PRICE"]); |
|
|
|
$price_key = $this->arrayName2StringName($s["name"]); |
|
$price_key = $this->getKeyFromNameString($price_key); |
|
|
|
$price_content = self::get($this->info["valori"], $price_key); |
|
|
|
$price_object = $this->makeAdd2GUUEObject(["child" => $this->getTypeElement("AC_PRICE")->asXML(), "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_AWARD_CRITERIA_SECTION"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "AC_PRICE", |
|
"title" => $this->translate("AC_PRICE"), |
|
"required" => true, |
|
"group-validate" => true, |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$price_object}');" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => !empty($cost_content) ? $cost_key : (! empty($price_content) ? $price_key : null), |
|
"object" => !empty($cost_content) ? $cost_object : (! empty($price_content) ? $price_object : "empty"), |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
|
|
} |
|
|
|
private function ac_cost_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["required"] = false; |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["AC_COST_CRITERION"])))); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $this->getTypeElement("ac_definition")->asXML(), "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => true]); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => !empty($content) ? $object : "empty", |
|
"attrs" => [ |
|
"id" => $id, |
|
] |
|
], |
|
[ |
|
"name" => "button", |
|
"required" => false, |
|
"type" => "button", |
|
"title" => __guue('Aggiungi un criterio di prezzo'), |
|
"attrs" => [ |
|
"onClick" => "eForms2.add2GUUE('#{$id}', '{$object}');", |
|
"class" => "btn btn-block btn-primary" |
|
] |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
|
|
} |
|
|
|
private function ac_definition_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$inputs = [ |
|
[ |
|
"size" => "col-12", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["AC_CRITERION"])), |
|
"title" => $this->translate("AC_CRITERION"), |
|
"type" => "text", |
|
"required" => $settings["required"] |
|
], |
|
[ |
|
"size" => "col-12", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["AC_WEIGHTING"])), |
|
"title" => $this->translate("AC_WEIGHTING"), |
|
"type" => "weight", |
|
"required" => $settings["required"] |
|
] |
|
]; |
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function date_start_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$inputs = [ |
|
[ |
|
"size" => "col-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"title" => $this->translate("DATE_START"), |
|
"type" => "date", |
|
"required" => $settings["required"], |
|
], |
|
]; |
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function date_end_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$inputs = [ |
|
[ |
|
"size" => "col-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"title" => $this->translate("DATE_END"), |
|
"type" => "date", |
|
"required" => $settings["required"], |
|
], |
|
]; |
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function val_fields(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
|
|
$req = true; |
|
$rel = ["S","1","0","2D"]; |
|
|
|
if (isset($node->attributes()["minOccurs"]) && $node->attributes()["minOccurs"] == 0) { |
|
|
|
$req = false; |
|
$rel = ["N", "0", "0", "2D"]; |
|
|
|
} |
|
|
|
$inputs = [ |
|
[ |
|
[ |
|
"size" => "col-sm-4", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["_attributes", "CURRENCY"])), |
|
"object" => "empty", |
|
"title" => $this->translate("CURRENCY"), |
|
"required" => $req, |
|
"type" => "select", |
|
"options" => $this->getCurrencyOptions() |
|
], |
|
[ |
|
"size" => "col-sm-8", |
|
"title" => $this->translate("VALUE"), |
|
"name" => $this->arrayName2StringName(array_merge($s["name"],["_value"])), |
|
"object" => "empty", |
|
"required" => $req, |
|
"type" => "number", |
|
"rel" => $rel |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
|
|
} |
|
|
|
private function time_frame_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$options["title"] = [ |
|
"info" => [ |
|
"title" => $this->translate("RADIO_FOR_TIME_FRAME"), |
|
"style" => "subtitle", |
|
"hidden" => true |
|
] |
|
]; |
|
if ($this->minOccursRadio($node, $settings, $section, "TIME_FRAME","RADIO_FOR_TIME_FRAME",$options)) { |
|
return; |
|
} |
|
|
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["SECTION_FOR_TIME_FRAME"]); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
|
|
$key = $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_TIME_FRAME"])); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$obj = null; |
|
|
|
$search = "//*[@name='DURATION']"; |
|
$child = $this->dom->xpath($search)[0]; |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $child->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_TIME_FRAME"])), |
|
"object" => "empty", |
|
"title" => $this->translate("DURATION"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "DURATION", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty(); eForms2.add2GUUE('#{$id}','{$object}')" |
|
] |
|
]; |
|
|
|
if($content == "DURATION") { |
|
|
|
$obj = $object; |
|
|
|
} |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $this->getTypeElement("time_frame")->choice->sequence->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_TIME_FRAME"])), |
|
"object" => "empty", |
|
"title" => $this->translate("DATE_START_AND_DATE_END"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "DATE_START_AND_DATE_END", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty(); eForms2.add2GUUE('#{$id}','{$object}')" |
|
] |
|
]; |
|
|
|
if($content == "DATE_START_AND_DATE_END") { |
|
|
|
$obj = $object; |
|
|
|
} |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $this->getTypeElement("DATE_END")->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_TIME_FRAME"])), |
|
"object" => "empty", |
|
"title" => $this->translate("DATE_END"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "DATE_END", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty(); eForms2.add2GUUE('#{$id}','{$object}')" |
|
] |
|
]; |
|
|
|
if($content == "DATE_END") { |
|
|
|
$obj = $object; |
|
|
|
} |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $obj, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
|
|
} |
|
|
|
private function duration_m_d_fields(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$inputs = [ |
|
[ |
|
"size" => "col-sm-4", |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["_attributes", "TYPE"])), |
|
"object" => "empty", |
|
"title" => __guue("Tipo di durata"), |
|
"required" => true, |
|
"type" => "select", |
|
"options" => [ |
|
"MONTH" => __guue("Mesi"), |
|
"DAY" => __guue("Giorni") |
|
] |
|
], |
|
[ |
|
"size" => "col-sm-8", |
|
"title" => $this->translate("DURATION"), |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["_value"])), |
|
"type" => "text", |
|
"object" => "empty", |
|
"value" => "DURATION", |
|
"attrs" => [ |
|
"class" => "datetime" |
|
] |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
|
|
} |
|
|
|
private function renewal_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_RENEWAL"]); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName($settings["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $this->getTypeElement("RENEWAL_DESCR")->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$inputs = []; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("RENEWAL"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "RENEWAL", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}');" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO_RENEWAL"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NO_RENEWAL", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
]; |
|
|
|
$key = $this->arrayName2StringName(array_merge($settings["name"], ["RENEWAL_DESCR"])); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $content == "RENEWAL" ? $object : "empty", |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
|
|
} |
|
|
|
private function renewal_descr_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
return; |
|
} |
|
|
|
private function accepted_variants_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
$this->getField($section, $child, $settings); |
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
$inputs = self::get($this->fields, $key); |
|
$inputs["ACCEPTED_VARIANTS"]["title"] = $this->translate("ACCEPTED_VARIANTS"); |
|
$inputs["VARIANTS_INFO"] = [$inputs["ACCEPTED_VARIANTS"]]; |
|
unset($inputs["ACCEPTED_VARIANTS"]); |
|
self::set($this->fields, $key, $inputs); |
|
} |
|
|
|
private function variants_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_VARIANTS"]); |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("ACCEPTED_VARIANTS"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "ACCEPTED_VARIANTS" |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO_ACCEPTED_VARIANTS"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NO_ACCEPTED_VARIANTS" |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
|
|
} |
|
|
|
private function ecatalogue_required_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
$this->getField($section, $child, $settings); |
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
$inputs = self::get($this->fields, $key); |
|
$ecatalogue_required = $inputs["ECATALOGUE_REQUIRED"]; |
|
$ecatalogue_required["title"] = $this->translate("ECATALOGUE_REQUIRED"); |
|
unset($inputs["ECATALOGUE_REQUIRED"]); |
|
$inputs = array_merge($inputs, [ |
|
"ECATALOGUE_REQUIRED_CHECKBOX" => [ |
|
$ecatalogue_required |
|
] |
|
]); |
|
self::set($this->fields, $key, $inputs); |
|
} |
|
|
|
private function options_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_OPTIONS"]); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName($settings["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $this->getTypeElement("OPTIONS_DESCR")->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$inputs = []; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("OPTIONS"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "OPTIONS", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}');" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO_OPTIONS"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NO_OPTIONS", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $content == "OPTIONS" ? $object : "empty", |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function options_descr_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
return; |
|
} |
|
|
|
private function eu_union_funds_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$settings["required"] = true; |
|
$options = []; |
|
$options["title"] = [ |
|
"info" => [ |
|
"title" => $this->translate("EU_UNION_FUNDS"), |
|
"style" => "subtitle", |
|
"hidden" => true |
|
] |
|
]; |
|
if ($this->minOccursRadio($node, $settings, $section, "EU_UNION_FUNDS", __guue("Specifica le informazioni relative ai fondi dell'unione europea"), $options)) { |
|
return; |
|
} |
|
$s["name"] = array_merge($settings["name"],["RADIO_FOR_EU_UNION_FOUNDS"]); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$child = $this->getTypeElement("EU_PROGR_RELATED"); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $child->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$inputs = [ |
|
[ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("CHOICE_EU_PROGR_RELATED"), |
|
"required" => true, |
|
"group_vaidate" => true, |
|
"type" => "radio", |
|
"value" => "__£__", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}')" |
|
] |
|
], |
|
[ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO_EU_PROGR_RELATED"), |
|
"required" => true, |
|
"group_vaidate" => true, |
|
"type" => "radio", |
|
"value" => "NO_EU_PROGR_RELATED", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
] |
|
]; |
|
|
|
$key = $this->arrayName2StringName(array_merge($settings["name"], ["EU_PROGR_RELATED"])); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $content == "__£__" ? $object : "empty", |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
|
|
} |
|
|
|
private function suitability_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
$this->getField($section, $child, $settings); |
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
$inputs = self::get($this->fields, $key); |
|
#FIX_ME: causa un problema grafico sull'F04, per il momento lo lascio commentato |
|
#$inputs = array_merge(["info" => ["title" => $this->translate("SECTION_III_LEFTI")]], $inputs); |
|
self::set($this->fields, $key, $inputs); |
|
} |
|
|
|
private function economic_criteria_doc_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_ECONOMIC_CRITERIA_DOC"]); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName($settings["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$child = '<sequence><element name="ECONOMIC_FINANCIAL_INFO" type="text_ft_multi_lines"/><element name="ECONOMIC_FINANCIAL_MIN_LEVEL" type="text_ft_multi_lines"/></sequence>'; |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$inputs = []; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("ECONOMIC_CRITERIA_DOC"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "ECONOMIC_CRITERIA_DOC", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO_ECONOMIC_CRITERIA_DOC"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "__£__", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}');" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $content == "__£__" ? $object : "empty", |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$s["name"] = array_merge($s["name"], ["ECONOMIC_FINANCIAL_STANDING"]); |
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function economic_financial_info_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
return; |
|
} |
|
|
|
private function economic_financial_min_level_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
return; |
|
} |
|
|
|
private function technical_criteria_doc_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_TECHNICAL_CRITERIA_DOC"]); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName($settings["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$child = '<sequence><element name="TECHNICAL_PROFESSIONAL_INFO" type="text_ft_multi_lines"/><element name="TECHNICAL_PROFESSIONAL_MIN_LEVEL" type="text_ft_multi_lines"/></sequence>'; |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$inputs = []; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("TECHNICAL_CRITERIA_DOC"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "TECHNICAL_CRITERIA_DOC", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO_TECHNICAL_CRITERIA_DOC"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "__£__", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}');" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $content == "__£__" ? $object : "empty", |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$s["name"] = array_merge($s["name"], ["TECHNICAL_CAPACITY"]); |
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function technical_professional_info_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
return; |
|
} |
|
|
|
private function technical_professional_min_level_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
return; |
|
} |
|
|
|
private function restricted_sheltered_workshop_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
$this->getField($section, $child, $settings); |
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
$inputs = self::get($this->fields, $key); |
|
$inputs["RESTRICTED_SHELTERED_WORKSHOP"]["title"] = $this->translate("RESTRICTED_SHELTERED_WORKSHOP"); |
|
$inputs["CONTRACTS_RESERVED"] = [$inputs["RESTRICTED_SHELTERED_WORKSHOP"]]; |
|
unset($inputs["RESTRICTED_SHELTERED_WORKSHOP"]); |
|
self::set($this->fields, $key, $inputs); |
|
} |
|
|
|
private function pt_restricted_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$parent = $node->xpath("parent::*")[0]; |
|
if($parent->element->count() == 2 && strpos($parent->asXML(), "PT_COMPETITIVE_NEGOTIATION") !== false) { |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"], ["RADIO_FOR_PT_RESTRICTED"]); |
|
|
|
$inputs = [ |
|
[ |
|
"info" => [ |
|
"title" => "IV_PROCEDURE_DESCRIPTION" |
|
] |
|
], |
|
"TYPE_PROCEDURE" => [ |
|
[ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("PT_RESTRICTED"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "PT_RESTRICTED" |
|
], |
|
[ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("PT_COMPETITIVE_NEGOTIATION"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "PT_COMPETITIVE_NEGOTIATION" |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
private function pt_competitive_negotiation_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
return; |
|
} |
|
|
|
private function justification_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$name = $this->arrayName2StringName($settings["name"]); |
|
|
|
$inputs = [ |
|
[ |
|
"info" => [ |
|
"title" => "* ". $this->translate("JUSTIFICATION"), |
|
"style" => "annotation", |
|
] |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "textarea", |
|
"title" => $this->translate("MOTIVAZIONE"), |
|
"required" => $settings["required"] |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function framework_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$options = []; |
|
$options["title"] = [ |
|
"info" => [ |
|
"title" => $this->translate("FRAMEWORK"), |
|
"style" => "subtitle", |
|
"hidden" => true |
|
] |
|
]; |
|
if (isset($node->complexType) && $this->minOccursRadio($node, $settings, $section, "FRAMEWORK", $this->translate("FRAMEWORK"), $options)) { |
|
return; |
|
} |
|
$s = $settings; |
|
if (isset($node->complexType)){ |
|
$this->getField($section, $node->complexType, $settings); |
|
} else { |
|
$s["name"] = array_merge($s["name"], ["FRAMEWORK"]); |
|
unset($node->attributes()["name"]); |
|
$this->getField($section, $node, $settings); |
|
} |
|
} |
|
|
|
private function framework_info_fields(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"], ["RADIO_FOR_FRAMEWORK_INFO"]); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName($settings["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$value = self::get($this->info["valori"], $key); |
|
|
|
array_pop($settings["name"]); |
|
$settings["name"][] = "RADIO_FOR_FRAMEWORK_INFO"; |
|
$child = ' |
|
<sequence> |
|
<element ref="SEVERAL_OPERATORS_CHOICE"/> |
|
<element ref="JUSTIFICATION" minOccurs="0"/> |
|
</sequence> |
|
'; |
|
|
|
$s2 = $s; |
|
array_pop($s2["name"]); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $s2, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$selected = "empty"; |
|
if ($value == "NOTICE_INVOLVES_FRAMEWORK") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NOTICE_INVOLVES_FRAMEWORK"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NOTICE_INVOLVES_FRAMEWORK", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}');" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NOTICE_INVOLVES_NO_FRAMEWORK"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NOTICE_INVOLVES_NO_FRAMEWORK", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
]; |
|
|
|
if (isset($node->attributes()["minOccurs"]) && (int) $node->attributes()["minOccurs"] == 0) { |
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO_FRAMEWORK_INFO"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NO_FRAMEWORK_INFO", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
]; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
|
|
} |
|
|
|
private function several_operators_node(SimpleXMLIterator $node, Array $settings = [], String $section) { |
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName($settings["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "text", |
|
"val" => "__£__", |
|
"attrs" => ["hidden" => true], |
|
"hidden-label" => true |
|
]; |
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function several_operators_choice_ref(SimpleXMLIterator $node, Array $settings = [], String $section) { |
|
$inputs = []; |
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"], ["RADIO_FOR_SEVERAL_OPERATORS"]); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName($settings["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
//$settings["name"][] = "RADIO_FOR_SEVERAL_OPERATORS"; |
|
|
|
$child = '<sequence><element ref="SEVERAL_OPERATORS"/><element ref="NB_PARTICIPANTS" minOccurs="0"/></sequence>'; |
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$value = self::get($this->info["valori"], $key); |
|
|
|
$selected = "empty"; |
|
if ($value == "SEVERAL_OPERATORS_CHECK") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("SEVERAL_OPERATORS"), |
|
"required" => true, |
|
"group_validate" => true, |
|
"type" => "radio", |
|
"value" => "SEVERAL_OPERATORS_CHECK", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}');" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("SINGLE_OPERATOR"), |
|
"required" => true, |
|
"group_validate" => true, |
|
"type" => "radio", |
|
"value" => "SINGLE_OPERATOR", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function dps_purchasers_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"], ["RADIO_FOR_DPS_PURCHASERS"]); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName($settings["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$child = '<element name="DPS_ADDITIONAL_PURCHASERS" type="empty" minOccurs="0"/>'; |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("DPS"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "DPS", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}');" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO_DPS"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "__£__", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $content == "DPS" ? $object : "empty", |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function eauction_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"], ["RADIO_FOR_EAUCTION"]); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName($settings["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$child = '<element ref="INFO_ADD_EAUCTION" minOccurs="0"/>'; |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("EAUCTION_USED"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "EAUCTION_USED", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}');" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO_EAUCTION_USED"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "__£__", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $content == "EAUCTION_USED" ? $object : "empty", |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function radio_for_gpa(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_GPA_COVERED"]); |
|
|
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName($settings["name"]))); |
|
|
|
$s2 = $settings; |
|
$s2["name"] = array_merge($settings["name"],["CONTRACT_COVERED_GPA"]); |
|
|
|
$s3 = $settings; |
|
$s3["name"] = array_merge($settings["name"], ["NO_CONTRACT_COVERED_GPA"]); |
|
|
|
|
|
$obj1 = $this->makeAdd2GUUEObject(["child" => $this->getTypeElement((string) $node->element[0]->attributes()["type"])->asXML(), "settings" => $s2, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
$obj2 = $this->makeAdd2GUUEObject(["child" => $this->getTypeElement((string) $node->element[1]->attributes()["type"])->asXML(), "settings" => $s3, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
|
|
$value = self::get($this->info["valori"], implode(".", array_merge($settings["name"],["RADIO_FOR_GPA_COVERED"]))); |
|
|
|
$selected = "empty"; |
|
if ($value == "CONTRACT_COVERED_GPA") { |
|
$selected = $obj1; |
|
} else if ($value == "NO_CONTRACT_COVERED_GPA") { |
|
$selected = $obj2; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "CONTRACT_COVERED_GPA", |
|
"title" => $this->translate("CONTRACT_COVERED_GPA"), |
|
"required" => true, |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty(); eForms2.add2GUUE('#{$id}','{$obj1}')" |
|
] |
|
]; |
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "NO_CONTRACT_COVERED_GPA", |
|
"title" => $this->translate("NO_CONTRACT_COVERED_GPA"), |
|
"required" => true, |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty(); eForms2.add2GUUE('#{$id}','{$obj2}')" |
|
] |
|
]; |
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "__£__", |
|
"title" => __guue('Non previsto'), |
|
"required" => true, |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
]; |
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_GPA_COVERED"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function gpa_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"], ["RADIO_FOR_GPA_COVERED"]); |
|
$covered = "CONTRACT_COVERED_GPA"; |
|
$not_covered = "NO_CONTRACT_COVERED_GPA"; |
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("CONTRACT_COVERED_GPA"), |
|
"required" => $settings["required"] ?? true, |
|
"group_validate" => $settings["required"] ?? true, |
|
"type" => "radio", |
|
"value" => $covered |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO_CONTRACT_COVERED_GPA"), |
|
"required" => $settings["required"] ?? true, |
|
"group_validate" => $settings["required"] ?? true, |
|
"type" => "radio", |
|
"value" => $not_covered |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function receipt_tenders_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["DATE_RECEIPT_TENDERS"]); |
|
|
|
$inputs = [ |
|
"RECEIPT_TENDERS_SECTION" => [ |
|
[ |
|
"size" => "col-sm-6", |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["DATE_RECEIPT_TENDERS"])), |
|
"object" => "", |
|
"title" => $this->translate("DATE_RECEIPT_TENDERS"), |
|
"required" => true, |
|
"type" => "date", |
|
"value" => "" |
|
], |
|
[ |
|
"size" => "col-sm-6", |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["TIME_RECEIPT_TENDERS"])), |
|
"object" => "time", |
|
"title" => $this->translate("TIME_RECEIPT_TENDERS"), |
|
"required" => false, |
|
"type" => "datetime", |
|
"value" => "" |
|
] |
|
] |
|
]; |
|
|
|
#$inputs = array_merge(["info" => ["title" => $this->translate("info_admin", $this->arrayName2StringName($settings["name"]))]], $inputs); |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function date_award_scheduled_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
$this->getField($section, $child, $settings); |
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
$inputs = self::get($this->fields, $key); |
|
$date_award_scheduled = $inputs["DATE_AWARD_SCHEDULED"]; |
|
unset($inputs["DATE_AWARD_SCHEDULED"]); |
|
$inputs = array_merge($inputs, [ |
|
"LANGUAGES" => [ |
|
"size" => "col-sm-6", |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["LANGUAGES", "LANGUAGE", "@VALUE"])), |
|
"object" => "text", |
|
"title" => $this->translate("LANGUAGE: ITA"), |
|
"required" => true, |
|
"type" => "hidden", |
|
"value" => "IT" |
|
], |
|
"DATE_AWARD_SCHEDULED" => $date_award_scheduled |
|
]); |
|
self::set($this->fields, $key, $inputs); |
|
} |
|
|
|
private function languages_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
if ( |
|
isset($node->attributes()["minOccurs"]) && |
|
(int) $node->attributes()["minOccurs"] == 0 |
|
) { |
|
return; |
|
} |
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["LANGUAGES", "LANGUAGE", "_attributes", "VALUE"])), |
|
"size" => "col-sm-12", |
|
"object" => "text", |
|
"type" => "hidden", |
|
"value" => "IT", |
|
"required" => true |
|
] |
|
]; |
|
$this->ignored_keys[] = "VALUE"; |
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["LANGUAGES", "LANGUAGE", "_attributes", "VALUE"]), $inputs, $this->fields); |
|
return false; |
|
|
|
} |
|
|
|
private function n2021_NUTS_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"],["NUTS"]); |
|
$s["required"] = true; |
|
$this->nuts_fields($node, $s, $section); |
|
} |
|
|
|
private function phone_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["PHONE"]); |
|
|
|
$input = [ |
|
"name" => $this->arrayName2StringName($name), |
|
"size" => "col-sm-3", |
|
"type" => "text", |
|
"title" => $this->translate('PHONE'), |
|
"override" => [ |
|
"rel" => "N;0;0;PN;" |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($name, $input, $this->fields); |
|
} |
|
|
|
private function fax_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"],["FAX"]); |
|
|
|
$input = [ |
|
"name" => $this->arrayName2StringName($name), |
|
"size" => "col-sm-3", |
|
"type" => "text", |
|
"title" => $this->translate('FAX'), |
|
"override" => [ |
|
"rel" => "N;0;0;PN;" |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($name, $input, $this->fields); |
|
} |
|
|
|
private function limit_candidate_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_LIMIT_CANDIDATE"]); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$child = '<child><element ref="NB_LIMIT_CANDIDATE_TYPE"/><element ref="CRITERIA_CANDIDATE" minOccurs="0"/></child>'; |
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("LIMIT_CANDIDATE"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "LIMIT_CANDIDATE", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty(); eForms2.add2GUUE('#{$id}','{$object}')" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO_LIMIT_CANDIDATE"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NO_LIMIT_CANDIDATE", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $content == "LIMIT_CANDIDATE" ? $object : 'empty', |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
|
|
} |
|
|
|
private function nb_limit_candidate_type_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"][] = "RADIO_FOR_NB_LIMIT_CANDIDATE_TYPE"; |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$obj = null; |
|
|
|
$child = '<element ref="NB_ENVISAGED_CANDIDATE"/>'; |
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
if($content == "NB_ENVISAGED_CANDIDATE") { $obj = $object; } |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NB_ENVISAGED_CANDIDATE"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NB_ENVISAGED_CANDIDATE", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty(); eForms2.add2GUUE('#{$id}','{$object}')" |
|
] |
|
]; |
|
|
|
$child = '<sequence><element ref="NB_MIN_LIMIT_CANDIDATE"/><element ref="NB_MAX_LIMIT_CANDIDATE" minOccurs="0"/></sequence>'; |
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
if($content == "NB_MIN_AND_MAX_LIMIT_CANDIDATE") { $obj = $object; } |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NB_MIN_AND_MAX_LIMIT_CANDIDATE"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NB_MIN_AND_MAX_LIMIT_CANDIDATE", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty(); eForms2.add2GUUE('#{$id}','{$object}')" |
|
] |
|
]; |
|
|
|
$child = '<element ref="NB_MAX_LIMIT_CANDIDATE"/>'; |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
if($content == "NB_MAX_LIMIT_CANDIDATE") { $obj = $object; } |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NB_MAX_LIMIT_CANDIDATE"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NB_MAX_LIMIT_CANDIDATE", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty(); eForms2.add2GUUE('#{$id}','{$object}')" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $obj, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
|
|
} |
|
|
|
private function nb_lot_fields(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
return; |
|
} |
|
|
|
private function reduction_recourse_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
$this->getField($section, $child, $settings); |
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
$inputs = self::get($this->fields, $key); |
|
$reduction_recourse = $inputs["REDUCTION_RECOURSE"]; |
|
$reduction_recourse["title"] = $this->translate("REDUCTION_RECOURSE"); |
|
unset($inputs["REDUCTION_RECOURSE"]); |
|
$inputs = array_merge($inputs, [ |
|
"REDUCTION_RECOURSE_SECTION" => [ |
|
"REDUCTION_RECOURSE" => $reduction_recourse |
|
] |
|
]); |
|
self::set($this->fields, $key, $inputs); |
|
} |
|
|
|
private function right_contract_initial_tenders_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
$this->getField($section, $child, $settings); |
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
$inputs = self::get($this->fields, $key); |
|
$right_contract_initial_tenders = $inputs["RIGHT_CONTRACT_INITIAL_TENDERS"]; |
|
$right_contract_initial_tenders["title"] = $this->translate("RIGHT_CONTRACT_INITIAL_TENDERS"); |
|
unset($inputs["RIGHT_CONTRACT_INITIAL_TENDERS"]); |
|
$inputs = array_merge($inputs, [ |
|
"RIGHT_CONTRACT_INITIAL_TENDERS_SECTION" => [ |
|
"RIGHT_CONTRACT_INITIAL_TENDERS" => $right_contract_initial_tenders |
|
] |
|
]); |
|
self::set($this->fields, $key, $inputs); |
|
} |
|
|
|
private function notice_number_oj_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
#region [ShowToGaetano] |
|
#Nell'F20, nella sezione PROCEDURE è presente solo questo campo, ma la sezione è facoltativa |
|
#endregion |
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
$this->getField($section, $child, $settings); |
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
$inputs = self::get($this->fields, $key); |
|
$notice_number_oj = $inputs["NOTICE_NUMBER_OJ"]; |
|
$notice_number_oj["title"] = $this->translate("NOTICE_NUMBER_OJ"); |
|
unset($inputs["NOTICE_NUMBER_OJ"]); |
|
$inputs = array_merge($inputs, [ |
|
"NOTICE_NUMBER_OJ_SECTION" => [ |
|
"NOTICE_NUMBER_OJ" => $notice_number_oj |
|
] |
|
]); |
|
self::set($this->fields, $key, $inputs); |
|
} |
|
|
|
public function date_dispatch_invitations_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
$this->getField($section, $child, $settings); |
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
$inputs = self::get($this->fields, $key); |
|
|
|
$date_dispatch_invitations = $inputs["DATE_DISPATCH_INVITATIONS"][0]; |
|
$date_dispatch_invitations["title"] = $this->translate("DATE_DISPATCH_INVITATIONS"); |
|
unset($inputs["DATE_DISPATCH_INVITATIONS"]); |
|
|
|
$inputs = array_merge($inputs, [ |
|
"DATE_DISPATCH_INVITATIONS_SECTION" => [ |
|
"DATE_DISPATCH_INVITATIONS" => $date_dispatch_invitations |
|
] |
|
]); |
|
self::set($this->fields, $key, $inputs); |
|
} |
|
|
|
public function time_frame_tender_valid_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_TIME_FRAME_TENDER"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$id = $this->getId($name); |
|
|
|
$key = $this->getKeyFromNameString($name); |
|
$value = self::get($this->info["valori"], $key); |
|
|
|
$obj = "empty"; |
|
|
|
$child = '<element name="DATE_TENDER_VALID" type="date_full"/>'; |
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
if($value == "DATE_TENDER_VALID") { |
|
$obj = $object; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "DATE_TENDER_VALID", |
|
"title" => $this->translate("DATE_END"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
]; |
|
|
|
$child = '<element name="DURATION_TENDER_VALID" type="month_duration"/>'; |
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
if($value == "DURATION_TENDER_VALID") { |
|
$obj = $object; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "DURATION_TENDER_VALID", |
|
"title" => $this->translate("DURATION"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
]; |
|
|
|
if(isset($node->attributes()["minOccurs"]) && (int) $node->attributes()["minOccurs"] == 0) { |
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "__£__", |
|
"title" => $this->translate("NOT_SPECIFIED"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
]; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $obj, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_TIME_FRAME_TENDER"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function month_duration_fields(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"title" => $this->translate("DURATION_TENDER_VALID"), |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["_attributes", "TYPE"])), |
|
"type" => "hidden", |
|
"value" => "MONTH", |
|
"required" => true |
|
]; |
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"title" => $this->translate("DURATION_TENDER_VALID"), |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["_value"])), |
|
"type" => "text", |
|
"object" => "empty", |
|
"attrs" => [ |
|
"class" => "datetime" |
|
], |
|
"required" => true |
|
]; |
|
|
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function recurrent_procurement_section(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_RECURRENT_PROCUREMENT"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$id = $this->getId($name); |
|
|
|
$key = $this->getKeyFromNameString($name); |
|
$value = self::get($this->info["valori"], $key); |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => '<element ref="ESTIMATED_TIMING" minOccurs="0"/>', |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "RECURRENT_PROCUREMENT", |
|
"title" => $this->translate("RECURRENT_PROCUREMENT"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_RECURRENT_PROCUREMENT", |
|
"title" => $this->translate("NO_RECURRENT_PROCUREMENT"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $value == "RECURRENT_PROCUREMENT" ? $key : null, |
|
"object" => $value == "RECURRENT_PROCUREMENT" ? $object : "empty", |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_RECURRENT_PROCUREMENT"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
|
|
private function val_base(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$this->val_fields($node, $settings, $section); |
|
} |
|
|
|
private function val_range_base(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
array_pop($settings["name"]); |
|
$this->val_range_total_ref($node, $settings, $section); |
|
} |
|
|
|
private function val_range_total_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"],["VAL_RANGE_TOTAL"]); |
|
|
|
$cost_object = $this->makeAdd2GUUEObject(["child" => '<element type="cost"/>', "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
//NOTE: questo input viene preso pari pari dal val_fields, forse converrebbe riutilizzarlo in qualche maniera |
|
$inputs[] = [ |
|
"size" => "col-sm-4", |
|
"name" => $this->arrayName2StringName(array_merge($name, ["_attributes", "CURRENCY"])), |
|
"object" => "empty", |
|
"title" => $this->translate("CURRENCY"), |
|
"required" => true, |
|
"type" => "select", |
|
"options" => $this->getCurrencyOptions() |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName(array_merge($name, ["LOW"])), |
|
"size" => "col-sm-12 col-md-4", |
|
"type" => "text", |
|
"object" => $cost_object, |
|
"value" => "LOW", |
|
"title" => $this->translate("LOW"), |
|
"required" => true |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName(array_merge($name, ["HIGH"])), |
|
"size" => "col-sm-12 col-md-4", |
|
"type" => "text", |
|
"object" => $cost_object, |
|
"value" => "HIGH", |
|
"title" => $this->translate("HIGH"), |
|
"required" => true |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["VAL_RANGE_TOTAL"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function termination_dps_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
$this->getField($section, $child, $settings); |
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
$inputs = self::get($this->fields, $key); |
|
$termination_dps = $inputs["TERMINATION_DPS"]; |
|
$termination_dps["title"] = $this->translate("TERMINATION_DPS", $this->arrayName2StringName($settings["name"])); |
|
unset($inputs["TERMINATION_DPS"]); |
|
$inputs = array_merge($inputs, [ |
|
"TERMINATION_DPS_SECTION" => [ |
|
"TERMINATION_DPS" => $termination_dps |
|
] |
|
]); |
|
self::set($this->fields, $key, $inputs); |
|
} |
|
|
|
private function termination_pin_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
$this->getField($section, $child, $settings); |
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
$inputs = self::get($this->fields, $key); |
|
$termination_pin = $inputs["TERMINATION_PIN"]; |
|
$termination_pin["title"] = $this->translate("TERMINATION_PIN"); |
|
unset($inputs["TERMINATION_PIN"]); |
|
$inputs = array_merge($inputs, [ |
|
"TERMINATION_PIN_SECTION" => [ |
|
"TERMINATION_PIN" => $termination_pin |
|
] |
|
]); |
|
self::set($this->fields, $key, $inputs); |
|
} |
|
|
|
private function contract_number_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$this->sizes["CONTRACT_NO"] = 'col-md-12 col-lg-3'; |
|
$this->sizes["LOT_NO"] = 'col-md-12 col-lg-2'; |
|
$this->sizes["TITLE"] = 'col-md-12 col-lg-7'; |
|
|
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
$this->getField($section, $child, $settings); |
|
} |
|
|
|
private function text_ft_multi_lines_base(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$attr = []; |
|
if ( |
|
isset($node->attribute) && |
|
isset($node->attribute->attributes()["name"]) && |
|
$node->attribute->attributes()["name"] == "PUBLICATION" |
|
) { |
|
$attr = ["P"]; |
|
} |
|
$node_name = $settings["name"][count($settings["name"])-1]; |
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"],$attr)), |
|
"title" => $this->translate($node_name), |
|
"size" => "col-sm-12", |
|
"type" => "textarea", |
|
"required" => $settings["required"] |
|
] |
|
]; |
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function awarded_contract_section(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$settings["required"] = true; |
|
$name = array_merge($settings["name"], ["RADIO_FOR_AWARDED_CONTRACT_SECTION"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$id = $this->getId($name); |
|
|
|
$key = $this->getKeyFromNameString($name); |
|
$value = self::get($this->info["valori"], $key); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => '<element name="NO_AWARDED_CONTRACT" type="no_award"/>',"settings" => $settings,"section" => $section,"xsd" => $this->xsd,"hidden-header" => true,'multiple' => false]); |
|
|
|
$k = null; |
|
$obj = "empty"; |
|
if($value == "NO_AWARDED_CONTRACT") { |
|
$k = $key; |
|
$obj = $object; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_AWARDED_CONTRACT", |
|
"title" => $this->translate("NO_AWARDED_CONTRACT"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"group_validate" => true, |
|
"required" => true, |
|
]; |
|
|
|
$search = "//element[@name='AWARDED_CONTRACT']"; |
|
$child = $this->dom->xpath($search)[0]->asXML(); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $child,"settings" => $settings,"section" => $section,"xsd" => $this->xsd,"hidden-header" => true,'multiple' => false]); |
|
|
|
if($value == "AWARDED_CONTRACT") { |
|
$k = $key; |
|
$obj = $object; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "AWARDED_CONTRACT", |
|
"title" => $this->translate("AWARDED_CONTRACT"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"group_validate" => true, |
|
"required" => true |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $k, |
|
"object" => $obj, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_AWARDED_CONTRACT_SECTION"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function no_award_fields(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_NO_AWARD_SECTION"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$id = $this->getId($name); |
|
|
|
$key = $this->getKeyFromNameString($name); |
|
$value = self::get($this->info["valori"], $key); |
|
|
|
$child = '<element ref="PROCUREMENT_DISCONTINUED" />'; |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $child,"settings" => $settings,"section" => $section,"xsd" => $this->xsd,"hidden-header" => true,'multiple' => false]); |
|
|
|
$k = null; |
|
$obj = "empty"; |
|
if($value == "PROCUREMENT_DISCONTINUED") { |
|
$k = $key; |
|
$obj = $object; |
|
} |
|
|
|
$r = $settings["required"]; |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PROCUREMENT_DISCONTINUED", |
|
"title" => $this->translate("PROCUREMENT_DISCONTINUED"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"group_validate" => $r, |
|
"required" => $r |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PROCUREMENT_UNSUCCESSFUL", |
|
"title" => $this->translate("PROCUREMENT_UNSUCCESSFUL"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"group_validate" => $r, |
|
"required" => $r |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $k, |
|
"object" => $obj, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_NO_AWARD_SECTION"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function procurement_discontinued_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$name = array_merge($settings["name"], ["RADIO_FOR_ORIGINAL_OTHER_MEANS_SECTION"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$id = $this->getId($name); |
|
|
|
$key = $this->getKeyFromNameString($name); |
|
$value = self::get($this->info["valori"], $key); |
|
|
|
$child = '<element ref="NO_ORIGINAL_OTHER_MEANS" />'; |
|
$object = $this->makeAdd2GUUEObject(["child" => $child,"settings" => $settings,"section" => $section,"xsd" => $this->xsd,"hidden-header" => true,'multiple' => false]); |
|
|
|
$k = null; |
|
$obj = "empty"; |
|
if($value == "NO_ORIGINAL_OTHER_MEANS") { |
|
$k = $key; |
|
$obj = $object; |
|
} |
|
|
|
$r = $settings["required"]; |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_ORIGINAL_OTHER_MEANS", |
|
"title" => $this->translate("NO_ORIGINAL_OTHER_MEANS"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"group_validate" => $r, |
|
"required" => $r |
|
]; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"],["PROCUREMENT_DISCONTINUED"]); |
|
|
|
$child = '<element ref="ORIGINAL_OTHER_MEANS"/>'; |
|
$object = $this->makeAdd2GUUEObject(["child" => $child,"settings" => $s, "section" => $section,"xsd" => $this->xsd,"hidden-header" => true,'multiple' => false]); |
|
if($value == "ORIGINAL_OTHER_MEANS") { |
|
$k = $key; |
|
$obj = $object; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "ORIGINAL_OTHER_MEANS", |
|
"title" => $this->translate("ORIGINAL_OTHER_MEANS"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"group_validate" => $r, |
|
"required" => $r |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $k, |
|
"object" => $obj, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-8", |
|
"title" => $this->translate("DATE_DISPATCH_ORIGINAL"), |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["PROCUREMENT_DISCONTINUED","DATE_DISPATCH_ORIGINAL", "_value"])), |
|
"type" => "date", |
|
"object" => "date", |
|
"value" => "", |
|
"attrs" => [ |
|
"class" => "datetimepicker" |
|
], |
|
"group_validate" => $r, |
|
"required" => $r |
|
]; |
|
|
|
$inputs[] = [ |
|
"type" => "hidden", |
|
"value" => "NO", |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["PROCUREMENT_DISCONTINUED","DATE_DISPATCH_ORIGINAL", "_attributes", "PUBLICATION"])), |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_ORIGINAL_OTHER_MEANS_SECTION"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function no_original_other_means_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"][] = "PROCUREMENT_DISCONTINUED"; |
|
|
|
$this->auth(); |
|
$ente = $_SESSION["ente"]->getInfo(); |
|
|
|
$inputs = []; |
|
$inputs[] = [ |
|
"type" => "hidden", |
|
"value" => "NO", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["ORIGINAL_ENOTICES", "_attributes", "PUBLICATION"])), |
|
]; |
|
|
|
$inputs[] = [ |
|
"type" => "hidden", |
|
"value" => $this->username, |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["ESENDER_LOGIN", "_value"])), |
|
]; |
|
|
|
$inputs[] = [ |
|
"type" => "hidden", |
|
"value" => "NO", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["ESENDER_LOGIN", "_attributes", "PUBLICATION"])), |
|
]; |
|
|
|
$inputs[] = [ |
|
"type" => "hidden", |
|
"value" => $ente["id_guue"] ?? "__£__", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["CUSTOMER_LOGIN", "_value"])), |
|
]; |
|
|
|
$inputs[] = [ |
|
"type" => "hidden", |
|
"value" => "NO", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["CUSTOMER_LOGIN", "_attributes", "PUBLICATION"])), |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["NO_DOC_EXT", "_value"])), |
|
"size" => "col-sm-12", |
|
"type" => "text", |
|
"object" => "empty", |
|
"value" => "", |
|
"rel" => ["S", "1", "0", "A"], |
|
"title" => $this->translate("NO_DOC_EXT"), |
|
"required" => true, |
|
]; |
|
|
|
$inputs[] = [ |
|
"type" => "hidden", |
|
"value" => "NO", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["NO_DOC_EXT", "_attributes", "PUBLICATION"])), |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["PROCUREMENT_DISCONTINUED"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function original_other_means_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
if ( |
|
!empty($node->complexType) && |
|
!empty($node->complexType->simpleContent) && |
|
!empty($node->complexType->simpleContent->extension) && |
|
isset($node->complexType->simpleContent->extension->attribute) && |
|
!empty($node->complexType->simpleContent->extension->attribute->attributes()["name"]) |
|
) { |
|
$attributes = $node->complexType->simpleContent->extension->attribute->attributes(); |
|
if ($attributes["name"] == "PUBLICATION" && !empty($attributes["fixed"]) && $attributes["fixed"] == "NO") { |
|
|
|
$inputs[] = [ |
|
"title" => __guue("Dettagli"), |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["_value"])), |
|
"object" => "text_ft_multi_lines", |
|
"required" => true, |
|
"type" => "textarea", |
|
"rel" => ["S",1,200,"RT"] |
|
]; |
|
|
|
$inputs[] = [ |
|
"type" => "hidden", |
|
"value" => "NO", |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["_attributes", "PUBLICATION"])), |
|
]; |
|
|
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
} |
|
} else { |
|
return $this->getField($section, $node->complexType, $settings); |
|
} |
|
} |
|
|
|
|
|
private function original_other_means_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$settings["name"][] = "ORIGINAL_OTHER_MEANS"; |
|
|
|
$inputs[] = [ |
|
"title" => __guue("Dettagli"), |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["_value"])), |
|
"object" => "text_ft_multi_lines", |
|
"required" => true, |
|
"type" => "textarea", |
|
]; |
|
|
|
$inputs[] = [ |
|
"type" => "hidden", |
|
"value" => "NO", |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["_attributes", "PUBLICATION"])), |
|
]; |
|
|
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function contractor_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_AWARDED_TO_SECTION"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$id = $this->getId($name); |
|
|
|
$key = $this->getKeyFromNameString($name); |
|
$value = self::get($this->info["valori"], $key); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => '<element ref="multiple_contractor_sme_man"/>', "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$k = null; |
|
$obj = "empty"; |
|
if($value == "AWARDED_TO_GROUP") { |
|
$k = $key; |
|
$obj = $object; |
|
} |
|
|
|
$r = $settings["required"]; |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "AWARDED_TO_GROUP", |
|
"title" => $this->translate("AWARDED_TO_GROUP"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"group_validate" => $r, |
|
"required" => $r, |
|
]; |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => '<element ref="contractor_sme_man"/>',"settings" => $settings,"section" => $section,"xsd" => $this->xsd,"hidden-header" => true,'multiple' => false]); |
|
|
|
if($value == "NO_AWARDED_TO_GROUP") { |
|
$k = $key; |
|
$obj = $object; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_AWARDED_TO_GROUP", |
|
"title" => $this->translate("NO_AWARDED_TO_GROUP"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"group_validate" => $r, |
|
"required" => $r |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $k, |
|
"object" => $obj, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_AWARDED_TO_SECTION"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function multiple_contractor_sme_man_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
if (in_array($this->form_section,["F15_2014"])) { |
|
$this->publication_fields($node, $settings, $section); |
|
} |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"],["CONTRACTOR"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = $this->getId($name); |
|
$key = $this->getKeyFromNameString($name); |
|
$object = $this->makeAdd2GUUEObject(["child" => '<element ref="contractor_sme_man"/>',"settings" => $s,"section" => $section,"xsd" => $this->xsd,"hidden-header" => true,'multiple' => true]); |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $object, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["CONTRACTOR_SME_MAN_ADDITIONAL_BUTTON"])), |
|
"required" => false, |
|
"type" => "button", |
|
"title" => __guue('Aggiungi Aggiudicatario'), |
|
"object" => $object, |
|
"attrs" => [ |
|
"onClick" => "eForms2.add2GUUE('#{$id}','{$object}')", |
|
"class" => "btn btn-block btn-primary" |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
#region[ShowToGaetano] |
|
#Qui è stata rimossa gran parte della funzione |
|
#i nodi sono stati gestiti singolarmente durante la stesura di qualcuno dei form |
|
#tenerla invariata causava anche problemi di generazione del form |
|
#endregion |
|
private function contractor_sme_man_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
$this->getField($section, $child, $settings); |
|
|
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$fields = self::get($this->fields, $key); |
|
|
|
unset($fields["SME"], $fields["NO_SME"]); |
|
self::set($this->fields, $key, $fields); |
|
|
|
$name = array_merge($settings["name"], ["RADIO_FOR_SME_SECTION"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$key = $this->getKeyFromNameString($name); |
|
|
|
return false; |
|
} |
|
|
|
private function nb_contract_fields(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
return; |
|
} |
|
|
|
private function date_full_fields(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$name = $settings["name"]; |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$inputs[] = [ |
|
"title" => $this->translate("DATE"), |
|
"name" => $name, |
|
"type" => "date", |
|
"object" => "empty", |
|
"size" => "col-sm-12", |
|
"required" => $settings["required"] |
|
]; |
|
|
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
public function date_dispatch_notice_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$child = $this->getTypeElement($node->attributes()["ref"]->__toString()); |
|
$this->getField($section, $child, $settings); |
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
$inputs = self::get($this->fields, $key); |
|
if (is_array($inputs["DATE_DISPATCH_NOTICE"]) && count($inputs["DATE_DISPATCH_NOTICE"]) > 0 && strpos($inputs["DATE_DISPATCH_NOTICE"][0]["name"], "DATE_DISPATCH_NOTICE") !== false) { |
|
$inputs["DATE_DISPATCH_NOTICE"][0]["required"] = true; |
|
$inputs["DATE_DISPATCH_NOTICE"][0]["title"] = $this->translate("DATE_DISPATCH_NOTICE", $this->arrayName2StringName($settings["name"])); |
|
} else if($this->debug) { |
|
$backtrace = debug_backtrace(); |
|
$backtrace = array_shift($backtrace); |
|
echo ("<b style='color:#ff0000;'>ERROR - DATE_DISPATCH_NOTICE</b><br><span><b>ƒ({$backtrace['file']}@{$backtrace['line']})</b>:<br> input non presente all'interno dell'array</span>"); |
|
die(); |
|
} |
|
self::set($this->fields, $key, $inputs); |
|
} |
|
|
|
private function entity_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["CE_ACTIVITY", "_attributes", "VALUE"])), |
|
"size" => "col-sm-4", |
|
"type" => "select", |
|
"object" => "empty", |
|
"options" => [ |
|
"AIRPORT_RELATED_ACTIVITIES" => $this->translate("AIRPORT_RELATED_ACTIVITIES"), |
|
"ELECTRICITY" => $this->translate("ELECTRICITY"), |
|
"EXPLORATION_EXTRACTION_COAL_OTHER_SOLID_FUEL" => $this->translate("EXPLORATION_EXTRACTION_COAL_OTHER_SOLID_FUEL"), |
|
"EXPLORATION_EXTRACTION_GAS_OIL" => $this->translate("EXPLORATION_EXTRACTION_GAS_OIL"), |
|
"PORT_RELATED_ACTIVITIES" => $this->translate("PORT_RELATED_ACTIVITIES"), |
|
"POSTAL_SERVICES" => $this->translate("POSTAL_SERVICES"), |
|
"PRODUCTION_TRANSPORT_DISTRIBUTION_GAS_HEAT" => $this->translate("PRODUCTION_TRANSPORT_DISTRIBUTION_GAS_HEAT"), |
|
"RAILWAY_SERVICES" => $this->translate("RAILWAY_SERVICES"), |
|
"URBAN_RAILWAY_TRAMWAY_TROLLEYBUS_BUS_SERVICES" => $this->translate("URBAN_RAILWAY_TRAMWAY_TROLLEYBUS_BUS_SERVICES"), |
|
"WATER" => $this->translate("WATER"), |
|
], |
|
"title" => $this->translate("CE_ACTIVITY"), |
|
"required" => false |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["CE_ACTIVITY_OTHER"])), |
|
"size" => "col-sm-8", |
|
"type" => "text", |
|
"object" => "empty", |
|
"title" => $this->translate("CA_TYPE_OTHER"), |
|
"required" => true |
|
] |
|
]; |
|
$this->ignored_keys[] = ["ce_activity_selection"]; |
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["ce_activity_selection"]), $inputs, $this->fields); |
|
} |
|
|
|
private function nb_object_contract_fields(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
return; |
|
} |
|
|
|
private function lefti_f04_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$n = $node; |
|
unset($n->attributes()["name"]); |
|
|
|
$s = $settings; |
|
$s["required"] = false; |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_LEFTI"])))); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $node->asXML(), "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false, 'force-show' => true]); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$value = self::get($this->info["valori"], implode(".", array_merge($s["name"], ["RADIO_FOR_LEFTI"]))); |
|
$selected = "empty"; |
|
if ($value == "__£__") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = [ |
|
"info" => [ |
|
"title" => $this->translate("RADIO_FOR_LEFTI", $this->arrayName2StringName($settings["name"])) |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_LEFTI"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "__£__", |
|
"title" => $this->translate("YES"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}')", |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_LEFTI"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_LEFTI", |
|
"title" => $this->translate("NO"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function lefti_f21_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$this->lefti_f04_node($node, $settings, $section); |
|
} |
|
|
|
private function lefti_f23_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
return $this->lefti_f04_node($node, $settings, $section); |
|
} |
|
|
|
private function lefti_f22_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
return $this->lefti_f04_node($node, $settings, $section); |
|
} |
|
|
|
private function custom_procedure_f21_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_PROCEDURE_TYPE"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
unset($node->sequence->choice[0]); |
|
unset($node->attributes()["name"]); |
|
|
|
$id = $this->getId($name); |
|
|
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$s2 = $settings; |
|
$s2["name"][] = "PT_AWARD_CONTRACT_WITHOUT_CALL"; |
|
|
|
$value = self::get($this->info["valori"], implode(".",array_merge($settings["name"],["RADIO_FOR_PROCEDURE_TYPE"]))); |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => $this->getTypeElement("annex_d1_f21")->asXML(), |
|
"settings" => $s2, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$selected = "empty"; |
|
if ($value == "PT_AWARD_CONTRACT_WITHOUT_CALL") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_OPEN", |
|
"title" => $this->translate("PT_OPEN"), |
|
"required" => true, |
|
"group_validate" => true, |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_RESTRICTED", |
|
"title" => $this->translate("PT_RESTRICTED"), |
|
"required" => true, |
|
"group_validate" => true, |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_INVOLVING_NEGOTIATION", |
|
"title" => $this->translate("PT_INVOLVING_NEGOTIATION"), |
|
"required" => true, |
|
"group_validate" => true, |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_AWARD_CONTRACT_WITHOUT_CALL", |
|
"title" => $this->translate("PT_AWARD_CONTRACT_WITHOUT_CALL",$this->arrayName2StringName($settings["name"])), |
|
"required" => true, |
|
"group_validate" => true, |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
|
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
], |
|
]; |
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_PROCEDURE_TYPE"]), $inputs, $this->fields); |
|
$this->getField($section, $node, $settings); |
|
return false; |
|
} |
|
|
|
private function val_revenue_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$options["title"] = [ |
|
"info" => [ |
|
"title" => $this->translate("SPECIFY_VAL_REVENUE"), |
|
"style" => "subtitle", |
|
"hidden" => true |
|
] |
|
]; |
|
unset($node->attributes()["name"]); |
|
if ($this->minOccursRadio($node, $settings, $section, "VAL_REVENUE", "SPECIFY_VAL_REVENUE", $options)) { |
|
return; |
|
} |
|
$this->getField($section, $node, $settings); |
|
} |
|
|
|
private function val_price_payment_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$options["title"] = [ |
|
"info" => [ |
|
"title" => $this->translate("SPECIFY_VAL_PRICE_PAYMENT_NODE"), |
|
"style" => "subtitle", |
|
"hidden" => true |
|
] |
|
]; |
|
unset($node->attributes()["name"]); |
|
if ($this->minOccursRadio($node, $settings, $section, "VAL_PRICE_PAYMENT", "SPECIFY_VAL_PRICE_PAYMENT_NODE", $options)) { |
|
return; |
|
} |
|
$this->getField($section, $node, $settings); |
|
} |
|
|
|
private function procedure_f21_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$n = $node; |
|
unset($n->attributes()["name"]); |
|
|
|
$s = $settings; |
|
$s["required"] = false; |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_PROCEDURE"])))); |
|
|
|
$node->addAttribute("name","custom_procedure_f21"); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $node->asXML(), "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false, 'force-show' => true]); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$value = self::get($this->info["valori"], implode(".", array_merge($s["name"], ["RADIO_FOR_PROCEDURE"]))); |
|
$selected = "empty"; |
|
if ($value == "__£__") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = [ |
|
"info" => [ |
|
"title" => $this->translate("RADIO_FOR_PROCEDURE", $this->arrayName2StringName($s["name"])) |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_PROCEDURE"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "__£__", |
|
"title" => $this->translate("YES"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}')", |
|
], |
|
"group_validate" => true, |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_PROCEDURE"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_PROCEDURE", |
|
"title" => $this->translate("NO"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"group_validate" => true, |
|
"required" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function procedure_f01_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$this->applyTitle("PROCEDURE", $settings, $section); |
|
$n = $node; |
|
unset($n->attributes()["name"]); |
|
|
|
$s = $settings; |
|
$s["required"] = false; |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_PROCEDURE_TYPE"])))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
unset($n->sequence->choice[0]); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_PROCEDURE_TYPE"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_COMPETITIVE_NEGOTIATION", |
|
"title" => $this->translate("PT_COMPETITIVE_NEGOTIATION"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();", |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_PROCEDURE_TYPE"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_RESTRICTED", |
|
"title" => $this->translate("PT_RESTRICTED"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();", |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_PROCEDURE_TYPE"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "__£__", |
|
"title" => $this->translate("NOT_SPECIFIED"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();", |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($s["name"],["RADIO_FOR_PROCEDURE_TYPE"]), $inputs, $this->fields); |
|
$this->getField($section, $n, $settings); |
|
} |
|
|
|
private function custom_procedure_f22_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$n = $node; |
|
unset($n->attributes()["name"]); |
|
|
|
$s = $settings; |
|
$s["required"] = true; |
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_PROCEDURE_TYPE"])))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$s2 = $settings; |
|
$s2["name"] = array_merge($settings["name"], ["PT_AWARD_CONTRACT_WITHOUT_CALL"]); |
|
|
|
$child = $this->getTypeElement($node->sequence->choice->element[3]->attributes()["type"]->__toString())->asXML(); |
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $s2, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false, 'force-show' => true]); |
|
unset($n->sequence->choice[0]); |
|
|
|
$value = self::get($this->info["valori"], implode(".", array_merge($s["name"], ["RADIO_FOR_PROCEDURE_TYPE"]))); |
|
$selected = "empty"; |
|
if ($value == "PT_AWARD_CONTRACT_WITHOUT_CALL") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_PROCEDURE_TYPE"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_OPEN", |
|
"title" => $this->translate("PT_OPEN"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();", |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_PROCEDURE_TYPE"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_RESTRICTED", |
|
"title" => $this->translate("PT_RESTRICTED"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();", |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_PROCEDURE_TYPE"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_INVOLVING_NEGOTIATION", |
|
"title" => $this->translate("PT_INVOLVING_NEGOTIATION"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();", |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_PROCEDURE_TYPE"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_AWARD_CONTRACT_WITHOUT_CALL", |
|
"title" => $this->translate("PT_AWARD_CONTRACT_WITHOUT_CALL",$this->arrayName2StringName($s["name"])), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}')", |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_PROCEDURE_TYPE"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "__£__", |
|
"title" => $this->translate("NOT_SPECIFIED"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();", |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($s["name"],["RADIO_FOR_PROCEDURE_TYPE"]), $inputs, $this->fields); |
|
$this->getField($section, $n, $settings); |
|
} |
|
|
|
|
|
private function procedure_f22_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$n = $node; |
|
$n->attributes()["name"] = "CUSTOM_PROCEDURE_F22"; |
|
|
|
$s = $settings; |
|
$s["required"] = false; |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_PROCEDURE"])))); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $node->asXML(), "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false, 'force-show' => true]); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$value = self::get($this->info["valori"], implode(".", array_merge($s["name"], ["RADIO_FOR_PROCEDURE"]))); |
|
$selected = "empty"; |
|
if ($value == "__£__") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = [ |
|
"info" => [ |
|
"title" => $this->translate("Specifica informazioni sulla procedura") |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_PROCEDURE"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "__£__", |
|
"title" => $this->translate("YES"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}')", |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_PROCEDURE"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_LEFTI", |
|
"title" => $this->translate("NO"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function award_contract_f03_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
if (array_search("£", $settings["name"]) === false) { |
|
$s = $settings; |
|
array_pop($s["name"]); |
|
$s["name"][] = "NUMBER_OF_AWARD_CONTRACT"; |
|
$name = $this->arrayName2StringName($s["name"]); |
|
|
|
$content = self::get($this->info["valori"],"TED_ESENDERS.FORM_SECTION.{$this->form_section}.NUMBER_OF_AWARD_CONTRACT"); |
|
$inputs = []; |
|
|
|
$inputs[] = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-12", |
|
"type" => "number", |
|
"title" => $this->translate("AWARD_CONTRACT_QUANTITY"), |
|
"object" => "empty", |
|
"required" => true, |
|
"rel" => ["S", "1", "100", "N"], |
|
"val" => $content ?? "" |
|
] |
|
]; |
|
$inputs[] = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["AWARD_CONTRACT"])), |
|
"type" => "hidden", |
|
"value" => "__£__" |
|
] |
|
]; |
|
$this->fields = $this->makeArray(array_merge($settings["name"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
unset($node->attributes()["name"]); |
|
$this->getField($section, $node, $settings); |
|
} |
|
|
|
private function award_contract_f06_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$this->award_contract_f03_node($node, $settings, $section); |
|
} |
|
|
|
private function award_contract_f15_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$this->award_contract_f03_node($node, $settings, $section); |
|
} |
|
|
|
private function award_contract_f21_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
if (array_search("£", $settings["name"]) === false) { |
|
$s = $settings; |
|
$s["required"] = true; |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_AWARD_CONTRACT"])))); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => '<complexType name="award_contract_f03"/>', "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false, 'force-show' => true]); |
|
|
|
$value = self::get($this->info["valori"], implode(".", array_merge($s["name"], ["RADIO_FOR_AWARD_CONTRACT"]))); |
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$selected = "empty"; |
|
if ($value == "__£__") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_AWARD_CONTRACT"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "__£__", |
|
"title" => $this->translate("YES"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}')", |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["RADIO_FOR_AWARD_CONTRACT"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_AWARD_CONTRACT", |
|
"title" => $this->translate("NO"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($s["name"],["RADIO_FOR_AWARD_CONTRACT"]), $inputs, $this->fields); |
|
return; |
|
} |
|
unset($node->attributes()["name"]); |
|
$this->getField($section, $node, $settings); |
|
} |
|
|
|
private function award_contract_f22_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$this->award_contract_f21_node($node, $settings, $section); |
|
} |
|
|
|
private function award_contract_f23_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$this->award_contract_f21_node($node, $settings, $section); |
|
} |
|
|
|
private function award_contract_f25_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$this->award_contract_f21_node($node, $settings, $section); |
|
} |
|
|
|
|
|
private function object_contract_f21_node(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
if (array_search("£",$settings["name"]) === false) { |
|
$s = $settings; |
|
array_pop($s["name"]); |
|
$s["name"][] = "NUMBER_OF_OBJECT_CONTRACT"; |
|
$name = $this->arrayName2StringName($s["name"]); |
|
|
|
$inputs = []; |
|
$inputs[] = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-12", |
|
"type" => "number", |
|
"title" => __guue('Quantità Oggetti del Contratto'), |
|
"object" => "empty", |
|
"required" => true, |
|
"rel" => ["S","1","100","N"] |
|
] |
|
]; |
|
$inputs[] = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"],["OBJECT_CONTRACT"])), |
|
"type" => "hidden", |
|
"value" => "__£__" |
|
] |
|
]; |
|
$this->fields = $this->makeArray(array_merge($settings["name"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
unset($node->attributes()["name"]); |
|
$this->getField($section, $node, $settings); |
|
} |
|
|
|
private function object_contract_f04_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$this->object_contract_f21_node($node, $settings, $section); |
|
} |
|
|
|
private function object_contract_f22_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$this->object_contract_f21_node($node, $settings, $section); |
|
} |
|
|
|
private function procedure_f20_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$node->sequence->element->attributes()["minOccurs"] = 0; |
|
unset($node->attributes()["name"]); |
|
$this->getField($section, $node, $settings); |
|
} |
|
|
|
private function pt_negotiated_with_prior_call_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_PT_RESTRICTED"]); |
|
$name = $this->arrayName2StringName($name); |
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_RESTRICTED", |
|
"title" => $this->translate("PT_RESTRICTED"), |
|
"group_validate" => false, |
|
"required" => false, |
|
]; |
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_NEGOTIATED_WITH_PRIOR_CALL", |
|
"title" => $this->translate("PT_NEGOTIATED_WITH_PRIOR_CALL"), |
|
"group_validate" => false, |
|
"required" => false, |
|
]; |
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_PT_RESTRICTED"]), $inputs, $this->fields); |
|
} |
|
|
|
private function d_justification_ref(SimpleXMLIterator $node, Array $settings = [], String $section) { |
|
$name = array_merge($settings["name"],["D_JUSTIFICATION"]); |
|
$name = $this->arrayName2StringName($name); |
|
$required = true; |
|
if(isset($this->attributes()["minOccurs"]) && (int) $this->attributes()["minOccurs"] == 0) { |
|
$required = false; |
|
} |
|
$inputs[] = [ |
|
"name" => $name, |
|
"title" => $this->translate("D_JUSTIFICATION"), |
|
"size" => "col-sm-12", |
|
"type" => "textarea", |
|
"required" => $required |
|
]; |
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["D_JUSTIFICATION"]), $inputs, $this->fields); |
|
} |
|
|
|
private function town_ref(SimpleXMLIterator $node, Array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"],["TOWN"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"type" => "text", |
|
"size" => "col-sm-3", |
|
"object" => "empty", |
|
"title" => $this->translate("TOWN"), |
|
"rel" => [$settings["required"] ? "S" : "N","2","100","ALPHA"], |
|
"required" => $settings["required"] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"],["TOWN"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function deposit_guarantee_required_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_DEPOSIT_GUARANTEE_REQUIRED"]); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName($settings["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$child = '<element name="DEPOSIT_GUARANTEE_REQUIRED" type="text_ft_multi_lines"/>'; |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$inputs[] = [ |
|
"info" => [ |
|
"title" => $this->translate("RADIO_FOR_DEPOSIT_GUARANTEE_REQUIRED",$this->arrayName2StringName($settings["name"])), |
|
"style" => "subtitle" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("RADIO_FOR_DEPOSIT_GUARANTEE_REQUIRED"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "RADIO_FOR_DEPOSIT_GUARANTEE_REQUIRED", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}');" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO_RADIO_FOR_DEPOSIT_GUARANTEE_REQUIRED"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NO_RADIO_FOR_DEPOSIT_GUARANTEE_REQUIRED", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $content == "RADIO_FOR_DEPOSIT_GUARANTEE_REQUIRED" ? $object : "empty", |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function main_financing_condition_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_MAIN_FINANCING_CONDITION"]); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName($settings["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$child = '<element name="MAIN_FINANCING_CONDITION" type="text_ft_multi_lines"/>'; |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$inputs = []; |
|
|
|
$inputs[] = [ |
|
"info" => [ |
|
"title" => $this->translate("MAIN_FINANCING_CONDITION", $this->arrayName2StringName($settings["name"])), |
|
"style" => "subtitle" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("RADIO_FOR_MAIN_FINANCING_CONDITION"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "RADIO_FOR_MAIN_FINANCING_CONDITION", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}');" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO_RADIO_FOR_MAIN_FINANCING_CONDITION"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NO_RADIO_FOR_MAIN_FINANCING_CONDITION", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $content == "RADIO_FOR_MAIN_FINANCING_CONDITION" ? $object : "empty", |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function legal_form_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_LEGAL_FORM"]); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName($settings["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$child = '<element type="text_ft_multi_lines" name="LEGAL_FORM"/>'; |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$inputs = []; |
|
|
|
$inputs[] = [ |
|
"info" => [ |
|
"title" => $this->translate("RADIO_FOR_LEGAL_FORM", $this->arrayName2StringName($settings["name"])), |
|
"style" => "subtitle" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("YES"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "RADIO_FOR_LEGAL_FORM", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}');" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "__£__", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $content == "__£__" ? "empty" : $object, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$s["name"] = array_merge($s["name"], ["LEGAL_FORM"]); |
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function particular_profession_section(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$this->applyTitle("RADIO_FOR_PARTICULAR_PROFESSION_SECTION",$settings,$section); |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_PARTICULAR_PROFESSION_SECTION"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName($settings["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$settings["skip-particular-profession"] = true; |
|
|
|
if ($this->form_section == "F12_2014") { |
|
unset($node->element[1]); |
|
} |
|
|
|
$child = $node->asXML(); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$inputs = []; |
|
|
|
$selected = "empty"; |
|
$value = self::get($this->info["valori"], $key); |
|
if ($value == "RADIO_FOR_PARTICULAR_PROFESSION_SECTION") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("CHOICE_RADIO_FOR_PARTICULAR_PROFESSION_SECTION", $this->arrayName2StringName($s["name"])), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "RADIO_FOR_PARTICULAR_PROFESSION_SECTION", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}');" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO_RADIO_FOR_PARTICULAR_PROFESSION_SECTION"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => (in_array($this->form_section,["F12_2014"])) ? "NO_PARTICULAR_PROFESSION" : "__£__", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$s["name"] = array_merge($s["name"], ["PARTICULAR_PROFESSION"]); |
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function annex_d3_part2_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"],["RADIO_FOR_D_SERVICES_LISTED"]); |
|
$name = array_merge($s["name"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
unset($node->choice); |
|
unset($node->attributes()["name"]); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "D_SERVICES_LISTED", |
|
"title" => $this->translate("D_SERVICES_LISTED"), |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "D_OUTSIDE_SCOPE", |
|
"title" => $this->translate("D_OUTSIDE_SCOPE"), |
|
"required" => true |
|
] |
|
]; |
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
$this->getField($section, $node, $settings); |
|
return false; |
|
|
|
} |
|
|
|
private function annex_d1_fields(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"],["RADIO_FOR_ANNEX_D1_PART1"]); |
|
|
|
$id = $this->getId($this->arrayName2StringName($s["name"])); |
|
|
|
$key = $this->getKeyFromNameString($this->arrayName2StringName($s["name"])); |
|
$value = self::get($this->info["valori"], $key); |
|
|
|
$s2 = $settings; |
|
if ($s2["name"][count($s2["name"])-1] != "PT_AWARD_CONTRACT_WITHOUT_CALL") { |
|
$s2["name"] = array_merge($s2["name"],["PT_AWARD_CONTRACT_WITHOUT_CALL","D_ACCORDANCE_ARTICLE"]); |
|
} else { |
|
$s2["name"] = array_merge($s2["name"],["D_ACCORDANCE_ARTICLE"]); |
|
} |
|
|
|
$annex_d1_object = $this->makeAdd2GUUEObject([ |
|
"child" => '<group ref="annex_d1_part1"/>', |
|
"settings" => $s2, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$annex_part2_object = $this->makeAdd2GUUEObject([ |
|
"child" => '<group ref="annex_part2"/>', |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$selected = "empty"; |
|
if ($value == "ANNEX_D1_PART_1") { |
|
$selected = $annex_d1_object; |
|
} else if ($value == "ANNEX_PART2") { |
|
$selected = $annex_part2_object; |
|
} |
|
|
|
$settings_merge = ["D_JUSTIFICATION"]; |
|
if ($settings["name"][count($settings["name"]) - 1] != "PT_AWARD_CONTRACT_WITHOUT_CALL") { |
|
$settings_merge = ["PT_AWARD_CONTRACT_WITHOUT_CALL","D_JUSTIFICATION"]; |
|
} |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "ANNEX_D1_PART_1", |
|
"title" => $this->translate("ANNEX_D1_PART_1"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$annex_d1_object}');" |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "ANNEX_PART2", |
|
"title" => $this->translate("ANNEX_PART2"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$annex_part2_object}');" |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], $settings_merge)), |
|
"size" => "col-sm-12", |
|
"type" => "textarea", |
|
"object" => "empty", |
|
"value" => "D_JUSTIFICATION", |
|
"title" => $this->translate("D_JUSTIFICATION"), |
|
"required" => true, |
|
"group_validate" => true |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_ANNEX_D1_PART1"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function procedure_f02_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_PROCEDURE_TYPE"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$id = $this->getId($name); |
|
|
|
$key = $this->getKeyFromNameString($name); |
|
$value = self::get($this->info["valori"], $key); |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => '<element ref="ACCELERATED_PROC" minOccurs="0"/>', |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_OPEN", |
|
"title" => $this->translate("PT_OPEN"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_RESTRICTED", |
|
"title" => $this->translate("PT_RESTRICTED"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_COMPETITIVE_NEGOTIATION", |
|
"title" => $this->translate("PT_COMPETITIVE_NEGOTIATION"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_COMPETITIVE_DIALOGUE", |
|
"title" => $this->translate("PT_COMPETITIVE_DIALOGUE"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_INNOVATION_PARTNERSHIP", |
|
"title" => $this->translate("PT_INNOVATION_PARTNERSHIP"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => in_array($value, ["PT_OPEN", "PT_RESTRICTED", "PT_COMPETITIVE_NEGOTIATION", "PT_COMPETITIVE_DIALOGUE"]) ? $key : null, |
|
"object" => in_array($value, ["PT_OPEN", "PT_RESTRICTED", "PT_COMPETITIVE_NEGOTIATION", "PT_COMPETITIVE_DIALOGUE"]) ? $object : "empty", |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_PROCEDURE_TYPE"]), $inputs, $this->fields); |
|
|
|
unset($node->sequence->choice); |
|
foreach ($node->sequence as $n) { |
|
$this->getField($section, $n, $settings); |
|
} |
|
|
|
return false; |
|
} |
|
|
|
private function procedure_f03_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"],["RADIO_FOR_PROCEDURE_TYPE"]); |
|
|
|
$id = $this->getId($this->arrayName2StringName($s["name"])); |
|
|
|
$key = $this->getKeyFromNameString($this->arrayName2StringName($s["name"])); |
|
$value = self::get($this->info["valori"], $key); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
|
|
$s = $settings; |
|
|
|
$s2 = $settings; |
|
$pt_award_without_call_object = $this->makeAdd2GUUEObject([ |
|
"child" => '<element name="PT_AWARD_CONTRACT_WITHOUT_CALL" type="annex_d1"/>', |
|
"settings" => $s2, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => '<element ref="ACCELERATED_PROC" minOccurs="0"/>', |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$selected = "empty"; |
|
if (in_array($value, ["PT_OPEN", "PT_RESTRICTED", "PT_COMPETITIVE_NEGOTIATION", "PT_COMPETITIVE_DIALOGUE"])) { |
|
$selected = $object; |
|
} else if ($value == "PT_AWARD_CONTRACT_WITHOUT_CALL") { |
|
$selected = $pt_award_without_call_object; |
|
} |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_OPEN", |
|
"title" => $this->translate("PT_OPEN"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_RESTRICTED", |
|
"title" => $this->translate("PT_RESTRICTED"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_COMPETITIVE_NEGOTIATION", |
|
"title" => $this->translate("PT_COMPETITIVE_NEGOTIATION"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_COMPETITIVE_DIALOGUE", |
|
"title" => $this->translate("PT_COMPETITIVE_DIALOGUE"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_INNOVATION_PARTNERSHIP", |
|
"title" => $this->translate("PT_INNOVATION_PARTNERSHIP"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_AWARD_CONTRACT_WITHOUT_CALL", |
|
"title" => $this->translate("PT_AWARD_CONTRACT_WITHOUT_CALL",$this->arrayName2StringName($s["name"])), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$pt_award_without_call_object}');" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_PROCEDURE_TYPE"]), $inputs, $this->fields); |
|
|
|
unset($node->sequence->choice); |
|
foreach ($node->sequence as $n) { |
|
$this->getField($section, $n, $settings); |
|
} |
|
|
|
return false; |
|
} |
|
|
|
private function procedure_f04_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_PROCEDURE_TYPE"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_RESTRICTED", |
|
"title" => $this->translate("PT_RESTRICTED"), |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_NEGOTIATED_WITH_PRIOR_CALL", |
|
"title" => $this->translate("PT_NEGOTIATED_WITH_PRIOR_CALL"), |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_NONE", |
|
"title" => $this->translate("NOT_SPECIFIED"), |
|
"required" => true |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_PROCEDURE_TYPE"]), $inputs, $this->fields); |
|
|
|
unset($node->sequence->choice); |
|
foreach ($node->sequence as $n) { |
|
$this->getField($section, $n, $settings); |
|
} |
|
|
|
return false; |
|
} |
|
|
|
private function procedure_f05_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_PROCEDURE_TYPE"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_OPEN", |
|
"title" => $this->translate("PT_OPEN"), |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_RESTRICTED", |
|
"title" => $this->translate("PT_RESTRICTED"), |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_NEGOTIATED_WITH_PRIOR_CALL", |
|
"title" => $this->translate("PT_NEGOTIATED_WITH_PRIOR_CALL"), |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_COMPETITIVE_DIALOGUE", |
|
"title" => $this->translate("PT_COMPETITIVE_DIALOGUE"), |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_INNOVATION_PARTNERSHIP", |
|
"title" => $this->translate("PT_INNOVATION_PARTNERSHIP"), |
|
"required" => true |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_PROCEDURE_TYPE"]), $inputs, $this->fields); |
|
|
|
unset($node->sequence->choice); |
|
foreach ($node->sequence as $n) { |
|
$this->getField($section, $n, $settings); |
|
} |
|
|
|
return false; |
|
} |
|
|
|
private function procedure_f06_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"], ["RADIO_FOR_PROCEDURE_TYPE"]); |
|
|
|
$id = $this->getId($this->arrayName2StringName($s["name"])); |
|
|
|
$key = $this->getKeyFromNameString($this->arrayName2StringName($s["name"])); |
|
$value = self::get($this->info["valori"], $key); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => '<element name="PT_AWARD_CONTRACT_WITHOUT_CALL" type="annex_d2"/>', |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$selected = "empty"; |
|
if ($value == "YES_PT_AWARD_CONTRACT_WITHOUT_CALL") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_OPEN", |
|
"title" => $this->translate("PT_OPEN"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_RESTRICTED", |
|
"title" => $this->translate("PT_RESTRICTED"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_NEGOTIATED_WITH_PRIOR_CALL", |
|
"title" => $this->translate("PT_NEGOTIATED_WITH_PRIOR_CALL"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_COMPETITIVE_DIALOGUE", |
|
"title" => $this->translate("PT_COMPETITIVE_DIALOGUE"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_INNOVATION_PARTNERSHIP", |
|
"title" => $this->translate("PT_INNOVATION_PARTNERSHIP"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "YES_PT_AWARD_CONTRACT_WITHOUT_CALL", |
|
"title" => $this->translate("PT_AWARD_CONTRACT_WITHOUT_CALL", $this->arrayName2StringName($s["name"])), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_PROCEDURE_TYPE"]), $inputs, $this->fields); |
|
|
|
unset($node->sequence->choice); |
|
foreach ($node->sequence as $n) { |
|
$this->getField($section, $n, $settings); |
|
} |
|
|
|
return false; |
|
} |
|
|
|
private function procedure_f07_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$this->getField($section, $node->annotation, $settings); |
|
$this->getField($section, $node->sequence, $settings); |
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"],["LANGUAGES","LANGUAGE","_attributes","VALUE"])), |
|
"size" => "col-sm-12", |
|
"type" => "text", |
|
"val" => "IT", |
|
"attrs" => ["hidden" => true] |
|
] |
|
]; |
|
$this->ignored_keys[] = "VALUE"; |
|
$this->fields = $this->makeArray(array_merge($settings["name"],["LANGUAGES","LANGUAGE","_attributes","VALUE"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function procedure_f12_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_PROCEDURE_TYPE"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$child = $node->sequence->choice[0]->sequence->asXML(); |
|
unset($node->sequence->choice[0]); |
|
unset($node->attributes()["name"]); |
|
|
|
$id = $this->getId($name); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => $child, |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$selected = "empty"; |
|
$content = self::get($this->info["valori"], $key); |
|
if ($content == "PT_RESTRICTED") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_OPEN", |
|
"title" => $this->translate("PT_OPEN"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_RESTRICTED", |
|
"title" => $this->translate("PT_RESTRICTED"), |
|
"required" => true, |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_PROCEDURE_TYPE"]), $inputs, $this->fields); |
|
$this->getField($section, $node, $settings); |
|
return false; |
|
} |
|
|
|
private function procedure_f13_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_PROCEDURE_TYPE"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
unset($node->sequence->choice[0]); |
|
unset($node->attributes()["name"]); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_OPEN", |
|
"title" => $this->translate("PT_OPEN"), |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "PT_RESTRICTED", |
|
"title" => $this->translate("PT_RESTRICTED"), |
|
"required" => true |
|
] |
|
]; |
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_PROCEDURE_TYPE"]), $inputs, $this->fields); |
|
$this->getField($section, $node, $settings); |
|
return false; |
|
} |
|
|
|
private function award_contract_multiple_section(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($s["name"], [TedEsender::MUL])))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $node->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => true]); |
|
|
|
$input = [ |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => !empty($content) ? $object : "empty", |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
], |
|
[ |
|
"name" => "button", |
|
"required" => false, |
|
"type" => "button", |
|
"title" => __guue('Aggiungi un aggiudicazione d\'Appalto'), |
|
"attrs" => [ |
|
"onClick" => "eForms2.add2GUUE('#{$id}', '{$object}')", |
|
"class" => "btn btn-block btn-primary" |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $input, $this->fields); |
|
return false; |
|
} |
|
|
|
private function d_proc_open_sel_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
array_pop($settings["name"]); |
|
$name = array_merge($settings["name"], ["D_PROC_OPEN"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$inputs = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "text", |
|
"val" => "__£__", |
|
"title" => $this->translate("D_PROC_OPEN"), |
|
]; |
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function d_proc_restricted_sel_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
array_pop($settings["name"]); |
|
$name = array_merge($settings["name"], ["D_PROC_RESTRICTED"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$inputs = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "text", |
|
"val" => "__£__", |
|
"title" => $this->translate("D_PROC_RESTRICTED"), |
|
]; |
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function d_proc_open_section(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_D_PROC_OPEN"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_AWARD_CRITERIA_DOC"])))); |
|
$obj1 = $this->makeAdd2GUUEObject( |
|
["child" => "<element type='empty' name='D_PROC_OPEN_SEL'></element>", "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false, 'force-show' => true |
|
]); |
|
$obj2 = $this->makeAdd2GUUEObject( |
|
["child" => "<element type='empty' name='D_PROC_RESTRICTED_SEL'></element>", "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false, 'force-show' => true |
|
]); |
|
|
|
$key = $this->arrayName2StringName(array_merge($settings["name"],["RADIO_FOR_D_PROC_OPEN"])); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$selected = "empty"; |
|
$value = self::get($this->info["valori"],$key); |
|
|
|
if ($value == "CHOICE_D_PROC_RESTRICTED") { |
|
$selected = $obj2; |
|
} else if ($value == "CHOICE_D_PROC_OPEN") { |
|
$selected = $obj1; |
|
} |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "CHOICE_D_PROC_OPEN", |
|
"title" => $this->translate("D_PROC_OPEN"), |
|
"required" => true, |
|
"group_validate" => true, |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj1}')", |
|
] |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "CHOICE_D_PROC_RESTRICTED", |
|
"title" => $this->translate("D_PROC_RESTRICTED"), |
|
"required" => true, |
|
"group_validate" => true, |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj2}')", |
|
] |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "CHOICE_NO_RADIO_FOR_D_PROC_OPEN", |
|
"title" => $this->translate("NO_RADIO_FOR_D_PROC_OPEN"), |
|
"required" => true, |
|
"group_validate" => true, |
|
"group_validate" => true, |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();", |
|
] |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "d-none", |
|
"id" => $id, |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_D_PROC_OPEN"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function d_technical_section(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_D_TECHNICAL"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
foreach ($node->element as $element) { |
|
$inputs[] = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"title" => $this->translate((string) $element->attributes()["ref"]), |
|
"value" => (string) $element->attributes()["ref"], |
|
"required" => true |
|
] |
|
]; |
|
} |
|
|
|
|
|
if (isset($node->attributes()["minOccurs"]) && $node->attributes()["minOccurs"] == 0) { |
|
$inputs[] = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"title" => $this->translate("NO_RADIO_FOR_D_TECHNICAL"), |
|
"value" => "NO_RADIO_FOR_D_TECHNICAL", |
|
"required" => true |
|
], |
|
]; |
|
} |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_D_TECHNICAL"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function d_artistic_section(SimpleXMLIterator $node, array $settings = [], String $section) { |
|
$name = array_merge($settings["name"], ["RADIO_FOR_D_TECHNICAL"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"title" => $this->translate("D_ARTISTIC"), |
|
"value" => "D_ARTISTIC", |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"title" => $this->translate("D_TECHNICAL"), |
|
"value" => "D_TECHNICAL", |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"title" => $this->translate("D_EXCLUSIVE_RIGHT"), |
|
"value" => "D_EXCLUSIVE_RIGHT", |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"title" => $this->translate("D_PROTECT_RIGHTS"), |
|
"value" => "D_PROTECT_RIGHTS", |
|
"required" => true |
|
] |
|
/* |
|
Dalle risposte del SIMAP il campo non risulta facoltativo |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"title" => __guue("Nessuno dei precedenti"), |
|
"value" => "__£__", |
|
"required" => true |
|
] |
|
*/ |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_D_TECHNICAL"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function d_from_winding_provider_section(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"],["RADIO_FOR_D_FROM_WINDING_PROVIDER"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$id = $this->getId($name); |
|
|
|
$key = $this->getKeyFromNameString($name); |
|
$value = self::get($this->info["valori"], $key); |
|
|
|
$obj1 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->element[0]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
"multiple" => false, |
|
]); |
|
$obj2 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->element[1]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
"multiple" => false |
|
]); |
|
|
|
$selected = "empty"; |
|
|
|
if ($value == "D_FROM_WINDING_PROVIDER") { |
|
$selected = $obj1; |
|
} else if ($value == "D_FROM_LIQUIDATOR_CREDITOR") { |
|
$selected = $obj2; |
|
} |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "D_FROM_WINDING_PROVIDER", |
|
"title" => $this->translate("D_FROM_WINDING_PROVIDER"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj1}');" |
|
], |
|
"group_validate" => true, |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "D_FROM_LIQUIDATOR_CREDITOR", |
|
"title" => $this->translate("D_FROM_LIQUIDATOR_CREDITOR"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj2}');" |
|
], |
|
"group_validate" => true, |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_RADIO_FOR_D_FROM_WINDING_PROVIDER", |
|
"title" => $this->translate("NO_RADIO_FOR_D_FROM_WINDING_PROVIDER"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"group_validate" => true, |
|
"required" => true, |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_D_FROM_WINDING_PROVIDER"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function agree_to_publication_man_fields(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"],["_attributes","PUBLICATION"])), |
|
"size" => "col-sm-12", |
|
"type" => "select", |
|
"object" => "empty", |
|
"options" => [ |
|
"YES" => $this->translate("YES"), |
|
"NO" => $this->translate("NO"), |
|
], |
|
"title" => $this->translate("AGREE_TO_PUBLICATION_MAN"), |
|
"required" => true |
|
], |
|
]; |
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function agree_to_publication_man_base(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$this->agree_to_publication_man_fields($node, $settings, $section); |
|
$n = null; |
|
if (isset($node->group)) { |
|
$n = $node->group; |
|
} else if (isset($node->choice)) { |
|
$n = $node->choice; |
|
} |
|
if ($n !== null) { |
|
$this->getField($section, $n, $settings); |
|
} else if ($this->debug) { |
|
dd("Content node not managed inside ƒ agree_to_publication_man_base"); |
|
} |
|
return false; |
|
} |
|
|
|
private function likely_subcontracted_section(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"],["RADIO_FOR_LIKELY_SUBCONTRACTED"]); |
|
$name = $this->arrayName2StringName($s["name"]); |
|
|
|
$id = $this->getId($name); |
|
|
|
unset($node->attributes()->minOccurs); |
|
unset($node->element); |
|
$child = $node->asXML(); |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => $child, |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$value = self::get($this->info["valori"],implode(".",$s["name"])); |
|
|
|
$inputs[] = [ |
|
"info" => [ |
|
"title" => $this->translate("V_2_5_SUBCONTR_INFO",$name), |
|
"style" => "subtitle" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "LIKELY_SUBCONTRACTED", |
|
"title" => $this->translate("LIKELY_SUBCONTRACTED"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$object}');", |
|
], |
|
"required" => true, |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "NO_RADIO_FOR_LIKELY_SUBCONTRACTED", |
|
"title" => $this->translate("NO_RADIO_FOR_LIKELY_SUBCONTRACTED"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty()", |
|
], |
|
"required" => true, |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => ($value == "LIKELY_SUBCONTRACTED") ? $object : "empty", |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
], |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_LIKELY_SUBCONTRACTED"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function nb_contract_awarded_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
|
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["_value"])), |
|
"size" => "col-12", |
|
"type" => "text", |
|
"value" => "NB_CONTRACT_AWARDED", |
|
"title" => $this->translate("NB_CONTRACT_AWARDED"), |
|
"required" => true |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["_attributes", "PUBLICATION"])), |
|
"type" => "hidden", |
|
"value" => "NO", |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function non_published_node(SimpleXMLIterator $node, array $settings = [], String $section, array $inputs = []) |
|
{ |
|
$s = $settings; |
|
$inputs[] = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["_attributes", "PUBLICATION"])), |
|
"type" => "hidden", |
|
"value" => "NO" |
|
] |
|
]; |
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function awarded_tenderer_variant_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$settings["name"][] = "AWARDED_TENDERER_VARIANT"; |
|
$this->non_published_node($node, $settings, $section); |
|
} |
|
|
|
private function no_awarded_tenderer_variant_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$settings["name"][] = "NO_AWARDED_TENDERER_VARIANT"; |
|
$this->non_published_node($node, $settings, $section); |
|
} |
|
|
|
private function radio_for_awarded_tenderer_variant(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"], ["RADIO_FOR_AWARDED_TENDERER_VARIANT"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = $this->getId($name); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$obj1 = $this->makeAdd2GUUEObject([ |
|
"child" => '<element ref="AWARDED_TENDERER_VARIANT"></element>', |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$obj2 = $this->makeAdd2GUUEObject([ |
|
"child" => '<element ref="NO_AWARDED_TENDERER_VARIANT"></element>', |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$value = self::get($this->info["valori"],$key); |
|
$selected = "empty"; |
|
if ($value == "AWARDED_TENDERER_VARIANT_CHOICE") { |
|
$selected = $obj1; |
|
} else if ($value == "NO_AWARDED_TENDERER_VARIANT_CHOICE") { |
|
$selected = $obj2; |
|
} |
|
|
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"title" => $this->translate("YES"), |
|
"value" => "AWARDED_TENDERER_VARIANT_CHOICE", |
|
"group_validate" => true, |
|
"required" => true, |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj1}');", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"title" => $this->translate("NO"), |
|
"value" => "NO_AWARDED_TENDERER_VARIANT_CHOICE", |
|
"group_validate" => true, |
|
"required" => true, |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj2}');", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"hidden" => true, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_AWARDED_TENDERER_VARIANT"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function tenders_excluded_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$settings["name"][] = "TENDERS_EXCLUDED"; |
|
$this->non_published_node($node, $settings, $section); |
|
} |
|
|
|
private function no_tenders_excluded_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$settings["name"][] = "NO_TENDERS_EXCLUDED"; |
|
$this->non_published_node($node, $settings, $section); |
|
} |
|
|
|
private function radio_for_tenders_excluded(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"], ["RADIO_FOR_TENDERS_EXCLUDED"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = $this->getId($name); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$obj1 = $this->makeAdd2GUUEObject([ |
|
"child" => '<element ref="TENDERS_EXCLUDED"></element>', |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$obj2 = $this->makeAdd2GUUEObject([ |
|
"child" => '<element ref="NO_TENDERS_EXCLUDED"></element>', |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$value = self::get($this->info["valori"], $key); |
|
$selected = "empty"; |
|
if ($value == "TENDERS_EXCLUDED_CHOICE") { |
|
$selected = $obj1; |
|
} else if ($value == "NO_TENDERS_EXCLUDED_CHOICE") { |
|
$selected = $obj2; |
|
} |
|
|
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"title" => $this->translate("YES"), |
|
"value" => "TENDERS_EXCLUDED_CHOICE", |
|
"group_validate" => true, |
|
"required" => true, |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj1}');", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"title" => $this->translate("NO"), |
|
"value" => "NO_TENDERS_EXCLUDED_CHOICE", |
|
"group_validate" => true, |
|
"required" => true, |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj2}');", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"hidden" => true, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_TENDERS_EXCLUDED"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function radio_for_val_total(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_VAL_TOTAL"]); |
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = $this->getId($name); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
|
|
|
|
$obj1 = $this->makeAdd2GUUEObject(["child" => $node->element[0]->asXML(),"settings" => $settings,"section" => $section,"xsd" => $this->xsd,"hidden-header" => true,'multiple' => false]); |
|
$obj2 = $this->makeAdd2GUUEObject(["child" => $node->element[1]->asXML(),"settings" => $settings,"section" => $section,"xsd" => $this->xsd,"hidden-header" => true,'multiple' => false]); |
|
|
|
$selected = "empty"; |
|
if ($value == "VAL_TOTAL") { |
|
$selected = $obj1; |
|
} else if ($value == "VAL_RANGE_TOTAL") { |
|
$selected = $obj2; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" =>$name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "VAL_TOTAL", |
|
"title" => $this->translate("VAL_TOTAL"), |
|
"required" => true, |
|
"attrs" => [ "onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj1}');" ] |
|
]; |
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "VAL_RANGE_TOTAL", |
|
"title" => $this->translate("VAL_RANGE_TOTAL"), |
|
"required" => true, |
|
"attrs" => ["onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj2}');"] |
|
]; |
|
if (isset($node->attributes()["minOccurs"]) && (int) ($node->attributes()["minOccurs"] == 0) ) { |
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "__£__", |
|
"title" => $this->translate("NO_RADIO_FOR_VAL_TOTAL"), |
|
"required" => true, |
|
"attrs" => ["onChange" => "$('#{$id}').empty();"] |
|
]; |
|
} |
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $this->getKeyFromNameString($name), |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_VAL_TOTAL"]), $inputs, $this->fields); |
|
} |
|
|
|
#region [ShowToGaetano] |
|
//anche questa radio potrebbe essere sottointesa |
|
#endregion |
|
private function radio_for_time_frame_indefinite(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_TIME_FRAME_INDEFINITE"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = $this->getId($name); |
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
|
|
|
|
$key = $this->getKeyFromNameString($this->arrayName2StringName($s["name"])); |
|
|
|
$no_indefinite_duration_obj = $this->makeAdd2GUUEObject([ |
|
"child" => $node->sequence->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$selected = "empty"; |
|
if ($value == "NO_INDEFINITE_DURATION") { |
|
$selected = $no_indefinite_duration_obj; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "INDEFINITE_DURATION", |
|
"title" => $this->translate("INDEFINITE_DURATION"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"group_validate" => true, |
|
"required" => true |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_INDEFINITE_DURATION", |
|
"title" => $this->translate("NO_INDEFINITE_DURATION"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$no_indefinite_duration_obj}');" |
|
], |
|
"group_validate" => true, |
|
"required" => true |
|
]; |
|
|
|
if ((int) ($node->attributes()["minOccurs"] ?? 1) == 0) { |
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_SPECIFIED_DURATION", |
|
"title" => $this->translate("NO_SPECIFIED_DURATION"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"group_validate" => true, |
|
"required" => true |
|
]; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"],["RADIO_FOR_TIME_FRAME_INDEFINITE"]), $inputs, $this->fields); |
|
return false; |
|
|
|
} |
|
|
|
private function performance_staff_qualification_ref(SimpleXMLIterator $node, array $settings = [], String $section) { |
|
$inputs = [ |
|
"info" => [ |
|
"title" => $this->translate("III_2_3_STAFF_RESPONSIBLE",$this->arrayName2StringName($settings["name"])) |
|
] |
|
]; |
|
$this->fields = $this->makeArray(array_merge($settings["name"],["T"]), $inputs, $this->fields); |
|
$node = $this->getTypeElement($node->attributes()["ref"]); |
|
$this->getField($section, $node, $settings); |
|
} |
|
|
|
private function section_for_qualification(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = $settings["name"]; |
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$s["required"] = true; |
|
$child = '<sequence><element name="CONDITIONS" type="text_ft_multi_lines"/><element name="METHODS" type="text_ft_multi_lines" minOccurs="0"/></sequence>'; |
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => true]); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$inputs[] = [ |
|
"info" => [ |
|
"title" => __guue("Sezione III) 1.9 Qualifica per il sistema") |
|
] |
|
]; |
|
$inputs[] = [ |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => !empty($content) ? $object : "empty", |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
], |
|
[ |
|
"name" => "button", |
|
"required" => false, |
|
"type" => "button", |
|
"title" => __guue('Aggiungi un criterio di qualità'), |
|
"attrs" => [ |
|
"onClick" => "eForms2.add2GUUE('#{$id}', '{$object}')", |
|
"class" => "btn btn-block btn-primary" |
|
] |
|
], |
|
]; |
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function notice_f07_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["_attributes", "TYPE"])), |
|
"size" => "col-sm-12", |
|
"type" => "text", |
|
"val" => "QSU_CALL_COMPETITION", |
|
"attrs" => ["hidden" => true] |
|
] |
|
]; |
|
$this->ignored_keys[] = "TYPE"; |
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["_attributes", "TYPE"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function notice_f21_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"],["_attributes", "TYPE"])), |
|
"size" => "col-12", |
|
"type" => "select", |
|
"object" => "empty", |
|
"options" => [ |
|
"PRI_ONLY" => $this->translate("PRI_ONLY"), |
|
"PRI_CALL_COMPETITION" => $this->translate("PRI_CALL_COMPETITION"), |
|
"CONTRACT" => __guue("Bando di gara"), |
|
"AWARD_CONTRACT" => __guue('Avviso aggiudicazione d\'appalto') |
|
], |
|
"title" => $this->translate("TYPE"), |
|
"required" => true |
|
]; |
|
$this->ignored_keys[] = "TYPE"; |
|
$this->fields = $this->makeArray(array_merge($settings["name"],["_attributes","TYPE"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function notice_f22_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"],["_attributes", "TYPE"])), |
|
"size" => "col-12", |
|
"type" => "select", |
|
"object" => "empty", |
|
"options" => [ |
|
"PER_ONLY" => __guue("Avviso periodico indicativo"), |
|
"PER_CALL_COMPETITION" => __guue("Avviso periodico indicativo - Indizione di gara"), |
|
"QSU_ONLY" => __guue("Sistema di qualificazione"), |
|
"QSU_CALL_COMPETITION" => __guue("Sistema di qualificazione - Indizione di gara"), |
|
"CONTRACT" => __guue("Bando di gara"), |
|
"AWARD_CONTRACT" => __guue('Avviso aggiudicazione d\'appalto') |
|
], |
|
"title" => $this->translate("TYPE"), |
|
"required" => true |
|
]; |
|
$this->ignored_keys[] = "TYPE"; |
|
$this->fields = $this->makeArray(array_merge($settings["name"],["_attributes","TYPE"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
|
|
private function radio_for_authority(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$name = $this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_AUTHORITY"])); |
|
$id = $this->getId($name); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$value = self::get($this->info["valori"], $key); |
|
|
|
$s["skip-legal-basis"] = true; |
|
|
|
$obj1 = $this->makeAdd2GUUEObject(["child" => $node->group[0]->asXML(), "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
$obj2 = $this->makeAdd2GUUEObject(["child" => $node->group[1]->asXML(), "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$selected = "empty"; |
|
if ($value == "CHOICE_CONTRACTING_AUTHORITY") { |
|
$selected = $obj1; |
|
} else if ($value = "CHOICE_CONTRACTING_ENTITY") { |
|
$selected = $obj2; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "CHOICE_CONTRACTING_AUTHORITY", |
|
"title" => $this->translate("CONTRACTING_AUTHORITY"), |
|
"required" => true, |
|
"attrs" => ["onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj1}');"] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "CHOICE_CONTRACTING_ENTITY", |
|
"title" => $this->translate("CONTRACTING_ENTITY"), |
|
"required" => true, |
|
"attrs" => ["onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj2}');"] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
], |
|
]; |
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_AUTHORITY"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function radio_for_nb_participants(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$name = $this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_NB_PARTICIPANTS"])); |
|
$id = $this->getId($name); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$s["skip-legal-basis"] = true; |
|
|
|
$child1 = $node->element[0]->asXML(); |
|
$child2 = $node->sequence->asXML(); |
|
$child3 = $node->element[1]->asXML(); |
|
|
|
$obj1 = $this->makeAdd2GUUEObject(["child" => $child1, "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
$obj2 = $this->makeAdd2GUUEObject(["child" => $child2, "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
$obj3 = $this->makeAdd2GUUEObject(["child" => $child3, "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$selected = "empty"; |
|
if ($value == "NB_PARTICIPANTS") { |
|
$selected = $obj1; |
|
} else if ($value == "NB_RANGE") { |
|
$selected = $obj2; |
|
} else if ($value == "NB_MAX_PARTICIPANTS") { |
|
$selected = $obj3; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "NB_PARTICIPANTS", |
|
"title" => $this->translate("NB_PARTICIPANTS"), |
|
"required" => true, |
|
"attrs" => ["onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj1}');"] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "NB_RANGE", |
|
"title" => $this->translate("NB_RANGE"), |
|
"required" => true, |
|
"attrs" => ["onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj2}');"] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "NB_MAX_PARTICIPANTS", |
|
"title" => $this->translate("NB_MAX_PARTICIPANTS"), |
|
"required" => true, |
|
"attrs" => ["onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj3}');"] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $this->getKeyFromNameString($name), |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_AUTHORITY"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function radio_for_prize_awarded(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$this->applyTitle("RADIO_FOR_PRIZE_AWARDED", $settings, $section); |
|
$name = array_merge($settings["name"], ["RADIO_FOR_PRIZE_AWARDED"]); |
|
$name = $this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_PRIZE_AWARDED"])); |
|
$id = $this->getId($name); |
|
|
|
unset($node->sequence->element[0]); |
|
$obj = $this->makeAdd2GUUEObject(["child" => $node->sequence->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "PRIZE_AWARDED", |
|
"title" => $this->translate("PRIZE_AWARDED"), |
|
"required" => true, |
|
"attrs" => ["onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj}');"] |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "NO_PRIZE_AWARDED", |
|
"title" => $this->translate("NO_PRIZE_AWARDED"), |
|
"required" => true, |
|
"attrs" => ["onChange" => "$('#{$id}').empty();"] |
|
|
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $this->getKeyFromNameString($name), |
|
"object" => (empty($value) || $value == "NO_PRIZE_AWARDED") ? "empty" : $obj, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"],["RADIO_FOR_PRIZE_AWARDED"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function radio_for_no_awarded_prize(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_NO_AWARDED_PRIZE"]); |
|
$name = $this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_NO_AWARDED_PRIZE"])); |
|
$id = $this->getId($name); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
|
|
$obj1 = $this->makeAdd2GUUEObject([ "child" => $node->element[0]->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false ]); |
|
$obj2 = $this->makeAdd2GUUEObject([ "child" => $node->element[1]->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false ]); |
|
|
|
$selected = "empty"; |
|
if ($value == "NO_AWARDED_PRIZE") { |
|
$selected = $obj1; |
|
} else if ($value == "AWARDED_PRIZE") { |
|
$selected = $obj2; |
|
} |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "NO_AWARDED_PRIZE", |
|
"title" => $this->translate("NO_AWARDED_PRIZE"), |
|
"required" => true, |
|
"attrs" => ["onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj1}');"] |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "AWARDED_PRIZE", |
|
"title" => $this->translate("AWARDED_PRIZE"), |
|
"required" => true, |
|
"attrs" => ["onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj2}');"] |
|
|
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $this->getKeyFromNameString($name), |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id |
|
] |
|
] |
|
]; |
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_NO_AWARDED_PRIZE"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function radio_for_follow_up_contracts(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_FOLLOW_UP_CONTRACTS"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "FOLLOW_UP_CONTRACTS", |
|
"title" => $this->translate("FOLLOW_UP_CONTRACTS"), |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_FOLLOW_UP_CONTRACTS"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "NO_FOLLOW_UP_CONTRACTS", |
|
"title" => $this->translate("NO_FOLLOW_UP_CONTRACTS"), |
|
"required" => true |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"],["RADIO_FOR_FOLLOW_UP_CONTRACTS"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function radio_for_decision_binding_contract(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"],["RADIO_FOR_DECISION_BINDING_CONTRACTING"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "DECISION_BINDING_CONTRACTING", |
|
"title" => $this->translate("DECISION_BINDING_CONTRACTING"), |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_DECISION_BINDING_CONTRACTING"])), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"value" => "NO_DECISION_BINDING_CONTRACTING", |
|
"title" => $this->translate("NO_DECISION_BINDING_CONTRACTING"), |
|
"required" => true |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"],["RADIO_FOR_DECISION_BINDING_CONTRACTING"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function publication_fields(SimpleXMLIterator $node, array $settings = [], String $section, bool $additive = false) |
|
{ |
|
$attribute = ["_attributes","PUBLICATION"]; |
|
if ( |
|
$settings["name"][count($settings["name"])-1] == "PUBLICATION" && |
|
$settings["name"][count($settings["name"])-2] == "_attributes" |
|
) { |
|
$attribute = []; |
|
} |
|
|
|
$name = array_merge($settings["name"], $attribute); |
|
|
|
$no = "NO"; |
|
if (in_array($this->form_section,["F15_2014"])) { |
|
$no = "__£__"; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName($name), |
|
"size" => "col-12", |
|
"type" => "select", |
|
"object" => "empty", |
|
"options" => [ |
|
"{$no}" => $this->translate("NO"), |
|
"YES" => $this->translate("YES"), |
|
], |
|
"title" => $this->translate("PUBLICATION"), |
|
"required" => true |
|
]; |
|
if ($additive) { |
|
$this->fields[] = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return true; |
|
} |
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return true; |
|
} |
|
|
|
private function agree_to_publication_opt_base(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$this->publication_fields($this->getTypeElement("agree_to_publication_opt"), $settings, $section); |
|
unset($node->attributes()["base"]); |
|
$this->getField($section, $node, $settings); |
|
return false; |
|
} |
|
|
|
private function winner_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
#region MULTIPLE WINNERS |
|
if (isset($node->attributes()["maxOccurs"])) { |
|
$name = $settings["name"]; |
|
$id = uniqid($this->slugify($this->arrayName2StringName($name))); |
|
|
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
unset($node->attributes()["maxOccurs"]); |
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => $node->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => true |
|
]); |
|
|
|
unset($node->complexType->sequence->element); |
|
unset($node->complexType->sequence->choice); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => !empty($content) ? $object : "empty", |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
], |
|
[ |
|
"name" => "button", |
|
"required" => true, |
|
"type" => "button", |
|
"title" => __guue('Aggiungi un vincitore'), |
|
"attrs" => [ |
|
"onClick" => "eForms2.add2GUUE('#{$id}', '{$object}');", |
|
"class" => "btn btn-block btn-primary" |
|
] |
|
] |
|
]; |
|
$this->fields = $this->makeArray($name, $inputs, $this->fields); |
|
return false; |
|
} |
|
#endregion |
|
$this->getField($section, $node->complexType, $settings); |
|
return false; |
|
} |
|
|
|
private function address_winner_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$node = $this->getTypeElement("contact_contractor"); |
|
unset($node->element[6]); //rimuove il contact point |
|
unset($node->element[10]); //rimuove l'url_general |
|
unset($node->element[10]); //rimuove l'url_buyer |
|
$this->getField($section, $node, $settings); |
|
} |
|
|
|
#region[ShowToGaetano] |
|
#BUGFIX: questo è da sistemare. Non va il group validate. |
|
#endregion |
|
private function radio_for_sme(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_SME"]); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("SME"), |
|
"group_validate" => true, |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "SME" |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO_SME"), |
|
"group_validate" => true, |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NO_SME" |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function radio_for_original_other_means(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"],["RADIO_FOR_OTHER_MEANS"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$key = $this->getKeyFromNameString($name); |
|
$id = $this->getId($name); |
|
|
|
$obj1 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->sequence[0]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
$obj2 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->sequence[1]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$selected = "empty"; |
|
if ($value == "NO_ORIGINAL_OTHER_MEANS") { |
|
$selected = $obj1; |
|
} else if ($value == "ORIGINAL_OTHER_MEANS") { |
|
$selected = $obj2; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $name, |
|
"object" => "empty", |
|
"title" => $this->translate("NO_ORIGINAL_OTHER_MEANS"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NO_ORIGINAL_OTHER_MEANS", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj1}');", |
|
], |
|
"required" => true, |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $name, |
|
"object" => "empty", |
|
"title" => $this->translate("ORIGINAL_OTHER_MEANS"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "ORIGINAL_OTHER_MEANS", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj2}');", |
|
], |
|
"required" => true, |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function radio_for_enotices(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_ENOTICES"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
|
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$s1 = $s; |
|
$s2 = $s; |
|
|
|
$s1["name"] = array_merge($settings["name"],["ORIGINAL_ENOTICES"]); |
|
$s2["name"] = array_merge($settings["name"], ["ORIGINAL_TED_ESENDER"]); |
|
|
|
$obj1 = $this->makeAdd2GUUEObject([ |
|
"child" => '<element type="non_published"></element>', |
|
"settings" => $s1, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$obj2 = $this->makeAdd2GUUEObject([ |
|
"child" => '<element type="non_published"></element>', |
|
"settings" => $s2, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$selected = "empty"; |
|
if ($value == "ORIGINAL_ENOTICES") { |
|
$selected = $obj1; |
|
} else if ($value == "ORIGINAL_TED_ESENDER") { |
|
$selected = $obj2; |
|
} |
|
|
|
$id = $this->getId($name); |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $name, |
|
"object" => "empty", |
|
"title" => $this->translate("ORIGINAL_ENOTICES"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "ORIGINAL_ENOTICES", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj1}');", |
|
], |
|
"required" => true, |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $name, |
|
"object" => "empty", |
|
"title" => $this->translate("ORIGINAL_TED_ESENDER"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "ORIGINAL_TED_ESENDER", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj2}');", |
|
], |
|
"required" => true, |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "d-none", |
|
"id" => $id, |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function esender_login_base(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$this->auth(); |
|
$ente = $_SESSION["ente"]->getInfo(); |
|
$inputs[] = [ |
|
"type" => "hidden", |
|
"value" => $this->username, |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["_value"])), |
|
]; |
|
|
|
$inputs[] = [ |
|
"type" => "hidden", |
|
"value" => "NO", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["_attributes", "PUBLICATION"])), |
|
]; |
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function customer_login_base(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$ente = $_SESSION["ente"]->getInfo(); |
|
$inputs[] = [ |
|
"type" => "hidden", |
|
"value" => $ente["id_guue"] ?? "__£__", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"],["_value"])), |
|
]; |
|
$inputs[] = [ |
|
"type" => "hidden", |
|
"value" => "NO", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["_attributes", "PUBLICATION"])), |
|
]; |
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function no_doc_ext_base(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["_value"])), |
|
"size" => "col-sm-12", |
|
"type" => "text", |
|
"object" => "empty", |
|
"value" => "", |
|
"rel" => ["S", "1", "0", "A"], |
|
"title" => $this->translate("NO_DOC_EXT"), |
|
"required" => true, |
|
]; |
|
|
|
$inputs[] = [ |
|
"type" => "hidden", |
|
"value" => "NO", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["_attributes", "PUBLICATION"])), |
|
]; |
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function radio_for_additional_need(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
#region[ShowToGaetano] |
|
#Bisognerebbe nascondere la stampa dei titoli per il contenuto dela selezione |
|
#endregion |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_ADDITIONAL_NEED"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = $this->getId($name); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$object1 = $this->makeAdd2GUUEObject(["child" => $node->element[0]->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
$object2 = $this->makeAdd2GUUEObject(["child" => $node->element[1]->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$selected = "empty"; |
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
|
|
if ($value == "ADDITIONAL_NEED") { |
|
$selected = $object1; |
|
} else if ($value == "UNFORESEEN_CIRCUMSTANCE") { |
|
$selected = $object2; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("ADDITIONAL_NEED"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "ADDITIONAL_NEED", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object1}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("UNFORESEEN_CIRCUMSTANCE"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "UNFORESEEN_CIRCUMSTANCE", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object2}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function radio_for_modification_original(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_MODIFICATION_ORIGINAL"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = $this->getId($name); |
|
$key = $this->getKeyFromNameString($name); |
|
$child = "<element ref='non_published' hidden='true'></element>"; |
|
|
|
$s1 = $s; |
|
$s2 = $s; |
|
|
|
$s1["name"] = array_merge($settings["name"], ["MODIFICATION_ORIGINAL"]); |
|
$s2["name"] = array_merge($settings["name"], ["PUBLICATION_TED"]); |
|
|
|
$object1 = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $s1, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
$object2 = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $s2, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$selected = "empty"; |
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
|
|
if ($value == "CHOICE_MODIFICATION_ORIGINAL") { |
|
$selected = $object1; |
|
} else if ($value == "CHOICE_PUBLICATION_TED") { |
|
$selected = $object2; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("MODIFICATION_ORIGINAL"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "CHOICE_MODIFICATION_ORIGINAL", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object1}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("PUBLICATION_TED"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "CHOICE_PUBLICATION_TED", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object2}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"hidden" => true, |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function section_for_change(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"],["CHANGE"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = $this->getId($name); |
|
$key = $this->getKeyFromNameString($name); |
|
$child = $node->sequence->element->complexType->sequence->asXML(); |
|
$child = " |
|
<sequence> |
|
<element ref='WHERE'/> |
|
<element name='OLD_VALUE'> |
|
<complexType> |
|
<group ref='data'/> |
|
</complexType> |
|
</element> |
|
<element name='NEW_VALUE'> |
|
<complexType> |
|
<group ref='data'/> |
|
</complexType> |
|
</element> |
|
</sequence> |
|
"; |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $child, "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => true]); |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $object, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"], ["CHANGE_ADDITIONAL_BUTTON"])), |
|
"required" => false, |
|
"type" => "button", |
|
"title" => __guue('Aggiungi Modifica'), |
|
"attrs" => [ |
|
"onClick" => "eForms2.add2GUUE('#{$id}','{$object}')", |
|
"class" => "btn btn-block btn-primary" |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
$this->getField($section, $node->sequence->element[1], $settings); |
|
return false; |
|
} |
|
|
|
private function data_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
$s = $settings; |
|
if ($settings["name"][count($settings["name"]) -1] == "OLD_VALUE") { |
|
$radio_name = "RADIO_FOR_DATA_OLD"; |
|
} else { |
|
$radio_name = "RADIO_FOR_DATA_NEW"; |
|
} |
|
$s["name"] = array_merge($settings["name"], [$radio_name]); |
|
|
|
$s1 = $s; $s2 = $s; $s3 = $s; $s4 = $s; |
|
|
|
$s1["name"] = array_merge($settings["name"], ["CPV_MAIN"]); |
|
$s2["name"] = $settings["name"]; |
|
$s3["name"] = array_merge($settings["name"], ["TEXT"]); |
|
$s4["name"] = array_merge($settings["name"]); |
|
$ignored = [$settings["name"][count($settings["name"])-2], "DATE", "DATA_DATE"]; |
|
|
|
$obj1 = $this->makeAdd2GUUEObject([ "child" => $node->choice->element[1]->asXML(), "settings" => $s1, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false, 'ignored_keys' => $ignored]); |
|
$obj2 = $this->makeAdd2GUUEObject([ "child" => $node->choice->element[2]->asXML(), "settings" => $s2, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false, 'ignored_keys' => $ignored]); |
|
$obj3 = $this->makeAdd2GUUEObject([ "child" => $node->choice->element[3]->asXML(), "settings" => $s3, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false, 'ignored_keys' => $ignored]); |
|
$obj4 = $this->makeAdd2GUUEObject([ "child" => $node->choice->sequence->asXML(), "settings" => $s4, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false, 'ignored_keys' => $ignored]); |
|
|
|
$name = $this->arrayName2StringName(array_merge($settings["name"],["SELECTION"])); |
|
$id = $this->getId($name); |
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
|
|
$selected = "empty"; |
|
if ($value == "CPV_MAIN") { |
|
$selected = $obj1; |
|
} else if ($value == "CPV_ADDITIONAL") { |
|
$selected = $obj2; |
|
} else if ($value == "TEXT") { |
|
$selected = $obj3; |
|
} else if ($value == "SEL_DATA_DATE") { |
|
$selected = $obj4; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $name, |
|
"object" => "empty", |
|
"title" => $this->translate("CPV_MAIN_SEL"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "CPV_MAIN", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj1}');", |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $name, |
|
"object" => "empty", |
|
"title" => $this->translate("CPV_ADDITIONAL",$name), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "CPV_ADDITIONAL", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj2}');", |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $name, |
|
"object" => "empty", |
|
"title" => $this->translate("TEXT"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "TEXT", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj3}');", |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $name, |
|
"object" => "empty", |
|
"title" => $this->translate("DATA_DATE"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "SEL_DATA_DATE", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}', '{$obj4}');", |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $name, |
|
"object" => "empty", |
|
"title" => $this->translate("NOTHING"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NOTHING", |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();", |
|
], |
|
"required" => true, |
|
"group_validate" => true |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $this->getKeyFromNameString($name), |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
], |
|
"ignored_keys" => $ignored |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"],[$radio_name]), $inputs, $this->fields); |
|
} |
|
|
|
private function joint_procurement_involved_ref(SimpleXMLIterator $node, array $settings = [], String $section){ |
|
$s = $settings; |
|
$s["name"][] = "JOINT_PROCUREMENT_INVOLVED"; |
|
$inputs[] = [ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "text", |
|
"val" => "__£__", |
|
"attrs" => ["hidden" => true], |
|
"hidden-label" => true |
|
]; |
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function body_f08_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"][] = "ADDRESS_CONTRACTING_BODY_ADDITIONAL"; |
|
$this->getField($section, $node->sequence->element[0], $settings); |
|
$this->radio_for_address_contracting_body_additional($node->sequence->sequence, $settings, $section); |
|
$this->getField($section, $node->sequence->element[1], $settings); |
|
$this->getField($section, $node->sequence->group[0], $settings); |
|
$this->getField($section, $node->sequence->group[1], $settings); |
|
$this->getField($section, $node->sequence->element[2], $settings); |
|
$this->getField($section, $node->sequence->choice, $settings); |
|
} |
|
|
|
private function radio_for_address_contracting_body_additional(SimpleXMLIterator $node, array $settings = [], String $section) { |
|
#region FACOLTATIVE |
|
if (!empty($node->attributes()) && isset($node->attributes()["minOccurs"]) && (int) $node->attributes()["minOccurs"] == 0) { |
|
$this->applyTitle("RADIO_FOR_CONTRACTING_BODY_ADDITIONAL",$settings,$section); |
|
$s = $settings; |
|
$s["name"] = array_merge($s["name"], ["RADIO_FOR_CONTRACTING_BODY_ADDITIONAL"]); |
|
$id = strtolower(str_replace(["][", "[", "]"], ["_", "", ""], $this->arrayName2StringName($s["name"]))); |
|
unset($node->attributes()["minOccurs"]); |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => '<sequence><element ref="ADDRESS_CONTRACTING_BODY_ADDITIONAL"/><element ref="JOINT_PROCUREMENT_INVOLVED"/><element ref="PROCUREMENT_LAW" minOccurs="0"/></sequence>', |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$value = self::get($this->info["valori"], implode(".", $s["name"])); |
|
|
|
$k = $this->arrayName2StringName($s["name"]); |
|
$k = trim(str_replace(['][', '[', ']'], '.', str_replace("guue", "", $k)), '.'); |
|
|
|
$selected = "empty"; |
|
if ($value == "ADDRESS_CONTRACTING_BODY_ADDITIONAL") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "ADDRESS_CONTRACTING_BODY_ADDITIONAL", |
|
"title" => $this->translate("YES"), |
|
"attrs" => [ |
|
"onChange" => "eForms2.add2GUUE('#{$id}', '{$object}')", |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "NO_ADDRESS_CONTRACTING_BODY_ADDITIONAL", |
|
"title" => $this->translate("NO"), |
|
"attrs" => [ |
|
"onChange" => "$('#{$id}').empty();" |
|
], |
|
"required" => true |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $k, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"class" => "", |
|
"id" => $id, |
|
] |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
#endregion |
|
#region SINGLE ELEMENT |
|
$this->address_contracting_body_additional_ref($node,$settings,$section); |
|
#endregion |
|
return false; |
|
} |
|
|
|
private function custom_document_url_section_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_DOCUMENT_URL_SECTION"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_DOCUMENT_URL_SECTION"])))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
unset($node->attributes()["ref"]); |
|
$object = $this->makeAdd2GUUEObject(["child" => $node->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
if ($value == "DOCUMENT_URL_MAN") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("DOCUMENT_URL_MAN"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "DOCUMENT_URL_MAN", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO_DOCUMENT_URL_MAN"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NO_DOCUMENT_URL_MAN", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function date_dispatch_original_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"][] = "DATE_DISPATCH_ORIGINAL"; |
|
$inputs[] = [ |
|
"size" => "col-sm-8", |
|
"title" => $this->translate("DATE_DISPATCH_ORIGINAL"), |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["_value"])), |
|
"type" => "date", |
|
"object" => "date", |
|
"value" => "", |
|
"attrs" => [ |
|
"class" => "datetimepicker" |
|
], |
|
"required" => true |
|
]; |
|
|
|
$inputs[] = [ |
|
"type" => "hidden", |
|
"value" => "NO", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"], ["_attributes", "PUBLICATION"])), |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function ac_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$options["title"] = [ |
|
"info" => [ |
|
"title" => $this->translate("RADIO_FOR_AC", $this->arrayName2StringName($settings["name"])), |
|
"style" => "subtitle", |
|
"hidden" => true |
|
] |
|
]; |
|
if ($this->minOccursRadio($node, $settings, $section, "AC", $this->translate("RADIO_FOR_AC", $this->arrayName2StringName($settings["name"])), $options)) { |
|
return; |
|
$settings["required"] = true; |
|
} |
|
$this->getField($section, $node->complexType, $settings); |
|
} |
|
|
|
private function ac_criterion_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$name = $this->arrayName2StringName($s["name"]); |
|
|
|
#region MULTIPLE AC_CRITERION |
|
if (!empty($node->attributes()["maxOccurs"]) && ((int) $node->attributes()["maxOccurs"]) > 0) { |
|
|
|
$s["name"] = array_merge($s["name"], ["AC_CRITERION"]); |
|
$name = $this->arrayName2StringName($s["name"]); |
|
|
|
$n = $node; |
|
$id = uniqid($this->slugify($name)); |
|
unset($n->attributes()["maxOccurs"]); |
|
|
|
$key = $this->getKeyFromNameString($name); |
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => $n->asXML(), |
|
"settings" => $s, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => true |
|
]); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => !empty($content) ? $object : "empty", |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
], |
|
[ |
|
"name" => "button", |
|
"required" => false, |
|
"type" => "button", |
|
"title" => __guue('Aggiungi un criterio di qualità'), |
|
"attrs" => [ |
|
"onClick" => "eForms2.add2GUUE('#{$id}', '{$object}')", |
|
"class" => "btn btn-block btn-primary" |
|
] |
|
], |
|
]; |
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
#endregion |
|
|
|
$inputs[] = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "text", |
|
"title" => $this->translate("AC_CRITERION"), |
|
"rel" => ["S","1","1000","ALFA"], |
|
"required" => true, |
|
] |
|
]; |
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function multiple_ac_criterion_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["AC_CRITERION"]); |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["AC_CRITERION"])))); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => '<element ref="AC_CRITERION" minOccurs="1"/>', |
|
"settings" => $s, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => true |
|
]); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => !empty($content) ? $object : "empty", |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
], |
|
[ |
|
"name" => "button", |
|
"required" => false, |
|
"type" => "button", |
|
"title" => __guue('Aggiungi un criterio di qualità'), |
|
"attrs" => [ |
|
"onClick" => "eForms2.add2GUUE('#{$id}', '{$object}')", |
|
"class" => "btn btn-block btn-primary" |
|
] |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function radio_for_ac_procurement_doc(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_AC_PROCUREMENT_DOC"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_AC_PROCUREMENT_DOC"])))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => '<element ref="multiple_ac_criterion"></element>', "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
if ($value == "MULTIPLE_AC_CRITERION") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("AC_PROCUREMENT_DOC"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "AC_PROCUREMENT_DOC", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("MULTIPLE_AC_CRITERION"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "MULTIPLE_AC_CRITERION", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function radio_for_annex_d4_part_1(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_ANNEX_D4_PART_1"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_ANNEX_D4_PART_1"])))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$object1 = $this->makeAdd2GUUEObject(["child" => $node->group[0]->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
$object2 = $this->makeAdd2GUUEObject(["child" => $node->group[1]->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
if ($value == "ANNEX_D4_PART1") { |
|
$selected = $object1; |
|
} else if ($value = "ANNEX_PART2") { |
|
$selected = $object2; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("ANNEX_D4_PART1"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "ANNEX_D4_PART1", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object1}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("ANNEX_PART2"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "ANNEX_PART2", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object2}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function radio_for_annex_d2_part1(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_ANNEX_D2_PART1"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_ANNEX_D2_PART1"])))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$object1 = $this->makeAdd2GUUEObject(["child" => $node->group[0]->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
$object2 = $this->makeAdd2GUUEObject(["child" => $node->group[1]->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
if ($value == "ANNEX_D2_PART1") { |
|
$selected = $object1; |
|
} else if ($value = "ANNEX_PART2") { |
|
$selected = $object2; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("ANNEX_D2_PART1"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "ANNEX_D2_PART1", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object1}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("ANNEX_PART2"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "ANNEX_PART2", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object2}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function radio_for_pt_award_contract_with_prior_publication(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_PT_AWARD_CONTRACT_WITH_PRIOR_PUBLICATION"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_PT_AWARD_CONTRACT_WITH_PRIOR_PUBLICATION"])))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$object = $this->makeAdd2GUUEObject(["child" => $node->element[1]->asXML(), "settings" => $settings, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => false]); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
if ($value == "PT_AWARD_CONTRACT_WITHOUT_PUBLICATION") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("PT_AWARD_CONTRACT_WITH_PRIOR_PUBLICATION"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "PT_AWARD_CONTRACT_WITH_PRIOR_PUBLICATION", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("PT_AWARD_CONTRACT_WITHOUT_PUBLICATION",$this->arrayName2StringName($s["name"])), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "PT_AWARD_CONTRACT_WITHOUT_PUBLICATION", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function radio_for_d_from_winding_provider(SimpleXMLIterator $node, array $settings = [], String $section) { |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_D_FROM_WINDING_PROVIDER"]); |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("D_FROM_WINDING_PROVIDER"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "D_FROM_WINDING_PROVIDER", |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("D_FROM_LIQUIDATOR_CREDITOR"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "D_FROM_LIQUIDATOR_CREDITOR", |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => __guue('Nessuna delle scelte precedenti'), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "__£__", |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function radio_for_d_accordance_article(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_D_ACCORDANCE_ARTICLE"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_D_ACCORDANCE_ARTICLE"])))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$object1 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->element->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$object2 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->group->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
if ($value == "D_ACCORDANCE_ARTICLE") { |
|
$selected = $object1; |
|
} else if ($value == "ANNEX_PART2") { |
|
$selected = $object2; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("D_ACCORDANCE_ARTICLE"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "D_ACCORDANCE_ARTICLE", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object1}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("ANNEX_PART2"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "ANNEX_PART2", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object2}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function radio_for_val_estimated_total(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_VAL_ESTIMATED_TOTAL"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_VAL_ESTIMATED_TOTAL"])))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$obj1 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->element[0]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$obj2 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->element[1]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$obj3 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->element[2]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
|
|
if ($value == "VAL_ESTIMATED_TOTAL") { |
|
$selected = $obj1; |
|
} else if ($value == "VAL_TOTAL") { |
|
$selected = $obj2; |
|
} else if ($value == "VAL_RANGE_TOTAL") { |
|
$selected = $obj3; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("VAL_ESTIMATED_TOTAL"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "VAL_ESTIMATED_TOTAL", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$obj1}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("VAL_TOTAL"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "VAL_TOTAL", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$obj2}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("VAL_RANGE_TOTAL"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "VAL_RANGE_TOTAL", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$obj3}')", |
|
] |
|
]; |
|
|
|
if (isset($node->attributes()["minOccurs"]) && ((int) $node->attributes()["minOccurs"]) == 0) { |
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => __guue('Nessuna delle scelte precedenti'), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "__£__", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();", |
|
] |
|
]; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function receipt_tenders_f21(SimpleXMLIterator $node, array $settings = [], String $section) { |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_RECEIPT_TENDERS"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_RECEIPT_TENDERS"])))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => $node->sequence->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
|
|
if ($value == "D_ACCORDANCE_ARTICLE") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("YES"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "D_ACCORDANCE_ARTICLE", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "TERMINATION_PIN", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function receipt_tenders_f22(SimpleXMLIterator $node, array $settings = [], String $section) { |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_RECEIPT_TENDERS"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_RECEIPT_TENDERS"])))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => $node->sequence->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
|
|
if ($value == "D_ACCORDANCE_ARTICLE") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("SPECIFY_RECEIPT_TENDERS"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "D_ACCORDANCE_ARTICLE", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("TERMINATION_PIN"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "TERMINATION_PIN", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NOT_SPECIFIED"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "__£__", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function radio_for_receipt_tenders(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
if (in_array($this->form_section,["F21_2014"])) { |
|
$this->receipt_tenders_f21($node, $settings, $section); |
|
} else if (in_array($this->form_section,["F22_2014"])) { |
|
$this->receipt_tenders_f22($node, $settings, $section); |
|
} |
|
} |
|
|
|
private function radio_for_time_frame(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$inputs = []; |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_TIME_FRAME_SECTION"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["RADIO_FOR_TIME_FRAME_SECTION"])))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$object1 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->sequence->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
$object2 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->element->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
|
|
if ($value == "CHOICE_TIME_FRAME") { |
|
$selected = $object1; |
|
} else if ($value == "CHOICE_QS") { |
|
$selected = $object2; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("CHOICE_TIME_FRAME"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "CHOICE_TIME_FRAME", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object1}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("QS"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "CHOICE_QS", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object2}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NOT_SPECIFIED"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "CHOICE_NO", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
|
|
private function qs_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$this->getField($section, $node->complexType->sequence->group, $settings); |
|
$this->renewal_ref($node, $settings, $section); |
|
} |
|
|
|
private function address_review_body_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
if (!empty($node->attributes()) && isset($node->attributes()["minOccurs"]) && (int) $node->attributes()["minOccurs"] == 0) { |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_ADDRESS_REVIEW_BODY"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
|
|
$n = $node; |
|
unset($n->attributes()["minOccurs"]); |
|
|
|
$settings["required"] = true; |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => $this->getTypeElement("ADDRESS_REVIEW_BODY")->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
if ($value == "ADDRESS_REVIEW_BODY") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = []; |
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("YES"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "ADDRESS_REVIEW_BODY", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NO_ADDRESS_REVIEW_BODY", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
$this->getField($section, $this->getTypeElement($node->attributes()["ref"]->__toString()), $settings); |
|
} |
|
|
|
private function address_mediation_body_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
if (!empty($node->attributes()) && isset($node->attributes()["minOccurs"]) && (int) $node->attributes()["minOccurs"] == 0) { |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_ADDRESS_MEDIATION_BODY"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
|
|
$n = $node; |
|
unset($n->attributes()["minOccurs"]); |
|
|
|
$settings["required"] = true; |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => $this->getTypeElement("ADDRESS_MEDIATION_BODY")->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
if ($value == "ADDRESS_MEDIATION_BODY") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = []; |
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("YES"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "ADDRESS_MEDIATION_BODY", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NO_ADDRESS_MEDIATION_BODY", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
$this->getField($section, $this->getTypeElement($node->attributes()["ref"]->__toString()), $settings); |
|
} |
|
|
|
private function review_procedure_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
if (!empty($node->attributes()) && isset($node->attributes()["minOccurs"]) && (int) $node->attributes()["minOccurs"] == 0) { |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_REVIEW_PROCEDURE"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
|
|
$n = $node; |
|
unset($n->attributes()["minOccurs"]); |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => $this->getTypeElement($node->attributes()["ref"]->__toString())->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
if ($value == "REVIEW_PROCEDURE") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = []; |
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("YES"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "REVIEW_PROCEDURE", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NO_REVIEW_PROCEDURE", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
$this->getField($section, $this->getTypeElement($node->attributes()["ref"]->__toString()), $settings); |
|
} |
|
|
|
private function address_review_info_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
if (!empty($node->attributes()) && isset($node->attributes()["minOccurs"]) && (int) $node->attributes()["minOccurs"] == 0) { |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_ADDRESS_REVIEW_INFO"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
|
|
$n = $node; |
|
unset($n->attributes()["minOccurs"]); |
|
|
|
$settings["required"] = true; |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => $this->getTypeElement("ADDRESS_REVIEW_INFO")->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
if ($value == "ADDRESS_REVIEW_INFO") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = []; |
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("YES"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "ADDRESS_REVIEW_INFO", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NO_REVIEW_PROCEDURE", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
$this->getField($section, $this->getTypeElement($node->attributes()["ref"]->__toString()), $settings); |
|
} |
|
|
|
private function radio_for_awarded_to_group(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_AWARDED_TO_GROUP"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$node->sequence->group->attributes()["ref"] = "multiple_contractor_sme_opt"; |
|
$object1 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->sequence->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
|
|
$object2 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->group->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
if ($value == "AWARDED_TO_GROUP") { |
|
$selected = $object1; |
|
} else if ($value == "NO_AWARDED_TO_GROUP") { |
|
$selected = $object2; |
|
} |
|
|
|
$inputs = []; |
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("YES"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "AWARDED_TO_GROUP", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object1}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NO_AWARDED_TO_GROUP", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object2}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function multiple_contractor_sme_opt_ref(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["required"] = false; |
|
|
|
$id = uniqid($this->slugify($this->arrayName2StringName(array_merge($settings["name"], ["CONTRACTOR_SME_OPT"])))); |
|
|
|
$s["name"][] = "CONTRACTOR"; |
|
$s["required"] = true; |
|
$object = $this->makeAdd2GUUEObject(["child" => $this->getTypeElement("contractor_sme_opt")->asXML(), "settings" => $s, "section" => $section, "xsd" => $this->xsd, "hidden-header" => true, 'multiple' => true]); |
|
|
|
$key = $this->arrayName2StringName($s["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $this->arrayName2StringName(array_merge($settings["name"],["AWARDED_TO_GROUP"])), |
|
"size" => "col-sm-12", |
|
"type" => "hidden", |
|
"value" => "__£__" |
|
], |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => !empty($content) ? $object : "empty", |
|
"attrs" => [ |
|
"id" => $id, |
|
] |
|
], |
|
[ |
|
"name" => "button", |
|
"required" => false, |
|
"type" => "button", |
|
"title" => __guue('Aggiungi operatore economico'), |
|
"attrs" => [ |
|
"onClick" => "eForms2.add2GUUE('#{$id}', '{$object}');", |
|
"class" => "btn btn-block btn-primary" |
|
] |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function opening_condition_ref(SimpleXMLIterator $node, array $settings = [], String $section) { |
|
if (!empty($node->attributes()) && isset($node->attributes()["minOccurs"]) && (int) $node->attributes()["minOccurs"] == 0) { |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_OPENING_CONDITION"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
|
|
$n = $node; |
|
unset($n->attributes()["minOccurs"]); |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => $this->getTypeElement($node->attributes()["ref"]->__toString())->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
if ($value == "OPENING_CONDITION") { |
|
$selected = $object; |
|
} |
|
|
|
$inputs = []; |
|
$inputs[] = [ |
|
"info" => [ |
|
"title" => $this->translate("SPECIFY_OPENING_CONDITION",$this->arrayName2StringName($s["name"])), |
|
"style" => "subtitle" |
|
] |
|
]; |
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("YES"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "OPENING_CONDITION", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "NO_OPENING_CONDITION", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
$this->getField($section, $this->getTypeElement($node->attributes()["ref"]->__toString()), $settings); |
|
} |
|
|
|
private function val_prize_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
if ($this->minOccursRadio($node, $settings, $section, "VAL_PRIZE", __guue("Specifica il valore dei premi"))) { |
|
return; |
|
} |
|
unset($node->complexType->simpleContent->extension->attribute); |
|
$this->getField($section, $node->complexType, $settings); |
|
|
|
$publication_node = $node = new SimpleXMLIterator('<attribute name="PUBLICATION" type="publication"/>'); |
|
$this->publication_fields($publication_node, $settings, $section, true); |
|
} |
|
|
|
private function participant_name_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
if (isset($node->attributes()["maxOccurs"])) { |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["PARTICIPANT_NAME_ADDITIONAL"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
|
|
$key = $this->arrayName2StringName($settings["name"]); |
|
$key = $this->getKeyFromNameString($key); |
|
$n = $node; |
|
unset($n->attributes()["maxOccurs"]); |
|
$child = $n; |
|
|
|
$object = $this->makeAdd2GUUEObject([ |
|
"child" => $child->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => true |
|
]); |
|
|
|
$content = self::get($this->info["valori"], $key); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => !empty($content) ? $object : "empty", |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
], |
|
[ |
|
"name" => "button", |
|
"required" => false, |
|
"type" => "button", |
|
"title" => __guue('Aggiungi partecipante'), |
|
"attrs" => [ |
|
"onClick" => "eForms2.add2GUUE('#{$id}', '{$object}')", |
|
"class" => "btn btn-block btn-primary" |
|
] |
|
], |
|
]; |
|
$this->fields = $this->makeArray($settings["name"], $inputs, $this->fields); |
|
return false; |
|
} else { |
|
$s = $settings; |
|
$inputs = [ |
|
[ |
|
"info" => [ |
|
"title" => __guue('Partecipante'), |
|
"style" => "subtitle" |
|
] |
|
], |
|
[ |
|
"size" => "col-12", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"])), |
|
"title" => $this->translate("PARTICIPANT_NAME"), |
|
"type" => "text", |
|
"required" => true |
|
], |
|
]; |
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
} |
|
|
|
private function radio_for_directives(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_DIRECTIVES"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
|
|
$object1 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->element[0]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$object2 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->element[1]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$object3 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->element[2]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$object4 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->element[3]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
if ($value == "DIRECTIVE_2014_23_EU") { |
|
$selected = $object1; |
|
} else if ($value == "DIRECTIVE_2014_24_EU") { |
|
$selected = $object2; |
|
} else if ($value == "DIRECTIVE_2014_25_EU") { |
|
$selected = $object3; |
|
} else if ($value == "DIRECTIVE_2009_81_EC") { |
|
$selected = $object4; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("DIRECTIVE_2014_23_EU"), |
|
"required" => true, |
|
"group_validate" => true, |
|
"type" => "radio", |
|
"value" => "DIRECTIVE_2014_23_EU", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object1}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("DIRECTIVE_2014_24_EU"), |
|
"required" => true, |
|
"group_validate" => true, |
|
"type" => "radio", |
|
"value" => "DIRECTIVE_2014_24_EU", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object2}')" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("DIRECTIVE_2014_25_EU"), |
|
"required" => true, |
|
"group_validate" => true, |
|
"type" => "radio", |
|
"value" => "DIRECTIVE_2014_25_EU", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object3}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("DIRECTIVE_2009_81_EC"), |
|
"required" => true, |
|
"group_validate" => true, |
|
"type" => "radio", |
|
"value" => "DIRECTIVE_2009_81_EC", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object4}')", |
|
] |
|
]; |
|
|
|
if (isset($node->attributes()["minOccurs"]) && (int) $node->attributes()["minOccurs"] == 0) { |
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("NO_DIRECTIVE"), |
|
"required" => true, |
|
"group_validate" => true, |
|
"type" => "radio", |
|
"value" => "NO_DIRECTIVE", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();", |
|
] |
|
]; |
|
} |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function ac_price_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$this->ignored_keys[] = "AC_PRICE"; |
|
$this->ignored_keys[] = "RADIO_FOR_AC_PRICE"; |
|
if (isset($node->complexType)) { |
|
if ($this->minOccursRadio($node->complexType->sequence, $settings, $section, "AC_PRICE", __guue('Specifica peso'))) { |
|
return false; |
|
} |
|
$this->getField($section, $node->complexType->sequence, $settings); |
|
} else { |
|
$s = $settings; |
|
$inputs = [ |
|
[ |
|
"size" => "col-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"title" => $this->translate("AC_PRICE"), |
|
"type" => "checkbox", |
|
"required" => true, |
|
"rel" => ["S","0","0","Checked"] |
|
], |
|
]; |
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
} |
|
} |
|
|
|
private function radio_for_ac_price(SimpleXMLIterator $node, array $settings = [], String $section) { |
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_AC_PRICE"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
|
|
$object1 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->element[0]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$object2 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->element[1]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
if ($value == "AC_PRICE") { |
|
$selected = $object1; |
|
} else if ($value == "AC_CRITERIA") { |
|
$selected = $object2; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"])), |
|
"object" => "empty", |
|
"title" => $this->translate("AC_PRICE"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "AC_PRICE", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object1}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("AC_CRITERIA"), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "AC_CRITERIA", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object2}')" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function radio_for_pt_award_contract_without_prior_publication(SimpleXMLIterator $node, array $settings = [], String $section) { |
|
$s = $settings; |
|
|
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_PT_AWARD_CONTRACT_WITHOUT_PUBLICATION"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
|
|
$object1 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->element[0]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$object2 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->element[1]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
if ($value == "PT_AWARD_CONTRACT_WITHOUT_PUBLICATION") { |
|
$selected = $object1; |
|
} else if ($value == "PT_AWARD_CONTRACT_WITHOUT_CALL") { |
|
$selected = $object2; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName(array_merge($s["name"])), |
|
"object" => "empty", |
|
"title" => $this->translate("PT_AWARD_CONTRACT_WITHOUT_PUBLICATION",$this->arrayName2StringName($s["name"])), |
|
"required" => true, |
|
"group_validate" => true, |
|
"type" => "radio", |
|
"value" => "PT_AWARD_CONTRACT_WITHOUT_PUBLICATION", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object1}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("PT_AWARD_CONTRACT_WITHOUT_CALL",$this->arrayName2StringName($s["name"])), |
|
"required" => true, |
|
"group_validate" => true, |
|
"type" => "radio", |
|
"value" => "PT_AWARD_CONTRACT_WITHOUT_CALL", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object2}')" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function radio_for_pt_negotiated_without_publication(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
|
|
$s = $settings; |
|
$s["name"] = array_merge($settings["name"], ["RADIO_FOR_PT_NEGOTIATED_WITHOUT_PUBLICATION"]); |
|
|
|
$name = $this->arrayName2StringName($s["name"]); |
|
$id = uniqid($this->slugify($this->arrayName2StringName($s["name"]))); |
|
$key = $this->getKeyFromNameString($name); |
|
|
|
$value = self::get($this->info["valori"], $this->getKeyFromNameString($name)); |
|
$selected = "empty"; |
|
|
|
$object1 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->element[0]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
$object2 = $this->makeAdd2GUUEObject([ |
|
"child" => $node->element[1]->asXML(), |
|
"settings" => $settings, |
|
"section" => $section, |
|
"xsd" => $this->xsd, |
|
"hidden-header" => true, |
|
'multiple' => false |
|
]); |
|
|
|
if ($value == "PT_NEGOTIATED_WITHOUT_PUBLICATION") { |
|
$selected = $object1; |
|
} else if ($value == "PT_AWARD_CONTRACT_WITHOUT_CALL") { |
|
$selected = $object2; |
|
} |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("PT_NEGOTIATED_WITHOUT_PUBLICATION", $this->arrayName2StringName($s["name"])), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "PT_NEGOTIATED_WITHOUT_PUBLICATION", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object1}')", |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"size" => "col-sm-12", |
|
"name" => $this->arrayName2StringName($s["name"]), |
|
"object" => "empty", |
|
"title" => $this->translate("PT_AWARD_CONTRACT_WITHOUT_CALL",$this->arrayName2StringName($s["name"])), |
|
"required" => true, |
|
"type" => "radio", |
|
"value" => "PT_AWARD_CONTRACT_WITHOUT_CALL", |
|
"attrs" => [ |
|
"onClick" => "$('#{$id}').empty();eForms2.add2GUUE('#{$id}','{$object2}')" |
|
] |
|
]; |
|
|
|
$inputs[] = [ |
|
"name" => "container", |
|
"type" => "div", |
|
"key" => $key, |
|
"object" => $selected, |
|
"attrs" => [ |
|
"id" => $id |
|
] |
|
]; |
|
|
|
$this->fields = $this->makeArray($s["name"], $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function radio_for_d_proc_restricted(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$name = array_merge($settings["name"], ["RADIO_FOR_D_PROC_RESTRICTED"]); |
|
$name = $this->arrayName2StringName($name); |
|
|
|
$inputs = [ |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "__£__", |
|
"title" => $this->translate("D_PROC_RESTRICTED"), |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "__£__", |
|
"title" => $this->translate("D_PROC_NEGOTIATED_PRIOR_CALL_COMPETITION"), |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "__£__", |
|
"title" => $this->translate("D_PROC_COMPETITIVE_DIALOGUE"), |
|
"required" => true |
|
], |
|
[ |
|
"name" => $name, |
|
"size" => "col-sm-12", |
|
"type" => "radio", |
|
"object" => "empty", |
|
"value" => "__£__", |
|
"title" => $this->translate("NO_RADIO_FOR_D_PROC_RESTRICTED"), |
|
"required" => true |
|
], |
|
]; |
|
|
|
$this->fields = $this->makeArray(array_merge($settings["name"], ["RADIO_FOR_D_PROC_OPEN"]), $inputs, $this->fields); |
|
return false; |
|
} |
|
|
|
private function cond_for_opening_tenders_node(SimpleXMLIterator $node, array $settings = [], String $section) |
|
{ |
|
$settings["required"] = true; |
|
$this->getField($section, $node->sequence, $settings); |
|
} |
|
|
|
private function country_origin_node(SimpleXMLIterator $node, array $settings = [], $section) { |
|
$inputs = [ |
|
"info" => [ |
|
"title" => $this->translate("COUNTRY_ORIGIN"), |
|
"style" => "subtitle" |
|
] |
|
]; |
|
$this->non_published_node($node, $settings, $section, $inputs); |
|
$this->getField($section, $node->complexType, $settings); |
|
} |
|
}
|
|
|