";
}elseif($depliable == 2){
$template="$simili_search_script_all
";
}else{
$template="
$case_a_cocher";
if ($icon) {
$info_bulle_icon=str_replace("!!niveau_biblio!!",$biblio_doc[$this->notice->niveau_biblio],$msg["info_bulle_icon"]);
$info_bulle_icon=str_replace("!!typdoc!!",$tdoc->table[$this->notice->typdoc],$info_bulle_icon);
$template.="
";
}
$template.="
!!heada!! ".$this->notice_header_doclink;
if($opac_allow_simili_search){
$simili_search_script="";
$expl_voisin_search_script="";
}
}
$template.="!!CONTENU!!
!!SUITE!!
";
if($this->notice->niveau_biblio != "b"){
$this->permalink = "index.php?lvl=notice_display&id=".$this->notice_id;
}else {
$this->permalink = "index.php?lvl=bulletin_display&id=".$this->bulletin_id;
}
if($opac_show_social_network){
if($this->notice_header_without_html == ""){
$this->do_header_without_html();
}
$template_in.="
";
}
if($img_tag) $li_tags="
$img_tag ";
if($basket || $img_tag || $opac_notice_enrichment){
$template_in.="
";
if ($basket) $template_in.="$basket ";
if($opac_notice_enrichment){
if($what =='ISBD') $template_in.="".$msg['ISBD']." ";
else $template_in.="".$msg['Public']." ";
}
$template_in.="
$li_tags
";
}
if($what =='ISBD') $template_in.="
!!ISBD!!
!!PUBLIC!!
";
else $template_in.="
!!PUBLIC!!
!!ISBD!!
"
;
$template_in.="
";
if (($opac_avis_display_mode==1) && (($this->avis_allowed && $this->avis_allowed !=2)|| ($_SESSION["user_code"] && $this->avis_allowed ==2))) $this->affichage_avis_detail=$this->avis_detail();
// Serials : différence avec les monographies on affiche [périodique] et [article] devant l'ISBD
if ($this->notice->niveau_biblio =='s') {
if(!$flag_no_get_bulletin){
if($this->get_bulletins()){
if ($lvl == "notice_display")$voir_bulletins="
".$msg["see_bull"]." ";
else $voir_bulletins="
".$msg["see_bull"]." ";
}
}
$template_in = str_replace('!!ISBD!!', "
[".$msg['isbd_type_perio']."] $voir_bulletins !!ISBD!!", $template_in);
$template_in = str_replace('!!PUBLIC!!', "
[".$msg['isbd_type_perio']."] $voir_bulletins !!PUBLIC!!", $template_in);
} elseif ($this->notice->niveau_biblio =='a') {
$template_in = str_replace('!!ISBD!!', "
[".$msg['isbd_type_art']."] !!ISBD!!", $template_in);
$template_in = str_replace('!!PUBLIC!!', "
[".$msg['isbd_type_art']."] !!PUBLIC!!", $template_in);
} elseif ($this->notice->niveau_biblio =='b') {
$template_in = str_replace('!!ISBD!!', "
[".$msg['isbd_type_bul']."] !!ISBD!!", $template_in);
$template_in = str_replace('!!PUBLIC!!', "
[".$msg['isbd_type_bul']."] !!PUBLIC!!", $template_in);
}
$template_in.=$this->get_serialcirc_form_actions();
$template_in = str_replace('!!ISBD!!', $this->notice_isbd, $template_in);
$template_in = str_replace('!!PUBLIC!!', $this->notice_public, $template_in);
$template_in = str_replace('!!id!!', $this->notice_id, $template_in);
$this->do_image($template_in,$depliable);
$this->result = str_replace('!!id!!', $this->notice_id, $template);
if($this->notice_header_doclink){
$this->result = str_replace('!!heada!!', $this->notice_header_without_doclink, $this->result);
}elseif($this->notice_header)
$this->result = str_replace('!!heada!!', $this->notice_header, $this->result);
else $this->result = str_replace('!!heada!!', '', $this->result);
$this->result = str_replace('!!CONTENU!!', $template_in, $this->result);
if($opac_allow_simili_search){
$this->affichage_simili_search_head="
".$expl_voisin_search_script."
".$simili_search_script;
}
if ($this->affichage_resa_expl || $this->affichage_avis_detail || $this->affichage_simili_search_head) $this->result = str_replace('!!SUITE!!', $this->affichage_resa_expl.$this->affichage_avis_detail.$this->affichage_simili_search_head, $this->result);
else $this->result = str_replace('!!SUITE!!', '', $this->result);
} // fin genere_simple($depliable=1, $what='ISBD')
// génération de l'affichage public----------------------------------------
function do_public($short=0,$ex=1) {
global $dbh;
global $msg;
global $tdoc;
global $charset;
global $memo_notice;
global $opac_notice_affichage_class;
$this->notice_public= $this->genere_in_perio ();
if(!$this->notice_id) return;
/* début modif */
// Notices parentes
//$this->notice_public.=$this->parents;
/* fin modif */
$this->notice_public .= "
";
//Titre
// constitution de la mention de titre
if ($this->notice->serie_name) {
$this->notice_public.= "".$msg['tparent_start']." ".inslink($this->notice->serie_name, str_replace("!!id!!", $this->notice->tparent_id, $this->lien_rech_serie));;
if ($this->notice->tnvol) $this->notice_public .= ', '.$this->notice->tnvol;
$this->notice_public .=" ";
}
$this->notice_public .= "".$msg['title']." : ";
$this->notice_public .= "".$this->notice->tit1 ;
//if($tdoc->table[$this->notice->typdoc]) $this->notice_public .= " [".$tdoc->table[$this->notice->typdoc]."]";
if ($this->notice->tit4) $this->notice_public .= " : ".$this->notice->tit4 ;
if ($this->notice->tit3) $this->notice_public .= " = ".$this->notice->tit3 ;
if ($this->notice->mention_edition) $this->notice_public .= " - ".$this->notice->mention_edition ;
$this->notice_public.=" ";
//Préparation des champs personnalisés
if (!$this->p_perso->no_special_fields) {
if(!$this->memo_perso_) $this->memo_perso_=$this->p_perso->show_fields($this->notice_id);
}
if(!$this->memo_perso_){
$this->memo_perso_["FIELDS"]=array();
}
//PPN
foreach ( $this->memo_perso_["FIELDS"] as $i => $value ) {
$p=$this->memo_perso_["FIELDS"][$i];
if ($p["AFF"] && ($p["NAME"] == "ppn001")){
$this->notice_public.="".strip_tags($p["TITRE"])." ".str_replace("Sudoc : ","",$p["AFF"])." ";
unset($this->memo_perso_["FIELDS"][$i]);
break;
}
}
//ISSN
// ISBN ou NO. commercial
$issn=$this->notice->code;
$mes_pp= new parametres_perso("notices");
$mes_pp->get_values($this->notice_id);
$values = $mes_pp->values;
foreach ( $values as $field_id => $vals ) {
if($mes_pp->t_fields[$field_id]["NAME"] == "cp_issn_autres") {
foreach ( $vals as $value ) {
if($issn)$issn.=". ";
$issn.=$mes_pp->get_formatted_output(array($value),$field_id);//Val
}
}
}
if ($issn) $this->notice_public .= "".$msg['code_start']." ".htmlentities($issn,ENT_QUOTES, $charset)." ";
//Auteurs
if ($this->auteurs_tous) $this->notice_public .= "".$msg['auteur_start']." ".$this->auteurs_tous." ";
if ($this->congres_tous) $this->notice_public .= "".$msg['congres_aff_public_libelle']." ".$this->congres_tous." ";
//Editeurs
foreach ( $this->memo_perso_["FIELDS"] as $i => $value ) {
$p=$this->memo_perso_["FIELDS"][$i];
if ($p["AFF"] && ($p["NAME"] == "cp_editeurs")){
$this->notice_public.="".strip_tags($p["TITRE"])." ".$p["AFF"]." ";
unset($this->memo_perso_["FIELDS"][$i]);
break;
}
}
//if ($this->notice->tit2) $this->notice_public .= "".$msg['other_title_t2']." : ".$this->notice->tit2." " ;
//if ($this->notice->tit3) $this->notice_public .= "".$msg['other_title_t3']." : ".$this->notice->tit3." " ;
//if ($tdoc->table[$this->notice->typdoc]) $this->notice_public .= "".$msg['typdocdisplay_start']." ".$tdoc->table[$this->notice->typdoc]." ";
// mention d'édition
//if ($this->notice->mention_edition) $this->notice_public .= "".$msg['mention_edition_start']." ".$this->notice->mention_edition." ";
// Années de publication
if ($this->notice->year)
$this->notice_public .= "".($charset != "utf-8"?"Années de publication":utf8_encode("Années de publication"))." : ".$this->notice->year." " ;
// $annee est vide si ajoutée avec l'éditeur, donc si pas éditeur, on l'affiche ici
/*$this->notice_public .= $annee ;
if ($this->notice->ed1_id) {
$editeur = new publisher($this->notice->ed1_id);
$this->publishers[]=$editeur;
$this->notice_public .= "".$msg['editeur_start']." ".inslink($editeur->display, str_replace("!!id!!", $this->notice->ed1_id, $this->lien_rech_editeur))." " ;
if ($annee) {
$this->notice_public .= $annee ;
$annee = "" ;
}
}*/
// Autre editeur
/*if ($this->notice->ed2_id) {
$editeur_2 = new publisher($this->notice->ed2_id);
$this->publishers[]=$editeur;
$this->notice_public .= "".$msg['other_editor']." ".inslink($editeur_2->display, str_replace("!!id!!", $this->notice->ed2_id, $this->lien_rech_editeur))." " ;
}*/
// Numérotation
foreach ( $this->memo_perso_["FIELDS"] as $i => $value ) {
$p=$this->memo_perso_["FIELDS"][$i];
if ($p["AFF"] && ($p["NAME"] == "numerotation207")){
$this->notice_public.="".strip_tags($p["TITRE"])." ".$p["AFF"]." ";
unset($this->memo_perso_["FIELDS"][$i]);
break;
}
}
// Pays de publication
foreach ( $this->memo_perso_["FIELDS"] as $i => $value ) {
$p=$this->memo_perso_["FIELDS"][$i];
if ($p["AFF"] && ($p["NAME"] == "paysdepublication102")){
$this->notice_public.="".strip_tags($p["TITRE"])." ".$p["AFF"]." ";
unset($this->memo_perso_["FIELDS"][$i]);
break;
}
}
// Langues
if (count($this->langues)) {
$this->notice_public .= "".$msg['537']." : ".$this->construit_liste_langues($this->langues);
if (count($this->languesorg)) $this->notice_public .= " ".$msg['711']." : ".$this->construit_liste_langues($this->languesorg);
$this->notice_public.=" ";
} elseif (count($this->languesorg)) {
$this->notice_public .= "".$msg['711']." : ".$this->construit_liste_langues($this->languesorg)." ";
}
// Périodicité
foreach ( $this->memo_perso_["FIELDS"] as $i => $value ) {
$p=$this->memo_perso_["FIELDS"][$i];
if ($p["AFF"] && ($p["NAME"] == "periodicite110")){
$this->notice_public.="".strip_tags($p["TITRE"])." ".$p["AFF"]." ";
unset($this->memo_perso_["FIELDS"][$i]);
break;
}
}
// Note générale
if ($this->notice->n_gen) $zoneNote = nl2br(htmlentities($this->notice->n_gen,ENT_QUOTES, $charset));
if ($zoneNote) $this->notice_public .= "".$msg['n_gen_start']." ".$zoneNote." ";
// Périodicité
if (!$this->p_perso->no_special_fields) {
if(!$this->memo_perso_) $this->memo_perso_=$this->p_perso->show_fields($this->notice_id);
foreach ( $this->memo_perso_["FIELDS"] as $i => $value ) {
$p=$this->memo_perso_["FIELDS"][$i];
if ($p["AFF"] && ($p["NAME"] == "annexes320")){
$this->notice_public.="".strip_tags($p["TITRE"])." ".$p["AFF"]." ";
unset($this->memo_perso_["FIELDS"][$i]);
break;
}
}
}
// Catégories
if ($this->categories_toutes) $this->notice_public .= "Sujets : ".$this->categories_toutes." ";
// Titre clé
foreach ( $this->memo_perso_["FIELDS"] as $i => $value ) {
$p=$this->memo_perso_["FIELDS"][$i];
if ($p["AFF"] && ($p["NAME"] == "titrecle530")){
$this->notice_public.="".strip_tags($p["TITRE"])." ".$p["AFF"]." ";
unset($this->memo_perso_["FIELDS"][$i]);
break;
}
}
// Titre abrégé
foreach ( $this->memo_perso_["FIELDS"] as $i => $value ) {
$p=$this->memo_perso_["FIELDS"][$i];
if ($p["AFF"] && ($p["NAME"] == "titreabrege531")){
$this->notice_public.="".strip_tags($p["TITRE"])." ".$p["AFF"]." ";
unset($this->memo_perso_["FIELDS"][$i]);
break;
}
}
// Titre(s) parallèle(s)
foreach ( $this->memo_perso_["FIELDS"] as $i => $value ) {
$p=$this->memo_perso_["FIELDS"][$i];
if ($p["AFF"] && ($p["NAME"] == "titreparallele510")){
$this->notice_public.="".strip_tags($p["TITRE"])." ".$p["AFF"]." ";
unset($this->memo_perso_["FIELDS"][$i]);
break;
}
}
// Titre(s) de couverture
foreach ( $this->memo_perso_["FIELDS"] as $i => $value ) {
$p=$this->memo_perso_["FIELDS"][$i];
if ($p["AFF"] && ($p["NAME"] == "titredecouverture512")){
$this->notice_public.="".strip_tags($p["TITRE"])." ".$p["AFF"]." ";
unset($this->memo_perso_["FIELDS"][$i]);
break;
}
}
// Titre(s) courant(s)
foreach ( $this->memo_perso_["FIELDS"] as $i => $value ) {
$p=$this->memo_perso_["FIELDS"][$i];
if ($p["AFF"] && ($p["NAME"] == "titrecourant515")){
$this->notice_public.="".strip_tags($p["TITRE"])." ".$p["AFF"]." ";
unset($this->memo_perso_["FIELDS"][$i]);
break;
}
}
// Titre(s) historique(s)
foreach ( $this->memo_perso_["FIELDS"] as $i => $value ) {
$p=$this->memo_perso_["FIELDS"][$i];
if ($p["AFF"] && ($p["NAME"] == "titrehistorique520")){
$this->notice_public.="".strip_tags($p["TITRE"])." ".$p["AFF"]." ";
unset($this->memo_perso_["FIELDS"][$i]);
break;
}
}
// Autres titres
foreach ( $this->memo_perso_["FIELDS"] as $i => $value ) {
$p=$this->memo_perso_["FIELDS"][$i];
if ($p["AFF"] && ($p["NAME"] == "titreautres517")){
$this->notice_public.="".strip_tags($p["TITRE"])." ".$p["AFF"]." ";
unset($this->memo_perso_["FIELDS"][$i]);
break;
}
}
// Titre développé
foreach ( $this->memo_perso_["FIELDS"] as $i => $value ) {
$p=$this->memo_perso_["FIELDS"][$i];
if ($p["AFF"] && ($p["NAME"] == "titredeveloppe532")){
$this->notice_public.="".strip_tags($p["TITRE"])." ".$p["AFF"]." ";
unset($this->memo_perso_["FIELDS"][$i]);
break;
}
}
//Lien notices
if($this->parents){
$this->notice_public.=$this->parents;
}
$this->genere_notice_childs();
if($this->notice_childs){
$this->notice_public.=$this->notice_childs;
}
// Origine de la notice
foreach ( $this->memo_perso_["FIELDS"] as $i => $value ) {
$p=$this->memo_perso_["FIELDS"][$i];
if ($p["AFF"] && ($p["NAME"] == "originenotice")){
$this->notice_public.="".strip_tags($p["TITRE"])." ".$p["AFF"]." ";
unset($this->memo_perso_["FIELDS"][$i]);
break;
}
}
// collection
/*if ($this->notice->nocoll) $affnocoll = " ".str_replace("!!nocoll!!", $this->notice->nocoll, $msg['subcollection_details_nocoll']) ;
else $affnocoll = "";
if($this->notice->subcoll_id) {
$subcollection = new subcollection($this->notice->subcoll_id);
$collection = new collection($this->notice->coll_id);
$this->collections[]=$collection;
$this->notice_public .= "".$msg['coll_start']." ".inslink($collection->name, str_replace("!!id!!", $this->notice->coll_id, $this->lien_rech_collection))." ".$collection->collection_web_link." " ;
$this->notice_public .= "".$msg['subcoll_start']." ".inslink($subcollection->name, str_replace("!!id!!", $this->notice->subcoll_id, $this->lien_rech_subcollection)) ;
$this->notice_public .=$affnocoll." ";
} elseif ($this->notice->coll_id) {
$collection = new collection($this->notice->coll_id);
$this->collections[]=$collection;
$this->notice_public .= "".$msg['coll_start']." ".inslink($collection->isbd_entry, str_replace("!!id!!", $this->notice->coll_id, $this->lien_rech_collection)) ;
$this->notice_public .=$affnocoll." ".$collection->collection_web_link." ";
}*/
// Titres uniformes
/*if($this->notice->tu_print_type_2) {
$this->notice_public.=
"".$msg['titre_uniforme_aff_public']."
".$this->notice->tu_print_type_2." ";
}*/
// zone de la collation
/*if($this->notice->npages) {
if ($this->notice->niveau_biblio<>"a") {
$this->notice_public .= "".$msg['npages_start']." ".$this->notice->npages." ";
} else {
$this->notice_public .= "".$msg['npages_start_perio']." ".$this->notice->npages." ";
}
}*/
//if ($this->notice->ill) $this->notice_public .= "".$msg['ill_start']." ".$this->notice->ill." ";
//if ($this->notice->size) $this->notice_public .= "".$msg['size_start']." ".$this->notice->size." ";
//if ($this->notice->accomp) $this->notice_public .= "".$msg['accomp_start']." ".$this->notice->accomp." ";
//if ($this->notice->prix) $this->notice_public .= "".$msg['price_start']." ".$this->notice->prix." ";
if (!$short) $this->notice_public .= $this->aff_suite() ;
else $this->notice_public.=$this->genere_in_perio();
$this->notice_public.="
\n";
//etat des collections
if ($this->notice->niveau_biblio=='s' && $this->notice->niveau_hierar==1) $this->notice_public.=$this->affichage_etat_collections();
// exemplaires, résas et compagnie
if ($ex) $this->affichage_resa_expl = $this->aff_resa_expl() ;
return;
} // fin do_public($short=0,$ex=1)
// génération du header----------------------------------------------------
function do_header($id_tpl=0) {
global $opac_notice_reduit_format ;
global $opac_url_base, $msg, $charset;
global $memo_notice;
global $opac_visionneuse_allow;
global $opac_url_base;
global $charset;
global $tdoc;
$this->notice_header="";
if(!$this->notice_id) return;
$type_reduit = substr($opac_notice_reduit_format,0,1);
$notice_tpl_header="";
if ($type_reduit=="H" || $id_tpl){
if(!$id_tpl) $id_tpl=substr($opac_notice_reduit_format,2);
if($id_tpl){
$tpl = new notice_tpl_gen($id_tpl);
$notice_tpl_header=$tpl->build_notice($this->notice_id);
if($notice_tpl_header){
$this->notice_header=$notice_tpl_header;
return;
}
}
}
if ($type_reduit=="E" || $type_reduit=="P" ) {
// peut-être veut-on des personnalisés ?
$perso_voulus_temp = substr($opac_notice_reduit_format,2) ;
if ($perso_voulus_temp!="") $perso_voulus = explode(",",$perso_voulus_temp);
}
if ($type_reduit=="E") {
// zone de l'éditeur
if ($this->notice->ed1_id) {
$editeur = new publisher($this->notice->ed1_id);
$editeur_reduit = $editeur->display ;
if ($this->notice->year) $editeur_reduit .= " (".$this->notice->year.")";
} elseif ($this->notice->year) {
// année mais pas d'éditeur et si pas un article
if($this->notice->niveau_biblio != 'a' && $this->notice->niveau_hierar != 2) $editeur_reduit = $this->notice->year." ";
}
} else $editeur_reduit = "" ;
//Champs personalisés à ajouter au réduit
if (!$this->p_perso->no_special_fields) {
if (count($perso_voulus)) {
$this->p_perso->get_values($this->notice_id) ;
for ($i=0; $i
p_perso->get_formatted_output($this->p_perso->values[$perso_voulus[$i]],$perso_voulus[$i])." " ;
}
$perso_voulu_aff=trim($perso_voulu_aff);
} else $perso_voulu_aff = "" ;
} else $perso_voulu_aff = "" ;
//Si c'est un depouillement, ajout du titre et bulletin
if($this->notice->niveau_biblio == 'a' && $this->notice->niveau_hierar == 2 && $this->parent_title) {
$aff_perio_title="".$msg[in_serial]." ".$this->parent_title.", ".$this->parent_numero." (".($this->parent_date?$this->parent_date:"[".$this->parent_aff_date_date."]").") ";
}
//Si c'est une notice de bulletin ajout du titre et bulletin
if($this->notice->niveau_biblio == 'b' && $this->notice->niveau_hierar == 2) {
$aff_bullperio_title = " ".($this->parent_date?sprintf($msg["bul_titre_perio"],$this->parent_title):sprintf($msg["bul_titre_perio"],$this->parent_title.", ".$this->parent_numero." [".$this->parent_aff_date_date."]"))." ";
} else $aff_bullperio_title="";
// récupération du titre de série
// constitution de la mention de titre
if($this->notice->serie_name) {
$this->notice_header = $this->notice->serie_name;
if($this->notice->tnvol) $this->notice_header .= ', '.$this->notice->tnvol;
} elseif ($this->notice->tnvol) $this->notice_header .= $this->notice->tnvol;
if ($this->notice_header) $this->notice_header .= ". ".$this->notice->tit1 ;
else $this->notice_header = $this->notice->tit1;
//Titre
//if($tdoc->table[$this->notice->typdoc]) $this->notice_header .= " [".$tdoc->table[$this->notice->typdoc]."]";
if ($this->notice->tit4) $this->notice_header .= " : ".$this->notice->tit4 ;
if ($this->notice->tit3) $this->notice_header .= " = ".$this->notice->tit3 ;
if ($this->notice->mention_edition) $this->notice_header .= " - ".$this->notice->mention_edition ;
$this->notice_header .= $aff_bullperio_title;
//$this->notice_header_without_html = $this->notice_header;
$this->notice_header = "";
//on ne propose à Zotero que les monos et les articles...
if($this->notice->niveau_biblio == "m" ||($this->notice->niveau_biblio == "a" && $this->notice->niveau_hierar == 2)) {
$this->notice_header =str_replace("!!zoteroNotice!!"," notice='".$this->notice_id."' ",$this->notice_header);
}else $this->notice_header =str_replace("!!zoteroNotice!!","",$this->notice_header);
$this->notice_header = 'statut_notice)?'title="'.htmlentities($this->statut_notice,ENT_QUOTES,$charset).'"':'').'> '.$this->notice_header;
$notice_header_suite = "";
//if ($type_reduit=="T" && $this->notice->tit4) $notice_header_suite = " : ".$this->notice->tit4;
//if ($type_reduit!='3' && $this->auteurs_principaux) $notice_header_suite .= " / ".$this->auteurs_principaux;
//if ($editeur_reduit) $notice_header_suite .= " / ".$editeur_reduit ;
//if ($perso_voulu_aff) $notice_header_suite .= " / ".$perso_voulu_aff ;
//if ($aff_perio_title) $notice_header_suite .= " ".$aff_perio_title;
//$this->notice_header_without_html .= $notice_header_suite ;
//$this->notice_header .= $notice_header_suite."";
//Un span de trop ?
$this->notice_header .= $notice_header_suite;
if ($this->notice->niveau_biblio =='m' || $this->notice->niveau_biblio =='s') {
switch($type_reduit) {
case '1':
if ($this->notice->year != '') $this->notice_header.=' ('.htmlentities($this->notice->year,ENT_QUOTES,$charset).')';
break;
case '2':
if ($this->notice->year != '' && $this->notice->niveau_biblio!='b') $this->notice_header.=' ('.htmlentities($this->notice->year, ENT_QUOTES, $charset).')';
if ($this->notice->code != '') $this->notice_header.=' / '.htmlentities($this->notice->code, ENT_QUOTES, $charset);
break;
default:
break;
}
}
//$this->notice_header.=" notice->notice_id."\" style=\"visibility:hidden\"> ";
$this->notice_header_doclink="";
if ($this->notice->lien) {
if(!$this->notice->eformat) $info_bulle=$msg["open_link_url_notice"];
else $info_bulle=$this->notice->eformat;
// ajout du lien pour les ressources électroniques
$this->notice_header_doclink .= " notice->lien."\" target=\"__LINK__\">";
$this->notice_header_doclink .= " notice_header_doclink .= " alt=\"";
$this->notice_header_doclink .= $info_bulle;
$this->notice_header_doclink .= "\" title=\"";
$this->notice_header_doclink .= $info_bulle;
$this->notice_header_doclink .= "\" />";
$this->notice_header_doclink .= " ";
}
if ($this->notice->niveau_biblio == 'b') {
$sql_explnum = "SELECT explnum_id, explnum_nom, explnum_nomfichier, explnum_url FROM explnum, bulletins WHERE bulletins.num_notice = ".$this->notice_id." AND bulletins.bulletin_id = explnum.explnum_bulletin order by explnum_id";
} else {
$sql_explnum = "SELECT explnum_id, explnum_nom, explnum_nomfichier,explnum_url FROM explnum WHERE explnum_notice = ".$this->notice_id." order by explnum_id";
}
$explnums = mysql_query($sql_explnum);
$explnumscount = mysql_num_rows($explnums);
if ( (is_null($this->dom_2) && $this->visu_explnum && (!$this->visu_explnum_abon || ($this->visu_explnum_abon && $_SESSION["user_code"]))) || ($this->rights & 16) ) {
if ($explnumscount == 1) {
$explnumrow = mysql_fetch_object($explnums);
if ($explnumrow->explnum_nomfichier){
if($explnumrow->explnum_nom == $explnumrow->explnum_nomfichier) $info_bulle=$msg["open_doc_num_notice"].$explnumrow->explnum_nomfichier;
else $info_bulle=$explnumrow->explnum_nom;
}elseif ($explnumrow->explnum_url){
if($explnumrow->explnum_nom == $explnumrow->explnum_url) $info_bulle=$msg["open_link_url_notice"].$explnumrow->explnum_url;
else $info_bulle=$explnumrow->explnum_nom;
}
$this->notice_header_doclink .= " ";
if ($opac_visionneuse_allow && $this->docnum_allowed){
$this->notice_header_doclink .="
explnum_id.");return false;\" alt='$alt' title='$alt'>";
}else{
$this->notice_header_doclink .= " explnum_id."\" target=\"__LINK__\">";
}
$this->notice_header_doclink .= " notice_header_doclink .= " alt=\"";
$this->notice_header_doclink .= htmlentities($info_bulle,ENT_QUOTES,$charset);
$this->notice_header_doclink .= "\" title=\"";
$this->notice_header_doclink .= htmlentities($info_bulle,ENT_QUOTES,$charset);
$this->notice_header_doclink .= "\">";
$this->notice_header_doclink .= " ";
} elseif ($explnumscount > 1) {
$explnumrow = mysql_fetch_object($explnums);
$info_bulle=$msg["info_docs_num_notice"];
$this->notice_header_doclink .= " ";
}
}
//coins pour Zotero
$coins_span=$this->gen_coins_span();
$this->notice_header.=$coins_span;
$this->notice_header_without_doclink=$this->notice_header;
$this->notice_header.=$this->notice_header_doclink;
$memo_notice[$this->notice_id]["header_without_doclink"]=$this->notice_header_without_doclink;
$memo_notice[$this->notice_id]["header_doclink"]= $this->notice_header_doclink;
$memo_notice[$this->notice_id]["header"]=$this->notice_header;
$memo_notice[$this->notice_id]["niveau_biblio"] = $this->notice->niveau_biblio;
$this->notice_header_with_link=inslink($this->notice_header, str_replace("!!id!!", $this->notice_id, $this->lien_rech_notice)) ;
} // fin do_header()
function aff_suite() {
global $msg;
global $charset,$opac_categories_affichage_ordre,$lang,$pmb_keyword_sep;
global $opac_allow_tags_search, $opac_permalink, $opac_url_base;
// afin d'éviter de recalculer un truc déjà calculé...
if ($this->affichage_suite_flag) return $this->affichage_suite ;
//Espace
//$ret.=" ";
// toutes indexations
$ret_index = "";
// Affectation du libellé mots clés ou tags en fonction de la recherche précédente
//if($opac_allow_tags_search == 1) $libelle_key = $msg['tags'];
//else $libelle_key = $msg['motscle_start'];
// indexation libre
//$mots_cles = $this->do_mots_cle() ;
//if($mots_cles) $ret_index.= "".$libelle_key." ".nl2br($mots_cles)." ";
// indexation interne
/*if($this->notice->indexint) {
$indexint = new indexint($this->notice->indexint);
$ret_index.= "".$msg['indexint_start']." ".inslink($indexint->name, str_replace("!!id!!", $this->notice->indexint, $this->lien_rech_indexint))." ".nl2br(htmlentities($indexint->comment,ENT_QUOTES, $charset))." " ;
}*/
//if ($ret_index) {
// $ret.=$ret_index;
//$ret.=" ";
//}
// résumé
//if($this->notice->n_resume) $ret .= "".$msg['n_resume_start']." ".nl2br($this->notice->n_resume)." ";
// note de contenu
//if($this->notice->n_contenu) $ret .= "".$msg['n_contenu_start']." ".nl2br(htmlentities($this->notice->n_contenu,ENT_QUOTES, $charset))." ";
//Champs personalisés
$perso_aff = "" ;
/*if (!$this->p_perso->no_special_fields) {
// $this->memo_perso_ permet au affichages personalisés dans notice_affichage_ex de gagner du temps
if(!$this->memo_perso_) $this->memo_perso_=$this->p_perso->show_fields($this->notice_id);
for ($i=0; $imemo_perso_["FIELDS"]); $i++) {
$p=$this->memo_perso_["FIELDS"][$i];
if ($p['OPAC_SHOW'] && $p["AFF"]){
if($p["NAME"] == "ppn001"){
$perso_aff .="".strip_tags($p["TITRE"])." ".str_replace("Sudoc : ","",$p["AFF"])." ";
}else{
$perso_aff .="".strip_tags($p["TITRE"])." ".$p["AFF"]." ";
}
}
}
}*/
$ret .= $perso_aff ;
/*if ($this->notice->lien) {
//$ret.=" ";
$ret.="".$msg["lien_start"]." " ;
if (substr($this->notice->eformat,0,3)=='RSS') {
$ret .= affiche_rss($this->notice->notice_id) ;
} else {
if (strlen($this->notice->lien)>80) {
$ret.="notice->lien."\" target=\"top\" class='lien856'>".htmlentities(substr($this->notice->lien, 0, 80),ENT_QUOTES,$charset)." [...]";
} else {
$ret.="notice->lien."\" target=\"top\" class='lien856'>".htmlentities($this->notice->lien,ENT_QUOTES,$charset)." ";
}
//$ret.=" ";
}
$ret.="";
if ($this->notice->eformat && substr($this->notice->eformat,0,3)!='RSS') $ret.="".$msg["eformat_start"]." ".htmlentities($this->notice->eformat,ENT_QUOTES,$charset)." ";
}*/
// Permalink avec Id
if ($opac_permalink) {
if($this->notice->niveau_biblio != "b"){
$ret.= "".$msg["notice_permalink"]." ".substr($opac_url_base."index.php?lvl=notice_display&id=".$this->notice_id,0,80)." ";
}else {
$ret.= "".$msg["notice_permalink"]." ".substr($opac_url_base."index.php?lvl=bulletin_display&id=".$this->bulletin_id,0,80)." ";
}
}
//PCP
$ret_index = "";
$requete = "select * from (
select libelle_thesaurus, c0.libelle_categorie as categ_libelle, c0.comment_public, n0.id_noeud , n0.num_parent, langue_defaut,id_thesaurus, if(c0.langue = '".$lang."',2, if(c0.langue= thesaurus.langue_defaut ,1,0)) as p, ordre_vedette, ordre_categorie
FROM noeuds as n0, categories as c0,thesaurus,notices_categories
where notices_categories.num_noeud=n0.id_noeud and n0.id_noeud = c0.num_noeud and n0.num_thesaurus=id_thesaurus and
notices_categories.notcateg_notice=".$this->notice_id." AND id_thesaurus='2' order by id_thesaurus, n0.id_noeud, p desc
) as list_categ group by id_noeud";
if ($opac_categories_affichage_ordre==1) $requete .= " order by ordre_vedette, ordre_categorie";
$result_categ=@mysql_query($requete);
if ($result_categ && mysql_num_rows($result_categ)) {
$ret_index .= "PCP : ";
$first=true;
while(($res_categ = mysql_fetch_object($result_categ))) {
$categ_id=$res_categ->id_noeud ;
$libelle_categ=$res_categ->categ_libelle ;
$comment_public=$res_categ->comment_public ;
// Si il y a présence d'un commentaire affichage du layer
$result_com = categorie::zoom_categ($categ_id, $comment_public);
$libelle_aff_complet = inslink($libelle_categ, str_replace("!!id!!", $categ_id, $this->lien_rech_categ), $result_com['java_com']);
$libelle_aff_complet .= $result_com['zoom'];
if(!$first)$ret_index .=" ".$pmb_keyword_sep." ";
$first=false;
$ret_index .=$libelle_aff_complet;
}
$ret_index .= " ";
}
if ($ret_index) {
$ret.=$ret_index;
}
$this->affichage_suite = $ret ;
$this->affichage_suite_flag = 1 ;
return $ret;
} // fin aff_suite()
// Construction des parents-----------------------------------------------------
function do_parents() {
global $dbh;
global $msg;
global $charset;
global $memo_notice;
global $opac_notice_affichage_class;
global $relation_listup, $parents_to_childs ;
// Pour ne pas afficher en parents les liens transférer dans les childs
if (sizeof($parents_to_childs)>0) $clause = " AND relation_type not in ('".implode("','", $parents_to_childs)."') ";
// gestion des droits d'affichage des parents
if (is_null($this->dom_2)) {
$acces_j='';
$statut_j=',notice_statut';
$statut_r="and statut=id_notice_statut and ((notice_visible_opac=1 and notice_visible_opac_abon=0)".($_SESSION["user_code"]?" or (notice_visible_opac_abon=1 and notice_visible_opac=1)":"").")";
} else {
$acces_j = $this->dom_2->getJoin($_SESSION['id_empr_session'],4,'notice_id');
$statut_j = "";
$statut_r = "";
}
//Recherche des notices parentes
$requete="select linked_notice, relation_type, rank from notices_relations join notices on notice_id=linked_notice $acces_j $statut_j
where num_notice=".$this->notice_id." $clause $statut_r
order by relation_type,rank";
$result_linked=mysql_query($requete,$dbh);
//Si il y en a, on prépare l'affichage
if (!mysql_num_rows($result_linked)) {
$this->parents = "";
return ;
}
$this->parents = "";
if (!$relation_listup) $relation_listup=new marc_list("relationtypeup");
$r_type=array();
$ul_opened=false;
//Pour toutes les notices liées
while (($r_rel=mysql_fetch_object($result_linked))) {
if ($opac_notice_affichage_class) $notice_affichage=$opac_notice_affichage_class; else $notice_affichage="notice_affichage";
// if($memo_notice[$r_rel->linked_notice]["header"]) {
// $parent_notice->notice_header=$memo_notice[$r_rel->linked_notice]["header"];
// } else {
// $parent_notice=new $notice_affichage($r_rel->linked_notice,$this->liens,1,$this->to_print,1);
// $parent_notice->visu_expl = 0 ;
// $parent_notice->visu_explnum = 0 ;
// $parent_notice->do_header();
// }
if(!$memo_notice[$r_rel->linked_notice]["header_without_doclink"]) {
$parent_notice=new $notice_affichage($r_rel->linked_notice,$this->liens,1,$this->to_print,1);
$parent_notice->visu_expl = 0 ;
$parent_notice->visu_explnum = 0 ;
$parent_notice->do_header();
}
//Présentation différente si il y en a un ou plusieurs
/*if (mysql_num_rows($result_linked)==1) {
// si une seule, peut-être est-ce une notice de bulletin, aller cherche $this>bulletin_id
$this->parents.="".$relation_listup->table[$r_rel->relation_type]." ";
if ($this->lien_rech_notice) $this->parents.="";
//$this->parents.=$parent_notice->notice_header;
$this->parents.=$memo_notice[$r_rel->linked_notice]["header_without_doclink"];
if ($this->lien_rech_notice) $this->parents.=" ";
$this->parents.=" ";
// si une seule, peut-être est-ce une notice de bulletin, aller cherche $this->bulletin_id
$rqbull="select bulletin_id from bulletins where num_notice=".$this->notice_id;
$rqbullr=mysql_query($rqbull);
$rqbulld=@mysql_fetch_object($rqbullr);
$this->bulletin_id=$rqbulld->bulletin_id;
} else {*/
if (!$r_type[$r_rel->relation_type]) {
$r_type[$r_rel->relation_type]=1;
if ($ul_opened) $this->parents.="";
else {
//$this->parents.=" ";
$ul_opened=true;
}
$this->parents.="".$relation_listup->table[$r_rel->relation_type]." : \n";
//$this->parents.=" \n";
return ;
} // fin do_parents()
function genere_notice_childs() {
global $msg, $opac_notice_affichage_class ;
global $memo_notice;
global $relation_typedown;
/* début modif */
//Je ne veux que les liens vers les notices liées, pas de notices dépliables.
$this->seule=0;
/* fin modif */
$onglet_perso=new notice_onglets();
$this->antiloop[$this->notice_id]=true;
//Notices liées
if ($this->notice_childs) return $this->notice_childs;
if ((count($this->childs))&&(!$this->to_print)) {
if ($this->seule) $affichage="";
else $affichage = "".$msg[voir_contenu_detail]." ";
if (!$relation_typedown) $relation_typedown=new marc_list("relationtypedown");
reset($this->childs);
$affichage.=" ";
while (list($rel_type,$child_notices)=each($this->childs)) {
/* début modif */
$affichage="".$relation_typedown->table[$rel_type]." : \n";
if ($this->seule) {
} else $affichage.="";
/* fin modif */
$bool=false;
for ($i=0; (($iseule))); $i++) {
if (!$this->antiloop[$child_notices[$i]]) {
//if(!$this->seule && $memo_notice[$child_notices[$i]]["niveau_biblio"]!='b' && $memo_notice[$child_notices[$i]]["header"]) {
if(!$this->seule && $memo_notice[$child_notices[$i]]["niveau_biblio"]!='b' && $memo_notice[$child_notices[$i]]["header_without_doclink"]) {
//$affichage.="".$memo_notice[$child_notices[$i]]["header"]." ";
$affichage.="".$memo_notice[$child_notices[$i]]["header_without_doclink"]." ";
$bool=true;
} else if (!$memo_notice[$child_notices[$i]]["niveau_biblio"]) {
if($this->seule) $header_only=0; else $header_only=1;
if ($opac_notice_affichage_class) $child_notice=new $opac_notice_affichage_class($child_notices[$i],$this->liens,$this->cart_allowed,$this->to_print,$header_only);
else $child_notice=new notice_affichage($child_notices[$i],$this->liens,$this->cart_allowed,$this->to_print,$header_only);
if ($child_notice->notice->niveau_biblio!='b' || ($child_notice->notice->niveau_biblio=='b' && $this->notice->niveau_biblio != "s")) {
$child_notice->antiloop=$this->antiloop;
$child_notice->do_header();
if ($this->seule) {
$child_notice->do_isbd();
$child_notice->do_public();
if ($this->double_ou_simple == 2 ) $child_notice->genere_double(1, $this->premier) ;
$child_notice->genere_simple(1, $this->premier);
$child_notice->result=$onglet_perso->insert_onglets($child_notices[$i],$child_notice->result);
$affichage .= $child_notice->result ;
} else {
$child_notice->visu_expl = 0 ;
$child_notice->visu_explnum = 0 ;
/* début modif */
$affichage.="".$child_notice->notice_header." ";
/* fin modif */
}
$bool=true;
}
}
}
}
if ($bool) $aff_childs.=$affichage;
if ($bool && (count($child_notices)>100) && (!$this->seule)) {
$aff_childs.=" ";
if ($this->lien_rech_notice) $aff_childs.="";
$aff_childs.=sprintf($msg["see_all_childs"],20,count($child_notices),count($child_notices)-20);
if ($this->lien_rech_notice) $aff_childs.=" ";
}
/* début modif */
if ($this->seule) {
} else $aff_childs.=" \n \n";
/* fin modif */
}
$this->notice_childs=$aff_childs." ";
} else $this->notice_childs = "" ;
return $this->notice_childs ;
}
function affichage_etat_collections() {
global $msg;
global $pmb_etat_collections_localise;
if ($this->notice->niveau_biblio!='s' && $this->notice->niveau_hierar!=1) return "";
if($pmb_etat_collections_localise) {
$this->coll_state_list("",0,0,0,1);
} else {
$this->coll_state_list("",0,0,0,0);
}
if($this->coll_state_list_nbr) {
$affichage.= "".$msg["perio_etat_coll"]." ";
$affichage.=$this->coll_state_list_liste;
}
return $affichage;
} // fin affichage_etat_collections()
//Récupérer de l'affichage complet
function coll_state_list($base_url,$filtre,$debut=0,$page=0, $type=0) {
global $dbh, $msg,$nb_per_page_a_search, $tpl_collstate_surloc_liste, $tpl_collstate_surloc_liste_line;
global $opac_sur_location_activate, $opac_view_filter_class;
global $opac_collstate_order, $opac_url_base;
global $empr_location;
global $include_path;
global $script_coll_modif_ctles_is_include;
$tpl_collstate_liste="
Bibliothèque
Pôle de conservation
Cote
Etat de collections
Lacunes
Fonds spécifique
Notes
!!collstate_liste!!
";
if(!$script_coll_modif_ctles_is_include){
$script_coll_modif_ctles_is_include=true;
$tpl_collstate_liste="
".$tpl_collstate_liste;
}
$tpl_collstate_liste_line="
!!localisation!!
!!statut_libelle!!
!!cote!!
!!state_collections!!
!!lacune!!
!!cp_stat_fonds!!
!!note!!
";
$location=$filtre->location;
if($opac_view_filter_class){
$req="SELECT collstate_id , location_id, num_infopage, surloc_id FROM arch_statut, collections_state
LEFT JOIN arch_emplacement ON collstate_emplacement=archempla_id, docs_location
LEFT JOIN sur_location on docs_location.surloc_num=surloc_id
WHERE ".($location?"(location_id='$location') and ":"")."id_serial='".$this->notice_id."'
and location_id=idlocation and idlocation in(". implode(",",$opac_view_filter_class->params["nav_collections"]).")
and archstatut_id=collstate_statut
and ((archstatut_visible_opac=1 and archstatut_visible_opac_abon=0)".( $_SESSION["user_code"]? " or (archstatut_visible_opac_abon=1 and archstatut_visible_opac=1)" : "").")";
if ($opac_collstate_order) $req .= " ORDER BY ".$opac_collstate_order;
else $req .= " ORDER BY ".($type?"location_libelle, ":"")."archempla_libelle, collstate_cote";
} else {
$req="SELECT collstate_id , location_id, num_infopage, surloc_id FROM arch_statut, collections_state
LEFT JOIN docs_location ON location_id = idlocation
LEFT JOIN sur_location on docs_location.surloc_num=surloc_id
LEFT JOIN arch_emplacement ON collstate_emplacement=archempla_id
WHERE ".($location?"(location_id='$location') and ":"")."id_serial='".$this->notice_id."'
and archstatut_id=collstate_statut
and ((archstatut_visible_opac=1 and archstatut_visible_opac_abon=0)".( $_SESSION["user_code"]? " or (archstatut_visible_opac_abon=1 and archstatut_visible_opac=1)" : "").")";
if ($opac_collstate_order) $req .= " ORDER BY ".$opac_collstate_order;
else $req .= " ORDER BY ".($type?"location_libelle, ":"")."archempla_libelle, collstate_cote";
}
$myQuery = mysql_query($req, $dbh);
if(($this->coll_state_list_nbr = mysql_num_rows($myQuery))) {
$parity=1;
while(($coll = mysql_fetch_object($myQuery))) {
$my_collstate=new collstate($coll->collstate_id);
if ($parity++ % 2) $pair_impair = "even"; else $pair_impair = "odd";
$tr_javascript=" ";
$tr_surbrillance = "onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='".$pair_impair."'\" ";
$line = str_replace('!!tr_javascript!!',$tr_javascript , $tpl_collstate_liste_line);
$line = str_replace('!!tr_surbrillance!!',$tr_surbrillance , $line);
$line = str_replace('!!pair_impair!!',$pair_impair , $line);
if ($opac_sur_location_activate) {
$line = str_replace('!!surloc!!', $my_collstate->surloc_libelle, $line);
}
if ($my_collstate->num_infopage) {
if ($my_collstate->surloc_id != "0") $param_surloc="&surloc=".$my_collstate->surloc_id;
else $param_surloc="";
$collstate_location = "num_infopage."&location=".$my_collstate->location_id.$param_surloc."\" alt=\"".$msg['location_more_info']."\" title=\"".$msg['location_more_info']."\">".$my_collstate->location_libelle." ";
} else
$collstate_location = $my_collstate->location_libelle;
$line = str_replace('!!localisation!!', $collstate_location, $line);
$line = str_replace('!!cote!!', $my_collstate->cote, $line);
$line = str_replace('!!type_libelle!!', $my_collstate->type_libelle, $line);
$line = str_replace('!!emplacement_libelle!!', $my_collstate->emplacement_libelle, $line);
$line = str_replace('!!origine!!', $my_collstate->origine, $line);
if($empr_location==$my_collstate->location_id){
// modif des notes
$tpl_note_modif="
collstate_id."').style.display='block'; return false;\" href=\"#\">
collstate_id."').style.display='none';\" value='Annuler'>
collstate_id.",'collstate_note', document.getElementById('note_modif_text_".$coll->collstate_id."').value);
document.getElementById('note_modif_".$coll->collstate_id."').style.display='none';
document.getElementById('note_contens".$coll->collstate_id."').innerHTML=document.getElementById('note_modif_text_".$coll->collstate_id."').value;\" value='Enregistrer'>
";
// modif du statut de la collection
$on_change="coll_modif_update(".$coll->collstate_id.",'collstate_statut',document.getElementById('collstate_statut_".$coll->collstate_id."').value )";
$select = gen_liste("select archstatut_id, archstatut_gestion_libelle from arch_statut order by 2", "archstatut_id", "archstatut_gestion_libelle", "collstate_statut_".$coll->collstate_id, $on_change, $my_collstate->statut, "", "","","",0) ;
$line = str_replace('!!statut_libelle!!',$select, $line);
}else {
$tpl_coll_modif="";
$tpl_lacune_modif="";
$tpl_note_modif="";
$line = str_replace('!!statut_libelle!!', $my_collstate->statut_opac_libelle, $line);
}
$line = str_replace('!!state_collections!!',"".str_replace("\n"," ",$my_collstate->state_collections)."
".$tpl_coll_modif, $line);
$line = str_replace('!!archive!!',$my_collstate->archive, $line);
$line = str_replace('!!lacune!!', "".str_replace("\n"," ",$my_collstate->lacune)."
".$tpl_lacune_modif, $line);
//cp_stat_fonds
$requete="SELECT collstate_custom_small_text FROM collstate_custom_values JOIN collstate_custom ON collstate_custom_champ=idchamp WHERE collstate_custom_origine='".$coll->collstate_id."' AND name='cp_stat_fonds'";
$rescp=mysql_query($requete);
if($rescp && mysql_num_rows($rescp)){
$line = str_replace('!!cp_stat_fonds!!', "".str_replace("\n"," ",mysql_result($rescp,0,0))."
", $line);
}else{
$line = str_replace('!!cp_stat_fonds!!', "
", $line);
}
$line = str_replace('!!note!!', "".str_replace("\n"," ",$my_collstate->note)."
".$tpl_note_modif, $line);
$liste.=$line;
}
$liste = str_replace('!!collstate_liste!!',$liste , $tpl_collstate_liste);
$liste = str_replace('!!base_url!!', $base_url, $liste);
$liste = str_replace('!!location!!', $location, $liste);
} else {
$liste= $msg["collstate_no_collstate"];
}
$this->coll_state_list_liste=$liste;
}
// récupération des categories ------------------------------------------------------------------
function fetch_categories() {
global $opac_thesaurus, $opac_categories_categ_in_line, $pmb_keyword_sep, $opac_categories_affichage_ordre;
global $dbh;
global $lang,$opac_categories_show_only_last;
global $categories_memo,$libelle_thesaurus_memo;
global $categories_top;
$categ_repetables = array() ;
if(!count($categories_top)) {
$q = "select num_thesaurus,id_noeud from noeuds where num_parent in(select id_noeud from noeuds where autorite='TOP') ";
$r = mysql_query($q, $dbh);
while(($res = mysql_fetch_object($r))) {
$categories_top[]=$res->id_noeud;
}
}
$requete = "select * from (
select libelle_thesaurus, c0.libelle_categorie as categ_libelle, c0.comment_public, n0.id_noeud , n0.num_parent, langue_defaut,id_thesaurus, if(c0.langue = '".$lang."',2, if(c0.langue= thesaurus.langue_defaut ,1,0)) as p, ordre_vedette, ordre_categorie
FROM noeuds as n0, categories as c0,thesaurus,notices_categories
where notices_categories.num_noeud=n0.id_noeud and n0.id_noeud = c0.num_noeud and n0.num_thesaurus=id_thesaurus and
notices_categories.notcateg_notice=".$this->notice_id." AND id_thesaurus!='2' order by id_thesaurus, n0.id_noeud, p desc
) as list_categ group by id_noeud";
if ($opac_categories_affichage_ordre==1) $requete .= " order by ordre_vedette, ordre_categorie";
$result_categ=@mysql_query($requete);
if (mysql_num_rows($result_categ)) {
while(($res_categ = mysql_fetch_object($result_categ))) {
$libelle_thesaurus=$res_categ->libelle_thesaurus;
$categ_id=$res_categ->id_noeud ;
$libelle_categ=$res_categ->categ_libelle ;
$comment_public=$res_categ->comment_public ;
$num_parent=$res_categ->num_parent ;
$langue_defaut=$res_categ->langue_defaut ;
$categ_head=0;
if(in_array($categ_id,$categories_top))$categ_head=1;
if ($opac_categories_show_only_last || $categ_head) {
if ($opac_thesaurus) $catalog_form="[".$libelle_thesaurus."] ".$libelle_categ;
// Si il y a présence d'un commentaire affichage du layer
$result_com = categorie::zoom_categ($categ_id, $comment_public);
$libelle_aff_complet = inslink($libelle_categ, str_replace("!!id!!", $categ_id, $this->lien_rech_categ), $result_com['java_com']);
$libelle_aff_complet .= $result_com['zoom'];
if ($opac_thesaurus) $categ_repetables[$libelle_thesaurus][] =$libelle_aff_complet;
else $categ_repetables['MONOTHESAURUS'][] =$libelle_aff_complet ;
} else {
if(!$categories_memo[$categ_id]) {
$anti_recurse[$categ_id]=1;
$path_table='';
$requete = "
select id_noeud as categ_id,
num_noeud, num_parent as categ_parent, libelle_categorie as categ_libelle,
num_renvoi_voir as categ_see,
note_application as categ_comment,
if(langue = '".$lang."',2, if(langue= '".$langue_defaut."' ,1,0)) as p
FROM noeuds, categories where id_noeud ='".$num_parent."'
AND noeuds.id_noeud = categories.num_noeud
order by p desc limit 1";
$result=@mysql_query($requete);
if (mysql_num_rows($result)) {
$parent = mysql_fetch_object($result);
$anti_recurse[$parent->categ_id]=1;
$path_table[] = array(
'id' => $parent->categ_id,
'libelle' => $parent->categ_libelle);
// on remonte les ascendants
while (($parent->categ_parent)&&(!$anti_recurse[$parent->categ_parent])) {
$requete = "select id_noeud as categ_id, num_noeud, num_parent as categ_parent, libelle_categorie as categ_libelle, num_renvoi_voir as categ_see, note_application as categ_comment, if(langue = '".$lang."',2, if(langue= '".$langue_defaut."' ,1,0)) as p
FROM noeuds, categories where id_noeud ='".$parent->categ_parent."'
AND noeuds.id_noeud = categories.num_noeud
order by p desc limit 1";
$result=@mysql_query($requete);
if (mysql_num_rows($result)) {
$parent = mysql_fetch_object($result);
$anti_recurse[$parent->categ_id]=1;
$path_table[] = array(
'id' => $parent->categ_id,
'libelle' => $parent->categ_libelle);
} else {
break;
}
}
$anti_recurse=array();
} else $path_table=array();
// ceci remet le tableau dans l'ordre général->particulier
$path_table = array_reverse($path_table);
if(sizeof($path_table)) {
$temp_table='';
while(list($xi, $l) = each($path_table)) {
$temp_table[] = $l['libelle'];
}
$parent_libelle = join(':', $temp_table);
$catalog_form = $parent_libelle.':'.$libelle_categ;
} else {
$catalog_form = $libelle_categ;
}
// pour libellé complet mais sans le nom du thésaurus
$libelle_aff_complet = $catalog_form ;
if ($opac_thesaurus) $catalog_form="[".$libelle_thesaurus."] ".$catalog_form;
//$categ = new category($categ_id);
// Si il y a présence d'un commentaire affichage du layer
$result_com = categorie::zoom_categ($categ_id, $comment_public);
$libelle_aff_complet = inslink($libelle_aff_complet, str_replace("!!id!!", $categ_id, $this->lien_rech_categ), $result_com['java_com']);
$libelle_aff_complet .= $result_com['zoom'];
if ($opac_thesaurus) $categ_repetables[$libelle_thesaurus][] =$libelle_aff_complet;
else $categ_repetables['MONOTHESAURUS'][] =$libelle_aff_complet ;
$categories_memo[$categ_id]=$libelle_aff_complet;
$libelle_thesaurus_memo[$categ_id]=$libelle_thesaurus;
} else {
if ($opac_thesaurus) $categ_repetables[$libelle_thesaurus_memo[$categ_id]][] =$categories_memo[$categ_id];
else $categ_repetables['MONOTHESAURUS'][] =$categories_memo[$categ_id] ;
}
}
}
}
while (list($nom_tesaurus, $val_lib)=each($categ_repetables)) {
//c'est un tri par libellé qui est demandé
if ($opac_categories_affichage_ordre==0){
$tmp=array();
foreach ( $val_lib as $key => $value ) {
$tmp[$key]=strip_tags($value);
}
$tmp=array_map("convert_diacrit",$tmp);//On enlève les accents
$tmp=array_map("strtoupper",$tmp);//On met en majuscule
asort($tmp);//Tri sur les valeurs en majuscule sans accent
foreach ( $tmp as $key => $value ) {
$tmp[$key]=$val_lib[$key];//On reprend les bons couples clé / libellé
}
$val_lib=$tmp;
}
if ($opac_thesaurus) {
if (!$opac_categories_categ_in_line) {
$categ_repetables_aff = "[".$nom_tesaurus."]".implode(" [".$nom_tesaurus."]",$val_lib) ;
}else {
$categ_repetables_aff = "".$nom_tesaurus." ".implode(" $pmb_keyword_sep ",$val_lib) ;
}
} elseif (!$opac_categories_categ_in_line) {
$categ_repetables_aff = implode(" ",$val_lib) ;
} else {
$categ_repetables_aff = implode(" $pmb_keyword_sep ",$val_lib) ;
}
if($categ_repetables_aff) $tmpcateg_aff .= "$categ_repetables_aff ";
}
$this->categories_toutes = $tmpcateg_aff;
} // fin fetch_categories()
}// fin class notice_affichage_ctles
?>