get_array_results(); } /* * gestion des droits... * Dans l'ordre : * on regarde les droits sur le pério, * ensuite la notice de bulletin (pour les expl et explnum)... */ if ($gestion_acces_active==1 && ($gestion_acces_empr_docnum || $gestion_acces_empr_notice)){ $ac= new acces(); if($gestion_acces_empr_notice==1) { $dom_2= $ac->setDomain(2); } if ($gestion_acces_empr_docnum==1) { $dom_3= $ac->setDomain(3); } } $id = intval($id); $requete = "SELECT bulletin_id, bulletin_numero, bulletin_notice, mention_date, date_date, bulletin_titre, bulletin_cb, date_format(date_date, '".$msg["format_date_sql"]."') as aff_date_date,num_notice FROM bulletins WHERE bulletin_id='$id'"; $resdep = @pmb_mysql_query($requete, $dbh); while(($obj=pmb_mysql_fetch_array($resdep))) { //on regarde tout de suite les droits de la notice de périodique... $perio_id = $obj["bulletin_notice"]; //droits d'acces emprunteur/notice $acces_v=TRUE; if ($gestion_acces_active==1 && $gestion_acces_empr_notice==1) { $acces_v = $dom_2->getRights($_SESSION['id_empr_session'],$perio_id,4); } else { $requete = "SELECT notice_visible_opac, expl_visible_opac, notice_visible_opac_abon, expl_visible_opac_abon, explnum_visible_opac, explnum_visible_opac_abon FROM notices, notice_statut WHERE notice_id ='".$perio_id."' and id_notice_statut=statut "; $myQuery = pmb_mysql_query($requete, $dbh); if(pmb_mysql_num_rows($myQuery)) { $statut_temp = pmb_mysql_fetch_object($myQuery); if(!$statut_temp->notice_visible_opac) $acces_v=FALSE; if($statut_temp->notice_visible_opac_abon && !$_SESSION['id_empr_session']) $acces_v=FALSE; } else $acces_v=FALSE; } //Visible - Mais est-elle visible dans la vue OPAC ? if($acces_v && $opac_opac_view_activate) { if(!empty($_SESSION["opac_view"]) && !empty($_SESSION["opac_view_query"])){ $query = "select opac_view_num_notice from opac_view_notices_".$_SESSION["opac_view"]." where opac_view_num_notice =".$perio_id; $result = pmb_mysql_query($query); if(!pmb_mysql_num_rows($result)) { $acces_v = FALSE; } } } if($id && $acces_v) { //on peut voir les bulletins de ce périodique... //on regarde si on a vraiment de voir ce bulletin en particulier (si on a une notice de bulletin) if($obj['num_notice']){ if ($gestion_acces_active==1 && $gestion_acces_empr_notice==1) { $acces_v = $dom_2->getRights($_SESSION['id_empr_session'],$obj['num_notice'],4); } else { $requete = "SELECT notice_visible_opac, notice_visible_opac_abon FROM notices, notice_statut WHERE notice_id ='".$obj['num_notice']."' and id_notice_statut=statut "; $myQuery = pmb_mysql_query($requete, $dbh); if(pmb_mysql_num_rows($myQuery)) { $statut_temp = pmb_mysql_fetch_object($myQuery); if(!$statut_temp->notice_visible_opac) $acces_v=FALSE; if($statut_temp->notice_visible_opac_abon && !$_SESSION['id_empr_session']) $acces_v=FALSE; } else $acces_v=FALSE; } //Visible - Mais est-elle visible dans la vue OPAC ? if($acces_v && $opac_opac_view_activate) { if(!empty($_SESSION["opac_view"]) && !empty($_SESSION["opac_view_query"])){ $query = "select opac_view_num_notice from opac_view_notices_".$_SESSION["opac_view"]." where opac_view_num_notice =".$obj['num_notice']; $result = pmb_mysql_query($query); if(!pmb_mysql_num_rows($result)) { $acces_v = FALSE; } } } } if($acces_v){ //on est maintenant sur que ce bulletin est visible ! $id_for_right = $perio_id; if($obj['num_notice']){ $id_for_right = $obj['num_notice']; } //est-ce que je peux voir les exemplaires $expl_visible = true; if ($gestion_acces_active==1 && $gestion_acces_empr_notice==1) { $expl_visible = $dom_2->getRights($_SESSION['id_empr_session'],$id_for_right,8); } else { $requete = "SELECT expl_visible_opac, expl_visible_opac_abon FROM notices, notice_statut WHERE notice_id ='".$id_for_right."' and id_notice_statut=statut "; $myQuery = pmb_mysql_query($requete, $dbh); if(pmb_mysql_num_rows($myQuery)) { $statut_temp = pmb_mysql_fetch_object($myQuery); if(!$statut_temp->expl_visible_opac) $expl_visible=false; if($statut_temp->expl_visible_opac_abon && !$_SESSION['id_empr_session']) $expl_visible=false; } else $expl_visible=false; } //lien $res_print_link = ""; if($obj['num_notice']){ $requete = "SELECT lien, eformat FROM notices WHERE notice_id ='".$obj['num_notice']."'"; $myQuery = pmb_mysql_query($requete, $dbh); if(pmb_mysql_num_rows($myQuery)) { $notice = pmb_mysql_fetch_object($myQuery); if ($notice->lien) { if(!$notice->eformat) $info_bulle=$msg["open_link_url_notice"]; else $info_bulle=$notice->eformat; // ajout du lien pour les ressources électroniques $res_print_link .= " lien."\" target=\"_blank\" type=\"external_url_notice\">"; $res_print_link .= ""; $res_print_link .= ""; } } } //est-ce que je peux voir les documents numériques $docnum_visible = true; if ($gestion_acces_active==1 && $gestion_acces_empr_notice==1) { $docnum_visible = $dom_2->getRights($_SESSION['id_empr_session'],$id_for_right,16); } else { $requete = "SELECT explnum_visible_opac, explnum_visible_opac_abon FROM notices, notice_statut WHERE notice_id ='".$id_for_right."' and id_notice_statut=statut "; $myQuery = pmb_mysql_query($requete, $dbh); if(pmb_mysql_num_rows($myQuery)) { $statut_temp = pmb_mysql_fetch_object($myQuery); if(!$statut_temp->explnum_visible_opac) $docnum_visible=false; if($statut_temp->explnum_visible_opac_abon && !$_SESSION['id_empr_session']) $docnum_visible=false; } else $docnum_visible=false; } $nb_docnum = 0; $res_print_docnum=$info_bulle=""; if($docnum_visible || $opac_show_links_invisible_docnums){ if($opac_show_links_invisible_docnums){ $req = "select explnum_id, explnum_nom, explnum_nomfichier, explnum_url from explnum where explnum_bulletin = ".$obj["bulletin_id"]; }else{ //on cherches des documents numériques if($gestion_acces_active==1 && $gestion_acces_empr_docnum == 1){ $join = $dom_3->getJoin($_SESSION['id_empr_session'], 16, 'explnum_id'); }else{ $join = " join explnum_statut on explnum_docnum_statut = id_explnum_statut and (".($_SESSION['id_empr_session'] ? "explnum_visible_opac = 1": "explnum_visible_opac = 1 and explnum_visible_opac_abon = 0").") "; } $req = "select explnum_id, explnum_nom, explnum_nomfichier, explnum_url from explnum ".$join." where explnum_notice = 0 and explnum_bulletin = ".$obj["bulletin_id"]; } $resultat = pmb_mysql_query($req, $dbh); $nb_docnum = pmb_mysql_num_rows($resultat); //on met le nécessaire pour la visionneuse if($opac_visionneuse_allow && $nb_docnum){ //print "   ".$link_to_visionneuse; print " "; } if($nb_docnum == 1){ $explnumrow = pmb_mysql_fetch_object($resultat); 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; } if($opac_visionneuse_allow){ $res_print_docnum=" explnum_id.");return false;\" title=''>"; }else{ $res_print_docnum= " explnum_id."\" target=\"_blank\">"; } $res_print_docnum .= ""; $res_print_docnum .= ""; }elseif($nb_docnum > 1){ $info_bulle=$msg["info_docs_num_notice"]; $res_print_docnum = " \"\"/"; } } $typdocchapeau="a"; $icon=""; $requete3 = "SELECT notice_id,typdoc FROM notices WHERE notice_id='".$perio_id."' "; $res3 = @pmb_mysql_query($requete3, $dbh); while(($obj3=pmb_mysql_fetch_object($res3))) { $notice3 = new notice($obj3->notice_id); $typdocchapeau=$obj3->typdoc; } $notice3->fetch_visibilite(); if (!$icon) $icon="icon_per.gif"; if (!isset($icon_doc)) { $icon_doc = marc_list_collection::get_instance('icondoc'); $icon_doc = $icon_doc->table; } $icon = $icon_doc["b".$typdocchapeau]; $num_notice=$obj['num_notice']; //carrousel pour la navigation if($opac_show_bulletin_nav) $res_print = do_carrousel($obj); else $res_print=""; if ($opac_notices_format != AFF_ETA_NOTICES_TEMPLATE_DJANGO) { //$res_print .= "

".$notice3->print_resume(1,$css)."."." ".$obj["bulletin_numero"]."".($nb_docnum ? " ".($nb_docnum > 1 ? "" : "")."" : "")."

\n"; $res_print .= "

".$notice3->print_resume(1,$css)."."." ".$obj["bulletin_numero"].""; if($res_print_link){ $res_print .=$res_print_link; } if($res_print_docnum){ $res_print .=$res_print_docnum."

\n"; }else{ $res_print .="
\n"; } if ($obj['bulletin_titre']) { $res_print .= htmlentities($obj['bulletin_titre'],ENT_QUOTES, $charset)."
"; } if ($obj['mention_date']) $res_print .= $msg['bull_mention_date']."  ".$obj['mention_date']."\n"; if ($obj['date_date']) $res_print .= "
".$msg['bull_date_date']."  ".$obj['aff_date_date']." \n"; if ($obj['bulletin_cb']) { $res_print .= "
".$msg["code_start"]." ".htmlentities($obj['bulletin_cb'],ENT_QUOTES, $charset)."\n"; $code_cb_bulletin = $obj['bulletin_cb']; } else { $code_cb_bulletin = ""; } do_image($res_print, $code_cb_bulletin, 0 ) ; print $res_print ; // construction des dépouillements $depouill = "
"; $articles = get_articles_from_bulletin($id); if(count($articles)) { $depouill .= "

".$msg['bull_dep']."

"; if ($opac_notices_depliable) $depouill .= $begin_result_liste; if ($opac_cart_allow) $depouill.="".$msg["cart_add_result_in"].""; $depouill.= "
"; foreach ($articles as $article) { $depouill.= pmb_bidi(aff_notice($article)); } $depouill.= "
"; } else { $depouill .= $msg["no_analysis"]; } $depouill .= "
"; if ($num_notice) { // Il y a une notice de bulletin $opac_notices_depliable = 0; $seule=1; print $notice_display_header; print pmb_bidi(aff_notice($num_notice,0,0)) ; print $notice_display_footer; } else { print '
'; if ($expl_visible) { if (!$opac_resa_planning) { $resa_check=check_statut(0,$id) ; if ($resa_check) { $requete_resa = "SELECT count(1) FROM resa WHERE resa_idbulletin='$id'"; $nb_resa_encours = pmb_mysql_result(pmb_mysql_query($requete_resa,$dbh), 0, 0) ; if ($nb_resa_encours) $message_nbresa = str_replace("!!nbresa!!", $nb_resa_encours, $msg["resa_nb_deja_resa"]) ; if (($_SESSION["user_code"] && $allow_book) && $opac_resa && !$popup_resa) { $ret_resa .= "

".$msg["bulletin_display_resa"]."

"; if ($opac_max_resa==0 || $opac_max_resa>$nb_resa_encours) { if ($opac_resa_popup) $ret_resa .= "".$msg["bulletin_display_place_resa"]."" ; else $ret_resa .= "".$msg["bulletin_display_place_resa"]."" ; $ret_resa .= $message_nbresa ; } else $ret_resa .= str_replace("!!nb_max_resa!!", $opac_max_resa, $msg["resa_nb_max_resa"]) ; $ret_resa.= "
"; } elseif (!($_SESSION["user_code"]) && $opac_resa && !$popup_resa) { // utilisateur pas connecté // préparation lien réservation sans être connecté $ret_resa .= "

".$msg["bulletin_display_resa"]."

"; if ($opac_resa_popup) $ret_resa .= "".$msg["bulletin_display_place_resa"]."" ; else $ret_resa .= "".$msg["bulletin_display_place_resa"]."" ; $ret_resa .= $message_nbresa ; $ret_resa .= "
"; } elseif ($fonction=='notice_affichage_custom_bretagne') { if ($opac_resa_popup) $reserver = "notice_id."&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;}else return false;\" id=\"bt_resa\">".$msg["bulletin_display_place_resa"]."" ; else $reserver = "".$msg["bulletin_display_place_resa"]."" ; $reservernbre = $message_nbresa ; } else $ret_resa = ""; print pmb_bidi($ret_resa) ; } } if ($opac_show_exemplaires) { if($fonction=='notice_affichage_custom_bretagne') print pmb_bidi(notice_affichage_custom_bretagne::expl_list("m",0,$id)); else print pmb_bidi(notice_affichage::expl_list("m",0,$id)); } } //Demande de numérisation if ($opac_scan_request_activate && $_SESSION['id_empr_session'] && $allow_scan_request) { $scan_request = new scan_request(); $scan_request->add_linked_records(array('bulletins' => array($id))); print "
".$scan_request->get_link_in_record($id, 'bulletins'); } if ($docnum_visible || $opac_show_links_invisible_docnums) { if (($explnum = show_explnum_per_notice(0, $id, ''))) print pmb_bidi("

