id = intval($id); } public function get_model_class_name() { return $this->model_class_name; } public function get_object_instance() { $model_class_name = $this->get_model_class_name(); $object_instance = new $model_class_name($this->id); if(method_exists($model_class_name, 'set_controller')) { $model_class_name::set_controller($this); } return $object_instance; } public function get_url_base() { return $this->url_base; } public function set_url_base($url_base) { $this->url_base = $url_base; } public function set_action($action) { $this->action = $action; } protected function display_error_message() { global $charset; error_message('', htmlentities($this->dom_1->getComment($this->error_message), ENT_QUOTES, $charset), 1, ''); } public function has_rights() { global $gestion_acces_active, $gestion_acces_user_notice; $acces_m=1; if ($gestion_acces_active==1 && $gestion_acces_user_notice==1) { $ac= new acces(); $this->dom_1= $ac->setDomain(1); $acces_m = $this->get_acces_m(); } if ($acces_m==0) { return false; } return true; } protected function get_redirection_form() { global $current_module; return "
get_permalink()."\" style=\"display:none\">
"; } public function proceed_explnum_form() { } public function proceed_explnum_update() { global $msg; global $f_notice, $f_bulletin, $f_nom, $f_url; global $conservervignette, $f_statut_chk, $f_explnum_statut; //Vérification des champs personalisés $p_perso=new parametres_perso("explnum"); $perso_=$p_perso->show_editable_fields($this->id); $error_convo=0; for ($i=0; $iread_form_fields_perso($p["NAME"]); switch($p["NAME"]){ case "Identificacion": switch($value){ case "ISBN134": if(!isISBN13($bul_cb)) { error_message_history($msg["notice_champs_perso"],$msg["bul_convo_isbn_error"] ,1); $error_convo=1; } break; case "ISBN103": if(!isISBN10($bul_cb)) { error_message_history($msg["notice_champs_perso"],$msg["bul_convo_isbn_error"] ,1); $error_convo=1; } break; case "ISBN81": if(!isISSN($bul_cb)) { error_message_history($msg["notice_champs_perso"],$msg["bul_convo_isbn_error"] ,1); $error_convo=1; } break; case "ISBN247": $code_reg = preg_replace('/-|\.| /', '', $bul_cb); if (strlen($code_reg)!==26){ error_message_history($msg["notice_champs_perso"],$msg["bul_convo_isbn_error"] ,1); $error_convo=1; } break; case "OTROS": break; } break; case "Precio": if ($value!=""){ if (is_numeric($value)){ if ($value>999.99){ error_message_history($msg["notice_champs_perso"],$msg["notices_convo_price_max_error"] ,1); $error_convo=1; } }else{ error_message_history($msg["notice_champs_perso"],$msg["notices_convo_price_format_error"] ,1); $error_convo=1; } } break; } } if ($error_convo==0){ //-----------------FIN LLIUREX--------------- $nberrors=$p_perso->check_submited_fields(); if ($nberrors) { error_message_history($msg["notice_champs_perso"],$p_perso->error_message,1); exit(); } $explnum = new explnum($this->id); $explnum->set_p_perso($p_perso); $explnum->mise_a_jour($f_notice, $f_bulletin, $f_nom, $f_url, $this->get_permalink(), $conservervignette, $f_statut_chk, $f_explnum_statut); } } public function proceed_explnum_delete() { global $msg; print "
".$msg['catalog_notices_suppression']."
"; $expl = new explnum($this->id); $expl->delete(); print $this->get_redirection_form(); } public function get_id() { return $this->id; } public function get_back_url() { global $base_path; global $user_input; global $page, $nbr_lignes; $short_referer = $base_path."/".substr($_SERVER["HTTP_REFERER"], strrpos($_SERVER["HTTP_REFERER"], "/")+1); if(strpos($short_referer, '&sub=replace')) { if(isset($_SESSION['PMB_STAKE_SHORT_REFERER']) && $_SESSION['PMB_STAKE_SHORT_REFERER']) { $this->back_url = $_SESSION['PMB_STAKE_SHORT_REFERER']; } } if(!$this->back_url) { $_SESSION['PMB_STAKE_SHORT_REFERER'] = $base_path."/".substr($_SERVER["HTTP_REFERER"], strrpos($_SERVER["HTTP_REFERER"], "/")+1); if($this->id && $_SESSION['PMB_STAKE_SHORT_REFERER'] == $this->get_permalink()) { $this->back_url = $this->get_permalink(); } else { $this->back_url = $this->get_url_base()."&sub=reach"; if($user_input) $this->back_url .= "&user_input=".rawurlencode(stripslashes($user_input)); if($page) $this->back_url .= "&page=".$page; if($nbr_lignes) $this->back_url .= "&nbr_lignes=".$nbr_lignes; } } return $this->back_url; } public function get_delete_url() { global $user_input; global $page, $nbr_lignes; $this->delete_url = $this->get_url_base()."&sub=delete&id=".$this->id; if($user_input) $this->delete_url .= "&user_input=".rawurlencode(stripslashes($user_input)); if($page) $this->delete_url .= "&page=".$page; if($nbr_lignes) $this->delete_url .= "&nbr_lignes=".$nbr_lignes; return $this->delete_url; } protected function get_cataloging_scheme_link_script($entity) { global $cataloging_scheme_id, $cataloging_scheme_level; if (!isset($cataloging_scheme_level)) { $cataloging_scheme_level = 0; } $rdf_dom_mapping_links = onto_pmb_entities_mapping::get_entity_rdf_dom_mapping_links($entity); $rdf_dom_mapping_link_types = onto_pmb_entities_mapping::get_entity_rdf_dom_mapping_link_types($entity); $scheme = new frbr_cataloging_scheme($cataloging_scheme_id); $entity_links = $scheme->get_links(); if (!isset($entity_links[$cataloging_scheme_level])) { return ''; } $entity_links_types = $scheme->get_links_types(); $link = ""; if (isset($rdf_dom_mapping_links[$entity_links[$cataloging_scheme_level]])) { $link = $rdf_dom_mapping_links[$entity_links[$cataloging_scheme_level]]; } $link_type = ""; $link_type_value = ""; if (isset($rdf_dom_mapping_link_types[$entity_links[$cataloging_scheme_level]]) && !empty($entity_links_types[$cataloging_scheme_level])) { $link_type = $rdf_dom_mapping_link_types[$entity_links[$cataloging_scheme_level]]; $link_type_value = $entity_links_types[$cataloging_scheme_level]; } return ' '; } public function get_document_title() { return ''; } public function set_document_title() { // Titre de la page $title = $this->get_document_title(); if($title) { print ''; } } }