id=$id+0; $this->fetch_data(); } function fetch_data() { global $include_path; $this->info=array(); $this->info['fields']=array(); if(!$this->id) return; $req="select * from authperso where id_authperso=". $this->id; $resultat=pmb_mysql_query($req); if (pmb_mysql_num_rows($resultat)) { $r=pmb_mysql_fetch_object($resultat); $this->info['id']= $r->id_authperso; $this->info['name']= $r->authperso_name; $this->info['onglet_num']= $r->authperso_notice_onglet_num; $this->info['isbd_script']= $r->authperso_isbd_script; $this->info['view_script']= $r->authperso_view_script; $this->info['opac_search']= $r->authperso_opac_search; $this->info['opac_multi_search']= $r->authperso_gestion_multi_search; $this->info['gestion_search']= $r->authperso_gestion_search; $this->info['gestion_multi_search']= $r->authperso_gestion_multi_search; $this->info['comment']= $r->authperso_comment; $this->info['onglet_name']=""; $req="SELECT * FROM notice_onglet where id_onglet=".$r->authperso_notice_onglet_num; $resultat=pmb_mysql_query($req); if (pmb_mysql_num_rows($resultat)) { $r_onglet=pmb_mysql_fetch_object($resultat); $this->info['onglet_name']= $r_onglet->onglet_name; } } } function get_form() { global $authperso_form_tpl,$msg,$charset; $tpl=$authperso_form_tpl; if($this->id){ $tpl=str_replace('!!msg_title!!',$msg['admin_authperso_form_edit'],$tpl); $tpl=str_replace('!!delete!!',"", $tpl); $name=$this->info['name']; $isbd_script=$this->info['isbd_script']; $view_script=$this->info['view_script']; $comment=$this->info['comment']; }else{ $tpl=str_replace('!!msg_title!!',$msg['admin_authperso_form_add'],$tpl); $tpl_objet=""; $tpl=str_replace('!!delete!!',"",$tpl); $name=""; $isbd_script=""; $view_script=""; $comment=""; } $notice_onglet_list=gen_liste ("SELECT * FROM notice_onglet", "id_onglet", "onglet_name", "notice_onglet", "", $this->info['onglet_num'], 0, $msg["admin_authperso_notice_onglet_no"],0,$msg["admin_authperso_notice_onglet_sel"]); $multi_search_checked=""; if($this->info['opac_multi_search']) $search_multi_checked= " checked='checked' "; $search_simple_checked[$this->info['opac_search']+0]= " checked='checked' "; $search_tpl=" ".$msg["admin_authperso_opac_search_no"]." ".$msg["admin_authperso_opac_search_yes"]." ".$msg["admin_authperso_opac_search_yes_active"]." "; if($this->info['gestion_multi_search']) $search_multi_checked_gestion= " checked='checked' "; $search_simple_checked_gestion[$this->info['gestion_search']+0]= " checked='checked' "; $search_tpl_gestion=" ".$msg["admin_authperso_gestion_search_no"]." ".$msg["admin_authperso_gestion_search_yes"]." ".$msg["admin_authperso_gestion_search_yes_active"]." "; $fields_options=""; $fields_options_view=""; $tpl=str_replace('!!name!!',htmlentities($name, ENT_QUOTES, $charset),$tpl); $tpl=str_replace('!!notice_onglet_list!!',$notice_onglet_list,$tpl); $tpl=str_replace('!!fields_options!!',$fields_options,$tpl); $tpl=str_replace('!!isbd_script!!',htmlentities($isbd_script, ENT_QUOTES, $charset),$tpl); $tpl=str_replace('!!fields_options_view!!',$fields_options_view,$tpl); $tpl=str_replace('!!view_script!!',htmlentities($view_script, ENT_QUOTES, $charset),$tpl); $tpl=str_replace('!!search_simple!!',$search_tpl,$tpl); $tpl=str_replace('!!search_multi!!',$search_multi_checked,$tpl); $tpl=str_replace('!!search_simple_gestion!!',$search_tpl_gestion,$tpl); $tpl=str_replace('!!search_multi_gestion!!',$search_multi_checked_gestion,$tpl); $tpl=str_replace('!!comment!!',htmlentities($comment, ENT_QUOTES, $charset),$tpl); $tpl=str_replace('!!id_authperso!!',$this->id,$tpl); return $tpl; } function save() { global $dbh; global $name; global $notice_onglet; global $isbd_script; global $view_script; global $comment; global $search_simple; global $search_multi; global $gestion_search_simple; global $gestion_search_multi; $notice_onglet+=0; $fields=" authperso_name='".$name."', authperso_notice_onglet_num='".$notice_onglet."', authperso_isbd_script='".$isbd_script."' , authperso_view_script='".$view_script."' , authperso_opac_search='".$search_simple."', authperso_opac_multi_search='".$search_multi."', authperso_gestion_search='".$gestion_search_simple."', authperso_gestion_multi_search='".$gestion_search_multi."', authperso_comment='".$comment."' "; if(!$this->id){ // Ajout $req="INSERT INTO authperso SET $fields "; pmb_mysql_query($req, $dbh); $this->id = pmb_mysql_insert_id($dbh); } else { $req="UPDATE authperso SET $fields where id_authperso=".$this->id; pmb_mysql_query($req, $dbh); } $this->fetch_data(); } function delete() { global $dbh; $p_perso=new custom_parametres_perso("authperso","authperso",$id_authperso,"./admin.php?categ=authorities&sub=authperso&auth_action=edition&id_authperso=".$this->id,$option_navigation,$option_visibilite); $p_perso->delete_all(); $req="DELETE from authperso WHERE id_authperso=".$this->id; pmb_mysql_query($req, $dbh); $this->id=0; $this->fetch_data(); } function fields_edition() { global $msg; $option_visibilite=array(); $option_visibilite["multiple"]="block"; $option_visibilite["obligatoire"]="block"; $option_visibilite["search"]="block"; $option_visibilite["export"]="none"; $option_visibilite["exclusion"]="none"; $option_visibilite["opac_sort"]="none"; $option_navigation=array(); $option_navigation['msg_title']=$msg["admin_menu_docs_perso_authperso"]." : ".$this->info['name']; $option_navigation['url_return_list']="./admin.php?categ=authorities&sub=authperso&auth_action="; $option_navigation['msg_return_list']=$msg["admin_authperso_return_list"]; $p_perso=new custom_parametres_perso("authperso","authperso",$this->id,"./admin.php?categ=authorities&sub=authperso&auth_action=edition&id_authperso=".$this->id,$option_navigation,$option_visibilite); $p_perso->proceed(); } function get_fields_options(){ global $msg; $p_perso=new custom_parametres_perso("authperso","authperso",$this->id); return $p_perso->get_selector_options_1().""; } function get_gestion() { global $msg; $tpl="