".$msg["explnum"]."

".$explnum); } if($opac_map_activate==1 || $opac_map_activate==3){ print map_locations_controler::get_map_location($memo_expl, '0_'.$id); } print '
'; } print $depouill; print notice_affichage::autres_lectures (0,$id); } else { print $res_print; if ($num_notice) { // Il y a une notice de bulletin $opac_notices_depliable = 0; $seule=1; print $notice_display_header; print pmb_bidi(aff_notice($num_notice,0,0)) ; print $notice_display_footer; } else { // On utilise un template django require_once($base_path."/cms/modules/common/includes/pmb_h2o.inc.php"); if (!$opac_notices_format_django_directory) $opac_notices_format_django_directory = "common"; if (empty($record_css_already_included)) { if (file_exists($include_path."/templates/record/".$opac_notices_format_django_directory."/styles/style.css")) { $retour_aff .= ""; } $record_css_already_included = true; } // On récupère le libellé de Bulletinq if(!isset($biblio_doc) || !is_array($biblio_doc) || !count($biblio_doc)) { $biblio_doc = new marc_list('nivbiblio'); $biblio_doc = $biblio_doc->table; } $obj['biblio_doc'] = $biblio_doc['b']; // on va chercher les infos de dépouillements $obj['articles'] = array(); $articles = get_articles_from_bulletin($id); if(is_array($articles) && count($articles)){ foreach ($articles as $article) { $obj['articles'][] = record_display::get_display_in_result($article); } } // on va cherche les infos de résa $resas_datas = array( 'nb_resas' => 0, 'href' => "#", 'onclick' => "", 'flag_max_resa' => false, 'flag_resa_visible' => true, 'flag_resa_possible' => true ); if ($expl_visible) { if (!$opac_resa_planning) { $resa_check=check_statut(0,$id) ; if ($resa_check) { $requete_resa = "SELECT count(1) FROM resa WHERE resa_idbulletin='$id'"; $resas_datas['nb_resas'] = pmb_mysql_result(pmb_mysql_query($requete_resa,$dbh), 0, 0) ; if (($_SESSION["user_code"] && $allow_book) && $opac_resa && !$popup_resa) { if ($opac_max_resa==0 || $opac_max_resa>$resas_datas['nb_resas']) { if ($opac_resa_popup) { $resas_datas['onclick'] = "if(confirm('".$msg["confirm_resa"]."')){w=window.open('./do_resa.php?lvl=resa&id_bulletin=".$id."&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;}else return false;"; } else { $resas_datas['href'] = "./do_resa.php?lvl=resa&id_bulletin=".$id."&oresa=popup"; $resas_datas['onclick'] = "return confirm('".$msg["confirm_resa"]."')"; } } else $resas_datas['flag_max_resa'] = true; } elseif (!($_SESSION["user_code"]) && $opac_resa && !$popup_resa) { // utilisateur pas connecté // préparation lien réservation sans être connecté if ($opac_resa_popup) { $resas_datas['onclick'] = "if(confirm('".$msg["confirm_resa"]."')){w=window.open('./do_resa.php?lvl=resa&id_bulletin=".$id."&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;}else return false;"; } else { $resas_datas['href'] = "./do_resa.php?lvl=resa&id_bulletin=".$id."&oresa=popup"; $resas_datas['onclick'] = "return confirm('".$msg["confirm_resa"]."')"; } } else { $resas_datas['flag_resa_possible'] = false; } } else { $resas_datas['flag_resa_possible'] = false; } } else { $resas_datas['flag_resa_possible'] = false; } if ($opac_show_exemplaires) { $obj['display_expls'] = pmb_bidi(notice_affichage::expl_list("m",0,$id)); } } else { $resas_datas['flag_resa_visible'] = false; } if ($docnum_visible || $opac_show_links_invisible_docnums) { if (($explnum = show_explnum_per_notice(0, $id, ''))) { $obj['display_explnum'] = pmb_bidi("

".$msg["explnum"].($nb_explnum_visible ? " (".$nb_explnum_visible.")" : "")."

".$explnum); } } //Demande de numérisation if ($opac_scan_request_activate && $_SESSION['id_empr_session'] && $allow_scan_request) { $scan_request = new scan_request(); $scan_request->add_linked_records(array('bulletins' => array($id))); } else { $scan_request = null; } // Etat des collections if ($pmb_collstate_advanced) { $collstate = new collstate(0, 0, $id); if($pmb_etat_collections_localise) { $collstate->get_display_list("",0,0,0,1); } else { $collstate->get_display_list("",0,0,0,0); } $obj['display_bulletins_list'] = "

".$msg["perio_etat_coll"]."

"; $obj['display_bulletins_list'].= $collstate->liste; } // On envoie le tout au template if (file_exists($include_path."/templates/record/".$opac_notices_format_django_directory."/bulletin_without_record_extended_display.tpl.html")) { $template = $include_path."/templates/record/".$opac_notices_format_django_directory."/bulletin_without_record_extended_display.tpl.html"; } else { $template = $include_path."/templates/record/common/bulletin_without_record_extended_display.tpl.html"; } $h2o = H2o_collection::get_instance($template); print $h2o->render(array('bulletin' => $obj, 'parent' => $notice3, 'liens_opac' => $liens_opac, 'resas_datas' => $resas_datas, 'scan_request' => $scan_request)); } } } else { print "

".htmlentities($msg['record_display_forbidden'],ENT_QUOTES,$charset).'

'; } } else { print "

".htmlentities($msg['record_display_forbidden'],ENT_QUOTES,$charset).'

'; } } function do_carrousel($bull){ global $gestion_acces_active,$gestion_acces_empr_notice,$opac_navigateur_bulletin_number; global $msg; if ($gestion_acces_active==1 && $gestion_acces_empr_notice==1) { $ac = new acces(); $dom_2= $ac->setDomain(2); $join_noti = $dom_2->getJoin($_SESSION["id_empr_session"],4,"bulletins.num_notice"); $join_bull = $dom_2->getJoin($_SESSION["id_empr_session"],4,"bulletins.bulletin_notice"); }else{ $join_noti = "join notices on bulletins.num_notice = notices.notice_id join notice_statut on notices.statut = notice_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)":"").")"; $join_bull = "join notices on bulletins.bulletin_notice = notices.notice_id join notice_statut on notices.statut = notice_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)":"").")"; } $requete_noti = "select bulletin_id, bulletin_numero, bulletin_notice, mention_date, date_date, bulletin_titre, bulletin_cb, date_format(date_date, '".$msg["format_date_sql"]."') as aff_date_date,num_notice from bulletins ".$join_noti." where bulletins.num_notice != 0 and bulletin_notice = ".$bull['bulletin_notice'].""; $requete_bull = "select bulletin_id, bulletin_numero, bulletin_notice, mention_date, date_date, bulletin_titre, bulletin_cb, date_format(date_date, '".$msg["format_date_sql"]."') as aff_date_date,num_notice from bulletins ".$join_bull." where bulletins.num_notice = 0 and bulletin_notice = ".$bull['bulletin_notice'].""; $requete = "select * from (".$requete_noti." union ".$requete_bull.") as uni"; $requete = "(".$requete." where date_date < '".$bull['date_date']."' order by date_date desc limit 0,".$opac_navigateur_bulletin_number.") union (".$requete." where date_date >= '".$bull['date_date']."' order by date_date asc limit 0,".($opac_navigateur_bulletin_number+1).")"; $res_caroussel = pmb_mysql_query($requete); if(pmb_mysql_num_rows($res_caroussel)){ $prev = true; $current = $previous = $next = array(); while (($bullForNav=pmb_mysql_fetch_array($res_caroussel))) { if($bullForNav['bulletin_id'] == $bull['bulletin_id']){ $prev = false; $current = $bullForNav; }else{ if($prev == true){ $previous[] = $bullForNav; }else{ $next[] = $bullForNav; } } } $carrousel = "
"; $taille = 100; //on a des bulletins précédent if (sizeof($previous)>0){ $taille =$taille - ($opac_navigateur_bulletin_number+1); } //on a des bulletins suivant if(sizeof($next)>0){ $taille =$taille - ($opac_navigateur_bulletin_number+1); } //ceux d'avant //on égalise : $opac_navigateur_bulletin_number de chaque coté if(sizeof($previous)>0)$carrousel .= ""; for($i=0 ; $i<($opac_navigateur_bulletin_number-sizeof($previous)); $i++){ if($i<($opac_navigateur_bulletin_number-sizeof($previous))-1) $carrousel .=""; else{ if(!$link_perio=get_perio_link($bull['bulletin_notice'],'before'))$carrousel .=""; else $carrousel .=""; } } if(sizeof($previous)>0){ for($i=sizeof($previous)-1 ; $i>=0 ; $i--){ $carrousel .=""; } } //le bull courant en évidence $carrousel .=""; //la suite if(sizeof($next)>0){ for($i=0 ; $i".$next[$i]['bulletin_numero'].($next[$i]['bulletin_titre'] ? " - ".$next[$i]['bulletin_titre'] : "")."
".($next[$i]['mention_date'] ? $next[$i]['mention_date'] :$next[$i]['aff_date_date'] )."
"; } } //on égalise : $opac_navigateur_bulletin_number de chaque coté for($i=0 ; $i<($opac_navigateur_bulletin_number-sizeof($next)) ; $i++){ if($i){ $carrousel .="
"; }else{ if(!$link_perio=get_perio_link($bull['bulletin_notice'],'after')) $carrousel .=""; else $carrousel .=""; } } if(sizeof($next)>0)$carrousel .= ""; //on ferme le tout $carrousel .= "
  $link_perio".$previous[$i]['bulletin_numero'].($previous[$i]['bulletin_titre'] ? " - ".$previous[$i]['bulletin_titre'] : "")."
".($previous[$i]['mention_date'] ? $previous[$i]['mention_date'] :$previous[$i]['aff_date_date'] )."
".$current['bulletin_numero'].($current['bulletin_titre'] ? " - ".$current['bulletin_titre'] : "")."
".($current['mention_date'] ? $current['mention_date'] :$current['aff_date_date'] )."
  $link_perio
"; } return $carrousel; } // Construction des tritres suivants et précédants function get_perio_link($id,$sens) { global $dbh,$lang,$include_path; global $msg; global $charset; global $opac_notice_affichage_class; $notice_relations = notice_relations_collection::get_object_instance($id); //Recherche des notices parentes $parents = $notice_relations->get_parents(); if($notice_relations->get_nb_parents()) { $parser = new XMLlist_perio("$include_path/marc_tables/$lang/relationtypeup.xml",1,1); $parser->analyser(); $listup= $parser->table_serial; foreach ($parents as $parents_relations) { foreach ($parents_relations as $parent) { if($listup[$parent->get_relation_type()]==$sens){ $current = new $opac_notice_affichage_class($parent->get_linked_notice(),"",0,0,1); $current->do_header_without_html(); $link=" ".$current->notice_header_without_html.""; return $link; } } } } //Recherche des notices filles $childs = $notice_relations->get_childs(); if($notice_relations->get_nb_childs()) { $parser = new XMLlist_perio("$include_path/marc_tables/$lang/relationtypedown.xml",1,1); $parser->analyser(); $listdown= $parser->table_serial; foreach ($childs as $childs_relations) { foreach ($childs_relations as $child) { if($listdown[$child->get_relation_type()]==$sens){ $current = new $opac_notice_affichage_class($child->get_linked_notice(),"",0,0,1); $current->do_header_without_html(); $link=" ".$current->notice_header_without_html.""; return $link; } } } } return ""; } class XMLlist_perio extends XMLlist { public $current_serial; public $table_serial; public function debutBalise($parser, $nom, $attributs) { global $_starttag; $_starttag=true; if($nom == 'ENTRY' && $attributs['CODE']){ $this->current = $attributs['CODE']; if($attributs['SERIAL']) $this->current_serial = $attributs['SERIAL']; } if($nom == 'ENTRY' && $attributs['ORDER']) { $this->flag_order = true; $this->order[$attributs['CODE']] = $attributs['ORDER']; } if($nom == 'XMLlist') { $this->table = array(); $this->table_serial = array(); $this->fav = array(); } } public function texte($parser, $data) { global $_starttag; if($this->current){ if ($_starttag) { $this->table[$this->current] = $data; $_starttag=false; } else $this->table[$this->current] .= $data; $this->table_serial[$this->current] = $this->current_serial; } } }