コード例 #1
0
         $depouill .= "<a href=\"cart_info.php?id=" . $id . "&lvl=analysis&header=" . rawurlencode(strip_tags($notice_header)) . "\" target=\"cart_info\" class=\"img_basket\">" . $msg["cart_add_result_in"] . "</a>";
     }
     $depouill .= "<blockquote>";
     while ($obj = mysql_fetch_array($res)) {
         $depouill .= pmb_bidi(aff_notice($obj["analysis_notice"]));
     }
     $depouill .= "</blockquote>";
 } else {
     $depouill = $msg["no_analysis"];
 }
 mysql_free_result($res);
 print $res_print;
 print $depouill;
 if ($expl_visible) {
     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 = mysql_result(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;
コード例 #2
0
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;
}
コード例 #3
0
 function aff_resa_expl()
 {
     global $opac_resa;
     global $opac_max_resa;
     global $opac_show_exemplaires, $opac_url_base;
     global $msg, $charset;
     global $dbh;
     global $popup_resa;
     global $opac_resa_popup;
     // la resa se fait-elle par popup ?
     global $allow_book;
     // afin d'eviter de recalculer un truc deja calcule...
     if ($this->affichage_resa_expl) {
         return $this->affichage_resa_expl;
     }
     if (is_null($this->dom) && $opac_show_exemplaires && $this->visu_expl && (!$this->visu_expl_abon || $this->visu_expl_abon && $_SESSION["user_code"]) || $this->rights & 8) {
         $resa_check = check_statut($this->notice_id, 0);
         // vérification si exemplaire réservable
         if ($resa_check) {
             // deplace dans le IF, si pas visible : pas de bouton resa
             $requete_resa = "SELECT count(1) FROM resa WHERE resa_idnotice='{$this->notice_id}'";
             $nb_resa_encours = mysql_result(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 ($this->notice->niveau_biblio == "m" && ($_SESSION["user_code"] && $allow_book) && $opac_resa && !$popup_resa) {
                 //$ret .= "<h3>".$msg["bulletin_display_resa"]."</h3>";
                 if ($opac_max_resa == 0 || $opac_max_resa > $nb_resa_encours) {
                     if ($opac_resa_popup) {
                         $ret .= "<a href='#' onClick=\"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;\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                     } else {
                         $ret .= "<a href='./do_resa.php?lvl=resa&id_notice=" . $this->notice_id . "&oresa=popup' id='bt_resa'>" . $msg["bulletin_display_place_resa"] . "</a>";
                     }
                     $ret .= $message_nbresa;
                 } else {
                     $ret .= str_replace("!!nb_max_resa!!", $opac_max_resa, $msg["resa_nb_max_resa"]);
                 }
                 $ret .= "<br />";
             } elseif ($this->notice->niveau_biblio == "m" && !$_SESSION["user_code"] && $opac_resa && !$popup_resa) {
                 // utilisateur pas connecte				// preparation lien reservation sans etre connecte				//$ret .= "<h3>".$msg["bulletin_display_resa"]."</h3>";
                 //if ($opac_resa_popup) $ret .= "<a href='#' onClick=\"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;\" id=\"bt_resa\">".$msg["bulletin_display_place_resa"]."</a>" ;
                 //	else $ret .= "<a href='./do_resa.php?lvl=resa&id_notice=".$this->notice_id."&oresa=popup' id='bt_resa'>".$msg["bulletin_display_place_resa"]."</a>" ;
                 $ret .= $message_nbresa;
             }
         }
         $temp = $this->expl_list($this->notice->niveau_biblio, $this->notice->notice_id);
         $ret .= $temp;
         $this->affichage_expl = $temp;
     }
     if ($this->notice->typdoc != "k") {
         if (is_null($this->dom) && $this->visu_explnum && (!$this->visu_explnum_abon || $this->visu_explnum_abon && $_SESSION["user_code"]) || $this->rights & 16) {
             if ($explnum = show_explnum_per_notice($this->notice_id, 0, '')) {
                 $ret .= "<img class='img_plus' src=\"./getgif.php?nomgif=plus\" name=\"imEx\" id=\"el_docnum_" . $this->notice_id . "Img\" title=\"" . $msg["expandable_notice"] . "\" border=\"0\" onClick=\"expandBase('el_docnum_" . $this->notice_id . "', true); return false;\" hspace=\"3\">\n\t    \t\t      <b>" . htmlentities($msg['expl num'], ENT_QUOTES, $charset) . "</b>\t\t\n\t        \t\t  <div id=\"el_docnum_" . $this->notice_id . "Child\" class=\"child\" style=\"margin-bottom:6px;display:none;\">";
                 $ret .= $explnum;
                 $ret .= "</div>";
                 $this->affichage_expl .= "<h3>{$msg['explnum']}</h3>" . $explnum;
             }
         }
         $this->affichage_resa_expl = $ret;
     }
     return $ret;
 }
コード例 #4
0
ファイル: record_datas.class.php プロジェクト: hogsim/PMB
 /**
  * Retourne les informations de réservation
  * @return array $this->resas_datas = array('nb_resas', 'href', 'onclick', 'flag_max_resa', 'flag_resa_visible')
  */
 public function get_resas_datas()
 {
     if (!isset($this->resas_datas)) {
         global $dbh, $msg;
         global $opac_resa;
         global $opac_max_resa;
         global $opac_show_exemplaires;
         global $popup_resa;
         global $opac_resa_popup;
         // la résa se fait-elle par popup ?
         global $opac_resa_planning;
         // la résa est elle planifiée
         global $allow_book;
         global $opac_show_exemplaires_analysis;
         $this->resas_datas = array('nb_resas' => 0, 'href' => "#", 'onclick' => "", 'flag_max_resa' => false, 'flag_resa_visible' => true, 'flag_resa_possible' => true);
         $bul_info = $this->get_bul_info();
         $bulletin_id = $bul_info['bulletin_id'];
         if ($bulletin_id) {
             $requete_resa = "SELECT count(1) FROM resa WHERE resa_idbulletin='{$bulletin_id}' ";
         } else {
             $requete_resa = "SELECT count(1) FROM resa WHERE resa_idnotice='{$this->id}' ";
         }
         $this->resas_datas['nb_resas'] = pmb_mysql_result(pmb_mysql_query($requete_resa, $dbh), 0, 0);
         if (is_null($this->dom_2) && $opac_show_exemplaires && $this->is_visu_expl() && (!$this->is_visu_expl_abon() || $this->is_visu_expl_abon() && $_SESSION["user_code"]) || $this->get_rights() & 8) {
             if (!$opac_resa_planning) {
                 if ($bulletin_id) {
                     $resa_check = check_statut(0, $bulletin_id);
                 } else {
                     $resa_check = check_statut($this->id, 0);
                 }
                 // vérification si exemplaire réservable
                 if ($resa_check) {
                     if (($this->get_niveau_biblio() == "m" || $this->get_niveau_biblio() == "b" || $this->get_niveau_biblio() == "a" && $opac_show_exemplaires_analysis) && ($_SESSION["user_code"] && $allow_book) && $opac_resa && !$popup_resa) {
                         if ($opac_max_resa == 0 || $opac_max_resa > $this->resas_datas['nb_resas']) {
                             if ($opac_resa_popup) {
                                 $this->resas_datas['onclick'] = "if(confirm('" . $msg["confirm_resa"] . "')){w=window.open('./do_resa.php?lvl=resa&id_notice=" . $this->id . "&id_bulletin=" . $bulletin_id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;}else return false;";
                             } else {
                                 $this->resas_datas['href'] = "./do_resa.php?lvl=resa&id_notice=" . $this->id . "&id_bulletin=" . $bulletin_id . "&oresa=popup";
                                 $this->resas_datas['onclick'] = "return confirm('" . $msg["confirm_resa"] . "')";
                             }
                         } else {
                             $this->resas_datas['flag_max_resa'] = true;
                         }
                     } elseif (($this->get_niveau_biblio() == "m" || $this->get_niveau_biblio() == "b" || $this->get_niveau_biblio() == "a" && $opac_show_exemplaires_analysis) && !$_SESSION["user_code"] && $opac_resa && !$popup_resa) {
                         // utilisateur pas connecté
                         // préparation lien réservation sans être connecté
                         if ($opac_resa_popup) {
                             $this->resas_datas['onclick'] = "if(confirm('" . $msg["confirm_resa"] . "')){w=window.open('./do_resa.php?lvl=resa&id_notice=" . $this->id . "&id_bulletin=" . $bulletin_id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;}else return false;";
                         } else {
                             $this->resas_datas['href'] = "./do_resa.php?lvl=resa&id_notice=" . $this->id . "&id_bulletin=" . $bulletin_id . "&oresa=popup";
                             $this->resas_datas['onclick'] = "return confirm('" . $msg["confirm_resa"] . "')";
                         }
                     }
                 } else {
                     $this->resas_datas['flag_resa_possible'] = false;
                 }
                 // fin if resa_check
             } else {
                 // planning de réservations
                 $this->resas_datas['nb_resas'] = resa_planning::count_resa($this->id);
                 if ($this->get_niveau_biblio() == "m" && ($_SESSION["user_code"] && $allow_book) && $opac_resa && !$popup_resa) {
                     if ($opac_max_resa == 0 || $opac_max_resa > $this->resas_datas['nb_resas']) {
                         if ($opac_resa_popup) {
                             $this->resas_datas['onclick'] = "w=window.open('./do_resa.php?lvl=resa_planning&id_notice=" . $this->id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;";
                         } else {
                             $this->resas_datas['href'] = "./do_resa.php?lvl=resa_planning&id_notice=" . $this->id . "&oresa=popup";
                         }
                     } else {
                         $this->resas_datas['flag_max_resa'] = true;
                     }
                 } elseif ($this->get_niveau_biblio() == "m" && !$_SESSION["user_code"] && $opac_resa && !$popup_resa) {
                     // utilisateur pas connecté
                     // préparation lien réservation sans être connecté
                     if ($opac_resa_popup) {
                         $this->resas_datas['onclick'] = "w=window.open('./do_resa.php?lvl=resa_planning&id_notice=" . $this->id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;";
                     } else {
                         $this->resas_datas['href'] = "./do_resa.php?lvl=resa_planning&id_notice=" . $this->id . "&oresa=popup";
                     }
                 }
             }
         } else {
             $this->resas_datas['flag_resa_visible'] = false;
         }
     }
     return $this->resas_datas;
 }
