protected function add_linked_record($notice_id, $bulletin_id, $comment = '')
 {
     if ($notice_id) {
         $display = aff_notice($notice_id, 0, 1, 0, AFF_ETA_NOTICES_REDUIT);
     } else {
         $display = bulletin_header($bulletin_id);
     }
     $this->linked_records[] = array('notice_id' => $notice_id, 'bulletin_id' => $bulletin_id, 'display' => $display, 'comment' => $comment);
 }
Example #2
0
function affiche_notice_navigopac($requete)
{
    global $page, $nbr_lignes, $id, $location, $dcote, $lcote, $nc, $main, $ssub, $plettreaut;
    global $opac_nb_aut_rec_per_page, $opac_section_notices_order, $msg, $dbh, $opac_notices_depliable, $begin_result_liste, $add_cart_link_spe, $base_path;
    global $back_surloc, $back_loc, $back_section_see;
    global $opac_perio_a2z_abc_search, $opac_perio_a2z_max_per_onglet;
    if (!$page) {
        $page = 1;
    }
    $debut = ($page - 1) * $opac_nb_aut_rec_per_page;
    //On controle paramètre de tri
    if (!trim($opac_section_notices_order)) {
        $opac_section_notices_order = "index_serie, tnvol, index_sew";
    }
    if ($plettreaut && $plettreaut != "vide") {
        $opac_section_notices_order = "index_author, " . $opac_section_notices_order;
    }
    $requete .= " ORDER BY " . $opac_section_notices_order . " LIMIT {$debut},{$opac_nb_aut_rec_per_page}";
    $res = @mysql_query($requete, $dbh);
    print $nbr_lignes . " " . $msg["results"] . "<br />";
    if ($opac_notices_depliable) {
        print $begin_result_liste;
    }
    if ($add_cart_link_spe) {
        print pmb_bidi(str_replace("!!spe!!", "&location={$location}&dcote={$dcote}&lcote={$lcote}&ssub={$ssub}&nc={$nc}&plettreaut={$plettreaut}", $add_cart_link_spe));
    }
    //affinage
    //enregistrement de l'endroit actuel dans la session
    $_SESSION["last_module_search"]["search_mod"] = "section_see";
    $_SESSION["last_module_search"]["search_id"] = $id;
    $_SESSION["last_module_search"]["search_location"] = $location;
    $_SESSION["last_module_search"]["search_page"] = $page;
    //affinage
    if ($dcote == "" && $plettreaut == "" && $nc == "") {
        print "&nbsp;&nbsp;<a href='{$base_path}/index.php?search_type_asked=extended_search&mode_aff=aff_module'>" . $msg["affiner_recherche"] . "</a>";
    }
    //fin affinage
    print "<blockquote>";
    print aff_notice(-1);
    while ($obj = mysql_fetch_object($res)) {
        print pmb_bidi(aff_notice($obj->notice_id));
    }
    print aff_notice(-2);
    print "</blockquote>";
    mysql_free_result($res);
    // constitution des liens
    $nbepages = ceil($nbr_lignes / $opac_nb_aut_rec_per_page);
    print '<div id="navbar"><hr /><center>' . printnavbar($page, $nbepages, './index.php?lvl=section_see&id=' . $id . '&location=' . $location . ($back_surloc ? '&back_surloc=' . urlencode($back_surloc) : '') . ($back_loc ? '&back_loc=' . urlencode($back_loc) : '') . ($back_section_see ? '&back_section_see=' . urlencode($back_section_see) : '') . '&page=!!page!!&nbr_lignes=' . $nbr_lignes . '&dcote=' . $dcote . '&lcote=' . $lcote . '&nc=' . $nc . '&main=' . $main . '&ssub=' . $ssub . '&plettreaut=' . $plettreaut) . '</center></div>';
}
 /**
  * Retourne l'affichage de la liste des notices indexées avec le concept
  * @param skos_concept $concept
  * @return string
  */
 public static function get_notices_indexed_with_concept($concept)
 {
     global $page;
     global $opac_nb_aut_rec_per_page, $opac_notices_depliable, $opac_allow_bannette_priv, $opac_nb_max_tri;
     global $allow_dsi_priv;
     global $begin_result_liste, $affich_tris_result_liste, $add_cart_link;
     global $include_path, $class_path, $base_path, $msg;
     global $opac_visionneuse_allow, $nbexplnum_to_photo, $link_to_visionneuse;
     global $opac_show_suggest, $opac_resa_popup;
     global $opac_allow_external_search;
     global $from;
     $indexed_notices = $concept->get_indexed_notices();
     if (!$page) {
         $page = 1;
     }
     $debut = ($page - 1) * $opac_nb_aut_rec_per_page;
     if ($nbr_lignes = count($indexed_notices)) {
         // pour la DSI
         if ($nbr_lignes && $opac_allow_bannette_priv && $allow_dsi_priv && ($_SESSION['abon_cree_bannette_priv'] == 1 || $opac_allow_bannette_priv == 2)) {
             print "<input type='button' class='bouton' name='dsi_priv' value=\"{$msg['dsi_bt_bannette_priv']}\" onClick=\"document.mc_values.action='./empr.php?lvl=bannette_creer'; document.mc_values.submit();\"><span class=\"espaceResultSearch\">&nbsp;</span>";
         }
         if ($opac_notices_depliable) {
             $content .= $begin_result_liste;
         }
         //gestion du tri
         if (isset($_GET["sort"])) {
             $_SESSION["last_sortnotices"] = $_GET["sort"];
         }
         if ($nbr_lignes > $opac_nb_max_tri) {
             $_SESSION["last_sortnotices"] = "";
             $content .= "<span class=\"espaceResultSearch\">&nbsp;</span>";
         } else {
             $pos = strpos($_SERVER['REQUEST_URI'], "?");
             $pos1 = strpos($_SERVER['REQUEST_URI'], "get");
             if ($pos1 == 0) {
                 $pos1 = strlen($_SERVER['REQUEST_URI']);
             } else {
                 $pos1 = $pos1 - 3;
             }
             $para = urlencode(substr($_SERVER['REQUEST_URI'], $pos + 1, $pos1 - $pos + 1));
             $para1 = substr($_SERVER['REQUEST_URI'], $pos + 1, $pos1 - $pos + 1);
             $affich_tris_result_liste = str_replace("!!page_en_cours!!", $para, $affich_tris_result_liste);
             $affich_tris_result_liste = str_replace("!!page_en_cours1!!", $para1, $affich_tris_result_liste);
             $content .= $affich_tris_result_liste;
             if ($_SESSION["last_sortnotices"] != "") {
                 require_once $class_path . "/sort.class.php";
                 $sort = new sort('notices', 'session');
                 $content .= "<span class='sort'>" . $msg['tri_par'] . " " . $sort->descriptionTriParId($_SESSION["last_sortnotices"]) . "<span class=\"espaceResultSearch\">&nbsp;</span></span>";
             }
         }
         //fin gestion du tri
         $content .= $add_cart_link;
         if ($opac_visionneuse_allow && $nbexplnum_to_photo) {
             $content .= "<span class=\"espaceResultSearch\">&nbsp;&nbsp;&nbsp;</span>" . $link_to_visionneuse;
             $sendToVisionneuseByGet = str_replace("!!mode!!", "concept_see", $sendToVisionneuseByGet);
             $sendToVisionneuseByGet = str_replace("!!idautorite!!", $concept->get_id(), $sendToVisionneuseByGet);
             $content .= $sendToVisionneuseByGet;
         }
         if ($opac_show_suggest) {
             $bt_sugg = "<span class=\"espaceResultSearch\">&nbsp;&nbsp;&nbsp;</span><span class=\"search_bt_sugg\"><a href=# ";
             if ($opac_resa_popup) {
                 $bt_sugg .= " onClick=\"w=window.open('./do_resa.php?lvl=make_sugg&oresa=popup','doresa','scrollbars=yes,width=600,height=600,menubar=0,resizable=yes'); w.focus(); return false;\"";
             } else {
                 $bt_sugg .= "onClick=\"document.location='./do_resa.php?lvl=make_sugg&oresa=popup' \" ";
             }
             $bt_sugg .= " title='" . $msg["empr_bt_make_sugg"] . "' >" . $msg['empr_bt_make_sugg'] . "</a></span>";
             $content .= $bt_sugg;
         }
         rec_last_authorities();
         //affinage
         if ($main) {
             // Gestion des alertes à partir de la recherche simple
             include_once $include_path . "/alert_see.inc.php";
             $content .= $alert_see_mc_values;
             //affichage
             $content .= "<span class=\"espaceResultSearch\">&nbsp;&nbsp;</span><span class=\"affiner_recherche\"><a href='" . $base_path . "/index.php?search_type_asked=extended_search&mode_aff=aff_module' title='" . $msg["affiner_recherche"] . "'>" . $msg["affiner_recherche"] . "</a></span>";
             //Etendre
             if ($opac_allow_external_search) {
                 $content .= "<span class=\"espaceResultSearch\">&nbsp;&nbsp;</span><span class=\"search_bt_external\"><a href='" . $base_path . "/index.php?search_type_asked=external_search&mode_aff=aff_module&external_type=simple' title='" . $msg["connecteurs_external_search_sources"] . "'>" . $msg["connecteurs_external_search_sources"] . "</a></span>";
             }
             //fin etendre
         } else {
             // Gestion des alertes à partir de la recherche simple
             include_once $include_path . "/alert_see.inc.php";
             $content .= $alert_see_mc_values;
             //affichage
             $content .= "<span class=\"espaceResultSearch\">&nbsp;&nbsp;</span><span class=\"affiner_recherche\"><a href='{$base_path}/index.php?search_type_asked=extended_search&mode_aff=aff_" . ($from == "search" ? "simple_search" : "module") . "' title='" . $msg["affiner_recherche"] . "'>" . $msg["affiner_recherche"] . "</a></span>";
             //Etendre
             if ($opac_allow_external_search) {
                 $content .= "<span class=\"espaceResultSearch\">&nbsp;&nbsp;</span><span class=\"search_bt_external\"><a href='{$base_path}/index.php?search_type_asked=external_search&mode_aff=aff_simple_search' title='" . $msg["connecteurs_external_search_sources"] . "'>" . $msg["connecteurs_external_search_sources"] . "</a></span>";
             }
             //fin etendre
         }
         //fin affinage
         foreach ($indexed_notices as $notice_id) {
             $content .= aff_notice($notice_id, 0, 1, 0, "", "", 0, 0, $recherche_ajax_mode);
         }
     }
     return $content;
 }
