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) . "&noticecode=!!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);
 }
 /**
  * Affichage sous forme de tableau des exemplaires
  */
 function construire_tableau()
 {
     global $_mimetypes_bymimetype_, $_mimetypes_byext_, $dbh, $charset, $opac_url_base;
     global $opac_visionneuse_allow;
     if (!$this->tableau_id) {
         $this->display = "";
     } else {
         create_tableau_mimetype();
         $url_docnum = "";
         switch ($this->type_elt) {
             case DOCNUM_DMDE:
                 $url_docnum = "/explnum_doc.php?explnumdoc_id=";
                 $requete = "SELECT id_explnum_doc as explnum_id, explnum_doc_nomfichier as explnum_nom,  explnum_doc_mimetype as explnum_mimetype,\n\t\t\t\t\t\t explnum_doc_url as explnum_url, explnum_doc_data as explnum_data, explnum_doc_extfichier as explnum_extfichier\n\t\t\t\t\t\t  FROM explnum_doc join explnum_doc_actions on id_explnum_doc=num_explnum_doc WHERE prive=0 and num_action in (" . implode(',', $this->tableau_id) . ")";
                 break;
             case DOCNUM_SUGG:
                 $url_docnum = "/explnum_doc.php?explnumdoc_id=";
                 $requete = "SELECT id_explnum_doc as explnum_id, explnum_doc_nomfichier as explnum_nom,  explnum_doc_mimetype as explnum_mimetype,\n\t\t\t\t\t\t explnum_doc_url as explnum_url, explnum_doc_data as explnum_data, explnum_doc_extfichier as explnum_extfichier\n\t\t\t\t\t\t  FROM explnum_doc join explnum_doc_sugg on id_explnum_doc=num_explnum_doc WHERE num_suggestion in (" . implode(',', $this->tableau_id) . ")";
                 break;
             case DOCNUM_NOTI:
             default:
                 // récupération des infos des explnum
                 $requete = "SELECT explnum_id, explnum_notice, explnum_bulletin, explnum_nom, explnum_mimetype,\n\t\t\t\t\t\t explnum_url, explnum_data, explnum_vignette, explnum_nomfichier, explnum_extfichier\n\t\t\t\t\t\t  FROM explnum WHERE explnum_id in (" . implode(',', $this->tableau_id) . ")";
                 $url_docnum = "/doc_num.php?explnum_id=";
                 break;
         }
         $res = pmb_mysql_query($requete, $dbh);
         $i = 1;
         $allowed_mimetype = array();
         if ($opac_visionneuse_allow) {
             global $opac_photo_filtre_mimetype;
             $allowed_mimetype = explode(",", str_replace("'", "", $opac_photo_filtre_mimetype));
         }
         while ($expl = pmb_mysql_fetch_object($res)) {
             if ($expl->explnum_notice) {
                 $notice_aff = new notice_affichage($expl->explnum_notice, '');
                 $notice_aff->do_header_without_html();
                 $titre = $notice_aff->notice_header_without_html;
             } elseif ($expl->explnum_bulletin) {
                 $titre = $this->get_header_bulletin($expl->explnum_bulletin);
             }
             if ($i == 1) {
                 $ligne = "<div class='row'><div class='colonne3' >!!1!!</div><div class='colonne3' width='33%'>!!2!!</div><div class='colonne3' >!!3!!</div></div>";
             }
             $alt = htmlentities($expl->explnum_nom . " - " . $expl->explnum_mimetype, ENT_QUOTES, $charset);
             if ($expl->explnum_vignette) {
                 $obj = "<img src='" . $opac_url_base . "/vig_num.php?explnum_id={$expl->explnum_id}' alt='{$alt}' title='{$alt}' border='0'>";
             } else {
                 // trouver l'icone correspondant au mime_type
                 $obj = "<img src='" . get_url_icon('mimetype/' . icone_mimetype($expl->explnum_mimetype, $expl->explnum_extfichier), 1) . "' alt='{$alt}' title='{$alt}' border='0'>";
             }
             $lien = "";
             if ($expl->explnum_notice) {
                 $lien = "index.php?lvl=notice_display&id=" . $expl->explnum_notice;
             } elseif ($expl->explnum_bulletin) {
                 $lien = "index.php?lvl=bulletin_display&id=" . $expl->explnum_bulletin;
             }
             $words_to_find = "";
             if ($expl->explnum_mimetype == 'application/pdf' || $expl->explnum_mimetype == 'URL' && strpos($expl->explnum_nom, '.pdf') !== false) {
                 $words_to_find = "#search=\"" . $this->termes_recherche . "\"";
             }
             $expl_liste_obj = "<div class='explnum-titre' style=\"margin-top:20px;margin-bottom:10px;text-align:center;font-weight:bold;\" ><a href='{$lien}'>{$titre}</a></div>";
             $expl_liste_obj .= "<div style=\"text-align:center; word-wrap: break-word\">";
             if ($allowed_mimetype && in_array($expl->explnum_mimetype, $allowed_mimetype)) {
                 $link = "\n\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\tif(typeof(sendToVisionneuse) == 'undefined'){\n\t\t\t\t\t\t\t\tvar sendToVisionneuse = function (explnum_id){\n\t\t\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\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</script>\n\t\t\t\t\t\t<a href='#' onclick=\"open_visionneuse(sendToVisionneuse," . $expl->explnum_id . ");return false;\" alt='{$alt}' title='{$alt}'>" . $obj . "</a><br />";
                 $expl_liste_obj .= $link;
             } else {
                 $expl_liste_obj .= "<a href='" . $opac_url_base . $url_docnum . $expl->explnum_id . $words_to_find . "' alt='{$alt}' title='{$alt}' target='_blank'>" . $obj . "</a><br />";
             }
             if ($_mimetypes_byext_[$expl->explnum_extfichier]["label"]) {
                 $explmime_nom = $_mimetypes_byext_[$expl->explnum_extfichier]["label"];
             } elseif ($_mimetypes_bymimetype_[$expl->explnum_mimetype]["label"]) {
                 $explmime_nom = $_mimetypes_bymimetype_[$expl->explnum_mimetype]["label"];
             } else {
                 $explmime_nom = $expl->explnum_mimetype;
             }
             $expl_liste_obj .= htmlentities($expl->explnum_nom, ENT_QUOTES, $charset) . "<div class='explnum_type'>" . htmlentities($explmime_nom, ENT_QUOTES, $charset) . "</div>";
             $expl_liste_obj .= "</div>";
             $ligne = str_replace("!!{$i}!!", $expl_liste_obj, $ligne);
             $i++;
             if ($i == 4) {
                 $ligne_finale .= $ligne;
                 $i = 1;
             }
         }
         if (!$ligne_finale) {
             $ligne_finale = $ligne;
         } elseif ($i != 1) {
             $ligne_finale .= $ligne;
         }
         $ligne_finale = str_replace('!!2!!', "&nbsp;", $ligne_finale);
         $ligne_finale = str_replace('!!3!!', "&nbsp;", $ligne_finale);
         $this->display = $ligne_finale;
     }
 }
