function genere_in_perio()
 {
     global $charset;
     // serials : si article
     if ($this->notice->niveau_biblio == 'a' && $this->notice->niveau_hierar == 2) {
         $bulletin = $this->parent_title;
         $notice_mere = inslink($this->parent_title, str_replace("!!id!!", "es" . $this->parent_id, $this->lien_rech_perio));
         if ($this->parent_numero) {
             $numero = $this->parent_numero . " ";
         }
         // affichage de la mention de date utile : mention_date si existe, sinon date_date
         if ($this->parent_date) {
             $date_affichee = " (" . $this->parent_date . ")";
         } elseif ($this->parent_date_date) {
             $date_affichee .= " [" . formatdate($this->parent_date_date) . "]";
         } else {
             $date_affichee = "";
         }
         $bulletin = inslink($numero . $date_affichee, str_replace("!!id!!", "es" . $this->bul_id, $this->lien_rech_bulletin));
         $mention_parent = "<b>in</b> {$notice_mere} > {$bulletin} ";
         $retour .= "<br />{$mention_parent}";
         $pagination = htmlentities($this->notice->npages, ENT_QUOTES, $charset);
         if ($pagination) {
             $retour .= ".&nbsp;-&nbsp;{$pagination}";
         }
     }
     return $retour;
 }
 function aff_suite()
 {
     global $msg;
     global $charset;
     // afin d'eviter de recalculer un truc deja calcule..
     if ($this->affichage_suite) {
         return $this->affichage_suite;
     }
     // serials : si article
     $ret .= $this->genere_in_perio();
     // resume	if($this->notice->n_resume)
     if ($this->notice->n_resume) {
         $ret .= "<tr><td align='right' class='bg-grey'><b>" . $msg['n_resume_start'] . "</b></td><td>" . nl2br(htmlentities($this->notice->n_resume, ENT_QUOTES, $charset)) . "</td></tr>";
     }
     // note de contenu
     if ($this->notice->n_contenu) {
         $ret .= "<tr><td align='right' class='bg-grey'><b>" . $msg['n_contenu_start'] . "</b></td><td>" . nl2br(htmlentities($this->notice->n_contenu, ENT_QUOTES, $charset)) . "</td></tr>";
     }
     // Categories
     if ($this->categories_toutes) {
         $ret .= "<tr><td align='right' class='bg-grey'><b>" . $msg['categories_start'] . "</b></td><td>" . $this->categories_toutes . "</td></tr>";
     }
     // indexation libre
     $mots_cles = $this->do_mots_cle();
     if ($mots_cles) {
         $ret .= "<tr><td align='right' class='bg-grey'><b>" . $msg['motscle_start'] . "</b></td><td>" . $mots_cles . "</td></tr>";
     }
     // indexation interne
     if ($this->notice->indexint) {
         $indexint = new indexint($this->notice->indexint);
         $ret .= "<tr><td align='right' class='bg-grey'><b>" . $msg['indexint_start'] . "</b></td><td>" . inslink($indexint->name, str_replace("!!id!!", $this->notice->indexint, $this->lien_rech_indexint)) . " " . nl2br(htmlentities($indexint->comment, ENT_QUOTES, $charset)) . "</td></tr>";
     }
     //Champs personnalises
     $perso_aff = "";
     if (!$this->p_perso->no_special_fields) {
         $perso_ = $this->p_perso->show_fields($this->notice_id);
         for ($i = 0; $i < count($perso_["FIELDS"]); $i++) {
             $p = $perso_["FIELDS"][$i];
             if ($p['OPAC_SHOW'] && $p["AFF"]) {
                 $perso_aff .= "<tr><td align='right' class='bg-grey'>" . $p["TITRE"] . "</td><td>" . $p["AFF"] . "</td></tr>";
             }
         }
     }
     if ($perso_aff) {
         //Espace
         //$ret.="<tr class='tr_spacer'><td colspan='2' class='td_spacer'>&nbsp;</td></tr>";
         $ret .= $perso_aff;
     }
     if ($this->notice->lien) {
         //$ret.="<tr class='tr_spacer'><td colspan='2' class='td_spacer'>&nbsp;</td></tr>";
         $ret .= "<tr><td align='right' class='bg-grey'><b>" . $msg["lien_start"] . "</b></td><td>";
         if (substr($this->notice->eformat, 0, 3) == 'RSS') {
             $ret .= affiche_rss($this->notice->notice_id);
         } else {
             $ret .= "<a href=\"" . $this->notice->lien . "\" target=\"top\">" . htmlentities($this->notice->lien, ENT_QUOTES, $charset) . "</a></td></tr>";
         }
         $ret .= "</td></tr>";
         if ($this->notice->eformat && substr($this->notice->eformat, 0, 3) != 'RSS') {
             $ret .= "<tr><td align='right' class='bg-grey'><b>" . $msg["eformat_start"] . "</b></td><td>" . htmlentities($this->notice->eformat, ENT_QUOTES, $charset) . "</td></tr>";
         }
     }
     $this->affichage_suite = $ret;
     return $ret;
 }