Example #4
0
            print "<strong>" . $msg['tous'] . $libelle . "</strong> " . $nb_result . " " . $msg['results'] . " ";
            print "<a href=\"javascript:document.forms['search_tous'].submit()\"> " . $msg['suite'] . "&nbsp;<img src=./images/search.gif border='0' align='absmiddle'/></a><br />";
        }
        if ($opac_show_results_first_page) {
            print "<div id='res_first_page'>\n";
            if ($opac_notices_depliable) {
                print $begin_result_liste;
            }
            $nb = 0;
            $recherche_ajax_mode = 0;
            $notices = array();
            $notices = $search_all_fields->get_sorted_result("default", 0, $opac_nb_results_first_page);
            for ($i = 0; $i < $opac_nb_results_first_page; $i++) {
                if ($i > 4) {
                    $recherche_ajax_mode = 1;
                }
                if ($i == count($notices)) {
                    break;
                }
                print pmb_bidi(aff_notice($notices[$i], 0, 1, 0, "", "", 0, 0, $recherche_ajax_mode));
            }
            print '</div>';
        }
        $form = "<div style=search_result>{$form}</div>";
        print $form;
    }
}
if ($nb_result) {
    $_SESSION["level1"]["tous"]["form"] = $form;
    $_SESSION["level1"]["tous"]["count"] = $nb_result;
}
Example #5
0
<?php

// +-------------------------------------------------+
// � 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: notice.inc.php,v 1.3 2015-04-13 13:56:32 vtouchard Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once "{$include_path}/notice_affichage.inc.php";
if ($id) {
    //droits d'acces utilisateur/notice (lecture)
    $display = '';
    $requete = "SELECT * FROM notices WHERE notice_id={$id} LIMIT 1";
    $resultat = pmb_mysql_query($requete, $dbh);
    if ($resultat) {
        if (pmb_mysql_num_rows($resultat)) {
            $notice = pmb_mysql_fetch_object($resultat);
            //Affichage d'une notice
            $opac_notices_depliable = 0;
            if ($popup_map) {
                $display .= aff_notice($id, 1, 1, 0, 2, "", 0, 1, 0, $show_map);
            } else {
                $display .= aff_notice($id, 1, 1, 0, 0, 0);
            }
        }
    }
    ajax_http_send_response($display);
}
 public function set_vedette_element_from_database()
 {
     $this->isbd = aff_notice($this->id, 0, 1, 0, AFF_ETA_NOTICES_REDUIT);
 }
function resa_planning($deb = TRUE)
{
    global $dbh, $msg, $charset;
    global $id_notice, $id_bulletin;
    global $liens_opac;
    global $form_resa_dates, $form_resa_ok;
    global $popup_resa, $opac_max_resa;
    global $resa_deb, $resa_fin;
    print "<h3><span>" . $msg['resa_resa_titre_add'] . "</span></h3>";
    if ($deb) {
        // test au cas où tentative de passer une résa hors URL de résa autorisée...
        $requete_resa = "SELECT count(1) FROM resa_planning WHERE resa_idnotice='{$id_notice}' and resa_idbulletin='{$id_bulletin}'";
        $result_resa = pmb_mysql_query($requete_resa, $dbh);
        if ($result_resa) {
            $nb_resa_encours = pmb_mysql_result($result_resa, 0, 0);
        } else {
            $nb_resa_encours = 0;
        }
        if ($opac_max_resa && $nb_resa_encours >= $opac_max_resa) {
            $id_notice = 0;
            $id_bulletin = 0;
        }
    }
    if (!$id_notice && !$id_bulletin) {
        return $msg['resa_planning_unknown_record'];
    }
    $tab_loc_retrait = resa_planning::get_available_locations($_SESSION['id_empr_session'], $id_notice, $id_bulletin);
    if (count($tab_loc_retrait) >= 1) {
        $form_loc_retrait = '<table ><tbody><tr><th>' . $msg['resa_planning_loc_retrait'] . '</th><th>' . $msg['resa_planning_qty_requested'] . '</th></tr>';
        foreach ($tab_loc_retrait as $k => $v) {
            $form_loc_retrait .= '<tr><td width="50%">' . htmlentities($v['location_libelle'], ENT_QUOTES, $charset) . '</td>';
            $form_loc_retrait .= '<td><select name="location[' . $v['location_id'] . ']">';
            for ($i = 0; $i < $v['location_nb'] * 1 + 1; $i++) {
                $form_loc_retrait .= '<option value=' . $i . '>' . $i . '</option>';
            }
            $form_loc_retrait .= '</select></td>';
            $form_loc_retrait .= '</tr>';
        }
        $form_loc_retrait .= '</tbody></table>';
    } else {
        return $msg['resa_planning_no_item_available'];
    }
    $form_resa_dates = str_replace('!!resa_loc_retrait!!', $form_loc_retrait, $form_resa_dates);
    print $form_resa_dates;
    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);
    }
    if (!$deb) {
        $form_resa_ok = str_replace('!!date_deb!!', formatdate($resa_deb), $form_resa_ok);
        $form_resa_ok = str_replace('!!date_fin!!', formatdate($resa_fin), $form_resa_ok);
        print $form_resa_ok;
    }
    print $ouvrage_resa;
    //Affichage des previsions sur le document courant par le lecteur courant
    $q3 = "SELECT id_resa, resa_idnotice, resa_idbulletin, resa_date_debut, resa_date_fin, ";
    $q3 .= "if(resa_date_fin < sysdate() or resa_date_fin='0000-00-00',1,0) as resa_perimee, resa_validee, resa_confirmee, ";
    $q3 .= "resa_qty, resa_loc_retrait, location_libelle ";
    $q3 .= "FROM resa_planning left join docs_location on resa_loc_retrait=idlocation ";
    $q3 .= "WHERE id_resa not in (select resa_planning_id_resa from resa where resa_idempr=" . $_SESSION['id_empr_session'] . ") ";
    $q3 .= "and resa_idempr='" . $_SESSION['id_empr_session'] . "' and resa_idnotice={$id_notice} and resa_idbulletin={$id_bulletin} ";
    $q3 .= "ORDER by resa_date_debut asc, resa_date_fin asc";
    $r3 = @pmb_mysql_query($q3, $dbh);
    if (pmb_mysql_num_rows($r3)) {
        $tableau_resa = '<h3>' . $msg['resa_planning_current'] . '</h3>';
        $tableau_resa .= '<table class="tab_resa_planning">';
        $tableau_resa .= '<tr><th>' . $msg['resa_planning_dates'] . '</th>
							<th>' . $msg['resa_planning_qty'] . '</th><th>' . $msg['resa_planning_loc_retrait'] . '</th></tr>';
        while ($resa = pmb_mysql_fetch_array($r3)) {
            $id_resa = $resa['id_resa'];
            $resa_idnotice = $resa['resa_idnotice'];
            $resa_idbulletin = $resa['resa_idbulletin'];
            $resa_date_debut = formatdate($resa['resa_date_debut']);
            $resa_date_fin = formatdate($resa['resa_date_fin']);
            $resa_qty = $resa['resa_qty'];
            $resa_loc_retrait = $resa['location_libelle'];
            $txt_dates = $msg['resa_planning_date_debut'] . $resa_date_debut . '<br />';
            $txt_dates .= $msg['resa_planning_date_fin'] . $resa_date_fin . '<br />';
            if ($resa['resa_perimee']) {
                $txt_dates .= $msg['resa_planning_overtime'];
            } else {
                $txt_dates .= $msg['resa_planning_attente_validation'];
            }
            if ($parity++ % 2) {
                $pair_impair = "even";
            } else {
                $pair_impair = "odd";
            }
            $tableau_resa .= "<tr class='{$pair_impair}'>\n\t\t\t\t<td>{$txt_dates}</td><td>{$resa_qty}</td>\n\t\t\t\t<td>" . htmlentities($resa_loc_retrait, ENT_QUOTES, $charset) . "</td>\n\t\t\t\t</tr>";
        }
        $tableau_resa .= "</table>";
        print $tableau_resa;
    }
}
Example #8
0
     $tmpHtml .= "</select><br /><br /><input type='submit' value='" . $msg["reservation_bt_choisir_localisation"] . "'></form>";
     echo $tmpHtml;
 } else {
     // test au cas où tentative de passer une résa hors URL de résa autorisée...
     $requete_resa = "SELECT count(1) FROM resa WHERE resa_idnotice='{$id_notice}' and resa_idbulletin='{$id_bulletin}'";
     $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);