예제 #3
0
function aff_bull_for_art_expl_num_vign_reduit($param)
{
    // Affiche pour une notice une icone cliquable pour ouvrir le document numérique
    // $param[0] = Est-ce que l'on tient compte des droits (0 ou vide -> Non, 1 -> Oui)
    // $param[1] = Texte de l'info-bulle dans le cas ou il y a plusieurs documents numériques // Si vide c'est celui par défaut qui est utilisé
    // $param[2] = Url de l'image dans le cas ou il y a plusieurs documents numériques // Si vide c'est celui par défaut qui est utilisé
    // $param[3] = Texte de l'info-bulle dans le cas ou il n'y a qu'un document numérique // Si vide c'est celui par défaut qui est utilisé
    // $param[4] = Url de l'image dans le cas ou il n'y a qu'un document numérique // Si vide c'est celui par défaut qui est utilisé
    global $parser_environnement, $dbh, $opac_visionneuse_allow, $opac_photo_filtre_mimetype, $msg, $opac_url_base;
    if (!$parser_environnement['id_notice']) {
        return "";
    }
    if (is_array($param) && count($param) && $param[0] == 1 && !explnum_test_rights($parser_environnement['id_notice'])) {
        return "";
    }
    //on va chercher le bulletin de l'article
    $requete = "SELECT analysis_bulletin FROM analysis WHERE analysis_notice='" . $parser_environnement['id_notice'] . "'";
    $result = pmb_mysql_query($requete, $dbh);
    if ($result && pmb_mysql_num_rows($result)) {
        $row = pmb_mysql_fetch_object($result);
        $bulletin_id = $row->analysis_bulletin;
    } else {
        return "";
    }
    $query = "SELECT explnum_id,explnum_mimetype,explnum_nom,explnum_nomfichier,explnum_url FROM explnum WHERE explnum_bulletin = '" . $bulletin_id . "'";
    $result = pmb_mysql_query($query);
    if ($result && pmb_mysql_num_rows($result)) {
        $tab_explnum = array();
        while ($explnum = pmb_mysql_fetch_object($result)) {
            if (explnum_test_rights_per_id($explnum->explnum_id)) {
                $tab_explnum[] = $explnum;
            }
        }
        if (count($tab_explnum) > 1) {
            $info_bulle = $msg["info_docs_num_notice"];
            if (is_array($param) && count($param) >= 2 && trim($param[1])) {
                $info_bulle = $param[1];
            }
            $img_multip_doc = get_url_icon("globe_rouge.png");
            if (is_array($param) && count($param) >= 3 && trim($param[2])) {
                $img_multip_doc = trim($param[2]);
            }
            return "<span class=\"expl_num_vign_reduit\" ><img src=\"" . $img_multip_doc . "\" alt=\"" . $info_bulle . "\" title=\"" . $info_bulle . "\" border=\"0\" align=\"middle\" hspace=\"3\"/></span>";
        } elseif (count($tab_explnum) == 1) {
            $explnumrow = $tab_explnum[0];
            $info_bulle = "";
            if (is_array($param) && count($param) >= 4 && trim($param[3])) {
                $info_bulle = $param[3];
            } else {
                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;
                    }
                }
            }
            $img_multip_doc = get_url_icon("globe_orange.png");
            if (is_array($param) && count($param) >= 5 && trim($param[4])) {
                $img_multip_doc = trim($param[4]);
            }
            $allowed_mimetype = array();
            if ($opac_visionneuse_allow) {
                $allowed_mimetype = explode(",", str_replace("'", "", $opac_photo_filtre_mimetype));
            }
            $ret = "<span class=\"expl_num_vign_reduit\" >";
            if ($opac_visionneuse_allow && in_array($explnumrow->explnum_mimetype, $allowed_mimetype)) {
                $ret .= "<script type='text/javascript'>\n\t\t\t\t\t\t\tif(typeof(sendToVisionneuse) == 'undefined'){\n\t\t\t\t\t\t\t\tvar sendToVisionneuse = function (explnum_id){\n\t\t\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\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</script>\n\t\t\t\t\t\t<a href='#' onclick=\"open_visionneuse(sendToVisionneuse," . $explnumrow->explnum_id . ");return false;\" alt=\"" . $info_bulle . "\" title=\"" . $info_bulle . "\">";
            } else {
                $ret .= "<a href=\"" . $opac_url_base . "doc_num.php?explnum_id=" . $explnumrow->explnum_id . "\" target=\"__LINK__\">";
            }
            $ret .= "<img src=\"" . $img_multip_doc . "\" border=\"0\" align=\"middle\" hspace=\"3\" alt=\"" . $info_bulle . "\" title=\"" . $info_bulle . "\"></a></span>";
            return $ret;
        }
    }
    return "";
}
예제 #4
0
파일: avis.php 프로젝트: hogsim/PMB
 $moyenne = number_format($loc->m, 1, ',', '');
 $c_notice = new notice_affichage($noticeid, "");
 $etoiles_moyenne = $c_notice->stars();
 //liste des témoignages
 $requete = "select note,sujet,commentaire,DATE_FORMAT(dateajout,'" . $msg['format_date'] . "') as ladate,empr_login,empr_nom, empr_prenom\n\t\t\t\tfrom avis\n\t\t\t\tleft join empr on id_empr=num_empr\n\t\t\t\twhere valide=1 and num_notice='" . $noticeid . "'\n\t\t\t\torder by dateajout desc";
 $r = pmb_mysql_query($requete, $dbh);
 if (pmb_mysql_num_rows($r)) {
     echo "<div class='row'>\n\t\t\t\t\t<div class='left'><b>" . $msg['avis_titre_tous'] . ":</b> " . $msg['avis_note'] . ": {$moyenne}</div>\n\t\t\t\t\t<div class='right'>{$etoiles_moyenne}</div>&nbsp;\n\t\t\t\t\t</div>";
     $cpt_star = 4;
     while ($loc = pmb_mysql_fetch_object($r)) {
         $etoiles = "";
         for ($i = 1; $i <= $loc->note; $i++) {
             $etoiles .= "<img border=0 src='" . get_url_icon('star.png') . "' align='absmiddle'>";
         }
         for ($j = round($loc->note); $j <= $cpt_star; $j++) {
             $etoiles .= "<img border=0 src='" . get_url_icon('star_unlight.png') . "' align='absmiddle'>";
         }
         echo "<hr /><div class='row'>\n\t\t\t\t\t<div class='left'><b>{$loc->sujet}</b>, " . $loc->ladate;
         if ($opac_avis_show_writer == 1 && $loc->empr_nom) {
             echo " " . $msg['avis_de'] . " {$loc->empr_prenom} {$loc->empr_nom} ";
         }
         if ($opac_avis_show_writer == 2 && $loc->empr_login) {
             echo " " . $msg['avis_de'] . " {$loc->empr_login} ";
         }
         echo "</div><div class='right'>{$etoiles}</div>";
         if ($charset != "utf-8") {
             $loc->commentaire = cp1252Toiso88591($loc->commentaire);
         }
         echo "\n\t\t\t\t\t<div class='row'>" . do_bbcode($loc->commentaire) . "</div>\n\t\t\t\t\t</div>";
     }
 } else {
예제 #5
0
// RSS
$std_header = str_replace("!!liens_rss!!", genere_link_rss(), $std_header);
// l'image $logo_rss_si_rss est calculée par genere_link_rss() en global
$liens_bas = str_replace("<!-- rss -->", $logo_rss_si_rss, $liens_bas);
if ($opac_parse_html || $cms_active) {
    ob_start();
}
print $std_header;
if ($time_expired) {
    echo "<script>alert(\"" . sprintf($msg["session_expired"], round($opac_duration_session_auth / 60)) . "\");</script>";
}
if ($opac_autolevel2) {
    $es = new search();
}
require_once $base_path . '/includes/navigator.inc.php';
$link_to_print_search_result = "<span class=\"printSearchResult\">\n<a href='#' onClick=\"openPopUp('" . $base_path . "/print.php?lvl=search&current_search=" . ($_SESSION['last_query'] + 0) . "','print',500,600,-2,-2,'scrollbars=yes,menubar=0'); w.focus(); return false;\">\n\t<img src='" . get_url_icon('print.gif') . "' border='0' align='bottom' alt=\"" . $msg["histo_print"] . "\" title=\"" . $msg["histo_print"] . "\"/>\n</a>\n</span>";
if ($opac_cart_allow && !$opac_cart_only_for_subscriber || $opac_cart_allow && $_SESSION["user_code"]) {
    $add_cart_link = "<span class=\"addCart\"><a href='cart_info.php?lvl={$lvl}&id={$id}' target='cart_info' title='" . $msg["cart_add_result_in"] . "'>" . $msg["cart_add_result_in"] . "</a></span>";
    $add_cart_link_spe = "<span class=\"addCart\"><a href='cart_info.php?lvl={$lvl}&id={$id}!!spe!!' target='cart_info' title='" . $msg["cart_add_result_in"] . "'>" . $msg["cart_add_result_in"] . "</a></span>";
}
$link_to_visionneuse = "\n<script type='text/javascript' >var oldAction;</script>\n<span class=\"open_visionneuse\"><a href='#' onclick=\"open_visionneuse(sendToVisionneuse);return false;\">" . $msg["result_to_phototeque"] . "</a></span>";
//cas général
$sendToVisionneuseByPost = "\n<script type='text/javascript'>\n\tfunction sendToVisionneuse(explnum_id){\n\t\tif (typeof(explnum_id)!= 'undefined') {\n\t\t\tif(!document.form_values.explnum_id){\n\t\t\t\tvar explnum =document.createElement('input');\n\t\t\t\texplnum.setAttribute('type','hidden');\n\t\t\t\texplnum.setAttribute('name','explnum_id');\n\t\t\t\tdocument.form_values.appendChild(explnum);\n\t\t\t}\n\t\t\tdocument.form_values.explnum_id.value = explnum_id;\n\t\t}\n\t\toldAction=document.form_values.action;\n\t\tdocument.form_values.action='visionneuse.php';\n\t\tdocument.form_values.target='visionneuse';\n\t\tdocument.form_values.submit();\t\n\t}\n</script>";
//cas des autorités
$sendToVisionneuseByGet = "\n<script type='text/javascript'>\n\tfunction sendToVisionneuse(explnum_id){\n\t\tdocument.getElementById('visionneuseIframe').src = \"visionneuse.php?mode=!!mode!!&idautorite=!!idautorite!!\"+(typeof(explnum_id) != 'undefined' ? '&explnum_id='+explnum_id : \"\");\n\t}\n</script>";
//cas de notice display
$sendToVisionneuseNoticeDisplay = "\n<script type='text/javascript'>\n\tfunction sendToVisionneuse(explnum_id){\n\t\tdocument.getElementById('visionneuseIframe').src = 'visionneuse.php?'+(typeof(explnum_id) != 'undefined' ? 'explnum_id='+explnum_id+\"\" : '\\'');\n\t}\n</script>";
switch ($lvl) {
    case 'author_see':
        $author_type_aff = 0;
        if ($opac_congres_affichage_mode && $id) {
function bulletin_affichage($id, $type = "")
{
    global $dbh, $msg;
    global $opac_show_exemplaires;
    $display = "";
    $requete = "SELECT bulletin_id, bulletin_numero, bulletin_notice, mention_date, date_date, bulletin_titre, bulletin_cb, date_format(date_date, '" . $msg["format_date_sql"] . "') as aff_date_date,num_notice FROM bulletins WHERE bulletin_id='{$id}'";
    $res = @pmb_mysql_query($requete, $dbh);
    while ($obj = pmb_mysql_fetch_array($res)) {
        $requete3 = "SELECT notice_id FROM notices WHERE notice_id='" . $obj["bulletin_notice"] . "' ";
        $res3 = @pmb_mysql_query($requete3, $dbh);
        while ($obj3 = pmb_mysql_fetch_object($res3)) {
            $notice3 = new notice($obj3->notice_id);
        }
        $notice3->fetch_visibilite();
        //on vient poser l'ancre des docnums...
        $req = "select explnum_id from explnum where explnum_bulletin = " . $obj["bulletin_id"];
        $resultat = pmb_mysql_query($req, $dbh) or die($req . " " . pmb_mysql_error());
        $nb_ex = pmb_mysql_num_rows($resultat);
        $res_print = "<h3><img src=./images/icon_per.gif> " . $notice3->print_resume(1, $css) . "." . " <b>" . $obj["bulletin_numero"] . "</b>" . ($nb_ex ? "&nbsp;<a href='#docnum'>" . ($nb_ex > 1 ? "<img src='" . get_url_icon("globe_rouge.png") . "' />" : "<img src='" . get_url_icon("globe_orange.png") . "' />") . "</a>" : "") . "</h3>\n";
        $num_notice = $obj['num_notice'];
        if ($obj['bulletin_titre']) {
            $res_print .= htmlentities($obj['bulletin_titre'], ENT_QUOTES, $charset) . "<br />";
        }
        if ($obj['mention_date']) {
            $res_print .= $msg['bull_mention_date'] . " &nbsp;" . $obj['mention_date'] . "\n";
        }
        if ($obj['date_date']) {
            $res_print .= "<br />" . $msg['bull_date_date'] . " &nbsp;" . $obj['aff_date_date'] . " \n";
        }
        if ($type != "visionneuse" && $nb_ex) {
            $res_print .= "<br /><a href='#docnum'>" . ($nb_ex > 1 ? "<img src='" . get_url_icon("globe_rouge.png") . "' />" : "<img src='" . get_url_icon("globe_orange.png") . "' />") . "</a>";
        }
        if ($obj['bulletin_cb']) {
            $res_print .= "<br />" . $msg["code_start"] . " " . htmlentities($obj['bulletin_cb'], ENT_QUOTES, $charset) . "\n";
            $code_cb_bulletin = $obj['bulletin_cb'];
        }
    }
    do_image($res_print, $code_cb_bulletin, 0);
    if ($num_notice) {
        // Il y a une notice de bulletin
        $display .= $res_print;
        $opac_notices_depliable = 0;
        $seule = 1;
        //$display .= pmb_bidi(aff_notice($num_notice,0,0)) ;
        if ($type == "visionneuse") {
            $display .= pmb_bidi(aff_notice($num_notice, 1, 1, 0, "", 0, 1));
        } else {
            $display .= pmb_bidi(aff_notice($num_notice, 0, 1, 0, "", 0));
        }
    } else {
        // construction des dépouillements
        $depouill = "<br /><h3>" . $msg['bull_dep'] . "</h3>";
        $requete = "SELECT * FROM analysis, notices, notice_statut WHERE analysis_bulletin='{$id}' AND notice_id = analysis_notice AND statut = id_notice_statut and ((notice_visible_opac=1 and notice_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (notice_visible_opac_abon=1 and notice_visible_opac=1)" : "") . ") ";
        $res = @pmb_mysql_query($requete, $dbh);
        if (pmb_mysql_num_rows($res)) {
            if ($opac_notices_depliable) {
                $depouill .= $begin_result_liste;
            }
            if ($opac_cart_allow) {
                $depouill .= "<a href=\"cart_info.php?id=" . $id . "&lvl=analysis&header=" . rawurlencode(strip_tags($notice_header)) . "\" target=\"cart_info\" class=\"img_basket\" title='" . $msg["cart_add_result_in"] . "'>" . $msg["cart_add_result_in"] . "</a>";
            }
            $depouill .= "<blockquote>";
            while ($obj = pmb_mysql_fetch_array($res)) {
                $depouill .= pmb_bidi(aff_notice($obj["analysis_notice"]));
            }
            $depouill .= "</blockquote>";
        } else {
            $depouill = $msg["no_analysis"];
        }
        $display .= $res_print;
        $display .= $depouill;
        if ($notice3->visu_expl && (!$notice3->visu_expl_abon || $notice3->visu_expl_abon && $_SESSION["user_code"])) {
            if (!$opac_resa_planning) {
                $resa_check = check_statut(0, $id);
                if ($resa_check) {
                    $requete_resa = "SELECT count(1) FROM resa WHERE resa_idbulletin='{$id}'";
                    $nb_resa_encours = pmb_mysql_result(pmb_mysql_query($requete_resa, $dbh), 0, 0);
                    if ($nb_resa_encours) {
                        $message_nbresa = str_replace("!!nbresa!!", $nb_resa_encours, $msg["resa_nb_deja_resa"]);
                    }
                    if ($_SESSION["user_code"] && $allow_book && $opac_resa && !$popup_resa) {
                        $ret_resa .= "<h3>" . $msg["bulletin_display_resa"] . "</h3>";
                        if ($opac_max_resa == 0 || $opac_max_resa > $nb_resa_encours) {
                            if ($opac_resa_popup) {
                                $ret_resa .= "<a href='#' onClick=\"if(confirm('" . $msg["confirm_resa"] . "')){w=window.open('./do_resa.php?lvl=resa&id_bulletin=" . $id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;}else return false;\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                            } else {
                                $ret_resa .= "<a href='./do_resa.php?lvl=resa&id_bulletin=" . $id . "&oresa=popup' onClick=\"return confirm('" . $msg["confirm_resa"] . "')\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                            }
                            $ret_resa .= $message_nbresa;
                        } else {
                            $ret_resa .= str_replace("!!nb_max_resa!!", $opac_max_resa, $msg["resa_nb_max_resa"]);
                        }
                        $ret_resa .= "<br />";
                    } elseif (!$_SESSION["user_code"] && $opac_resa && !$popup_resa) {
                        // utilisateur pas connecté
                        // préparation lien réservation sans être connecté
                        $ret_resa .= "<h3>" . $msg["bulletin_display_resa"] . "</h3>";
                        if ($opac_resa_popup) {
                            $ret_resa .= "<a href='#' onClick=\"if(confirm('" . $msg["confirm_resa"] . "')){w=window.open('./do_resa.php?lvl=resa&id_bulletin=" . $id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;}else return false;\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                        } else {
                            $ret_resa .= "<a href='./do_resa.php?lvl=resa&id_bulletin=" . $id . "&oresa=popup' onClick=\"return confirm('" . $msg["confirm_resa"] . "')\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                        }
                        $ret_resa .= $message_nbresa;
                        $ret_resa .= "<br />";
                    } elseif ($fonction == 'notice_affichage_custom_bretagne') {
                        if ($opac_resa_popup) {
                            $reserver = "<a href='#' onClick=\"if(confirm('" . $msg["confirm_resa"] . "')){w=window.open('./do_resa.php?lvl=resa&id_notice=" . $this->notice_id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;}else return false;\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                        } else {
                            $reserver = "<a href='./do_resa.php?lvl=resa&id_notice=" . $this->notice_id . "&oresa=popup' onClick=\"return confirm('" . $msg["confirm_resa"] . "')\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                        }
                        $reservernbre = $message_nbresa;
                    } else {
                        $ret_resa = "";
                    }
                    $display .= pmb_bidi($ret_resa);
                }
            }
            if ($opac_show_exemplaires) {
                if ($fonction == 'notice_affichage_custom_bretagne') {
                    $display .= pmb_bidi(notice_affichage_custom_bretagne::expl_list("m", 0, $id));
                } else {
                    $display .= pmb_bidi(notice_affichage::expl_list("m", 0, $id));
                }
            }
        }
        if ($type != "visionneuse" && $notice3->visu_explnum && (!$notice3->visu_explnum_abon || $notice3->visu_explnum_abon && $_SESSION["user_code"])) {
            if ($explnum = show_explnum_per_notice(0, $id, '')) {
                $display .= pmb_bidi("<a name='docnum'><h3>" . $msg["explnum"] . "</h3></a>" . $explnum);
            }
        }
    }
    pmb_mysql_free_result($res);
    $display .= notice_affichage::autres_lectures(0, $id);
    return $display;
}
예제 #7
0
 /**
  * Retourne l'URL calculée de l'image
  * @return string
  */
 public function get_picture_url()
 {
     if (!$this->picture_url && ($this->get_code() || $this->get_thumbnail_url())) {
         global $opac_show_book_pics, $opac_book_pics_url;
         global $opac_url_base;
         if ($opac_show_book_pics == '1' && ($opac_book_pics_url || $this->get_thumbnail_url())) {
             if ($this->get_thumbnail_url()) {
                 $this->picture_url = $this->get_thumbnail_url();
             } else {
                 $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $this->get_code());
                 $url_image = $opac_book_pics_url;
                 $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($url_image) . "&noticecode=!!noticecode!!&vigurl=" . urlencode($this->get_thumbnail_url());
                 $this->picture_url = str_replace("!!noticecode!!", $code_chiffre, $url_image);
             }
         }
     }
     if (!$this->picture_url) {
         $this->picture_url = get_url_icon("no_image.jpg");
     }
     return $this->picture_url;
 }
 function genere_simple($depliable = 1, $what = 'ISBD')
 {
     global $msg, $charset;
     global $dbh;
     global $cart_aff_case_traitement;
     global $opac_url_base;
     global $opac_avis_allow;
     global $opac_allow_add_tag;
     global $opac_visionneuse_allow;
     global $allow_tag;
     // l'utilisateur a-t-il le droit d'ajouter un tag
     $this->notice_childs = $this->genere_notice_childs();
     // preparation de la case a cocher pour traitement panier
     if ($cart_aff_case_traitement) {
         $case_a_cocher = "<input type='checkbox' value='!!id!!' name='notice[]'/>&nbsp;";
     } else {
         $case_a_cocher = "";
     }
     if ($this->cart_allowed) {
         if (isset($_SESSION["cart"]) && in_array($this->notice_id, $_SESSION["cart"])) {
             $basket = "<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 {
             $basket = "<a href=\"cart_info.php?id=" . $this->notice_id . "&header=" . rawurlencode($this->notice_header) . "\" target=\"cart_info\" 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>";
         }
     }
     //Avis
     if ($opac_avis_allow && $opac_avis_allow != 2 || $_SESSION["user_code"] && $opac_avis_allow == 2) {
         $basket .= "&nbsp;&nbsp;<a href='#' onclick=\"open('avis.php?todo=liste&noticeid={$this->notice_id}','avis','width=520,height=290,scrollbars=yes,resizable=yes'); return false;\"><img src='" . get_url_icon('avis.png', 1) . "' align='absmiddle' border='0' title=\"" . $msg[notice_title_avis] . "\" alt=\"" . $msg[notice_title_avis] . "\"></a>";
     }
     //add tags
     if ($opac_allow_add_tag == 1 || $opac_allow_add_tag == 2 && $_SESSION["user_code"] && $allow_tag) {
         $basket .= "&nbsp;&nbsp;<a href='#' onclick=\"open('addtags.php?noticeid={$this->notice_id}','ajouter_un_tag','width=350,height=150,scrollbars=yes,resizable=yes'); return false;\"><img src='" . get_url_icon('tag.png', 1) . "'align='absmiddle' border='0' title=\"" . $msg[notice_title_tag] . "\" alt=\"" . $msg[notice_title_tag] . "\"></a>";
     }
     if ($basket) {
         $basket = "<div>" . $basket . "</div>";
     }
     if ($this->notice->niveau_biblio == "s") {
         $icon = "icon_per_16x16.gif";
     } elseif ($this->notice->niveau_biblio == "a") {
         $icon = "icon_art_16x16.gif";
     } else {
         $icon = "icon_" . $this->notice->typdoc . "_16x16.gif";
     }
     $icon_is_new = "";
     if (!$this->no_header && $this->notice->notice_is_new) {
         $icon_is_new = "icone_nouveautes.png";
     }
     if (!$depliable && $this->notice->typdoc == "k") {
         $template = "\n\t\t\t<div id=\"el!!id!!Global\" class=\"notice-global-photo\">\n\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n\n\t\t{$case_a_cocher}";
         if ($icon) {
             $template .= "\n\t\t\t\t<img src=\"" . get_url_icon($icon, 1) . "\" />";
         }
         $template .= "\n    \t\t<span class=\"notice-heada\">!!heada!!</span>";
         if ($icon_is_new) {
             $info_bulle_icon_new = $msg["notice_is_new_gestion"];
             $template .= "&nbsp;<img src=\"" . get_url_icon($icon_is_new, 1) . "\" alt='" . htmlentities($info_bulle_icon_new, ENT_QUOTES, $charset) . "' title='" . htmlentities($info_bulle_icon_new, ENT_QUOTES, $charset) . "'/>";
         }
         $template .= "\n\t\t    <center>!!DOCNUM1!!</center>\n\n    \t\t</div>\t\t\t\n\t\t\t<div id=\"el!!id!!Child\" class=\"notice-child-photo\" style=\"margin-bottom:6px;\">" . $basket . "!!ISBD!!\n\n\t\t\t</div>\n\n\t\t\t</div>\n";
     } else {
         $template = "\n\t\t\t<div id=\"el!!id!!Global\" class=\"notice-global-nophoto\">\n\n\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n\n    \t{$case_a_cocher}";
         if ($icon) {
             $template .= "\n\t\t\t\t<img src=\"" . get_url_icon($icon, 1) . "\" />";
         }
         $template .= "\n    \t\t<span class=\"heada\">!!heada!!</span>";
         if ($icon_is_new) {
             $info_bulle_icon_new = $msg["notice_is_new_gestion"];
             $template .= "&nbsp;<img src=\"" . get_url_icon($icon_is_new, 1) . "\" alt='" . htmlentities($info_bulle_icon_new, ENT_QUOTES, $charset) . "' title='" . htmlentities($info_bulle_icon_new, ENT_QUOTES, $charset) . "'/>";
         }
         $template .= "\n    \t\t<br />\n\t    \t</div>\t\t\t\n\t\t\t\n<div id='el!!id!!Child' class='child' >" . $basket . "\n\t\t\t!!ISBD!!\n\t\t\t!!SUITE!!\n\t\t\t</div>\r\n</div>\n";
     }
     $no_notice = $this->notice_id;
     if ($this->notice->typdoc == "k") {
         // Affichage du premier exemplaire numerique
         if ($no_notice) {
             // Traitement exemplaire numerique
             $requete = "SELECT explnum_id, explnum_notice, explnum_bulletin, explnum_nom, explnum_mimetype, explnum_url, explnum_data, explnum_vignette, explnum_nomfichier, explnum_extfichier FROM explnum WHERE ";
             $requete .= "explnum_notice='{$no_notice}' ";
             $requete .= " order by explnum_id LIMIT 1";
             $res = pmb_mysql_query($requete, $dbh) or die($requete . " " . pmb_mysql_error());
             $nb_ex = pmb_mysql_num_rows($res);
         }
         if ($nb_ex) {
             // on recupere les donnees des exemplaires
             $i = 1;
             while ($expl = pmb_mysql_fetch_object($res)) {
                 $ligne = "!!1!!";
                 if ($link_expl) {
                     $tlink = str_replace("!!explnum_id!!", $expl->explnum_id, $link_expl);
                     $tlink = str_replace("!!notice_id!!", $expl->explnum_notice, $tlink);
                     $tlink = str_replace("!!bulletin_id!!", $expl->explnum_bulletin, $tlink);
                 }
                 $alt = htmlentities($expl->explnum_nom . " - " . $expl->explnum_mimetype, ENT_QUOTES, $charset);
                 global $prefix_url_image;
                 if ($prefix_url_image) {
                     $tmpprefix_url_image = $prefix_url_image;
                 } else {
                     $tmpprefix_url_image = "./";
                 }
                 if ($expl->explnum_vignette) {
                     $obj = "<img src='" . $tmpprefix_url_image . "vig_num.php?explnum_id={$expl->explnum_id}' alt='{$alt}' title='{$alt}' border='0'>";
                 } else {
                     // trouver l'icone correspondant au mime_type
                     $obj = "<img src='" . $tmpprefix_url_image . "images/mimetype/" . icone_mimetype($expl->explnum_mimetype, $expl->explnum_extfichier) . "' alt='{$alt}' title='{$alt}' border='0'>";
                 }
                 $expl_liste_obj = "";
                 if ($opac_visionneuse_allow) {
                     $link = "<script type='text/javascript'>\n\t\t\t\t\t\tif(typeof(sendToVisionneuse) == 'undefined'){\n\t\t\t\t\t\t\tvar sendToVisionneuse = function (explnum_id){\n\t\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\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t</script>";
                     $link .= "<a href='#' onclick=\"open_visionneuse(sendToVisionneuse," . $expl->explnum_id . ");return false;\" alt='{$alt}' title='{$alt}'>" . $obj . "</a><br />";
                     $expl_liste_obj .= $link;
                 } else {
                     $suite_url_explnum = "doc_num.php?explnum_id={$expl->explnum_id}{$words_to_find}";
                     $expl_liste_obj .= "<a href='index.php?lvl=notice_display&id=" . $this->notice_id . "&mode_phototeque=1' alt='{$alt}' title='{$alt}'>" . $obj . "</a><br />";
                 }
                 if ($_mimetypes_byext_[$expl->explnum_extfichier]["label"]) {
                     $explmime_nom = $_mimetypes_byext_[$expl->explnum_extfichier]["label"];
                 } elseif ($_mimetypes_bymimetype_[$expl->explnum_mimetype]["label"]) {
                     $explmime_nom = $_mimetypes_bymimetype_[$expl->explnum_mimetype]["label"];
                 } else {
                     $explmime_nom = $expl->explnum_mimetype;
                 }
                 /* Pas besoin de l'affichage des titres ni format
                 			 if ($tlink) {
                 				$expl_liste_obj .= "<a href='$tlink'>";
                 				$expl_liste_obj .= htmlentities($expl->explnum_nom,ENT_QUOTES, $charset)."</a><div class='explnum_type'>".htmlentities($explmime_nom,ENT_QUOTES, $charset)."</div>";
                 				} else {
                 					$expl_liste_obj .= htmlentities($expl->explnum_nom,ENT_QUOTES, $charset)."<div class='explnum_type'>".htmlentities($explmime_nom,ENT_QUOTES, $charset)."</div>";
                 					}
                 			*/
                 $expl_liste_obj .= "";
                 $ligne = str_replace("!!{$i}!!", $expl_liste_obj, $ligne);
             }
             $ligne_finale = $ligne;
         }
         $entry .= "{$ligne_finale}";
     }
     // Si un document numerique, renvoi du doc num $entry dans le template, sinon vide
     if ($nb_ex) {
         $template = str_replace('!!DOCNUM1!!', $entry, $template);
     } else {
         $template = str_replace('!!DOCNUM1!!', "", $template);
     }
     // Serials : difference avec les monographies on affiche [periodique] et [article] devant l'ISBD
     if ($this->notice->niveau_biblio == 's') {
         $template = str_replace('!!ISBD!!', "<span class='fond-mere'>[" . $msg['isbd_type_perio'] . "]</span>&nbsp;<a href='index.php?lvl=notice_display&id=" . $this->notice_id . "'><i>" . $msg["see_bull"] . "</i></a>&nbsp;!!ISBD!!", $template);
     } elseif ($this->notice->niveau_biblio == 'a') {
         $template = str_replace('!!ISBD!!', "<span class='fond-article'>[" . $msg['isbd_type_art'] . "]</span>&nbsp;!!ISBD!!", $template);
     }
     $this->result = str_replace('!!id!!', $this->notice_id, $template);
     $this->result = str_replace('!!heada!!', $this->notice_header, $this->result);
     if ($what == 'ISBD') {
         $this->do_image($this->notice_isbd, $depliable);
         $this->result = str_replace('!!ISBD!!', $this->notice_isbd, $this->result);
     } else {
         $this->do_image($this->notice_public, $depliable);
         $this->result = str_replace('!!ISBD!!', $this->notice_public, $this->result);
     }
     if ($this->affichage_resa_expl || $this->notice_childs) {
         $this->result = str_replace('!!SUITE!!', $this->notice_childs . $this->affichage_resa_expl, $this->result);
     } else {
         $this->result = str_replace('!!SUITE!!', '', $this->result);
     }
 }
예제 #9
0
파일: sort.inc.php 프로젝트: hogsim/PMB
                    $tmpStr = str_replace("!!page_en_cours!!", urlencode($page_en_cours), $tmpStr);
                    $tmpStr = str_replace("!!page_en_cours1!!", $page_en_cours, $tmpStr);
                    $tmpStr = str_replace("!!action_suppr_tris!!", "get_sort_content(1, sortSupprIds('cases_a_cocher','cases_suppr'));", $tmpStr);
                    $display .= $tmpStr;
                    $tmpStr = $sort->show_sel_form();
                    $tmpStr = str_replace("!!page_en_cours!!", urlencode($page_en_cours), $tmpStr);
                    $tmpStr = str_replace("!!page_en_cours1!!", $page_en_cours, $tmpStr);
                    $display .= $tmpStr;
                } else {
                    $temp_tri = $_SESSION["nb_sortnotices"] - 1;
                    $display .= "<script> document.location='./index.php?" . $page_en_cours . "&get_last_query=" . $_SESSION["last_query"] . "&sort=" . $temp_tri . "';</script>";
                }
            } else {
                $display .= "<script> document.location='./index.php?" . $page_en_cours . "&get_last_query=" . $_SESSION["last_query"] . "';</script>";
            }
        } else {
            $tmpStr = $sort->show_tris_form();
            $tmpStr = str_replace("<!--bouton close-->", "<a href='#' onClick='parent.kill_sort_frame();return false;'><img src='" . get_url_icon('close.gif') . "' border='0' align='right'></a></div>", $tmpStr);
            $tmpStr = str_replace("!!page_en_cours!!", urlencode($page_en_cours), $tmpStr);
            $tmpStr = str_replace("!!page_en_cours1!!", $page_en_cours, $tmpStr);
            $tmpStr = str_replace("!!action_suppr_tris!!", "get_sort_content(1, sortSupprIds('cases_a_cocher','cases_suppr'));", $tmpStr);
            $display .= $tmpStr;
            $tmpStr = $sort->show_sel_form();
            $tmpStr = str_replace("!!page_en_cours!!", urlencode($page_en_cours), $tmpStr);
            $tmpStr = str_replace("!!page_en_cours1!!", $page_en_cours, $tmpStr);
            $display .= $tmpStr;
        }
        break;
}
ajax_http_send_response($display);
return;
예제 #10
0
파일: explnum.inc.php 프로젝트: hogsim/PMB
/**
 * Fonction retournant les infos d'exemplaires numériques pour une notice ou un bulletin donné
 * @param int $explnum_id Identifiant du document numérique
 * @return string
 */
