array(),"auteurs" => array()); // les auteurs public $categories = array(); // les categories public $p_perso; public $expl = 0; // flag indiquant si on affiche les infos d'exemplaire public $nb_expl = 0; //nombre d'exemplaires public $link_expl = ''; // lien associé à un exemplaire public $show_explnum = 1; public $show_statut = 0; public $childs= array(); //Filles de la notice public $print_mode = 0; // 0 affichage normal // 1 affichage impression sans liens // 2 affichage impression avec liens sur documents numeriques // 4 affichage email : sans lien sauf url associée public $langues = array(); public $languesorg = array(); public $aff_statut = '' ; // carré de couleur pour signaler le statut de la notice public $show_opac_hidden_fields = true; // public $drag = 0; public $anti_loop = array(); public $show_map=1; public $context_dsi_id_bannette=0; public $notice_relations; //Objet notice_relations public $is_child=false; public $icondoc = ''; public $unique_id = ''; protected $context_parameters; /** * Tableau d'instances de record_datas * @var record_datas */ static private $records_datas = array(); static private $special; public static $linked_permalink; // récupération des valeurs en table public function fetch_data() { $query = "SELECT * FROM notices WHERE notice_id='".$this->notice_id."' "; $result = pmb_mysql_query($query); if (pmb_mysql_num_rows($result)){ $this->notice = pmb_mysql_fetch_object($result); } $this->langues = get_notice_langues($this->notice_id, 0) ; // langues de la publication $this->languesorg = get_notice_langues($this->notice_id, 1) ; // langues originales } // génération du template javascript--------------------------------------- public function init_javascript() { global $msg, $base_path, $pmb_recherche_ajax_mode; global $caller, $callback, $charset; // propriétés pour le selecteur de panier $cart_click = "onClick=\"openPopUp('".$base_path."/cart.php?object_type=NOTI&item=!!notice_id!!', 'cart')\""; $cart_over_out = "onMouseOver=\"show_div_access_carts(event,!!notice_id!!);\" onMouseOut=\"set_flag_info_div(false);\""; $current=$_SESSION["CURRENT"]; if ($current!==false) { $print_action = " \"".$msg["histo_print"]."\""; } else { $print_action = ""; } $javascript_template = $this->get_display_anchor()."
"; if(isset($this->context_parameters['in_search']) && $this->context_parameters['in_search']) { $javascript_template .= ""; } if($pmb_recherche_ajax_mode && $this->ajax_mode){ $javascript_template .= " !!heada!!
"; } else{ $javascript_template .= " !!heada!!
"; } if($this->is_child) $javascript_template .= ""; $microtime = md5(microtime()); $this->unique_id = $this->notice_id.(is_array($this->anti_loop) && count($this->anti_loop)?"_p".implode("_",$this->anti_loop):"").'_'.$microtime; $this->result = str_replace('!!id!!', $this->unique_id, $javascript_template); $this->result = str_replace('!!notice_id!!', $this->notice_id, $this->result); $this->result = str_replace('!!item!!', $this->notice_id, $this->result); $this->result = str_replace('!!unique!!', $microtime, $this->result); if(isset($this->context_parameters['in_selector']) && $this->context_parameters['in_selector']) { $this->result = str_replace('!!heada!!', ($this->show_statut ? $this->aff_statut.' ' : ''). ($this->get_icondoc() ? $this->icondoc : ''). str_replace('!!notice_id!!', $this->notice_id, $this->lien_suppr_cart)."notice_id."', '".htmlentities(addslashes($this->header_texte), ENT_QUOTES, $charset)."','".$callback."')\">".strip_tags($this->header)."", $this->result); } else { $this->result = str_replace('!!heada!!', str_replace('!!notice_id!!', $this->notice_id, $this->lien_suppr_cart).$this->header, $this->result); } } protected function get_icondoc() { global $use_opac_url_base, $opac_url_base, $base_path; global $tdoc; //Icone type de Document $icon_doc = marc_list_collection::get_instance('icondoc'); $icon = (!empty($icon_doc->table[$this->notice->niveau_biblio.$this->notice->typdoc]) ? $icon_doc->table[$this->notice->niveau_biblio.$this->notice->typdoc] : ''); $this->icondoc = ''; if ($icon) { $biblio_doc = marc_list_collection::get_instance('nivbiblio'); $info_bulle_icon=$biblio_doc->table[$this->notice->niveau_biblio]." : ".$tdoc->table[$this->notice->typdoc]; if ($use_opac_url_base) $this->icondoc="\"$info_bulle_icon\""; else $this->icondoc="\"$info_bulle_icon\""; } return $this->icondoc; } protected function get_icon_is_new() { global $msg; global $use_opac_url_base, $opac_url_base, $base_path; $icon = "icone_nouveautes.png"; $this->icon_is_new = ""; if($this->notice->notice_is_new) { $info_bulle_icon_new=$msg["notice_is_new_gestion"]; if ($use_opac_url_base) $this->icon_is_new="\"$info_bulle_icon_new\""; else $this->icon_is_new="\"$info_bulle_icon_new\""; } return $this->icon_is_new; } protected function get_aff_statut() { global $charset; global $use_opac_url_base; if ($this->notice->statut) { $rqt_st = "SELECT class_html , gestion_libelle FROM notice_statut WHERE id_notice_statut='".$this->notice->statut."' "; $res_st = pmb_mysql_query($rqt_st); $class_html = " class='".pmb_mysql_result($res_st, 0, 0)."' "; if ($this->notice->statut>1) $txt = pmb_mysql_result($res_st, 0, 1) ; else $txt = "" ; } else { $class_html = " class='statutnot1' " ; $txt = "" ; } if ($this->notice->commentaire_gestion) { if ($txt) $txt .= ":\r\n".$this->notice->commentaire_gestion ; else $txt = $this->notice->commentaire_gestion ; } $use_opac_url_base = intval($use_opac_url_base); if ($txt) { $this->aff_statut = "notice_id."'); z.style.display=''; \" onmouseout=\"z=document.getElementById('zoom_statut".$this->notice_id."'); z.style.display='none'; \">"; $this->aff_statut .= "" ; } else { $this->aff_statut = ""; } return $this->aff_statut; } protected function get_aff_editeur_reduit() { $aff_editeur_reduit = ''; // zone de l'éditeur if ($this->notice->ed1_id) { $editeur = new editeur($this->notice->ed1_id); $aff_editeur_reduit = $editeur->display ; if ($this->notice->year) $aff_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) $aff_editeur_reduit = $this->notice->year." "; } return $aff_editeur_reduit; } protected function get_aff_perso() { global $pmb_notice_reduit_format; // peut-être veut-on des personnalisés ? $perso_voulus_temp = substr($pmb_notice_reduit_format,2) ; $perso_voulus = array(); if ($perso_voulus_temp!="") $perso_voulus = explode(",",$perso_voulus_temp); if (!is_object($this->p_perso)) $this->p_perso = new parametres_perso("notices"); //Champs personalisés à ajouter au réduit $perso_voulu_aff = ''; if (!$this->p_perso->no_special_fields) { if (count($perso_voulus)) { $this->p_perso->get_values($this->notice_id) ; for ($i=0; $ip_perso->get_formatted_output($this->p_perso->values[$perso_voulus[$i]],$perso_voulus[$i])." " ; } $perso_voulu_aff=trim($perso_voulu_aff); } } return $perso_voulu_aff; } protected function get_resources_link() { global $use_dsi_diff_mode; global $use_opac_url_base, $opac_url_base, $base_path; $resources_link = ''; if (!$this->print_mode || $this->print_mode=='2' || $use_dsi_diff_mode) { $resources_link .= "notice->lien."\" target=\"_blank\">"; if (!$use_opac_url_base) $resources_link .= "notice->eformat; $resources_link .= "\" title=\""; $resources_link .= $this->notice->eformat; $resources_link .= "\">"; $resources_link .=""; } elseif ($this->print_mode=='4') { $resources_link .= '
'; $resources_link .= "notice->lien."\" target=\"_blank\">"; $resources_link .= $this->notice->lien; $resources_link .=''; } else { $resources_link .= "
"; $resources_link .= $this->notice->lien; } return $resources_link; } protected function get_display_collation() { $collation = ''; if($this->notice->npages) { $collation = $this->notice->npages; } if($this->notice->ill) { $collation .= ' : '.$this->notice->ill; } if($this->notice->size) { $collation .= ' ; '.$this->notice->size; } if($this->notice->accomp) { $collation .= ' + '.$this->notice->accomp; } return $collation; } protected function get_display_categories() { global $base_path; global $thesaurus_mode_pmb, $thesaurus_categories_categ_in_line, $pmb_keyword_sep, $thesaurus_categories_affichage_ordre; global $lang; global $categories_memo,$libelle_thesaurus_memo; global $categories_top,$use_opac_url_base,$opac_url_base,$thesaurus_categories_show_only_last, $opac_categories_show_only_last; $categ_repetables = array() ; if ($this->context_dsi_id_bannette) { $categories_show_only_last = $opac_categories_show_only_last; } else { $categories_show_only_last = $thesaurus_categories_show_only_last; } if(!is_array($categories_top)) { $categories_top = array(); } if(!count($categories_top)) { $q = "select id_noeud from noeuds where autorite='TOP' "; $r = pmb_mysql_query($q); while($res = pmb_mysql_fetch_object($r)) { $categories_top[]=$res->id_noeud; } } $requete = "select * from ( select libelle_thesaurus, if (catlg.num_noeud is null, catdef.libelle_categorie, catlg.libelle_categorie ) as categ_libelle, noeuds.id_noeud , noeuds.num_parent, langue_defaut,id_thesaurus, if(catdef.langue = '".$lang."',2, if(catdef.langue= thesaurus.langue_defaut ,1,0)) as p, ordre_vedette, ordre_categorie FROM ((noeuds join thesaurus ON thesaurus.id_thesaurus = noeuds.num_thesaurus left join categories as catdef on noeuds.id_noeud=catdef.num_noeud and catdef.langue = thesaurus.langue_defaut left join categories as catlg on catdef.num_noeud = catlg.num_noeud and catlg.langue = '".$lang."')) ,notices_categories where notices_categories.num_noeud=noeuds.id_noeud and notices_categories.notcateg_notice=".$this->notice_id." order by id_thesaurus, noeuds.id_noeud, p desc ) as list_categ group by id_noeud"; if ($thesaurus_categories_affichage_ordre==1) $requete .= " order by ordre_vedette, ordre_categorie"; $result_categ=@pmb_mysql_query($requete); if (pmb_mysql_num_rows($result_categ)) { $anti_recurse=array(); while($res_categ = pmb_mysql_fetch_object($result_categ)) { $libelle_thesaurus=$res_categ->libelle_thesaurus; $categ_id=$res_categ->id_noeud ; $libelle_categ=$res_categ->categ_libelle ; $num_parent=$res_categ->num_parent ; $langue_defaut=$res_categ->langue_defaut ; $categ_head=0; if(in_array($num_parent,$categories_top)) $categ_head=1; if ($categories_show_only_last || $categ_head) { if ($use_opac_url_base) $url_base_lien_aut = $opac_url_base."index.php?&lvl=categ_see&id=" ; else $url_base_lien_aut=$base_path."/autorites.php?categ=see&sub=category&id="; if ( (SESSrights & AUTORITES_AUTH || $use_opac_url_base) && (!$this->print_mode) ) $libelle_aff_complet = "".$libelle_categ.""; else $libelle_aff_complet =$libelle_categ; if ($thesaurus_mode_pmb) { $categ_repetables[$libelle_thesaurus][] = $libelle_aff_complet; } else $categ_repetables['MONOTHESAURUS'][] = $libelle_aff_complet; } else { if(!isset($categories_memo[$categ_id])) { $anti_recurse[$categ_id]=1; $path_table = array(); $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=@pmb_mysql_query($requete); if (pmb_mysql_num_rows($result)) { $parent = pmb_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 if(!isset($parent->categ_parent)) $parent->categ_parent = 0; if(!isset($anti_recurse[$parent->categ_parent])) $anti_recurse[$parent->categ_parent] = 0; 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=@pmb_mysql_query($requete); if (pmb_mysql_num_rows($result)) { $parent = pmb_mysql_fetch_object($result); $anti_recurse[$parent->categ_id]=1; $path_table[] = array( 'id' => $parent->categ_id, 'libelle' => $parent->categ_libelle); if(!isset($parent->categ_parent)) $parent->categ_parent = 0; if(!isset($anti_recurse[$parent->categ_parent])) $anti_recurse[$parent->categ_parent] = 0; } 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 (!empty($path_table)) { $temp_table = array(); foreach ($path_table as $xi => $l) { $temp_table[] = $l['libelle']; } $parent_libelle = implode(':', $temp_table); $catalog_form = $parent_libelle.':'.$libelle_categ; } else { $catalog_form = $libelle_categ; } if ($use_opac_url_base) $url_base_lien_aut = $opac_url_base."index.php?&lvl=categ_see&id=" ; else $url_base_lien_aut=$base_path."/autorites.php?categ=see&sub=category&id="; if ((SESSrights & AUTORITES_AUTH || $use_opac_url_base) && (!$this->print_mode) ) $libelle_aff_complet = "".$catalog_form.""; else $libelle_aff_complet =$catalog_form; if ($thesaurus_mode_pmb) { $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 ($thesaurus_mode_pmb) $categ_repetables[$libelle_thesaurus_memo[$categ_id]][] =$categories_memo[$categ_id]; else $categ_repetables['MONOTHESAURUS'][] =$categories_memo[$categ_id] ; } } } } $tmpcateg_aff = ''; foreach ($categ_repetables as $nom_thesaurus => $val_lib) { //c'est un tri par libellé qui est demandé if ($thesaurus_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 ($thesaurus_mode_pmb) { if (!$thesaurus_categories_categ_in_line) $categ_repetables_aff = "[".$nom_thesaurus."] ".implode("
[".$nom_thesaurus."] ",$val_lib) ; else $categ_repetables_aff = "".$nom_thesaurus."
".implode(" $pmb_keyword_sep ",$val_lib) ; } else if (!$thesaurus_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"; } return $tmpcateg_aff; } protected function get_display_relations_links() { global $base_path; global $load_tablist_js; $display = ''; if ((count($this->childs) || $this->notice_relations->get_nb_pairs())&&(!$this->no_link)) { if(!$load_tablist_js) $this->isbd.="\n"; $load_tablist_js=1; $this->isbd.="
"; $anti_loop=$this->anti_loop; $anti_loop[]=$this->notice_id; //Notices horizontales liées if($this->notice_relations->get_nb_pairs()) { $display .= $this->notice_relations->get_display_links('pairs', $this->print_mode, $this->show_explnum, 1, $this->show_opac_hidden_fields, $anti_loop); } if(count($this->childs) && !$this->print_mode) { $display .= $this->notice_relations->get_display_links('childs', $this->print_mode, $this->show_explnum, 1, $this->show_opac_hidden_fields, $anti_loop); } } return $display; } protected function get_display_pperso() { $perso_aff = "" ; if (!$this->p_perso->no_special_fields) { $perso_=$this->p_perso->show_fields($this->notice_id); for ($i=0; $ishow_opac_hidden_fields) afin de masquer les champs masqué de l'OPAC en diff de bannette. if ($p["AFF"] !== '' && ($p['OPAC_SHOW'] || $this->show_opac_hidden_fields)) $perso_aff .="
".$p["TITRE"]." ".($p["TYPE"]=='html'?$p["AFF"]:nl2br($p["AFF"])); } } return $perso_aff; } protected function get_display_external() { global $msg; $display = ''; $record_datas = static::get_record_datas($this->notice_id); $label = $record_datas->get_source_label(); if($label) { $display .= "
".$msg['external_source']." : ".$label; } return $display; } /** * fonction retournant les infos d'exemplaires pour une notice donnée * @param int $no_notice * @param string $link_expl * @param int $expl_bulletin * @param boolean $loaned FALSE = tous les exemplaires, TRUE les exemplaires en cours de pret * @return void|string */ public function show_expl_per_notice($no_notice, $link_expl='',$expl_bulletin=0, $loaned=false ) { global $msg, $base_path; global $explr_invisible, $explr_visible_unmod, $explr_visible_mod, $pmb_droits_explr_localises; global $pmb_expl_list_display_comments; global $pmb_sur_location_activate; global $pmb_expl_data,$charset; global $pmb_expl_display_location_without_expl; global $pmb_html_allow_expl_cote; global $pmb_transferts_actif, $pmb_pret_groupement; global $pmb_expl_order; // params : // $no_notice= id de la notice // $link_expl= lien associé à l'exemplaire avec !!expl_id!! et !!expl_cb!! à mettre à jour if(!$no_notice && !$expl_bulletin) return ''; $explr_tab_invis=explode(",",$explr_invisible); $explr_tab_unmod=explode(",",$explr_visible_unmod); $explr_tab_modif=explode(",",$explr_visible_mod); // récupération du nombre total d'exemplaires if($expl_bulletin){ $requete = "SELECT COUNT(1) FROM exemplaires WHERE expl_bulletin='$expl_bulletin' "; }else{ $requete = "SELECT COUNT(1) FROM exemplaires WHERE expl_notice='$no_notice' "; } $res = pmb_mysql_query($requete); $nb_ex = pmb_mysql_result($res, 0, 0); if($nb_ex) { $expl_liste = ''; // on récupère les données des exemplaires // visibilité des exemplaires: if ($pmb_droits_explr_localises && $explr_invisible) $where_expl_localises = "and expl_location not in ($explr_invisible)"; else $where_expl_localises = ""; //Liste des champs d'exemplaires if($pmb_sur_location_activate) $surloc_field="surloc_libelle,"; if (!$pmb_expl_data) $pmb_expl_data="expl_cb,expl_cote,".$surloc_field."location_libelle,section_libelle,statut_libelle,tdoc_libelle"; $colonnesarray=explode(",",$pmb_expl_data); if (!in_array("expl_cb", $colonnesarray)) array_unshift($colonnesarray, "expl_cb"); $total_columns = count($colonnesarray); if ($pmb_pret_groupement || $pmb_transferts_actif) $total_columns++; //Présence de champs personnalisés if (strstr($pmb_expl_data, "#")) { $cp=new parametres_perso("expl"); } if($expl_bulletin){ $where_expl_notice_expl_bulletin = " and expl_bulletin='$expl_bulletin' "; $prefix ="bull_".$expl_bulletin; }else{ $where_expl_notice_expl_bulletin = " and expl_notice='$no_notice' "; $prefix ="noti_".$no_notice; } $where_loaned = ""; if($loaned) { $where_loaned = " and pret.pret_idexpl is not null"; } $requete = "SELECT exemplaires.*, pret.*, docs_location.*, docs_section.*, docs_statut.*, docs_codestat.*, lenders.*, tdoc_libelle, "; if(in_array("surloc_libelle", $colonnesarray)){ $requete .= "sur_location.*, "; } $requete .= " date_format(pret_date, '".$msg["format_date"]."') as aff_pret_date, "; $requete .= " date_format(pret_retour, '".$msg["format_date"]."') as aff_pret_retour, "; $requete .= " IF(pret_retour>sysdate(),0,1) as retard " ; $requete .= " FROM exemplaires LEFT JOIN pret ON exemplaires.expl_id=pret.pret_idexpl "; $requete .= " left join docs_location on exemplaires.expl_location=docs_location.idlocation "; if(in_array("surloc_libelle", $colonnesarray)){ $requete .= " left join sur_location on docs_location.surloc_num=sur_location.surloc_id "; } $requete .= " left join docs_section on exemplaires.expl_section=docs_section.idsection "; $requete .= " left join docs_statut on exemplaires.expl_statut=docs_statut.idstatut "; $requete .= " left join docs_codestat on exemplaires.expl_codestat=docs_codestat.idcode "; $requete .= " left join lenders on exemplaires.expl_owner=lenders.idlender "; $requete .= " left join docs_type on exemplaires.expl_typdoc=docs_type.idtyp_doc "; $requete .= " WHERE 1 $where_expl_notice_expl_bulletin $where_expl_localises $where_loaned"; if($pmb_expl_order) { $requete .= " order by ".$pmb_expl_order; }elseif(in_array("surloc_libelle", $colonnesarray)){ $requete .= " order by surloc_libelle,location_libelle, section_libelle, expl_cote, expl_cb "; }else{ $requete .= " order by location_libelle, section_libelle, expl_cote, expl_cb "; } $result = pmb_mysql_query($requete) or die ("
".pmb_mysql_error()."
".$requete); $nbr_expl = pmb_mysql_num_rows($result); if ($nbr_expl) { $expl_list_id = array(); if($pmb_transferts_actif) $expl_list_id_transfer = array(); while($expl = pmb_mysql_fetch_object($result)) { $expl_list_id[] = $expl->expl_id; //visibilité des exemplaires if ($pmb_droits_explr_localises) { $as_invis = array_search($expl->idlocation,$explr_tab_invis); $as_unmod = array_search($expl->idlocation,$explr_tab_unmod); $as_modif = array_search($expl->idlocation,$explr_tab_modif); } else { $as_invis = false; $as_unmod = false; $as_modif = true; } $tlink=""; if ($link_expl) { if($expl_bulletin){ $tlink="./catalog.php?categ=serials&sub=bulletinage&action=expl_form&bul_id=!!bull_id!!&expl_id=!!expl_id!!"; $tlink = str_replace('!!bull_id!!', $expl_bulletin, $tlink); $tlink = str_replace('!!expl_id!!', $expl->expl_id, $tlink); $tlink = str_replace('!!expl_cb!!', rawurlencode($expl->expl_cb), $tlink); }else{ $tlink = str_replace('!!expl_id!!', $expl->expl_id, $link_expl); $tlink = str_replace('!!expl_cb!!', rawurlencode($expl->expl_cb), $tlink); $tlink = str_replace('!!notice_id!!', $expl->expl_notice, $tlink); } } $expl_liste .= ""; for ($i=0; $i".$colonnesarray[$i].";"); } if (($i == 0) && ($expl->expl_note || $expl->expl_comment) && $pmb_expl_list_display_comments) $expl_rowspan = "rowspan='2'"; else $expl_rowspan = ""; $aff_column = ""; $id_column = ""; if (substr($colonnesarray[$i],0,1)=="#") { //champs personnalisés $id=substr($colonnesarray[$i],1); $cp->get_values($expl->expl_id); if (!$cp->no_special_fields) { $temp=$cp->get_formatted_output((isset($cp->values[$id]) ? $cp->values[$id] : array()), $id); if (!$temp) $temp=" "; $aff_column.=$temp; } } else if ($colonnesarray[$i]=="expl_cb") { if (($tlink) && ($as_modif!== FALSE && $as_modif!== NULL) ) { $aff_column .= "".$colencours.""; } else $aff_column .= $colencours; } else if ($colonnesarray[$i]=="expl_cote") { if ($pmb_html_allow_expl_cote) { $aff_column.="".$colencours.""; } else { $aff_column.="".htmlentities($colencours,ENT_QUOTES, $charset).""; } } else if ($colonnesarray[$i]=="statut_libelle") { if($expl->pret_retour) { // exemplaire sorti $rqt_empr = "SELECT empr_nom, empr_prenom, id_empr, empr_cb FROM empr WHERE id_empr='$expl->pret_idempr' "; $res_empr = pmb_mysql_query($rqt_empr) ; $res_empr_obj = pmb_mysql_fetch_object($res_empr) ; $situation = "${msg[358]} ".$expl->aff_pret_retour.""; global $empr_show_caddie; if ($empr_show_caddie && (SESSrights & CIRCULATION_AUTH)) { $img_ajout_empr_caddie="basketpret_idempr."', 'cart')\"> "; } else $img_ajout_empr_caddie=""; switch ($this->print_mode) { case '2': $situation .= "
$res_empr_obj->empr_prenom $res_empr_obj->empr_nom"; break; default : $situation .= "
$img_ajout_empr_caddie$res_empr_obj->empr_prenom $res_empr_obj->empr_nom"; break; } } else { // tester si réservé $result_resa = pmb_mysql_query("select 1 from resa where resa_cb='".addslashes($expl->expl_cb)."' ") or die ("
".pmb_mysql_error()."
".$requete); $reserve = pmb_mysql_num_rows($result_resa); // tester à ranger $result_aranger = pmb_mysql_query(" select 1 from resa_ranger where resa_cb='".addslashes($expl->expl_cb)."' ") or die ("
".pmb_mysql_error()."
".$requete); $aranger = pmb_mysql_num_rows($result_aranger); if ($reserve) $situation = "".$msg['expl_reserve'].""; // exemplaire réservé elseif($expl->expl_retloc) $situation = $msg['resa_menu_a_traiter']; // exemplaire à traiter elseif ($aranger) $situation = "".$msg['resa_menu_a_ranger'].""; // exemplaire à ranger elseif ($expl->pret_flag) $situation = "${msg[359]}"; // exemplaire disponible else $situation = ""; } $aff_column .= htmlentities($colencours,ENT_QUOTES, $charset); if ($situation) $aff_column .= "
$situation"; } else if ($colonnesarray[$i]=="groupexpl_name") { $id_column = "id='groupexpl_name_".$expl->expl_cb."'"; $colencours = groupexpls::get_group_name_expl($expl->expl_cb); $aff_column = htmlentities($colencours,ENT_QUOTES, $charset); } else if ($colonnesarray[$i]=="nb_prets") { $colencours = exemplaire::get_nb_prets_from_id($expl->expl_id); $aff_column = ($colencours ? htmlentities($colencours,ENT_QUOTES, $charset) : ''); } else { $aff_column = htmlentities($colencours,ENT_QUOTES, $charset); } if ($i == 0 && $id_column ==""){ $expl_liste .= "".$aff_column.""; } else { $expl_liste .= "".$aff_column.""; } } if ($this->print_mode) { $expl_liste .= " "; } else { if(SESSrights & CATALOGAGE_AUTH){ //le panier d'exemplaire $cart_click = "onClick=\"openPopUp('".$base_path."/cart.php?object_type=EXPL&item=".$expl->expl_id."', 'cart')\""; $cart_over_out = "onMouseOver=\"show_div_access_carts(event,".$expl->expl_id.",'EXPL',1);\" onMouseOut=\"set_flag_info_div(false);\""; $cart_link = "basket"; //l'icon pour le drag&drop de panier $drag_link = "expl_cb,ENT_QUOTES, $charset)."\" draggable=\"yes\" dragtype=\"notice\" callback_before=\"show_carts\" callback_after=\"\" style=\"padding-left:7px\">"; }else{ $cart_click = ""; $cart_link = ""; $drag_link = ""; } //l'impression de la fiche exemplaire $fiche_click = "onClick=\"openPopUp('".$base_path."/pdf.php?pdfdoc=fiche_catalographique&expl_id=".$expl->expl_id."', 'Fiche', 500, 400, -2, -2, 'toolbar=no, dependent=yes, resizable=yes, scrollbars=yes')\""; $fiche_link = "".$msg ["; global $pmb_transferts_actif; //si les transferts sont activés if ($pmb_transferts_actif) { //si l'exemplaire n'est pas transferable on a une image vide $transfer_link = ""; $dispo_pour_transfert = transfert::est_transferable ( $expl->expl_id ); if (SESSrights & TRANSFERTS_AUTH && $dispo_pour_transfert) { //l'icon de demande de transfert $transfer_link = "expl_id."', 'cart', 600, 450, -2, -2, 'toolbar=no, dependent=yes, resizable=yes, scrollbars=yes');\">\"".$msg"; $expl_list_id_transfer[] = $expl->expl_id; } } else { $transfer_link = ""; } //on met tout dans la colonne $expl_liste .= "".((isset($fiche_link) && $fiche_link) ? $fiche_link." " : "").((isset($cart_link) && $cart_link) ? $cart_link." " : "").((isset($transfer_link) && $transfer_link) ? $transfer_link." " : "").((isset($drag_link) && $drag_link) ? $drag_link : "").""; } if ($pmb_pret_groupement || $pmb_transferts_actif) { $expl_liste .= ""; } $expl_liste .= ""; if (($expl->expl_note || $expl->expl_comment) && $pmb_expl_list_display_comments) { $notcom=array(); $expl_liste .= ""; if ($expl->expl_note && ($pmb_expl_list_display_comments & 1)) $notcom[] .= "$expl->expl_note"; if ($expl->expl_comment && ($pmb_expl_list_display_comments & 2)) $notcom[] .= "".nl2br($expl->expl_comment).""; $expl_liste .= implode("
",$notcom); $expl_liste .= ""; } } // fin while } // fin il y a des expl visibles if ($expl_liste) { $entry = ""; if($pmb_pret_groupement || $pmb_transferts_actif) { if ($pmb_pret_groupement) $on_click_groupexpl = "if(check_if_checked(document.getElementById('".$prefix."_expl_list_id').value,'groupexpl')) openPopUp('./select.php?what=groupexpl&caller=form_".$prefix."_expl&expl_list_id='+get_expl_checked(document.getElementById('".$prefix."_expl_list_id').value), 'selector')"; if ($pmb_transferts_actif) $on_click_transferts = "if(check_if_checked(document.getElementById('".$prefix."_expl_list_id_transfer').value,'transfer')) openPopUp('./catalog/transferts/transferts_popup.php?expl='+get_expl_checked(document.getElementById('".$prefix."_expl_list_id_transfer').value), 'selector')"; $entry .= "
".$msg["notice_for_expl_checked"]." ".($pmb_pret_groupement ? "  " : "")." ".($pmb_transferts_actif ? "" : "")."
"; } // On ne propose pas le tri en impression ainsi qu'avec les commentaires (on ne sait pas encore faire) if ($this->print_mode || $pmb_expl_list_display_comments) { $entry .= ""; } else { $entry .= "
"; } $entry .= ""; for ($i=0; $ino_special_fields) { $id=substr($colonnesarray[$i],1); $entry.=""; } } else { eval ("\$colencours=\$msg['expl_header_".$colonnesarray[$i]."'];"); $entry.=""; } } $entry.=""; if($pmb_pret_groupement || $pmb_transferts_actif) { if(!is_array($expl_list_id_transfer)) { $expl_list_id_transfer = array(); } $entry.=""; } $entry .="$expl_liste
".htmlentities($cp->t_fields[$id]['TITRE'],ENT_QUOTES,$charset)."".htmlentities($colencours,ENT_QUOTES, $charset)." 
"; } else $entry = ""; if($pmb_expl_display_location_without_expl){ if ($pmb_sur_location_activate) { $array_surloc = array(); $requete = "SELECT * FROM sur_location ORDER BY surloc_libelle"; $result = pmb_mysql_query($requete) or die ("
".pmb_mysql_error()."
".$requete); $nb_surloc = pmb_mysql_num_rows($result); if ($nb_surloc) { while($surloc = pmb_mysql_fetch_object($result)) { $array_surloc[]=array("id"=>$surloc->surloc_id, "libelle"=>$surloc->surloc_libelle, "locations"=>array()); } } if (count($array_surloc)) { foreach ($array_surloc as $key=>$surloc) { $requete = "SELECT idlocation, location_libelle from docs_location where surloc_num=".$surloc["id"]." AND idlocation not in (SELECT expl_location from exemplaires WHERE expl_notice=$no_notice) order by location_libelle"; $result = pmb_mysql_query($requete) or die ("
".pmb_mysql_error()."
".$requete); $nb_loc = pmb_mysql_num_rows($result); if ($nb_loc) { while($loc = pmb_mysql_fetch_object($result)) { $array_surloc[$key]["locations"][] = array("id"=>$loc->idlocation, "libelle"=>$loc->location_libelle); } } else { unset($array_surloc[$key]); } } } //Au moins une surloc à afficher if (count($array_surloc)) { $tr_surloc=""; foreach ($array_surloc as $key => $surloc) { $tr_surloc.=""; $tr_loc=""; foreach ($surloc["locations"] as $keyloc => $loc) { $tr_loc.="".$loc["libelle"].""; } $tpl_surloc= " $tr_loc
"; $tr_surloc.=gen_plus('surlocation_without_expl'.$key.'_'.$no_notice,$surloc["libelle"],$tpl_surloc,0); $tr_surloc.=""; } $tpl = " $tr_surloc
"; $entry.=gen_plus('location_without_expl'.$no_notice,$msg['expl_surlocation_without_expl'],$tpl,0); } } else { $requete = "SELECT location_libelle from docs_location where idlocation not in (SELECT expl_location from exemplaires WHERE expl_notice=$no_notice) order by location_libelle"; $result = pmb_mysql_query($requete) or die ("
".pmb_mysql_error()."
".$requete); $nb_loc = pmb_mysql_num_rows($result); if ($nb_loc) { $items=""; while($loc = pmb_mysql_fetch_object($result)) { $items.="".$loc->location_libelle.""; } $tpl = " $items
"; $tpl=gen_plus('location_without_expl'.$no_notice,$msg['expl_location_without_expl'],$tpl,0); $entry.=$tpl; } } } $this->nb_expl=$nbr_expl; return $entry; } else { return ""; } } public function show_orders_pnb($notice_id) { $pnb_record_orders = new pnb_record_orders($notice_id); $this->nb_expl = $pnb_record_orders->get_orders_number(); return $pnb_record_orders->get_display_orders(); } // finalisation du résultat (écriture de l'isbd) public function finalize() { $this->result = str_replace('!!ISBD!!', $this->isbd, $this->result); } public function get_context_parameters() { return $this->context_parameters; } public function set_context_parameters($context_parameters=array()) { $this->context_parameters = $context_parameters; } public function add_context_parameter($key, $value) { $this->context_parameters[$key] = $value; } public function delete_context_parameter($key) { unset($this->context_parameters[$key]); } /** * Retourne une instance de record_datas * @param int $notice_id Identifiant de la notice * @return record_datas */ static public function get_record_datas($notice_id) { if (!isset(self::$records_datas[$notice_id])) { self::$records_datas[$notice_id] = new record_datas($notice_id); } return self::$records_datas[$notice_id]; } static public function lookup($name, $object) { $return = null; // Si on le nom commence par record. on va chercher les méthodes if (substr($name, 0, 8) == ":record.") { $attributes = explode('.', $name); $notice_id = $object->getVariable('notice_id'); // On va chercher dans record_display $return = static::look_for_attribute_in_class("record_display", $attributes[1], array($notice_id)); if (!$return) { // On va chercher dans record_datas $record_datas = static::get_record_datas($notice_id); $return = static::look_for_attribute_in_class($record_datas, $attributes[1]); } // On regarde les attributs enfants recherchés if ($return && count($attributes) > 2) { for ($i = 2; $i < count($attributes); $i++) { // On regarde si c'est un tableau ou un objet if (is_array($return)) { $return = (isset($return[$attributes[$i]]) ? $return[$attributes[$i]] : ''); } else if (is_object($return)) { $return = static::look_for_attribute_in_class($return, $attributes[$i]); } else { $return = null; break; } } } } else { $attributes = explode('.', $name); // On regarde si on a directement une instance d'objet, dans le cas des boucles for if (is_object($obj = $object->getVariable(substr($attributes[0], 1))) && (count($attributes) > 1)) { $return = $obj; for ($i = 1; $i < count($attributes); $i++) { // On regarde si c'est un tableau ou un objet if (is_array($return)) { $return = $return[$attributes[$i]]; } else if (is_object($return)) { $return = static::look_for_attribute_in_class($return, $attributes[$i]); } else { $return = null; break; } } } } return $return; } static protected function look_for_attribute_in_class($class, $attribute, $parameters = array()) { if (is_object($class) && (isset($class->{$attribute}) || method_exists($class, '__get'))) { return $class->{$attribute}; } else if (method_exists($class, $attribute)) { return call_user_func_array(array($class, $attribute), $parameters); } else if (method_exists($class, "get_".$attribute)) { return call_user_func_array(array($class, "get_".$attribute), $parameters); } else if (method_exists($class, "is_".$attribute)) { return call_user_func_array(array($class, "is_".$attribute), $parameters); } return null; } static private function render($notice_id, $tpl, $unimarc = false, $parameters = '') { $h2o = H2o_collection::get_instance($tpl); H2o_collection::addLookup("record_display::lookup"); return $h2o->render(array('notice_id' => $notice_id, 'unimarc' => $unimarc, 'parameters'=>$parameters)); } /** * Génère le titre nécessaire à Zotéro * @param int $id_notice Identifiant de la notice * @return string */ static public function get_display_coins_title($notice_id){ $display = ''; $record_datas = static::get_record_datas($notice_id); $coins = $record_datas->get_coins(); foreach ($coins as $key=>$value) { if(is_array($value)) { //Spécifique rft.aut foreach ($value as $sub_value) { $display .= "&".$key."=".rawurlencode(encoding_normalize::utf8_normalize($sub_value)); } } else { $display .= "&".$key."=".rawurlencode(encoding_normalize::utf8_normalize($value)); } } return $display; } /** * Génère le span nécessaire à Zotéro * @param int $id_notice Identifiant de la notice * @return string */ static public function get_display_coins_span($notice_id){ // Attention!! Fait pour Zotero qui ne traite pas toute la norme ocoins global $charset; $record_datas = static::get_record_datas($notice_id); // http://generator.ocoins.info/?sitePage=info/book.html& // http://ocoins.info/cobg.html $coins_span="".htmlentities($expl[$label], ENT_QUOTES, $charset).""; } else if ($label=="expl_comment") { $column.="".nl2br(htmlentities($expl[$label],ENT_QUOTES, $charset)).""; } elseif ($label=="expl_cb") { $column.="".htmlentities($expl[$label],ENT_QUOTES, $charset).""; } else { $column .="".htmlentities($expl[$label],ENT_QUOTES, $charset).""; } return $column; } static public function get_display_situation($expl) { global $msg, $charset; global $opac_show_empr ; global $pmb_transferts_actif, $transferts_statut_transferts; $situation = ""; if ($expl['statut_libelle_opac'] != "") $situation .= $expl['statut_libelle_opac']."
"; if ($expl['flag_resa']) { $situation .= "".$msg['expl_reserve'].""; } else { if ($expl['pret_flag']) { if($expl['pret_retour']) { // exemplaire sorti if ((($opac_show_empr==1) && ($_SESSION["user_code"])) || ($opac_show_empr==2)) { $situation .= $msg['entete_show_empr'].htmlentities(" ".$expl['empr_prenom']." ".$expl['empr_nom'],ENT_QUOTES, $charset)."
"; } $situation .= "".str_replace('!!date!!', formatdate($expl['pret_retour']), $msg['out_until'] ).""; // ****** Affichage de l'emprunteur } else { // pas sorti $situation .= "".$msg['available'].""; } } else { // pas prêtable // exemplaire pas prêtable, on affiche juste "exclu du pret" if (($pmb_transferts_actif=="1") && ("".$expl['expl_statut'].""==$transferts_statut_transferts)) { $situation .= "".$msg['reservation_lib_entransfert'].""; } else { $situation .= "".$msg['exclu'].""; } } } // fin if else $flag_resa return $situation; } /** * Génère la liste des exemplaires * @param int $notice_id Identifiant de la notice * @return string */ static public function get_display_expl_list($notice_id) { global $msg, $charset; global $expl_list_header, $expl_list_footer; global $pmb_transferts_actif,$transferts_statut_transferts; global $memo_p_perso_expl; global $opac_show_empty_items_block ; global $opac_show_exemplaires_analysis; global $expl_list_header_loc_tpl,$opac_aff_expl_localises; $nb_expl_visible = 0; $nb_expl_autre_loc=0; $nb_perso_aff=0; $record_datas = static::get_record_datas($notice_id); $type = $record_datas->get_niveau_biblio(); $id = $record_datas->get_id(); $bull = $record_datas->get_bul_info(); $bull_id = $bull['bulletin_id']; // les dépouillements ou périodiques n'ont pas d'exemplaire if (($type=="a" && !$opac_show_exemplaires_analysis) || $type=="s") return "" ; if(!$memo_p_perso_expl) $memo_p_perso_expl=new parametres_perso("expl"); $header_found_p_perso=0; $expls_datas = $record_datas->get_expls_datas(); $expl_list_header_deb=""; if (isset($expls_datas['colonnesarray']) && is_array($expls_datas['colonnesarray'])) { foreach ($expls_datas['colonnesarray'] as $colonne) { $expl_list_header_deb .= "".htmlentities($msg['expl_header_'.$colonne],ENT_QUOTES, $charset).""; } } $expl_list_header_deb.="".$msg['statut'].""; $expl_liste=""; if(is_array($expls_datas['expls']) && count($expls_datas['expls'])) { foreach ($expls_datas['expls'] as $expl) { $expl_liste .= ""; foreach ($expls_datas['colonnesarray'] as $colonne) { $expl_liste .= static::get_display_column($colonne, $expl); } if ($expl['flag_resa']) { $class_statut = "expl_reserve"; } else { if ($expl['pret_flag']) { if($expl['pret_retour']) { // exemplaire sorti $class_statut = "expl_out"; } else { // pas sorti $class_statut = "expl_available"; } } else { // pas prêtable // exemplaire pas prêtable, on affiche juste "exclu du pret" if (($pmb_transferts_actif=="1") && ("".$expl['expl_statut'].""==$transferts_statut_transferts)) { $class_statut = "expl_transfert"; } else { $class_statut = "expl_unavailable"; } } } // fin if else $flag_resa $expl_liste .= "".static::get_display_situation($expl)." "; $expl_liste = str_replace("!!class_statut!!", $class_statut, $expl_liste); //Champs personalisés $perso_aff = "" ; if (!$memo_p_perso_expl->no_special_fields) { $perso_=$memo_p_perso_expl->show_fields($expl['expl_id']); for ($i=0; $i"; $nb_perso_aff++; } if( $p["AFF"] !== '') { $perso_aff.="".$p["AFF"].""; } else $perso_aff.=""; } } } $header_found_p_perso=1; $expl_liste.=$perso_aff; $expl_liste .=""; $expl_liste_all.=$expl_liste; if($opac_aff_expl_localises && $_SESSION["empr_location"]) { if($expl['expl_location']==$_SESSION["empr_location"]) { $expl_liste_loc.=$expl_liste; } else $nb_expl_autre_loc++; } $expl_liste=""; $nb_expl_visible++; } // fin foreach } $expl_list_header_deb="".$expl_list_header_deb; //S'il y a des titres de champs perso dans les exemplaires if($header_perso_aff) { $expl_list_header_deb.=$header_perso_aff; } $expl_list_header_deb.=""; if($opac_aff_expl_localises && $_SESSION["empr_location"] && $nb_expl_autre_loc) { // affichage avec onglet selon la localisation if(!$expl_liste_loc) { $expl_liste_loc="".$msg["no_expl"].""; } $expl_liste_all=str_replace("!!EXPL!!",$expl_list_header_deb.$expl_liste_all,$expl_list_header_loc_tpl); $expl_liste_all=str_replace("!!EXPL_LOC!!",$expl_list_header_deb.$expl_liste_loc,$expl_liste_all); $expl_liste_all=str_replace("!!mylocation!!",$_SESSION["empr_location_libelle"],$expl_liste_all); $expl_liste_all=str_replace("!!id!!",$id+$bull_id,$expl_liste_all); } else { // affichage de la liste d'exemplaires calculée ci-dessus if (!$expl_liste_all && $opac_show_empty_items_block==1) { $expl_liste_all = $expl_list_header.$expl_list_header_deb."".$msg["no_expl"]."".$expl_list_footer; } elseif (!$expl_liste_all && $opac_show_empty_items_block==0) { $expl_liste_all = ""; } else { $expl_liste_all = $expl_list_header.$expl_list_header_deb.$expl_liste_all.$expl_list_footer; } } $expl_liste_all=str_replace("",($nb_expl_visible ? " (".$nb_expl_visible.")" : ""),$expl_liste_all); return $expl_liste_all; } // fin function get_display_expl_list /** * Génère la liste des exemplaires * @param int $notice_id Identifiant de la notice * @return string */ static public function get_display_expl_responsive_list($notice_id) { global $dbh; global $msg, $charset; global $expl_list_header, $expl_list_footer; global $opac_expl_data, $opac_expl_order, $opac_url_base; global $pmb_transferts_actif,$transferts_statut_transferts; global $memo_p_perso_expl; global $opac_show_empty_items_block ; global $opac_show_exemplaires_analysis; global $expl_list_header_loc_tpl,$opac_aff_expl_localises; $nb_expl_visible = 0; $nb_expl_autre_loc=0; $nb_perso_aff=0; $record_datas = static::get_record_datas($notice_id); if(!$record_datas->is_numeric()){ $type = $record_datas->get_niveau_biblio(); $id = $record_datas->get_id(); $bull = $record_datas->get_bul_info(); $bull_id = (isset($bull['bulletin_id']) ? $bull['bulletin_id'] : ''); // les dépouillements ou périodiques n'ont pas d'exemplaire if (($type=="a" && !$opac_show_exemplaires_analysis) || $type=="s") return "" ; if(!$memo_p_perso_expl) $memo_p_perso_expl=new parametres_perso("expl"); $header_found_p_perso=0; $expls_datas = $record_datas->get_expls_datas(); $expl_list_header_deb=""; foreach ($expls_datas['colonnesarray'] as $colonne) { $expl_list_header_deb .= "".htmlentities($msg['expl_header_'.$colonne],ENT_QUOTES, $charset).""; } $expl_list_header_deb.="".$msg['statut'].""; $expl_liste=""; $expl_liste_all=""; $header_perso_aff=""; if(count($expls_datas['expls'])) { $customization_expl_columns = array(); $special = static::get_special($notice_id); if(!empty($special) && method_exists($special, "get_customization_expl_columns")) { $customization_expl_columns = $special->get_customization_expl_columns(); } foreach ($expls_datas['expls'] as $expl) { $expl_liste .= ""; foreach ($expls_datas['colonnesarray'] as $colonne) { if(isset($customization_expl_columns[$colonne])) { $expl_liste .=""; if(isset($customization_expl_columns[$colonne]['htmlentities']) && $customization_expl_columns[$colonne]['htmlentities'] == false) { $expl_liste .=strip_tags($expl[$colonne], $customization_expl_columns[$colonne]['keep_tags']); } else { $expl_liste .=htmlentities($expl[$colonne],ENT_QUOTES, $charset); } $expl_liste .=""; } elseif (($colonne == "location_libelle") && $expl['num_infopage']) { if ($expl['surloc_id'] != "0") { $param_surloc="&surloc=".$expl['surloc_id']; } else { $param_surloc=""; } $expl_liste .="".htmlentities($expl[$colonne], ENT_QUOTES, $charset).""; } elseif($colonne == "expl_cb") { $expl_liste .="".htmlentities($expl[$colonne],ENT_QUOTES, $charset).""; } else { $expl_liste .="".htmlentities($expl[$colonne],ENT_QUOTES, $charset).""; } } if ($expl['flag_resa']) { $class_statut = "expl_reserve"; } else { if ($expl['pret_flag']) { if($expl['pret_retour']) { // exemplaire sorti $class_statut = "expl_out"; } else { // pas sorti $class_statut = "expl_available"; } } else { // pas prêtable // exemplaire pas prêtable, on affiche juste "exclu du pret" if (($pmb_transferts_actif=="1") && ("".$expl['expl_statut'].""==$transferts_statut_transferts)) { $class_statut = "expl_transfert"; } else { $class_statut = "expl_unavailable"; } } } // fin if else $flag_resa $expl_liste .= "".static::get_display_situation($expl)." "; $expl_liste = str_replace("!!class_statut!!", $class_statut, $expl_liste); //Champs personalisés $perso_aff = "" ; if (!$memo_p_perso_expl->no_special_fields) { $perso_=$memo_p_perso_expl->show_fields($expl['expl_id']); for ($i=0; $i"; $nb_perso_aff++; } if( $p["AFF"] !== '') { $perso_aff.="".$p["AFF"].""; } else $perso_aff.=""; } } } $header_found_p_perso=1; $expl_liste.=$perso_aff; $expl_liste .=""; $expl_liste_all.= $expl_liste; if($opac_aff_expl_localises && $_SESSION["empr_location"]) { if($expl['expl_location']==$_SESSION["empr_location"]) { $expl_liste_loc.=$expl_liste; } else { $nb_expl_autre_loc++; } } $expl_liste=""; $nb_expl_visible++; } // fin foreach } //S'il y a des titres de champs perso dans les exemplaires if($header_perso_aff) { $expl_list_header_deb.=$header_perso_aff; } $expl_list_header_deb.=""; if($opac_aff_expl_localises && $_SESSION["empr_location"] && $nb_expl_autre_loc) { // affichage avec onglet selon la localisation if(!$expl_liste_loc) { $expl_liste_loc="".$msg["no_expl"].""; } $expl_liste_all=str_replace("!!EXPL!!",$expl_list_header_deb.$expl_liste_all,$expl_list_header_loc_tpl); $expl_liste_all=str_replace("!!EXPL_LOC!!",$expl_list_header_deb.$expl_liste_loc,$expl_liste_all); $expl_liste_all=str_replace("!!mylocation!!",$_SESSION["empr_location_libelle"],$expl_liste_all); $expl_liste_all=str_replace("!!id!!",$id+$bull_id,$expl_liste_all); } else { // affichage de la liste d'exemplaires calculée ci-dessus if (!$expl_liste_all && $opac_show_empty_items_block==1) { $expl_liste_all = $expl_list_header.$expl_list_header_deb."".$msg["no_expl"]."".$expl_list_footer; } elseif (!$expl_liste_all && $opac_show_empty_items_block==0) { $expl_liste_all = ""; } else { $expl_liste_all = $expl_list_header.$expl_list_header_deb.$expl_liste_all.$expl_list_footer; } } $expl_liste_all=str_replace("",($nb_expl_visible ? " (".$nb_expl_visible.")" : ""),$expl_liste_all); return $expl_liste_all; } return ''; } // fin function get_display_expl_responsive_list /** * Fontion qui génère le bloc H3 + table des autres lectures * @param number $notice_id Identifiant de la notice * @param number $bulletin_id Identifiant du bulletin * @return string */ static public function get_display_other_readings($notice_id) { global $dbh, $msg; global $opac_autres_lectures_tri; global $opac_autres_lectures_nb_mini_emprunts; global $opac_autres_lectures_nb_maxi; global $opac_autres_lectures_nb_jours_maxi; global $opac_autres_lectures; global $gestion_acces_active,$gestion_acces_empr_notice; $record_datas = static::get_record_datas($notice_id); $bull = $record_datas->get_bul_info(); $bulletin_id = (isset($bull['bulletin_id']) ? $bull['bulletin_id'] : ''); if (!$opac_autres_lectures || (!$notice_id && !$bulletin_id)) return ""; if (!$opac_autres_lectures_nb_maxi) $opac_autres_lectures_nb_maxi = 999999 ; if ($opac_autres_lectures_nb_jours_maxi) $restrict_date=" date_add(oal.arc_fin, INTERVAL $opac_autres_lectures_nb_jours_maxi day)>=sysdate() AND "; else $restrict_date=""; if ($notice_id) $pas_notice = " oal.arc_expl_notice!=$notice_id AND "; else $pas_notice = ""; if ($bulletin_id) $pas_bulletin = " oal.arc_expl_bulletin!=$bulletin_id AND "; else $pas_bulletin = ""; // Ajout ici de la liste des notices lues par les lecteurs de cette notice $rqt_autres_lectures = "SELECT oal.arc_expl_notice, oal.arc_expl_bulletin, count(*) AS total_prets, trim(concat(ifnull(notices_m.tit1,''),ifnull(notices_s.tit1,''),' ',ifnull(bulletin_numero,''), if(mention_date, concat(' (',mention_date,')') ,if (date_date, concat(' (',date_format(date_date, '%d/%m/%Y'),')') ,'')))) as tit, if(notices_m.notice_id, notices_m.notice_id, notices_s.notice_id) as not_id FROM ((((pret_archive AS oal JOIN (SELECT distinct arc_id_empr FROM pret_archive nbec where (nbec.arc_expl_notice='".$notice_id."' AND nbec.arc_expl_bulletin='".$bulletin_id."') AND nbec.arc_id_empr !=0) as nbec ON (oal.arc_id_empr=nbec.arc_id_empr and oal.arc_id_empr!=0 and nbec.arc_id_empr!=0)) LEFT JOIN notices AS notices_m ON arc_expl_notice = notices_m.notice_id ) LEFT JOIN bulletins ON arc_expl_bulletin = bulletins.bulletin_id) LEFT JOIN notices AS notices_s ON bulletin_notice = notices_s.notice_id) WHERE $restrict_date $pas_notice $pas_bulletin oal.arc_id_empr !=0 GROUP BY oal.arc_expl_notice, oal.arc_expl_bulletin HAVING total_prets>=$opac_autres_lectures_nb_mini_emprunts ORDER BY $opac_autres_lectures_tri "; $res_autres_lectures = pmb_mysql_query($rqt_autres_lectures) or die ("
".pmb_mysql_error()."
".$rqt_autres_lectures."
"); if (pmb_mysql_num_rows($res_autres_lectures)) { $odd_even=1; $inotvisible=0; $ret=""; //droits d'acces emprunteur/notice $acces_j=''; if ($gestion_acces_active==1 && $gestion_acces_empr_notice==1) { $ac= new acces(); $dom_2= $ac->setDomain(2); $acces_j = $dom_2->getJoin($_SESSION['id_empr_session'],4,'notice_id'); } if($acces_j) { $statut_j=''; $statut_r=''; } else { $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)":"").")"; } while (($data=pmb_mysql_fetch_array($res_autres_lectures))) { // $inotvisible<=$opac_autres_lectures_nb_maxi $requete = "SELECT 1 "; $requete .= " FROM notices $acces_j $statut_j WHERE notice_id='".$data['not_id']."' $statut_r "; $myQuery = pmb_mysql_query($requete, $dbh); if (pmb_mysql_num_rows($myQuery) && $inotvisible<=$opac_autres_lectures_nb_maxi) { // pmb_mysql_num_rows($myQuery) $inotvisible++; $titre = $data['tit']; // ********** $responsab = array("responsabilites" => array(),"auteurs" => array()); // les auteurs $responsab = get_notice_authors($data['not_id']) ; $as = array_search ("0", $responsab["responsabilites"]) ; if ($as!== FALSE && $as!== NULL) { $auteur_0 = $responsab["auteurs"][$as] ; $auteur = new auteur($auteur_0["id"]); $mention_resp = $auteur->get_isbd(); } else { $aut1_libelle = array(); $as = array_keys ($responsab["responsabilites"], "1" ) ; for ($i = 0 ; $i < count($as) ; $i++) { $indice = $as[$i] ; $auteur_1 = $responsab["auteurs"][$indice] ; $auteur = new auteur($auteur_1["id"]); $aut1_libelle[]= $auteur->get_isbd(); } $mention_resp = implode (", ",$aut1_libelle) ; } $mention_resp ? $auteur = $mention_resp : $auteur=""; // on affiche les résultats if ($odd_even==0) { $pair_impair="odd"; $odd_even=1; } else if ($odd_even==1) { $pair_impair="even"; $odd_even=0; } if ($data['arc_expl_notice']) $tr_javascript=" class='$pair_impair' onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='$pair_impair'\" onmousedown=\"document.location='./index.php?lvl=notice_display&id=".$data['not_id']."&seule=1';\" style='cursor: pointer' "; else $tr_javascript=" class='$pair_impair' onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='$pair_impair'\" onmousedown=\"document.location='./index.php?lvl=bulletin_display&id=".$data['arc_expl_bulletin']."';\" style='cursor: pointer' "; $ret .= ""; $ret .= "".$titre.""; $ret .= "".$auteur.""; $ret .= "\n"; } } if ($ret) $ret = "

".$msg['autres_lectures']."

".$ret."
"; } else $ret=""; return $ret; } // fin autres_lectures ($notice_id=0,$bulletin_id=0) /** * Ajoute l'image * @param int $notice_id Identifiant de la notice * @param string $entree Contenu avant l'ajout * @param int $depliable */ static public function do_image($notice_id, &$entree,$depliable) { global $charset; global $msg; $record_datas = static::get_record_datas($notice_id); $image = ""; if ($record_datas->get_code() || $record_datas->get_thumbnail_url()) { if (static::get_parameter_value('show_book_pics')=='1' && (static::get_parameter_value('book_pics_url') || $record_datas->get_thumbnail_url())) { $url_image_ok=getimage_url($record_datas->get_code(), $record_datas->get_thumbnail_url()); $title_image_ok = ""; if(!$record_datas->get_thumbnail_url()){ $title_image_ok = htmlentities(static::get_parameter_value('book_pics_msg'), ENT_QUOTES, $charset); } if(!trim($title_image_ok)){ $title_image_ok = htmlentities($record_datas->get_tit1(), ENT_QUOTES, $charset); } if ($depliable) { $image = "".$msg["opac_notice_vignette_alt"].""; } else { $image = "".$msg["opac_notice_vignette_alt"].""; } } } if ($image) { $entree = "
$entree$image
" ; } else { $entree = "
$entree
" ; } } /** * Retourne le script des notices similaires * @return string */ static public function get_display_simili_script($notice_id) { switch (static::get_parameter_value('allow_simili_search')) { case "0" : $script_simili_search = ""; break; case "1" : $script_simili_search = "show_simili_search('".$notice_id."');"; $script_simili_search.= "show_expl_voisin_search('".$notice_id."');"; break; case "2" : $script_simili_search = "show_expl_voisin_search('".$notice_id."');"; break; case "3" : $script_simili_search = "show_simili_search('".$notice_id."');"; break; } return $script_simili_search; } /** * Retourne les notices similaires * @param int $notice_id Identifiant de la notice * @return string */ static public function get_display_simili_search($notice_id) { $simili_search = ""; switch(static::get_parameter_value('allow_simili_search')){ case "1" : $simili_search=" "; $simili_search.=" "; break; case "2" : $simili_search=" "; $simili_search.=" "; break; case "3" : $simili_search=" "; $simili_search.=" "; break; } return $simili_search; } /** * Renvoie les états de collections * @param int $notice_id Identifiant de la notice * @return mixed */ static public function get_display_collstate($notice_id) { global $msg; global $pmb_etat_collections_localise; $affichage = ""; $record_datas = static::get_record_datas($notice_id); $collstate = $record_datas->get_collstate(); if($pmb_etat_collections_localise) { $collstate->get_display_list("",0,0,0,1); } else { $collstate->get_display_list("",0,0,0,0); } if($collstate->nbr) { $affichage.= "

".$msg["perio_etat_coll"]."

"; $affichage.=$collstate->liste; } return $affichage; } static public function get_lang_list($tableau) { $langues = ""; $nb_langues = count($tableau); for ($i = 0 ; $i < $nb_langues; $i++) { if (!empty($langues)) { $langues .= " "; } $langues .= $tableau[$i]["langue"]." (".$tableau[$i]["lang_code"].")"; } return $langues; } /** * Fonction d'affichage des avis * @param int $notice_id Identifiant de la notice */ static public function get_display_avis($notice_id) { $record_datas = static::get_record_datas($notice_id); $avis = $record_datas->get_avis(); return $avis->get_display(); } static public function get_display_avis_detail($notice_id) { $record_datas = static::get_record_datas($notice_id); $avis = $record_datas->get_avis(); return $avis->get_display_detail(); } static public function get_display_avis_only_stars($notice_id) { $record_datas = static::get_record_datas($notice_id); $avis = $record_datas->get_avis(); return $avis->get_display_only_stars(); } /** * Retourne l'affichage des étoiles * @param float $moyenne */ /** * Fonction d'affichage des suggestions * @param int $notice_id Identifiant de la notice * @return string */ static public function get_display_suggestion($notice_id){ global $msg; $do_suggest="".$msg['suggest_notice_opac'].""; return $do_suggest; } /** * Fonction d'affichage des tags * @param int $notice_id Identifiant de la notice * @return string */ static public function get_display_tag($notice_id){ global $msg; return "".$msg['notice_title_tag'].""; } /** * Fonction d'affichage des listes de lecture * @param int $notice_id Identifiant de la notice * @return string */ static public function get_display_liste_lecture($notice_id){ global $msg; return " \"".$msg['notice_title_liste_lecture']."\" ".$msg['notice_title_liste_lecture']."
".$msg['notice_title_liste_lecture']."
".liste_lecture::gen_selector_my_list($notice_id)."
"; } /** * Retourne l'affichage étendu d'une notice * @param int $notice_id Identifiant de la notice * @param string $django_directory Répertoire Django à utiliser * @return string Code html d'affichage de la notice */ static public function get_display_extended($notice_id, $django_directory = "") { $record_datas = static::get_record_datas($notice_id); $template = static::get_template("record_extended_display", $record_datas->get_niveau_biblio(), $record_datas->get_typdoc(), $django_directory); return static::render($notice_id, $template); } /** * Retourne l'affichage d'une notice dans un résultat de recherche * @param int $notice_id Identifiant de la notice * @param string $django_directory Répertoire Django à utiliser * @return string Code html d'affichage de la notice */ static public function get_display_in_result($notice_id, $django_directory = "") { $record_datas = static::get_record_datas($notice_id); $template = static::get_template("record_in_result_display", $record_datas->get_niveau_biblio(), $record_datas->get_typdoc(), $django_directory); return static::render($notice_id, $template); } /** * Retourne l'affichage d'une notice pour impression sur imprimante format court * @param int $notice_id Identifiant de la notice * @param string $django_directory Répertoire Django à utiliser * @param array $parameters Permet un affichage dynamique en fonction de champs de formulaire par exemple * @return string Code html d'affichage de la notice */ static public function get_display_for_printer_short($notice_id, $django_directory = "", $parameters = '') { $record_datas = static::get_record_datas($notice_id); $record_datas->set_external_parameters($parameters); $template = static::get_template("record_for_printer_short", $record_datas->get_niveau_biblio(), $record_datas->get_typdoc(), $django_directory); return static::render($notice_id, $template); } /** * Retourne l'affichage d'une notice pour impression sur imprimante format court * @param int $notice_id Identifiant de la notice * @param string $django_directory Répertoire Django à utiliser * @param array $parameters Permet un affichage dynamique en fonction de champs de formulaire par exemple * @return string Code html d'affichage de la notice */ static public function get_display_for_printer_short_unimarc($notice_id, $django_directory = "", $parameters = '') { global $include_path; $record_datas = static::get_record_datas($notice_id); $record_datas->set_external_parameters($parameters); $template = static::get_template("record_unimarc_for_printer_short", $record_datas->get_niveau_biblio(), $record_datas->get_typdoc(), $django_directory); return static::render($notice_id, $template, true, $parameters); } /** * Retourne l'affichage d'une notice pour impression sur imprimante format long * @param int $notice_id Identifiant de la notice * @param string $django_directory Répertoire Django à utiliser * @param array $parameters Permet un affichage dynamique en fonction de champs de formulaire par exemple * @return string Code html d'affichage de la notice */ static public function get_display_for_printer_extended($notice_id, $django_directory = "", $parameters = '') { $record_datas = static::get_record_datas($notice_id); $record_datas->set_external_parameters($parameters); $template = static::get_template("record_for_printer_extended", $record_datas->get_niveau_biblio(), $record_datas->get_typdoc(), $django_directory); return static::render($notice_id, $template); } /** * Retourne l'affichage d'une notice pour impression sur imprimante format long * @param int $notice_id Identifiant de la notice * @param string $django_directory Répertoire Django à utiliser * @param array $parameters Permet un affichage dynamique en fonction de champs de formulaire par exemple * @return string Code html d'affichage de la notice */ static public function get_display_for_printer_extended_unimarc($notice_id, $django_directory = "", $parameters = '') { global $include_path; $record_datas = static::get_record_datas($notice_id); $record_datas->set_external_parameters($parameters); $template = static::get_template("record_unimarc_for_printer_extended", $record_datas->get_niveau_biblio(), $record_datas->get_typdoc(), $django_directory); return static::render($notice_id, $template, true, $parameters); } /** * Retourne l'affichage d'une notice pour impression sur pdf format court * @param int $notice_id Identifiant de la notice * @param string $django_directory Répertoire Django à utiliser * @param array $parameters Permet un affichage dynamique en fonction de champs de formulaire par exemple * @return string Code html d'affichage de la notice */ static public function get_display_for_pdf_short($notice_id, $django_directory = "", $parameters = '') { $record_datas = static::get_record_datas($notice_id); $record_datas->set_external_parameters($parameters); $template = static::get_template("record_for_pdf_short", $record_datas->get_niveau_biblio(), $record_datas->get_typdoc(), $django_directory); return static::render($notice_id, $template); } /** * Retourne l'affichage d'une notice pour impression sur pdf format court * @param int $notice_id Identifiant de la notice * @param string $django_directory Répertoire Django à utiliser * @param array $parameters Permet un affichage dynamique en fonction de champs de formulaire par exemple * @return string Code html d'affichage de la notice */ static public function get_display_for_pdf_short_unimarc($notice_id, $django_directory = "", $parameters = '') { global $include_path; $record_datas = static::get_record_datas($notice_id); $record_datas->set_external_parameters($parameters); $template = static::get_template("record_unimarc_for_pdf_short", $record_datas->get_niveau_biblio(), $record_datas->get_typdoc(), $django_directory); return static::render($notice_id, $template, true, $parameters); } /** * Retourne l'affichage d'une notice pour impression sur pdf format long * @param int $notice_id Identifiant de la notice * @param string $django_directory Répertoire Django à utiliser * @param array $parameters Permet un affichage dynamique en fonction de champs de formulaire par exemple * @return string Code html d'affichage de la notice */ static public function get_display_for_pdf_extended($notice_id, $django_directory = "", $parameters = '') { $record_datas = static::get_record_datas($notice_id); $record_datas->set_external_parameters($parameters); $template = static::get_template("record_for_pdf_extended", $record_datas->get_niveau_biblio(), $record_datas->get_typdoc(), $django_directory); return static::render($notice_id, $template); } /** * Retourne l'affichage d'une notice pour impression sur pdf format long * @param int $notice_id Identifiant de la notice * @param string $django_directory Répertoire Django à utiliser * @param array $parameters Permet un affichage dynamique en fonction de champs de formulaire par exemple * @return string Code html d'affichage de la notice */ static public function get_display_for_pdf_extended_unimarc($notice_id, $django_directory = "", $parameters = '') { global $include_path; $record_datas = static::get_record_datas($notice_id); $record_datas->set_external_parameters($parameters); $template = static::get_template("record_unimarc_for_pdf_extended", $record_datas->get_niveau_biblio(), $record_datas->get_typdoc(), $django_directory); return static::render($notice_id, $template, true, $parameters); } /** * Retourne l'affichage du titre de la notice sur un flux RSS * @param int $notice_id Identifiant de la notice * @param string $django_directory Répertoire Django à utiliser * @param array $parameters Permet un affichage dynamique en fonction de champs de formulaire par exemple * @return string Code html d'affichage de la notice */ static public function get_display_for_rss_title($notice_id, $django_directory = "", $parameters = '') { $record_datas = static::get_record_datas($notice_id); $record_datas->set_external_parameters($parameters); $template = static::get_template("record_for_rss_title", $record_datas->get_niveau_biblio(), $record_datas->get_typdoc(), $django_directory); return static::render($notice_id, $template); } /** * Retourne l'affichage de la description d'une notice sur un flux RSS * @param int $notice_id Identifiant de la notice * @param string $django_directory Répertoire Django à utiliser * @param array $parameters Permet un affichage dynamique en fonction de champs de formulaire par exemple * @return string Code html d'affichage de la notice */ static public function get_display_for_rss_description($notice_id, $django_directory = "", $parameters = '') { $record_datas = static::get_record_datas($notice_id); $record_datas->set_external_parameters($parameters); $template = static::get_template("record_for_rss_description", $record_datas->get_niveau_biblio(), $record_datas->get_typdoc(), $django_directory); return static::render($notice_id, $template); } /** * Retourne le bon template * @param string $template_name Nom du template : record_extended ou record_in_result * @param string $niveau_biblio Niveau bibliographique * @param string $typdoc Type de document * @param string $django_directory Répertoire Django à utiliser (paramètre opac_notices_format_django_directory par défaut) * @return string Nom du template à appeler */ static public function get_template($template_name, $niveau_biblio, $typdoc, $django_directory = "") { global $include_path; if (!$django_directory) $django_directory = static::get_parameter_value('notices_format_django_directory'); if (file_exists($include_path."/templates/record/".$django_directory."/".$template_name."_".$niveau_biblio.$typdoc.".tpl.html")) { return $include_path."/templates/record/".$django_directory."/".$template_name."_".$niveau_biblio.$typdoc.".tpl.html"; } if (file_exists($include_path."/templates/record/common/".$template_name."_".$niveau_biblio.$typdoc.".tpl.html")) { return $include_path."/templates/record/common/".$template_name."_".$niveau_biblio.$typdoc.".tpl.html"; } if (file_exists($include_path."/templates/record/".$django_directory."/".$template_name."_".$niveau_biblio.".tpl.html")) { return $include_path."/templates/record/".$django_directory."/".$template_name."_".$niveau_biblio.".tpl.html"; } if (file_exists($include_path."/templates/record/common/".$template_name."_".$niveau_biblio.".tpl.html")) { return $include_path."/templates/record/common/".$template_name."_".$niveau_biblio.".tpl.html"; } if (file_exists($include_path."/templates/record/".$django_directory."/".$template_name.".tpl.html")) { return $include_path."/templates/record/".$django_directory."/".$template_name.".tpl.html"; } return $include_path."/templates/record/common/".$template_name.".tpl.html"; } static public function get_liens_opac() { global $liens_opac; return $liens_opac; } static public function get_linked_permalink() { global $base_path; global $use_opac_url_base, $opac_url_base; $use_opac_url_base += 0; if(!isset(static::$linked_permalink[$use_opac_url_base])) { if($use_opac_url_base) { static::$linked_permalink[$use_opac_url_base] = array( 'author' => $opac_url_base."index.php?lvl=author_see&id=!!id!!", 'category' => $opac_url_base."index.php?lvl=categ_see&id=!!id!!", 'publisher' => $opac_url_base."index.php?lvl=publisher_see&id=!!id!!", 'collection' => $opac_url_base."index.php?lvl=coll_see&id=!!id!!", 'subcollection' => $opac_url_base."index.php?lvl=subcoll_see&id=!!id!!", 'serie' => $opac_url_base."index.php?lvl=serie_see&id=!!id!!", 'titre_uniforme' => $opac_url_base."index.php?lvl=titre_uniforme_see&id=!!id!!", 'indexint' => $opac_url_base."index.php?lvl=indexint_see&id=!!id!!", 'authperso' => $opac_url_base."index.php?lvl=authperso_see&id=!!id!!", "concept" => $opac_url_base."index.php?lvl=concept_see&id=!!id!!" ); } else { static::$linked_permalink[$use_opac_url_base] = array( 'author' => $base_path."/autorites.php?categ=see&sub=author&id=!!id!!", 'category' => $base_path."/autorites.php?categ=see&sub=category&id=!!id!!", 'publisher' => $base_path."/autorites.php?categ=see&sub=publisher&id=!!id!!", 'collection' => $base_path."/autorites.php?categ=see&sub=collection&id=!!id!!", 'subcollection' => $base_path."/autorites.php?categ=see&sub=subcollection&id=!!id!!", 'serie' => $base_path."/autorites.php?categ=see&sub=serie&id=!!id!!", 'titre_uniforme' => $base_path."/autorites.php?categ=see&sub=titre_uniforme&id=!!id!!", 'indexint' => $base_path."/autorites.php?categ=see&sub=indexint&id=!!id!!", 'authperso' => $base_path."/autorites.php?categ=see&sub=authperso&id=!!id!!", 'concept' => $base_path."/autorites.php?categ=see&sub=concept&id=!!id!!" ); } } return static::$linked_permalink[$use_opac_url_base]; } /** * Retourne l'affichage des documents numériques * @param int $notice_id Identifiant de la notice * @return string Rendu html des documents numériques */ static public function get_display_explnums($notice_id) { global $include_path; global $msg; global $nb_explnum_visible; require_once($include_path."/explnum.inc.php"); $record_datas = static::get_record_datas($notice_id); $bull = $record_datas->get_bul_info(); $bulletin_id = (isset($bull['bulletin_id']) ? $bull['bulletin_id'] : ''); if ($record_datas->get_niveau_biblio() == "b" && ($explnums = show_explnum_per_notice(0, $bulletin_id, ''))) { return "

".$msg['explnum']." (".$nb_explnum_visible.")

".$explnums; } if ($explnums = show_explnum_per_notice($notice_id, 0, '')) { return "

".$msg['explnum']." (".$nb_explnum_visible.")

".$explnums; } return ""; } static public function get_display_size($notice_id) { $record_datas = static::get_record_datas($notice_id); $size = array(); if ($record_datas->get_npages()) $size[] = $record_datas->get_npages(); if ($record_datas->get_ill()) $size[] = $record_datas->get_ill(); if ($record_datas->get_size()) $size[] = $record_datas->get_size(); return implode(" / ", $size); } static public function get_display_demand($notice_id) { global $msg, $charset, $include_path, $form_modif_demande, $form_linked_record, $demandes_active, $opac_demandes_allow_from_record; if ($demandes_active && $opac_demandes_allow_from_record && $_SESSION['id_empr_session']) { $record_datas = static::get_record_datas($notice_id); $demande = new demandes(); $themes = new demandes_themes('demandes_theme','id_theme','libelle_theme',$demande->theme_demande); $types = new demandes_types('demandes_type','id_type','libelle_type',$demande->type_demande); $f_modif_demande = $form_modif_demande; $f_modif_demande = str_replace('!!form_title!!',htmlentities($msg['demandes_creation'],ENT_QUOTES,$charset),$f_modif_demande); $f_modif_demande = str_replace('!!sujet!!','',$f_modif_demande); $f_modif_demande = str_replace('!!progression!!','',$f_modif_demande); $f_modif_demande = str_replace('!!empr_txt!!','',$f_modif_demande); $f_modif_demande = str_replace('!!idempr!!',$_SESSION['id_empr_session'],$f_modif_demande); $f_modif_demande = str_replace('!!iduser!!',"",$f_modif_demande); $f_modif_demande = str_replace('!!titre!!','',$f_modif_demande); $etat=$demande->getStateValue(); $f_modif_demande = str_replace('!!idetat!!',$etat['id'],$f_modif_demande); $f_modif_demande = str_replace('!!value_etat!!',$etat['comment'],$f_modif_demande); $f_modif_demande = str_replace('!!select_theme!!',$themes->getListSelector(),$f_modif_demande); $f_modif_demande = str_replace('!!select_type!!',$types->getListSelector(),$f_modif_demande); $date = formatdate(today()); $date_debut=date("Y-m-d",time()); $date_dmde = ""; $f_modif_demande = str_replace('!!date_demande!!',$date_dmde,$f_modif_demande); $f_modif_demande = str_replace('!!date_fin_btn!!',$date,$f_modif_demande); $f_modif_demande = str_replace('!!date_debut_btn!!',$date,$f_modif_demande); $f_modif_demande = str_replace('!!date_debut!!',$date_debut,$f_modif_demande); $f_modif_demande = str_replace('!!date_fin!!',$date_debut,$f_modif_demande); $f_modif_demande = str_replace('!!date_prevue!!',$date_debut,$f_modif_demande); $f_modif_demande = str_replace('!!date_prevue_btn!!',$date,$f_modif_demande); $f_modif_demande = str_replace('!!iddemande!!', '', $f_modif_demande); $f_modif_demande = str_replace('!!form_linked_record!!', $form_linked_record, $f_modif_demande); $f_modif_demande = str_replace('!!linked_record!!', $record_datas->get_tit1(), $f_modif_demande); $f_modif_demande = str_replace("!!linked_record_id!!", $notice_id, $f_modif_demande); $f_modif_demande = str_replace("!!linked_record_link!!", $record_datas->get_permalink(), $f_modif_demande); $act_cancel = "demandDialog_".$notice_id.".hide();"; $act_form = "./empr.php?tab=request&lvl=list_dmde&sub=save_demande"; $f_modif_demande = str_replace('!!form_action!!',$act_form,$f_modif_demande); $f_modif_demande = str_replace('!!cancel_action!!',$act_cancel,$f_modif_demande); // Requires et début de formulaire $html = "
".$f_modif_demande."
".$msg['do_demande_on_record']." "; return $html; } return ""; } /** * Retourne le rendu html des documents numériques du bulletin parent de la notice d'article * @param int $notice_id Identifiant de la notice * @return string Rendu html des documents numériques du bulletin parent */ static public function get_display_bull_for_art_expl_num($notice_id) { $record_datas = static::get_record_datas($notice_id); $bul_infos = $record_datas->get_bul_info(); $paramaff["mine_type"]=1; $retour = show_explnum_per_notice(0, $bul_infos['bulletin_id'],"",$paramaff); return $retour; } static public function get_special($notice_id) { global $include_path; $classpath = $include_path."/templates/record/".static::get_parameter_value('notices_format_django_directory')."/special/".static::get_parameter_value('notices_format_django_directory')."_special.class.php"; $class = ""; if(file_exists($classpath)){ require_once $classpath; $class = static::get_parameter_value('notices_format_django_directory')."_special"; } if(!class_exists($class)){ return null; } if (!isset(self::$special[$notice_id])) { self::$special[$notice_id] = new $class(self::$records_datas[$notice_id]); } return self::$special[$notice_id]; } static public function get_display_scan_request($notice_id) { global $msg; $html = ""; $record_datas = static::get_record_datas($notice_id); if(is_null($record_datas->get_dom_1()) && $record_datas->is_visu_scan_request() && (!$record_datas->is_visu_scan_request_abon() || ($record_datas->is_visu_scan_request_abon() && $_SESSION["user_code"])) || ($record_datas->get_rights() & 32)) { $scan_request = new scan_request(); if($record_datas->get_niveau_biblio() == 'b') { $bul_infos = $record_datas->get_bul_info(); // $scan_request->add_linked_records(array('bulletins' => array($bul_infos['bulletin_id']))); $html = $scan_request->get_link_in_record($bul_infos['bulletin_id'], 'bulletins'); } else { // $scan_request->add_linked_records(array('notices' => array($notice_id))); $html = $scan_request->get_link_in_record($notice_id); } } return $html; } /** * Fonction d'affichage des réseaux sociax * @param int $notice_id Identifiant de la notice * @return string */ static public function get_display_social_network($notice_id){ global $charset; $record_datas = static::get_record_datas($notice_id); if(isset($_SESSION["opac_view"])) { $permalink = $record_datas->get_permalink()."&opac_view=".$_SESSION["opac_view"]; } else { $permalink = $record_datas->get_permalink(); } return "
get_tit1()) : $record_datas->get_tit1())))."&url=".rawurlencode(($charset != "utf-8" ? utf8_encode($permalink) : $permalink))."'>
"; } static public function get_display_serialcirc_form_actions($notice_id) { global $msg, $charset; global $allow_serialcirc; $html = ""; $record_datas = static::get_record_datas($notice_id); if($_SESSION['id_empr_session'] && static::get_parameter_value('serialcirc_active') && $record_datas->get_opac_serialcirc_demande() && $allow_serialcirc) { if($record_datas->get_niveau_biblio() == "s"){ // pour un pério, on affiche un bouton pour demander l'inscription à un liste de diffusion //TODO si le statut le permet... $html .= "
 
 
"; }else if ($record_datas->get_niveau_biblio() == "b"){ // pour un bulletin, on regarde s'il est pas en cours d'inscription... // récup la circulation si existante... $query = "select id_serialcirc from serialcirc join abts_abts on abt_id = num_serialcirc_abt join bulletins on bulletin_notice = abts_abts.num_notice where bulletins.num_notice = ".$notice_id; $result = pmb_mysql_query($query); if(pmb_mysql_num_rows($result)){ $id_serialcirc = pmb_mysql_result($result,0,0); $serialcirc = new serialcirc($id_serialcirc); if($serialcirc->is_virtual()){ if($serialcirc->empr_is_subscribe($_SESSION['id_empr_session'])){ $query ="select num_serialcirc_expl_id from serialcirc_expl where num_serialcirc_expl_serialcirc = ".$id_serialcirc." and serialcirc_expl_start_date = 0"; $result = pmb_mysql_query($query); if(pmb_mysql_num_rows($result)){ $expl_id = pmb_mysql_result($result,0,0); $serialcirc_empr_circ = new serialcirc_empr_circ($_SESSION['id_empr_session'],$id_serialcirc,$expl_id); $html.= $serialcirc_empr_circ->get_actions_form(); } } } } } } return $html; } static public function get_display_bulletins_list($notice_id, $bulletins_id = array()) { global $page, $premier, $f_bull_deb_id, $nb_per_page_custom; global $bull_date_start, $bull_date_end; global $msg; global $opac_show_links_invisible_docnums; global $gestion_acces_active, $gestion_acces_empr_notice, $gestion_acces_empr_docnum; global $opac_bull_results_per_page; global $opac_fonction_affichage_liste_bull; $notice_id = $notice_id*1; if ($notice_id) { $record_datas = static::get_record_datas($notice_id); if ($record_datas->get_niveau_biblio() != 's') { return null; } } global ${"bull_num_deb_".$notice_id}; $html = ''; //Recherche dans les numéros $start_num = ${"bull_num_deb_".$notice_id}; $restrict_date = ""; if($f_bull_deb_id){ $restrict_num = " and date_date >='".$f_bull_deb_id."' "; } else if($start_num){ $restrict_num = " and bulletin_numero like '%".$start_num."%' "; } else { $restrict_num = ""; } // Recherche dans les dates et libellés de période if(!$restrict_num) { if($bull_date_start && $bull_date_end){ if($bull_date_end < $bull_date_start){ $restrict_date = " and date_date between '".$bull_date_end."' and '".$bull_date_start."' "; } else if($bull_date_end == $bull_date_start) { $restrict_date = " and date_date='".$bull_date_start."' "; } else { $restrict_date = " and date_date between '".$bull_date_start."' and '".$bull_date_end."' "; } } else if($bull_date_start){ $restrict_date = " and date_date >='".$bull_date_start."' "; } else if($bull_date_end){ $restrict_date = " and date_date <='".$bull_date_end."' "; } } // nombre de références par pages (12 par défaut) if (!isset($opac_bull_results_per_page)) $opac_bull_results_per_page = 12; if(!$page) $page = 1; $debut = ($page-1)*$opac_bull_results_per_page; $limiter = " LIMIT ".$debut.",".$opac_bull_results_per_page; //Recherche par numéro $num_field_start = " "; //Recherche par date $deb_value = str_replace("-","",$bull_date_start); $fin_value = str_replace("-","",$bull_date_end); $date_deb_value = ($deb_value ? formatdate($deb_value) : '...'); $date_fin_value = ($fin_value ? formatdate($fin_value) : '...'); $date_debut = " "; $date_fin = " "; $tableau = "