Example #9
0
 /**
  * Consultation d'une liste statique
  */
 function consulter_liste()
 {
     global $liste_lecture_consultation, $dbh, $charset, $msg, $opac_search_results_per_page, $page;
     $rqt = "select id_liste, nom_liste, description, read_only, empr_nom, empr_prenom, notices_associees, public, if(abo.num_empr is null,0,1) as abo \n\t\t\tfrom opac_liste_lecture op\n\t\t\tleft join empr e on op.num_empr=e.id_empr \n            left join abo_liste_lecture abo on (num_liste=id_liste and abo.num_empr='" . $this->num_empr . "')\n\t\t \twhere id_liste='" . $this->id_liste . "'\n\t\t \t";
     $res = pmb_mysql_query($rqt, $dbh);
     $liste_noti = array();
     while ($liste = pmb_mysql_fetch_object($res)) {
         $liste_lecture_consultation = str_replace('!!nom_liste!!', sprintf($msg['list_lecture_view'], htmlentities($liste->nom_liste, ENT_QUOTES, $charset)), $liste_lecture_consultation);
         $liste_lecture_consultation = str_replace('!!liste_comment!!', htmlentities($liste->description, ENT_QUOTES, $charset), $liste_lecture_consultation);
         $liste_lecture_consultation = str_replace('!!id_liste!!', $this->id_liste, $liste_lecture_consultation);
         $proprio = "(" . sprintf($msg[list_lecture_owner], $liste->empr_prenom . " " . $liste->empr_nom) . ")";
         $liste_lecture_consultation = str_replace('!!proprio!!', $proprio, $liste_lecture_consultation);
         if ($liste->notices_associees) {
             $liste_noti = explode(',', $liste->notices_associees);
         }
         $abo_btn = "<input type='submit' class='bouton' name='abo' onclick='this.form.act.value=\"get_acces\";this.form.action=\"empr.php?tab=lecture&lvl=public_list\";' value=\"" . $msg['list_lecture_abo'] . "\" />";
         $desabo_btn = "<input type='submit'  class='bouton' name='desabo' onclick='this.form.act.value=\"suppr_acces\";this.form.action=\"empr.php?tab=lecture&lvl=public_list\";' value=\"" . $msg['list_lecture_desabo'] . "\" />";
         if (!$liste->read_only) {
             $add_noti_btn = "<input type='submit' class='bouton' name='list_in' onclick='this.form.act.value=\"list_in\";' value='" . $msg['list_lecture_list_in'] . "' />";
         } else {
             $add_noti_btn = '';
         }
         if ($liste->abo) {
             $liste_lecture_consultation = str_replace('!!abo_btn!!', $desabo_btn, $liste_lecture_consultation);
             $liste_lecture_consultation = str_replace('!!add_noti_btn!!', $add_noti_btn, $liste_lecture_consultation);
         } else {
             $liste_lecture_consultation = str_replace('!!abo_btn!!', $abo_btn, $liste_lecture_consultation);
             $liste_lecture_consultation = str_replace('!!add_noti_btn!!', '', $liste_lecture_consultation);
         }
         //Gestion de la liste des notices et de la pagination
         if ($page == "") {
             $page = 1;
         }
         $affich .= "<span><b>" . sprintf($msg["show_cart_n_notices"], count($liste_noti)) . "</b></span>";
         $affich .= "<blockquote>";
         // case à cocher de suppression transférée dans la classe notice_affichage
         $affich .= "<form action='./index.php?lvl=show_list&sub=view&id_liste={$this->id_liste}&page={$page}' method='post' name='list_form'>\n";
         for ($i = ($page - 1) * $opac_search_results_per_page; $i < count($liste_noti) && $i < $page * $opac_search_results_per_page; $i++) {
             if (substr($liste_noti[$i], 0, 2) != "es") {
                 $affich .= aff_notice($liste_noti[$i], 1);
             } else {
                 $affich .= aff_notice_unimarc(substr($liste_noti[$i], 2), 1);
             }
         }
         $affich .= "</form>";
         $affich .= "</blockquote>";
         $affich .= $this->aff_navigation_notices($liste_noti, $this->id_liste, 'consultation');
     }
     $liste_lecture_consultation = str_replace('!!notice_filtre!!', htmlentities(implode(',', $liste_noti), ENT_QUOTES, $charset), $liste_lecture_consultation);
     $liste_lecture_consultation = str_replace('!!liste_notice!!', $affich, $liste_lecture_consultation);
     print $liste_lecture_consultation;
 }
Example #10
0
     print pmb_bidi(aff_notice($num_notice, 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)" : "") . ") order by analysis_notice";
     $res = @mysql_query($requete, $dbh);
     if (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\">" . $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) {
function get_html_subscription_action($others_informations)
{
    global $opac_websubscribe_show;
    global $msg;
    $html = "";
    if ($opac_websubscribe_show == 2) {
        switch ($others_informations['lvl']) {
            case "resa":
                $html = "\n\t\t\t\t<div>\n\t\t\t\t\t<h3>" . $msg['websubscribe_resa_action'] . "</h3>\n\t\t\t\t\t<div class='row'>&nbsp;</div> \n\t\t\t\t\t" . aff_notice($others_informations['id_notice'], 1, 1, 0, "", 0, 0, 1) . "\n\t\t\t\t</div>";
                break;
            case "bannette_gerer":
                $id_bannette = 0;
                foreach ($others_informations['bannette_abon'] as $id => $v) {
                    $id_bannette = $id;
                }
                $html = "\n\t\t\t\t<div>\n\t\t\t\t\t<h3>" . $msg['websubscribe_bannette_action'] . "</h3>\n\t\t\t\t<div class='row'>&nbsp;</div>\n\t\t\t\t" . affiche_public_bannette($id_bannette) . "\n\t\t\t\t</div>";
                break;
        }
    }
    return $html;
}
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;
}
                    $count1 = $count;
                }
                $nbepages = ceil($count1 / $opac_bull_results_per_page);
                $url_page = "javascript:if (document.getElementById(\"onglet_isbd{$id}\")) if (document.getElementById(\"onglet_isbd{$id}\").className==\"isbd_public_active\") document.form_values.premier.value=\"ISBD\"; else document.form_values.premier.value=\"PUBLIC\"; document.form_values.page.value=!!page!!; document.form_values.submit()";
                $action = "javascript:if (document.getElementById(\"onglet_isbd{$id}\")) if (document.getElementById(\"onglet_isbd{$id}\").className==\"isbd_public_active\") document.form_values.premier.value=\"ISBD\"; else document.form_values.premier.value=\"PUBLIC\"; document.form_values.page.value=document.form.page.value; document.form_values.submit()";
                if ($count) {
                    $form = "<div class='row'></div><div id='navbar'><br />\n<center>" . printnavbar($page, $nbepages, $url_page, $action) . "</center></div>";
                }
                break;
            case "a":
                print pmb_bidi(aff_notice($id));
                break;
            case "m":
            default:
                //$l_typdoc=$obj->typdoc;
                print pmb_bidi("<br />" . aff_notice($id));
                break;
        }
    }
}
if (!($id && $acces_v)) {
    print "<h3>" . htmlentities($msg['no_result'], ENT_QUOTES, $charset) . '</h3>';
}
/**
 * Récupère les infos de la notice
 */
