Beispiel #1
0
function notices_caddie($idetagere, &$notices, $acces_j = '', $statut_j = '', $statut_r = '', $nb_notices, $id_tri = 0)
{
    global $dbh;
    global $opac_etagere_notices_order;
    if (!$opac_etagere_notices_order) {
        $opac_etagere_notices_order = " index_serie, tit1 ";
    } else {
        $opac_etagere_notices_order = " {$opac_etagere_notices_order} ";
    }
    // on constitue un tableau avec les notices du caddie
    $query_notice = "select distinct notice_id from caddie_content, etagere_caddie, notices {$acces_j} {$statut_j} ";
    $query_notice .= "where etagere_id={$idetagere} and caddie_content.caddie_id=etagere_caddie.caddie_id and notice_id=object_id {$statut_r} ";
    if ($id_tri > 0) {
        $sort = new sort("notices", "base");
        $query_notice = $sort->appliquer_tri($id_tri, $query_notice, "notice_id", 0, 0);
    } else {
        $query_notice .= "order by {$opac_etagere_notices_order} ";
    }
    $result_notice = mysql_query($query_notice, $dbh);
    if (mysql_num_rows($result_notice)) {
        while ($notice = mysql_fetch_object($result_notice)) {
            $notices[$notice->notice_id] = $notice->niveau_biblio;
        }
    }
    // fin if notices
}
 /**
  * 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;
 }
Beispiel #3
0
     $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);
     print $affich_tris_result_liste;
     if ($_SESSION["last_sortnotices"] != "") {
         $sort = new sort('notices', 'session');
         print " " . $msg['tri_par'] . " " . $sort->descriptionTriParId($_SESSION["last_sortnotices"]) . "&nbsp;";
     } elseif ($opac_default_sort_display) {
         $sort = new sort('notices', 'session');
         print " " . $msg['tri_par'] . " " . $sort->descriptionTriParId("default") . "&nbsp;";
     }
 } else {
     print "&nbsp;";
 }
 //fin gestion du tri
 print $add_cart_link;
 if ($opac_visionneuse_allow && $nbexplnum_to_photo) {
     print "&nbsp;&nbsp;&nbsp;" . $link_to_visionneuse;
     print $sendToVisionneuseByPost;
 }
 //affinage
 //enregistrement de l'endroit actuel dans la session
 if ($_SESSION["last_query"]) {
     $n = $_SESSION["last_query"];
         $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' title='" . $msg["connecteurs_external_search_sources"] . "'>" . $msg["connecteurs_external_search_sources"] . "</a></span>";
     }
     //fin etendre
 }
 //fin affinage
 if ($auto_postage_form) {
     $recordslist .= "<div id='autopostageform'>" . $auto_postage_form . "</div>";
 }
 $recordslist .= "<blockquote>\n";
 // on lance la vraie requête
 $requete = "SELECT distinct notices.notice_id {$suite_req}";
 //gestion du tri
 if ($_SESSION["last_sortnotices"] != "") {
     $requete = $sort->appliquer_tri($_SESSION["last_sortnotices"], $requete, "notice_id", $debut, $opac_nb_aut_rec_per_page);
 } else {
     $sort = new sort('notices', 'session');
     $requete = $sort->appliquer_tri("default", $requete, "notice_id", $debut, $opac_nb_aut_rec_per_page);
 }
 //fin gestion du tri
 $res = @pmb_mysql_query($requete, $dbh);
 $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);
 }
Beispiel #5
0
     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);
     print $affich_tris_result_liste;
     //on recupere le tri à appliquer
     if (isset($_GET["sort"])) {
         $_SESSION["last_sortnotices"] = $_GET["sort"];
     }
     if ($_SESSION["last_sortnotices"] != "") {
         $sort = new sort('notices', 'session');
         print "<span class='sort'>" . $msg['tri_par'] . " " . $sort->descriptionTriParId($_SESSION["last_sortnotices"]) . "&nbsp;</span>";
     }
 }
 //fin gestion du tri
 print $add_cart_link;
 if ($opac_visionneuse_allow && $nbexplnum_to_photo) {
     print "&nbsp;&nbsp;&nbsp;" . $link_to_visionneuse;
     $sendToVisionneuseByGet = str_replace("!!mode!!", "author_see", $sendToVisionneuseByGet);
     $sendToVisionneuseByGet = str_replace("!!idautorite!!", $id, $sendToVisionneuseByGet);
     print $sendToVisionneuseByGet;
 }
 if ($opac_show_suggest) {
     $bt_sugg = "&nbsp;&nbsp;&nbsp;<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;\"";
Beispiel #6
0
 function show_results($url, $url_to_search_form, $hidden_form = true, $search_target = "", $acces = false)
 {
     global $dbh;
     global $begin_result_liste;
     global $nb_per_page_search;
     global $page;
     global $charset;
     global $search;
     global $msg;
     global $pmb_nb_max_tri;
     global $affich_tris_result_liste;
     global $pmb_allow_external_search;
     global $debug;
     global $gestion_acces_active, $gestion_acces_user_notice, $PMBuserid, $pmb_allow_external_search;
     global $link_bulletin;
     global $opac_view_id;
     $start_page = $nb_per_page_search * $page;
     //Y-a-t-il des champs ?
     if (count($search) == 0) {
         array_pop($_SESSION["session_history"]);
         error_message_history($msg["search_empty_field"], $msg["search_no_fields"], 1);
         exit;
     }
     $recherche_externe = true;
     //Savoir si l'on peut faire une recherche externe à partir des critères choisis
     //Verification des champs vides
     for ($i = 0; $i < count($search); $i++) {
         $op = "op_" . $i . "_" . $search[$i];
         global ${$op};
         $field_ = "field_" . $i . "_" . $search[$i];
         global ${$field_};
         $field = ${$field_};
         $s = explode("_", $search[$i]);
         $bool = false;
         if ($s[0] == "f") {
             $champ = $this->fixedfields[$s[1]]["TITLE"];
             if ((string) $field[0] == "") {
                 $bool = true;
             }
         } elseif (array_key_exists($s[0], $this->pp)) {
             $recherche_externe = false;
             $champ = $this->pp[$s[0]]->t_fields[$s[1]]["TITRE"];
             if ((string) $field[0] == "") {
                 $bool = true;
             }
         } elseif ($s[0] == "s") {
             $recherche_externe = false;
             $champ = $this->specialfields[$s[1]]["TITLE"];
             $type = $this->specialfields[$s[1]]["TYPE"];
             for ($is = 0; $is < count($this->tableau_speciaux["TYPE"]); $is++) {
                 if ($this->tableau_speciaux["TYPE"][$is]["NAME"] == $type) {
                     $sf = $this->specialfields[$s[1]];
                     global $include_path;
                     require_once $include_path . "/search_queries/specials/" . $this->tableau_speciaux["TYPE"][$is]["PATH"] . "/search.class.php";
                     $specialclass = new $this->tableau_speciaux["TYPE"][$is]["CLASS"]($s[1], $sf, $i, $this);
                     $bool = $specialclass->is_empty($field);
                     break;
                 }
             }
         }
         if ($bool && !$this->op_empty[${$op}]) {
             array_pop($_SESSION["session_history"]);
             error_message_history($msg["search_empty_field"], sprintf($msg["search_empty_error_message"], $champ), 1);
             exit;
         }
     }
     $table = $this->make_search();
     if ($acces == true && $gestion_acces_active == 1 && $gestion_acces_user_notice == 1) {
         $this->filter_searchtable_from_accessrights($table, $PMBuserid);
     }
     $requete = "select count(1) from {$table}";
     if ($res = pmb_mysql_query($requete)) {
         $nb_results = pmb_mysql_result($res, 0, 0);
     } else {
         array_pop($_SESSION["session_history"]);
         error_message_history("", $msg["search_impossible"], 1);
         exit;
     }
     //gestion du tri
     $has_sort = false;
     if ($nb_results <= $pmb_nb_max_tri) {
         if ($_SESSION["tri"]) {
             $sort = new sort('notices', 'base');
             $requete = $sort->appliquer_tri($_SESSION["tri"], "SELECT * FROM " . $table, "notice_id", $start_page, $nb_per_page_search);
             $table = $sort->table_tri_tempo;
             $has_sort = true;
         }
     }
     // fin gestion tri
     //Y-a-t-il une erreur lors de la recherche ?
     if ($this->error_message) {
         array_pop($_SESSION["session_history"]);
         error_message_history("", $this->error_message, 1);
         exit;
     }
     if ($hidden_form) {
         print $this->make_hidden_search_form($url);
     }
     $requete = "select {$table}.*,notices.niveau_biblio from " . $table . ",notices where notices.notice_id={$table}.notice_id";
     if (count($search) > 1 && !$has_sort) {
         $requete .= " order by index_serie, tnvol, index_sew";
     }
     $requete .= " limit " . $start_page . "," . $nb_per_page_search;
     $resultat = pmb_mysql_query($requete, $dbh);
     $human_requete = $this->make_human_query();
     print "<strong>" . $msg["search_search_extended"] . "</strong> : " . $human_requete;
     if ($debug) {
         print "<br />" . $this->serialize_search();
     }
     if ($nb_results) {
         print " => " . $nb_results . " " . $msg["1916"] . "<br />\n";
         print $begin_result_liste;
         if ($this->rec_history) {
             //Affichage des liens paniers et impression
             $current = $_SESSION["CURRENT"];
             if ($current !== false) {
                 $tri_id_info = $_SESSION["tri"] ? "&sort_id=" . $_SESSION["tri"] : "";
                 print "&nbsp;<a href='#' onClick=\"openPopUp('./print_cart.php?current_print={$current}&action=print_prepare{$tri_id_info}','print',600,700,-2,-2,'scrollbars=yes,menubar=0,resizable=yes'); return false;\"><img src='./images/basket_small_20x20.gif' border='0' align='center' alt=\"" . $msg["histo_add_to_cart"] . "\" title=\"" . $msg["histo_add_to_cart"] . "\"></a>&nbsp;<a href='#' onClick=\"openPopUp('./print.php?current_print={$current}&action_print=print_prepare{$tri_id_info}','print',500,600,-2,-2,'scrollbars=yes,menubar=0'); w.focus(); return false;\"><img src='./images/print.gif' border='0' align='center' alt=\"" . $msg["histo_print"] . "\" title=\"" . $msg["histo_print"] . "\"/></a>";
                 print "&nbsp;<a href='#' onClick=\"openPopUp('./download.php?current_download={$current}&action_download=download_prepare" . $tri_id_info . "','download',500,600,-2,-2,'scrollbars=yes,menubar=0'); return false;\"><img src='./images/upload.gif' border='0' align='center' alt=\"" . $msg["docnum_download"] . "\" title=\"" . $msg["docnum_download"] . "\"/></a>";
                 if ($pmb_allow_external_search) {
                     if ($recherche_externe) {
                         $tag_a = "href='catalog.php?categ=search&mode=7&from_mode=6&external_type=multi'";
                     } else {
                         $tag_a = "onClick=\"alert('" . $msg["search_interdite_externe"] . "')\"";
                     }
                     print "&nbsp;<a " . $tag_a . "  title='" . $msg["connecteurs_external_search_sources"] . "'><img src='./images/external_search.png' border='0' align='center' alt=\"" . $msg["connecteurs_external_search_sources"] . "\"/></a>";
                 }
                 if ($nb_results <= $pmb_nb_max_tri) {
                     print $affich_tris_result_liste;
                 }
             }
         }
     } else {
         print "<br />" . $msg["1915"] . " ";
     }
     print "<input type='button' class='bouton' onClick=\"document.search_form.action='{$url_to_search_form}'; document.search_form.target='{$search_target}'; document.search_form.submit(); return false;\" value=\"" . $msg["search_back"] . "\"/>";
     global $dsi_active;
     if ($dsi_active && !$opac_view_id) {
         global $id_equation, $priv_pro, $id_empr;
         if ($id_equation) {
             $mess_bouton = $msg['dsi_sauvegarder_equation'];
         } else {
             $mess_bouton = $msg["dsi_transformer_equation"];
         }
         print "&nbsp;<input  type='button' class='bouton' onClick=\"document.forms['transform_dsi'].submit(); \" value=\"" . $mess_bouton . "\"/>\n\t\t\t\t\t\t<form name='transform_dsi' style='display:none;' method='post' action='./dsi.php'>";
         if ($priv_pro == "PRI") {
             print "\n\t\t\t\t\t\t<input type=hidden name='categ' value='bannettes' />\n\t\t\t\t\t\t<input type=hidden name='sub' value='abo' />\n\t\t\t\t\t\t<input type=hidden name='suite' value='transform_equ' />\n\t\t\t\t\t\t<input type=hidden name='id_equation' value='{$id_equation}' />\n\t\t\t\t\t\t<input type=hidden name='id_empr' value='{$id_empr}' />\n\t\t\t\t\t\t<input type=hidden name='requete' value='" . htmlentities($this->serialize_search(), ENT_QUOTES, $charset) . "' />\n\t\t\t\t\t\t</form>";
         } else {
             print "\n\t\t\t\t\t\t<input type=hidden name='categ' value='equations' />\n\t\t\t\t\t\t<input type=hidden name='sub' value='gestion' />\n\t\t\t\t\t\t<input type=hidden name='suite' value='transform' />\n\t\t\t\t\t\t<input type=hidden name='id_equation' value='{$id_equation}' />\n\t\t\t\t\t\t<input type=hidden name='requete' value='" . htmlentities($this->serialize_search(), ENT_QUOTES, $charset) . "' />\n\t\t\t\t\t\t</form>";
         }
     }
     global $pmb_opac_view_activate;
     if ($pmb_opac_view_activate) {
         if ($opac_view_id) {
             $mess_bouton = $msg['opac_view_sauvegarder_equation'];
             print "\n\t\t\t\t\t&nbsp;<input  type='button' class='bouton' onClick=\"document.forms['transform_opac_view'].submit(); \" value=\"" . $mess_bouton . "\"/>\n\t\t\t\t\t<form name='transform_opac_view' style='display:none;' method='post' action='./admin.php?categ=opac&sub=opac_view&section=list&action=form&opac_view_id={$opac_view_id}'>\t\t\t\t\t\t\n\t\t\t\t\t\t\t<input type=hidden name='suite' value='transform_equ' />\n\t\t\t\t\t\t\t<input type=hidden name='opac_view_id' value='{$opac_view_id}' />\n\t\t\t\t\t\t\t<input type=hidden name='requete' value='" . htmlentities($this->serialize_search(), ENT_QUOTES, $charset) . "' />\n\t\t\t\t\t</form>";
         }
     }
     // transformation de la recherche en multicriteres: on reposte tout avec mode=8
     if (!$opac_view_id) {
         print "&nbsp;<input  type='button' class='bouton' onClick='document.search_transform.submit(); return false;' value=\"" . $msg["search_notice_to_expl_transformation"] . "\"/>";
         print "<form name='search_transform' action='./catalog.php?categ=search&mode=8&sub=launch' style=\"display:none\" method='post'>";
         $memo_search = "";
         foreach ($_POST as $key => $val) {
             if ($val) {
                 if (is_array($val)) {
                     foreach ($val as $cle => $val_array) {
                         if (is_array($val_array)) {
                             foreach ($val_array as $valeur) {
                                 $memo_search .= "<input type='hidden' name=\"" . $key . "[" . $cle . "][]\" value='" . htmlentities($valeur, ENT_QUOTES, $charset) . "'/>";
                             }
                         } else {
                             $memo_search .= "<input type='hidden' name='" . $key . "[]' value='" . htmlentities($val_array, ENT_QUOTES, $charset) . "'/>";
                         }
                     }
                 } else {
                     $memo_search .= "<input type='hidden' name='{$key}' value='{$val}'/>";
                 }
             }
         }
         print "{$memo_search}</form>";
     }
     //transformation en set pour connecteur externe
     global $id_connector_set;
     $id_connector_set += 0;
     //Il faut que l'on soit passé par le formulaire d'édition de set pour avoir $id_connector_set pour ne pas avoir le bouton tout le temps vu qu'il sert rarement
     if ($pmb_allow_external_search && SESSrights & ADMINISTRATION_AUTH && $id_connector_set) {
         //Il faut qu'il y ait des sets multi critères si on veut pouvoir associer la recherche à quelque chose
         if (connector_out_sets::get_typed_set_count(2)) {
             print '<form name="export_to_outset" style="display:none;" method="post" action="./admin.php?categ=connecteurs&sub=out_sets&action=import_notice_search_into_set&candidate_id=' . $id_connector_set . '"><input type="hidden" name="toset_search" value="' . htmlentities($this->serialize_search(), ENT_QUOTES, $charset) . '" /></form>';
             print '&nbsp;<input type="button" onClick="document.forms[\'export_to_outset\'].submit(); " class="bouton" value="' . htmlentities($msg["search_notice_to_connector_out_set"], ENT_QUOTES, $charset) . '">';
         }
     }
     print $this->get_current_search_map();
     while ($r = pmb_mysql_fetch_object($resultat)) {
         if ($nb++ > 5) {
             $recherche_ajax_mode = 1;
         }
         switch ($r->niveau_biblio) {
             case 'm':
                 // notice de monographie
                 $nt = new mono_display($r->notice_id, 6, $this->link, 1, $this->link_expl, '', $this->link_explnum, 1, 0, 1, 1, "", 1, false, true, $recherche_ajax_mode, 1);
                 break;
             case 's':
                 // on a affaire a un periodique
                 // function serial_display ($id, $level='1', $action_serial='', $action_analysis='', $action_bulletin='', $lien_suppr_cart="", $lien_explnum="", $bouton_explnum=1,$print=0,$show_explnum=1, $show_statut=0, $show_opac_hidden_fields=true, $draggable=0 ) {
                 $nt = new serial_display($r->notice_id, 6, $this->link_serial, $this->link_analysis, $this->link_bulletin, "", $this->link_explnum_serial, 0, 0, 1, 1, true, 1, $recherche_ajax_mode);
                 break;
             case 'a':
                 // on a affaire a un article
                 // function serial_display ($id, $level='1', $action_serial='', $action_analysis='', $action_bulletin='', $lien_suppr_cart="", $lien_explnum="", $bouton_explnum=1,$print=0,$show_explnum=1, $show_statut=0, $show_opac_hidden_fields=true, $draggable=0 ) {
                 $nt = new serial_display($r->notice_id, 6, $this->link_serial, $this->link_analysis, $this->link_bulletin, "", $this->link_explnum_analysis, 0, 0, 1, 1, true, 1, $recherche_ajax_mode);
                 break;
             case 'b':
                 // on a affaire a un bulletin
                 $rqt_bull_info = "SELECT s.notice_id as id_notice_mere, bulletin_id as id_du_bulletin, b.notice_id as id_notice_bulletin FROM notices as s, notices as b, bulletins WHERE b.notice_id={$r->notice_id} and s.notice_id=bulletin_notice and num_notice=b.notice_id";
                 $bull_ids = @pmb_mysql_fetch_object(pmb_mysql_query($rqt_bull_info));
                 if (!$link_bulletin) {
                     $link_bulletin = './catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=' . $bull_ids->id_du_bulletin;
                 } else {
                     $link_bulletin = str_replace("!!id!!", $bull_ids->id_du_bulletin, $link_bulletin);
                 }
                 if ($this->link_explnum_bulletin) {
                     $link_explnum_bulletin = str_replace("!!bul_id!!", $bull_ids->id_du_bulletin, $this->link_explnum_bulletin);
                 } else {
                     $link_explnum_bulletin = "";
                 }
                 $nt = new mono_display($r->notice_id, 6, $link_bulletin, 1, $this->link_expl, '', $link_explnum_bulletin, 1, 0, 1, 1, "", 1, false, true, $recherche_ajax_mode);
                 $link_bulletin = '';
                 break;
         }
         echo "<div class='row'>" . $nt->result . "</div>";
     }
     //Gestion de la pagination
     if ($nb_results) {
         $n_max_page = ceil($nb_results / $nb_per_page_search);
         if (!$page) {
             $page_en_cours = 0;
         } else {
             $page_en_cours = $page;
         }
         // affichage du lien precedent si necessaire
         if ($page > 0) {
             $nav_bar .= "<a href='#' onClick='document.search_form.page.value-=1; ";
             if (!$hidden_form) {
                 $nav_bar .= "document.search_form.launch_search.value=1; ";
             }
             $nav_bar .= "document.search_form.submit(); return false;'>";
             $nav_bar .= "<img src='./images/left.gif' border='0'  title='" . $msg[48] . "' alt='[" . $msg[48] . "]' hspace='3' align='middle'/>";
             $nav_bar .= "</a>";
         }
         $deb = $page_en_cours - 10;
         if ($deb < 0) {
             $deb = 0;
         }
         for ($i = $deb; $i < $n_max_page && $i < $page_en_cours + 10; $i++) {
             if ($i == $page_en_cours) {
                 $nav_bar .= "<strong>" . ($i + 1) . "</strong>";
             } else {
                 $nav_bar .= "<a href='#' onClick=\"if ((isNaN(document.search_form.page.value))||(document.search_form.page.value=='')) document.search_form.page.value=1; else document.search_form.page.value=" . $i . "; ";
                 if (!$hidden_form) {
                     $nav_bar .= "document.search_form.launch_search.value=1; ";
                 }
                 $nav_bar .= "document.search_form.submit(); return false;\">";
                 $nav_bar .= $i + 1;
                 $nav_bar .= "</a>";
             }
             if ($i < $n_max_page) {
                 $nav_bar .= " ";
             }
         }
         if ($page + 1 < $n_max_page) {
             $nav_bar .= "<a href='#' onClick=\"if ((isNaN(document.search_form.page.value))||(document.search_form.page.value=='')) document.search_form.page.value=1; else document.search_form.page.value=parseInt(document.search_form.page.value)+parseInt(1); ";
             if (!$hidden_form) {
                 $nav_bar .= "document.search_form.launch_search.value=1; ";
             }
             $nav_bar .= "document.search_form.submit(); return false;\">";
             $nav_bar .= "<img src='./images/right.gif' border='0' title='" . $msg[49] . "' alt='[" . $msg[49] . "]' hspace='3' align='middle'>";
             $nav_bar .= "</a>";
         } else {
             $nav_bar .= "";
         }
         $nav_bar = "<div align='center'>{$nav_bar}</div>";
         echo $nav_bar;
     }
 }
Beispiel #7
0
             if ($p) {
                 $requete = substr($requete, 0, $p);
             }
         }
     } else {
         $requete .= ",notices where notices.notice_id={$table}.notice_id";
         if ($environement["pager"]) {
             $requete .= " limit " . $nb_per_page_search * $page . ",{$nb_per_page_search}";
         }
     }
     break;
 case "cart":
     $requete = "select object_id as notice_id from caddie_content";
     if ($_SESSION["tri"]) {
         $requete .= " where caddie_id=" . $idcaddie;
         $sort = new sort('notices', 'base');
         if ($nb_per_page_search) {
             $requete = $sort->appliquer_tri($_SESSION["tri"], $requete, "notice_id", $nb_per_page_search * ($page - 1), $nb_per_page_search);
         } else {
             $requete = $sort->appliquer_tri($_SESSION["tri"], $requete, "notice_id", 0, 0);
         }
         if (!$environement["pager"]) {
             $p = stripos($requete, "limit");
             if ($p) {
                 $requete = substr($requete, 0, $p);
             }
         }
     } else {
         $requete .= ",notices where notices.notice_id=caddie_content.object_id and caddie_id=" . $idcaddie;
         $orderby = " order by index_sew";
         if ($environement["pager"]) {
 function get_results($first_index, $number_to_fetch, $sort_type = "", $delete_expired = true)
 {
     global $dbh;
     $this->update();
     $records = array();
     $requete = $this->cache->get_objectref_list_with_content_sql(CACHE_TYPE_NOTICE, $this->search_realm . "_" . $this->search_unique_id, 'pmbesSearch', "notice_id", "pert", false, false, $delete_expired);
     if (!$this->external_search && $sort_type) {
         global $class_path;
         require_once $class_path . '/sort.class.php';
         $sort = new sort('notices', 'base');
         $tri = array("nom_tri" => "", "tri_par" => $sort_type);
         $requete = $sort->appliquer_tri($tri, $requete, "notice_id", $first_index, $number_to_fetch);
         $requete = "SELECT notice_id FROM (" . $requete . ") as every_derived_table_must_have_its_own_alias";
     } else {
         $limit_from = $first_index + 0;
         $limit_count = $number_to_fetch + 0;
         if ($limit_from !== false && $limit_count) {
             $limit = " LIMIT " . $limit_from . ',' . $limit_count;
         } else {
             $limit = "";
         }
         $requete .= $limit;
     }
     $res = pmb_mysql_query($requete, $dbh);
     while ($row = pmb_mysql_fetch_assoc($res)) {
         $records[] = $row["notice_id"];
     }
     return $records;
 }
Beispiel #9
0
     print "<br /><br />";
     if ($opac_resa_popup) {
         print "<input type='button' id='show_cart_reserve' class='bouton' value=\"" . $msg["show_cart_reserve"] . "\" title=\"" . $msg["show_cart_reserve_title"] . "\" \n\t\t\t\t\tonClick=\"\n\t\t\t\t\t\tw=window.open('./do_resa.php?lvl=resa_cart&sub=resa_cart','doresa','scrollbars=yes,width=900,height=300,menubar=0,resizable=yes'); w.focus(); return false;\n\t\t\t\t\t\" /><span class=\"espaceCartAction\">&nbsp;</span>\n\n\t\t\t\t   <input type='button' id='show_cart_reserve_checked' class='bouton' value=\"" . $msg["show_cart_reserve_checked"] . "\" title=\"" . $msg["show_cart_reserve_checked_title"] . "\" \n\t\t\t\t\tonClick=\"\n\t\t\t\t\t\tvar notice='';\n\t\t\t\t\t\tvar data=document.forms['cart_form'].elements['notice[]'];\n\t\t\t\t   \t\t\t   \t\t\n\t\t\t\t\t\tif(typeof(data.length) != 'undefined'){\n\t\t\t\t   \t\t\tfor (var key = 0; key < data.length; key++) {\n\t\t\t\t\t\t\t\tif(data[key].checked && data[key].value){\n\t\t\t\t\t\t\t\t\tnotice+='&notice[]='+data[key].value;\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif(data.checked && data.value){\n\t\t\t\t\t\t\t\tnotice+='&notice[]='+data.value;\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(notice!=''){\n\t\t\t\t\t\t\tw=window.open('./do_resa.php?lvl=resa_cart&sub=resa_cart_checked'+notice,'doresa','scrollbars=yes,width=900,height=300,menubar=0,resizable=yes');\n\t\t\t\t\t\t\tw.focus(); \n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\talert('" . $msg["resa_no_doc_selected"] . "')\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\" /><br /><br />";
     } else {
         print "<input type='button' id='show_cart_reserve' class='bouton' value=\"" . $msg["show_cart_reserve"] . "\" title=\"" . $msg["show_cart_reserve_title"] . "\" onClick=\"\n\t\t\t\t\t\tdocument.location='./do_resa.php?lvl=resa_cart&sub=resa_cart';\n\t\t\t\t\t\" /><span class=\"espaceCartAction\">&nbsp;</span>\n\t\t\t\t   <input type='button' id='show_cart_reserve_checked' class='bouton' value=\"" . $msg["show_cart_reserve_checked"] . "\" title=\"" . $msg["show_cart_reserve_checked_title"] . "\" onClick=\"\n\t\t\t\t\t\tvar notice='';\n\t\t\t\t\t\tvar data=document.forms['cart_form'].elements['notice[]'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(typeof(data.length) != 'undefined'){\n\t\t\t\t\t\t\tfor (var key = 0; key < data.length; key++) {\n\t\t\t\t\t\t\t\tif(data[key].checked && data[key].value){\n\t\t\t\t\t\t\t\t\tnotice+='&notice[]='+data[key].value;\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif(data.checked && data.value){\n\t\t\t\t\t\t\t\tnotice+='&notice[]='+data.value;\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(notice!=''){\n\t\t\t\t\t\t\tdocument.location='./do_resa.php?lvl=resa_cart&sub=resa_cart_checked'+notice;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\talert('" . $msg["resa_no_doc_selected"] . "')\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\" /><br /><br />";
     }
     //on récupère le tableau des résa de resa_cart.inc.php
     global $resa_cart_display;
     if ($resa_cart_display && !$opac_resa_popup) {
         //on imprime le tableau d'affichage sur la page du panier
         print $resa_cart_display;
     }
 }
 //Tri
 if ($_SESSION["last_sortnotices"] != "") {
     $sort = new sort('notices', 'session');
     $sql = "SELECT notice_id FROM notices WHERE notice_id IN (";
     for ($z = 0; $z < count($cart_); $z++) {
         $sql .= "'" . $cart_[$z] . "',";
     }
     $sql = substr($sql, 0, strlen($sql) - 1) . ")";
     $sql = $sort->appliquer_tri($_SESSION["last_sortnotices"], $sql, "notice_id", 0, 0);
 } else {
     $sql = "select notice_id from notices where notice_id in ('" . implode("','", $cart_) . "') order by tit1";
 }
 $res = pmb_mysql_query($sql, $dbh);
 $cart_ = array();
 while ($r = pmb_mysql_fetch_object($res)) {
     $cart_[] = $r->notice_id;
 }
 if ($cart_ext) {
Beispiel #10
0
     }
     print pmb_bidi($etagere_form);
     break;
 case 'edit_etagere':
     $myEtagere = new etagere($idetagere);
     $etagere_form = str_replace('!!formulaire_titre!!', $msg['etagere_edit_etagere'], $etagere_form);
     $etagere_form = str_replace('!!formulaire_action!!', "./catalog.php?categ=etagere&sub=gestion&action=save_etagere&idetagere={$idetagere}", $etagere_form);
     $etagere_form = str_replace('!!formulaire_annuler!!', "./catalog.php?categ=etagere&sub=gestion&action=", $etagere_form);
     $etagere_form = str_replace('!!idetagere!!', $idetagere, $etagere_form);
     $etagere_form = str_replace('!!name!!', htmlentities($myEtagere->name, ENT_QUOTES, $charset), $etagere_form);
     $bouton_suppr = "<input type='button' class='bouton' value=' {$msg['supprimer']} ' onClick=\"javascript:confirmation_delete({$idetagere},'" . htmlentities(addslashes($myEtagere->name), ENT_QUOTES, $charset) . "')\" />";
     $etagere_form = str_replace('<!--!!bouton_suppr!!-->', $bouton_suppr, $etagere_form);
     $etagere_form = str_replace('!!comment!!', $myEtagere->comment, $etagere_form);
     $etagere_form = str_replace('!!autorisations_users!!', aff_form_autorisations_etagere($myEtagere->autorisations, 0), $etagere_form);
     if ($myEtagere->id_tri > 0) {
         $sort = new sort("notices", "base");
         $etagere_form = str_replace('!!tri!!', $myEtagere->id_tri, $etagere_form);
         $etagere_form = str_replace('!!tri_name!!', $sort->descriptionTriParId($myEtagere->id_tri), $etagere_form);
     } else {
         $etagere_form = str_replace('!!tri!!', "", $etagere_form);
         $etagere_form = str_replace('!!tri_name!!', $msg['etagere_form_no_active_tri'], $etagere_form);
     }
     if ($myEtagere->validite) {
         $etagere_form = str_replace('!!checkbox_all!!', "checked", $etagere_form);
         $etagere_form = str_replace('!!form_visible_deb!!', "", $etagere_form);
         $etagere_form = str_replace('!!form_visible_fin!!', "", $etagere_form);
     } else {
         $etagere_form = str_replace('!!checkbox_all!!', "", $etagere_form);
         $etagere_form = str_replace('!!form_visible_deb!!', $myEtagere->validite_date_deb_f, $etagere_form);
         $etagere_form = str_replace('!!form_visible_fin!!', $myEtagere->validite_date_fin_f, $etagere_form);
     }
Beispiel #11
0
     $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);
     print $affich_tris_result_liste;
     if ($_SESSION["last_sortnotices"] != "") {
         $sort = new sort('notices', 'session');
         print "<span class='sort'>" . $msg['tri_par'] . " " . $sort->descriptionTriParId($_SESSION["last_sortnotices"]) . "&nbsp;</span>";
     } elseif ($opac_default_sort_display) {
         $sort = new sort('notices', 'session');
         print "<span class='sort'>" . $msg['tri_par'] . " " . $sort->descriptionTriParId("default") . "&nbsp;</span>";
     }
 } else {
     print "&nbsp;";
 }
 //fin gestion du tri
 print $add_cart_link;
 if ($opac_visionneuse_allow && $nbexplnum_to_photo) {
     print "&nbsp;&nbsp;&nbsp;" . $link_to_visionneuse;
     print $sendToVisionneuseByPost;
 }
 //affinage
 //enregistrement de l'endroit actuel dans la session
 if ($_SESSION["last_query"]) {
     $n = $_SESSION["last_query"];
Beispiel #12
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: sort.inc.php,v 1.34 2007/06/08 16:55:57 jlesaint
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
// gestion du tri
require_once $include_path . "/templates/sort.tpl.php";
require_once $class_path . "/sort.class.php";
$sort = new sort('notices', 'session');
//Si vidage historique des tris demandé ?
if ($raz_sort) {
    if (isset($_POST['cases_suppr']) && !empty($_POST['cases_suppr'])) {
        $cases_a_suppr = $_POST['cases_suppr'];
        $sort->supprimer($cases_a_suppr);
    }
}
if (isset($_GET['page_en_cours'])) {
    $page_en_cours = $_GET['page_en_cours'];
}
if (isset($_GET['modif_sort'])) {
    $temp = array();
    for ($i = 0; $i <= 4; $i++) {
        if ($_POST['liste_critere' . $i] != "") {
            $temp[$i] = $_POST['croit_decroit' . $i] . "_" . $_POST['num_text' . $i] . "_" . $_POST['liste_critere' . $i];
        }
    }
    if (count($temp) != 0) {
Beispiel #13
0
 public function get_explnums($tri)
 {
     global $gestion_acces_active;
     global $gestion_acces_empr_notice;
     $this->explnums = array();
     $this->get_result();
     //$table = $this->_get_pert();
     $this->_get_pert();
     //liste complete des résultats..;
     if ($this->notices_ids != "") {
         $sort = new sort("notices", "session");
         //$query = $sort->appliquer_tri_from_tmp_table($tri,$table,"notice_id",0,0);
         $query = $sort->appliquer_tri_from_tmp_table($tri, $this->table_tempo, "notice_id", 0, 0);
         //vérification de la visibilité des documents numériques
         $acces_j = '';
         if ($gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) {
             $ac = new acces();
             $dom_2 = $ac->setDomain(2);
             $join = $dom_2->getJoin($_SESSION['id_empr_session'], 16, 'notice_id');
         }
         if (!$join) {
             $join = "join notices on " . $sort->table_tri_tempo . ".notice_id = notices.notice_id join notice_statut on notices.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)" : "") . ")";
         }
         $explnum_noti = "select explnum_id," . $sort->table_tri_tempo . ".* from explnum join " . $sort->table_tri_tempo . " on explnum_notice!=0 and explnum_notice = " . $sort->table_tri_tempo . ".notice_id {$join}";
         $rqt = "create temporary table explnum_list {$explnum_noti}";
         mysql_query($rqt);
         $explnum_issue = "select explnum_id," . $sort->table_tri_tempo . ".* from explnum join bulletins on explnum_bulletin!=0 and bulletin_id = explnum_bulletin join " . $sort->table_tri_tempo . " on num_notice != 0 and num_notice = " . $sort->table_tri_tempo . ".notice_id {$join}";
         $rqt = "insert ignore into explnum_list {$explnum_issue}";
         mysql_query($rqt);
         mysql_query("alter table explnum_list order by " . $sort->get_order_by($tri));
         $rqt = "select explnum_id from explnum_list order by " . $sort->get_order_by($tri);
         $res = mysql_query($rqt);
         //si get_order_by renvoit une valeur nulle, on ne s'occupe pas du tri.
         if (!$res) {
             $rqt = "select explnum_id from explnum_list";
             $res = mysql_query($rqt);
         }
         if ($res) {
             if (mysql_num_rows($res)) {
                 while ($row = mysql_fetch_object($res)) {
                     $this->explnums[] = $row->explnum_id;
                 }
             }
         }
     }
     return $this->explnums;
 }
Beispiel #14
0
    case "1":
        $simili_search_call = "show_simili_search_all();show_expl_voisin_search_all();";
        break;
    case "2":
        $simili_search_call = "show_expl_voisin_search_all();";
        break;
    case "3":
        $simili_search_call = "show_simili_search_all()";
        break;
}
if ($opac_recherche_ajax_mode) {
    $begin_result_liste = "<span class=\"expandAll\"><a href='javascript:expandAll_ajax(" . $opac_recherche_ajax_mode . ");{$simili_search_call}'><img class='img_plusplus' src='./images/expand_all.gif' border='0' id='expandall'></a></span><span class=\"espaceResultSearch\">&nbsp;</span><span class=\"collapseAll\"><a href='javascript:collapseAll()'><img class='img_moinsmoins' src='./images/collapse_all.gif' border='0' id='collapseall'></a></span>";
} else {
    $begin_result_liste = "<span class=\"expandAll\"><a href='javascript:expandAll()'><img class='img_plusplus' src='./images/expand_all.gif' border='0' id='expandall'></a></span><span class=\"espaceResultSearch\">&nbsp;</span><span class=\"collapseAll\"><a href='javascript:collapseAll()'><img class='img_moinsmoins' src='./images/collapse_all.gif' border='0' id='collapseall'></a></span>";
}
$affich_tris_result_liste .= sort::show_tris_selector();
define('AFF_ETA_NOTICES_NON', 0);
define('AFF_ETA_NOTICES_ISBD', 1);
define('AFF_ETA_NOTICES_PUBLIC', 2);
define('AFF_ETA_NOTICES_BOTH', 4);
define('AFF_ETA_NOTICES_BOTH_ISBD_FIRST', 5);
define('AFF_ETA_NOTICES_REDUIT', 8);
define('AFF_ETA_NOTICES_DEPLIABLES_NON', 0);
define('AFF_ETA_NOTICES_DEPLIABLES_OUI', 1);
define('AFF_ETA_NOTICES_TEMPLATE_DJANGO', 9);
define('AFF_BAN_NOTICES_NON', 0);
define('AFF_BAN_NOTICES_ISBD', 1);
define('AFF_BAN_NOTICES_PUBLIC', 2);
define('AFF_BAN_NOTICES_BOTH', 4);
define('AFF_BAN_NOTICES_BOTH_ISBD_FIRST', 5);
define('AFF_BAN_NOTICES_REDUIT', 8);
Beispiel #15
0
if ($_REQUEST["type_tri"]) {
    $triType = $_REQUEST["type_tri"];
} else {
    //par defaut affichage de la liste des tris
    $triType = "notices";
}
//action (par defaut:affliste)
if ($_REQUEST["action_tri"]) {
    $actionTri = $_REQUEST["action_tri"];
} else {
    //par defaut affichage de la liste des tris
    $actionTri = "affliste";
}
//echo "action:".$actionTri."<br />";
//déclaration de la classe
$sort = new sort($triType, 'base');
$sort->caller = $_REQUEST['caller'];
switch ($actionTri) {
    case "enreg":
        //insertion ou modification d'un tri
        if ($_REQUEST['id_tri']) {
            //c'est une modification car on a un identifiant
            $id_tri = $_REQUEST['id_tri'];
        } else {
            //c'est une insertion car on a pas d'id
            $id_tri = "";
        }
        if ($_REQUEST['nom_tri']) {
            $nom_tri = $_REQUEST['nom_tri'];
        }
        if (isset($_REQUEST['liste_sel']) && !empty($_REQUEST['liste_sel'])) {
Beispiel #16
0
function aff_cart_objects($idcaddie = 0, $url_base = "./catalog.php?categ=caddie&sub=gestion&quoi=panier&idcaddie=0", $no_del = false, $rec_history = 0, $no_point = false)
{
    global $msg;
    global $dbh;
    global $begin_result_liste, $end_result_liste;
    global $affich_tris_result_liste;
    global $pmb_nb_max_tri;
    global $nbr_lignes, $page, $nb_per_page_search;
    global $url_base_suppr_cart;
    $url_base_suppr_cart = $url_base;
    $cb_display = "\n\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n\t    \t\t<span class=\"notice-heada\">!!heada!!</span>\n\t    \t\t<br />\n\t\t\t</div>\n\t\t\t";
    // nombre de références par pages
    if ($nb_per_page_search != "") {
        $nb_per_page = $nb_per_page_search;
    } else {
        $nb_per_page = 10;
    }
    // on récupére le nombre de lignes
    if (!$nbr_lignes) {
        $requete = "SELECT count(1) FROM caddie_content where caddie_id='" . $idcaddie . "' ";
        $res = pmb_mysql_query($requete, $dbh);
        $nbr_lignes = pmb_mysql_result($res, 0, 0);
    }
    if (!$page) {
        $page = 1;
    }
    $debut = ($page - 1) * $nb_per_page;
    //Calcul des variables pour la suppression de notices
    $modulo = $nbr_lignes % $nb_per_page;
    if ($modulo == 1) {
        $page_suppr = !$page ? 1 : $page - 1;
    } else {
        $page_suppr = $page;
    }
    $nb_after_suppr = $nbr_lignes ? $nbr_lignes - 1 : 0;
    if ($nbr_lignes) {
        // on lance la vraie requête
        $myCart = new caddie($idcaddie);
        $caddie_type = $myCart->type;
        switch ($caddie_type) {
            case "NOTI":
                $from = " caddie_content left join notices on notice_id = object_id ";
                $order_by = " index_sew ";
                break;
            case "EXPL":
                $from = " caddie_content left join exemplaires on expl_id=object_id left join notices on notice_id = expl_notice ";
                $order_by = " index_sew ";
                break;
            case "BULL":
                $from = " caddie_content left join bulletins on bulletin_id = object_id ";
                $order_by = " date_date ";
                break;
        }
        $requete = "SELECT * FROM {$from} where caddie_id='" . $idcaddie . "' order by {$order_by}";
        $requete .= " LIMIT {$debut},{$nb_per_page} ";
        //gestion du tri
        if ($caddie_type == "NOTI") {
            if ($nbr_lignes <= $pmb_nb_max_tri) {
                if ($_SESSION["tri"]) {
                    $requete = "SELECT notice_id,caddie_content.* FROM {$from} where caddie_id='" . $idcaddie . "'";
                    $sort = new sort('notices', 'base');
                    $requete = $sort->appliquer_tri($_SESSION["tri"], $requete, "notice_id", $debut, $nb_per_page);
                }
            }
        }
        // fin gestion tri
        $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true);
        // l'affichage du résultat est fait après le else
    } else {
        print $msg[399];
        return;
    }
    $liste = array();
    $result = @pmb_mysql_query($requete, $dbh);
    // or die (pmb_mysql_error());
    if ($result) {
        if (pmb_mysql_num_rows($result)) {
            while ($temp = pmb_mysql_fetch_object($result)) {
                $liste[] = array('object_id' => $temp->object_id, 'content' => $temp->content, 'blob_type' => $temp->blob_type, 'flag' => $temp->flag);
            }
        }
    }
    if (!sizeof($liste) || !is_array($liste)) {
        print $msg[399];
        return;
    } else {
        print "\n\t\t<script>\n\t\t\tvar ajax_pointage=new http_request();\n\t\t\tvar num_caddie=0;\n\t\t\tvar num_item=0;\n\t\t\tvar action='';\n\t\t\tfunction add_pointage_item(idcaddie,id_item) {\n\t\t\t\tnum_caddie=idcaddie;\n\t\t\t\tnum_item=id_item;\n\t\t\t\taction='add_item';\t\n\t\t\t\tvar url = './ajax.php?module=catalog&categ=pointage_add&sub=pointage&moyen=manu&action=add_item&idcaddie='+idcaddie+'&id_item='+id_item;\n\t\t \t\tajax_pointage.request(url,0,'',1,pointage_callback,0,0);\n\t\t\t}\n\t\t\t\n\t\t\tfunction del_pointage_item(idcaddie,id_item) {\n\t\t\t\tnum_caddie=idcaddie;\n\t\t\t\tnum_item=id_item;\n\t\t\t\taction='del_item';\n\t\t\t\tvar url = './ajax.php?module=catalog&categ=pointage_del&sub=pointage&moyen=manu&action=del_item&idcaddie='+idcaddie+'&id_item='+id_item;\n\t\t\t\tajax_pointage.request(url,0,'',1,pointage_callback,0,0);   \n\t\t\t}\n\t\t\tfunction pointage_callback(response) {\n\t\t\t\tdata = eval('('+response+')');\n\t\t\t\tswitch (action) {\n\t\t\t\t\tcase 'add_item':\n\t\t\t\t\t\tif (data.res_pointage == 1) {\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).src='./images/depointer.png';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).title='" . $msg['caddie_item_depointer'] . "';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).setAttribute('onclick','del_pointage_item('+num_caddie+','+num_item+')');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).src='./images/pointer.png';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).title='" . $msg['caddie_item_pointer'] . "';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).setAttribute('onclick','add_pointage_item('+num_caddie+','+num_item+')');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'del_item':\n\t\t\t\t\t\tif (data.res_pointage == 1) {\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).src='./images/pointer.png';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).title='" . $msg['caddie_item_pointer'] . "';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).setAttribute('onclick','add_pointage_item('+num_caddie+','+num_item+')');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).src='./images/depointer.png';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).title='" . $msg['caddie_item_depointer'] . "';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).setAttribute('onclick','del_pointage_item('+num_caddie+','+num_item+')');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tvar div = document.createElement('div');\n\t\t\t\tdiv.setAttribute('id','cart_'+data.idcaddie+'_nb_items');\n\t\t\t\tdiv.innerHTML = data.aff_cart_nb_items;\n\t\t\t\tdocument.getElementById('cart_'+data.idcaddie+'_nb_items').parentNode.replaceChild(div,document.getElementById('cart_'+data.idcaddie+'_nb_items'));\n\t\t\t}\n\t\t</script>";
        // en fonction du type de caddie on affiche ce qu'il faut
        if ($caddie_type == "NOTI") {
            // boucle de parcours des notices trouvées
            // inclusion du javascript de gestion des listes dépliables
            // début de liste
            print $begin_result_liste;
            //Affichage du lien impression et panier
            if ($rec_history && $_SESSION["CURRENT"] !== false) {
                $current = $_SESSION["CURRENT"];
                print "&nbsp;<a href='#' onClick=\"openPopUp('./print_cart.php?current_print={$current}&action=print_prepare','print',600,700,-2,-2,'scrollbars=yes,menubar=0'); return false;\"><img src='./images/basket_small_20x20.gif' border='0' align='center' alt=\"" . $msg["histo_add_to_cart"] . "\" title=\"" . $msg["histo_add_to_cart"] . "\"></a>&nbsp;<a href='#' onClick=\"openPopUp('./print.php?current_print={$current}&action_print=print_prepare','print',500,600,-2,-2,'scrollbars=yes,menubar=0'); return false;\"><img src='./images/print.gif' border='0' align='center' alt=\"" . $msg["histo_print"] . "\" title=\"" . $msg["histo_print"] . "\"/></a>";
                print "&nbsp;<a href='#' onClick=\"openPopUp('./download.php?current_download={$current}&action_download=download_prepare" . $tri_id_info . "','download',500,600,-2,-2,'scrollbars=yes,menubar=0'); return false;\"><img src='./images/upload_docnum.gif' border='0' align='center' alt=\"" . $msg["docnum_download"] . "\" title=\"" . $msg["docnum_download"] . "\"/></a>";
                if ($nbr_lignes <= $pmb_nb_max_tri) {
                    print "&nbsp;" . $affich_tris_result_liste;
                }
            }
            print caddie::show_actions($idcaddie, $caddie_type);
            while (list($cle, $object) = each($liste)) {
                if ($object[content] == "") {
                    // affichage de la liste des notices sous la forme 'expandable'
                    $requete = "SELECT * FROM notices WHERE notice_id={$object['object_id']} LIMIT 1";
                    $fetch = pmb_mysql_query($requete);
                    if (pmb_mysql_num_rows($fetch)) {
                        $notice = pmb_mysql_fetch_object($fetch);
                        if ($notice->niveau_biblio == 'b') {
                            // notice de bulletin
                            $rqtbull = "select bulletin_id from bulletins where num_notice=" . $notice->notice_id;
                            $fetchbull = pmb_mysql_query($rqtbull);
                            $bull = pmb_mysql_fetch_object($fetchbull);
                            $link = "./catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=" . $bull->bulletin_id;
                            // pas affichés pour l'instant:
                            $link_expl = '';
                            $link_explnum = '';
                            if (!$no_point) {
                                if ($object[flag]) {
                                    $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>";
                                } else {
                                    $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>";
                                }
                            } else {
                                if ($object[flag]) {
                                    $marque_flag = "<img src='images/tick.gif'/>";
                                } else {
                                    $marque_flag = "";
                                }
                            }
                            if (!$no_del) {
                                $lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=NOTI&item={$notice->notice_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}";
                            } else {
                                $lien_suppr_cart = $marque_flag;
                            }
                            $display = new mono_display($notice, 6, $link, 1, $link_expl, $lien_suppr_cart, $link_explnum, 0, 0, 1, 1);
                            print pmb_bidi($display->result);
                        } elseif ($notice->niveau_biblio != 's' && $notice->niveau_biblio != 'a') {
                            // notice de monographie
                            $link = './catalog.php?categ=isbd&id=!!id!!';
                            $link_expl = './catalog.php?categ=edit_expl&id=!!notice_id!!&cb=!!expl_cb!!&expl_id=!!expl_id!!';
                            $link_explnum = './catalog.php?categ=edit_explnum&id=!!notice_id!!&explnum_id=!!explnum_id!!';
                            if (!$no_point) {
                                if ($object[flag]) {
                                    $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>";
                                } else {
                                    $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>";
                                }
                            } else {
                                if ($object[flag]) {
                                    $marque_flag = "<img src='images/tick.gif'/>";
                                } else {
                                    $marque_flag = "";
                                }
                            }
                            if (!$no_del) {
                                $lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=NOTI&item={$notice->notice_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}";
                            } else {
                                $lien_suppr_cart = $marque_flag;
                            }
                            $display = new mono_display($notice, 6, $link, 1, $link_expl, $lien_suppr_cart, $link_explnum, 0, 0, 1, 1);
                            print pmb_bidi($display->result);
                        } else {
                            // on a affaire à un périodique
                            // préparation des liens pour lui
                            $link_serial = './catalog.php?categ=serials&sub=view&serial_id=!!id!!';
                            $link_analysis = './catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=!!bul_id!!&art_to_show=!!id!!';
                            $link_bulletin = './catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=!!id!!';
                            if (!$no_point) {
                                if ($object[flag]) {
                                    $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>";
                                } else {
                                    $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>";
                                }
                            } else {
                                if ($object[flag]) {
                                    $marque_flag = "<img src='images/tick.gif'/>";
                                } else {
                                    $marque_flag = "";
                                }
                            }
                            if (!$no_del) {
                                $lien_suppr_cart = "<a href='{$url_base}&action=del_item&action=del_item&object_type=NOTI&item={$notice->notice_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}";
                            } else {
                                $lien_suppr_cart = $marque_flag;
                            }
                            if ($notice->niveau_biblio == 's') {
                                $link_explnum = "./catalog.php?categ=serials&sub=explnum_form&serial_id=!!serial_id!!&explnum_id=!!explnum_id!!";
                            } else {
                                $link_explnum = "./catalog.php?categ=serials&sub=analysis&action=explnum_form&bul_id=!!bul_id!!&analysis_id=!!analysis_id!!&explnum_id=!!explnum_id!!";
                            }
                            $serial = new serial_display($notice, 6, $link_serial, $link_analysis, $link_bulletin, $lien_suppr_cart, $link_explnum, 0, 0, 1, 1);
                            print pmb_bidi($serial->result);
                        }
                    }
                } else {
                    if ($object[flag]) {
                        $marque_flag = "<img src='images/tick.gif'/>";
                    } else {
                        $marque_flag = "";
                    }
                    if (!$no_del) {
                        $lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=EXPL_CB&item=" . $object[content] . "&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}";
                    } else {
                        $lien_suppr_cart = $marque_flag;
                    }
                    $cb_display = "\n\t\t\t\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n\t\t\t\t    \t\t<span class=\"notice-heada\"><strong>{$lien_suppr_cart} " . $msg["4014"] . " : {$object['content']}&nbsp;: {$msg[395]}</strong></span>\n\t\t\t\t    \t\t<br />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t";
                    print $cb_display;
                }
            }
            // fin de liste
            print $end_result_liste;
        }
        // fin si NOTI
        // si EXPL
        if ($caddie_type == "EXPL") {
            // boucle de parcours des exemplaires trouvés
            // inclusion du javascript de gestion des listes dépliables
            // début de liste
            print $begin_result_liste;
            print caddie::show_actions($idcaddie, $caddie_type);
            while (list($cle, $expl) = each($liste)) {
                if (!$expl[content]) {
                    if ($stuff = get_expl_info($expl[object_id])) {
                        if (!$no_point) {
                            if ($expl[flag]) {
                                $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $stuff->expl_id . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $stuff->expl_id . ");' style='cursor: pointer'/>";
                            } else {
                                $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $stuff->expl_id . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $stuff->expl_id . ");' style='cursor: pointer'/>";
                            }
                        } else {
                            if ($expl[flag]) {
                                $marque_flag = "<img src='images/tick.gif'/>";
                            } else {
                                $marque_flag = "";
                            }
                        }
                        if (!$no_del) {
                            $stuff->lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=EXPL&item={$stuff->expl_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}";
                        } else {
                            $stuff->lien_suppr_cart = $marque_flag;
                        }
                        $stuff = check_pret($stuff);
                        print pmb_bidi(print_info($stuff, 0, 1));
                    } else {
                        print "<strong>ID : {$expl['object_id']}&nbsp;: {$msg[395]}</strong>";
                    }
                } else {
                    if (!$no_point) {
                        if ($expl[flag]) {
                            $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $stuff->expl_id . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $stuff->expl_id . ");' style='cursor: pointer'/>";
                        } else {
                            $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $stuff->expl_id . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $stuff->expl_id . ");' style='cursor: pointer'/>";
                        }
                    } else {
                        if ($expl[flag]) {
                            $marque_flag = "<img src='images/tick.gif'/>";
                        } else {
                            $marque_flag = "";
                        }
                    }
                    if (!$no_del) {
                        $lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=EXPL_CB&item=" . $expl[content] . "&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}";
                    } else {
                        $lien_suppr_cart = $marque_flag;
                    }
                    $cb_display = "\n\t\t\t\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n\t\t\t\t    \t\t<span class=\"notice-heada\"><strong>{$lien_suppr_cart} Code-barre : {$expl['content']}&nbsp;: {$msg[395]}</strong></span>\n\t\t\t\t    \t\t<br />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t";
                    print $cb_display;
                }
            }
            // fin de liste
            print $end_result_liste;
        }
        // fin si EXPL
        if ($caddie_type == "BULL") {
            // boucle de parcours des bulletins trouvés
            // inclusion du javascript de gestion des listes dépliables
            // début de liste
            print $begin_result_liste;
            print caddie::show_actions($idcaddie, $caddie_type);
            while (list($cle, $expl) = each($liste)) {
                if (!$no_del) {
                    $show_del = 1;
                } else {
                    $show_del = 0;
                }
                if ($bull_aff = show_bulletinage_info($expl[object_id], 0, $show_del, $expl[flag], 1)) {
                    print pmb_bidi($bull_aff);
                } else {
                    if (!$no_point) {
                        if ($expl[flag]) {
                            $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $expl[object_id] . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $expl[object_id] . ");' style='cursor: pointer'/>";
                        } else {
                            $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $expl[object_id] . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $expl[object_id] . ");' style='cursor: pointer'/>";
                        }
                    } else {
                        if ($expl[flag]) {
                            $marque_flag = "<img src='images/tick.gif'/>";
                        } else {
                            $marque_flag = "";
                        }
                    }
                    if (!$no_del) {
                        $lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=EXPL_CB&item=" . $expl[content] . "&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}";
                    } else {
                        $lien_suppr_cart = $marque_flag;
                    }
                    $cb_display = "\n\t\t\t\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n\t\t\t\t    \t\t<span class=\"notice-heada\"><strong>{$lien_suppr_cart} Code-barre : {$expl['content']}&nbsp;: {$msg[395]}</strong></span>\n\t\t\t\t    \t\t<br />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t";
                    print $cb_display;
                }
            }
            // fin de liste
            print $end_result_liste;
        }
        // fin si BULL
    }
    print "<br />" . $nav_bar;
    return;
}
Beispiel #17
0
    }
    if ($current_module == "demandes") {
        require_once $base_path . "/alert/demandes.inc.php";
    }
    if (isset($aff_alerte)) {
        $aff_alerte = "<div class='erreur'>{$aff_alerte}</div>";
    }
    $extra_info = "<iframe frameborder='0' scrolling='auto' name='alerte' id='alerte' src='{$base_path}/alert.php?current_alert={$current_module}' class='{$current_module}'></iframe>";
    $extra_info = "<script type=\"text/javascript\">\n\t\tfunction get_alert() {\n\t\t\tif(!document.getElementById('div_alert')) return;\n\t\t\tif(!session_active) return;\n\t\t\tvar req = new http_request();\t\t\n\t\t\treq.request('{$base_path}/ajax.php?module=ajax&categ=alert&current_alert={$current_module}',0,'',1,get_alert_callback,'');\n\t\t\tsetTimeout('get_alert()',120000);\n\t\t}\t\n\t\t\n\t\tfunction get_alert_callback(text ) {\n\t\t\tstruct = eval('('+text+')');\n\t\t\tif(struct.state != 1 ){\n\t\t\t\tsession_active=0;\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsession_active=1;\n\t\t\tvar div_alert = document.getElementById('div_alert');\n\t\t\t//si les notifications sont en fonctionnement, on appelle le callback des alertes...\n\t\t\tif(typeof(notif) == 'object'){\n\t\t\t\tnotif.check_new_alert(struct);\n\t\t\t}\n\t\t\tdiv_alert.innerHTML = struct.separator+struct.html;\n\t\t}\n\t\t\n\t\tflag_get_alert=1;\n\t\tsession_active=1;\n\t</script>";
}
//	----------------------------------
// $footer : template footer standard
$footer = "\n<div id='footer'>\n\t<div class='row'>\n\t\n\t</div>\t\n</div>\n<script type=\"text/javascript\">\n\tif (init_drag && ((typeof no_init_drag=='undefined') || (no_init_drag==false)) ) init_drag();\n\tif (typeof flag_get_alert!=\"undefined\"){\n\t\tif (flag_get_alert) setTimeout('get_alert()',120000);\n\t}\n\tmenuAutoHide();\n</script>\n  </body>\n</html>\n";
/* listes dépliables et tris */
// ici, templates de gestion des listes dépliables et tris en résultat de recherche catalogage ou autres
if ($pmb_recherche_ajax_mode) {
    $begin_result_liste = "\n<script type=\"text/javascript\" src=\"" . $javascript_path . "/tablist.js\"></script>\n<a href=\"javascript:expandAll_ajax()\"><img src='./images/expand_all.gif' border='0' id=\"expandall\"></a>\n<a href=\"javascript:collapseAll()\"><img src='./images/collapse_all.gif' border='0' id=\"collapseall\"></a>\n";
} else {
    $begin_result_liste = "\n<script type=\"text/javascript\" src=\"" . $javascript_path . "/tablist.js\"></script>\n<a href=\"javascript:expandAll()\"><img src='./images/expand_all.gif' border='0' id=\"expandall\"></a>\n<a href=\"javascript:collapseAll()\"><img src='./images/collapse_all.gif' border='0' id=\"collapseall\"></a>\n";
}
$affich_tris_result_liste = "<a href=# onClick=\"document.getElementById('history').src='./sort.php?action=0'; document.getElementById('history').style.display='';return false;\" alt=\"" . $msg['tris_dispos'] . "\" title=\"" . $msg['tris_dispos'] . "\"><img src='./images/orderby_az.gif' align='middle' hspace='3'></a>";
if ($_SESSION["tri"]) {
    $sort = new sort("notices", "base");
    $affich_tris_result_liste .= $msg['tri_par'] . " " . $sort->descriptionTriParId($_SESSION["tri"]);
}
$affich_tris_result_liste .= "<br />";
$expand_result = "\n<script type=\"text/javascript\" src=\"./javascript/tablist.js\"></script>\n";
$end_result_list = "\n";
/* /listes dépliables et tris */
/* Editeur HTML DOJO */
$cms_dojo_plugins_editor = " data-dojo-props=\"extraPlugins:[\n\t\t\t{name: 'pastefromword', width: '400px', height: '200px'},\n\t\t\t{name: 'dojox.editor.plugins.TablePlugins', command: 'insertTable'},\n\t\t    {name: 'dojox.editor.plugins.TablePlugins', command: 'modifyTable'},\n\t\t    {name: 'dojox.editor.plugins.TablePlugins', command: 'InsertTableRowBefore'},\n\t\t    {name: 'dojox.editor.plugins.TablePlugins', command: 'InsertTableRowAfter'},\n\t\t    {name: 'dojox.editor.plugins.TablePlugins', command: 'insertTableColumnBefore'},\n\t\t    {name: 'dojox.editor.plugins.TablePlugins', command: 'insertTableColumnAfter'},\n\t\t    {name: 'dojox.editor.plugins.TablePlugins', command: 'deleteTableRow'},\n\t\t    {name: 'dojox.editor.plugins.TablePlugins', command: 'deleteTableColumn'},\n\t\t    {name: 'dojox.editor.plugins.TablePlugins', command: 'colorTableCell'},\n\t\t    {name: 'dojox.editor.plugins.TablePlugins', command: 'tableContextMenu'},\n\t\t    {name: 'dojox.editor.plugins.TablePlugins', command: 'ResizeTableColumn'},\n\t\t\t{name: 'fontName', plainText: true},\n\t\t\t{name: 'fontSize', plainText: true},\n\t\t\t{name: 'formatBlock', plainText: true},\n\t\t\t'foreColor','hiliteColor',\n\t\t\t'createLink','insertanchor', 'unlink', 'insertImage',\n\t\t\t'fullscreen',\n\t\t\t'viewsource'\n\n\t\t]\"\t";
Beispiel #18
0
if ($opac_photo_filtre_mimetype) {
    $requete_nbexplnum = "select count(*) from {$table_tempo_explnum} as uni where explnum_mimetype in ({$opac_photo_filtre_mimetype})";
    $res_nbexplnum = mysql_query($requete_nbexplnum);
    if (mysql_num_rows($res_nbexplnum)) {
        $nbexplnum = mysql_result($res_nbexplnum, 0, 0);
    }
}
//gestion du tri
if (isset($_GET["sort"])) {
    $_SESSION["last_sortnotices"] = $_GET["sort"];
}
if ($count > $opac_nb_max_tri) {
    $_SESSION["last_sortnotices"] = "";
}
if ($_SESSION["last_sortnotices"] != "") {
    $sort = new sort('notices', 'session');
    $requete = $sort->appliquer_tri($_SESSION["last_sortnotices"], $requete, "notice_id", $debut, $opac_search_results_per_page);
} else {
    $requete .= " " . $tri;
    $requete .= " " . $limiter;
}
//fin gestion du tri
$found = mysql_query($requete, $dbh);
print "\t</div>\n\n\t\t<div id=\"resultatrech_liste\">";
if ($opac_notices_depliable) {
    print $begin_result_liste;
}
//gestion du tri
if ($count <= $opac_nb_max_tri) {
    $pos = strpos($_SERVER['REQUEST_URI'], "?");
    $pos1 = strpos($_SERVER['REQUEST_URI'], "get");
Beispiel #19
0
                break;
            case "cart":
                $requete = "select object_id as notice_id from caddie_content join notices where caddie_id=" . $idcaddie . " and object_id=notice_id order by index_sew";
                break;
        }
    }
    if ($environement["pager"]) {
        $start = $nb_per_page_search * ($environement["PAGE"] - 1);
        $nbLimit = $nb_per_page_search;
        $limit = "limit " . $start . ",{$nb_per_page_search}";
    } else {
        $start = 0;
        $nbLimit = -1;
    }
    if ($environement["sort_id"]) {
        $sort = new sort('notices', 'base');
        $requete = $sort->appliquer_tri($environement["sort_id"], $requete, "notice_id", $start, $nbLimit);
    } else {
        $requete .= " {$limit}";
    }
    $resultat = @mysql_query($requete);
    if (!$environement["vignette"]) {
        $pmb_book_pics_show = 0;
    }
    $pheader = '<html><head><title>' . $msg['print_title'] . '</title><meta http-equiv=Content-Type content="text/html; charset=' . $charset . '" /></head><body>';
    $pheader .= '<style type="text/css">
		body { 	
			font-size: 10pt;
			font-family: verdana, geneva, helvetica, arial;
			color:#000000;
			background:#FFFFFF;
Beispiel #20
0
 protected function _sort($start, $number)
 {
     if ($this->table_tempo != "") {
         $sort = new sort("notices", "session");
         $query = $sort->appliquer_tri_from_tmp_table($this->tri, $this->table_tempo, $this->object_key, $start, $number);
         $res = pmb_mysql_query($query);
         if (pmb_mysql_num_rows($res)) {
             $this->result = array();
             while ($row = pmb_mysql_fetch_object($res)) {
                 $this->result[] = $row->{$this}->{object_key};
             }
         }
     }
 }
Beispiel #21
0
         $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);
         $sr_form .= $affich_tris_result_liste;
         if ($_SESSION["last_sortnotices"] != "") {
             $sort = new sort('notices', 'session');
             $sr_form .= " " . $msg['tri_par'] . " " . $sort->descriptionTriParId($_SESSION["last_sortnotices"]) . "<span class=\"espaceResultSearch\">&nbsp;</span>";
         } elseif ($opac_default_sort_display) {
             $sort = new sort('notices', 'session');
             $sr_form .= " " . $msg['tri_par'] . " " . $sort->descriptionTriParId("default") . "<span class=\"espaceResultSearch\">&nbsp;</span>";
         }
     } else {
         $sr_form .= "<span class=\"espaceResultSearch\">&nbsp;</span>";
     }
     //fin gestion du tri
     $sr_form .= $add_cart_link;
     if ($opac_visionneuse_allow && $nbexplnum_to_photo) {
         $search_to_post = $es->serialize_search();
         $sr_form .= "<span class=\"espaceResultSearch\">&nbsp;&nbsp;&nbsp;</span>" . $link_to_visionneuse;
         $sr_form .= "\n\t\t<script type='text/javascript'>\n\t\t\tfunction sendToVisionneuse(explnum_id){\n\t\t\t\tif (typeof(explnum_id)!= 'undefined') {\n\t\t\t\t\tvar explnum =document.createElement('input');\n\t\t\t\t\texplnum.setAttribute('type','hidden');\n\t\t\t\t\texplnum.setAttribute('name','explnum_id');\n\t\t\t\t\texplnum.setAttribute('value',explnum_id);\n\t\t\t\t\tdocument.form_values.appendChild(explnum);\n\t\t\t\t}\n\t\t\t\tvar mode = document.createElement('input');\n\t\t\t\tmode.setAttribute('type','hidden');\n\t\t\t\tmode.setAttribute('name','mode');\n\t\t\t\tmode.setAttribute('value','extended');\n\t\t\t\tvar input = document.createElement('input');\n\t\t\t\tinput.setAttribute('id','serialized_search');\n\t\t\t\tinput.setAttribute('name','serialized_search');\n\t\t\t\tinput.setAttribute('type','hidden');\n\t\t\t\tinput.setAttribute('value',\"" . addslashes($search_to_post) . "\");\n\t\t\t\toldAction=document.form_values.action;\n\t\t\t\tdocument.form_values.appendChild(input);\n\t\t\t\tdocument.form_values.appendChild(mode);\n\t\t\t\n\t\t\n\t\t\t\tdocument.form_values.action='visionneuse.php';\n\t\t\t\tdocument.form_values.target='visionneuse';\n\t\t\t\tdocument.form_values.submit();\n\t\t\t}\n\t\t</script>";
     }
 }
 //affinage
 //enregistrement de l'endroit actuel dans la session