function show_explnum_per_id($explnum_id, $link_explnum = "")
{
    global $dbh;
    global $charset;
    global $opac_url_base;
    global $opac_visionneuse_allow;
    global $opac_photo_filtre_mimetype;
    global $opac_explnum_order;
    global $opac_show_links_invisible_docnums;
    global $gestion_acces_active, $gestion_acces_empr_notice, $gestion_acces_empr_docnum;
    global $search_terms;
    if (!$explnum_id) {
        return "";
    }
    global $_mimetypes_bymimetype_, $_mimetypes_byext_;
    create_tableau_mimetype();
    // récupération des infos du document
    $query = "select explnum_id, explnum_notice, explnum_bulletin, explnum_nom, explnum_mimetype, explnum_url, explnum_vignette, explnum_nomfichier, explnum_extfichier , explnum_docnum_statut FROM explnum WHERE explnum_id = " . $explnum_id;
    $result = pmb_mysql_query($query, $dbh);
    if ($result && pmb_mysql_num_rows($result)) {
        if ($explnum = pmb_mysql_fetch_object($result)) {
            $docnum_visible = true;
            $id_for_right = $explnum->explnum_notice;
            if ($gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) {
                $ac = new acces();
                $dom_2 = $ac->setDomain(2);
                $docnum_visible = $dom_2->getRights($_SESSION['id_empr_session'], $id_for_right, 16);
            } else {
                $requete = "SELECT explnum_visible_opac, explnum_visible_opac_abon FROM notices, notice_statut WHERE notice_id ='" . $id_for_right . "' and id_notice_statut=statut ";
                $myQuery = pmb_mysql_query($requete, $dbh);
                if (pmb_mysql_num_rows($myQuery)) {
                    $statut_temp = pmb_mysql_fetch_object($myQuery);
                    if (!$statut_temp->explnum_visible_opac) {
                        $docnum_visible = false;
                    }
                    if ($statut_temp->explnum_visible_opac_abon && !$_SESSION['id_empr_session']) {
                        $docnum_visible = false;
                    }
                } else {
                    $docnum_visible = false;
                }
            }
            if ($docnum_visible) {
                if ($gestion_acces_active == 1 && $gestion_acces_empr_docnum == 1) {
                    $ac = new acces();
                    $dom_3 = $ac->setDomain(3);
                    $docnum_visible = $dom_3->getRights($_SESSION['id_empr_session'], $explnum->explnum_id, 16);
                } else {
                    $requete = "SELECT explnum_visible_opac, explnum_visible_opac_abon FROM explnum, explnum_statut WHERE explnum_id ='" . $explnum->explnum_id . "' and id_explnum_statut=explnum_docnum_statut ";
                    $myQuery = pmb_mysql_query($requete, $dbh);
                    if (pmb_mysql_num_rows($myQuery)) {
                        $statut_temp = pmb_mysql_fetch_object($myQuery);
                        if (!$statut_temp->explnum_visible_opac) {
                            $docnum_visible = false;
                        }
                        if ($statut_temp->explnum_visible_opac_abon && !$_SESSION['id_empr_session']) {
                            $docnum_visible = false;
                        }
                    } else {
                        $docnum_visible = false;
                    }
                }
            }
            if ($link_explnum) {
                $tlink = str_replace("!!explnum_id!!", $explnum->explnum_id, $link_explnum);
                $tlink = str_replace("!!notice_id!!", $explnum->explnum_notice, $tlink);
                $tlink = str_replace("!!bulletin_id!!", $explnum->explnum_bulletin, $tlink);
            }
            $alt = htmlentities($explnum->explnum_nom . " - " . $explnum->explnum_mimetype, ENT_QUOTES, $charset);
            // couleur de l'img en fonction du statut
            if ($expl->explnum_docnum_statut) {
                $rqt_st = "SELECT * FROM explnum_statut WHERE  id_explnum_statut='" . $expl->explnum_docnum_statut . "' ";
                $Query_statut = pmb_mysql_query($rqt_st, $dbh) or die($rqt_st . " " . pmb_mysql_error());
                $r_statut = pmb_mysql_fetch_object($Query_statut);
                $class_img = " class='docnum_" . $r_statut->class_html . "' ";
                if ($expl->explnum_docnum_statut > 1) {
                    $txt = $r_statut->opac_libelle;
                } else {
                    $txt = "";
                }
                $statut_libelle_div = "\r\n\t\t\t\t\t<div id='zoom_statut_docnum" . $expl->explnum_id . "' style='border: 2px solid rgb(85, 85, 85); background-color: rgb(255, 255, 255); position: absolute; z-index: 2000; display: none;'>\r\n\t\t\t\t\t\t<b>{$txt}</b>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t";
            } else {
                $class_img = " class='docnum_statutnot1' ";
                $txt = "";
            }
            if ($explnum->explnum_vignette) {
                $obj = "<img src='" . $opac_url_base . "vig_num.php?explnum_id={$explnum->explnum_id}' alt='{$alt}' title='{$alt}' border='0'>";
            } else {
                // trouver l'icone correspondant au mime_type
                $obj = "<img src='" . get_url_icon('mimetype/' . icone_mimetype($explnum->explnum_mimetype, $explnum->explnum_extfichier), 1) . "' alt='{$alt}' title='{$alt}' border='0'>";
            }
            $explnum_liste_obj = "<center>";
            $obj .= "{$statut_libelle_div}\r\n\t\t\t\t<a  href='#' onmouseout=\"z=document.getElementById('zoom_statut_docnum" . $expl->explnum_id . "'); z.style.display='none'; \" onmouseover=\"z=document.getElementById('zoom_statut_docnum" . $expl->explnum_id . "'); z.style.display=''; \">\r\n\t\t\t\t\t<div class='vignette_doc_num' ><img {$class_img} width='10' height='10' src='./images/spacer.gif'></div>\r\n\t\t\t\t</a>\r\n\t\t\t";
            $words_to_find = "";
            if ($explnum->explnum_mimetype == 'application/pdf' || $explnum->explnum_mimetype == 'URL' && strpos($explnum->explnum_nom, '.pdf') !== false) {
                if (is_array($search_terms)) {
                    $words_to_find = "#search=\"" . trim(str_replace('*', '', implode(' ', $search_terms))) . "\"";
                }
            }
            //si l'affichage du lien vers les documents numériques est forcé et qu'on est pas connecté, on propose l'invite de connexion!
            if (!$docnum_visible && !$_SESSION['user_code'] && $opac_show_links_invisible_docnums) {
                if ($opac_visionneuse_allow) {
                    $allowed_mimetype = explode(",", str_replace("'", "", $opac_photo_filtre_mimetype));
                }
                if ($allowed_mimetype && in_array($explnum->explnum_mimetype, $allowed_mimetype)) {
                    $link = "\n\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\tif(typeof(sendToVisionneuse) == 'undefined'){\n\t\t\t\t\t\t\t\tvar sendToVisionneuse = function (explnum_id){\n\t\t\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\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfunction sendToVisionneuse_" . $explnum->explnum_id . "(){\n\t\t\t\t\t\t\t\topen_visionneuse(sendToVisionneuse," . $explnum->explnum_id . ");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</script>\n\t\t\t\t\t\t<a href='#' onclick=\"auth_popup('./ajax.php?module=ajax&categ=auth&callback_func=sendToVisionneuse_" . $explnum->explnum_id . "');\" alt='{$alt}' title='{$alt}'>" . $obj . "</a><br />";
                    $explnum_liste_obj .= $link;
                } else {
                    $link = "\n\t\t\t\t\t\t<a href='#' onclick=\"auth_popup('./ajax.php?module=ajax&categ=auth&new_tab=1&callback_url=" . rawurlencode($opac_url_base . "doc_num.php?explnum_id=" . $explnum->explnum_id) . "')\" alt='{$alt}' title='{$alt}'>" . $obj . "</a><br />";
                    $explnum_liste_obj .= $link;
                }
            } else {
                if ($opac_visionneuse_allow) {
                    $allowed_mimetype = explode(",", str_replace("'", "", $opac_photo_filtre_mimetype));
                }
                if ($allowed_mimetype && in_array($explnum->explnum_mimetype, $allowed_mimetype)) {
                    $link = "\n\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\tif(typeof(sendToVisionneuse) == 'undefined'){\n\t\t\t\t\t\t\t\tvar sendToVisionneuse = function (explnum_id){\n\t\t\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\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</script>\n\t\t\t\t\t\t<a href='#' onclick=\"open_visionneuse(sendToVisionneuse," . $explnum->explnum_id . ");return false;\" alt='{$alt}' title='{$alt}'>" . $obj . "</a><br />";
                    $explnum_liste_obj .= $link;
                } else {
                    $suite_url_explnum = "doc_num.php?explnum_id={$explnum->explnum_id}";
                    if (!$r_statut->explnum_download_opac) {
                        $explnum_liste_obj .= $obj . "<br />";
                    } else {
                        $explnum_liste_obj .= "<a href='" . $opac_url_base . $suite_url_explnum . "' alt='{$alt}' title='{$alt}' target='_blank'>" . $obj . "</a><br />";
                    }
                }
            }
            if ($_mimetypes_byext_[$explnum->explnum_extfichier]["label"]) {
                $explnummime_nom = $_mimetypes_byext_[$explnum->explnum_extfichier]["label"];
            } elseif ($_mimetypes_bymimetype_[$explnum->explnum_mimetype]["label"]) {
                $explnummime_nom = $_mimetypes_bymimetype_[$explnum->explnum_mimetype]["label"];
            } else {
                $explnummime_nom = $explnum->explnum_mimetype;
            }
            if ($tlink) {
                $explnum_liste_obj .= "<a href='{$tlink}'>";
                $explnum_liste_obj .= htmlentities($explnum->explnum_nom, ENT_QUOTES, $charset) . "</a><div class='explnum_type'>" . htmlentities($explnummime_nom, ENT_QUOTES, $charset) . "</div>";
            } else {
                $explnum_liste_obj .= htmlentities($explnum->explnum_nom, ENT_QUOTES, $charset) . "<div class='explnum_type'>" . htmlentities($explnummime_nom, ENT_QUOTES, $charset) . "</div>";
            }
            $explnum_liste_obj .= "</center>";
        } else {
            return "";
        }
    } else {
        return "";
    }
    return $explnum_liste_obj;
}
예제 #11
0
     $current->do_public($short, $ex);
     if ($vignette) {
         $current->do_image($current->notice_public, false);
     }
 } else {
     $current->do_isbd($short, $ex);
     if ($vignette) {
         $current->do_image($current->notice_isbd, false);
     }
 }
 //Icone type de Document
 $icon = $icon_doc[$current->notice->niveau_biblio . $current->notice->typdoc];
 $iconDoc = "";
 if ($icon) {
     $info_bulle_icon = $biblio_doc[$current->notice->niveau_biblio] . " : " . $tdoc->table[$current->notice->typdoc];
     $iconDoc = "<img src=\"" . get_url_icon($icon, 1) . "\" alt=\"{$info_bulle_icon}\" title=\"{$info_bulle_icon}\" align='top' />";
 }
 if ($header) {
     $notice_aff .= "<h3>" . $iconDoc . $current->notice_header . "</h3>";
 }
 if ($current->notice->niveau_biblio == 's') {
     $perio = "<span class='fond-mere'>[" . $msg['isbd_type_perio'] . $bulletins . "]</span>&nbsp;";
 } elseif ($current->notice->niveau_biblio == 'a') {
     $perio = "<span class='fond-article'>[" . $msg['isbd_type_art'] . "]</span>&nbsp;";
 } else {
     $perio = "";
 }
 if ($type == 'PUBLIC') {
     $notice_aff .= $perio . $current->notice_public;
 } else {
     $notice_aff .= $perio . $current->notice_isbd;
예제 #12
0
            }
        }
    }
    $message = sprintf($msg["cart_add_notices"], $n, $nbtotal);
    if ($na) {
        $message .= ", " . sprintf($msg["cart_already_in"], $na);
    }
    if (count($cart_) == $opac_max_cart_items) {
        $message .= ", " . $msg["cart_full"];
    }
    return $message;
}
print "<script type='text/javascript'>\n\t\t\tvar msg_notice_title_basket_exist = '" . addslashes($msg["notice_title_basket_exist"]) . "';\n\t\t</script>";
print "<script type='text/javascript' src='" . $include_path . "/javascript/cart.js'></script>";
$vide_cache = filemtime("./styles/" . $css . "/" . $css . ".css");
print "<link rel=\"stylesheet\" href=\"./styles/" . $css . "/" . $css . ".css?" . $vide_cache . "\" />\n<span class='img_basket'><img src='" . get_url_icon("basket_small_20x20.png") . "' border='0' valign='center'/></span>&nbsp;";
$cart_ = $_SESSION["cart"];
if (!count($cart_)) {
    $cart_ = array();
}
$id = stripslashes($id);
// attention id peut etre du type es123 (recherche externe)
$location += 0;
if ($id && !$lvl) {
    if (count($cart_) < $opac_max_cart_items) {
        $as = array_search($id, $cart_);
        $notice_header = htmlentities(substr(strip_tags(stripslashes(html_entity_decode($header, ENT_QUOTES))), 0, 45), ENT_QUOTES, $charset);
        if ($notice_header != $header) {
            $notice_header .= "...";
        }
        if ($as !== null && $as !== false) {
예제 #13
0
 function print_resume($level = 2, $css = '')
 {
     global $css, $msg;
     if (!$this->id) {
         return;
     }
     // adaptation par rapport au niveau de détail souhaité
     switch ($level) {
         // case x :
         case 2:
         default:
             global $publisher_level2_display;
             $publisher_display = $publisher_level2_display;
             break;
     }
     $print = $publisher_display;
     // remplacement des champs statiques
     $print = str_replace("!!id!!", $this->id, $print);
     $print = str_replace("!!name!!", $this->name, $print);
     $print = str_replace("!!adr1!!", $this->adr1, $print);
     $print = str_replace("!!adr2!!", $this->adr2, $print);
     $print = str_replace("!!cp!!", $this->cp, $print);
     $print = str_replace("!!ville!!", $this->ville, $print);
     $print = str_replace("!!pays!!", $this->pays, $print);
     if ($this->web) {
         $print = str_replace("!!site_web!!", "<a href='{$this->web}' target='_blank' type='external_url_autor'><img src='" . get_url_icon("globe.gif") . "' border='0' /></a>", $print);
     } else {
         $print = str_replace("!!site_web!!", "", $print);
     }
     $print = str_replace("!!isbd!!", $this->isbd_entry, $print);
     $print = str_replace("!!aut_comment!!", $this->ed_comment, $print);
     if (preg_match("#!!colls!!#", $print)) {
         global $dbh;
         $query = "select collection_id, collection_name from collections where collection_parent='" . $this->id . "' order by index_coll";
         $result = pmb_mysql_query($query, $dbh);
         if (pmb_mysql_num_rows($result)) {
             $remplacement = $msg[publishers_collections] . "\n<ul>\n";
             while ($obj = pmb_mysql_fetch_object($result)) {
                 $remplacement .= "<li><a href='index.php?lvl=coll_see&id=" . $obj->collection_id . "'>" . $obj->collection_name . "</a></li>\n";
             }
             pmb_mysql_free_result($result);
             $remplacement .= "</ul><div class='row'></div>\n";
         } else {
             $remplacement = "";
         }
         $print = str_replace("!!colls!!", $remplacement, $print);
     }
     if (preg_match("#!!address!!#", $print)) {
         if ($this->adr1 != "" && $this->cp != "" && $this->ville != "") {
             $remplacement = $this->adr1;
             if ($this->adr2 != "") {
                 $remplacement .= "<br />\n" . $this->adr2;
             }
             $remplacement .= "<br />\n" . $this->cp . " " . $this->ville;
             if ($this->pays != "") {
                 $remplacement .= "<br />\n" . $this->pays;
             }
         } else {
             $remplacement = "";
         }
         $print = str_replace("!!address!!", $remplacement, $print);
     }
     return $print;
 }
예제 #14
0
function affiche_public_bannette($bannettes = "", $aff_notices_nb = 0, $mode_aff_notice = AFF_BAN_NOTICES_BOTH, $depliable = AFF_BAN_NOTICES_DEPLIABLES_OUI, $link_to_bannette = "", $liens_opac = array(), $date_diff = '', $htmldiv_id = "bannette-container", $htmldiv_class = "bannette-container", $htmldiv_zindex = "")
{
    global $dbh;
    global $msg, $charset;
    global $opac_notice_affichage_class;
    global $affiche_bannette_tpl;
    // récupération des bannettes
    global $id_empr;
    global $opac_websubscribe_show;
    global $id_empr;
    if ($bannettes) {
        $clause = " and id_bannette in ({$bannettes}) ";
    }
    //Récupération des infos des bannettes
    $requete = "select distinct id_bannette,comment_public, date_format(date_last_envoi, '" . $msg["format_date"] . "') as aff_date_last_envoi from bannettes where proprio_bannette = 0 {$clause} order by date_last_envoi DESC ";
    $resultat = pmb_mysql_query($requete);
    $tableau_bannettes = array();
    while ($r = pmb_mysql_fetch_object($resultat)) {
        $requete = "select count(1) as compte from bannette_contenu where num_bannette='{$r->id_bannette}'";
        $resnb = pmb_mysql_query($requete);
        $nb = pmb_mysql_fetch_object($resnb);
        if ($nb->compte) {
            $tableau_bannettes[] = array('id_bannette' => $r->id_bannette, 'comment_public' => $r->comment_public, 'aff_date_last_envoi' => $r->aff_date_last_envoi, 'nb_contenu' => $nb->compte);
        }
    }
    if (!sizeof($tableau_bannettes)) {
        return "";
    }
    // préparation du div comme il faut
    $retour_aff = "<div id='{$htmldiv_id}' class='{$htmldiv_class}'";
    if ($htmldiv_zindex) {
        $retour_aff .= " zindex='{$htmldiv_zindex}' ";
    }
    $retour_aff .= " >";
    for ($i = 0; $i < sizeof($tableau_bannettes); $i++) {
        $aff_banette = "";
        $id_bannette = $tableau_bannettes[$i]['id_bannette'];
        $comment_public = $tableau_bannettes[$i]['comment_public'];
        $aff_date_last_envoi = $tableau_bannettes[$i]['aff_date_last_envoi'];
        $aff_banette .= "\n<div class='bannette-titre'><h1>";
        $aff_banette .= "<a href='cart_info.php?lvl=dsi&id={$id_bannette}' target='cart_info' title=\"" . $msg[notice_title_basket] . "\"><img src='" . get_url_icon("basket_small_20x20.png") . "' border='0' alt=\"" . $msg[notice_title_basket] . "\"></a>";
        if ($link_to_bannette) {
            $aff_banette .= "<a href=\"" . str_replace("!!id_bannette!!", $id_bannette, $link_to_bannette) . "\">";
        }
        if ($date_diff) {
            $aff_banette .= htmlentities($comment_public . " - " . formatdate($date_diff), ENT_QUOTES, $charset);
        } else {
            $aff_banette .= htmlentities($comment_public . " - " . $aff_date_last_envoi, ENT_QUOTES, $charset);
        }
        if ($link_to_bannette) {
            $aff_banette .= "</a>";
        }
        //TODO
        if ($_SESSION['user_code']) {
            $aff_banette .= "\n\t\t\t<form name='bannette_subscription' method='post' action='./empr.php?tab=dsi&lvl=bannette_gerer'>\n\t\t\t\t<input type='hidden' name='enregistrer' value='PUB'/>\n\t\t\t\t<input type='hidden' name='lvl' value='bannette_gerer'/>\n\t\t\t\t<input type='hidden' name='bannette_abon[" . $id_bannette . "]' value='1' />";
            $query = "select num_bannette from bannette_abon where num_empr = " . $id_empr;
            $result = pmb_mysql_query($query);
            if (pmb_mysql_num_rows($result)) {
                while ($row = pmb_mysql_fetch_object($result)) {
                    $aff_banette .= "\n\t\t\t\t<input type='hidden' name='bannette_abon[" . $row->num_bannette . "]' value='1' />";
                }
            }
            $aff_banette .= "\n\t\t\t\t<input type='submit' class='bouton' value=\"" . $msg['bannette_abonn'] . "\"/>\n\t\t\t</form>";
        } else {
            if ($opac_websubscribe_show == 2) {
                $aff_banette .= "\n\t\t\t<form name='bannette_subscription' method='post' action='./do_resa.php'>\n\t\t\t\t<input type='hidden' name='enregistrer' value='PUB'/>\n\t\t\t\t<input type='hidden' name='lvl' value='bannette_gerer'/>\n\t\t\t\t<input type='hidden' name='new_connexion' value='1' /> \n\t\t\t\t<input type='hidden' name='tab' value='dsi'/>\n\t\t\t\t<input type='hidden' name='bannette_abon[" . $id_bannette . "]' value='1' />";
                $aff_banette .= "\n\t\t\t\t<input type='submit' class='bouton' value=\"" . $msg['bannette_abonn'] . "\"/>\n\t\t\t</form>";
            }
        }
        $aff_banette .= "</h1></div><hr/>";
        $notices = array();
        notices_bannette($id_bannette, $notices, $date_diff);
        if ($aff_notices_nb > 0) {
            $limite_notices = min($aff_notices_nb, count($notices));
        } elseif ($aff_notices_nb < 0) {
            $limite_notices = min($aff_notices_nb, count($notices));
        } else {
            $limite_notices = count($notices);
        }
        reset($notices);
        $limit = 0;
        if ($limite_notices) {
            $aff_banette .= "<div id='etagere-notice-list_!!id_bannette!!'>";
        }
        while ((list($idnotice, $niveau_biblio) = each($notices)) && $limit < $limite_notices) {
            $limit++;
            $notice = new $opac_notice_affichage_class($idnotice, $liens_opac, 1);
            // si notice visible
            if ($notice->visu_notice) {
                $notice->do_header();
                switch ($mode_aff_notice) {
                    case AFF_BAN_NOTICES_REDUIT:
                        $aff_banette .= "<div class='etagere-titre-reduit'>" . $notice->notice_header_with_link . "</div>";
                        break;
                    case AFF_BAN_NOTICES_ISBD:
                        $notice->do_isbd();
                        $notice->genere_simple($depliable, 'ISBD');
                        $aff_banette .= $notice->result;
                        break;
                    case AFF_BAN_NOTICES_PUBLIC:
                        $notice->do_public();
                        $notice->genere_simple($depliable, 'PUBLIC');
                        $aff_banette .= $notice->result;
                        break;
                    case AFF_BAN_NOTICES_BOTH:
                        $notice->do_isbd();
                        $notice->do_public();
                        $notice->genere_double($depliable, 'PUBLIC');
                        $aff_banette .= $notice->result;
                        break;
                    default:
                        $notice->do_isbd();
                        $notice->do_public();
                        $notice->genere_double($depliable, 'autre');
                        $aff_banette .= $notice->result;
                        break;
                }
            }
        }
        if ($limite_notices && $limite_notices < count($notices)) {
            $aff_banette .= "<br />...";
        }
        if ($limite_notices) {
            $aff_banette .= "</div>";
        }
        $req = "select distinct date_diff_arc from dsi_archive where num_banette_arc='" . $id_bannette . "' order by date_diff_arc desc";
        $res_arc = pmb_mysql_query($req, $dbh);
        $first = 0;
        $diff_list = "";
        while ($r = pmb_mysql_fetch_object($res_arc)) {
            if (!$first) {
                $libelle = $msg["dsi_archive_last"];
            } else {
                $libelle = sprintf($msg["dsi_archive_other"], formatdate($r->date_diff_arc));
            }
            if ($pair_impair == 'even') {
                $pair_impair = 'odd';
            } else {
                $pair_impair = 'even';
            }
            $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" onmousedown=\"document.location='{$link_to_bannette}&date_diff=" . $r->date_diff_arc . "';\" ";
            $diff = "<tr style='cursor: pointer' class='{$pair_impair}' {$tr_javascript}><td>" . $libelle . "</td></tr>";
            $first = 1;
            $diff_list .= $diff;
        }
        $tpl = $affiche_bannette_tpl;
        $tpl = str_replace("!!historique!!", $diff_list, $tpl);
        $tpl = str_replace("!!diffusion!!", $aff_banette, $tpl);
        $tpl = str_replace("!!id_bannette!!", $id_bannette, $tpl);
        $retour_aff .= $tpl;
    }
    // fermeture du DIV
    $retour_aff .= "</div><!-- fin id='{$htmldiv_id}' class='{$htmldiv_class}' -->";
    return $retour_aff;
}
예제 #15
0
 /**
  * @return string les script js utile pour le comparateur
  */
 public static function get_compare_wrapper()
 {
     global $base_path;
     global $msg;
     $script = "\n\t\t\tfunction valid_facettes_compare(){\n\t\t\t\t\n\t\t\t\tvar form = document.facettes_multi;\n\t\t\t\tif(form.elements.length>0){\n\t\t\t\t\t\n\t\t\t\t\tvar form_values_compare_input_array=new Array();\n\t\t\t\t\t\n\t\t\t\t\tfor(var i=0; i<form.elements.length;i++){\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(form.elements[i].name=='check_facette[]' && form.elements[i].checked){\n\t\t\t\t\t\t\t//on transforme les case à coché en element du tableau des facettes\t\n\t\t\t\t\t\t\t//on ajoute dans le tableau des facettes\n\t\t\t\t\t\t\tvar value=form.elements[i].value;\n\t\t\t\t\t\t\tvar jsonArray=JSON.parse(value);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//On ajoute dans le formulaire de postage général\n\t\t\t\t\t\t\tvar form_values_compare_input=document.createElement('input');\n\t\t\t\t\t\t\tform_values_compare_input.setAttribute('name','check_facette_compare[]');\n\t\t\t\t\t\t\tform_values_compare_input.setAttribute('type','hidden');\n\t\t\t\t\t\t\tform_values_compare_input.setAttribute('value',value);\n\t\t\t\t\t\t\tform_values_compare_input_array.push(form_values_compare_input);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tvar post=false;\n\t\t\t\t\tvar form_values=document.form_values;\n\t\t\t\t\tfor(var i=0;i<form_values_compare_input_array.length;i++) {\n\t\t\t\t\t\tform_values.appendChild(form_values_compare_input_array[i]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfor(var i=0; i<form_values.elements.length;i++){\n\t\t\t\t\t\tif(form_values.elements[i].name=='check_facette_compare[]' && form_values.elements[i].value!=''){\n\t\t\t\t\t\t\tdocument.getElementById('filtre_compare_facette').value='compare';\n\t\t\t\t\t\t\tdocument.getElementById('filtre_compare_form_values').value='compare';\n\t\t\t\t\t\t\tform_values.submit();\n\t\t\t\t\t\t\tpost=true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(post=false){\n\t\t\t\t\t\talert('" . $msg['facette_compare_not_selected'] . "');\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\talert('" . $msg['facette_compare_not_selected'] . "');\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfunction valid_compare(){\n\t\t\t\tvar form_values=document.form_values;\n\t\t\t\tvar post=false;\n\t\t\t\t\n\t\t\t\tfor(var i=0; i<form_values.elements.length;i++){\n\t\t\t\t\tif(form_values.elements[i].name=='check_facette_compare[]' && form_values.elements[i].value!=''){\n\t\t\t\t\t\tdocument.getElementById('filtre_compare_facette').value='compare';\n\t\t\t\t\t\tdocument.getElementById('filtre_compare_form_values').value='compare';\n\t\t\t\t\t\tform_values.submit();\n\t\t\t\t\t\tpost=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(post=false){\n\t\t\t\t\talert('" . $msg['facette_compare_not_selected'] . "');\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfunction remove_compare_facette(value){\n\t\t\t\t\n\t\t\t\tvar jsonArray = JSON.parse(value);\n\t\t\t\t\n\t\t\t\t//on supprime l'élement du tableau des facettes\n\t\t\t\telem=document.getElementById('compare_facette_'+jsonArray[4]);\n\t\t\t\telem.parentNode.removeChild(elem);\n\t\t\t\t\n\t\t\t\t//on supprime l'élément du formulaire général aussi\n\t\t\t\tvar form_values=document.form_values;\n\t\t\t\tfor(var i in form_values.elements){\n\t\t\t\t\tif(form_values.elements[i] && form_values.elements[i].value && form_values.elements[i].name=='check_facette_compare[]'){\n\t\t\t\t\t\tform_values_json_array=JSON.parse(form_values.elements[i].value);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(form_values_json_array[4]==jsonArray[4]){\n\t\t\t\t\t\t\telem=form_values.elements[i];\n\t\t\t\t\t\t\telem.parentNode.removeChild(elem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar post=true;\n\t\t\t\tfor(var i in form_values.elements){\n\t\t\t\t\tif(form_values.elements[i] && form_values.elements[i].value && form_values.elements[i].name=='check_facette_compare[]'){\n\t\t\t\t\t\tvalid_facettes_compare();\n\t\t\t\t\t\tpost=false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(post){\n\t\t\t\t\tdocument.location.href='{$base_path}/index.php?lvl=more_results&get_last_query=1&reinit_compare=1';\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfunction group_by(groupBy){\n\t\t\t\t\n\t\t\t\tvar jsonArray=JSON.parse(groupBy);\n\t\t\t\n\t\t\t\t//on vide les elements group_by\n\t\t\t\tvar group_by_elements=document.getElementsByName('check_facette_groupby[]');\n\t\t\t\t\n\t\t\t\tvar nodes_to_remove;\n\t\t\t\t\n\t\t\t\tfor(var i in group_by_elements){\n\t\t\t\t\tif(group_by_elements[i].nodeName=='INPUT'){\n\t\t\t\t\t\tif(group_by_elements[i].getAttribute('id')!='facette_groupby_'+jsonArray[3]){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(group_by_elements[i].parentNode.getAttribute('name')!='form_values' && group_by_elements[i].parentNode.getAttribute('name')!='cart_values'){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar group_by_elements_img=group_by_elements[i].previousElementSibling.firstChild;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tgroup_by_elements_img.setAttribute('src','" . get_url_icon('group_by_grey.png') . "');\n\t\t\t\t\t\t\t\tgroup_by_elements[i].setAttribute('value','');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tnodes_to_remove=[i=[group_by_elements[i],group_by_elements[i].parentNode]];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(nodes_to_remove && nodes_to_remove.length>0){\n\t\t\t\t\tfor(var i in nodes_to_remove){\n\t\t\t\t\t\tnodes_to_remove[i][1].removeChild(nodes_to_remove[i][0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telement=document.getElementById('facette_groupby_'+jsonArray[3]);\n\t\t\t\tvar img=element.previousElementSibling.firstChild;\n\t\t\t\t\n\t\t\t\tvar table_groupby=document.getElementById('facette_groupby');\n\t\t\t\t\n\t\t\t\tif(element.getAttribute('value')==''){\n\t\t\t\t\telement.setAttribute('value',JSON.stringify(groupBy));\n\t\t\t\t\t\n\t\t\t\t\t//On ajoute dans le formulaire de postage général\n\t\t\t\t\tvar form_values=document.form_values;\n\t\t\t\t\tvar form_values_groupby_input=document.createElement('input');\n\t\t\t\t\tform_values_groupby_input.setAttribute('name','check_facette_groupby[]');\n\t\t\t\t\tform_values_groupby_input.setAttribute('type','hidden');\n\t\t\t\t\tform_values_groupby_input.setAttribute('value',groupBy);\n\t\t\t\t\tform_values.appendChild(form_values_groupby_input);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tvalid_facettes_compare();\n\t\t\t}\n\t\t";
     return $script;
 }
예제 #16
0
 }
 $notice3->fetch_visibilite();
 if (!$icon) {
     $icon = "icon_per.gif";
 }
 $icon = $icon_doc["b" . $typdocchapeau];
 $num_notice = $obj['num_notice'];
 //carrousel pour la navigation
 if ($opac_show_bulletin_nav) {
     $res_print = do_carroussel($obj);
 } else {
     $res_print = "";
 }
 if ($opac_notices_format != AFF_ETA_NOTICES_TEMPLATE_DJANGO) {
     //$res_print .= "<h3><img src=./images/$icon /> ".$notice3->print_resume(1,$css)."."." <b>".$obj["bulletin_numero"]."</b>".($nb_docnum ? "&nbsp;<a href='#docnum'>".($nb_docnum > 1 ? "<img src='./images/globe_rouge.png' />" : "<img src='./images/globe_orange.png' />")."</a>" : "")."</h3>\n";
     $res_print .= "<h3><img src='" . get_url_icon($icon) . "' /> " . $notice3->print_resume(1, $css) . "." . " <b>" . $obj["bulletin_numero"] . "</b>";
     if ($res_print_link) {
         $res_print .= $res_print_link;
     }
     if ($res_print_docnum) {
         $res_print .= $res_print_docnum . "</h3>\n";
     } else {
         $res_print .= "</h3>\n";
     }
     if ($obj['bulletin_titre']) {
         $res_print .= htmlentities($obj['bulletin_titre'], ENT_QUOTES, $charset) . "<br />";
     }
     if ($obj['mention_date']) {
         $res_print .= $msg['bull_mention_date'] . " &nbsp;" . $obj['mention_date'] . "\n";
     }
     if ($obj['date_date']) {
예제 #17
0
 function show_docnum_table($docnum_tab = array())
 {
     global $charset;
     create_tableau_mimetype();
     $display = "";
     if ($docnum_tab) {
         $nb_doc = 0;
         $display .= "<table>\r\n\t\t\t<tbody>";
         for ($i = 0; $i < count($docnum_tab); $i++) {
             $nb_doc++;
             if ($nb_doc == 1) {
                 $display .= "<tr>";
             }
             $alt = htmlentities($docnum_tab[$i]['explnum_doc_nomfichier'], ENT_QUOTES, $charset) . ' - ' . htmlentities($docnum_tab[$i]['explnum_doc_mimetype'], ENT_QUOTES, $charset);
             $display .= "<td class='docnum' style='width:25%;border:1px solid #CCCCCC;padding : 5px 5px'>\r\n\t\t\t\t<a target='_blank' alt='{$alt}' title='{$alt}' href=\"./explnum_doc.php?explnumdoc_id=" . $docnum_tab[$i]['id_explnum_doc'] . "\">\r\n\t\t\t\t<img src='" . get_url_icon('mimetype/' . icone_mimetype($docnum_tab[$i]['explnum_doc_mimetype'], $docnum_tab[$i]['explnum_doc_extfichier'])) . "' alt='{$alt}' title='{$alt}' >\r\n\t\t\t\t</a>\r\n\t\t\t\t<br />\r\n\t\t\t\t<div class='explnum_type'>" . $docnum_tab[$i]['explnum_doc_mimetype'] . "</div>\r\n\t\t\t\t</td>\r\n\t\t\t\t";
             if ($nb_doc == 4) {
                 $display .= "</tr>";
                 $nb_doc = 0;
             }
         }
         $display .= "</tbody></table>";
     }
     return $display;
 }
예제 #18
0
function get_bulletin_list_func($id)
{
    global $charset, $dbh, $msg, $css;
    global $opac_visionneuse_allow, $icon_doc, $opac_cart_allow, $opac_max_resa;
    global $begin_result_liste, $notice_header, $opac_resa_planning;
    global $opac_show_exemplaires, $fonction, $opac_resa_popup, $opac_resa, $popup_resa, $allow_book;
    global $opac_perio_a2z_show_bulletin_notice;
    $resultat_aff = "";
    $libelle = $msg[270];
    $largeur = 500;
    $requete = "SELECT bulletin_id, bulletin_numero, bulletin_notice, mention_date, date_date, bulletin_titre, bulletin_cb, date_format(date_date, '" . $msg["format_date_sql"] . "') as aff_date_date,num_notice FROM bulletins WHERE bulletin_id='{$id}'";
    $res = @pmb_mysql_query($requete, $dbh);
    while ($obj = pmb_mysql_fetch_array($res)) {
        //on cherches des documents numériques
        $req = "select explnum_id from explnum where explnum_bulletin = " . $obj["bulletin_id"];
        $resultat = pmb_mysql_query($req, $dbh) or die($req . " " . pmb_mysql_error());
        $nb_ex = pmb_mysql_num_rows($resultat);
        //on met le nécessaire pour la visionneuse
        if ($opac_visionneuse_allow && $nb_ex) {
            $resultat_aff .= "\n\t\t\t<script type='text/javascript'>\n\t\t\t\tfunction sendToVisionneuse(explnum_id){\n\t\t\t\t\tdocument.getElementById('visionneuseIframe').src = 'visionneuse.php?mode=perio_bulletin&idperio=" . $obj['bulletin_notice'] . "'+(typeof(explnum_id) != 'undefined' ? '&explnum_id='+explnum_id+\"\" : '\\'');\n\t\t\t\t}\n\t\t\t</script>";
        }
        $typdocchapeau = "a";
        $icon = "";
        $requete3 = "SELECT notice_id,typdoc FROM notices WHERE notice_id='" . $obj["bulletin_notice"] . "' ";
        $res3 = @pmb_mysql_query($requete3, $dbh);
        while ($obj3 = pmb_mysql_fetch_object($res3)) {
            $notice3 = new notice($obj3->notice_id);
            $typdocchapeau = $obj3->typdoc;
        }
        $notice3->fetch_visibilite();
        if (!$icon) {
            $icon = "icon_per.gif";
        }
        $icon = $icon_doc["b" . $typdocchapeau];
        $res_print .= "<h3><img src='" . get_url_icon($icon) . "' /> " . $notice3->print_resume(1, $css) . "." . " <b>" . $obj["bulletin_numero"] . "</b></h3>\n";
        $num_notice = $obj['num_notice'];
        if ($obj['date_date']) {
            $res_print .= $msg['bull_date_date'] . " &nbsp;" . $obj['aff_date_date'] . " \n";
        }
        if ($obj['bulletin_cb']) {
            $res_print .= "<br />" . $msg["code_start"] . " " . htmlentities($obj['bulletin_cb'], ENT_QUOTES, $charset) . "\n";
            $code_cb_bulletin = $obj['bulletin_cb'];
        }
    }
    do_image($res_print, $code_cb_bulletin, 0);
    if ($opac_perio_a2z_show_bulletin_notice && $num_notice) {
        // Il y a une notice de bulletin
        $resultat_aff .= $res_print;
        global $opac_notices_depliable;
        global $seule;
        $memo_opac_notices_depliable = $opac_notices_depliable;
        $memo_seule = $seule;
        $opac_notices_depliable = 0;
        $seule = 1;
        $resultat_aff .= pmb_bidi(aff_notice($num_notice, 0, 0));
        $opac_notices_depliable = $memo_opac_notices_depliable;
        $seule = $memo_seule;
    } else {
        // construction des dépouillements
        $requete = "SELECT * FROM analysis, notices, notice_statut WHERE analysis_bulletin='{$id}' AND notice_id = analysis_notice AND statut = id_notice_statut and ((notice_visible_opac=1 and notice_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (notice_visible_opac_abon=1 and notice_visible_opac=1)" : "") . ") ";
        $res = @pmb_mysql_query($requete, $dbh);
        if (pmb_mysql_num_rows($res)) {
            $depouill = "<h3>" . $msg['bull_dep'] . "</h3>";
            if ($opac_notices_depliable) {
                $depouill .= $begin_result_liste;
            }
            if ($opac_cart_allow) {
                $depouill .= "<a href=\"cart_info.php?id=" . $id . "&lvl=analysis&header=" . rawurlencode(strip_tags($notice_header)) . "\" target=\"cart_info\" class=\"img_basket\" title='" . $msg["cart_add_result_in"] . "'>" . $msg["cart_add_result_in"] . "</a>";
            }
            $depouill .= "<blockquote>";
            while ($obj = pmb_mysql_fetch_array($res)) {
                $depouill .= pmb_bidi(aff_notice($obj["analysis_notice"]));
            }
            $depouill .= "</blockquote>";
        }
        $resultat_aff .= $res_print;
        $resultat_aff .= $depouill;
        if ($notice3->visu_expl && (!$notice3->visu_expl_abon || $notice3->visu_expl_abon && $_SESSION["user_code"])) {
            if (!$opac_resa_planning) {
                $resa_check = check_statut(0, $id);
                if ($resa_check) {
                    $requete_resa = "SELECT count(1) FROM resa WHERE resa_idbulletin='{$id}'";
                    $nb_resa_encours = pmb_mysql_result(pmb_mysql_query($requete_resa, $dbh), 0, 0);
                    if ($nb_resa_encours) {
                        $message_nbresa = str_replace("!!nbresa!!", $nb_resa_encours, $msg["resa_nb_deja_resa"]);
                    }
                    if ($_SESSION["user_code"] && $allow_book && $opac_resa && !$popup_resa) {
                        $ret_resa .= "<h3>" . $msg["bulletin_display_resa"] . "</h3>";
                        if ($opac_max_resa == 0 || $opac_max_resa > $nb_resa_encours) {
                            if ($opac_resa_popup) {
                                $ret_resa .= "<a href='#' onClick=\"if(confirm('" . $msg["confirm_resa"] . "')){w=window.open('./do_resa.php?lvl=resa&id_bulletin=" . $id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;}else return false;\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                            } else {
                                $ret_resa .= "<a href='./do_resa.php?lvl=resa&id_bulletin=" . $id . "&oresa=popup' onClick=\"return confirm('" . $msg["confirm_resa"] . "')\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                            }
                            $ret_resa .= $message_nbresa;
                        } else {
                            $ret_resa .= str_replace("!!nb_max_resa!!", $opac_max_resa, $msg["resa_nb_max_resa"]);
                        }
                        $ret_resa .= "<br />";
                    } elseif (!$_SESSION["user_code"] && $opac_resa && !$popup_resa) {
                        // utilisateur pas connecté
                        // préparation lien réservation sans être connecté
                        $ret_resa .= "<h3>" . $msg["bulletin_display_resa"] . "</h3>";
                        if ($opac_resa_popup) {
                            $ret_resa .= "<a href='#' onClick=\"if(confirm('" . $msg["confirm_resa"] . "')){w=window.open('./do_resa.php?lvl=resa&id_bulletin=" . $id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;}else return false;\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                        } else {
                            $ret_resa .= "<a href='./do_resa.php?lvl=resa&id_bulletin=" . $id . "&oresa=popup' onClick=\"return confirm('" . $msg["confirm_resa"] . "')\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                        }
                        $ret_resa .= $message_nbresa;
                        $ret_resa .= "<br />";
                    } else {
                        $ret_resa = "";
                    }
                    $resultat_aff .= pmb_bidi($ret_resa);
                }
            }
            if ($opac_show_exemplaires) {
                if ($fonction == 'notice_affichage_custom_bretagne') {
                    $resultat_aff .= pmb_bidi(notice_affichage_custom_bretagne::expl_list("m", 0, $id));
                } else {
                    $resultat_aff .= pmb_bidi(notice_affichage::expl_list("m", 0, $id, 0));
                }
            }
        }
        if ($notice3->visu_explnum && (!$notice3->visu_explnum_abon || $notice3->visu_explnum_abon && $_SESSION["user_code"])) {
            if ($explnum = show_explnum_per_notice(0, $id, '')) {
                $resultat_aff .= pmb_bidi("<a name='docnum'><h3>" . $msg["explnum"] . "</h3></a>" . $explnum);
            }
        }
    }
    pmb_mysql_free_result($res);
    $resultat_aff .= notice_affichage::autres_lectures(0, $id);
    return $resultat_aff;
}
 static function show_list_actions($actions, $id_demande, $last_modified = 0, $allow_expand = true)
 {
     global $form_liste_action, $dbh, $msg, $pmb_gestion_devise, $charset, $pmb_type_audit, $ck_vue, $form_see_docnum;
     $liste = "";
     if (sizeof($actions)) {
         $parity = 1;
         foreach ($actions as $id_action => $action) {
             if ($parity % 2) {
                 $pair_impair = "even";
             } else {
                 $pair_impair = "odd";
             }
             $parity += 1;
             $tr_javascript = "onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='" . $pair_impair . "'\" ";
             //On ouvre la derniere conversation
             if ($last_modified == $action->id_action) {
                 $form_liste_action = str_replace('!!last_modified!!', $last_modified, $form_liste_action);
             }
             // affichage en gras si nouveauté pour l'opac du côté des notes ou des actions + icone
             $style = "";
             if ($action->actions_read_opac == 1) {
                 $style = " style='cursor: pointer; font-weight:bold;width:100%;height:30px;margin:5px;border-radius: 6px;'";
             } else {
                 $style = " style='cursor: pointer;width:100%;margin:5px;border-radius: 6px;'";
             }
             if ($allow_expand) {
                 $onclick = "onclick=\"expand_note('note" . $action->id_action . "','{$action->id_action}', true); return false;\"";
             } else {
                 $onclick = "onclick=\"document.location='./empr.php?tab=request&lvl=list_dmde&sub=open_demande&iddemande={$id_demande}&last_modified={$action->id_action}'\"";
             }
             $liste .= "<div {$onclick} class='form-list-actions " . $pair_impair . "' " . $tr_javascript . $style . " >";
             $liste .= "<div style=\"float:left;padding-top: 6px;\">";
             if ($action->actions_read_opac == 1) {
                 $liste .= "<img hspace=\"3\" border=\"0\" " . $onclick . " title=\"\" id=\"read" . $action->id_action . "Img1\" name=\"imRead\" class=\"img_plus\" src=\"" . get_url_icon('notification_empty.png') . "\" style='display:none;margin:0 5px'>\r\n\t\t\t\t\t\t\t\t<img style=\"margin:0 5px\" hspace=\"3\" border=\"0\" " . $onclick . " title=\"\" id=\"read" . $action->id_action . "Img2\" name=\"imRead\" class=\"img_plus\" src=\"" . get_url_icon('notification_new.png') . "\">";
             } else {
                 $liste .= "<img style=\";margin:0 5px\" hspace=\"3\" border=\"0\" " . $onclick . " title=\"\" id=\"read" . $action->id_action . "Img1\" name=\"imRead\" class=\"img_plus\" src=\"" . get_url_icon('notification_empty.png') . "\" >\r\n\t\t\t\t\t\t\t\t<img hspace=\"3\" border=\"0\" " . $onclick . " title=\"\" id=\"read" . $action->id_action . "Img2\" name=\"imRead\" class=\"img_plus\" src=\"" . get_url_icon('notification_new.png') . "\" style='display:none;margin:0 5px'>";
             }
             foreach ($action->workflow->getTypeList() as $id => $value) {
                 if ($value['id'] == $action->type_action && $value['image']) {
                     $liste .= "<img hspace=\"3\" border=\"0\" title=\"" . $value['comment'] . "\" src=\"./images/" . $value['image'] . "\" style=\"height:16px;margin:0 5px\" />";
                 }
             }
             $liste .= "</div>";
             $liste .= "<p style=\"padding-top: 8px;\">#" . $action->getCreateur($action->actions_num_user, $action->actions_type_user) . " : <i>" . htmlentities($action->sujet_action, ENT_QUOTES, $charset) . "</i> " . htmlentities($action->detail_action, ENT_QUOTES, $charset) . "</p>";
             $liste .= "</div>";
             if ($allow_expand) {
                 //Le détail de l'action, contient les notes
                 $liste .= "<div id=\"note" . $action->id_action . "Child\" style=\"display:none\">\n\t\t\t\t\t\n\t\t\t\t\t<div id=\"note" . $action->id_action . "ChildTd\">";
                 $liste .= "</div>";
                 $liste .= self::show_action_docnum($action);
                 $liste .= "</div>";
             }
         }
     } else {
         $liste .= "<div>" . $msg['demandes_action_liste_vide'] . "</div>";
     }
     if (!$last_modified) {
         $form_liste_action = str_replace('!!last_modified!!', '', $form_liste_action);
     }
     $form_liste_action = str_replace('!!iddemande!!', $id_demande, $form_liste_action);
     $form_liste_action = str_replace('!!liste_action!!', $liste, $form_liste_action);
     if ($allow_expand) {
         $script = "\n\t\t\t\tif(document.getElementById('last_modified').value!=0){\n\t\t\t\t\twindow.onload(expand_note('note'+document.getElementById('last_modified').value,document.getElementById('last_modified').value, true));\n\t\t\t\t}\n\t\t\t";
     }
     $form_liste_action = str_replace('!!script_expand!!', $script, $form_liste_action);
     return $form_liste_action;
 }
예제 #20
0
 function page_navigator()
 {
     $last_page = ceil($this->n_total / $this->n_per_page) - 1;
     $url_page = $this->url_for_term_search . "?" . $this->search_term_name . "=" . rawurlencode($this->search_term) . "&" . $this->search_term_origin_name . "=" . rawurlencode($this->search_term_origin);
     if ($this->offset != 0) {
         $navig .= "<a href=\"{$url_page}&page=0" . "&nbresultterme=" . $this->n_total . "\"><img src='" . get_url_icon('first.gif') . "' border='0'/></a>";
     } else {
         $navig .= "<img src='" . get_url_icon('first-grey.gif') . "' border='0'/>";
     }
     if ($this->offset != 0) {
         $navig .= "<a href=\"{$url_page}&page=" . ($this->page - 1) . "&nbresultterme=" . $this->n_total . "&" . $this->base_query . "\"><img src='" . get_url_icon('prev.gif') . "' border='0'/></a>";
     } else {
         $navig .= "<img src='" . get_url_icon('prev-grey.gif') . "' border='0'/>";
     }
     $navig .= " (" . ($this->offset + 1) . "-" . min($this->offset + $this->n_per_page, $this->n_total) . ")/" . $this->n_total . " ";
     if ($this->offset + $this->n_per_page + 1 < $this->n_total) {
         $navig .= "<a href=\"{$url_page}&page=" . ($this->page + 1) . "&nbresultterme=" . $this->n_total . "&" . $this->base_query . "\"><img src='" . get_url_icon('next.gif') . "' border='0'/></a>";
     } else {
         $navig .= "<img src='" . get_url_icon('next-grey.gif') . "' border=0/>";
     }
     if ($this->offset + $this->n_per_page + 1 < $this->n_total) {
         $navig .= "<a href=\"{$url_page}&page={$last_page}" . "&nbresultterme=" . $this->n_total . "\"><img src='" . get_url_icon('last.gif') . "' border='0'/></a>";
     } else {
         $navig .= "<img src='" . get_url_icon('last-grey.gif') . "' border='0'/>";
     }
     return $navig;
 }
예제 #21
0
function val_resolve_empr($field, $value)
{
    global $charset, $pmb_perso_sep, $opac_url_base, $use_opac_url_base;
    $without = "";
    $options = $field[OPTIONS][0];
    $values = format_output($field, $value);
    $ret = "";
    for ($i = 0; $i < count($values); $i++) {
        $val = explode("|", $values[$i]);
        if (count($val) > 1) {
            $id = $val[0];
            foreach ($options[RESOLVE] as $res) {
                if ($res[ID] == $val[1]) {
                    $label = $res[LABEL];
                    $url = $res[value];
                    break;
                }
            }
            $link = str_replace("!!id!!", $id, $url);
            if ($ret != "") {
                $ret .= " / ";
            }
            //$ret.= "<a href='$link' target='_blank'>".htmlentities($link,ENT_QUOTES,$charset)."</a>";
            if (!$use_opac_url_base) {
                $ret .= htmlentities($label, ENT_QUOTES, $charset) . " : {$id} <a href='{$link}' target='_blank'><img align='center' src='" . get_url_icon("globe.gif") . "' alt='{$link}' title='link'/></a>";
            } else {
                $ret .= htmlentities($label, ENT_QUOTES, $charset) . " : {$id} <a href='{$link}' target='_blank'><img align='center' src='" . get_url_icon("globe.gif", 1) . "' alt='{$link}' title='link'/></a>";
            }
            if ($without) {
                $without .= $pmb_perso_sep;
            }
            $without .= $link;
        } else {
            if ($without) {
                $without .= $pmb_perso_sep;
            }
            $without .= implode($pmb_perso_sep, $value);
        }
    }
    return array("ishtml" => true, "value" => $ret, "withoutHTML" => $without);
}
예제 #22
0
 /**
  * Génère le formulaire pour les listes publiques 
  */
 function generate_publiclist()
 {
     global $liste_lecture_public, $charset, $msg, $opac_url_base;
     $rqt = "select id_liste, nom_liste, description, confidential, read_only, empr_login, empr_nom, empr_prenom, if(etat is null,0,etat) as etat\n\t\t\t\tfrom opac_liste_lecture op\n\t\t\t\tleft join empr e on e.id_empr=op.num_empr \n\t\t\t\tleft join abo_liste_lecture abo on (abo.num_liste=id_liste and abo.num_empr='" . $this->num_empr . "')\n\t\t\t\twhere public=1 \n\t\t\t\tand op.num_empr !='" . $this->num_empr . "' \n\t\t\t\torder by nom_liste";
     $res = pmb_mysql_query($rqt);
     if (pmb_mysql_num_rows($res) == 0) {
         //Si on a aucune liste partagée dispo
         $affichage_liste .= "<div class='row'><label>" . $msg['list_lecture_no_publiclist'] . "</label></div>";
         $liste_lecture_public = str_replace('!!inscrire_btn!!', '', $liste_lecture_public);
         $liste_lecture_public = str_replace('!!desinscrire_btn!!', '', $liste_lecture_public);
         $liste_lecture_public = str_replace('!!public_list!!', $affichage_liste, $liste_lecture_public);
         $this->display = $liste_lecture_public;
         return;
     }
     $affichage_liste .= "<script src='./includes/javascript/liste_lecture.js' type='text/javascript'></script>\n\t\t\t\t<script src='./includes/javascript/http_request.js' type='text/javascript'></script>";
     while ($liste = pmb_mysql_fetch_object($res)) {
         $font = '';
         $font_end = '';
         $check = '';
         $nblistes = array();
         if ($liste->etat == 2) {
             $font = "<font color=\"green\">";
             $font_end = "</font>";
             $check = 'checked';
         }
         //Ajout de script pour la gestion de la confidentialité et l'ajax
         $confidential = false;
         $icone = "";
         $disable = "";
         $ajax = "";
         $title = "";
         if ($liste->confidential && !$liste->etat) {
             $ajax = "onclick=\"make_mail_form('" . $liste->id_liste . "')\" style=\"cursor:pointer\"";
             $disable = 'disabled';
             $icone = "lock.png";
             $title = $msg['list_lecture_confidential'];
             $confidential = true;
         } elseif ($liste->confidential && $liste->etat == 1) {
             $ajax = "onclick=\"demandeEnCours();\"";
             $disable = 'disabled';
             $icone = "hourglass.png";
             $title = $msg['list_lecture_encours_demande'];
             $confidential = true;
         } elseif ($liste->confidential) {
             $icone = "lock_open.png";
             $title = $msg['list_lecture_accessible'];
         }
         if ($liste->description) {
             $div_description = "<div id='desc{$liste->id_liste}' class='listedescription'>{$liste->description}</div>";
             $div_action = " onmouseout=\"document.getElementById('desc{$liste->id_liste}').style.visibility='hidden';\" onmouseover=\"document.getElementById('desc{$liste->id_liste}').style.visibility='visible';\"";
         }
         $affichage_liste .= "<div id='liste_{$liste->id_liste}' {$ajax}>\n\t\t\t\t<input type='checkbox' class='checkbox' id='cb{$liste->id_liste}' name='list_ck[]' value='{$liste->id_liste}' {$check} {$disable} />";
         $titre_liste = " ( {$liste->empr_prenom} {$liste->empr_nom}  )";
         if ($liste->read_only) {
             $img_ro = "&nbsp;<span><img border=0 align='top' src='" . get_url_icon('b_no_edit.png', 1) . "' title=\"" . $msg['list_lecture_readonly'] . "\" id='img_ro_{$liste->id_liste}' /></span>";
         } else {
             $img_ro = "";
         }
         if ($confidential) {
             $affichage_liste .= "&nbsp;<span><a {$div_action} href='#' onclick='return false;'>" . htmlentities($liste->nom_liste, ENT_QUOTES, $charset) . "</a>{$font}<label for='cb{$liste->id_liste}' >" . htmlentities($titre_liste, ENT_QUOTES, $charset) . "</label>{$font_end}</span>{$div_description}";
         } else {
             $affichage_liste .= "&nbsp;<span><a {$div_action} href='./index.php?lvl=show_list&sub=consultation&id_liste={$liste->id_liste}'>" . htmlentities($liste->nom_liste, ENT_QUOTES, $charset) . "</a>{$font}<label for='cb{$liste->id_liste}' >" . htmlentities($titre_liste, ENT_QUOTES, $charset) . " </label>{$font_end}</span>{$div_description}";
         }
         if ($icone) {
             $affichage_liste .= "<span><img border=0 align='top' src='" . get_url_icon($icone, 1) . "' title=\"{$title}\" id='img_confi_{$liste->id_liste}' /></span>";
         }
         $affichage_liste .= $img_ro;
         $affichage_liste .= "</div>";
         $affichage_liste .= "<div id='maillist_{$liste->id_liste}'></div>";
         $nblistes[] = $liste->id_liste;
     }
     $btn_insc = "<input type='submit' class='bouton' name='acces_btn' value=\"{$msg['list_lecture_acces']}\" onclick='this.form.lvl.value=\"public_list\"; this.form.act.value=\"get_acces\";' />";
     $btn_desins = "<input type='submit' class='bouton' name='no_acces_btn' value=\"{$msg['list_lecture_quit_acces']}\" onclick='this.form.lvl.value=\"public_list\"; this.form.act.value=\"suppr_acces\";' />";
     $liste_lecture_public = str_replace('!!inscrire_btn!!', $btn_insc, $liste_lecture_public);
     $liste_lecture_public = str_replace('!!desinscrire_btn!!', $btn_desins, $liste_lecture_public);
     $liste_lecture_public = str_replace('!!public_list!!', $affichage_liste, $liste_lecture_public);
     $this->display = $liste_lecture_public;
 }
예제 #23
0
 function show_docnum_to_attach()
 {
     global $dbh, $form_liste_docnum, $msg, $charset, $base_path, $pmb_indexation_docnum_default;
     $req = "select id_explnum_doc as id, explnum_doc_nomfichier as nom, num_explnum, \n\t\t\tconcat(explnum_index_sew,'',explnum_index_wew) as indexer\n\t\t\tfrom explnum_doc \n\t\t\tjoin explnum_doc_actions on (id_explnum_doc=num_explnum_doc and rapport=1)\n\t\t\tjoin demandes_actions on num_action=id_action\n\t\t\tleft join explnum on explnum_id=num_explnum\n\t\t\twhere num_demande='" . $this->id_demande . "'";
     $res = pmb_mysql_query($req, $dbh);
     $liste = "";
     if (pmb_mysql_num_rows($res)) {
         while ($doc = pmb_mysql_fetch_object($res)) {
             if ($doc->num_explnum) {
                 $check = 'checked';
             }
             if ($pmb_indexation_docnum_default || $doc->indexer) {
                 $check_index = 'checked';
             }
             $liste .= "\t\t\t\t\n\t\t\t\t<div class='row'>\n\t\t\t\t\t<div class='colonne3'>\n\t\t\t\t\t\t<input type='checkbox' id='chk[{$doc->id}]' value='{$doc->id}' name='chk[]' {$check} /><label for='chk[{$doc->id}]' class='etiquette'>" . htmlentities($doc->nom, ENT_QUOTES, $charset) . "</label>&nbsp;\n\t\t\t\t\t\t<a href=\"{$base_path}/explnum_doc.php?explnumdoc_id=" . $doc->id . "'\" target=\"_LINK_\"><img src='" . get_url_icon("globe_orange.png") . "' /></a>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='colonne3'>\t\n\t\t\t\t\t\t<input type='checkbox' id='ck_index[{$doc->id}]' value='{$doc->id}' name='ck_index[]' {$check_index}/><label for='ck_index[{$doc->id}]' class='etiquette'>" . htmlentities($msg['demandes_docnum_indexer'], ENT_QUOTES, $charset) . "</label>&nbsp;\t\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class='row'></div>";
             $check = "";
             $check_index = "";
         }
         $btn_attach = "<input type='submit' class='bouton' value='" . $msg['demandes_attach_checked_docnum'] . "' onClick='this.form.act.value=\"save_attach\" ; return verifChk();' />";
         $form_liste_docnum = str_replace('!!btn_attach!!', $btn_attach, $form_liste_docnum);
     } else {
         $liste = htmlentities($msg['demandes_no_docnum'], ENT_QUOTES, $charset);
         $form_liste_docnum = str_replace('!!btn_attach!!', '', $form_liste_docnum);
     }
     $form_liste_docnum = str_replace('!!liste_docnum!!', $liste, $form_liste_docnum);
     $form_liste_docnum = str_replace('!!iddemande!!', $this->id_demande, $form_liste_docnum);
     print $form_liste_docnum;
 }
예제 #24
0
$dbh = connection_mysql();
//Sessions !! Attention, ce doit être impérativement le premier include (à cause des cookies)
require_once $base_path . "/includes/session.inc.php";
require_once $base_path . "includes/start.inc.php";
require_once "./includes/misc.inc.php";
require_once $base_path . '/includes/templates/common.tpl.php';
// récupération localisation
require_once './includes/localisation.inc.php';
// si paramétrage authentification particulière et pour la re-authentification ntlm
if (file_exists($base_path . '/includes/ext_auth.inc.php')) {
    require_once $base_path . '/includes/ext_auth.inc.php';
}
print "\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n    \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"fr\" >\n<head>\n\t<meta http-equiv=\"content-type\" content=\"text/html; charset=" . $charset . "\" />\n\t<meta name=\"author\" content=\"PMB Group\" />";
if ($charset == 'utf-8') {
    print utf8_encode("\t<meta name=\"keywords\" content=\"OPAC, web, libray, opensource, catalog, catalogue, bibliothèque, médiathèque, pmb, phpmybibli\" />");
} else {
    print "\t<meta name=\"keywords\" content=\"OPAC, web, libray, opensource, catalog, catalogue, bibliothèque, médiathèque, pmb, phpmybibli\" />";
}
print "\t<meta name=\"description\" content=\"Recherches simples dans l'OPAC de PMB\" />\n\t<meta name=\"robots\" content=\"all\" />\n\t<title>pmb : opac</title>\n\t<script>\n\tfunction div_show(name) {\n\t\tvar z=document.getElementById(name);\n\t\tif (z.style.display==\"none\") {\n\t\t\tz.style.display=\"block\"; }\n\t\telse { z.style.display=\"none\"; }\n\t\t}\n\t</script>\n\t" . link_styles($css) . "\n</head>\n\n<body onload=\"window.defaultStatus='pmb : opac';\" id=\"help_popup\" class='popup'>\n<div id='help-container'>\n<p align=right style=\"margin-top:4px;\"><a name='top' ></a><a href='#' onclick=\"self.close();return false\" title=\"" . $msg[search_close] . "\" alt=\"" . $msg[search_close] . "\"><img src=\"" . get_url_icon('close.gif') . "\" align=\"absmiddle\" border=\"0\"></a></p>\n\n";
if (file_exists("includes/messages/" . $lang . "/doc_" . $whatis . "_subst.txt")) {
    $aide = file_get_contents("includes/messages/" . $lang . "/doc_" . $whatis . "_subst.txt");
} elseif (file_exists("includes/messages/" . $lang . "/doc_" . $whatis . ".txt")) {
    $aide = file_get_contents("includes/messages/" . $lang . "/doc_" . $whatis . ".txt");
}
if ($charset == 'utf-8') {
    print utf8_encode($aide);
} else {
    print $aide;
}
print "\n<p align=\"right\"><a href='#top' title=\"" . $msg[search_up] . "\" alt=\"" . $msg[search_up] . "\"><img src=\"images/up.gif\" align=\"absmiddle\" border=\"0\"></a></p>\n</div>\n<script>self.focus();</script>";
print "</body></html>";
예제 #25
0
 static function show_dialog($notes, $num_action, $num_demande, $redirect_to = 'demandes_actions-show_consultation_form')
 {
     global $form_dialog_note, $dbh, $msg, $charset, $id_empr;
     $form_dialog_note = str_replace('!!redirectto!!', $redirect_to, $form_dialog_note);
     $form_dialog_note = str_replace('!!idaction!!', $num_action, $form_dialog_note);
     $form_dialog_note = str_replace('!!iddemande!!', $num_demande, $form_dialog_note);
     $dialog = '';
     if (sizeof($notes)) {
         foreach ($notes as $idNote => $note) {
             //Utilisateur ou lecteur ?
             if ($note->notes_type_user === "1") {
                 $side = 'note_opac';
             } elseif ($note->notes_type_user === "0") {
                 $side = 'note_gest';
             }
             $dialog .= '<div class="' . $side . '" id="note_' . $note->id_note . '">';
             $dialog .= '<div class="btn_note">';
             if ($note->prive) {
                 $dialog .= "<input type='image' src='" . get_url_icon('interdit.gif') . "' alt='" . htmlentities($msg['demandes_note_privacy'], ENT_QUOTES, $charset) . "' title='" . htmlentities($msg['demandes_note_privacy'], ENT_QUOTES, $charset) . "' onclick='return false;'/>";
             }
             if ($note->rapport) {
                 $dialog .= "<input type='image' src='" . get_url_icon('info.gif') . "' alt='" . htmlentities($msg['demandes_note_rapport'], ENT_QUOTES, $charset) . "' title='" . htmlentities($msg['demandes_note_rapport'], ENT_QUOTES, $charset) . "' onclick='return false;'/>";
             }
             if ($note->notes_read_opac) {
                 $dialog .= "<input type='image' src='" . get_url_icon('notification_new.png') . "' alt='" . htmlentities($msg['demandes_note_vue'], ENT_QUOTES, $charset) . "' title='" . htmlentities($msg['demandes_note_vue'], ENT_QUOTES, $charset) . "' onclick='return false;'/>";
             }
             $dialog .= ' </div>';
             $dialog .= "<div>";
             $dialog .= '<div class="entete_note">' . $note->createur_note . ' ' . $msg['381'] . ' ' . formatdate($note->date_note) . '</div>';
             $dialog .= '<p>' . $note->contenu . '</p>';
             $dialog .= '</div>';
             $dialog .= '</div>';
             demandes_notes::note_read($note->id_note, true, "_opac");
         }
         $dialog .= '<a name="fin"></a>';
     }
     // Annulation de l'alerte sur l'action dépliée après lecture des nouvelles notes si c'est la personne à laquelle est affectée l'action qui la lit
     demandes_actions::action_read($num_action, true, "_opac");
     // Mise à jour de la demande dont est issue l'action
     demandes_actions::action_majParentEnfant($num_action, $num_demande, "_opac");
     $form_dialog_note = str_replace('!!dialog!!', $dialog, $form_dialog_note);
     return $form_dialog_note;
 }
예제 #26
0
function printnavbar_onclick($page, $nbrpages, $url, $action = '')
{
    global $script_test_form;
    global $msg;
    $precedente = $page - 1;
    $suivante = $page + 1;
    // affichage de la barre de navigation
    $print = "<div class=\"navbar\">\n";
    $print .= "<form name='form' onsubmit=\"document.getElementById('page').value=document.getElementById('navbar_input_page').value;{$action}\">\n";
    // first
    if ($page != 1) {
        $print .= "<img src='" . get_url_icon('first.gif') . "' alt='first' border='0' title='" . $msg["first_page"] . "' onclick=\"document.getElementById('page').value=1;{$action}\">\n";
    } else {
        $print .= "<img src='" . get_url_icon('first-grey.gif') . "' alt='first'>\n";
    }
    // prev
    if ($precedente >= 1) {
        $printurl = str_replace("!!page!!", "{$precedente}", $url);
        $print .= "<img src='" . get_url_icon('prev.gif') . "' alt='previous' border='0' title='" . $msg["prec_page"] . "'  onclick=\"document.getElementById('page').value={$precedente};{$action}\">\n";
    } else {
        $print .= "<img src='" . get_url_icon('prev-grey.gif') . "' alt='previous'>\n";
    }
    // page courante
    if ($nbrpages > 1) {
        $print .= "page <input type='text' class='numero_page' name='page' id='navbar_input_page' value='{$page}' size='" . strlen("{$nbrpages}") . "'>/{$nbrpages}\n";
    } else {
        $print .= "page {$page}/{$nbrpages}\n";
    }
    // next
    if ($suivante <= $nbrpages) {
        $print .= "<img src='" . get_url_icon('next.gif') . "' alt='next' border='0' title='" . $msg["next_page"] . "' onclick=\"document.getElementById('page').value={$suivante};{$action}\">\n";
    } else {
        $print .= "<img src='" . get_url_icon('next-grey.gif') . "' alt='next'>\n";
    }
    // last
    if ($page != $nbrpages) {
        $print .= "<img src='" . get_url_icon('last.gif') . "' alt='last' border='0' title='" . $msg["last_page"] . "' onclick=\"document.getElementById('page').value={$nbrpages};{$action}\">\n";
    } else {
        $print .= "<img src='" . get_url_icon('last-grey.gif') . "' alt='last'>\n";
    }
    $print .= "</form>\n";
    $print .= "</div>\n";
    return $print;
}
예제 #27
0
 function get_onglet($onglet_sel = '1_1')
 {
     global $dbh, $msg, $charset, $base_path;
     global $a2z_perio_display, $onglet_a2z, $a2z_perio, $a2z_tpl_ajax;
     global $filtre_select;
     $myArray = explode("_", $onglet_sel);
     $onglet_sel = $myArray[0];
     $ongletSub_sel = $myArray[1];
     $form = $a2z_tpl_ajax;
     $form_list = "";
     if (count($this->onglets_sub_contens[$onglet_sel])) {
         foreach ($this->onglets_sub_contens[$onglet_sel] as $onglet_num => $onglet) {
             if ($onglet_num == $ongletSub_sel) {
                 // onglet actif
                 $line = str_replace('!!onglet_class!!', "isbd_public_active", $line);
                 // liste des périodiques
                 $perio_list = "";
                 $view = 0;
                 $perio_id_list = "";
                 if (is_array($onglet["id"])) {
                     //tri de la liste par titre
                     $serials_ids = implode(",", $onglet["id"]);
                     foreach ($onglet["id"] as $id_brute) {
                         if (pmb_substr($id_brute, 0, 2) == "es") {
                             //notice externe
                             if ($filtre_select != 2) {
                                 // si cataloguée, on ne l'affiche pas. sauf si on filtre par fonds externe ($filtre_select!=2)
                                 if ($this->get_doublon_ex($this->extract_external_id($id_brute))) {
                                     continue;
                                 }
                             }
                             $requete = "SELECT source_id FROM external_count WHERE rid=" . addslashes($this->extract_external_id($id_brute));
                             $myQuery = pmb_mysql_query($requete, $dbh);
                             $source_id = pmb_mysql_result($myQuery, 0, 0);
                             $query = "select ufield,value from entrepot_source_{$source_id} where recid='" . addslashes($this->extract_external_id($id_brute)) . "' and ((ufield='200' and usubfield='a') or (ufield='461' and usubfield='t') or (ufield='bl') or (ufield='hl')) ";
                             $result = pmb_mysql_query($query, $dbh);
                             if ($result) {
                                 while ($row = pmb_mysql_fetch_object($result)) {
                                     $infos[$row->ufield] = $row->value;
                                 }
                                 switch ($infos['bl'] . $infos['hl']) {
                                     case "a2":
                                     case "s2":
                                         $tit1 = $infos['461'];
                                         break;
                                     default:
                                         $tit1 = $infos['200'];
                                         break;
                                 }
                                 $perio = $a2z_perio;
                                 $perio = str_replace('!!id!!', $id_brute, $perio);
                                 $perio = str_replace('!!perio_title!!', $tit1, $perio);
                                 $perio = str_replace('!!abt_actif!!', $this->get_external_icon($id_brute), $perio);
                                 $perio_list .= $perio;
                                 if (!$view) {
                                     $view++;
                                     $form = str_replace('!!perio_display!!', $this->get_perio($id_brute), $form);
                                 }
                             }
                         } else {
                             $query = "select notice_id,tit1 from notices where notice_id ={$id_brute}";
                             //print $query."<br>";
                             $result = pmb_mysql_query($query, $dbh);
                             if ($result) {
                                 if ($notice = pmb_mysql_fetch_object($result)) {
                                     $perio = $a2z_perio;
                                     $perio = str_replace('!!id!!', $notice->notice_id, $perio);
                                     $perio = str_replace('!!perio_title!!', $notice->tit1, $perio);
                                     $req = "select abt_id from abts_abts  where num_notice=" . $notice->notice_id . " and date_fin >= CURDATE() ";
                                     $res = pmb_mysql_query($req);
                                     if (pmb_mysql_num_rows($res)) {
                                         $perio = str_replace('!!abt_actif!!', "<img src='" . get_url_icon('check.png') . "'>", $perio);
                                     } else {
                                         $perio = str_replace('!!abt_actif!!', "", $perio);
                                     }
                                     $perio_list .= $perio;
                                     if (!$view) {
                                         $view++;
                                         $form = str_replace('!!perio_display!!', $this->get_perio($notice->notice_id), $form);
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             $form_list .= $line;
         }
     } else {
         $perio_list = $msg["a2z_abt_actif_filter_no_result"];
         $form = str_replace('!!perio_display!!', "", $form);
     }
     $form = str_replace('!!perio_id_list!!', $perio_id_list, $form);
     $form = str_replace('!!a2z_perio_list!!', $perio_list, $form);
     return $form;
 }
예제 #28
0
파일: sort.class.php 프로젝트: hogsim/PMB
 /**
  * affiche un selecteur des tris disponibles
  */
 static function show_tris_selector()
 {
     global $msg, $opac_default_sort_list;
     $sortArray = explode(" ", $opac_default_sort_list);
     //Mode Ajax
     if ($sortArray[0] == 0) {
         $tris_selector = "<span class=\"espaceResultSearch\">&nbsp;</span><script type='text/javascript' src='./includes/javascript/select.js'></script>\n\t\t\t\t\t\t<script>\n\t\t\t\t\t\t\tvar ajax_get_sort=new http_request();\n\t\t\t\n\t\t\t\t\t\t\tfunction get_sort_content(del_sort, ids) {\n\t\t\t\t\t\t\t\tvar url = './ajax.php?module=ajax&categ=sort&sub=get_sort&raz_sort='+(typeof(del_sort) != 'undefined' ? del_sort : '')+'&suppr_ids='+(typeof(ids) != 'undefined' ? ids : '')+'&page_en_cours=!!page_en_cours!!';\n\t\t\t\t\t\t\t\t  ajax_get_sort.request(url,0,'',1,show_sort_content,0,0);\n\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\tfunction show_sort_content(response) {\n\t\t\t\t\t\t\t\tdocument.getElementById('frame_notice_preview').innerHTML=ajax_get_sort.get_text();\n\t\t\t\t\t\t\t\tvar tags = document.getElementById('frame_notice_preview').getElementsByTagName('script');\n\t\t\t\t\t       \t\tfor(var i=0;i<tags.length;i++){\n\t\t\t\t\t\t\t\t\twindow.eval(tags[i].text);\n\t\t\t\t\t        \t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfunction kill_sort_frame() {\n\t\t\t\t\t\t\t\tvar sort_view=document.getElementById('frame_notice_preview');\n\t\t\t\t\t\t\t\tif (sort_view)\n\t\t\t\t\t\t\t\t\tsort_view.parentNode.removeChild(sort_view);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</script>\n\t\t\t\t\t\t<span class=\"triSelector\"><a onClick='show_layer(); get_sort_content();' alt=\"" . $msg['tris_dispos'] . "\" title=\"" . $msg['tris_dispos'] . "\" style='cursor : pointer;'><img src='" . get_url_icon('orderby_az.gif') . "' align='bottom' hspace='3' border='0' id='sort_icon'></a></span>";
     } elseif ($sortArray[0] == 1) {
         global $sort;
         if (!isset($sort)) {
             $sort = $_SESSION["last_sortnotices"];
         }
         if ($sort != "") {
             $sel_sort = $sort;
         } else {
             $sel_sort = -1;
         }
         // creation du tableau de la liste des tris enregistrés
         $tris_selector = "<span class=\"espaceResultSearch\">&nbsp;</span><span class=\"triSelector\"><select name='tri_selector' id='tri_selector' onChange='applySort(this.options[this.selectedIndex].value)'>";
         //affichage des enregistrements de tris possibles
         $sort = new sort('notices', 'session');
         $sort->dSort->initParcoursTris($sort);
         $tris_selector .= "<option value=''>" . $sort->descriptionTriParId("default") . "</option>";
         while ($result = $sort->dSort->parcoursTriSuivant()) {
             $tris_selector .= "<option value='" . $result['id_tri'] . "' " . ($sel_sort == $result['id_tri'] ? "selected='selected'" : "") . ">";
             $tris_selector .= $result['nom_tri'];
             //$tris_selector .= addslashes($result['nom_tri']);
             $tris_selector .= "</option>";
         }
         $tris_selector .= "<option value='custom'>" . $msg['tris_dispos'] . "</option>";
         $tris_selector .= "</select></span>\n\t\t\t<script>\n\t\t\tfunction applySort(value){\n\t\t\t\tif (value=='custom') {\n\t\t\t\t\tmaPage='index.php?lvl=sort&page_en_cours=!!page_en_cours!!';\n\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tmaPage='index.php?!!page_en_cours1!!&get_last_query=1&sort='+value;\n\t\t\t\t}\n\t\t\t\tdocument.location = maPage;\n\t\t\t}\n\t\t\t</script><span class=\"espaceResultSearch\">&nbsp;</span>";
     } else {
         $tris_selector = "<span class=\"espaceResultSearch\">&nbsp;</span><span class=\"triSelector\"><a href='index.php?lvl=sort&page_en_cours=!!page_en_cours!!' alt=\"" . $msg['tris_dispos'] . "\" title=\"" . $msg['tris_dispos'] . "\"><img src='" . get_url_icon('orderby_az.gif') . "' align='bottom' hspace='3' border='0' id='sort_icon'></a></span>";
     }
     return $tris_selector;
 }
예제 #29
0
 function get_primaldatafrom($obj)
 {
     global $charset;
     $this->id = $obj->collection_id;
     $this->name = $obj->collection_name;
     $this->parent = $obj->collection_parent;
     $this->issn = $obj->collection_issn;
     $this->collection_web = $obj->collection_web;
     $this->comment = $obj->collection_comment;
     if ($obj->collection_web) {
         $this->collection_web_link = " <a href='{$obj->collection_web}' target=_blank title='" . htmlentities($obj->collection_web, ENT_QUOTES, $charset) . "' alt='" . htmlentities($obj->collection_web, ENT_QUOTES, $charset) . "' type='external_url_autor' ><img src='" . get_url_icon("globe.gif") . "' border=0 /></a>";
     } else {
         $this->collection_web_link = "";
     }
 }
예제 #30
0
    /**
     * Retourne les infos de documents numériques associés à la notice
     * @return array
     */
    public function get_explnums_datas()
    {
        if (!isset($this->explnums_datas)) {
            global $dbh;
            global $charset;
            global $opac_url_base;
            global $opac_visionneuse_allow;
            global $opac_photo_filtre_mimetype;
            global $opac_explnum_order;
            global $opac_show_links_invisible_docnums;
            global $gestion_acces_active, $gestion_acces_empr_notice, $gestion_acces_empr_docnum;
            $this->explnums_datas = array('nb_explnums' => 0, 'explnums' => array(), 'visionneuse_script' => '
								<script type="text/javascript">
									if(typeof(sendToVisionneuse) == "undefined"){
										var sendToVisionneuse = function (explnum_id){
											document.getElementById("visionneuseIframe").src = "visionneuse.php?"+(typeof(explnum_id) != "undefined" ? "explnum_id="+explnum_id : "");
										}
									}
								</script>');
            global $_mimetypes_bymimetype_, $_mimetypes_byext_;
            if (!count($_mimetypes_bymimetype_)) {
                create_tableau_mimetype();
            }
            $this->get_bul_info();
            // récupération du nombre d'exemplaires
            $query = "SELECT explnum_id, explnum_notice, explnum_bulletin, explnum_nom, explnum_mimetype, explnum_url, explnum_vignette, explnum_nomfichier, explnum_extfichier, explnum_docnum_statut FROM explnum WHERE ";
            if ($this->get_niveau_biblio() != 'b') {
                $query .= "explnum_notice='" . $this->id . "' ";
            } else {
                $query .= "explnum_bulletin='" . $this->parent['bulletin_id'] . "' or explnum_notice='" . $this->id . "' ";
            }
            $query .= "union SELECT explnum_id, explnum_notice, explnum_bulletin, explnum_nom, explnum_mimetype, explnum_url, explnum_vignette, explnum_nomfichier, explnum_extfichier, explnum_docnum_statut\n\t\t\tFROM explnum, bulletins\n\t\t\tWHERE bulletin_id = explnum_bulletin\n\t\t\tAND bulletins.num_notice='" . $this->id . "'";
            if ($opac_explnum_order) {
                $query .= " order by " . $opac_explnum_order;
            } else {
                $query .= " order by explnum_mimetype, explnum_nom, explnum_id ";
            }
            $res = pmb_mysql_query($query, $dbh);
            $nb_explnums = pmb_mysql_num_rows($res);
            $docnum_visible = true;
            if ($gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) {
                $docnum_visible = $this->dom_2->getRights($_SESSION['id_empr_session'], $this->id, 16);
            } else {
                $query = "SELECT explnum_visible_opac, explnum_visible_opac_abon FROM notices, notice_statut WHERE notice_id ='" . $this->id . "' and id_notice_statut=statut ";
                $result = pmb_mysql_query($query, $dbh);
                if ($result && pmb_mysql_num_rows($result)) {
                    $statut_temp = pmb_mysql_fetch_object($result);
                    if (!$statut_temp->explnum_visible_opac) {
                        $docnum_visible = false;
                    }
                    if ($statut_temp->explnum_visible_opac_abon && !$_SESSION['id_empr_session']) {
                        $docnum_visible = false;
                    }
                } else {
                    $docnum_visible = false;
                }
            }
            if ($nb_explnums && ($docnum_visible || $opac_show_links_invisible_docnums)) {
                // on récupère les données des exemplaires
                global $search_terms;
                while ($expl = pmb_mysql_fetch_object($res)) {
                    // couleur de l'img en fonction du statut
                    if ($expl->explnum_docnum_statut) {
                        $rqt_st = "SELECT * FROM explnum_statut WHERE  id_explnum_statut='" . $expl->explnum_docnum_statut . "' ";
                        $Query_statut = pmb_mysql_query($rqt_st, $dbh) or die($rqt_st . " " . pmb_mysql_error());
                        $r_statut = pmb_mysql_fetch_object($Query_statut);
                        $explnum_class = 'docnum_' . $r_statut->class_html;
                        if ($expl->explnum_docnum_statut > 1) {
                            $explnum_opac_label = $r_statut->opac_libelle;
                        } else {
                            $explnum_opac_label = '';
                        }
                    } else {
                        $explnum_class = 'docnum_statutnot1';
                        $explnum_opac_label = '';
                    }
                    $explnum_docnum_visible = true;
                    $explnum_docnum_consult = true;
                    if ($gestion_acces_active == 1 && $gestion_acces_empr_docnum == 1) {
                        $explnum_docnum_visible = $this->dom_3->getRights($_SESSION['id_empr_session'], $expl->explnum_id, 16);
                        $explnum_docnum_consult = $this->dom_3->getRights($_SESSION['id_empr_session'], $expl->explnum_id, 4);
                    } else {
                        $requete = "SELECT explnum_visible_opac, explnum_visible_opac_abon, explnum_consult_opac, explnum_consult_opac_abon FROM explnum, explnum_statut WHERE explnum_id ='" . $expl->explnum_id . "' and id_explnum_statut=explnum_docnum_statut ";
                        $myQuery = pmb_mysql_query($requete, $dbh);
                        if (pmb_mysql_num_rows($myQuery)) {
                            $statut_temp = pmb_mysql_fetch_object($myQuery);
                            if (!$statut_temp->explnum_visible_opac) {
                                $explnum_docnum_visible = false;
                            }
                            if (!$statut_temp->explnum_consult_opac) {
                                $explnum_docnum_consult = false;
                            }
                            if ($statut_temp->explnum_visible_opac_abon && !$_SESSION['id_empr_session']) {
                                $explnum_docnum_visible = false;
                            }
                            if ($statut_temp->explnum_consult_opac_abon && !$_SESSION['id_empr_session']) {
                                $explnum_docnum_consult = false;
                            }
                        } else {
                            $explnum_docnum_visible = false;
                        }
                    }
                    if ($explnum_docnum_visible || $opac_show_links_invisible_docnums) {
                        $this->explnums_datas['nb_explnums']++;
                        $explnum_datas = array('id' => $expl->explnum_id, 'name' => $expl->explnum_nom, 'mimetype' => $expl->explnum_mimetype, 'url' => $expl->explnum_url, 'filename' => $expl->explnum_nomfichier, 'extension' => $expl->explnum_extfichier, 'statut' => $expl->explnum_docnum_statut, 'consultation' => $explnum_docnum_consult);
                        if ($expl->explnum_vignette) {
                            $explnum_datas['thumbnail_url'] = $opac_url_base . 'vig_num.php?explnum_id=' . $expl->explnum_id;
                        } else {
                            // trouver l'icone correspondant au mime_type
                            $explnum_datas['thumbnail_url'] = get_url_icon('mimetype/' . icone_mimetype($expl->explnum_mimetype, $expl->explnum_extfichier), 1);
                        }
                        $words_to_find = "";
                        if ($expl->explnum_mimetype == 'application/pdf' || $expl->explnum_mimetype == 'URL' && strpos($expl->explnum_nom, '.pdf') !== false) {
                            if (is_array($search_terms)) {
                                $words_to_find = "#search=\"" . trim(str_replace('*', '', implode(' ', $search_terms))) . "\"";
                            }
                        }
                        $explnum_datas['access_datas'] = array('script' => '', 'href' => '#', 'onclick' => '');
                        //si l'affichage du lien vers les documents numériques est forcé et qu'on est pas connecté, on propose l'invite de connexion!
                        if (!$explnum_docnum_visible && $opac_show_links_invisible_docnums && !$_SESSION['id_empr_session']) {
                            if ($opac_visionneuse_allow) {
                                $allowed_mimetype = explode(",", str_replace("'", "", $opac_photo_filtre_mimetype));
                            }
                            if ($allowed_mimetype && in_array($expl->explnum_mimetype, $allowed_mimetype)) {
                                $explnum_datas['access_datas']['script'] = "\n\t\t\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\t\t\tfunction sendToVisionneuse_" . $expl->explnum_id . "(){\n\t\t\t\t\t\t\t\t\t\topen_visionneuse(sendToVisionneuse," . $expl->explnum_id . ");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</script>";
                                $explnum_datas['access_datas']['onclick'] = "auth_popup('./ajax.php?module=ajax&categ=auth&callback_func=sendToVisionneuse_" . $expl->explnum_id . "');";
                            } else {
                                $explnum_datas['access_datas']['onclick'] = "auth_popup('./ajax.php?module=ajax&categ=auth&new_tab=1&callback_url=" . rawurlencode($opac_url_base . "doc_num.php?explnum_id=" . $expl->explnum_id) . "')";
                            }
                        } else {
                            if ($opac_visionneuse_allow) {
                                $allowed_mimetype = explode(",", str_replace("'", "", $opac_photo_filtre_mimetype));
                            }
                            if ($allowed_mimetype && in_array($expl->explnum_mimetype, $allowed_mimetype)) {
                                $explnum_datas['access_datas']['onclick'] = "open_visionneuse(sendToVisionneuse," . $expl->explnum_id . ");return false;";
                            } else {
                                $explnum_datas['access_datas']['href'] = $opac_url_base . 'doc_num.php?explnum_id=' . $expl->explnum_id;
                            }
                        }
                        if ($_mimetypes_byext_[$expl->explnum_extfichier]["label"]) {
                            $explnum_datas['mimetype_label'] = $_mimetypes_byext_[$expl->explnum_extfichier]["label"];
                        } elseif ($_mimetypes_bymimetype_[$expl->explnum_mimetype]["label"]) {
                            $explnum_datas['mimetype_label'] = $_mimetypes_bymimetype_[$expl->explnum_mimetype]["label"];
                        } else {
                            $explnum_datas['mimetype_label'] = $expl->explnum_mimetype;
                        }
                        $this->explnums_datas['explnums'][] = $explnum_datas;
                    }
                }
            }
        }
        return $this->explnums_datas;
    }