function recup_notice_infos($id_notice)
{
    global $infos_notice, $infos_expl;
    $rqt = "select notice_id, typdoc, niveau_biblio, index_l, libelle_categorie, name_pclass, indexint_name\n\t\tfrom notices n\n\t\tleft join notices_categories nc on nc.notcateg_notice=n.notice_id\n\t\tleft join categories c on nc.num_noeud=c.num_noeud\n\t\tleft join indexint i on n.indexint=i.indexint_id\n\t\tleft join pclassement pc on i.num_pclass=pc.id_pclass\n\t\twhere notice_id='" . $id_notice . "'";
    $res_noti = pmb_mysql_query($rqt);
Example #14
0
}
$templates = str_replace("!!styles!!", $stylescsscodehtml, $templates);
//Enrichissement OPAC
if ($opac_notice_enrichment) {
    require_once $base_path . "/classes/enrichment.class.php";
    $enrichment = new enrichment();
    $templates = str_replace("!!scripts!!", "<script type='text/javascript' src='includes/javascript/http_request.js'></script>" . $enrichment->getHeaders(), $templates);
} else {
    $templates = str_replace("!!scripts!!", "", $templates);
}
$id = $_GET["id"];
if ($opac_parse_html || $cms_active) {
    ob_start();
}
//Affichage d'une notice
$notice = aff_notice($id, 1);
print str_replace("#FILES", $notice, $templates);
if ($opac_parse_html || $cms_active) {
    if ($opac_parse_html) {
        $htmltoparse = parseHTML(ob_get_contents());
    } else {
        $htmltoparse = ob_get_contents();
    }
    ob_end_clean();
    if ($cms_active) {
        require_once $base_path . "/classes/cms/cms_build.class.php";
        $cms = new cms_build();
        $htmltoparse = $cms->transform_html($htmltoparse);
    }
    print $htmltoparse;
}
Example #15
0
 if ($opac_notices_depliable) {
     print $begin_result_liste;
 }
 if (count($cart_) <= $pmb_nb_max_tri) {
     print str_replace("!!page_en_cours!!", "lvl=show_cart", $affich_tris_result_liste);
 }
 if ($_SESSION["last_sortnotices"] != "") {
     print " " . $msg['tri_par'] . " " . $sort->descriptionTriParId($_SESSION["last_sortnotices"]) . "<span class=\"espaceCartAction\">&nbsp;</span>";
 }
 print "<blockquote>";
 // case à cocher de suppression transférée dans la classe notice_affichage
 $cart_aff_case_traitement = 1;
 print "<form action='./index.php?lvl=show_cart&action=del&page={$page}' method='post' name='cart_form'>\n";
 for ($i = ($page - 1) * $opac_search_results_per_page; $i < count($cart_) && $i < $page * $opac_search_results_per_page; $i++) {
     if (substr($cart_[$i], 0, 2) != "es") {
         print pmb_bidi(aff_notice($cart_[$i], 1));
     } else {
         print pmb_bidi(aff_notice_unimarc(substr($cart_[$i], 2), 1));
     }
 }
 print "</form>";
 print "</blockquote>";
 print "</div>";
 $nbepages = ceil(count($cart_) / $opac_search_results_per_page);
 $suivante = $page + 1;
 $precedente = $page - 1;
 // affichage du lien précédent si nécéssaire
 print "<hr /><table border='0' summary='navigation bar' align='center'><tr>";
 // affichage du lien pour retour au début
 if ($precedente > 1) {
     print "<td width=\"14\" align=\"center\"><a href=\"index.php?lvl=show_cart&page=1\"><img src=\"./images/first.gif\"";
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;
}
Example #17
0
function resa_planning($deb = TRUE)
{
    global $dbh;
    global $msg;
    global $id_notice;
    global $liens_opac;
    global $form_resa_dates, $form_resa_ok;
    global $popup_resa, $opac_max_resa;
    global $resa_date_debut, $resa_date_fin;
    print "<h3><span>" . $msg['resa_resa_titre_add'] . "</span></h3>";
    if ($deb) {
        // test au cas où tentative de passer une résa hors URL de résa autorisée...
        $requete_resa = "SELECT count(1) FROM resa_planning WHERE resa_idnotice='{$id_notice}' '";
        $result_resa = mysql_query($requete_resa, $dbh);
        if ($result_resa) {
            $nb_resa_encours = mysql_result($result_resa, 0, 0);
        } else {
            $nb_resa_encours = 0;
        }
        if ($opac_max_resa && $nb_resa_encours >= $opac_max_resa) {
            $id_notice = 0;
        }
        print $form_resa_dates;
    }
    if (!$id_notice) {
        return "Erreur, pas de notice sélectionnée";
    }
    if ($id_notice) {
        $opac_notices_depliable = 1;
        $liens_opac = array();
        $ouvrage_resa = aff_notice($id_notice, 1);
    }
    if (!$deb) {
        $form_resa_ok = str_replace('!!date_deb!!', formatdate($resa_date_debut), $form_resa_ok);
        $form_resa_ok = str_replace('!!date_fin!!', formatdate($resa_date_fin), $form_resa_ok);
        print $form_resa_ok;
    }
    //Affichage des réservations planifiées sur le document courant par le lecteur
    $requete3 = "SELECT id_resa, resa_idempr, resa_idnotice, resa_date, resa_date_debut, resa_date_fin, resa_validee, IF(resa_date_fin>=sysdate() or resa_date_fin='0000-00-00',0,1) as perimee, date_format(resa_date_fin, '" . $msg["format_date_sql"] . "') as aff_date_fin ";
    $requete3 .= "FROM resa_planning ";
    $requete3 .= "WHERE resa_idempr='" . $_SESSION['id_empr_session'] . "' and resa_idnotice='" . $id_notice . "' ";
    $result3 = @mysql_query($requete3, $dbh);
    $message_resa = "";
    while ($resa = mysql_fetch_array($result3)) {
        $id_resa = $resa['id_resa'];
        $resa_idempr = $resa['resa_idempr'];
        $resa_idnotice = $resa['resa_idnotice'];
        $resa_idbulletin = $resa['resa_idbulletin'];
        $resa_date = $resa['resa_date'];
        $resa_date_debut = $resa['resa_date_debut'];
        $resa_date_fin = $resa['resa_date_fin'];
        $resa_validee = $resa['resa_validee'];
        $message_resa .= "<blockquote><b>" . $msg['resa_date_debut'] . "</b> " . formatdate($resa_date_debut) . "&nbsp;<b>" . $msg['resa_date_fin'] . "</b> " . formatdate($resa_date_fin) . "&nbsp;";
        if (!$resa['perimee']) {
            if ($resa['resa_validee']) {
                $message_resa .= " " . $msg['resa_validee'];
            } else {
                $message_resa .= " " . $msg['resa_attente_validation'] . " ";
            }
        } else {
            $message_resa .= " " . $msg['resa_overtime'] . " ";
        }
        $message_resa .= "</blockquote>";
    }
    print pmb_bidi($message_resa);
    print $ouvrage_resa;
}
Example #18
0
 function getCurrentDoc()
 {
     $this->currentDoc = "";
     //on peut récup déjà un certain nombre d'infos...
     $this->currentDoc["id"] = $this->listeDocs[$this->current]->explnum_id;
     $this->params["explnum_id"] = $this->listeDocs[$this->current]->explnum_id;
     $this->currentDoc["titre"] = $this->listeDocs[$this->current]->explnum_nom;
     $req_expl = "select explnum_id from explnum ";
     $req_expl .= "where explnum_id = " . $this->listeDocs[$this->current]->explnum_id . " and ";
     $terms = explode(" ", $this->params["user_query"]);
     if (sizeof($terms > 0)) {
         $req_expl .= "(";
     }
     $search = '';
     for ($i = 0; $i < sizeof($terms); $i++) {
         if ($search != "") {
             $search .= " or ";
         }
         $search .= "explnum_index_sew LIKE '%" . $terms[$i] . "%'";
     }
     if ($search != "") {
         $req_expl .= $search;
     }
     if (sizeof($terms > 0)) {
         $req_expl .= ")";
     }
     $searchInExplnum = pmb_mysql_query($req_expl);
     if (pmb_mysql_num_rows($searchInExplnum) == 0) {
         $this->currentDoc["searchterms"] = "";
     } else {
         $this->currentDoc["searchterms"] = $this->params["user_query"];
     }
     //on récupère le chemin
     if ($this->listeDocs[$this->current]->explnum_url != "") {
         //c'est une url
         $this->currentDoc["path"] = $this->listeDocs[$this->current]->explnum_url;
     } elseif ($this->listeDocs[$this->current]->explnum_repertoire != 0) {
         //il est en répertoire d'upload
         $rep = new upload_folder($this->listeDocs[$this->current]->explnum_repertoire);
         $this->currentDoc["path"] = $rep->repertoire_path . "/" . $this->listeDocs[$this->current]->explnum_nomfichier;
     } else {
         //il est en base
         //faudra revoir ce truc
         $this->currentDoc["path"] = "";
     }
     //dans le cadre d'une URL, on doit récup le mimetype...
     if ($this->listeDocs[$this->current]->explnum_url) {
         if (file_exists($this->visionneuse_path . "/conf/mime_magic.txt")) {
             $fp = fopen($this->visionneuse_path . "/conf/mime_magic.txt", "r");
             $mimetype_file = fread($fp, filesize($this->visionneuse_path . "/conf/mime_magic.txt"));
             fclose($fp);
             if ($mimetype_file == "") {
                 $mimetype_file = get_cfg_var("mime_magic.magicfile");
             }
         } else {
             $mimetype_file = get_cfg_var("mime_magic.magicfile");
         }
         $finfo = finfo_open(FILEINFO_MIME, $mimetype_file);
         $mime_magic = finfo_file($finfo, $this->listeDocs[$this->current]->explnum_url);
         $this->currentDoc["mimetype"] = strpos($mime_magic, ";") > 0 ? substr($mime_magic, 0, strpos($mime_magic, ";")) : $mime_magic;
     } else {
         //sinon il a déjà été détecté et est présent en base...
         $this->currentDoc["mimetype"] = $this->listeDocs[$this->current]->explnum_mimetype;
     }
     //pour la conversion on y ajoute l'extension
     $ext = '';
     $ext = $this->listeDocs[$this->current]->explnum_extfichier;
     if (!$ext && $this->listeDocs[$this->current]->explnum_nomfichier) {
         $ext = substr($this->listeDocs[$this->current]->explnum_nomfichier, strrpos($this->listeDocs[$this->current]->explnum_nomfichier, '.') * 1 + 1);
     }
     if (!$ext && $this->listeDocs[$this->current]->explnum_url) {
         $ext = substr($this->listeDocs[$this->current]->explnum_url, strrpos($this->listeDocs[$this->current]->explnum_url, '.') * 1 + 1);
     }
     $this->currentDoc['extension'] = $ext;
     //on récup la notice associée...
     if ($this->listeDocs[$this->current]->explnum_notice) {
         $this->currentDoc["desc"] = aff_notice($this->listeDocs[$this->current]->explnum_notice, 1, 1, 0, "", 0, 1);
     } else {
         $this->currentDoc["desc"] = bulletin_affichage($this->listeDocs[$this->current]->explnum_bulletin, "visionneuse");
     }
     preg_match_all("/(<a href=[\"'][^#][^>]*>)(.*?)<\\/a>/", $this->currentDoc["desc"], $lop);
     for ($i = 0; $i < sizeof($lop[0]); $i++) {
         $plop = explode($lop[0][$i], $this->currentDoc["desc"]);
         $this->currentDoc["desc"] = implode($lop[2][$i], $plop);
     }
     return $this->currentDoc;
 }