".$msg['perio_list_bulletins']."

\n
\n \n \n \n
".$msg["search_bull"]." :  ".$msg["search_per_bull_num"]." : ".$msg["search_bull_exact"]." ".$num_field_start."  
".$msg["search_per_bull_date"]." : ".$msg["search_bull_start"]." ".$date_debut." ".$msg["search_bull_end"]." ".$date_fin."   

\n"; $html.= $tableau; //quel affichage de notice il faut utiliser (Public, ISBD) (valeur postée) if ($premier) { $html.= ""; } $html.= ""; $join_docnum_noti = $join_docnum_bull = ""; 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"); if(!$opac_show_links_invisible_docnums){ $join_docnum_noti = $dom_2->getJoin($_SESSION["id_empr_session"],16,"bulletins.num_notice"); $join_docnum_bull = $dom_2->getJoin($_SESSION["id_empr_session"],16,"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)":"").")"; if(!$opac_show_links_invisible_docnums){ $join_docnum_noti = "join notices on bulletins.num_notice = notices.notice_id join notice_statut on notices.statut = notice_statut.id_notice_statut AND ((explnum_visible_opac=1 and explnum_visible_opac_abon=0)".($_SESSION["user_code"]?" or (explnum_visible_opac_abon=1 and explnum_visible_opac=1)":"").")"; $join_docnum_bull = "join notices on bulletins.bulletin_notice = notices.notice_id join notice_statut on notices.statut = notice_statut.id_notice_statut AND ((explnum_visible_opac=1 and explnum_visible_opac_abon=0)".($_SESSION["user_code"]?" or (explnum_visible_opac_abon=1 and explnum_visible_opac=1)":"").")"; } } $join_docnum_explnum = ""; if(!$opac_show_links_invisible_docnums) { if ($gestion_acces_active==1 && $gestion_acces_empr_docnum==1) { $ac = new acces(); $dom_3= $ac->setDomain(3); $join_docnum_explnum = $dom_3->getJoin($_SESSION["id_empr_session"],16,"explnum_id"); }else{ $join_docnum_explnum = "join explnum_statut on explnum_docnum_statut=id_explnum_statut and ((explnum_visible_opac=1 and explnum_visible_opac_abon=0)".($_SESSION["user_code"]?" or (explnum_visible_opac_abon=1 and explnum_visible_opac=1)":"").")"; } } $restriction = " 1"; if (count($bulletins_id)) { $restriction = " bulletins.bulletin_id in (".implode(",", $bulletins_id).")"; } else if ($notice_id) { $restriction = " bulletin_notice = ".$notice_id; } $requete_docnum_noti = "select bulletin_id, count(explnum_id) as nbexplnum from explnum join bulletins on explnum_bulletin = bulletin_id and explnum_notice = 0 ".$join_docnum_explnum." where ".$restriction." and explnum_bulletin in (select bulletin_id from bulletins ".$join_docnum_noti." where ".$restriction.") group by bulletin_id"; $requete_docnum_bull = "select bulletin_id, count(explnum_id) as nbexplnum from explnum join bulletins on explnum_bulletin = bulletin_id and explnum_notice = 0 ".$join_docnum_explnum." where ".$restriction." and explnum_bulletin in (select bulletin_id from bulletins ".$join_docnum_bull." where ".$restriction.") group by bulletin_id"; $requete_noti = "select bulletins.*,ifnull(nbexplnum,0) as nbexplnum from bulletins ".$join_noti." left join (".$requete_docnum_noti.") as docnum_noti on bulletins.bulletin_id = docnum_noti.bulletin_id where bulletins.num_notice != 0 and ".$restriction." ".$restrict_num." ".$restrict_date." GROUP BY bulletins.bulletin_id"; $requete_bull = "select bulletins.*,ifnull(nbexplnum,0) as nbexplnum from bulletins ".$join_bull." left join ($requete_docnum_bull) as docnum_bull on bulletins.bulletin_id = docnum_bull.bulletin_id where bulletins.num_notice = 0 and ".$restriction." ".$restrict_num." ".$restrict_date." GROUP BY bulletins.bulletin_id"; $requete = "select * from (".$requete_noti." union ".$requete_bull.") as uni where 1 ".$restrict_num." ".$restrict_date; $rescount1 = pmb_mysql_query($requete); $count1 = pmb_mysql_num_rows($rescount1); //si on recherche par date ou par numéro, le résultat sera trié par ordre croissant if ($restrict_num || $restrict_date) { $requete.=" ORDER BY date_date, bulletin_numero*1 "; } else { $requete.= " ORDER BY date_date DESC, bulletin_numero*1 DESC"; } $requete.= $limiter; $res = pmb_mysql_query($requete); $count = pmb_mysql_num_rows($res); if ($count) { if ($opac_fonction_affichage_liste_bull) { $html.= call_user_func_array($opac_fonction_affichage_liste_bull, array($res, false)); } else { affichage_liste_bulletins_normale($res); } } else { $html.= "
".$msg["bull_no_found"].""; } $html.= "

