".$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) {
$record_datas = static::get_record_datas($notice_id);
return $record_datas->get_display_expl_responsive_list();
} // 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 integer $notice_id Identifiant de la notice
* @param object $entree Contenu avant l'ajout
* @param integer $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 = "";
} else {
$image = "";
}
}
}
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 = "";
for ($i = 0 ; $i < sizeof($tableau) ; $i++) {
if ($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']."
";
}
/**
* Retourne l'affichage étendu d'une notice
* @param integer $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 = "", $connector_id = "", $source_id = "") {
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."_".$source_id."_".$niveau_biblio.$typdoc.".tpl.html")) {
return $include_path."/templates/record/".$django_directory."/".$template_name."_".$source_id."_".$niveau_biblio.$typdoc.".tpl.html";
}
if (file_exists($include_path."/templates/record/".$django_directory."/".$template_name."_".$connector_id."_".$niveau_biblio.$typdoc.".tpl.html")) {
return $include_path."/templates/record/".$django_directory."/".$template_name."_".$connector_id."_".$niveau_biblio.$typdoc.".tpl.html";
}
if (file_exists($include_path."/templates/record/".$django_directory."/".$template_name."_".$source_id."_".$niveau_biblio.".tpl.html")) {
return $include_path."/templates/record/".$django_directory."/".$template_name."_".$source_id."_".$niveau_biblio.".tpl.html";
}
if (file_exists($include_path."/templates/record/".$django_directory."/".$template_name."_".$connector_id."_".$niveau_biblio.".tpl.html")) {
return $include_path."/templates/record/".$django_directory."/".$template_name."_".$connector_id."_".$niveau_biblio.".tpl.html";
}
if (file_exists($include_path."/templates/record/".$django_directory."/".$template_name."_".$source_id.".tpl.html")) {
return $include_path."/templates/record/".$django_directory."/".$template_name."_".$source_id.".tpl.html";
}
if (file_exists($include_path."/templates/record/".$django_directory."/".$template_name."_".$connector_id.".tpl.html")) {
return $include_path."/templates/record/".$django_directory."/".$template_name."_".$connector_id.".tpl.html";
}
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/".$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."/index.php?lvl=author_see&id=!!id!!",
'category' => $base_path."/index.php?lvl=categ_see&id=!!id!!",
'publisher' => $base_path."/index.php?lvl=publisher_see&id=!!id!!",
'collection' => $base_path."/index.php?lvl=coll_see&id=!!id!!",
'subcollection' => $base_path."/index.php?lvl=subcoll_see&id=!!id!!",
'serie' => $base_path."/index.php?lvl=serie_see&id=!!id!!",
'titre_uniforme' => $base_path."/index.php?lvl=titre_uniforme_see&id=!!id!!",
'indexint' => $base_path."/index.php?lvl=indexint_see&id=!!id!!",
'authperso' => $base_path."/index.php?lvl=authperso_see&id=!!id!!",
"concept" => $base_path."/index.php?lvl=concept_see&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 "
";
}
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, $charset;
$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";
$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) {
$html.= pmb_bidi("
");
}
return $html;
}
public static function get_display_analysis_list($notice_id) {
global $msg;
global $opac_notices_depliable, $begin_result_liste;
//global $opac_cart_allow;
$display = "
".$msg['bull_dep']."
";
$query = "SELECT * FROM analysis
JOIN bulletins ON bulletins.bulletin_id = analysis.analysis_bulletin
JOIN notices ON notices.notice_id = analysis.analysis_notice
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)":"").")
WHERE num_notice = ".$notice_id;
$result = @pmb_mysql_query($query);
if (pmb_mysql_num_rows($result)) {
if ($opac_notices_depliable) $display .= $begin_result_liste;
/*if ($opac_cart_allow) {
$bulletin_id = pmb_mysql_result($result, 0, 'analysis_bulletin');
$display.="".$msg["cart_add_result_in"]."";
}*/
$display.= "