Example #19
0
 function get_perio($id)
 {
     //on simplifie les appels..
     if (strpos($id, "es") !== false) {
         return $this->get_perio_ex($id);
     }
     global $msg, $charset, $dbh;
     global $f_bull_deb_id, $opac_bull_results_per_page, $page, $opac_fonction_affichage_liste_bull, $bull_date_start, $bull_date_end;
     global $bull_num_deb;
     global $flag_no_get_bulletin;
     global $recherche_ajax_mode;
     //on surcharge pour l'affichage des périos en affichage django
     global $lvl;
     global $opac_notices_format;
     if ($opac_notices_format == AFF_ETA_NOTICES_TEMPLATE_DJANGO) {
         $lvl = 'notice_display';
     }
     $flag_no_get_bulletin = 1;
     $opac_notices_depliable = 0;
     $resultat_aff .= aff_notice($id, 0, 1, 0, "", 0, 0, 1, $recherche_ajax_mode);
     /*
     $notice = new notice_affichage($id) ;
     $notice->do_header();
     $notice->do_public();
     //$notice->do_isbd();
     $notice->genere_simple(0, 'PUBLIC') ;					
     $resultat_aff .= $notice->result;	
     */
     $requete = "SELECT notice_id, niveau_biblio,typdoc,opac_visible_bulletinage FROM notices WHERE notice_id='{$id}'  and (opac_visible_bulletinage&0x1) LIMIT 1";
     $res = @pmb_mysql_query($requete, $dbh);
     if ($obj = pmb_mysql_fetch_object($res)) {
         //Recherche dans les numéros
         $start_num = $bull_num_deb;
         if ($f_bull_deb_id) {
             $restrict_num = $this->compare_date($f_bull_deb_id);
             $restrict_date = "";
         } else {
             if ($start_num) {
                 $restrict_num = " and bulletin_numero like '%" . $start_num . "%' ";
                 $restrict_date = "";
             }
         }
         // Recherche dans les dates et libellés de période
         if (!$restrict_num) {
             $restrict_date = $this->compare_date($bull_date_start, $bull_date_end);
         }
         // nombre de références par pages (12 par défaut)
         if (!isset($opac_bull_results_per_page)) {
             $opac_bull_results_per_page = 12;
         }
         if (!$page) {
             $page = 1;
         }
         $debut = ($page - 1) * $opac_bull_results_per_page;
         $limiter = " LIMIT {$debut},{$opac_bull_results_per_page}";
         //Recherche par numéro
         $num_field_start = "\n\t\t\t<input type='hidden' name='f_bull_deb_id' id='f_bull_deb_id' />\n\t\t\t<input id='bull_num_deb' name='bull_num_deb' type='text' size='10' value='" . $start_num . "' onkeypress='if (event.keyCode==13){ show_perio({$id});}' />";
         //Recherche par date
         $deb_value = str_replace("-", "", $bull_date_start);
         $fin_value = str_replace("-", "", $bull_date_end);
         $date_deb_value = $deb_value ? formatdate($deb_value) : '...';
         $date_fin_value = $fin_value ? formatdate($fin_value) : '...';
         $date_debut = "\n\t\t\t<input type='hidden' id='bull_date_start' name='bull_date_start' value='{$bull_date_start}'/>\n\t\t\t<input type='button' class='bouton' id='date_deb_btn' name='date_deb_btn'  value='" . $date_deb_value . "' onClick=\"window.open('./select.php?what=calendrier&caller=form_values&date_caller=&param1=bull_date_start&param2=date_deb_btn&auto_submit=NO&date_anterieure=YES', 'date_fin', 'width=250,height=300,toolbar=no,dependent=yes,resizable=yes')\"/>\n\t\t\t<input type='button' class='bouton' name='del' value='X' onclick='this.form.date_deb_btn.value=\"...\";this.form.bull_date_start.value=\"\";' />\n\t\t";
         $date_fin = "\n\t\t\t<input type='hidden' id='bull_date_end' name='bull_date_end' value='{$bull_date_end}' />\n\t\t\t<input type='button' class='bouton' id='date_fin_btn' name='date_fin_btn' value='" . $date_fin_value . "' onClick=\"window.open('./select.php?what=calendrier&caller=form_values&date_caller=&param1=bull_date_end&param2=date_fin_btn&auto_submit=NO&date_anterieure=YES', 'date_fin', 'width=250,height=300,toolbar=no,dependent=yes,resizable=yes')\"/>\n\t\t\t<input type='button' class='bouton' name='del' value='X' onclick='this.form.date_fin_btn.value=\"...\";this.form.bull_date_end.value=\"\";' />\n\t\t";
         $bulletin_retard = $this->get_bulletin_retard($id);
         $tableau = "\t\t\n\t\t<a name='tab_bulletin'></a>\n\t\t<h3><span id='titre_exemplaires'>" . $msg["a2z_perio_list_bulletins"] . "</span></h3>\n\t\t<div id='form_search_bull'>\n\t\t\t\n\t\t\t\t<script src='./includes/javascript/ajax.js'></script>\n\t\t\t\t<form name=\"form_values\" action=\"./index.php?lvl=notice_display&id={$id}\" >\n\n\t\t\t\t\t<input type=\"hidden\" name=\"premier\" value=\"\">\n\n\t\t\t\t\t<input type=\"hidden\" id='page' name=\"page\" value=\"{$page}\">\n\n\t\t\t\t\t<table>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<td ><strong>" . $msg["search_per_bull_num"] . " : " . $msg["search_bull_exact"] . "</strong></td>\n\t\t\t\t\t\t\t<td >{$num_field_start}</td>\t\t\t\t\t\t\n\t\t\t\t\t\t\t<td >&nbsp;</td>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<td align='left' rowspan=2><input type='button' class='boutonrechercher' value='" . $msg["142"] . "' onclick='show_perio({$id});' /></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td ><strong>" . $msg["search_per_bull_date"] . " : " . $msg["search_bull_start"] . "</strong></td>\n\t\t\t\t\t\t\t<td>{$date_debut}</td>\n\t\t\t\t\t\t\t<td><strong>" . $msg["search_bull_end"] . "</strong> {$date_fin}</td>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t\t<div class='row'></div><br />\n\t\t</div>\n";
         $resultat_aff .= $tableau;
         //		$resultat_aff.= "<script type='text/javascript'>ajax_parse_dom();</script>";
         $resultat_aff .= $bulletin_retard;
         // A EXTERNALISER ENSUITE DANS un bulletin_list.inc.php
         //AVANT
         $requete = "SELECT bulletins.*,count(explnum_id) as nbexplnum FROM bulletins LEFT JOIN explnum ON explnum_bulletin = bulletin_id where bulletin_id in(\n\t\tSELECT bulletin_id FROM bulletins WHERE bulletin_notice='{$id}' {$restrict_num} {$restrict_date} and num_notice=0\n\t\t) or bulletin_id in(\n\t\tSELECT bulletin_id FROM bulletins,notice_statut, notices WHERE bulletin_notice='{$id}' {$restrict_num} {$restrict_date} \n\t\tand notice_id=num_notice\n\t\tand statut=id_notice_statut \n\t\tand((notice_visible_opac=1 and notice_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (notice_visible_opac_abon=1 and notice_visible_opac=1)" : "") . ")) \n\t\tGROUP BY bulletins.bulletin_id ";
         //MAINTENANT
         global $gestion_acces_active, $gestion_acces_empr_notice, $gestion_acces_empr_docnum, $opac_show_links_invisible_docnums;
         $join_docnum_noti = $join_docnum_bull = "";
         if ($gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) {
             $ac = new acces();
             $dom_2 = $ac->setDomain(2);
             $join_noti = $dom_2->getJoin($_SESSION["id_empr_session"], 4, "bulletins.num_notice");
             $join_bull = $dom_2->getJoin($_SESSION["id_empr_session"], 4, "bulletins.bulletin_notice");
             if (!$opac_show_links_invisible_docnums) {
                 $join_docnum_noti = $dom_2->getJoin($_SESSION["id_empr_session"], 16, "bulletins.num_notice");
                 $join_docnum_bull = $dom_2->getJoin($_SESSION["id_empr_session"], 16, "bulletins.bulletin_notice");
             }
         } else {
             $join_noti = "join notices on bulletins.num_notice = notices.notice_id join notice_statut on notices.statut = notice_statut.id_notice_statut AND ((notice_visible_opac=1 and notice_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (notice_visible_opac_abon=1 and notice_visible_opac=1)" : "") . ")";
             $join_bull = "join notices on bulletins.bulletin_notice = notices.notice_id join notice_statut on notices.statut = notice_statut.id_notice_statut AND ((notice_visible_opac=1 and notice_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (notice_visible_opac_abon=1 and notice_visible_opac=1)" : "") . ")";
             if (!$opac_show_links_invisible_docnums) {
                 $join_docnum_noti = "join notices on bulletins.num_notice = notices.notice_id join notice_statut on notices.statut = notice_statut.id_notice_statut AND ((explnum_visible_opac=1 and explnum_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (explnum_visible_opac_abon=1 and explnum_visible_opac=1)" : "") . ")";
                 $join_docnum_bull = "join notices on bulletins.bulletin_notice = notices.notice_id join notice_statut on notices.statut = notice_statut.id_notice_statut AND ((explnum_visible_opac=1 and explnum_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (explnum_visible_opac_abon=1 and explnum_visible_opac=1)" : "") . ")";
             }
         }
         $join_docnum_explnum = "";
         if (!$opac_show_links_invisible_docnums) {
             if ($gestion_acces_active == 1 && $gestion_acces_empr_docnum == 1) {
                 $ac = new acces();
                 $dom_3 = $ac->setDomain(3);
                 $join_docnum_explnum = $dom_3->getJoin($_SESSION["id_empr_session"], 16, "explnum_id");
             } else {
                 $join_docnum_explnum = "join explnum_statut on explnum_docnum_statut=id_explnum_statut and ((explnum_visible_opac=1 and explnum_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (explnum_visible_opac_abon=1 and explnum_visible_opac=1)" : "") . ")";
             }
         }
         $requete_docnum_noti = "select bulletin_id, count(explnum_id) as nbexplnum from explnum join bulletins on explnum_bulletin = bulletin_id and explnum_notice = 0 " . $join_docnum_explnum . " where bulletin_notice = " . $id . " and explnum_bulletin in (select bulletin_id from bulletins " . $join_docnum_noti . " where bulletin_notice = " . $id . ") group by bulletin_id";
         $requete_docnum_bull = "select bulletin_id, count(explnum_id) as nbexplnum from explnum join bulletins on explnum_bulletin = bulletin_id and explnum_notice = 0 " . $join_docnum_explnum . " where bulletin_notice = " . $id . " and explnum_bulletin in (select bulletin_id from bulletins " . $join_docnum_bull . " where bulletin_notice = " . $id . ") group by bulletin_id";
         $requete_noti = "select bulletins.*,ifnull(nbexplnum,0) as nbexplnum from bulletins " . $join_noti . " left join ({$requete_docnum_noti}) as docnum_noti on bulletins.bulletin_id = docnum_noti.bulletin_id where bulletins.num_notice != 0 and bulletin_notice = " . $id . " {$restrict_num} {$restrict_date} GROUP BY bulletins.bulletin_id";
         $requete_bull = "select bulletins.*,ifnull(nbexplnum,0) as nbexplnum from bulletins " . $join_bull . " left join ({$requete_docnum_bull}) as docnum_bull on bulletins.bulletin_id = docnum_bull.bulletin_id where bulletins.num_notice = 0 and bulletin_notice = " . $id . " {$restrict_num} {$restrict_date} GROUP BY bulletins.bulletin_id";
         $requete = "select * from (" . $requete_noti . " union " . $requete_bull . ") as uni where 1 " . $restrict_num . " " . $restrict_date;
         $rescount1 = pmb_mysql_query($requete);
         $count1 = pmb_mysql_num_rows($rescount1);
         //si on recherche par date ou par numéro, le résultat sera trié par ordre croissant
         if ($restrict_num || $restrict_date) {
             $requete .= " ORDER BY date_date, bulletin_numero*1 ";
         } else {
             $requete .= " ORDER BY date_date DESC, bulletin_numero*1 DESC";
         }
         $requete .= $limiter;
         $res = @pmb_mysql_query($requete, $dbh);
         $count = pmb_mysql_num_rows($res);
         if ($count) {
             ob_start();
             if ($opac_fonction_affichage_liste_bull) {
                 eval("\$opac_fonction_affichage_liste_bull (\$res);");
             } else {
                 affichage_liste_bulletins_normale($res);
             }
             $resultat_aff .= ob_get_contents();
             ob_end_clean();
         } else {
             $resultat_aff .= "<strong>" . $msg["bull_no_found"] . "</strong>";
         }
         //$resultat_aff.= "<br />";
         // constitution des liens
         if (!$count1) {
             $count1 = $count;
         }
         $nbepages = ceil($count1 / $opac_bull_results_per_page);
         $url_page = "";
         //javascript:if (document.getElementById(\"onglet_isbd$id\")) if (document.getElementById(\"onglet_isbd$id\").className==\"isbd_public_active\") document.form_values.premier.value=\"ISBD\"; else document.form_values.premier.value=\"PUBLIC\"; document.form_values.page.value=!!page!!; document.form_values.submit()";
         $action = "show_perio({$id});return false;";
         if ($nbepages > 1) {
             $form = "<div class='row'></div>\n<div id='navbar_perio'><center>" . printnavbar_onclick($page, $nbepages, $url_page, $action) . "</center></div>";
         }
     }
     return $resultat_aff . $form;
 }