"; // constitution des liens if (!$count1) $count1 = $count; $url_page = "javascript:if (document.getElementById(\"onglet_isbd".$notice_id."\")) if (document.getElementById(\"onglet_isbd".$notice_id."\").className==\"isbd_public_active\") document.form_values.premier.value=\"ISBD\"; else document.form_values.premier.value=\"PUBLIC\"; document.form_values.page.value=!!page!!; document.form_values.submit()"; $nb_per_page_custom_url = "javascript:document.form_values.nb_per_page_custom.value=!!nb_per_page_custom!!"; $action = "javascript:if (document.getElementById(\"onglet_isbd".$notice_id."\")) if (document.getElementById(\"onglet_isbd".$notice_id."\").className==\"isbd_public_active\") document.form_values.premier.value=\"ISBD\"; else document.form_values.premier.value=\"PUBLIC\"; document.form_values.page.value=document.form.page.value; document.form_values.submit()"; if ($count) $form = "
"; $html.= pmb_bidi($form); return $html; } public static function get_display_isbd_with_link($notice_id = 0, $bulletin_id = 0) { if ($notice_id) { $display = aff_notice($notice_id, 0, 1, 0, AFF_ETA_NOTICES_REDUIT, '', 1, 0); } else { $display = "".bulletin_header($bulletin_id)."
"; } return $display; } public static function get_record_rights($notice_id = 0, $bulletin_id = 0) { global $gestion_acces_active,$gestion_acces_empr_notice; $rights = array( 'visible' => false ); $id_for_right = 0; if($bulletin_id) { $query = "select num_notice,bulletin_notice from bulletins where bulletin_id = '".$bulletin_id."'"; $result = pmb_mysql_query($query); if(pmb_mysql_num_rows($result)){ $infos = pmb_mysql_fetch_object($result); if($infos->num_notice){ //notice de bulletin $id_for_right = $infos->num_notice; }else{ //notice de pério $id_for_right = $infos->bulletin_notice; } } } else { $id_for_right = $notice_id; } if ($gestion_acces_active==1 && $gestion_acces_empr_notice==1) { $ac = new acces(); $dom_2= $ac->setDomain(2); if($dom_2->getRights($_SESSION['id_empr_session'],$id_for_right, 4)) { $rights['visible'] = true; } } else { $query = "SELECT notice_visible_opac, notice_visible_opac_abon FROM notice_statut JOIN notices ON notices.statut = notice_statut.id_notice_statut WHERE notice_id='".$id_for_right."' "; $result = pmb_mysql_query($query); if(pmb_mysql_num_rows($result)) { $row = pmb_mysql_fetch_object($result); if($row->notice_visible_opac && (!$row->notice_visible_opac_abon || ($row->notice_visible_opac_abon && $_SESSION['id_empr_session']))) { $rights['visible'] = true; } } } return $rights; } static public function get_display_links_for_serials($notice_id) { global $msg; global $opac_photo_filtre_mimetype; $record_datas = static::get_record_datas($notice_id); $links_for_serials = ''; if ($record_datas->get_niveau_biblio() == "s") { $voir_bulletins = ''; $voir_docnum_bulletins = ''; $search_in_serial = ''; if ($record_datas->get_bulletins()) { $voir_bulletins="".$msg["see_bull"].""; } if (static::get_parameter_value('visionneuse_allow') && $record_datas->get_opac_visible_bulletinage()) { $nb_bulletins_docnums = 0; $allowed_mimetype = explode(",",str_replace("'","",$opac_photo_filtre_mimetype)); $bulletins_docnums = $record_datas->get_bulletins_docnums(); foreach($bulletins_docnums as $bulletin_docnum) { if ($allowed_mimetype && in_array($bulletin_docnum->explnum_mimetype,$allowed_mimetype)){ $nb_bulletins_docnums++; } } if ($nb_bulletins_docnums) { $voir_docnum_bulletins=" ".$msg["see_docnum_bull"]." "; } } if ($record_datas->is_open_to_search()) { $search_in_serial ="".$msg["rechercher_in_serial"].""; } if ($voir_bulletins || $voir_docnum_bulletins || $search_in_serial) { $links_for_serials = ""; } } return $links_for_serials; } static public function get_display_pnb_loan_button($notice_id) { global $msg; global $charset; return '

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

' . htmlentities($msg['empr_bt_checkout'], ENT_QUOTES, $charset).'
'; } public static function get_locations_list($notice_id, $property) { $record_datas = static::get_record_datas($notice_id); $data = $record_datas->get_locations(); $return_data = []; foreach ($data as $infos) { if (!empty($infos[$property])) { $return_data[] = $infos[$property]; } } $return_data = array_unique($return_data); return $return_data; } public static function get_lenders_list($notice_id, $property) { $record_datas = static::get_record_datas($notice_id); $data = $record_datas->get_lenders(); $return_data = []; foreach ($data as $infos) { if (!empty($infos[$property])) { $return_data[] = $infos[$property]; } } $return_data = array_unique($return_data); return $return_data; } static public function get_display_caddies_list($notice_id) { return caddie_controller::get_display_list_from_item('display', 'NOTI', $notice_id); } static public function get_directories_options($selected = '') { if (!$selected) { $selected = static::get_parameter_value('notices_format_django_directory'); } if (!$selected) { $selected = 'common'; } $dirs = array_filter(glob('./includes/templates/record/*'), 'is_dir'); $tpl = ""; foreach($dirs as $dir){ if(basename($dir) != "CVS"){ $tpl.= ""; } } return $tpl; } static public function get_directories() { $directories = array(); // $dirs = array_filter(glob('./includes/templates/record/*'), 'is_dir'); $dirs = array_filter(glob('./opac_css/includes/templates/record/*'), 'is_dir'); foreach($dirs as $dir){ if(basename($dir) != "CVS"){ $directories[basename($dir)] = "[Django] ".basename($dir); } } return $directories; } static protected function get_parameter_value($name) { $parameter_name = 'pmb_'.$name; global ${$parameter_name}; return ${$parameter_name}; } }