id=$id*1; $this->id_parent=0; $notice_relations = notice_relations_collection::get_object_instance($this->id); $parents = $notice_relations->get_parents(); if(isset($parents[$pmb_nomenclature_record_children_link][0])) { $this->id_parent=$parents[$pmb_nomenclature_record_children_link][0]->get_linked_notice(); $this->nomenclature_record = new nomenclature_record_child_ui($this->id); } else { $this->nomenclature_record = new nomenclature_record_formations_ui($this->id); } } // end of member function __construct public function create_record_child($id_parent){ $this->nomenclature_record = new nomenclature_record_child_ui(); return $this->nomenclature_record->create_record_child($id_parent); } public function get_form($duplicate = false){ $args = "num_record:".($duplicate ? 0 : $this->id); if($this->id_parent){ $args.=",child_detail :\"".addslashes(encoding_normalize::json_encode($this->nomenclature_record->record_child->get_data()))."\""; }else{ $args.=",record_formations :\"".addslashes(encoding_normalize::json_encode($this->nomenclature_record->record_formations->get_data($duplicate)))."\""; } $div = nomenclature_datastore::get_form(); $div.= ""; return $div."
"; } public function save_form(){ if(!$this->id)return; // pas id de notice $this->nomenclature_record->save_form(); } public function delete(){ if(!$this->id)return; // pas id de notice $this->nomenclature_record->delete(); } public function get_isbd(){ return $this->nomenclature_record->get_isbd(); } public static function get_index($id) { global $pmb_nomenclature_record_children_link; $notice_relations = notice_relations_collection::get_object_instance($id); $parents = $notice_relations->get_parents(); if(isset($parents[$pmb_nomenclature_record_children_link][0])) { return nomenclature_record_child_ui::get_index($id); }else{ return nomenclature_record_formations_ui::get_index($id); } } } // end of nomenclature_record_formations