recursif=$recursif; $this->id = $id; $this->getData(); } else { // la notice n'existe pas $this->id = 0; $this->getData(); } } // --------------------------------------------------------------- // getData() : récupération infos titre_uniforme // --------------------------------------------------------------- function getData() { global $dbh,$msg; $this->name = ''; $this->tonalite = ''; $this->comment =''; $this->distrib=array(); $this->ref=array(); $this->subdiv=array(); $this->import_denied=0; $this->form = ''; $this->date =''; $this->date_date =''; $this->characteristic = ''; $this->intended_termination = ''; $this->intended_audience = ''; $this->context = ''; $this->coordinates = ''; $this->equinox = ''; $this->subject = ''; $this->place = ''; $this->history = ''; $this->num_author = ''; $this->display = ''; if($this->id) { $requete = "SELECT * FROM titres_uniformes WHERE tu_id='".addslashes($this->id)."' LIMIT 1 "; $result = @mysql_query($requete, $dbh); if(mysql_num_rows($result)) { $temp = mysql_fetch_object($result); $this->id = $temp->tu_id; $this->name = $temp->tu_name; $this->tonalite = $temp->tu_tonalite; $this->comment = $temp->tu_comment ; $this->import_denied = $temp->tu_import_denied; $this->form = $temp->tu_forme; $this->date = $temp->tu_date; $this->date_date = $temp->tu_date_date; $this->characteristic = $temp->tu_caracteristique; $this->intended_termination = $temp->tu_completude; $this->intended_audience = $temp->tu_public; $this->context = $temp->tu_contexte; $this->coordinates = $temp->tu_coordonnees; $this->equinox = $temp->tu_equinoxe; $this->subject = $temp->tu_sujet; $this->place = $temp->tu_lieu; $this->history = $temp->tu_histoire; $this->num_author = $temp->tu_num_author; $requete = "SELECT * FROM tu_distrib WHERE distrib_num_tu='$this->id' order by distrib_ordre"; $result = mysql_query($requete, $dbh); if(mysql_num_rows($result)) { while(($param=mysql_fetch_object($result))) { $this->distrib[]["label"]=$param->distrib_name; } } $requete = "SELECT * FROM tu_ref WHERE ref_num_tu='$this->id' order by ref_ordre"; $result = mysql_query($requete, $dbh); if(mysql_num_rows($result)) { while(($param=mysql_fetch_object($result))) { $this->ref[]["label"]=$param->ref_name; } } $requete = "SELECT * FROM tu_subdiv WHERE subdiv_num_tu='$this->id' order by subdiv_ordre"; $result = mysql_query($requete, $dbh); if(mysql_num_rows($result)) { while(($param=mysql_fetch_object($result))) { $this->subdiv[]["label"]=$param->subdiv_name; } } $this->display = $this->name; if($this->date){ $this->display.=" (".$this->date.")"; } if($this->num_author){ $tu_auteur = new auteur($this->num_author); $libelle[] = $tu_auteur->display; $this->display.=" / ".$tu_auteur->rejete." ".$tu_auteur->name; } } else { // pas trouvé avec cette clé $this->id = 0; } } } // --------------------------------------------------------------- // print_resume($level) : affichage d'informations sur le titre uniforme // --------------------------------------------------------------- function print_resume($level = 2) { global $msg,$charset; if(!$this->id) return; // adaptation par rapport au niveau de détail souhaité switch ($level) { // case x : case 2 : default : global $titre_uniforme_level2_display; $titre_uniforme_display = $titre_uniforme_level2_display; break; } $print = $titre_uniforme_display; $print_distrib=$print_ref=$print_subdiv=''; foreach ($this->distrib as $field) { if($print_distrib) $print_distrib.="; "; $print_distrib.=$field["label"]; } foreach ($this->ref as $field) { if($print_ref) $print_ref.="; "; $print_ref.=$field["label"]; } foreach ($this->subdiv as $field) { if($print_subdiv) $print_subdiv.="; "; $print_subdiv.=$field["label"]; } // remplacement des champs $print = str_replace("!!id!!", $this->id, $print); $print = str_replace("!!name!!", $this->name, $print); $tu_auteur = new auteur($this->num_author); $print = str_replace("!!auteur!!", ($this->num_author?"

".$msg["aut_oeuvre_form_auteur"]." : ".htmlentities($tu_auteur->display,ENT_QUOTES,$charset)."

":""), $print); $print = str_replace("!!forme!!", ($this->form?"

".$msg["aut_oeuvre_form_forme"]." : ".htmlentities($this->form,ENT_QUOTES,$charset)."

":""), $print); $print = str_replace("!!date!!", ($this->date?"

".$msg["aut_oeuvre_form_date"]." : ".htmlentities($this->date,ENT_QUOTES,$charset)."

":""), $print); $print = str_replace("!!sujet!!", ($this->subject?"

".$msg["aut_oeuvre_form_sujet"]." : ".htmlentities($this->subject,ENT_QUOTES,$charset)."

":""), $print); $print = str_replace("!!lieu!!", ($this->place?"

".$msg["aut_oeuvre_form_lieu"]." : ".htmlentities($this->place,ENT_QUOTES,$charset)."

":""), $print); $completude=''; if($this->intended_termination==1){ $completude="Oeuvre finie"; } elseif($this->intended_termination==2){ $completude="Oeuvre infinie"; } $print= str_replace("!!completude!!", ($completude?"

".$msg["aut_oeuvre_form_completude"]." : ".htmlentities($completude,ENT_QUOTES,$charset)."

":""), $print); $print = str_replace("!!public!!", ($this->intended_audience?"

".$msg["aut_oeuvre_form_public"]." : ".htmlentities($this->intended_audience,ENT_QUOTES,$charset)."

":""), $print); $print = str_replace("!!histoire!!", ($this->history?"

".$msg["aut_oeuvre_form_histoire"]." : ".htmlentities($this->history,ENT_QUOTES,$charset)."

":""), $print); $print = str_replace("!!contexte!!", ($this->context?"

".$msg["aut_oeuvre_form_contexte"]." : ".htmlentities($this->context,ENT_QUOTES,$charset)."

":""), $print); $print = str_replace("!!distribution!!", ($print_distrib?"

Distribution (oeuvre musicale) : ".htmlentities($print_distrib,ENT_QUOTES,$charset)."

":""), $print); $print = str_replace("!!reference!!", ($print_ref?"

Référence (oeuvre musicale) : ".htmlentities($print_ref,ENT_QUOTES,$charset)."

":""), $print); $print = str_replace("!!tonalite!!", ($this->tonalite?"

Tonalité (oeuvre musicale) : ".htmlentities($this->tonalite,ENT_QUOTES,$charset)."

":""), $print); $print = str_replace("!!subdivision!!", ($print_subdiv?"

Subdivision de forme : ".htmlentities($print_subdiv,ENT_QUOTES,$charset)."

":""), $print); $print = str_replace("!!coordonnees!!", ($this->coordinates?"

".$msg["aut_oeuvre_form_coordonnees"]." : ".htmlentities($this->context,ENT_QUOTES,$charset)."

":""), $print); $print = str_replace("!!equinoxe!!", ($this->equinox?"

".$msg["aut_oeuvre_form_equinoxe"]." : ".htmlentities($this->equinox,ENT_QUOTES,$charset)."

":""), $print); $print = str_replace("!!caracteristique!!", ($this->characteristic?"

".$msg["aut_oeuvre_form_caracteristique"]." : ".htmlentities($this->characteristic,ENT_QUOTES,$charset)."

":""), $print); $print = str_replace("!!aut_comment!!", $this->comment, $print); return $print; } function gen_input_selection($label,$form_name,$item,$values,$what_sel,$class='saisie-80em' ) { global $msg; $select_prop = "scrollbars=yes, toolbar=no, dependent=yes, resizable=yes"; $link="'./select.php?what=$what_sel&caller=$form_name&p1=f_".$item."_code!!num!!&p2=f_".$item."!!num!!&deb_rech='+".pmb_escape()."(this.form.f_".$item."!!num!!.value), '$what_sel', 400, 400, -2, -2, '$select_prop'"; $size_item=strlen($item)+2; $script_js=" "; //template de zone de texte pour chaque valeur $aff="
!!bouton_parcourir!! !!bouton_ajouter!!
\n"; if($what_sel)$bouton_parcourir=""; else $bouton_parcourir=""; $aff= str_replace('!!bouton_parcourir!!', $bouton_parcourir, $aff); $template=$script_js."
"; $template.="
"; $num=0; if(!$values[0]) $values[0] = array("id"=>"","label"=>""); foreach($values as $value) { $label_element=$value["label"]; $id_element=$value["id"]; $temp= str_replace('!!id_element!!', $id_element, $aff); $temp= str_replace('!!label_element!!', $label_element, $temp); $temp= str_replace('!!num!!', $num, $temp); if(!$num) $temp= str_replace('!!bouton_ajouter!!', " ", $temp); else $temp= str_replace('!!bouton_ajouter!!', "", $temp); $template.=$temp; $num++; } $template.=""; $template.="
"; return $template; } // --------------------------------------------------------------- // search_form() : affichage du form de recherche // --------------------------------------------------------------- function search_form() { global $user_query; global $msg; $user_query = str_replace ('!!user_query_title!!', $msg[357]." : ".$msg["aut_menu_titre_uniforme"] , $user_query); $user_query = str_replace ('!!action!!', './autorites.php?categ=titres_uniformes&sub=reach&id=', $user_query); $user_query = str_replace ('!!add_auth_msg!!', $msg["aut_titre_uniforme_ajouter"] , $user_query); $user_query = str_replace ('!!add_auth_act!!', './autorites.php?categ=titres_uniformes&sub=titre_uniforme_form', $user_query); $user_query = str_replace ('', "".$msg["aut_titre_uniforme_derniers_crees"]."", $user_query); print pmb_bidi($user_query) ; } // --------------------------------------------------------------- // do_isbd() : génération de l'isbd du titre uniforme (AFNOR Z 44-061 de 1986) // --------------------------------------------------------------- function do_isbd() { global $msg; $this->tu_isbd=""; if(!$this->id) return; if($this->num_author){ $tu_auteur = new auteur ($this->num_author); $this->tu_isbd = $tu_auteur->display.". "; } if($this->name){ $this->tu_isbd.= $this->name; } return $this->tu_isbd; } } // class auteur