コード例 #5
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;
}
コード例 #6
0
 function aff_resa_expl()
 {
     global $opac_resa;
     global $opac_max_resa;
     global $opac_show_exemplaires;
     global $msg;
     global $dbh;
     global $popup_resa;
     global $opac_resa_popup;
     // la résa se fait-elle par popup ?
     global $opac_resa_planning;
     // la résa est elle planifiée
     global $allow_book;
     global $opac_show_exemplaires_analysis;
     // afin d'éviter de recalculer un truc déjà calculé...
     if ($this->affichage_resa_expl_flag) {
         return $this->affichage_resa_expl;
     }
     if (is_null($this->dom_2) && $opac_show_exemplaires && $this->visu_expl && (!$this->visu_expl_abon || $this->visu_expl_abon && $_SESSION["user_code"]) || $this->rights & 8) {
         if (!$opac_resa_planning) {
             if ($this->bulletin_id) {
                 $resa_check = check_statut(0, $this->bulletin_id);
             } else {
                 $resa_check = check_statut($this->notice_id, 0);
             }
             // vérification si exemplaire réservable
             if ($resa_check) {
                 // déplacé dans le IF, si pas visible : pas de bouton résa
                 if ($this->bulletin_id) {
                     $requete_resa = "SELECT count(1) FROM resa WHERE resa_idbulletin='{$this->bulletin_id}' ";
                 } else {
                     $requete_resa = "SELECT count(1) FROM resa WHERE resa_idnotice='{$this->notice_id}' ";
                 }
                 $nb_resa_encours = mysql_result(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 (($this->notice->niveau_biblio == "m" || $this->notice->niveau_biblio == "b" || $this->notice->niveau_biblio == "a" && $opac_show_exemplaires_analysis) && ($_SESSION["user_code"] && $allow_book) && $opac_resa && !$popup_resa) {
                     $ret .= "<h3>" . $msg["bulletin_display_resa"] . "</h3>";
                     if ($opac_max_resa == 0 || $opac_max_resa > $nb_resa_encours) {
                         if ($opac_resa_popup) {
                             $ret .= "<a href='#' onClick=\"if(confirm('" . $msg["confirm_resa"] . "')){w=window.open('./do_resa.php?lvl=resa&id_notice=" . $this->notice_id . "&id_bulletin=" . $this->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 .= "<a href='./do_resa.php?lvl=resa&id_notice=" . $this->notice_id . "&id_bulletin=" . $this->bulletin_id . "&oresa=popup' onClick=\"return confirm('" . $msg["confirm_resa"] . "')\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                         }
                         $ret .= $message_nbresa;
                     } else {
                         $ret .= str_replace("!!nb_max_resa!!", $opac_max_resa, $msg["resa_nb_max_resa"]);
                     }
                     $ret .= "<br />";
                 } elseif (($this->notice->niveau_biblio == "m" || $this->notice->niveau_biblio == "b" || $this->notice->niveau_biblio == "a" && $opac_show_exemplaires_analysis) && !$_SESSION["user_code"] && $opac_resa && !$popup_resa) {
                     // utilisateur pas connecté
                     // préparation lien réservation sans être connecté
                     $ret .= "<h3>" . $msg["bulletin_display_resa"] . "</h3>";
                     if ($opac_resa_popup) {
                         $ret .= "<a href='#' onClick=\"if(confirm('" . $msg["confirm_resa"] . "')){w=window.open('./do_resa.php?lvl=resa&id_notice=" . $this->notice_id . "&id_bulletin=" . $this->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 .= "<a href='./do_resa.php?lvl=resa&id_notice=" . $this->notice_id . "&id_bulletin=" . $this->bulletin_id . "&oresa=popup' onClick=\"return confirm('" . $msg["confirm_resa"] . "')\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                     }
                     $ret .= $message_nbresa;
                     $ret .= "<br />";
                 }
             }
             // fin if resa_check
             $temp = $this->expl_list($this->notice->niveau_biblio, $this->notice->notice_id, $this->bulletin_id);
             $ret .= $temp;
             $this->affichage_expl = $temp;
         } else {
             // planning de réservations
             $nb_resa_encours = resa_planning::countResa($this->notice_id);
             if ($nb_resa_encours) {
                 $message_nbresa = str_replace("!!nbresa!!", $nb_resa_encours, $msg["resa_nb_deja_resa"]);
             }
             if ($this->notice->niveau_biblio == "m" && ($_SESSION["user_code"] && $allow_book) && $opac_resa && !$popup_resa) {
                 $ret .= "<h3>" . $msg["bulletin_display_resa"] . "</h3>";
                 if ($opac_max_resa == 0 || $opac_max_resa > $nb_resa_encours) {
                     if ($opac_resa_popup) {
                         $ret .= "<a href='#' onClick=\"w=window.open('./do_resa.php?lvl=resa_planning&id_notice=" . $this->notice_id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                     } else {
                         $ret .= "<a href='./do_resa.php?lvl=resa_planning&id_notice=" . $this->notice_id . "&oresa=popup' id='bt_resa'>" . $msg["bulletin_display_place_resa"] . "</a>";
                     }
                     $ret .= $message_nbresa;
                 } else {
                     $ret .= str_replace("!!nb_max_resa!!", $opac_max_resa, $msg["resa_nb_max_resa"]);
                 }
                 $ret .= "<br />";
             } elseif ($this->notice->niveau_biblio == "m" && !$_SESSION["user_code"] && $opac_resa && !$popup_resa) {
                 // utilisateur pas connecté
                 // préparation lien réservation sans être connecté
                 $ret .= "<h3>" . $msg["bulletin_display_resa"] . "</h3>";
                 if ($opac_resa_popup) {
                     $ret .= "<a href='#' onClick=\"w=window.open('./do_resa.php?lvl=resa_planning&id_notice=" . $this->notice_id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                 } else {
                     $ret .= "<a href='./do_resa.php?lvl=resa_planning&id_notice=" . $this->notice_id . "&oresa=popup' id='bt_resa'>" . $msg["bulletin_display_place_resa"] . "</a>";
                 }
                 $ret .= $message_nbresa;
                 $ret .= "<br />";
             }
             $temp = $this->expl_list($this->notice->niveau_biblio, $this->notice->notice_id, $this->bulletin_id);
             $ret .= $temp;
             $this->affichage_expl = $temp;
         }
     }
     //affichage exemplaires numeriques
     if ($this->docnum_allowed) {
         $ret .= $this->aff_explnum();
     }
     if ($autres_lectures = $this->autres_lectures($this->notice_id, $this->bulletin_id)) {
         $ret .= $autres_lectures;
     }
     $this->affichage_resa_expl = $ret;
     $this->affichage_resa_expl_flag = 1;
     return $ret;
 }
コード例 #7
0
 function aff_resa_expl()
 {
     global $opac_resa;
     global $opac_max_resa;
     global $opac_show_exemplaires;
     global $msg;
     global $dbh;
     global $popup_resa;
     global $opac_resa_popup;
     // la résa se fait-elle par popup ?
     global $allow_book;
     // afin d'éviter de recalculer un truc déjà calculé...
     if ($this->affichage_resa_expl) {
         return $this->affichage_resa_expl;
     }
     if (is_null($this->dom) && $opac_show_exemplaires && $this->visu_expl && (!$this->visu_expl_abon || $this->visu_expl_abon && $_SESSION["user_code"]) || $this->rights & 8) {
         $resa_check = check_statut($this->notice_id, 0);
         // vérification si exemplaire réservable
         if ($resa_check) {
             // déplacé dans le IF, si pas visible : pas de bouton résa
             $requete_resa = "SELECT count(1) FROM resa WHERE resa_idnotice='{$this->notice_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 ($this->notice->niveau_biblio == "m" && ($_SESSION["user_code"] && $allow_book) && $opac_resa && !$popup_resa) {
                 $ret .= "<h3>" . $msg["bulletin_display_resa"] . "</h3>";
                 if ($opac_max_resa == 0 || $opac_max_resa > $nb_resa_encours) {
                     if ($opac_resa_popup) {
                         $ret .= "<a href='#' onClick=\"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;\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                     } else {
                         $ret .= "<a href='./do_resa.php?lvl=resa&id_notice=" . $this->notice_id . "&oresa=popup' id='bt_resa'>" . $msg["bulletin_display_place_resa"] . "</a>";
                     }
                     $ret .= $message_nbresa;
                 } else {
                     $ret .= str_replace("!!nb_max_resa!!", $opac_max_resa, $msg["resa_nb_max_resa"]);
                 }
                 $ret .= "<br />";
             } elseif ($this->notice->niveau_biblio == "m" && !$_SESSION["user_code"] && $opac_resa && !$popup_resa) {
                 // utilisateur pas connecté
                 // préparation lien réservation sans être connecté
                 $ret .= "<h3>" . $msg["bulletin_display_resa"] . "</h3>";
                 if ($opac_resa_popup) {
                     $ret .= "<a href='#' onClick=\"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;\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                 } else {
                     $ret .= "<a href='./do_resa.php?lvl=resa&id_notice=" . $this->notice_id . "&oresa=popup' id='bt_resa'>" . $msg["bulletin_display_place_resa"] . "</a>";
                 }
                 $ret .= $message_nbresa;
                 $ret .= "<br />";
             }
         }
         $temp = $this->expl_list($this->notice->niveau_biblio, $this->notice->notice_id);
         $ret .= $temp;
         $this->affichage_expl = $temp;
     }
     if ($this->visu_explnum && (!$this->visu_explnum_abon || $this->visu_explnum_abon && $_SESSION["user_code"])) {
         if ($explnum = show_explnum_per_notice($this->notice_id, 0, '')) {
             $ret .= "<h3>{$msg['explnum']}</h3>" . $explnum;
             $this->affichage_expl .= "<h3>{$msg['explnum']}</h3>" . $explnum;
         }
     }
     $this->affichage_resa_expl = $ret;
     return $ret;
 }
コード例 #8
0
ファイル: resa.inc.php プロジェクト: hogsim/PMB
 $nb_resa_encours = pmb_mysql_result(pmb_mysql_query($requete_resa, $dbh), 0, 0);
 if ($opac_max_resa && $nb_resa_encours >= $opac_max_resa) {
     $id_notice = 0;
     $id_bulletin = 0;
 }
 if ($id_notice || $id_bulletin) {
     // c'est une pose de résa
     if ($id_notice) {
         $opac_notices_depliable = 0;
         $liens_opac = array();
         $ouvrage_resa = aff_notice($id_notice, 1);
     } else {
         $ouvrage_resa = bulletin_affichage_reduit($id_bulletin, 1);
     }
     $message_resa = "";
     $resa_check = check_statut($id_notice, $id_bulletin);
     $already = allready_loaned($id_notice, $id_bulletin, $_SESSION["id_empr_session"]);
     if ($resa_check == 1 && !$already) {
         // document sélectionné -> création de la réservation
         $res_resa_OK = check_quota_resa($_SESSION["id_empr_session"], $id_notice, $id_bulletin);
         if ($res_resa_OK['ERROR']) {
             $message_resa = $msg["resa_failed"] . " : " . $res_resa_OK['MESSAGE'];
         } else {
             $id_resa_ajoutee = 0;
             $requete2 = "SELECT COUNT(1) FROM resa WHERE resa_idempr=" . $_SESSION["id_empr_session"] . " AND resa_idnotice='" . $id_notice . "' and resa_idbulletin='" . $id_bulletin . "' ";
             $result2 = @pmb_mysql_query($requete2, $dbh);
             $nb = pmb_mysql_result($result2, 0, 0);
             if ($nb) {
                 // on ne peut pas réserver deux fois un même ouvrage
                 $message_resa = $msg["resa_doc_deja_reserve"] . " ";
             } else {