示例#3
0
 function aff_suite()
 {
     global $msg;
     global $charset;
     global $opac_allow_tags_search, $opac_permalink, $opac_url_base;
     // afin d'éviter de recalculer un truc déjà calculé...
     if ($this->affichage_suite_flag) {
         return $this->affichage_suite;
     }
     //Espace
     //$ret.="<tr class='tr_spacer'><td colspan='2' class='td_spacer'>&nbsp;</td></tr>";
     // toutes indexations
     $ret_index = "";
     // Catégories
     if ($this->categories_toutes) {
         $ret_index .= "<tr><td align='right' class='bg-grey'><span class='etiq_champ'>" . $msg['categories_start'] . "</span></td><td>" . $this->categories_toutes . "</td></tr>";
     }
     // Affectation du libellé mots clés ou tags en fonction de la recherche précédente
     if ($opac_allow_tags_search == 1) {
         $libelle_key = $msg['tags'];
     } else {
         $libelle_key = $msg['motscle_start'];
     }
     // indexation libre
     $mots_cles = $this->do_mots_cle();
     if ($mots_cles) {
         $ret_index .= "<tr><td align='right' class='bg-grey'><span class='etiq_champ'>" . $libelle_key . "</span></td><td>" . nl2br($mots_cles) . "</td></tr>";
     }
     // indexation interne
     if ($this->notice->indexint) {
         $indexint = new indexint($this->notice->indexint);
         $ret_index .= "<tr><td align='right' class='bg-grey'><span class='etiq_champ'>" . $msg['indexint_start'] . "</span></td><td>" . inslink($indexint->name, str_replace("!!id!!", $this->notice->indexint, $this->lien_rech_indexint)) . " " . nl2br(htmlentities($indexint->comment, ENT_QUOTES, $charset)) . "</td></tr>";
     }
     if ($ret_index) {
         $ret .= $ret_index;
         //$ret.="<tr class='tr_spacer'><td colspan='2' class='td_spacer'>&nbsp;</td></tr>";
     }
     // résumé
     if ($this->notice->n_resume) {
         $ret .= "<tr><td align='right' class='bg-grey'><span class='etiq_champ'>" . $msg['n_resume_start'] . "</span></td><td class='td_resume'>" . nl2br($this->notice->n_resume) . "</td></tr>";
     }
     // note de contenu
     if ($this->notice->n_contenu) {
         $ret .= "<tr><td align='right' class='bg-grey'><span class='etiq_champ'>" . $msg['n_contenu_start'] . "</span></td><td>" . nl2br(htmlentities($this->notice->n_contenu, ENT_QUOTES, $charset)) . "</td></tr>";
     }
     //Champs personalisés
     $perso_aff = "";
     if (!$this->p_perso->no_special_fields) {
         // $this->memo_perso_ permet au affichages personalisés dans notice_affichage_ex de gagner du temps
         if (!$this->memo_perso_) {
             $this->memo_perso_ = $this->p_perso->show_fields($this->notice_id);
         }
         for ($i = 0; $i < count($this->memo_perso_["FIELDS"]); $i++) {
             $p = $this->memo_perso_["FIELDS"][$i];
             if ($p['OPAC_SHOW'] && $p["AFF"]) {
                 $perso_aff .= "<tr><td align='right' class='bg-grey'><span class='etiq_champ'>" . strip_tags($p["TITRE"]) . "</span></td><td>" . $p["AFF"] . "</td></tr>";
             }
         }
     }
     $ret .= $perso_aff;
     if ($this->notice->lien) {
         //$ret.="<tr class='tr_spacer'><td colspan='2' class='td_spacer'>&nbsp;</td></tr>";
         $ret .= "<tr><td align='right' class='bg-grey'><span class='etiq_champ'>" . $msg["lien_start"] . "</span></td><td>";
         if (substr($this->notice->eformat, 0, 3) == 'RSS') {
             $ret .= affiche_rss($this->notice->notice_id);
         } else {
             if (strlen($this->notice->lien) > 80) {
                 $ret .= "<a href=\"" . $this->notice->lien . "\" target=\"top\" class='lien856'>" . htmlentities(substr($this->notice->lien, 0, 80), ENT_QUOTES, $charset) . "</a>&nbsp;[...]";
             } else {
                 $ret .= "<a href=\"" . $this->notice->lien . "\" target=\"top\" class='lien856'>" . htmlentities($this->notice->lien, ENT_QUOTES, $charset) . "</a>";
             }
             //$ret.="</td></tr>";
         }
         $ret .= "</td></tr>";
         if ($this->notice->eformat && substr($this->notice->eformat, 0, 3) != 'RSS') {
             $ret .= "<tr><td align='right' class='bg-grey'><span class='etiq_champ'>" . $msg["eformat_start"] . "</span></td><td>" . htmlentities($this->notice->eformat, ENT_QUOTES, $charset) . "</td></tr>";
         }
     }
     // Permalink avec Id
     if ($opac_permalink) {
         if ($this->notice->niveau_biblio != "b") {
             $ret .= "<tr><td align='right' class='bg-grey'><span class='etiq_champ'>" . $msg["notice_permalink"] . "</span></td><td><a href='" . $opac_url_base . "index.php?lvl=notice_display&id=" . $this->notice_id . "'>" . substr($opac_url_base . "index.php?lvl=notice_display&id=" . $this->notice_id, 0, 80) . "</a></td></tr>";
         } else {
             $ret .= "<tr><td align='right' class='bg-grey'><span class='etiq_champ'>" . $msg["notice_permalink"] . "</span></td><td><a href='" . $opac_url_base . "index.php?lvl=bulletin_display&id=" . $this->bulletin_id . "'>" . substr($opac_url_base . "index.php?lvl=bulletin_display&id=" . $this->bulletin_id, 0, 80) . "</a></td></tr>";
         }
     }
     $this->affichage_suite = $ret;
     $this->affichage_suite_flag = 1;
     return $ret;
 }
 function fetch_auteurs()
 {
     global $fonction_auteur;
     global $dbh;
     global $opac_url_base;
     $this->responsabilites = array();
     $auteurs = array();
     $res["responsabilites"] = array();
     $res["auteurs"] = array();
     $rqt = "SELECT author_id, responsability_fonction, responsability_type, author_type,author_name, author_rejete, author_type, author_date, author_see ";
     $rqt .= "FROM responsability, authors ";
     $rqt .= "WHERE responsability_notice='" . $this->notice_id . "' AND responsability_author=author_id ";
     $rqt .= "ORDER BY responsability_type, responsability_ordre ";
     $res_sql = pmb_mysql_query($rqt, $dbh);
     while ($notice = pmb_mysql_fetch_object($res_sql)) {
         $responsabilites[] = $notice->responsability_type;
         $info_bulle = "";
         if ($notice->author_type == 72 || $notice->author_type == 71) {
             $congres = new auteur($notice->author_id);
             $auteur_isbd = $congres->isbd_entry;
             $auteur_titre = $congres->display;
             $info_bulle = " title='" . $congres->info_bulle . "' ";
         } else {
             if ($notice->author_rejete) {
                 $auteur_isbd = $notice->author_name . ", " . $notice->author_rejete;
             } else {
                 $auteur_isbd = $notice->author_name;
             }
             // on s'arrête là pour auteur_titre = "NOM, Prénom" uniquement
             $auteur_titre = $auteur_isbd;
         }
         $auteur_isbd = inslink($auteur_isbd, str_replace("!!id!!", $notice->author_id, $this->lien_rech_auteur), $info_bulle);
         if ($notice->responsability_fonction && $notice->responsability_fonction != "070") {
             $auteur_isbd = $fonction_auteur[$notice->responsability_fonction] . " : " . $auteur_isbd;
         }
         $auteurs[] = array('id' => $notice->author_id, 'fonction' => $notice->responsability_fonction, 'responsability' => $notice->responsability_type, 'name' => $notice->author_name, 'rejete' => $notice->author_rejete, 'date' => $notice->author_date, 'type' => $notice->author_type, 'fonction_aff' => $fonction_auteur[$notice->responsability_fonction], 'auteur_isbd' => $auteur_isbd, 'auteur_titre' => $auteur_titre);
     }
     if (!$responsabilites) {
         $responsabilites = array();
     }
     if (!$auteurs) {
         $auteurs = array();
     }
     $res["responsabilites"] = $responsabilites;
     $res["auteurs"] = $auteurs;
     $this->responsabilites = $res;
     // $this->auteurs_principaux
     // on ne prend que le auteur_titre = "Prénom NOM"
     $as = array_search("0", $this->responsabilites["responsabilites"]);
     if ($as !== FALSE && $as !== NULL) {
         $auteur_0 = $this->responsabilites["auteurs"][$as];
         $this->auteurs_principaux = $auteur_0["auteur_titre"];
     } else {
         $as = array_keys($this->responsabilites["responsabilites"], "1");
         $aut1_libelle = array();
         for ($i = 0; $i < count($as); $i++) {
             $indice = $as[$i];
             $auteur_1 = $this->responsabilites["auteurs"][$indice];
             if ($auteur_1["type"] == 72 || $auteur_1["type"] == 72) {
                 $congres = new auteur($auteur_1["id"]);
                 $aut1_libelle[] = $congres->display;
             } else {
                 $aut1_libelle[] = $auteur_1["auteur_titre"];
             }
         }
         $auteurs_liste = implode(" ; ", $aut1_libelle);
         if ($auteurs_liste) {
             $this->auteurs_principaux = $auteurs_liste;
         }
     }
     // $this->auteurs_tous
     $mention_resp = array();
     $congres_resp = array();
     $as = array_search("0", $this->responsabilites["responsabilites"]);
     if ($as !== FALSE && $as !== NULL) {
         $auteur_0 = $this->responsabilites["auteurs"][$as];
         $mention_resp_lib = $auteur_0["auteur_isbd"];
         if ($this->responsabilites["auteurs"][$as]["type"] == 72) {
             $congres_resp[] = $mention_resp_lib;
         } else {
             $mention_resp[] = $mention_resp_lib;
         }
     }
     $as = array_keys($this->responsabilites["responsabilites"], "1");
     for ($i = 0; $i < count($as); $i++) {
         $indice = $as[$i];
         $auteur_1 = $this->responsabilites["auteurs"][$indice];
         $mention_resp_lib = $auteur_1["auteur_isbd"];
         if ($this->responsabilites["auteurs"][$indice]["type"] == 72) {
             $congres_resp[] = $mention_resp_lib;
         } else {
             $mention_resp[] = $mention_resp_lib;
         }
     }
     $as = array_keys($this->responsabilites["responsabilites"], "2");
     for ($i = 0; $i < count($as); $i++) {
         $indice = $as[$i];
         $auteur_2 = $this->responsabilites["auteurs"][$indice];
         $mention_resp_lib = $auteur_2["auteur_isbd"];
         if ($this->responsabilites["auteurs"][$indice]["type"] == 72) {
             $congres_resp[] = $mention_resp_lib;
         } else {
             $mention_resp[] = $mention_resp_lib;
         }
     }
     $libelle_mention_resp = implode(" ; ", $mention_resp);
     if ($libelle_mention_resp) {
         $this->auteurs_tous = $libelle_mention_resp;
     } else {
         $this->auteurs_tous = "";
     }
     $libelle_congres_resp = implode(" ; ", $congres_resp);
     if ($libelle_congres_resp) {
         $this->congres_tous = $libelle_congres_resp;
     } else {
         $this->congres_tous = "";
     }
 }
 function do_header($id_tpl = 0)
 {
     global $opac_notice_reduit_format;
     global $opac_url_base, $msg, $charset;
     global $memo_notice;
     global $opac_visionneuse_allow;
     global $opac_photo_filtre_mimetype;
     global $opac_url_base;
     global $charset;
     $this->notice_header = "";
     if (!$this->notice_id) {
         return;
     }
     $type_reduit = substr($opac_notice_reduit_format, 0, 1);
     $notice_tpl_header = "";
     if ($type_reduit == "H" || $id_tpl) {
         if (!$id_tpl) {
             $id_tpl = substr($opac_notice_reduit_format, 2);
         }
         if ($id_tpl) {
             $tpl = new notice_tpl_gen($id_tpl);
             $notice_tpl_header = $tpl->build_notice($this->notice_id);
             if ($notice_tpl_header) {
                 $this->notice_header = $notice_tpl_header;
                 return;
             }
         }
     }
     if ($type_reduit == "E" || $type_reduit == "P") {
         // peut-être veut-on des personnalisés ?
         $perso_voulus_temp = substr($opac_notice_reduit_format, 2);
         if ($perso_voulus_temp != "") {
             $perso_voulus = explode(",", $perso_voulus_temp);
         }
     }
     if ($type_reduit == "E") {
         // zone de l'éditeur
         if ($this->notice->ed1_id) {
             $editeur = new publisher($this->notice->ed1_id);
             $editeur_reduit = $editeur->display;
             if ($this->notice->year) {
                 $editeur_reduit .= " (" . $this->notice->year . ")";
             }
         } elseif ($this->notice->year) {
             // année mais pas d'éditeur et si pas un article
             if ($this->notice->niveau_biblio != 'a' && $this->notice->niveau_hierar != 2) {
                 $editeur_reduit = $this->notice->year . " ";
             }
         }
     } else {
         $editeur_reduit = "";
     }
     //Champs personalisés à ajouter au réduit
     if (!$this->p_perso->no_special_fields) {
         if (count($perso_voulus)) {
             $this->p_perso->get_values($this->notice_id);
             for ($i = 0; $i < count($perso_voulus); $i++) {
                 $perso_voulu_aff .= $this->p_perso->get_formatted_output($this->p_perso->values[$perso_voulus[$i]], $perso_voulus[$i]) . " ";
             }
             $perso_voulu_aff = trim($perso_voulu_aff);
         } else {
             $perso_voulu_aff = "";
         }
     } else {
         $perso_voulu_aff = "";
     }
     //Si c'est un depouillement, ajout du titre et bulletin
     if ($this->notice->niveau_biblio == 'a' && $this->notice->niveau_hierar == 2 && $this->parent_title) {
         $aff_perio_title = "<i>" . $msg[in_serial] . " " . $this->parent_title . ", " . $this->parent_numero . " (" . ($this->parent_date ? $this->parent_date : "[" . $this->parent_aff_date_date . "]") . ")</i>";
     }
     //Si c'est une notice de bulletin ajout du titre et bulletin
     if ($this->notice->niveau_biblio == 'b' && $this->notice->niveau_hierar == 2) {
         $aff_bullperio_title = "<span class='isbulletinof'><i> " . ($this->parent_date ? sprintf($msg["bul_titre_perio"], $this->parent_title) : sprintf($msg["bul_titre_perio"], $this->parent_title . ", " . $this->parent_numero . " [" . $this->parent_aff_date_date . "]")) . "</i></span>";
     } else {
         $aff_bullperio_title = "";
     }
     // récupération du titre de série
     // constitution de la mention de titre
     if ($this->notice->serie_name) {
         $this->notice_header = $this->notice->serie_name;
         if ($this->notice->tnvol) {
             $this->notice_header .= ', ' . $this->notice->tnvol;
         }
     } elseif ($this->notice->tnvol) {
         $this->notice_header .= $this->notice->tnvol;
     }
     if ($this->notice_header) {
         $this->notice_header .= ". " . $this->notice->tit1;
     } else {
         $this->notice_header = $this->notice->tit1;
     }
     if ($type_reduit == '4') {
         if ($this->notice->tit3 != "") {
             $this->notice_header .= "&nbsp;=&nbsp;" . $this->notice->tit3;
         }
     }
     $this->notice_header .= $aff_bullperio_title;
     //$this->notice_header_without_html = $this->notice_header;
     $this->notice_header = "<span !!zoteroNotice!! class='header_title'>" . $this->notice_header . "</span>";
     //on ne propose à Zotero que les monos et les articles...
     if ($this->notice->niveau_biblio == "m" || $this->notice->niveau_biblio == "a" && $this->notice->niveau_hierar == 2) {
         $this->notice_header = str_replace("!!zoteroNotice!!", " notice='" . $this->notice_id . "' ", $this->notice_header);
     } else {
         $this->notice_header = str_replace("!!zoteroNotice!!", "", $this->notice_header);
     }
     $this->notice_header = '<span class="statutnot' . $this->notice->statut . '" ' . ($this->statut_notice ? 'title="' . htmlentities($this->statut_notice, ENT_QUOTES, $charset) . '"' : '') . '></span>' . $this->notice_header;
     //Ajout
     $aff_cote_supp = "";
     $requete = "SELECT expl_cote FROM exemplaires WHERE expl_notice='" . $this->notice_id . "' ORDER BY expl_id LIMIT 1";
     $res = mysql_query($requete);
     if ($res && mysql_num_rows($res)) {
         $aff_cote_supp = " / <span style='font-style:italic;'>rayon : " . htmlentities(mysql_result($res, 0, 0), ENT_QUOTES, $charset) . "</span>";
     }
     $notice_header_suite = "";
     if ($type_reduit == "T" && $this->notice->tit4) {
         $notice_header_suite = " : " . $this->notice->tit4;
     }
     if ($type_reduit != '3' && $this->auteurs_principaux) {
         $notice_header_suite .= " / " . $this->auteurs_principaux;
     }
     if ($editeur_reduit) {
         $notice_header_suite .= " / " . $editeur_reduit;
     }
     if ($perso_voulu_aff) {
         $notice_header_suite .= " / " . $perso_voulu_aff;
     }
     if ($aff_perio_title) {
         $notice_header_suite .= " " . $aff_perio_title;
     }
     //$this->notice_header_without_html .= $notice_header_suite ;
     //$this->notice_header .= $notice_header_suite."</span>";
     //Un  span de trop ?
     $this->notice_header .= $notice_header_suite;
     if ($this->notice->niveau_biblio == 'm' || $this->notice->niveau_biblio == 's') {
         switch ($type_reduit) {
             case '1':
                 if ($this->notice->year != '') {
                     $this->notice_header .= ' (' . htmlentities($this->notice->year, ENT_QUOTES, $charset) . ')';
                 }
                 break;
             case '2':
                 if ($this->notice->year != '' && $this->notice->niveau_biblio != 'b') {
                     $this->notice_header .= ' (' . htmlentities($this->notice->year, ENT_QUOTES, $charset) . ')';
                 }
                 if ($this->notice->code != '') {
                     $this->notice_header .= ' / ' . htmlentities($this->notice->code, ENT_QUOTES, $charset);
                 }
                 break;
             default:
                 break;
         }
     }
     if ($aff_cote_supp) {
         $this->notice_header .= $aff_cote_supp;
     }
     //$this->notice_header.="&nbsp;<span id=\"drag_symbol_drag_noti_".$this->notice->notice_id."\" style=\"visibility:hidden\"><img src=\"images/drag_symbol.png\"\></span>";
     $this->notice_header_doclink = "";
     if ($this->notice->lien) {
         if (!$this->notice->eformat) {
             $info_bulle = $msg["open_link_url_notice"];
         } else {
             $info_bulle = $this->notice->eformat;
         }
         // ajout du lien pour les ressources électroniques
         $this->notice_header_doclink .= "&nbsp;<span class='notice_link'><a href=\"" . $this->notice->lien . "\" target=\"__LINK__\">";
         $this->notice_header_doclink .= "<img src=\"" . $opac_url_base . "images/globe.gif\" border=\"0\" align=\"middle\" hspace=\"3\"";
         $this->notice_header_doclink .= " alt=\"";
         $this->notice_header_doclink .= $info_bulle;
         $this->notice_header_doclink .= "\" title=\"";
         $this->notice_header_doclink .= $info_bulle;
         $this->notice_header_doclink .= "\" />";
         $this->notice_header_doclink .= "</a></span>";
     }
     if ($this->notice->niveau_biblio == 'b') {
         $sql_explnum = "SELECT explnum_id, explnum_nom, explnum_nomfichier, explnum_url FROM explnum, bulletins WHERE bulletins.num_notice = " . $this->notice_id . " AND bulletins.bulletin_id = explnum.explnum_bulletin order by explnum_id";
     } else {
         $sql_explnum = "SELECT explnum_id, explnum_nom, explnum_nomfichier,explnum_url FROM explnum WHERE explnum_notice = " . $this->notice_id . " order by explnum_id";
     }
     $explnums = mysql_query($sql_explnum);
     $explnumscount = mysql_num_rows($explnums);
     if (is_null($this->dom_2) && $this->visu_explnum && (!$this->visu_explnum_abon || $this->visu_explnum_abon && $_SESSION["user_code"]) || $this->rights & 16) {
         if ($explnumscount == 1) {
             $explnumrow = mysql_fetch_object($explnums);
             if ($explnumrow->explnum_nomfichier) {
                 if ($explnumrow->explnum_nom == $explnumrow->explnum_nomfichier) {
                     $info_bulle = $msg["open_doc_num_notice"] . $explnumrow->explnum_nomfichier;
                 } else {
                     $info_bulle = $explnumrow->explnum_nom;
                 }
             } elseif ($explnumrow->explnum_url) {
                 if ($explnumrow->explnum_nom == $explnumrow->explnum_url) {
                     $info_bulle = $msg["open_link_url_notice"] . $explnumrow->explnum_url;
                 } else {
                     $info_bulle = $explnumrow->explnum_nom;
                 }
             }
             $this->notice_header_doclink .= "&nbsp;<span>";
             if ($opac_visionneuse_allow) {
                 $allowed_mimetype = explode(",", str_replace("'", "", $opac_photo_filtre_mimetype));
             }
             if ($opac_visionneuse_allow && $this->docnum_allowed && ($allowed_mimetype && in_array($expl->explnum_mimetype, $allowed_mimetype))) {
                 $this->notice_header_doclink .= "\r\n\t\t\t\t\t<script type='text/javascript'>\r\n\t\t\t\t\t\tif(typeof(sendToVisionneuse) == 'undefined'){\r\n\t\t\t\t\t\t\tvar sendToVisionneuse = function (explnum_id){\r\n\t\t\t\t\t\t\t\tdocument.getElementById('visionneuseIframe').src = 'visionneuse.php?'+(typeof(explnum_id) != 'undefined' ? 'explnum_id='+explnum_id+\"\" : '\\'');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t</script>\r\n\t\t\t\t\t<a href='#' onclick=\"open_visionneuse(sendToVisionneuse," . $explnumrow->explnum_id . ");return false;\" alt='{$alt}' title='{$alt}'>";
             } else {
                 $this->notice_header_doclink .= "<a href=\"./doc_num.php?explnum_id=" . $explnumrow->explnum_id . "\" target=\"__LINK__\">";
             }
             $this->notice_header_doclink .= "<img src=\"./images/globe_orange.png\" border=\"0\" align=\"middle\" hspace=\"3\"";
             $this->notice_header_doclink .= " alt=\"";
             $this->notice_header_doclink .= htmlentities($info_bulle, ENT_QUOTES, $charset);
             $this->notice_header_doclink .= "\" title=\"";
             $this->notice_header_doclink .= htmlentities($info_bulle, ENT_QUOTES, $charset);
             $this->notice_header_doclink .= "\">";
             $this->notice_header_doclink .= "</a></span>";
         } elseif ($explnumscount > 1) {
             $explnumrow = mysql_fetch_object($explnums);
             $info_bulle = $msg["info_docs_num_notice"];
             $this->notice_header_doclink .= "<img src=\"./images/globe_rouge.png\" alt=\"{$info_bulle}\" \" title=\"{$info_bulle}\" border=\"0\" align=\"middle\" hspace=\"3\">";
         }
     }
     //coins pour Zotero
     $coins_span = $this->gen_coins_span();
     $this->notice_header .= $coins_span;
     $this->notice_header_without_doclink = $this->notice_header;
     $this->notice_header .= $this->notice_header_doclink;
     $memo_notice[$this->notice_id]["header_without_doclink"] = $this->notice_header_without_doclink;
     $memo_notice[$this->notice_id]["header_doclink"] = $this->notice_header_doclink;
     $memo_notice[$this->notice_id]["header"] = $this->notice_header;
     $memo_notice[$this->notice_id]["niveau_biblio"] = $this->notice->niveau_biblio;
     $this->notice_header_with_link = inslink($this->notice_header, str_replace("!!id!!", $this->notice_id, $this->lien_rech_notice));
 }
 function fetch_categories()
 {
     global $opac_thesaurus, $opac_categories_categ_in_line, $pmb_keyword_sep, $opac_categories_affichage_ordre;
     global $dbh;
     global $lang, $opac_categories_show_only_last;
     global $categories_memo, $libelle_thesaurus_memo;
     global $categories_top;
     $categ_repetables = array();
     if (!count($categories_top)) {
         $q = "select num_thesaurus,id_noeud from noeuds where num_parent in(select id_noeud from noeuds where autorite='TOP') ";
         $r = mysql_query($q, $dbh);
         while ($res = mysql_fetch_object($r)) {
             $categories_top[] = $res->id_noeud;
         }
     }
     $requete = "select * from (\n\t\t\tselect libelle_thesaurus, c0.libelle_categorie as categ_libelle, c0.comment_public, n0.id_noeud , n0.num_parent, langue_defaut,id_thesaurus, if(c0.langue = '" . $lang . "',2, if(c0.langue= thesaurus.langue_defaut ,1,0)) as p, ordre_vedette, ordre_categorie\n\t\t\tFROM noeuds as n0, categories as c0,thesaurus,notices_categories \n\t\t\twhere notices_categories.num_noeud=n0.id_noeud and n0.id_noeud = c0.num_noeud and n0.num_thesaurus=id_thesaurus and \n\t\t\tnotices_categories.notcateg_notice=" . $this->notice_id . " AND id_thesaurus!='2' order by id_thesaurus, n0.id_noeud, p desc\n\t\t\t) as list_categ group by id_noeud";
     if ($opac_categories_affichage_ordre == 1) {
         $requete .= " order by ordre_vedette, ordre_categorie";
     }
     $result_categ = @mysql_query($requete);
     if (mysql_num_rows($result_categ)) {
         while ($res_categ = mysql_fetch_object($result_categ)) {
             $libelle_thesaurus = $res_categ->libelle_thesaurus;
             $categ_id = $res_categ->id_noeud;
             $libelle_categ = $res_categ->categ_libelle;
             $comment_public = $res_categ->comment_public;
             $num_parent = $res_categ->num_parent;
             $langue_defaut = $res_categ->langue_defaut;
             $categ_head = 0;
             if (in_array($categ_id, $categories_top)) {
                 $categ_head = 1;
             }
             if ($opac_categories_show_only_last || $categ_head) {
                 if ($opac_thesaurus) {
                     $catalog_form = "[" . $libelle_thesaurus . "] " . $libelle_categ;
                 }
                 // Si il y a présence d'un commentaire affichage du layer
                 $result_com = categorie::zoom_categ($categ_id, $comment_public);
                 $libelle_aff_complet = inslink($libelle_categ, str_replace("!!id!!", $categ_id, $this->lien_rech_categ), $result_com['java_com']);
                 $libelle_aff_complet .= $result_com['zoom'];
                 if ($opac_thesaurus) {
                     $categ_repetables[$libelle_thesaurus][] = $libelle_aff_complet;
                 } else {
                     $categ_repetables['MONOTHESAURUS'][] = $libelle_aff_complet;
                 }
             } else {
                 if (!$categories_memo[$categ_id]) {
                     $anti_recurse[$categ_id] = 1;
                     $path_table = '';
                     $requete = "\n\t\t\t\t\t\tselect id_noeud as categ_id, \n\t\t\t\t\t\tnum_noeud, num_parent as categ_parent, libelle_categorie as categ_libelle,\n\t\t\t\t\t\tnum_renvoi_voir as categ_see, \n\t\t\t\t\t\tnote_application as categ_comment,\n\t\t\t\t\t\tif(langue = '" . $lang . "',2, if(langue= '" . $langue_defaut . "' ,1,0)) as p\n\t\t\t\t\t\tFROM noeuds, categories where id_noeud ='" . $num_parent . "' \n\t\t\t\t\t\tAND noeuds.id_noeud = categories.num_noeud \n\t\t\t\t\t\torder by p desc limit 1";
                     $result = @mysql_query($requete);
                     if (mysql_num_rows($result)) {
                         $parent = mysql_fetch_object($result);
                         $anti_recurse[$parent->categ_id] = 1;
                         $path_table[] = array('id' => $parent->categ_id, 'libelle' => $parent->categ_libelle);
                         // on remonte les ascendants
                         while ($parent->categ_parent && !$anti_recurse[$parent->categ_parent]) {
                             $requete = "select id_noeud as categ_id, num_noeud, num_parent as categ_parent, libelle_categorie as categ_libelle,\tnum_renvoi_voir as categ_see, note_application as categ_comment, if(langue = '" . $lang . "',2, if(langue= '" . $langue_defaut . "' ,1,0)) as p\n\t\t\t\t\t\t\t\t\tFROM noeuds, categories where id_noeud ='" . $parent->categ_parent . "' \n\t\t\t\t\t\t\t\t\tAND noeuds.id_noeud = categories.num_noeud \n\t\t\t\t\t\t\t\t\torder by p desc limit 1";
                             $result = @mysql_query($requete);
                             if (mysql_num_rows($result)) {
                                 $parent = mysql_fetch_object($result);
                                 $anti_recurse[$parent->categ_id] = 1;
                                 $path_table[] = array('id' => $parent->categ_id, 'libelle' => $parent->categ_libelle);
                             } else {
                                 break;
                             }
                         }
                         $anti_recurse = array();
                     } else {
                         $path_table = array();
                     }
                     // ceci remet le tableau dans l'ordre général->particulier
                     $path_table = array_reverse($path_table);
                     if (sizeof($path_table)) {
                         $temp_table = '';
                         while (list($xi, $l) = each($path_table)) {
                             $temp_table[] = $l['libelle'];
                         }
                         $parent_libelle = join(':', $temp_table);
                         $catalog_form = $parent_libelle . ':' . $libelle_categ;
                     } else {
                         $catalog_form = $libelle_categ;
                     }
                     // pour libellé complet mais sans le nom du thésaurus
                     $libelle_aff_complet = $catalog_form;
                     if ($opac_thesaurus) {
                         $catalog_form = "[" . $libelle_thesaurus . "] " . $catalog_form;
                     }
                     //$categ = new category($categ_id);
                     // Si il y a présence d'un commentaire affichage du layer
                     $result_com = categorie::zoom_categ($categ_id, $comment_public);
                     $libelle_aff_complet = inslink($libelle_aff_complet, str_replace("!!id!!", $categ_id, $this->lien_rech_categ), $result_com['java_com']);
                     $libelle_aff_complet .= $result_com['zoom'];
                     if ($opac_thesaurus) {
                         $categ_repetables[$libelle_thesaurus][] = $libelle_aff_complet;
                     } else {
                         $categ_repetables['MONOTHESAURUS'][] = $libelle_aff_complet;
                     }
                     $categories_memo[$categ_id] = $libelle_aff_complet;
                     $libelle_thesaurus_memo[$categ_id] = $libelle_thesaurus;
                 } else {
                     if ($opac_thesaurus) {
                         $categ_repetables[$libelle_thesaurus_memo[$categ_id]][] = $categories_memo[$categ_id];
                     } else {
                         $categ_repetables['MONOTHESAURUS'][] = $categories_memo[$categ_id];
                     }
                 }
             }
         }
     }
     while (list($nom_tesaurus, $val_lib) = each($categ_repetables)) {
         //c'est un tri par libellé qui est demandé
         if ($opac_categories_affichage_ordre == 0) {
             $tmp = array();
             foreach ($val_lib as $key => $value) {
                 $tmp[$key] = strip_tags($value);
             }
             $tmp = array_map("convert_diacrit", $tmp);
             //On enlève les accents
             $tmp = array_map("strtoupper", $tmp);
             //On met en majuscule
             asort($tmp);
             //Tri sur les valeurs en majuscule sans accent
             foreach ($tmp as $key => $value) {
                 $tmp[$key] = $val_lib[$key];
                 //On reprend les bons couples clé / libellé
             }
             $val_lib = $tmp;
         }
         if ($opac_thesaurus) {
             if (!$opac_categories_categ_in_line) {
                 $categ_repetables_aff = "[" . $nom_tesaurus . "]" . implode("<br />[" . $nom_tesaurus . "]", $val_lib);
             } else {
                 $categ_repetables_aff = "<b>" . $nom_tesaurus . "</b><br />" . implode(" {$pmb_keyword_sep} ", $val_lib);
             }
         } elseif (!$opac_categories_categ_in_line) {
             $categ_repetables_aff = implode("<br />", $val_lib);
         } else {
             $categ_repetables_aff = implode(" {$pmb_keyword_sep} ", $val_lib);
         }
         if ($categ_repetables_aff) {
             $tmpcateg_aff .= "{$categ_repetables_aff}<br />";
         }
     }
     $this->categories_toutes = $tmpcateg_aff;
 }
示例#7
0
     case "movedown":
         movelink('down');
         break;
     case "moveup":
         movelink('up');
         break;
     case "fixsequence":
         fixsequence();
         break;
         //add link
     //add link
     case "newlink":
         newlink();
         break;
     case "inslink":
         inslink();
         break;
         //mod link
     //mod link
     case "modlink":
         modlink();
         break;
     case "uplink":
         uplink();
         break;
         //del link
     //del link
     case "dellink":
         dellink();
         break;
 }