Beispiel #22
0
 protected function sort_results($table)
 {
     global $nb_per_page_search;
     global $page;
     $start_page = $nb_per_page_search * $page;
     $sort = new sort('notices', 'base');
     $requete = $sort->appliquer_tri($_SESSION["tri"], "SELECT * FROM " . $table, "notice_id", $start_page, $nb_per_page_search);
     return $sort->table_tri_tempo;
 }
Beispiel #23
0
 // on lance la requête de sélection des notices
 //$requete = "SELECT notices.notice_id FROM notices, notice_statut WHERE (coll_id='$id') 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)":"")."))";
 $requete = "SELECT notices.notice_id FROM notices {$acces_j} {$statut_j} ";
 $requete .= "WHERE coll_id='{$id}' {$statut_r} ";
 //gestion du tri
 if (isset($_GET["sort"])) {
     $_SESSION["last_sortnotices"] = $_GET["sort"];
 }
 if ($nbr_lignes > $opac_nb_max_tri) {
     $_SESSION["last_sortnotices"] = "";
 }
 if ($_SESSION["last_sortnotices"] != "") {
     $sort = new sort('notices', 'session');
     $requete = $sort->appliquer_tri($_SESSION["last_sortnotices"], $requete, "notice_id", $debut, $opac_nb_aut_rec_per_page);
 } else {
     $sort = new sort('notices', 'session');
     $requete = $sort->appliquer_tri("default", $requete, "notice_id", $debut, $opac_nb_aut_rec_per_page);
 }
 //fin gestion du tri
 $res = @pmb_mysql_query($requete, $dbh);
 if ($opac_notices_depliable) {
     $recordslist .= $begin_result_liste;
 }
 //gestion du tri
 if ($nbr_lignes <= $opac_nb_max_tri) {
     $pos = strpos($_SERVER['REQUEST_URI'], "?");
     $pos1 = strpos($_SERVER['REQUEST_URI'], "get");
     if ($pos1 == 0) {
         $pos1 = strlen($_SERVER['REQUEST_URI']);
     } else {
         $pos1 = $pos1 - 3;
Beispiel #24
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: sort.inc.php,v 1.1.8.1 2015-09-24 15:48:15 dgoron Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once $class_path . "/sort.class.php";
include $include_path . "/templates/sort.tpl.php";
switch ($sub) {
    case 'get_sort':
        $display = '';
        $sort = new sort('notices', 'session');
        //Si vidage historique des tris demandé ?
        if ($raz_sort && suppr_ids) {
            $suppr_sort_ids = array();
            $suppr_sort_ids = explode(",", $suppr_ids);
            if (count($suppr_sort_ids)) {
                $sort->supprimer($suppr_sort_ids);
            }
        }
        if (isset($_GET['page_en_cours'])) {
            $page_en_cours = $_GET['page_en_cours'];
        }
        if (isset($_GET['modif_sort'])) {
            $temp = array();
            for ($i = 0; $i <= 4; $i++) {
                if ($_POST['liste_critere' . $i] != "") {
                    $temp[$i] = $_POST['croit_decroit' . $i] . "_" . $_POST['num_text' . $i] . "_" . $_POST['liste_critere' . $i];
 } 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);
     print $affich_tris_result_liste;
     if ($_SESSION["last_sortnotices"] != "") {
         if (!$sort_class || !is_object($sort_class)) {
             $sort_class = new sort('notices', 'session');
         }
         print " " . $msg['tri_par'] . " " . $sort_class->descriptionTriParId($_SESSION["last_sortnotices"]) . "<span class=\"espaceResultSearch\">&nbsp;</span>";
     }
 }
 //fin gestion du tri
 print $add_cart_link;
 //affinage
 //enregistrement de l'endroit actuel dans la session
 $_SESSION["last_module_search"]["search_mod"] = "etagere_see";
 $_SESSION["last_module_search"]["search_id"] = $id;
 $_SESSION["last_module_search"]["search_page"] = $page;
 // Gestion des alertes à partir de la recherche simple
 include_once $include_path . "/alert_see.inc.php";
 print $alert_see_mc_values;
 //affichage
Beispiel #26
0
     print "<br /><br />";
     if ($opac_resa_popup) {
         print "<input type='button' id='show_cart_reserve' class='bouton' value=\"" . $msg["show_cart_reserve"] . "\" title=\"" . $msg["show_cart_reserve_title"] . "\" \n\t\t\t\t\tonClick=\"\n\t\t\t\t\t\tw=window.open('./do_resa.php?lvl=resa_cart&sub=resa_cart','doresa','scrollbars=yes,width=900,height=300,menubar=0,resizable=yes'); w.focus(); return false;\n\t\t\t\t\t\" />&nbsp;\n\n\t\t\t\t   <input type='button' id='show_cart_reserve_checked' class='bouton' value=\"" . $msg["show_cart_reserve_checked"] . "\" title=\"" . $msg["show_cart_reserve_checked_title"] . "\" \n\t\t\t\t\tonClick=\"\n\t\t\t\t\t\tvar notice='';\n\t\t\t\t\t\tvar data=document.forms['cart_form'].elements['notice[]'];\n\t\t\t\t   \t\t\t   \t\t\n\t\t\t\t\t\tif(typeof(data.length) != 'undefined'){\n\t\t\t\t   \t\t\tfor (var key = 0; key < data.length; key++) {\n\t\t\t\t\t\t\t\tif(data[key].checked && data[key].value){\n\t\t\t\t\t\t\t\t\tnotice+='&notice[]='+data[key].value;\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif(data.checked && data.value){\n\t\t\t\t\t\t\t\tnotice+='&notice[]='+data.value;\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(notice!=''){\n\t\t\t\t\t\t\tw=window.open('./do_resa.php?lvl=resa_cart&sub=resa_cart_checked'+notice,'doresa','scrollbars=yes,width=900,height=300,menubar=0,resizable=yes');\n\t\t\t\t\t\t\tw.focus(); \n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\talert('" . $msg["resa_no_doc_selected"] . "')\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\" /><br /><br />";
     } else {
         print "<input type='button' id='show_cart_reserve' class='bouton' value=\"" . $msg["show_cart_reserve"] . "\" title=\"" . $msg["show_cart_reserve_title"] . "\" onClick=\"\n\t\t\t\t\t\tdocument.location='./do_resa.php?lvl=resa_cart&sub=resa_cart';\n\t\t\t\t\t\" />&nbsp;\n\t\t\t\t   <input type='button' id='show_cart_reserve_checked' class='bouton' value=\"" . $msg["show_cart_reserve_checked"] . "\" title=\"" . $msg["show_cart_reserve_checked_title"] . "\" onClick=\"\n\t\t\t\t\t\tvar notice='';\n\t\t\t\t\t\tvar data=document.forms['cart_form'].elements['notice[]'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(typeof(data.length) != 'undefined'){\n\t\t\t\t\t\t\tfor (var key = 0; key < data.length; key++) {\n\t\t\t\t\t\t\t\tif(data[key].checked && data[key].value){\n\t\t\t\t\t\t\t\t\tnotice+='&notice[]='+data[key].value;\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif(data.checked && data.value){\n\t\t\t\t\t\t\t\tnotice+='&notice[]='+data.value;\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(notice!=''){\n\t\t\t\t\t\t\tdocument.location='./do_resa.php?lvl=resa_cart&sub=resa_cart_checked'+notice;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\talert('" . $msg["resa_no_doc_selected"] . "')\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\" /><br /><br />";
     }
     //on récupère le tableau des résa de resa_cart.inc.php
     global $resa_cart_display;
     if ($resa_cart_display && !$opac_resa_popup) {
         //on imprime le tableau d'affichage sur la page du panier
         print $resa_cart_display;
     }
 }
 //Tri
 if ($_SESSION["last_sortnotices"] != "") {
     $sort = new sort('notices', 'session');
     $sql = "SELECT notice_id FROM notices WHERE notice_id IN (";
     for ($z = 0; $z < count($cart_); $z++) {
         $sql .= "'" . $cart_[$z] . "',";
     }
     $sql = substr($sql, 0, strlen($sql) - 1) . ")";
     $sql = $sort->appliquer_tri($_SESSION["last_sortnotices"], $sql, "notice_id", 0, 0);
 } else {
     $sql = "select notice_id from notices where notice_id in ('" . implode("','", $cart_) . "') order by tit1";
 }
 $res = mysql_query($sql, $dbh);
 $cart_ = array();
 while ($r = mysql_fetch_object($res)) {
     $cart_[] = $r->notice_id;
 }
 if ($cart_ext) {