public function render($datas) { global $opac_notice_affichage_class; if (!$opac_notice_affichage_class) { $opac_notice_affichage_class = "notice_affichage"; } // $datas => id de la notice $notice = $datas; $render_datas = array(); $render_datas['record'] = array(); if ($notice) { //on calcule le template de notices... $notice_class = new $opac_notice_affichage_class($notice); $notice_class->do_header(); if ($notice_class->notice->niveau_biblio != "b") { $permalink = "index.php?lvl=notice_display&id=" . $notice_class->notice_id; } else { $permalink = "index.php?lvl=bulletin_display&id=" . $notice_class->bulletin_id; } $infos = array('header' => $notice_class->notice_header, 'link' => $permalink); if ($this->parameters['used_template']) { $tpl = new notice_tpl_gen($this->parameters['used_template']); $infos['content'] = $tpl->build_notice($notice); } else { $notice_class->do_isbd(); $infos['content'] = $notice_class->notice_isbd; } $render_datas['record'] = $infos; } //on rappelle le tout... return parent::render($render_datas); }
public function render($datas) { global $opac_notice_affichage_class; global $opac_show_book_pics; global $opac_book_pics_url; global $opac_book_pics_msg; if (!$opac_notice_affichage_class) { $opac_notice_affichage_class = "notice_affichage"; } //on rajoute nos éléments... //le titre $render_datas = array(); $render_datas['title'] = $datas["title"]; $render_datas['records'] = array(); if (is_array($datas["records"])) { foreach ($datas["records"] as $notice) { //on calcule les templates pour chaque notices... $notice_class = new $opac_notice_affichage_class($notice); $notice_class->do_header(); if ($notice_class->notice->niveau_biblio != "b") { $notice_id = $notice_class->notice_id; $is_bulletin = false; } else { $notice_id = $notice_class->bulletin_id; $is_bulletin = true; } if ($opac_show_book_pics == '1' && ($opac_book_pics_url || $notice_class->notice->thumbnail_url)) { $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $notice_class->notice->code); $url_image = $opac_book_pics_url; $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($url_image) . "¬icecode=!!noticecode!!&vigurl=" . urlencode($notice_class->notice->thumbnail_url); if ($notice_class->notice->thumbnail_url) { $url_vign = $notice_class->notice->thumbnail_url; } else { if ($code_chiffre) { $url_vign = str_replace("!!noticecode!!", $code_chiffre, $url_image); } else { $url_vign = $opac_url_base . "images/vide.png"; } } } $infos = array('id' => $notice_id, 'title' => $notice_class->notice->tit1, 'vign' => $url_vign, 'header' => $notice_class->notice_header, 'link' => $this->get_constructed_link("notice", $notice_id, $is_bulletin)); if ($this->parameters['used_template']) { $tpl = new notice_tpl_gen($this->parameters['used_template']); $infos['content'] = $tpl->build_notice($notice); } else { $notice_class->do_isbd(); $infos['content'] = $notice_class->notice_isbd; } $render_datas['records'][] = $infos; } } //on rappelle le tout... return parent::render($render_datas); }
function form_compare() { global $tpl_form_compare, $msg, $charset; $sel_notice_tpl = notice_tpl_gen::gen_tpl_select("notice_tpl", $this->notice_tpl, ''); $tpl_form_compare = str_replace('!!notice_nb!!', $this->notice_nb, $tpl_form_compare); $tpl_form_compare = str_replace('!!sel_notice_tpl!!', $sel_notice_tpl, $tpl_form_compare); return $tpl_form_compare; }
public function render($records) { $datas = array(); global $opac_url_base; global $opac_show_book_pics; global $opac_book_pics_url; global $opac_notice_affichage_class; if (!$opac_notice_affichage_class) { $opac_notice_affichage_class = "notice_affichage"; } if (is_array($records['records']) && count($records['records'])) { $query = "select notice_id,tit1,thumbnail_url,code from notices where notice_id in (" . implode(",", $records['records']) . ") order by field( notice_id, " . implode(",", $records['records']) . ")"; $result = pmb_mysql_query($query); if ($result && pmb_mysql_num_rows($result)) { while ($row = pmb_mysql_fetch_object($result)) { if ($opac_show_book_pics == '1' && ($opac_book_pics_url || $row->thumbnail_url)) { $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $row->code); $url_image = $opac_book_pics_url; $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($url_image) . "¬icecode=!!noticecode!!&vigurl=" . urlencode($row->thumbnail_url); if ($row->thumbnail_url) { $url_vign = $row->thumbnail_url; } else { if ($code_chiffre) { $url_vign = str_replace("!!noticecode!!", $code_chiffre, $url_image); } else { $url_vign = get_url_icon("vide.png", 1); } } } $notice_class = new $opac_notice_affichage_class($row->notice_id, ""); $notice_class->do_header(); if ($this->parameters['used_template']) { $tpl = new notice_tpl_gen($this->parameters['used_template']); $content = $tpl->build_notice($row->notice_id); } else { $notice_class->do_isbd(); $content = $notice_class->notice_isbd; } $datas[] = array('id' => $row->notice_id, 'title' => $row->tit1, 'link' => $this->get_constructed_link("notice", $row->notice_id), 'vign' => $url_vign, 'header' => $notice_class->notice_header, 'content' => $content); } } } $datas = array('title' => $records['title'], 'records' => $datas); return parent::render($datas); }
} hr { border:none; border-bottom:1px solid #000000; } h3 { font-size: 12pt; color:#000000; } </style>'; $output_final .= $pheader; $date_today = formatdate(today()); $output_final .= '<h3>' . $date_today . ' ' . sprintf($msg["print_n_notices"], mysql_num_rows($resultat)) . '</h3>'; $output_final .= '<hr style="border:none;border-bottom:solid #000000 3px;"/>'; if ($_SESSION["PRINT"]["notice_tpl"]) { $noti_tpl = new notice_tpl_gen($_SESSION["PRINT"]["notice_tpl"]); } while ($r = mysql_fetch_object($resultat)) { if ($noti_tpl) { $output_final .= $noti_tpl->build_notice($r->notice_id, $deflt2docs_location); $output_final .= "<hr />"; } else { $n = mysql_fetch_object(@mysql_query("select * from notices where notice_id=" . $r->notice_id)); if ($n->niveau_biblio != 's' && $n->niveau_biblio != 'a') { $mono = new mono_display($n, $environement["short"], "", $environement["ex"], "", "", "", 0, 1, $environement["exnum"]); if ($environement["header"]) { $output_final .= '<b>' . $mono->header . '</b><br /><br />'; } $output_final .= $mono->isbd; } else { $serial = new serial_display($n, $environement["short"], "", "", "", "", "", 0, 1, $environement["exnum"]);
/** * * Fonction par défaut d'affichage d'un template (DJANGO ou en base) */ function aff_notice_fonction_template($id, $cart, $gen_header, $use_cache, $mode_aff_notice, $depliable, $nodocnum, $enrichment, $recherche_ajax_mode, $show_map, $recordmodes) { global $liens_opac; global $opac_notice_affichage_class; global $opac_recherche_ajax_mode; global $aff_notice_table_pos; global $memo_notice; $retour_aff = ''; $current_mode = $recordmodes->get_current_mode(); $layout = $recordmodes->get_layout($current_mode); //Début du flux if ($id == -1) { if ($layout['TYPE'] == 'table') { $retour_aff .= "<table class='aff_notice_template'>"; $aff_notice_table_pos = 0; } else { $retour_aff .= "<div class='row'>"; } } if ($id == -2) { if ($layout['TYPE'] == 'table') { for ($i = $aff_notice_table_pos; $i < $layout['COLUMS']; $i++) { $retour_aff .= "<td> </td>"; } if ($aff_notice_table_pos < $layout['COLUMS']) { $retour_aff .= "</tr>"; } $retour_aff .= "</table>"; } else { $retour_aff .= "<div class='aff_notice_template row'></div>"; $retour_aff .= "</div>"; } } if ($id >= 0) { if ($layout['TYPE'] == 'table') { if ($aff_notice_table_pos >= $layout['COLUMS']) { $aff_notice_table_pos = 0; $retour_aff .= "</tr>"; } if (!$aff_notice_table_pos) { $retour_aff .= "<tr>"; } $retour_aff .= "<td>"; } else { $retour_aff .= "<div class='aff_notice_template_notice'>"; } $header_only = 0; if ($recherche_ajax_mode && $opac_recherche_ajax_mode) { //Si ajax, on ne charge pas tout $header_only = 1; } $current = new $opac_notice_affichage_class($id, $liens_opac, $cart, 0, $header_only, !$gen_header, $show_map); $tpl = new notice_tpl_gen($recordmodes->get_template_id($current_mode), $recordmodes->get_template_code($current_mode)); $notice_tpl_header = $tpl->build_notice($id); if ($notice_tpl_header) { $aff_notice = ''; $aff_notice .= $notice_tpl_header; //coins pour Zotero $coins_span = $current->gen_coins_span(); $aff_notice .= $coins_span; $memo_notice[$id]["header_without_doclink"] = $aff_notice; $memo_notice[$id]["header_doclink"] = ""; $memo_notice[$id]["header"] = $aff_notice; $memo_notice[$id]["niveau_biblio"] = $current->notice->niveau_biblio; $retour_aff .= $aff_notice; $aff_notice_table_pos++; } if ($layout['TYPE'] == 'table') { $retour_aff .= "</td>"; } else { $retour_aff .= "</div>"; } } return $retour_aff; }
} else { $checkprintexpl = ""; $checknoprintexpl = "checked"; } $output_final .= "\n\t\t\t\t<input type='radio' name='ex' id='ex1' value='1' {$checkprintexpl} /><label for='ex1'> " . $msg["print_ex"] . "</label><br />\n\t\t\t\t<input type='radio' name='ex' id='ex0' value='0' {$checknoprintexpl} /><label for='ex0'> " . $msg["print_no_ex"] . "</label>\n\t\t\t</blockquote>\n\t\t</div>\n\t</div> \n\t<div id='docnum_part'>\t\n\t</div> \n\t<center>\n\t<input type='submit' value='" . $msg["print_print"] . "' class='bouton' onClick='return getSelectedNotice();' /> \n\t<input type='button' value='" . $msg["print_cancel"] . "' class='bouton' onClick='self.close();'/>\n\t</center>\n\t"; $output_final .= "</form>\n\t\t<script type='text/javascript'>\n\t\tsel_part_gestion();\n\t\t</script>"; } elseif ($output == "docnum") { $docnum = new docnum_merge(0, $doc_num_list); $docnum->merge(); exit; } else { //print "<link rel=\"stylesheet\" href=\"./styles/".$css."/print.css\" />"; $output_final .= "<style type='text/css'>\n\t\t\tBODY { \t\n\t\t\t\tfont-size: 10pt;\n\t\t\t\tfont-family: verdana, geneva, helvetica, arial;\n\t\t\t\tcolor:#000000;\n\t\t\t\t}\n\t\t\ttd {\n\t\t\t\tfont-size: 10pt;\n\t\t\t\tfont-family: verdana, geneva, helvetica, arial;\n\t\t\t\tcolor:#000000;\n\t\t\t}\n\t\t\tth {\n\t\t\t\tfont-size: 10pt;\n\t\t\t\tfont-family: verdana, geneva, helvetica, arial;\n\t\t\t\tfont-weight:bold;\n\t\t\t\tcolor:#000000;\n\t\t\t\tbackground:#DDDDDD;\n\t\t\t\ttext-align:left;\n\t\t\t}\n\t\t\thr {\n\t\t\t\tborder:none;\n\t\t\t\tborder-bottom:1px solid #000000;\n\t\t\t}\n\t\t\th3 {\n\t\t\t\tfont-size: 12pt;\n\t\t\t}\n\t\t\t</style>"; $opac_visionneuse_allow = 0; if ($notice_tpl) { $noti_tpl = new notice_tpl_gen($notice_tpl); } if ($action == 'print_cart') { if ($number && $select_noti) { $cart_ = explode(",", $select_noti); } else { $cart_ = $_SESSION["cart"]; } $date_today = formatdate(today()); if ($output == "email") { //on rajoute une mention spécifiant l'origine du mail... $rqt = "select empr_nom, empr_prenom from empr where id_empr ='" . $_SESSION['id_empr_session'] . "'"; $res = mysql_query($rqt); if (mysql_num_rows($res)) { $info = mysql_fetch_object($res); $output_final .= "<h3>" . $msg['biblio_send_by'] . " " . $info->empr_nom . " " . $info->empr_prenom . "</h3>";
function do_header_similaire($id_tpl = 0) { global $opac_notice_reduit_format; global $opac_notice_reduit_format_similaire; 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; } if (!isset($opac_notice_reduit_format_similaire)) { $opac_notice_reduit_format_similaire = $opac_notice_reduit_format; } $type_reduit = substr($opac_notice_reduit_format_similaire, 0, 1); $notice_tpl_header = ""; if ($type_reduit == "H" || $id_tpl) { if (!$id_tpl) { $id_tpl = substr($opac_notice_reduit_format_similaire, 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; $memo_notice[$this->notice_id]["header_without_doclink"] = $this->notice_header; $memo_notice[$this->notice_id]["header_doclink"] = ""; $memo_notice[$this->notice_id]["header"] = $this->notice_header; $memo_notice[$this->notice_id]["niveau_biblio"] = $this->notice->niveau_biblio; return; } } } if ($type_reduit == "E" || $type_reduit == "P") { // peut-être veut-on des personnalisés ? $perso_voulus_temp = substr($opac_notice_reduit_format_similaire, 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 .= " = " . $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; $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; } } //$this->notice_header.=" <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 .= " <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 .= " <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 .= "\n\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\tif(typeof(sendToVisionneuse) == 'undefined'){\n\t\t\t\t\t\tvar sendToVisionneuse = function (explnum_id){\n\t\t\t\t\t\t\tdocument.getElementById('visionneuseIframe').src = 'visionneuse.php?'+(typeof(explnum_id) != 'undefined' ? 'explnum_id='+explnum_id+\"\" : '\\'');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t</script>\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 aff_get_notice_tpl($param) { global $parser_environnement; global $deflt2docs_location; $id_notice = $parser_environnement['id_notice']; $template_notice = new notice_tpl_gen($parser_environnement['id_template']); $notice = $template_notice->build_notice($param[0], $deflt2docs_location, true); $parser_environnement['id_notice'] = $id_notice; return $notice; }
public function render($datas) { global $dbh; global $opac_url_base; global $opac_show_book_pics; global $opac_book_pics_url; global $opac_notice_affichage_class; global $opac_bannette_notices_depliables; global $opac_bannette_notices_format; global $opac_bannette_notices_order; global $liens_opac; if (!$opac_notice_affichage_class) { $opac_notice_affichage_class = "notice_affichage"; } //on gère l'affichage des banettes foreach ($datas["bannettes"] as $i => $bannette) { $datas['bannettes'][$i]['link'] = $this->get_constructed_link('bannette', $datas['bannettes'][$i]['id']); if ($this->parameters['nb_notices']) { $limitation = " LIMIT " . $this->parameters['nb_notices']; } $requete = "select * from bannette_contenu, notices where num_bannette='" . $datas['bannettes'][$i]['id'] . "' \n\t\t\tand notice_id=num_notice"; if ($opac_bannette_notices_order) { $requete .= " order by " . $opac_bannette_notices_order; } $requete .= " " . $limitation; $resultat = pmb_mysql_query($requete, $dbh); $cpt_record = 0; $datas["bannettes"][$i]['records'] = array(); while ($r = pmb_mysql_fetch_object($resultat)) { $content = ""; if ($opac_show_book_pics == '1' && ($opac_book_pics_url || $r->thumbnail_url)) { $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $r->code); $url_image = $opac_book_pics_url; $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($url_image) . "¬icecode=!!noticecode!!&vigurl=" . urlencode($r->thumbnail_url); if ($r->thumbnail_url) { $url_vign = $r->thumbnail_url; } else { if ($code_chiffre) { $url_vign = str_replace("!!noticecode!!", $code_chiffre, $url_image); } else { $url_vign = $opac_url_base . "images/vide.png"; } } } if ($this->parameters['used_template']) { $tpl = new notice_tpl_gen($this->parameters['used_template']); $content = $tpl->build_notice($r->num_notice); } else { $notice_class = new $opac_notice_affichage_class($r->num_notice, $liens_opac); $notice_class->do_header(); switch ($opac_bannette_notices_format) { case AFF_BAN_NOTICES_REDUIT: $content .= "<div class='etagere-titre-reduit'>" . $notice_class->notice_header_with_link . "</div>"; break; case AFF_BAN_NOTICES_ISBD: $notice_class->do_isbd(); $notice_class->genere_simple($opac_bannette_notices_depliables, 'ISBD'); $content .= $notice_class->result; break; case AFF_BAN_NOTICES_PUBLIC: $notice_class->do_public(); $notice_class->genere_simple($opac_bannette_notices_depliables, 'PUBLIC'); $content .= $notice_class->result; break; case AFF_BAN_NOTICES_BOTH: $notice_class->do_isbd(); $notice_class->do_public(); $notice_class->genere_double($opac_bannette_notices_depliables, 'PUBLIC'); $content .= $notice_class->result; break; default: $notice_class->do_isbd(); $notice_class->do_public(); $notice_class->genere_double($opac_bannette_notices_depliables, 'autre'); $content .= $notice_class->result; break; } } $datas["bannettes"][$i]['records'][$cpt_record]['id'] = $r->num_notice; $datas["bannettes"][$i]['records'][$cpt_record]['title'] = $r->title; $datas["bannettes"][$i]['records'][$cpt_record]['link'] = $this->get_constructed_link("notice", $r->num_notice); $datas["bannettes"][$i]['records'][$cpt_record]['url_vign'] = $url_vign; $datas["bannettes"][$i]['records'][$cpt_record]['content'] = $content; $cpt_record++; } } //on rappelle le tout... return parent::render($datas); }
function show_eval($notice_id = 0) { global $notice_tpl_eval; global $deflt2docs_location; if (!$notice_id) { $notice_id = $this->id_test; } $notice_tpl_gen = new notice_tpl_gen($this->id); $tpl = $notice_tpl_gen->build_notice($notice_id, $deflt2docs_location); $form = str_replace("!!tpl!!", $tpl, $notice_tpl_eval); return $form; }
function get_datas_content($use_limit = 1) { global $dbh; global $msg; global $opac_url_base, $use_opac_url_base; global $opac_notice_affichage_class; global $liens_opac; global $dsi_bannette_notices_order; if ($this->nb_notices_diff && $use_limit) { $limitation = " LIMIT {$this->nb_notices_diff} "; } $requete = "select num_notice from bannette_contenu, notices where num_bannette='" . $this->id_bannette . "' and notice_id=num_notice order by index_serie, tnvol, index_sew {$limitation} "; $resultat = pmb_mysql_query($requete, $dbh); if ($this->notice_tpl) { $noti_tpl = new notice_tpl_gen($this->notice_tpl); } $liste = array(); $liste_group = array(); $notice_group = array(); if (pmb_mysql_num_rows($resultat)) { while ($temp = pmb_mysql_fetch_object($resultat)) { // Si un champ perso est donné comme critère de regroupement if ($this->group_pperso && $this->group_type != 1) { $this->p_perso->get_values($temp->num_notice); $values = $this->p_perso->values; $trouve = false; foreach ($values as $field_id => $vals) { if ($this->group_pperso == $field_id) { foreach ($vals as $cpVal) { $notice_group[$temp->num_notice][] = $this->p_perso->get_formatted_output(array($cpVal), $field_id); if (!$cpVal) { $cpVal = "_no_value_"; } $liste_group[$cpVal][] = $temp; $trouve = true; } $this->field_type = $this->p_perso->t_fields[$field_id]["TYPE"]; $this->field_id = $field_id; } } if (!$trouve) { $liste_group["_no_value_"][] = $temp; $notice_group[$temp->num_notice][] = $this->p_perso->get_formatted_output(array(), $field_id); } } else { $liste[] = $temp; } } } // groupement par facettes if (count($liste) && $this->group_type == 1) { $notice_ids = array(); foreach ($liste as $r) { $notice_ids[] = $r->num_notice; } $facette = new bannette_facettes($this->id_bannette); $this->data_document['sommaires'] = $facette->build_document_data($notice_ids, $this->document_notice_tpl); return; } if (count($liste_group)) { foreach ($liste_group as $list_notice) { $req_list = array(); foreach ($list_notice as $r) { $req_list[] = $r->num_notice; } $requete = "select notice_id as num_notice from notices where notice_id in(" . implode(",", $req_list) . ") order by {$dsi_bannette_notices_order} "; $res_tri = pmb_mysql_query($requete, $dbh); while ($r = pmb_mysql_fetch_object($res_tri)) { $liste[] = $r; } } } $tri_tpl = array(); if ($liste) { $already_printed = array(); foreach ($liste as $r) { $tpl = ""; if ($this->notice_tpl) { $tpl = $noti_tpl->build_notice($r->num_notice, $deflt2docs_location); } if (!$tpl) { if (!$opac_notice_affichage_class) { $opac_notice_affichage_class = "notice_affichage"; } $current = new $opac_notice_affichage_class($r->num_notice, $liens_opac); $current->do_isbd(); $tpl .= $current->notice_isbd; } if ($this->group_pperso) { if ($notice_group[$r->num_notice]) { foreach ($notice_group[$r->num_notice] as $id => $cpDisplay) { if ($this->display_notice_in_every_group) { $already_printed = array(); } if (!$tri_tpl[$notice_group[$r->num_notice][$id]] || !in_array($tpl, $tri_tpl[$notice_group[$r->num_notice][$id]])) { if (!in_array($r->num_notice, $already_printed)) { $tri_tpl[$notice_group[$r->num_notice][$id]][] = $tpl; $already_printed[] = $r->num_notice; } } } } } else { $this->data_document['sommaires'][0]['records'][]['render'] = $tpl; } } } // il faut trier les regroupements par ordre alphabétique if ($this->group_pperso) { //ksort($tri_tpl); $this->pmb_ksort($tri_tpl); $index = 0; foreach ($tri_tpl as $titre => $liste) { $index++; $this->data_document['sommaires'][$index]['level'] = 1; $this->data_document['sommaires'][$index]['title'] = $titre; $nb = 0; foreach ($liste as $val) { $this->data_document['sommaires'][$index]['records'][$nb]['render'] = $val; $nb++; } } } }
function show_form() { global $msg, $charset; global $dsi_flux_form; global $dbh, $PMBuserid; if ($this->id_rss_flux) { $action = "./dsi.php?categ=fluxrss&sub=&id_rss_flux={$this->id_rss_flux}&suite=update"; $button_delete = "<input type='button' class='bouton' value='{$msg['63']}' onClick=\"confirm_delete();\">"; $libelle = $msg['dsi_flux_form_modif']; } else { $action = "./dsi.php?categ=fluxrss&sub=&id_rss_flux=0&suite=update"; $libelle = $msg['dsi_flux_form_creat']; $button_delete = ''; } $sel_notice_tpl = notice_tpl_gen::gen_tpl_select("notice_tpl", $this->tpl_rss_flux, $onchange); $sel_default_format = "<select name='format_flux'>"; if (!$this->format_flux) { $sel_default_format .= "<option selected value='0'>{$msg['dsi_flux_form_format_flux_default_empty']}</option>"; } else { $sel_default_format .= "<option value='0'>{$msg['dsi_flux_form_format_flux_default_empty']}</option>"; } if ($this->format_flux == 'TITLE') { $sel_default_format .= "<option selected value='TITLE'>{$msg['dsi_flux_form_format_flux_default_title']}</option>"; } else { $sel_default_format .= "<option value='TITLE'>{$msg['dsi_flux_form_format_flux_default_title']}</option>"; } if ($this->format_flux == 'ISBD') { $sel_default_format .= "<option selected value='ISBD'>{$msg['dsi_flux_form_format_flux_default_isbd']}</option>"; } else { $sel_default_format .= "<option value='ISBD'>{$msg['dsi_flux_form_format_flux_default_isbd']}</option>"; } if ($this->format_flux == 'ABSTRACT') { $sel_default_format .= "<option selected value='ABSTRACT'>{$msg['dsi_flux_form_format_flux_default_abstract']}</option>"; } else { $sel_default_format .= "<option value='ABSTRACT'>{$msg['dsi_flux_form_format_flux_default_abstract']}</option>"; } $sel_default_format .= "</select>"; $dsi_flux_form = str_replace('!!libelle!!', $libelle, $dsi_flux_form); $dsi_flux_form = str_replace('!!id_rss_flux!!', $this->id_rss_flux, $dsi_flux_form); $dsi_flux_form = str_replace('!!action!!', $action, $dsi_flux_form); $dsi_flux_form = str_replace('!!nom_rss_flux!!', htmlentities($this->nom_rss_flux, ENT_QUOTES, $charset), $dsi_flux_form); $dsi_flux_form = str_replace('!!link_rss_flux!!', htmlentities($this->link_rss_flux, ENT_QUOTES, $charset), $dsi_flux_form); $dsi_flux_form = str_replace('!!descr_rss_flux!!', htmlentities($this->descr_rss_flux, ENT_QUOTES, $charset), $dsi_flux_form); $dsi_flux_form = str_replace('!!lang_rss_flux!!', htmlentities($this->lang_rss_flux, ENT_QUOTES, $charset), $dsi_flux_form); $dsi_flux_form = str_replace('!!copy_rss_flux!!', htmlentities($this->copy_rss_flux, ENT_QUOTES, $charset), $dsi_flux_form); $dsi_flux_form = str_replace('!!editor_rss_flux!!', htmlentities($this->editor_rss_flux, ENT_QUOTES, $charset), $dsi_flux_form); $dsi_flux_form = str_replace('!!webmaster_rss_flux!!', htmlentities($this->webmaster_rss_flux, ENT_QUOTES, $charset), $dsi_flux_form); $dsi_flux_form = str_replace('!!ttl_rss_flux!!', htmlentities($this->ttl_rss_flux, ENT_QUOTES, $charset), $dsi_flux_form); $dsi_flux_form = str_replace('!!img_url_rss_flux!!', htmlentities($this->img_url_rss_flux, ENT_QUOTES, $charset), $dsi_flux_form); $dsi_flux_form = str_replace('!!img_title_rss_flux!!', htmlentities($this->img_title_rss_flux, ENT_QUOTES, $charset), $dsi_flux_form); $dsi_flux_form = str_replace('!!img_link_rss_flux!!', htmlentities($this->img_link_rss_flux, ENT_QUOTES, $charset), $dsi_flux_form); $dsi_flux_form = str_replace('!!format_flux_default!!', $sel_default_format, $dsi_flux_form); $dsi_flux_form = str_replace('!!sel_notice_tpl!!', $sel_notice_tpl, $dsi_flux_form); if ($this->export_court_flux) { $dsi_flux_form = str_replace('!!export_court!!', 'checked', $dsi_flux_form); $dsi_flux_form = str_replace('!!tpl_rss_flux!!', '', $dsi_flux_form); } else { $dsi_flux_form = str_replace('!!tpl_rss_flux!!', 'checked', $dsi_flux_form); $dsi_flux_form = str_replace('!!export_court!!', '', $dsi_flux_form); } $rqt = "select idcaddie as id_obj, name as name_obj from caddie where type='NOTI' "; if ($PMBuserid != 1) { $rqt .= " and (autorisations='{$PMBuserid}' or autorisations like '{$PMBuserid} %' or autorisations like '% {$PMBuserid} %' or autorisations like '% {$PMBuserid}') "; } $rqt .= " order by name "; $result = mysql_query($rqt, $dbh) or die($rqt . "<br /> in rss_flux.class.php : " . mysql_error()); $paniers = ""; while ($contenant = mysql_fetch_object($result)) { if (array_search($contenant->id_obj, $this->num_paniers) !== false) { $checked = "checked"; } else { $checked = ""; } $paniers .= "<div class='usercheckbox'>\n\t\t\t\t\t\t\t<input type='checkbox' id='paniers[" . $contenant->id_obj . "]' name='paniers[]' " . $checked . " value='" . $contenant->id_obj . "' />\n\t\t\t\t\t\t\t<label for='paniers[" . $contenant->id_obj . "]' >" . htmlentities($contenant->name_obj, ENT_QUOTES, $charset) . "</label>\n\t\t\t\t\t\t</div>"; } $dsi_flux_form = str_replace('!!paniers!!', $paniers, $dsi_flux_form); $rqt = "select id_bannette as id_obj, nom_bannette as name_obj from bannettes where proprio_bannette=0 order by nom_bannette "; $result = mysql_query($rqt, $dbh) or die($rqt . "<br /> in rss_flux.class.php : " . mysql_error()); $bannettes = ""; while ($contenant = mysql_fetch_object($result)) { if (array_search($contenant->id_obj, $this->num_bannettes) !== false) { $checked = "checked"; } else { $checked = ""; } $bannettes .= "<div class='usercheckbox'>\n\t\t\t\t\t\t\t<input type='checkbox' id='bannettes[" . $contenant->id_obj . "]' name='bannettes[]' " . $checked . " value='" . $contenant->id_obj . "' />\n\t\t\t\t\t\t\t<label for='bannettes[" . $contenant->id_obj . "]' >" . htmlentities($contenant->name_obj, ENT_QUOTES, $charset) . "</label>\n\t\t\t\t\t\t\t</div>"; } $dsi_flux_form = str_replace('!!bannettes!!', $bannettes, $dsi_flux_form); $dsi_flux_form = str_replace('!!delete!!', $button_delete, $dsi_flux_form); // afin de revenir ou on etait : $form_cb, le critere de recherche global $form_cb; $dsi_flux_form = str_replace('!!form_cb!!', $form_cb, $dsi_flux_form); print $dsi_flux_form; }
function items_notices() { global $dbh, $liens_opac; global $charset; global $opac_flux_rss_notices_order; global $opac_notice_affichage_class; if (!$this->nb_bannettes && !$this->nb_paniers) { $this->notices = ""; return; } if (!$opac_flux_rss_notices_order) { $opac_flux_rss_notices_order = "index_serie, tnvol, index_sew"; } if (!$charset) { $charset = 'ISO-8859-1'; } if ($this->nb_bannettes) { $rqt[] = "select distinct notice_id, index_sew, create_date, update_date, index_serie, tnvol \n\t\t\t\t\tfrom notices join bannette_contenu on num_notice=notice_id \n\t\t\t\t\t\t\tjoin notice_statut on statut=id_notice_statut \n\t\t\t\t\twhere notice_visible_opac=1 and notice_visible_opac_abon=0 and num_bannette in (" . implode(",", $this->num_bannettes) . ") "; } if ($this->nb_paniers) { $rqt[] = "select distinct notice_id, index_sew, create_date, update_date, index_serie, tnvol \n\t\t\t\t\tfrom notices join caddie_content on object_id=notice_id \n\t\t\t\t\t\t\tjoin notice_statut on statut=id_notice_statut \n\t\t\t\t\twhere notice_visible_opac=1 and notice_visible_opac_abon=0 and caddie_id in (" . implode(",", $this->num_paniers) . ") "; } $rqtfinale = implode(' union ', $rqt); pmb_mysql_query("create temporary table tmpfluxrss ENGINE=MyISAM {$rqtfinale} ", $dbh); // Thu, 27 Apr 2006 23:40:11 +0100 $query_not = "select distinct notice_id, index_sew, DATE_FORMAT(create_date,'%a, %e %b %Y %T +0100') as pubdate from tmpfluxrss order by {$opac_flux_rss_notices_order}"; $res = pmb_mysql_query($query_not, $dbh); while ($tmp = pmb_mysql_fetch_object($res)) { if ($opac_notice_affichage_class != "") { $notice = new $opac_notice_affichage_class($tmp->notice_id, $liens_opac, "", 1); } else { $notice = new notice_affichage($tmp->notice_id, $liens_opac, "", 1); } $notice->visu_expl = 0; $notice->visu_explnum = 0; $notice->do_header_without_html(); $retour_aff .= "<item>\n\t\t\t\t\t\t\t\t<title>" . htmlspecialchars($notice->notice_header_without_html, ENT_QUOTES, $charset) . "</title>\n\t\t\t\t\t\t\t\t<pubDate>" . htmlspecialchars($tmp->pubdate, ENT_QUOTES, $charset) . "</pubDate>\n\t\t\t\t\t\t\t\t<link>" . htmlspecialchars(str_replace("!!id!!", $tmp->notice_id, $liens_opac['lien_rech_notice']), ENT_QUOTES, $charset) . "</link>"; $desc = ''; $desc_explnum = ''; if ($this->export_court_flux) { $notice->do_isbd(1, 0); $desc = $notice->notice_isbd; } elseif ($this->tpl_rss_flux) { $noti_tpl = new notice_tpl_gen($this->tpl_rss_flux); $desc .= $noti_tpl->build_notice($tmp->notice_id, $deflt2docs_location); } else { switch ($this->format_flux) { case 'TITLE': $desc = ''; break; case 'ABSTRACT': $desc = $notice->notice->n_resume . '<br />'; break; case 'ISBD': default: $notice->do_isbd(0, 0); $desc = $notice->notice_isbd; $desc_explnum = $this->do_explnum($tmp->notice_id); } } if (!$this->tpl_rss_flux) { $image = $this->do_image($notice->notice->code, $notice->notice->thumbnail_url, $notice->notice->tit1); $desc = str_replace("<br />", "<br/>", $desc); $retour_aff .= "\t<description>" . htmlspecialchars(strip_tags($image . $desc, "<table><tr><td><br/><img>"), ENT_QUOTES, $charset) . "</description>"; $retour_aff .= $desc_explnum; } else { $retour_aff .= "\t<description>" . htmlspecialchars($desc, ENT_QUOTES, $charset) . "</description>"; } $retour_aff .= "</item>"; } $this->notices = $retour_aff; }
} else { $checkprintexpl = ""; $checknoprintexpl = "checked"; } $output_final .= "\n\t\t\t\t<input type='radio' name='ex' id='ex1' value='1' {$checkprintexpl} /><label for='ex1'> " . $msg["print_ex"] . "</label><br />\n\t\t\t\t<input type='radio' name='ex' id='ex0' value='0' {$checknoprintexpl} /><label for='ex0'> " . $msg["print_no_ex"] . "</label>\n\t\t\t</blockquote>\n\t\t</div>\n\t</div> \n\t<div id='docnum_part'>\t\n\t</div> \n\t<center>\n\t<input type='submit' value='" . $msg["print_print"] . "' class='bouton' onClick='return checkForSubmit();' /> \n\t<input type='button' value='" . $msg["print_cancel"] . "' class='bouton' onClick='self.close();'/>\n\t</center>\n\t"; $output_final .= "</form>\n\t\t<script type='text/javascript'>\n\t\tsel_part_gestion();\n\t\t</script>"; } elseif ($output == "docnum") { $docnum = new docnum_merge(0, $doc_num_list); $docnum->merge(); exit; } else { //print "<link rel=\"stylesheet\" href=\"./styles/".$css."/print.css\" />"; $output_final .= "<style type='text/css'>\n\t\t\tBODY { \t\n\t\t\t\tfont-size: 10pt;\n\t\t\t\tfont-family: verdana, geneva, helvetica, arial;\n\t\t\t\tcolor:#000000;\n\t\t\t\t}\n\t\t\ttd {\n\t\t\t\tfont-size: 10pt;\n\t\t\t\tfont-family: verdana, geneva, helvetica, arial;\n\t\t\t\tcolor:#000000;\n\t\t\t}\n\t\t\tth {\n\t\t\t\tfont-size: 10pt;\n\t\t\t\tfont-family: verdana, geneva, helvetica, arial;\n\t\t\t\tfont-weight:bold;\n\t\t\t\tcolor:#000000;\n\t\t\t\tbackground:#DDDDDD;\n\t\t\t\ttext-align:left;\n\t\t\t}\n\t\t\thr {\n\t\t\t\tborder:none;\n\t\t\t\tborder-bottom:1px solid #000000;\n\t\t\t}\n\t\t\th3 {\n\t\t\t\tfont-size: 12pt;\n\t\t\t}\n\t\t\t</style>"; $opac_visionneuse_allow = 0; if ($notice_tpl) { $noti_tpl = new notice_tpl_gen($notice_tpl); } $notices = array(); switch ($action) { case 'print_cart': if ($number && $select_noti) { $notices = explode(",", $select_noti); } else { $notices = $_SESSION["cart"]; } break; case 'print_list': if ($number && $select_noti) { $notices = explode(",", $select_noti); } else { $rqt = "select * from opac_liste_lecture where id_liste='{$id_liste}'";
die("no access"); } require_once "./classes/notice_tpl_gen.class.php"; if ($idcaddie) { $myCart = new caddie($idcaddie); print pmb_bidi(aff_cart_titre($myCart)); switch ($action) { case 'choix_quoi': print pmb_bidi(aff_cart_nb_items($myCart)); $action = "./catalog/caddie/action/edit.php?idcaddie={$idcaddie}"; $action_cancel = "./catalog.php?categ=caddie&sub=action&quelle=edition&action=&idcaddie=0"; $cart_choix_quoi_edition = str_replace('!!action!!', $action, $cart_choix_quoi_edition); $cart_choix_quoi_edition = str_replace('!!action_cancel!!', $action_cancel, $cart_choix_quoi_edition); $cart_choix_quoi_edition = str_replace('!!titre_form!!', $msg["caddie_choix_edition"], $cart_choix_quoi_edition); $suppl = "<input type='hidden' name='dest' value=''> \n\t\t\t\t<input type='button' class='bouton' value='{$msg['caddie_choix_edition_HTML']}' onclick=\"this.form.dest.value='HTML'; this.form.submit();\" /> \n\t\t\t\t<input type='button' class='bouton' value='{$msg['caddie_choix_edition_TABLEAUHTML']}' onclick=\"this.form.dest.value='TABLEAUHTML'; this.form.submit();\" /> \n\t\t\t\t<input type='button' class='bouton' value='{$msg['caddie_choix_edition_TABLEAU']}' onclick=\"this.form.dest.value='TABLEAU'; this.form.submit();\" />"; $sel_notice_tpl = notice_tpl_gen::gen_tpl_select("notice_tpl", 0, '', 1, 1); if ($sel_notice_tpl) { $sel_notice_tpl = $msg['caddie_select_notice_tpl'] . " " . $sel_notice_tpl; $suppl .= " <input type='button' class='bouton' value='" . $msg['etatperso_export_notice'] . "' onclick=\"this.form.dest.value='EXPORT_NOTI'; this.form.submit();\" />"; } $cart_choix_quoi_edition = str_replace('<!-- !!boutons_supp!! -->', $suppl, $cart_choix_quoi_edition); $cart_choix_quoi_edition = str_replace('<!-- notice_template -->', $sel_notice_tpl, $cart_choix_quoi_edition); print $cart_choix_quoi_edition; break; case 'suite': print pmb_bidi(aff_cart_nb_items($myCart)); switch ($myCart->type) { case "EXPL": case "NOTI": case "BULL": default:
function construit_contenu_HTML($use_limit = 1) { global $dbh; global $msg; global $opac_url_base, $use_opac_url_base; global $deflt2docs_location; global $suite; global $url_base_opac; $url_base_opac = $opac_url_base . "index.php?database=" . DATA_BASE . "&lvl=notice_display&id="; $use_opac_url_base = true; // pour URL image vue de l'extérieur global $prefix_url_image; global $depliable; $depliable = 0; $prefix_url_image = $opac_url_base; global $dsi_bannette_notices_order; $this->data_document = array(); if (!$dsi_bannette_notices_order) { $dsi_bannette_notices_order = "index_serie, tnvol, index_sew"; } if ($this->nb_notices_diff && $use_limit) { $limitation = " LIMIT {$this->nb_notices_diff} "; } // purge des archives au dela de $this->archive_number ou si a 0 $this->clean_archive(); $requete = "select num_notice from bannette_contenu, notices where num_bannette='" . $this->id_bannette . "' and notice_id=num_notice order by {$dsi_bannette_notices_order} {$limitation} "; $resultat = pmb_mysql_query($requete, $dbh) or die($requete . " " . pmb_mysql_error()); // paramétrage : $environement["short"] = 6; $environement["ex"] = 0; $environement["exnum"] = 1; if ($this->nb_notices_diff >= $this->nb_notices || !$this->nb_notices_diff) { $nb_envoyees = $this->nb_notices; } else { $nb_envoyees = $this->nb_notices_diff; } $resultat_aff .= "<span class=\"dsi_hide_for_emails\"><hr />"; $resultat_aff .= sprintf($msg["dsi_diff_n_notices"], $nb_envoyees, $this->nb_notices); $resultat_aff .= "<hr /></span>"; if ($this->notice_tpl) { $noti_tpl = new notice_tpl_gen($this->notice_tpl); } $liste = array(); $liste_group = array(); $notice_group = array(); if (pmb_mysql_num_rows($resultat)) { while ($temp = pmb_mysql_fetch_object($resultat)) { // Si un champ perso est donné comme critère de regroupement if ($this->group_pperso && $this->group_type != 1) { $this->p_perso->get_values($temp->num_notice); $values = $this->p_perso->values; $trouve = false; foreach ($values as $field_id => $vals) { if ($this->group_pperso == $field_id) { foreach ($vals as $cpVal) { $notice_group[$temp->num_notice][] = $this->p_perso->get_formatted_output(array($cpVal), $field_id); if (!$cpVal) { $cpVal = "_no_value_"; } $liste_group[$cpVal][] = $temp; $trouve = true; } $this->field_type = $this->p_perso->t_fields[$field_id]["TYPE"]; $this->field_id = $field_id; } } if (!$trouve) { $liste_group["_no_value_"][] = $temp; $notice_group[$temp->num_notice][] = $this->p_perso->get_formatted_output(array(), $field_id); } } else { $liste[] = $temp; } // archivage if ($this->archive_number) { $req = "insert into dsi_archive set num_banette_arc='" . $this->id_bannette . "', num_notice_arc='" . $temp->num_notice . "', date_diff_arc=CURDATE() "; pmb_mysql_query($req, $dbh); } } } // groupement par facettes if (count($liste) && $this->group_type == 1) { $notice_ids = array(); foreach ($liste as $r) { $notice_ids[] = $r->num_notice; } $facette = new bannette_facettes($this->id_bannette); if ($suite == "gen_document") { if ($this->bannette_tpl_num) { $this->data_document['sommaires'] = $facette->build_document_data($notice_ids, $this->document_notice_tpl); return; } else { $this->aff_document = $facette->build_document($notice_ids, $this->document_notice_tpl, $this->document_add_summary, 1); } } else { if ($this->bannette_tpl_num) { $this->data_document['sommaires'] = $facette->build_document_data($notice_ids, $this->document_notice_tpl); return; } else { $this->aff_document = $facette->build_document($notice_ids, $this->document_notice_tpl, $this->document_add_summary); } } if ($this->typeexport && !$use_limit) { $this->export_contenu = cree_export_notices($this->liste_id_notice, start_export::get_id_by_path($this->typeexport), 1, $this->param_export); } return $resultat_aff . $this->aff_document; } if (count($liste_group)) { foreach ($liste_group as $list_notice) { $req_list = array(); foreach ($list_notice as $r) { $req_list[] = $r->num_notice; } $requete = "select notice_id as num_notice from notices where notice_id in(" . implode(",", $req_list) . ") order by {$dsi_bannette_notices_order} "; $res_tri = pmb_mysql_query($requete, $dbh); while ($r = pmb_mysql_fetch_object($res_tri)) { $liste[] = $r; } } } $group_printed = $tri_tpl = array(); $memo_resultat_aff = $resultat_aff; $group_printed_document = $tri_tpl_document = array(); $aff_document = ""; if ($this->document_notice_tpl && $this->document_generate) { $noti_tpl_document = new notice_tpl_gen($this->document_notice_tpl); } if ($liste) { $already_printed = array(); $already_printed_document = array(); foreach ($liste as $r) { if ($this->document_generate) { $tpl_document = ""; if ($this->document_notice_tpl) { $tpl_document = $noti_tpl_document->build_notice($r->num_notice, $deflt2docs_location); } if (!$tpl_document) { $n = pmb_mysql_fetch_object(@pmb_mysql_query("select * from notices where notice_id=" . $r->num_notice)); global $use_opac_url_base; $use_opac_url_base = 1; global $use_dsi_diff_mode; $use_dsi_diff_mode = 1; if ($this->statut_not_account) { $use_dsi_diff_mode = 2; } //On ne tient pas compte des statuts de notice pour la diffusion if ($n->niveau_biblio == 'm' || $n->niveau_biblio == 'b') { $mono = new mono_display($n, $environement["short"], "", $environement["ex"], "", "", "", 0, 1, $environement["exnum"], 0, "", 0, true, false); $tpl_document .= "<a href='" . $url_base_opac . $n->notice_id . "&code=!!code!!&emprlogin=!!login!!&date_conex=!!date_conex!!'><b>" . $mono->header . "</b></a><br /><br />\r\n"; $tpl_document .= $mono->isbd; } elseif ($n->niveau_biblio == 's' || $n->niveau_biblio == 'a') { $serial = new serial_display($n, 6, "", "", "", "", "", 0, 1, $environement["exnum"], 0, false); $tpl_document .= "<a href='" . $url_base_opac . $n->notice_id . "&code=!!code!!&emprlogin=!!login!!&date_conex=!!date_conex!!'><b>" . $serial->header . "</b></a><br /><br />\r\n"; $tpl_document .= $serial->isbd; } $tpl_document = str_replace('<!-- !!avis_notice!! -->', "", $tpl_document); } if ($this->document_group) { if ($notice_group[$r->num_notice]) { foreach ($notice_group[$r->num_notice] as $id => $cpDisplay) { if ($this->display_notice_in_every_group) { $already_printed_document = array(); } if (!$tri_tpl_document[$notice_group[$r->num_notice][$id]] || !in_array($tpl_document, $tri_tpl_document[$notice_group[$r->num_notice][$id]])) { if (!in_array($r->num_notice, $already_printed_document)) { $tri_tpl_document[$notice_group[$r->num_notice][$id]][] = $tpl_document; $already_printed_document[] = $r->num_notice; } } if ($cpDisplay && !in_array($cpDisplay, $group_printed_document)) { $group_printed_document[] = $cpDisplay; } } } } else { if (!in_array($r->num_notice, $already_printed_document)) { if (!$this->notice_tpl) { $aff_document .= $tpl_document . "<hr />\r\n"; } else { $aff_document .= $tpl_document . "\r\n"; } $already_printed_document[] = $r->num_notice; if ($this->bannette_tpl_num) { $this->data_document['sommaires'][0]['records'][]['render'] = $tpl_document; } } } } // DSI classique par mail... $tpl = ""; if ($this->notice_tpl) { $tpl = $noti_tpl->build_notice($r->num_notice, $deflt2docs_location); } if (!$tpl) { $n = pmb_mysql_fetch_object(@pmb_mysql_query("select * from notices where notice_id=" . $r->num_notice)); global $use_opac_url_base; $use_opac_url_base = 1; global $use_dsi_diff_mode; $use_dsi_diff_mode = 1; if ($this->statut_not_account) { $use_dsi_diff_mode = 2; } //On ne tient pas compte des statuts de notice pour la diffusion if ($n->niveau_biblio == 'm' || $n->niveau_biblio == 'b') { //function mono_display($id, $level=1, $action='', $expl=1, $expl_link='', $lien_suppr_cart="", $explnum_link='', $show_resa=0, $print=0, $show_explnum=1, $show_statut=0, $anti_loop='', $draggable=0, $no_link=false, $show_opac_hidden_fields=true ) $mono = new mono_display($n, $environement["short"], "", $environement["ex"], "", "", "", 0, 1, $environement["exnum"], 0, "", 0, true, false); $tpl .= "<a href='" . $url_base_opac . $n->notice_id . "&code=!!code!!&emprlogin=!!login!!&date_conex=!!date_conex!!'><b>" . $mono->header . "</b></a><br /><br />\r\n"; $tpl .= $mono->isbd; } elseif ($n->niveau_biblio == 's' || $n->niveau_biblio == 'a') { // level=2 pour ne pas rajouter le "in ..." sur le titre de la notice de dépouillement // function serial_display ($id, $level='1', $action_serial='', $action_analysis='', $action_bulletin='', $lien_suppr_cart="", $lien_explnum="", $bouton_explnum=1,$print=0,$show_explnum=1, $show_statut=0, $show_opac_hidden_fields=true ) { $serial = new serial_display($n, 6, "", "", "", "", "", 0, 1, $environement["exnum"], 0, false); $tpl .= "<a href='" . $url_base_opac . $n->notice_id . "&code=!!code!!&emprlogin=!!login!!&date_conex=!!date_conex!!'><b>" . $serial->header . "</b></a><br /><br />\r\n"; $tpl .= $serial->isbd; } $tpl = str_replace('<!-- !!avis_notice!! -->', "", $tpl); } if ($this->group_pperso) { foreach ($notice_group[$r->num_notice] as $id => $cpDisplay) { if ($this->display_notice_in_every_group) { $already_printed = array(); } if (!$tri_tpl[$notice_group[$r->num_notice][$id]] || !in_array($tpl, $tri_tpl[$notice_group[$r->num_notice][$id]])) { if (!in_array($r->num_notice, $already_printed)) { $tri_tpl[$notice_group[$r->num_notice][$id]][] = $tpl; $already_printed[] = $r->num_notice; } } if ($cpDisplay && !in_array($cpDisplay, $group_printed)) { $group_printed[] = $cpDisplay; } } } else { $resultat_aff .= $tpl; if ($this->bannette_tpl_num) { $this->data_document['sommaires'][0]['records'][]['render'] = $tpl; } if (!$this->notice_tpl) { $resultat_aff .= "<div class='hr'><hr /></div>\r\n"; } else { $resultat_aff .= "<br />"; } } } } // on retrie chaque goupe de notice selon le critère de tri de la DSI // il faut trier les regroupements par ordre alphabétique (si document à générer et groupement) $this->aff_document = ""; if ($this->document_generate) { if ($this->document_group) { $aff_document = ""; $this->pmb_ksort($tri_tpl_document); $index = 0; $summary = ""; global $group_separator; global $notice_separator; foreach ($tri_tpl_document as $titre => $liste) { if ($group_separator) { $aff_document .= $group_separator; } else { $aff_document .= "<div class='hr_group'><hr /></div>"; } $index++; if ($this->bannette_tpl_num) { $this->data_document['sommaires'][$index]['level'] = 1; $this->data_document['sommaires'][$index]['title'] = $titre; } $aff_document .= "<a name='[{$index}]'></a><h1>" . $index . " - " . $titre . "</h1>"; $summary .= "<a href='#[{$index}]' class='summary_elt'>" . $index . " - " . $titre . "</a><br />"; $nb = 0; foreach ($liste as $val) { $aff_document .= $val; if ($this->bannette_tpl_num) { $this->data_document['sommaires'][$index]['records'][$nb]['render'] = $val; } if (++$nb < count($liste)) { if (!$this->notice_tpl) { if ($notice_separator) { $aff_document .= $notice_separator; } else { $aff_document .= "<div class='hr'><hr /></div>"; } } else { $aff_document .= "<br />"; } } } $aff_document .= "\r\n"; } //$summary.="</div>"; if ($this->document_add_summary) { $aff_document = "<a name='summary'></a><div class='summary'><br />" . $summary . "</div>" . $aff_document; } $this->aff_document = $aff_document; } else { $this->aff_document = $aff_document; } } // il faut trier les regroupements par ordre alphabétique if ($this->group_pperso) { $resultat_aff = $memo_resultat_aff; //ksort($tri_tpl); $this->pmb_ksort($tri_tpl); $index = 0; $summary = ""; foreach ($tri_tpl as $titre => $liste) { global $group_separator; global $notice_separator; if ($group_separator) { $resultat_aff .= $group_separator; } else { $resultat_aff .= "<div class='hr_group'><hr /></div>"; } $index++; if ($this->bannette_tpl_num) { $this->data_document['sommaires'][$index]['level'] = 1; $this->data_document['sommaires'][$index]['title'] = $titre; } $resultat_aff .= "<a name='[{$index}]'></a><h1>" . $index . " - " . $titre . "</h1>"; $summary .= "<a href='#[{$index}]' class='summary_elt'>" . $index . " - " . $titre . "</a><br />"; $nb = 0; foreach ($liste as $val) { $resultat_aff .= $val; if ($this->bannette_tpl_num) { $this->data_document['sommaires'][$index]['records'][$nb]['render'] = $val; } if (++$nb < count($liste)) { if (!$this->notice_tpl) { if ($notice_separator) { $resultat_aff .= $notice_separator; } else { $resultat_aff .= "<div class='hr'><hr /></div>"; } } else { $resultat_aff .= "<br />"; } } } $resultat_aff .= "\r\n"; } if ($this->document_add_summary) { $resultat_aff = "<a name='summary'></a><div class='summary'><br />" . $summary . "</div>" . $resultat_aff; } } if ($this->typeexport && !$use_limit) { $this->export_contenu = cree_export_notices($this->liste_id_notice, start_export::get_id_by_path($this->typeexport), 1, $this->param_export); } // DEBUG if (false && $this->export_contenu) { $fp = fopen("{$base_path}/temp/exp_bannette_" . $this->id_bannette . ".exp", "wb"); fwrite($fp, $this->export_contenu); fclose($fp); } return $resultat_aff; }
function afftab_cart_objects($idcaddie = 0, $flag = "", $no_flag = "", $notice_tpl = 0) { global $msg, $dbh, $charset; global $worksheet; global $myCart; global $dest; global $entete_bloc; global $max_aut; global $max_perso; global $res_compte3; global $etat_table; // permet de savoir si les tag table sont ouverts ou ferm�s if ($flag == "" && $no_flag == "") { $no_flag = 1; $flag = 1; } $caddie_type = $myCart->type; // Afin de trier les éditions : switch ($caddie_type) { case 'NOTI': $fromc = " left join notices on object_id=notice_id "; $orderc = ", niveau_hierar desc "; break; case 'EXPL': $fromc = " left join exemplaires on object_id=expl_id "; $orderc = ", expl_notice desc, expl_bulletin "; break; case 'BULL': $fromc = " left join bulletins on object_id=bulletin_id "; $orderc = ", date_date "; break; } $requete = "SELECT caddie_content.* FROM caddie_content {$fromc} where caddie_id='" . $idcaddie . "' "; if ($flag && $no_flag) { $complement_clause = ""; } if (!$flag && $no_flag) { $complement_clause = " and flag is null "; } if ($flag && !$no_flag) { $complement_clause = " and flag is not null "; } if (!$flag && !$no_flag) { return; } $requete .= $complement_clause . " order by blob_type, content {$orderc}, object_id"; $liste = array(); $result = mysql_query($requete, $dbh) or die($requete . "<br />" . mysql_error($dbh)); if ($dest == "EXPORT_NOTI") { $noti_tpl = new notice_tpl_gen($notice_tpl); } if (mysql_num_rows($result)) { while ($temp = mysql_fetch_object($result)) { if ($dest == "EXPORT_NOTI") { if ($caddie_type == "EXPL") { $rqt_test = "select expl_notice as id from exemplaires where expl_id='" . $temp->object_id . "' "; $res_notice = mysql_query($rqt_test, $dbh); $obj_notice = mysql_fetch_object($res_notice); if (!$obj_notice->id) { $rqt_test = "select num_notice as id from bulletins join exemplaires on bulletin_id=expl_bulletin where expl_id='" . $temp->object_id . "' "; $res_notice = mysql_query($rqt_test, $dbh); $obj_notice = mysql_fetch_object($res_notice); } if (!$flag_notice_id[$obj_notice->id] && $obj_notice->id) { $flag_notice_id[$obj_notice->id] = 1; $contents .= $noti_tpl->build_notice($obj_notice->id) . "<hr />"; } } elseif ($caddie_type == "NOTI") { $contents .= $noti_tpl->build_notice($temp->object_id) . "<hr />"; } if ($caddie_type == "BULL") { $rqt_test = $rqt_tout = "select num_notice as id from bulletins where bulletin_id = '" . $temp->object_id . "' "; $res_notice = mysql_query($rqt_test, $dbh); $obj_notice = mysql_fetch_object($res_notice); if (!$flag_notice_id[$obj_notice->id] && $obj_notice->id) { $flag_notice_id[$obj_notice->id] = 1; $contents .= $noti_tpl->build_notice($obj_notice->id) . "<hr />"; } } } else { $liste[] = array('object_id' => $temp->object_id, 'content' => $temp->content, 'blob_type' => $temp->blob_type, 'flag' => $temp->flag); } } } else { return; } switch ($dest) { case "TABLEAU": break; case "EXPORT_NOTI": return "<html>\n\t\t\t\t<head>\n\t\t\t\t\t<meta http-equiv=\"content-type\" content=\"text/html; charset=" . $charset . "\" />\n\t\t\t\t\t<meta charset=\"" . $charset . "\" />\n\t\t\t\t</head>\n\t\t\t\t<body>" . $contents . "</body></html>"; break; case "TABLEAUHTML": default: echo pmb_bidi("<h1>" . $msg['panier_num'] . " {$idcaddie} / " . $myCart->name . "</h1>"); echo pmb_bidi($myCart->comment . "<br />"); break; } // en fonction du type de caddie on affiche ce qu'il faut if ($caddie_type == "NOTI") { // calcul du nombre max de colonnes pour les auteurs $rqt_compte1 = "create temporary table tmp_compte1 ENGINE=MyISAM as select count(*) as comptage from caddie_content join notices on object_id=notice_id left join responsability on responsability_notice=notice_id where caddie_id={$idcaddie} group by notice_id"; $res_compte1 = mysql_query($rqt_compte1, $dbh); $rqt_compte2 = "select max(comptage) as max_aut from tmp_compte1 "; $res_compte2 = mysql_query($rqt_compte2, $dbh); $compte2 = mysql_fetch_object($res_compte2); $max_aut = $compte2->max_aut; // calcul du nombre max de colonnes pour les champs perso $rqt_compte3 = "select idchamp, titre from notices_custom order by ordre "; $res_compte3 = mysql_query($rqt_compte3, $dbh); $max_perso = mysql_num_rows($res_compte3); // boucle de parcours des notices trouvées // inclusion du javascript de gestion des listes dépliables // début de liste $entete_bloc_prec = ""; while (list($cle, $object) = each($liste)) { if ($object[content] == "") { //On regarde le type de notice $requete = "select niveau_biblio, niveau_hierar FROM notices WHERE notice_id='" . $object[object_id] . "' "; $mon_res = mysql_query($requete, $dbh); $sel = ", '', '', '', '', '', '', ''"; $tabl = ""; if (mysql_result($mon_res, 0, 0) == "a" && mysql_result($mon_res, 0, 1) == "2") { $sel = " ,n2.tit1 as 'Périodique', n2.code as ISSN, b.bulletin_numero, b.mention_date, b.date_date, b.bulletin_titre, b.bulletin_cb "; $tabl = " JOIN analysis ON n1.notice_id=analysis_notice JOIN bulletins b ON analysis_bulletin=b.bulletin_id JOIN notices n2 ON n2.notice_id=bulletin_notice "; } elseif (mysql_result($mon_res, 0, 0) == "b" && mysql_result($mon_res, 0, 1) == "2") { $sel = " ,n2.tit1, n2.code as ISSN, b.bulletin_numero, b.mention_date, b.date_date, b.bulletin_titre, b.bulletin_cb "; $tabl = " JOIN bulletins b ON n1.notice_id=b.num_notice JOIN notices n2 ON n2.notice_id=bulletin_notice "; } $rqt_tout = "SELECT n1.notice_id, n1.typdoc, n1.tit1, n1.tit2, n1.tit3, n1.tit4, serie_name, n1.tnvol, p1.ed_name, p1.ed_ville, collection_name, sub_coll_name, n1.year, n1.nocoll, n1.mention_edition, p2.ed_name as '2nd editeur', p2.ed_ville as 'ville 2nd editeur', n1.code as ISBN, n1.npages, n1.ill, n1.size, n1.accomp, n1.n_gen, n1.n_contenu, n1.n_resume, n1.lien, n1.eformat, n1.index_l, indexint_name, n1.niveau_biblio, n1.niveau_hierar, n1.prix, n1.statut, n1.commentaire_gestion, n1.thumbnail_url, n1.create_date, n1.update_date " . $sel . " FROM notices n1"; $rqt_tout .= " left join series on serie_id=n1.tparent_id "; $rqt_tout .= " left join publishers p1 on p1.ed_id=n1.ed1_id "; $rqt_tout .= " left join publishers p2 on p2.ed_id=n1.ed2_id "; $rqt_tout .= " left join collections on n1.coll_id=collection_id "; $rqt_tout .= " left join sub_collections on n1.subcoll_id=sub_coll_id "; $rqt_tout .= " left join indexint on n1.indexint=indexint_id "; $rqt_tout .= $tabl; $rqt_tout .= " WHERE n1.notice_id='" . $object[object_id] . "' "; //echo "requete :".$rqt_tout."\n"; $entete_bloc = "MONO"; if ($entete_bloc != $entete_bloc_prec) { extrait_info_notice($rqt_tout, 1, $object[flag]); $entete_bloc_prec = $entete_bloc; } else { extrait_info_notice($rqt_tout, 0, $object[flag]); } } else { $entete_bloc = "BLOB"; if ($entete_bloc != $entete_bloc_prec) { extrait_blob($object[blob_type] . " " . $object[content], 1, $object[flag]); $entete_bloc_prec = $entete_bloc; } else { extrait_blob($object[blob_type] . " " . $object[content], 0, $object[flag]); } } } // fin de liste } // fin si NOTI // si EXPL if ($caddie_type == "EXPL") { // calcul du nombre max de colonnes pour les auteurs $rqt_compte1 = "create temporary table tmp_compte1 ENGINE=MyISAM as select count(*) as comptage from caddie_content join notices on object_id=notice_id left join responsability on responsability_notice=notice_id where caddie_id={$idcaddie} group by notice_id"; $res_compte1 = mysql_query($rqt_compte1, $dbh); $rqt_compte2 = "select max(comptage) as max_aut from tmp_compte1 "; $res_compte2 = mysql_query($rqt_compte2, $dbh); $compte2 = mysql_fetch_object($res_compte2); $max_aut = $compte2->max_aut; // calcul du nombre max de colonnes pour les champs perso $rqt_compte3 = "select idchamp, titre from expl_custom order by ordre "; $res_compte3 = mysql_query($rqt_compte3, $dbh); $max_perso = mysql_num_rows($res_compte3); // boucle de parcours des exemplaires trouvés $entete_bloc_prec = ""; while (list($cle, $expl) = each($liste)) { if (!$expl["content"]) { $rqt_test = "select expl_bulletin from exemplaires where expl_id='" . $expl[object_id] . "' "; $result_test = mysql_query($rqt_test, $dbh); $obj_test = mysql_fetch_object($result_test); if ($obj_test->expl_bulletin == 0) { // expl de mono $rqt_tout = "SELECT e.*, t.*, s.*, st.*, l.location_libelle, stat.*, n.*"; $rqt_tout .= " FROM exemplaires e"; $rqt_tout .= ", docs_type t"; $rqt_tout .= ", docs_section s"; $rqt_tout .= ", docs_statut st"; $rqt_tout .= ", docs_location l"; $rqt_tout .= ", docs_codestat stat"; $rqt_tout .= ", notices n"; $rqt_tout .= " WHERE e.expl_id='" . $expl[object_id] . "'"; $rqt_tout .= " AND e.expl_typdoc=t.idtyp_doc"; $rqt_tout .= " AND e.expl_section=s.idsection"; $rqt_tout .= " AND e.expl_statut=st.idstatut"; $rqt_tout .= " AND e.expl_location=l.idlocation"; $rqt_tout .= " AND e.expl_codestat=stat.idcode"; $rqt_tout .= " AND e.expl_notice=n.notice_id"; $entete_bloc = "EXPLMONO"; } else { // expl de bulletin $rqt_tout = "SELECT e.*, t.*, s.*, st.*, l.location_libelle, stat.*, n.*, b.*"; $rqt_tout .= " FROM exemplaires e"; $rqt_tout .= ", docs_type t"; $rqt_tout .= ", docs_section s"; $rqt_tout .= ", docs_statut st"; $rqt_tout .= ", docs_location l"; $rqt_tout .= ", docs_codestat stat"; $rqt_tout .= ", notices n"; $rqt_tout .= ", bulletins b"; $rqt_tout .= " WHERE e.expl_id='" . $expl[object_id] . "'"; $rqt_tout .= " AND e.expl_typdoc=t.idtyp_doc"; $rqt_tout .= " AND e.expl_section=s.idsection"; $rqt_tout .= " AND e.expl_statut=st.idstatut"; $rqt_tout .= " AND e.expl_location=l.idlocation"; $rqt_tout .= " AND e.expl_codestat=stat.idcode"; $rqt_tout .= " AND e.expl_bulletin=b.bulletin_id"; $rqt_tout .= " AND n.notice_id=b.bulletin_notice"; $entete_bloc = "EXPLBULL"; } if ($entete_bloc != $entete_bloc_prec) { extrait_info_notice($rqt_tout, 1, $expl["flag"]); $entete_bloc_prec = $entete_bloc; } else { extrait_info_notice($rqt_tout, 0, $expl["flag"]); } } else { $entete_bloc = "BLOB"; if ($entete_bloc != $entete_bloc_prec) { extrait_blob($expl["blob_type"] . " " . $expl["content"], 1, $expl["flag"]); $entete_bloc_prec = $entete_bloc; } else { extrait_blob($expl["blob_type"] . " " . $expl["content"], 0, $expl["flag"]); } } } // fin de liste } // fin si EXPL if ($caddie_type == "BULL") { // boucle de parcours des bulletins trouvés // inclusion du javascript de gestion des listes dépliables // début de liste $entete_bloc_prec = ""; while (list($cle, $expl) = each($liste)) { if (!$expl["content"]) { $rqt_tout = "select * from bulletins where bulletin_id = '" . $expl[object_id] . "' "; $entete_bloc = "BULL"; if ($entete_bloc != $entete_bloc_prec) { extrait_info($rqt_tout, 1, $expl["flag"]); $entete_bloc_prec = $entete_bloc; } else { extrait_info($rqt_tout, 0, $expl["flag"]); } } else { $entete_bloc = "BLOB"; if ($entete_bloc != $entete_bloc_prec) { extrait_blob($expl["blob_type"] . " " . $expl["content"], 1, $expl["flag"]); $entete_bloc_prec = $entete_bloc; } else { extrait_blob($expl["blob_type"] . " " . $expl["content"], 0, $expl["flag"]); } } } // fin de liste } // fin si BULL return; }
$fieldname = mysql_field_name($res, $i); print "{$fieldname}\t"; } for ($i = 0; $i < $nbr_lignes; $i++) { $row = mysql_fetch_row($res); echo "\n"; foreach ($row as $dummykey => $col) { /* if (is_numeric($col)) { $col = "\"'".(string)$col."\"" ; } */ print "{$col}\t"; } } break; case "EXPORT_NOTI": $noti_tpl = new notice_tpl_gen($form_notice_tpl); for ($i = 0; $i < $nbr_lignes; $i++) { $row = mysql_fetch_object($res); $contents .= $noti_tpl->build_notice($row->{$proc_notice_tpl_field}) . "<hr />"; } header("Content-Disposition: attachment; filename='bibliographie.doc';"); header('Content-type: application/msword'); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); header("Pragma: public"); echo "<html><body>" . $contents . "</body></html>"; break; default: echo "<script type='text/javascript'>\n\t\t\t\t\tfunction survol(obj){\n\t\t\t\t\t\tobj.style.cursor = 'pointer';\n\t\t\t\t\t}\n\t\t\t\t\tfunction sort_by_col(type){\n\t\t\t\t\t\tdocument.forms['navbar'].sort.value = type;\n\t\t\t\t\t\tdocument.forms['navbar'].submit();\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t</script>"; echo "<table>"; for ($i = 0; $i < $nbr_champs; $i++) {
function render($context, $stream) { global $dbh; global $class_path; $query_stream = new StreamWriter(); $this->pmb_notice->render($context, $query_stream); $notice_id = $query_stream->close(); $notice_id = $notice_id + 0; $query = "select count(notice_id) from notices where notice_id=" . $notice_id; $result = mysql_query($query, $dbh); if ($result && mysql_result($result, 0)) { require_once "{$class_path}/notice_tpl_gen.class.php"; $struct = array(); $tpl = new notice_tpl_gen($this->id_tpl); $this->content = $tpl->build_notice($notice_id); $stream->write($this->content); } }
function do_header() { global $msg, $dbh, $base_path; global $charset; global $pmb_notice_reduit_format; global $icon_doc; global $tdoc, $biblio_doc; global $use_opac_url_base, $opac_url_base, $use_dsi_diff_mode; global $no_aff_doc_num_image; $aut1_libelle = array(); $type_reduit = substr($pmb_notice_reduit_format, 0, 1); //Icone type de Document $icon = $icon_doc[$this->notice->niveau_biblio . $this->notice->typdoc]; if ($icon) { $info_bulle_icon = $biblio_doc[$this->notice->niveau_biblio] . " : " . $tdoc->table[$this->notice->typdoc]; if ($use_opac_url_base) { $this->icondoc = "<img src=\"" . $opac_url_base . "images/{$icon}\" alt=\"{$info_bulle_icon}\" title=\"{$info_bulle_icon}\" align='top' />"; } else { $this->icondoc = "<img src=\"" . $base_path . "/images/{$icon}\" alt=\"{$info_bulle_icon}\" title=\"{$info_bulle_icon}\" align='top' />"; } } //Icone nouveauté $icon = "icone_nouveautes.png"; if ($this->notice->notice_is_new) { $info_bulle_icon_new = $msg["notice_is_new_gestion"]; if ($use_opac_url_base) { $this->icon_is_new = "<img src=\"" . $opac_url_base . "images/{$icon}\" alt=\"{$info_bulle_icon_new}\" title=\"{$info_bulle_icon_new}\" align='top' />"; } else { $this->icon_is_new = "<img src=\"" . $base_path . "/images/{$icon}\" alt=\"{$info_bulle_icon_new}\" title=\"{$info_bulle_icon_new}\" align='top' />"; } } 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, $dbh) or die($rqt_st . " " . pmb_mysql_error()); $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; } } if ($txt) { $statut = "<small><span {$class_html} style='margin-right: 3px;'><a href=# onmouseover=\"z=document.getElementById('zoom_statut" . $this->notice_id . "'); z.style.display=''; \" onmouseout=\"z=document.getElementById('zoom_statut" . $this->notice_id . "'); z.style.display='none'; \"><img src='" . $base_path . "/images/spacer.gif' width='10' height='10' /></a></span></small>"; $statut .= "<div id='zoom_statut" . $this->notice_id . "' style='border: solid 2px #555555; background-color: #FFFFFF; position: absolute; display:none; z-index: 2000;'><b>" . nl2br(htmlentities($txt, ENT_QUOTES, $charset)) . "</b></div>"; } else { $statut = "<small><span {$class_html} style='margin-right: 3px;'><img src='" . $base_path . "/images/spacer.gif' width='10' height='10' /></span></small>"; } $this->aff_statut = $statut; if ($type_reduit == "H") { $id_tpl = substr($pmb_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->header = $notice_tpl_header; } } } if ($type_reduit == "E" || $type_reduit == "P") { // peut-être veut-on des personnalisés ? $perso_voulus_temp = substr($pmb_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 editeur($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 = ""; } if ($type_reduit == "E" || $type_reduit == "P") { if (!is_object($this->p_perso)) { $this->p_perso = new parametres_perso("notices"); } //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 = ""; } } if ($type_reduit != "H") { // récupération du titre de série if ($this->tit_serie) { $this->header = $this->header_texte = $this->tit_serie; if ($this->notice->tnvol) { $this->header .= ', ' . $this->notice->tnvol; $this->header_texte .= ', ' . $this->notice->tnvol; } } elseif ($this->notice->tnvol) { $this->header .= $this->notice->tnvol; $this->header_texte .= $this->notice->tnvol; } $this->tit1 = $this->notice->tit1; $this->header ? $this->header .= '. ' . $this->tit1 : ($this->header = $this->tit1); $this->header_texte ? $this->header_texte .= '. ' . $this->tit1 : ($this->header_texte = $this->tit1); $this->memo_titre = $this->header_texte; $this->memo_complement_titre = $this->notice->tit4; $this->memo_titre_parallele = $this->notice->tit3; } if ($type_reduit == '4') { if ($this->memo_titre_parallele != "") { $this->header .= " = " . $this->memo_titre_parallele; $this->header_texte .= ' = ' . $this->memo_titre_parallele; } } // if ((floor($type_reduit/10) == 1)&&($this->memo_complement_titre)) { // $this->header.=" : ".htmlentities($this->memo_complement_titre,ENT_QUOTES,$charset); // $this->header_texte.=" : ".$this->memo_complement_titre; // } if ($type_reduit == "T" && $this->memo_complement_titre) { $this->header .= " : " . htmlentities($this->memo_complement_titre, ENT_QUOTES, $charset); $this->header_texte .= " : " . $this->memo_complement_titre; } if ($type_reduit != '3' && $type_reduit != 'H') { //$this->responsabilites $as = array_search("0", $this->responsabilites["responsabilites"]); if ($as !== FALSE && $as !== NULL) { $auteur_0 = $this->responsabilites["auteurs"][$as]; $auteur = new auteur($auteur_0["id"]); if ($auteur->isbd_entry) { $this->header .= ' / ' . $auteur->isbd_entry; $this->header_texte .= ' / ' . $auteur->isbd_entry; } } else { $as = array_keys($this->responsabilites["responsabilites"], "1"); for ($i = 0; $i < count($as); $i++) { $indice = $as[$i]; $auteur_1 = $this->responsabilites["auteurs"][$indice]; $auteur = new auteur($auteur_1["id"]); $aut1_libelle[] = $auteur->isbd_entry; } $auteurs_liste = implode("; ", $aut1_libelle); if ($auteurs_liste) { $this->header .= ' / ' . $auteurs_liste; $this->header_texte .= ' / ' . $auteurs_liste; } } } if ($editeur_reduit) { $this->header .= ' / ' . $editeur_reduit; $this->header_texte .= ' / ' . $editeur_reduit; } if ($perso_voulu_aff) { $this->header .= ' / ' . $perso_voulu_aff; $this->header_texte .= ' / ' . $perso_voulu_aff; } switch ($type_reduit) { case "1": if ($this->notice->year != '') { $this->header .= ' (' . htmlentities($this->notice->year, ENT_QUOTES, $charset) . ')'; $this->header_texte .= ' (' . $this->notice->year . ')'; } break; case "2": if ($this->notice->year != '') { $this->header .= ' (' . htmlentities($this->notice->year, ENT_QUOTES, $charset) . ')'; $this->header_texte .= ' (' . $this->notice->year . ')'; } if ($this->notice->code != '') { $this->header .= ' / ' . htmlentities($this->notice->code, ENT_QUOTES, $charset); $this->header_texte .= ' / ' . $this->notice->code; } break; default: break; } if ($this->drag) { $drag = "<span onMouseOver='if(init_drag) init_drag();' id=\"NOTI_drag_" . $this->notice_id . ($this->anti_loop ? "_p" . $this->anti_loop[count($this->anti_loop) - 1] : "") . "\" dragicon=\"" . $base_path . "/images/icone_drag_notice.png\" dragtext=\"" . $this->header . "\" draggable=\"yes\" dragtype=\"notice\" callback_before=\"show_carts\" callback_after=\"\" style=\"padding-left:7px\"><img src=\"" . $base_path . "/images/notice_drag.png\"/></span>"; } if ($this->action) { $this->header = "<a href=\"" . $this->action . "\">" . $this->header . '</a>'; } if ($this->icon_is_new) { $this->header = $this->header . " " . $this->icon_is_new; } if ($this->notice->niveau_biblio == 'b') { $rqt = "select tit1, date_format(date_date, '" . $msg["format_date"] . "') as aff_date_date, bulletin_numero as num_bull from bulletins,notices where bulletins.num_notice='" . $this->notice_id . "' and notices.notice_id=bulletins.bulletin_notice"; $execute_query = pmb_mysql_query($rqt); $row = pmb_mysql_fetch_object($execute_query); $this->header .= " <i>" . (!$row->aff_date_date ? sprintf($msg["bul_titre_perio"], $row->tit1) : sprintf($msg["bul_titre_perio"], $row->tit1 . ", " . $row->num_bull . " [" . $row->aff_date_date . "]")) . "</i>"; $this->header_texte .= " " . (!$row->aff_date_date ? sprintf($msg["bul_titre_perio"], $row->tit1) : sprintf($msg["bul_titre_perio"], $row->tit1 . ", " . $row->num_bull . " [" . $row->aff_date_date . "]")); pmb_mysql_free_result($execute_query); } if ($this->drag) { $this->header .= $drag; } if ($this->notice->lien) { // ajout du lien pour les ressource notice_parent_useds électroniques if (!$this->print_mode || $this->print_mode == '2' || $use_dsi_diff_mode) { $this->header .= "<a href=\"" . $this->notice->lien . "\" target=\"__LINK__\">"; if (!$use_opac_url_base) { $this->header .= "<img src=\"" . $base_path . "/images/globe.gif\" border=\"0\" align=\"middle\" hspace=\"3\""; } else { $this->header .= "<img src=\"" . $opac_url_base . "images/globe.gif\" border=\"0\" align=\"middle\" hspace=\"3\""; } $this->header .= " alt=\""; $this->header .= $this->notice->eformat; $this->header .= "\" title=\""; $this->header .= $this->notice->eformat; $this->header .= "\">"; $this->header .= '</a>'; } elseif ($this->print_mode == '4') { $this->header .= '<br />'; $this->header .= "<a href=\"" . $this->notice->lien . "\" target=\"__LINK__\">"; $this->header .= '<font size="-1">' . $this->notice->lien . '</font>'; $this->header .= '</a>'; } else { $this->header .= "<br />"; $this->header .= '<font size="-1">' . $this->notice->lien . '</font>'; } } if (!$this->print_mode || $this->print_mode == '2' && !$no_aff_doc_num_image) { if ($this->notice->niveau_biblio == 'b') { $sql_explnum = "SELECT explnum_id, explnum_nom 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 FROM explnum WHERE explnum_notice = " . $this->notice_id; } $explnums = pmb_mysql_query($sql_explnum); $explnumscount = pmb_mysql_num_rows($explnums); if ($explnumscount == 1) { $explnumrow = pmb_mysql_fetch_object($explnums); if (!$use_opac_url_base) { $this->header .= "<a href=\"" . $base_path . "/doc_num.php?explnum_id=" . $explnumrow->explnum_id . "\" target=\"__LINK__\">"; } else { $this->header .= "<a href=\"" . $opac_url_base . "doc_num.php?explnum_id=" . $explnumrow->explnum_id . "\" target=\"__LINK__\">"; } if (!$use_opac_url_base) { $this->header .= "<img src=\"" . $base_path . "/images/globe_orange.png\" border=\"0\" align=\"middle\" hspace=\"3\""; } else { $this->header .= "<img src=\"" . $opac_url_base . "images/globe_orange.png\" border=\"0\" align=\"middle\" hspace=\"3\""; } $this->header .= " alt=\""; $this->header .= htmlentities($explnumrow->explnum_nom, ENT_QUOTES, $charset); $this->header .= "\" title=\""; $this->header .= htmlentities($explnumrow->explnum_nom, ENT_QUOTES, $charset); $this->header .= "\">"; $this->header .= '</a>'; } else { if ($explnumscount > 1) { if (!$use_opac_url_base) { $this->header .= "<img src=\"" . $base_path . "/images/globe_rouge.png\" border=\"0\" align=\"middle\" alt=\"" . $msg['info_docs_num_notice'] . "\" title=\"" . $msg['info_docs_num_notice'] . "\" hspace=\"3\">"; } else { $this->header .= "<img src=\"" . $opac_url_base . "images/globe_rouge.png\" border=\"0\" align=\"middle\" alt=\"" . $msg['info_docs_num_notice'] . "\" title=\"" . $msg['info_docs_num_notice'] . "\" hspace=\"3\">"; } } } } if ($this->icondoc) { $this->header = $this->icondoc . " " . $this->header; } if ($this->show_statut) { $this->header = $this->aff_statut . " " . $this->header; } }
/** * Classe permettant d'appeler l'affichage des notices * Retire de la liste envoyée en référence les notices déjà affichées * * @param string $notices_ids la liste des notices, séparées par , * @param integer $notice_nb le nombre de notices à afficher par passe * @param integer $notice_tpl l'identifiant du template d'affichage, si null, affiche le header de la classe d'affichage */ public static function call_notice_display(&$notices_ids, $notice_nb, $notice_tpl) { global $base_path, $charset, $msg; global $liens_opac; global $opac_notice_affichage_class; global $opac_url_base; global $opac_notices_format; $notices_ids = explode(",", $notices_ids); $notices = ''; for ($i_notice_nb = 0; $i_notice_nb < $notice_nb; $i_notice_nb++) { if ($notices_ids[$i_notice_nb]) { $notices .= '<li>'; $current = new $opac_notice_affichage_class($notices_ids[$i_notice_nb], $liens_opac, 1, 1); $current->genere_ajax_param($opac_notices_format, 0); //le panier if ($current->cart_allowed) { if (isset($_SESSION["cart"]) && in_array($current->notice_id, $_SESSION["cart"])) { $notices .= "<a href='#' class=\"img_basket_exist\" title=\"" . $msg['notice_title_basket_exist'] . "\"><img src=\"" . get_url_icon('basket_exist.gif', 1) . "\" align='absmiddle' border='0' alt=\"" . $msg['notice_title_basket_exist'] . "\" /></a>"; } else { $title = $current->notice_header; if (!$title) { $title = $current->notice->tit1; } $notices .= "<a href=\"cart_info.php?id=" . $current->notice_id . "&header=" . rawurlencode(strip_tags($title)) . "\" target=\"cart_info\" class=\"img_basket\" title=\"" . $msg['notice_title_basket'] . "\"><img src='" . get_url_icon("basket_small_20x20.png", 1) . "' align='absmiddle' border='0' alt=\"" . $msg['notice_title_basket'] . "\" /></a>"; } } else { $notices .= ""; } //le lien pour ouvrir la popup $notices .= "<a class=\"Cmpr_Wrap_linkItem\" " . $current->notice_affichage_enrichment . " onclick=\"open_notice_popup({$notices_ids[$i_notice_nb]},'" . rawurlencode($current->notice_affichage_cmd) . "',this.getAttribute('enrichment'))\">"; //l'affichage if ($notice_tpl) { $noti_tpl = new notice_tpl_gen($notice_tpl); $notices .= $noti_tpl->build_notice($notices_ids[$i_notice_nb]); } else { $current->do_header(); $notices .= $current->notice_header; } unset($notices_ids[$i_notice_nb]); $notices .= '</a>'; $notices .= '</li>'; } } if (sizeof($notices_ids)) { $notices_ids = implode(',', $notices_ids); } return $notices; }