Example #20
0
 function getNoticeInfos($notice_id, $source_id)
 {
     global $search_index, $url;
     $error = false;
     $info = "";
     $asin = 0;
     $params = $this->get_source_params($source_id);
     $this->fetch_global_properties();
     $parameters = unserialize($this->parameters);
     if ($params["PARAMETERS"]) {
         //Affichage du formulaire avec $params["PARAMETERS"]
         $vars = unserialize($params["PARAMETERS"]);
         foreach ($vars as $key => $val) {
             global ${$key};
             ${$key} = $val;
         }
     }
     $client = $this->initAWS($source_id);
     $client->__setSoapHeaders($this->make_soap_headers('ItemSearch'));
     $rqt = "select code from notices where notice_id = '" . $notice_id . "'";
     $res = pmb_mysql_query($rqt);
     if (pmb_mysql_num_rows($res)) {
         $code = pmb_mysql_result($res, 0, 0);
         if ($code != "") {
             $code = preg_replace('/-|\\.| /', '', $code);
             $paws["Request"] = array("SearchIndex" => $search_index[$url][0], "ResponseGroup" => "ItemIds", "Keywords" => "{$code}");
             $paws["AssociateTag"] = $parameters['associatetag'];
             try {
                 $this->sleep_needed();
                 $result = $client->ItemSearch($paws);
             } catch (Exception $e) {
                 $error = true;
             }
             if (!$error) {
                 if (is_object($result)) {
                     $result = amazon::objectToArrayAndCharset($result);
                 }
                 $items = $this->soap2array($result["Items"], "Item");
                 $asin = $items[0][ASIN];
                 if ($asin) {
                     $client->__setSoapHeaders(NULL);
                     $client->__setSoapHeaders($this->make_soap_headers('ItemLookup'));
                     $paws["Request"] = array("ResponseGroup" => "Large", "IdType" => "ASIN", "ItemId" => $asin);
                     try {
                         $this->sleep_needed();
                         $result = $client->ItemLookup($paws);
                     } catch (Exception $e) {
                         $error = true;
                     }
                     if (!$error) {
                         if (is_object($result)) {
                             $result = amazon::objectToArrayAndCharset($result);
                         }
                         $items = $this->soap2array($result["Items"], "Item");
                         //récupération des résumés...
                         $resumes = $this->soap2array($items[0]["EditorialReviews"], "EditorialReview");
                         if (count($resumes)) {
                             for ($i = 0; $i < count($resumes); $i++) {
                                 $infos['resume'] .= $resumes[$i]["Content"] . ($resumes[$i]["Source"] ? " (" . $resumes[$i]["Source"] . ")" : "");
                             }
                         }
                         //récupération des avis ...
                         $links = $this->soap2array($items[0]["ItemLinks"], "ItemLink");
                         if (count($links)) {
                             for ($i = 0; $i < count($links); $i++) {
                                 if ($links[$i]['Description'] == "All Customer Reviews") {
                                     $infos['review'] .= "<iframe src='" . $links[$i]['URL'] . "' style='width:" . $review_width . ";height:" . $review_height . ";'></iframe>";
                                 }
                             }
                         }
                         //récupération des extrait sonore si dispo ...
                         $discs = $this->soap2array($items[0]["Tracks"], "Disc");
                         if (count($discs)) {
                             $infos['extract_audio'] = "\n\t\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t\t<tr>";
                             for ($i = 0; $i < count($discs); $i++) {
                                 $infos['extract_audio'] .= "\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t<h4>Disque " . $discs[$i]['Number'] . "</h4>\n\t\t\t\t\t\t\t\t\t\t\t<ul>";
                                 for ($j = 0; $j < count($discs[$i]['Track']); $j++) {
                                     $infos['extract_audio'] .= "\n\t\t\t\t\t\t\t\t\t\t\t\t<li><a href='http://www.amazon.fr/gp/recsradio/radio/" . $asin . "/ref=pd_krex_dp_a&disc=" . $discs[$i]['Number'] . "&track=" . $discs[$i]['Track'][$j]['Number'] . "' target='_blank' alt='" . sprintf($this->msg['amazon_enrichment_listen_extract'], $discs[$i]['Track'][$j]['_']) . "' title='" . sprintf($this->msg['amazon_enrichment_listen_extract'], $discs[$i]['Track'][$j]['_']) . "'>" . $discs[$i]['Track'][$j]['Number'] . " - " . $discs[$i]['Track'][$j]['_'] . "</a></li>";
                                 }
                                 $infos['extract_audio'] .= "\n\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t</td>";
                             }
                             $infos['extract_audio'] .= "\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</table>";
                         }
                         //pour les similarités
                         foreach ($items[0][SimilarProducts][SimilarProduct] as $similar) {
                             if (isISBN($similar[ASIN])) {
                                 $rqt = "select notice_id from notices where code = '" . formatISBN($similar[ASIN], 10) . "' or code = '" . formatISBN($similar[ASIN], 13) . "' limit 1";
                                 $res = mysql_query($rqt);
                                 if (mysql_num_rows($res)) {
                                     $notice = mysql_result($res, 0, 0);
                                     if ($notice) {
                                         $infos['similarities'] .= aff_notice($notice, 1, 1, 0, AFF_ETA_NOTICES_REDUIT, "no", 0, 1);
                                     }
                                 }
                             } else {
                                 //si c'est pas un ISBN on cherche ce que ca peut être...
                                 $paws["Request"] = array("ResponseGroup" => "ItemAttributes", "IdType" => "ASIN", "ItemId" => $similar[ASIN]);
                                 try {
                                     $result = $client->ItemLookup($paws);
                                     if (is_object($result)) {
                                         $result = amazon::objectToArrayAndCharset($result);
                                     }
                                 } catch (Exception $e) {
                                     $error = true;
                                 }
                                 if (!$error) {
                                     $items = $this->soap2array($result["Items"], "Item");
                                     $code = $items[0][ItemAttributes][UPC];
                                     if ($code) {
                                         $rqt = "select notice_id from notices where code = '" . $code . "' or code = '" . $code . "' limit 1";
                                         $res = mysql_query($rqt);
                                         if (mysql_num_rows($res)) {
                                             $notice = mysql_result($res, 0, 0);
                                             if ($notice) {
                                                 $infos['similarities'] .= aff_notice($notice, 1, 1, 0, AFF_ETA_NOTICES_REDUIT, "no", 0, 1);
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     return $infos;
 }
Example #21
0
     //fin gestion du tri
     $nb = 0;
     $recherche_ajax_mode = 0;
     $res = mysql_query($requete, $dbh);
     while ($obj = mysql_fetch_object($res)) {
         global $infos_notice;
         if ($nb++ > 4) {
             $recherche_ajax_mode = 1;
         }
         print pmb_bidi(aff_notice($obj->notice_id, 0, 1, 0, "", "", 0, 0, $recherche_ajax_mode));
         $infos_notice['nb_pages'] = ceil($nbr_lignes / $opac_nb_aut_rec_per_page);
     }
     mysql_free_result($res);
     // constitution des liens pur affichage de la barre de navigation
     $nbepages = ceil($nbr_lignes / $opac_nb_aut_rec_per_page);
     print aff_notice(-2);
     print "\t</blockquote>\n\n\t\t\t\t</div><!-- fermeture du div aut_details_liste -->\n";
     print "<div id='navbar'><hr /><center>" . printnavbar($page, $nbepages, "./index.php?lvl=author_see&id={$id}&page=!!page!!&nbr_lignes={$nbr_lignes}&l_typdoc=" . rawurlencode($l_typdoc)) . "</center></div>\n";
 } else {
     print $msg[no_document_found];
     print "</div><!-- fermeture du div aut_details_liste -->\n";
 }
 // Documents numériques auxquels l'auteur est associé
 $query = "select distinct explnum_speaker_explnum_num from explnum_speakers where explnum_speaker_author " . $clause_auteurs;
 $result = mysql_query($query, $dbh);
 if ($result && mysql_num_rows($result)) {
     print pmb_bidi("<h3>" . $msg['author_see_explnum_associate'] . "</h3>\n");
     while ($explnum = mysql_fetch_object($result)) {
         print "<div>" . show_explnum_per_id($explnum->explnum_speaker_explnum_num) . "</div>";
     }
 }
Example #22
0
 } else {
     //si demande de réinitialisation
     if ($reinit_compare == 1) {
         facette_search_compare::session_facette_compare(null, $reinit_compare);
     }
     $sr_form .= $searcher->get_current_search_map();
     $sr_form .= aff_notice(-1);
     $nb = 0;
     $recherche_ajax_mode = 0;
     for ($i = 0; $i < count($notices); $i++) {
         if ($i > 4) {
             $recherche_ajax_mode = 1;
         }
         $sr_form .= pmb_bidi(aff_notice($notices[$i], 0, 1, 0, "", "", 0, 0, $recherche_ajax_mode));
     }
     $sr_form .= aff_notice(-2);
 }
 $sr_form .= "</blockquote></div></div>";
 // constitution des liens
 $nbepages = ceil($count / $opac_search_results_per_page);
 $sr_form .= "<div class='row'><span class=\"espaceResultSearch\">&nbsp;</span></div>";
 if (!$opac_allow_affiliate_search) {
     $url_page = "javascript:document.form_values.page.value=!!page!!; document.form_values.submit()";
     $action = "javascript:document.form_values.page.value=document.form.page.value; document.form_values.submit()";
 } else {
     $url_page = "javascript:document.form_values.page.value=!!page!!; document.form_values.catalog_page.value=document.form_values.page.value; document.form_values.action = \"./index.php?lvl=more_results&mode=extended&tab=catalog\"; document.form_values.submit()";
     $action = "javascript:document.form_values.page.value=document.form.page.value; document.form_values.catalog_page.value=document.form_values.page.value; document.form_values.action = \"./index.php?lvl=more_results&mode=extended&tab=catalog\"; document.form_values.submit()";
 }
 //Si pas de résultats, affichage des suggestions
 if (!$count && $opac_simple_search_suggestions) {
     $tableSuggest = "";
function affiche_notice_navigopac($requete)
{
    global $page, $nbr_lignes, $id, $location, $dcote, $lcote, $nc, $main, $ssub, $plettreaut;
    global $opac_nb_aut_rec_per_page, $opac_section_notices_order, $msg, $dbh, $opac_notices_depliable, $begin_result_liste, $add_cart_link_spe, $base_path;
    global $back_surloc, $back_loc, $back_section_see;
    global $opac_perio_a2z_abc_search, $opac_perio_a2z_max_per_onglet;
    global $str, $opac_facettes_ajax;
    if (!$page) {
        $page = 1;
    }
    $debut = ($page - 1) * $opac_nb_aut_rec_per_page;
    //On controle paramètre de tri
    if (!trim($opac_section_notices_order)) {
        $opac_section_notices_order = "index_serie, tnvol, index_sew";
    }
    if ($plettreaut && $plettreaut != "vide") {
        $opac_section_notices_order = "index_author, " . $opac_section_notices_order;
    }
    $requete_initiale = $requete;
    $requete .= " ORDER BY " . $opac_section_notices_order . " LIMIT {$debut},{$opac_nb_aut_rec_per_page}";
    $res = @pmb_mysql_query($requete, $dbh);
    print $nbr_lignes . " " . $msg["results"] . "<br />";
    if ($opac_notices_depliable) {
        print $begin_result_liste;
    }
    if ($add_cart_link_spe) {
        print pmb_bidi(str_replace("!!spe!!", "&location={$location}&dcote={$dcote}&lcote={$lcote}&ssub={$ssub}&nc={$nc}&plettreaut={$plettreaut}", $add_cart_link_spe));
    }
    /*//affinage
    	//enregistrement de l'endroit actuel dans la session
    	$_SESSION["last_module_search"]["search_mod"]="section_see";
    	$_SESSION["last_module_search"]["search_id"]=$id;
    	*/
    //affinage
    if ($dcote == "" && $plettreaut == "" && $nc == "") {
        print "<span class=\"espaceResultSearch\">&nbsp;&nbsp;</span><span class=\"affiner_recherche\"><a href='{$base_path}/index.php?search_type_asked=extended_search&mode_aff=aff_module' title='" . $msg["affiner_recherche"] . "'>" . $msg["affiner_recherche"] . "</a></span>";
    }
    //fin affinage
    print "<blockquote>";
    print aff_notice(-1);
    while ($obj = pmb_mysql_fetch_object($res)) {
        print pmb_bidi(aff_notice($obj->notice_id));
    }
    print aff_notice(-2);
    print "</blockquote>";
    pmb_mysql_free_result($res);
    // constitution des liens
    $nbepages = ceil($nbr_lignes / $opac_nb_aut_rec_per_page);
    print '<div id="navbar"><hr /><center>' . printnavbar($page, $nbepages, './index.php?lvl=section_see&id=' . $id . '&location=' . $location . ($back_surloc ? '&back_surloc=' . urlencode($back_surloc) : '') . ($back_loc ? '&back_loc=' . urlencode($back_loc) : '') . ($back_section_see ? '&back_section_see=' . urlencode($back_section_see) : '') . '&page=!!page!!&nbr_lignes=' . $nbr_lignes . '&dcote=' . $dcote . '&lcote=' . $lcote . '&nc=' . $nc . '&main=' . $main . '&ssub=' . $ssub . '&plettreaut=' . $plettreaut) . '</center></div>';
    //FACETTES
    $records = "";
    if ($nbr_lignes) {
        require_once $base_path . '/classes/facette_search.class.php';
        $facettes_result = pmb_mysql_query($requete_initiale, $dbh);
        while ($row = pmb_mysql_fetch_object($facettes_result)) {
            if ($records) {
                $records .= ",";
            }
            $records .= $row->notice_id;
        }
        if (!$opac_facettes_ajax) {
            $str .= facettes::make_facette($records);
        } else {
            $_SESSION['tab_result'] = $records;
            $str .= facettes::get_facette_wrapper();
            $str .= "<div id='facette_wrapper'><img src='./images/patience.gif'/></div>";
            $str .= "\n\t\t\t<script type='text/javascript'>\n\t\t\t\tvar req = new http_request();\n\t\t\t\treq.request(\"./ajax.php?module=ajax&categ=facette&sub=call_facettes\",false,null,true,function(data){\n\t\t\t\t\tdocument.getElementById('facette_wrapper').innerHTML=data;\n\t\t\t\t});\n\t\t\t</script>";
        }
        //Formulaire "FACTICE" pour l'application du comparateur et du filetre multiple...
        $str .= '
<form name="form_values" style="display:none;" method="post" action="?lvl=more_results&mode=extended">
	<input type="hidden" name="from_see" value="1" />
	' . facette_search_compare::form_write_facette_compare() . '
</form>';
    }
}
Example #24
0
         $recordslist .= "<span class=\"espaceResultSearch\">&nbsp;&nbsp;</span><span class=\"search_bt_external\"><a href='{$base_path}/index.php?search_type_asked=external_search&mode_aff=aff_simple_search&external_type=simple' title='" . $msg["connecteurs_external_search_sources"] . "'>" . $msg["connecteurs_external_search_sources"] . "</a></span>";
     }
     //fin etendre
     $recordslist .= "<blockquote>\n";
     $recordslist .= aff_notice(-1);
     $nb = 0;
     $recherche_ajax_mode = 0;
     while ($obj = pmb_mysql_fetch_object($res)) {
         global $infos_notice;
         if ($nb++ > 4) {
             $recherche_ajax_mode = 1;
         }
         $recordslist .= pmb_bidi(aff_notice($obj->notice_id, 0, 1, 0, "", "", 0, 0, $recherche_ajax_mode));
         $infos_notice['nb_pages'] = ceil($nbr_lignes / $opac_nb_aut_rec_per_page);
     }
     $recordslist .= aff_notice(-2);
     $recordslist .= "</blockquote>\n";
     pmb_mysql_free_result($res);
     // constitution des liens
     $nbepages = ceil($nbr_lignes / $opac_nb_aut_rec_per_page);
     // 		$recordslist.=  "</div><!-- fermeture #aut_details_liste -->\n";
     $recordslist .= "<div id='navbar'><hr /><center>" . printnavbar($page, $nbepages, "./index.php?lvl=coll_see&id={$id}&page=!!page!!&nbr_lignes={$nbr_lignes}&l_typdoc=" . rawurlencode($l_typdoc)) . "</center></div>\n";
 } else {
     $recordslist .= $msg[no_document_found];
 }
 $recordslist .= "</div>";
 // Fermeture du div resultatrech_liste
 $context['authority']['recordslist'] = $recordslist;
 $authority = new authority("collection", $id);
 $authority->render($context);
 //FACETTES
             }
         }
         if ($docnum_visible || $opac_show_links_invisible_docnums) {
             if ($explnum = show_explnum_per_notice(0, $id, '')) {
                 print pmb_bidi("<a name='docnum'><h3>" . $msg["explnum"] . "</h3></a>" . $explnum);
             }
         }
     }
     print notice_affichage::autres_lectures(0, $id);
 } else {
     print $res_print;
     if ($num_notice) {
         // Il y a une notice de bulletin
         $opac_notices_depliable = 0;
         $seule = 1;
         print pmb_bidi(aff_notice($num_notice, 0, 0));
     } else {
         // On utilise un template django
         require_once $base_path . "/cms/modules/common/includes/pmb_h2o.inc.php";
         if (!$opac_notices_format_django_directory) {
             $opac_notices_format_django_directory = "common";
         }
         if (!$record_css_already_included) {
             if (file_exists($include_path . "/templates/record/" . $opac_notices_format_django_directory . "/styles/style.css")) {
                 $retour_aff .= "<link type='text/css' href='./includes/templates/record/" . $opac_notices_format_django_directory . "/styles/style.css' rel='stylesheet'></link>";
             }
             $record_css_already_included = true;
         }
         // On récupère le libellé de Bulletinq
         if (!count($biblio_doc)) {
             $biblio_doc = new marc_list('nivbiblio');
Example #26
0
function contenu_etagere($idetagere, $aff_notices_nb = 0, $mode_aff_notice = AFF_ETA_NOTICES_BOTH, $depliable = AFF_ETA_NOTICES_DEPLIABLES_OUI, $link_to_etagere = "", $link)
{
    global $charset, $msg;
    global $gestion_acces_active, $gestion_acces_empr_notice;
    global $class_path;
    //droits d'acces emprunteur/notice
    $acces_j = '';
    if ($gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) {
        require_once "{$class_path}/acces.class.php";
        $ac = new acces();
        $dom_2 = $ac->setDomain(2);
        $acces_j = $dom_2->getJoin($_SESSION['id_empr_session'], 4, 'notice_id');
    }
    if ($acces_j) {
        $statut_j = '';
        $statut_r = '';
    } else {
        $statut_j = ',notice_statut';
        $statut_r = "and statut=id_notice_statut and ((notice_visible_opac=1 and notice_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (notice_visible_opac_abon=1 and notice_visible_opac=1)" : "") . ")";
    }
    if (!$idetagere) {
        return "";
    }
    $notices = array();
    //petit check rapide pour récupérer le tri imposé sur l'étagère...
    $idetagere += 0;
    $rqt = "select id_tri from etagere where idetagere=" . $idetagere;
    $res = mysql_query($rqt);
    if (mysql_num_rows($res)) {
        $id_tri = mysql_result($res, 0, 0);
    } else {
        $id_tri = 0;
    }
    //On récupère les notices associées à l'étagère
    notices_caddie($idetagere, $notices, $acces_j, $statut_j, $statut_r, $aff_notices_nb, $id_tri);
    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;
    while ((list($idnotice, $niveau_biblio) = each($notices)) && $limit < $limite_notices) {
        $limit++;
        $retour_aff .= aff_notice($idnotice, 0, 1, 0, $mode_aff_notice, $depliable);
    }
    if (count($notices) > $limite_notices && $link_to_etagere) {
        $retour_aff .= "<a href=\"" . str_replace("!!id!!", $idetagere, $link) . "\">";
        $retour_aff .= "<span class='etagere-suite'>" . $msg['etagere_suite'] . "</span>";
        $retour_aff .= "</a>";
    }
    return $retour_aff;
}
Example #27
0
    require_once "{$class_path}/acces.class.php";
    $ac = new acces();
    $dom_2 = $ac->setDomain(2);
    $acces_j = $dom_2->getJoin($_SESSION['id_empr_session'], 4, 'notice_id');
}
if ($acces_j) {
    $statut_j = '';
    $statut_r = '';
} else {
    $statut_j = ',notice_statut';
    $statut_r = "where statut=id_notice_statut and ((notice_visible_opac=1 and notice_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (notice_visible_opac_abon=1 and notice_visible_opac=1)" : "") . ")";
}
if ($opac_view_restrict) {
    $statut_r .= " and " . $opac_view_restrict;
}
$requete = "select notice_id from notices {$acces_j} {$statut_j} {$statut_r} ";
$requete .= "order by create_date desc, notice_id desc limit {$last_records}";
$result = mysql_query($requete, $dbh);
if (mysql_num_rows($result)) {
    print $last_records_header;
    //	print "<blockquote>\n";
    if ($opac_notices_depliable) {
        print $begin_result_liste;
    }
    while ($notice = mysql_fetch_object($result)) {
        print pmb_bidi(aff_notice($notice->notice_id));
    }
    //	print "</blockquote>\n";
    $plus = $plus + 10;
    print $last_records_footer;
}