public function generate_rss($context, $hash)
 {
     global $opac_url_base, $dbh;
     $this->notices_list = array();
     $mc = unserialize($context);
     $search = new search($mc["search_type"]);
     $search->unserialize_search(serialize($mc["serialized_search"]));
     $table = $search->make_search();
     $q = "select distinct notice_id from {$table} ";
     $res = pmb_mysql_query($q, $dbh);
     if (pmb_mysql_num_rows($res)) {
         while ($row = pmb_mysql_fetch_object($res)) {
             $this->notices_list[] = $row->notice_id;
         }
     }
     $flux = new newrecords_flux(0);
     $flux->setRecords($this->notices_list);
     $flux->setLink($opac_url_base . "s.php?h={$hash}");
     $flux->setDescription(strip_tags($mc["human_query"]));
     $flux->xmlfile();
     if (!$flux->envoi) {
         return;
     }
     @header('Content-type: text/xml');
     echo $flux->envoi;
 }
 public function get_value()
 {
     global $dbh;
     if (!count($this->value)) {
         if ($this->parameters['equation']) {
             $equ = new equation($this->parameters['equation']);
             $search = new search();
             $search->unserialize_search($equ->requete);
             $table = $search->make_search();
             $result = pmb_mysql_query("select * from " . $table, $dbh);
             if (pmb_mysql_num_rows($result)) {
                 while ($row = pmb_mysql_fetch_object($result)) {
                     $this->value[] = $row->notice_id;
                 }
             }
         }
     }
     return $this->value;
 }
 public function get_datas()
 {
     //on commence par récupérer l'identifiant retourné par le sélecteur...
     if ($this->parameters['selector'] != "") {
         for ($i = 0; $i < count($this->selectors); $i++) {
             if ($this->selectors[$i]['name'] == $this->parameters['selector']) {
                 $selector = new $this->parameters['selector']($this->selectors[$i]['id']);
                 break;
             }
         }
         $values = $selector->get_value();
         $searcher = new search(false);
         $current_search = $searcher->serialize_search();
         $searcher->destroy_global_env();
         global $search;
         $search = array();
         $search[] = "d_" . $values['cp'];
         $op = "op_0_d_" . $values['cp'];
         $field = "field_0_d_" . $values['cp'];
         global ${$op}, ${$field};
         ${$op} = "EQ";
         ${$field} = $values['cp_val'];
         $table = $searcher->make_search();
         $query = "select notice_id from " . $table;
         $result = pmb_mysql_query($query);
         $records = array();
         if (pmb_mysql_num_rows($result)) {
             while ($row = pmb_mysql_fetch_object($result)) {
                 $records[] = $row->notice_id;
             }
         }
         $searcher->unserialize_search($current_search);
         $records = $this->filter_datas("notices", $records);
         if ($this->parameters['nb_max_elements'] > 0) {
             $records = array_slice($records, 0, $this->parameters['nb_max_elements']);
         }
         $return = array('title' => 'Liste de Notices', 'records' => $records);
         return $return;
     }
     return false;
 }
 function make_hidden_search_form($serialized_search)
 {
     global $search;
     global $charset;
     global $page;
     $url = "./catalog.php?categ=search&mode=6";
     // remplir $search
     $sc = new search(false);
     $sc->unserialize_search($serialized_search);
     $r = "<form name='modif_requete_form_' action='{$url}' style='display:none' method='post'>";
     for ($i = 0; $i < count($search); $i++) {
         $inter = "inter_" . $i . "_" . $search[$i];
         global ${$inter};
         $op = "op_" . $i . "_" . $search[$i];
         global ${$op};
         $field_ = "field_" . $i . "_" . $search[$i];
         global ${$field_};
         $field = ${$field_};
         //Récupération des variables auxiliaires
         $fieldvar_ = "fieldvar_" . $i . "_" . $search[$i];
         global ${$fieldvar_};
         $fieldvar = ${$fieldvar_};
         if (!is_array($fieldvar)) {
             $fieldvar = array();
         }
         $r .= "<input type='hidden' name='search[]' value='" . htmlentities($search[$i], ENT_QUOTES, $charset) . "'/>";
         $r .= "<input type='hidden' name='" . $inter . "' value='" . htmlentities(${$inter}, ENT_QUOTES, $charset) . "'/>";
         $r .= "<input type='hidden' name='" . $op . "' value='" . htmlentities(${$op}, ENT_QUOTES, $charset) . "'/>";
         for ($j = 0; $j < count($field); $j++) {
             $r .= "<input type='hidden' name='" . $field_ . "[]' value='" . htmlentities($field[$j], ENT_QUOTES, $charset) . "'/>";
         }
         reset($fieldvar);
         while (list($var_name, $var_value) = each($fieldvar)) {
             for ($j = 0; $j < count($var_value); $j++) {
                 $r .= "<input type='hidden' name='" . $fieldvar_ . "[" . $var_name . "][]' value='" . htmlentities($var_value[$j], ENT_QUOTES, $charset) . "'/>";
             }
         }
     }
     $r .= "<input type='hidden' name='id_connector_set' value='{$this->id}'/>";
     $r .= "</form>";
     return $r;
 }
 public function get_forms_list()
 {
     $my_search = new search();
     $forms_search = '';
     $links = '';
     for ($i = 0; $i < count($this->search_persopac_list); $i++) {
         //composer le formulaire de la recherche
         $my_search->unserialize_search($this->search_persopac_list[$i]->query);
         $forms_search .= $my_search->make_hidden_search_form("./index.php?search_type_asked=extended_search&limitsearch=" . $this->search_persopac_list[$i]->limitsearch, "search_form" . $this->search_persopac_list[$i]->id);
         $libelle = $this->search_persopac_list[$i]->name;
         $links .= "\n\t\t\t<span>\n\t\t\t\t<a href=\"javascript:document.forms['search_form" . $this->search_persopac_list[$i]->id . "'].submit();\">{$libelle}</a>\n\t\t\t\t</span><br/>";
     }
     return $forms_search . $links;
 }
예제 #6
0
 function remplir()
 {
     global $dbh;
     global $msg;
     global $gestion_acces_active, $gestion_acces_empr_notice;
     if (!$this->id_bannette) {
         return $msg[dsi_ban_no_access];
     }
     // impossible d'accéder à cette bannette
     // récupérer les équations associées à la bannette
     $equations = $this->get_equations();
     $res_affichage = "<ul>";
     if ($this->update_type == "C") {
         $colonne_update_create = "create_date";
     } else {
         $colonne_update_create = "update_date";
     }
     for ($i = 0; $i < sizeof($equations); $i++) {
         // pour chaque équation ajouter les notices trouvées au contenu de la bannette
         $equ = new equation($equations[$i]);
         $search = new search();
         $search->unserialize_search($equ->requete);
         $table = $search->make_search();
         $temp_requete = "insert into bannette_contenu (num_bannette, num_notice) (select " . $this->id_bannette . " , notices.notice_id from {$table} , notices, notice_statut where notices.{$colonne_update_create}>='" . $this->date_last_envoi . "' and {$table}.notice_id=notices.notice_id and statut=id_notice_statut and ((notice_visible_opac=1 and notice_visible_opac_abon=0) or (notice_visible_opac_abon=1 and notice_visible_opac=1)) limit 300) ";
         $res = @pmb_mysql_query($temp_requete, $dbh);
         $res_affichage .= "<li>" . $equ->human_query . "</li>";
         $temp_requete = "drop table {$table} ";
         $res = @pmb_mysql_query($temp_requete, $dbh);
     }
     $res_affichage .= "</ul>";
     $this->compte_elements();
     $temp_requete = "update bannettes set date_last_remplissage=sysdate() where id_bannette='" . $this->id_bannette . "' ";
     $res = @pmb_mysql_query($temp_requete, $dbh);
     //purge pour les bannettes privees des notices ne devant pas etre diffusees
     if ($this->proprio_bannette && $gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) {
         $ac = new acces();
         $dom_2 = $ac->setDomain(2);
         $acces_j = $dom_2->getJoin($this->proprio_bannette, '4=0', 'num_notice');
         $q = "delete from bannette_contenu using bannette_contenu {$acces_j} WHERE num_bannette='{$this->id_bannette}' ";
         pmb_mysql_query($q, $dbh);
     }
     return $res_affichage;
 }
예제 #7
0
 public function get_forms_list()
 {
     $my_search = new search();
     $forms_search = '';
     $links = '';
     for ($i = 0; $i < count($this->search_perso_user); $i++) {
         //composer le formulaire de la recherche
         $my_search->unserialize_search($this->search_perso_user[$i]->query);
         $forms_search .= $my_search->make_hidden_search_form("./catalog.php?categ=search&mode=6", "search_form" . $this->search_perso_user[$i]->id);
         $libelle = $this->search_perso_user[$i]->name;
         $links .= "\n\t\t\t<span>\n\t\t\t\t<a href=\"javascript:document.forms['search_form" . $this->search_perso_user[$i]->id . "'].submit();\">{$libelle}</a>\n\t\t\t</span><br/>";
     }
     return $forms_search . $links;
 }
예제 #8
0
function import_noticesearch_into_multicritere_set()
{
    global $dbh, $toset_search, $set_id;
    $set_id += 0;
    //Pas de set spécifié?
    if (!$set_id) {
        return;
    }
    //Vérifions que le set spécifié est bien un bon set multicritère
    $the_set = new connector_out_set($set_id, true);
    if ($the_set->type != 2) {
        return;
    }
    $serialized_search = stripslashes($toset_search);
    //Un petit tour dans la classe search histoire de filtrer la recherche
    $sc = new search(false);
    $sc->unserialize_search($serialized_search);
    $serialized_search = $sc->serialize_search();
    //Mettons à jour le set
    $the_set_m = new connector_out_set_noticemulticritere($set_id, true);
    $the_set_m->config["search"] = $serialized_search;
    $the_set_m->commit_to_db();
    $the_set_m->clear_cache(true);
}
예제 #9
0
function gerer_abon_bannette($priv_pub = "PUB", $link_to_bannette = "", $htmldiv_id = "bannette-container", $htmldiv_class = "bannette-container", $htmldiv_zindex = "")
{
    global $dbh;
    global $charset;
    global $msg;
    global $opac_allow_resiliation;
    // récupération des bannettes
    $tableau_bannettes = tableau_gerer_bannette($priv_pub);
    if (!sizeof($tableau_bannettes)) {
        return "";
    }
    // préparation du tableau
    $retour_aff = "<div id='{$htmldiv_id}' class='{$htmldiv_class}'";
    if ($htmldiv_zindex) {
        $retour_aff .= " zindex='{$htmldiv_zindex}' ";
    }
    $retour_aff .= " >";
    $retour_aff .= "<form name='bannette_abonn' method='post' >";
    $retour_aff .= "<input type='hidden' name='lvl' value='bannette_gerer' />";
    $retour_aff .= "<input type='hidden' name='enregistrer' value='{$priv_pub}' />";
    $retour_aff .= "<table cellpadding='3px' cellspacing='5px'><tr>\n\t\t\t\t\t\t\t<th align='right' valign='bottom'>" . $msg[dsi_bannette_gerer_abonn] . "</th>\n\t\t\t\t\t\t\t<th align='left' valign='bottom'>" . $msg[dsi_bannette_gerer_nom_liste] . "</th>\n\t\t\t\t\t\t\t<th align='center' valign='bottom'>" . $msg[dsi_bannette_gerer_date] . "</th>\n\t\t\t\t\t\t\t<th align='center' valign='bottom'>" . $msg[dsi_bannette_gerer_nb_notices] . "</th>\n\t\t\t\t\t\t\t<th align='center' valign='bottom'>" . $msg[dsi_bannette_gerer_periodicite] . "</th>\n\t\t\t\t\t\t\t</tr>";
    for ($i = 0; $i < sizeof($tableau_bannettes); $i++) {
        $id_bannette = $tableau_bannettes[$i]['id_bannette'];
        $comment_public = $tableau_bannettes[$i]['comment_public'];
        $aff_date_last_envoi = $tableau_bannettes[$i]['aff_date_last_envoi'];
        $retour_aff .= "\n<tr><td align='right' valign='top'>";
        if (!$opac_allow_resiliation && $tableau_bannettes[$i]['categorie_lecteurs']) {
            $retour_aff .= "\n<input type='checkbox' name='dummy[]' value='' " . $tableau_bannettes[$i]['abonn'] . " disabled />";
            $retour_aff .= "<input type='hidden' name='bannette_abon[{$id_bannette}]' value='1' " . $tableau_bannettes[$i]['abonn'] . " style='display:none'/>";
        } else {
            $retour_aff .= "\n<input type='checkbox' name='bannette_abon[{$id_bannette}]' value='1' " . $tableau_bannettes[$i]['abonn'] . " />";
        }
        $retour_aff .= "\n</td><td align='left' valign='top'>";
        if ($link_to_bannette) {
            // Construction de l'affichage de l'info bulle de la requette
            $requete = "select * from bannette_equation, equations where num_equation=id_equation and num_bannette={$id_bannette}";
            $resultat = pmb_mysql_query($requete);
            if ($r = pmb_mysql_fetch_object($resultat)) {
                $recherche = $r->requete;
                $equ = new equation($r->num_equation);
                if (!is_object($search)) {
                    $search = new search();
                }
                $search->unserialize_search($equ->requete);
                $recherche = $search->make_human_query();
                $zoom_comment = "<div id='zoom_comment" . $id_bannette . "' style='border: solid 2px #555555; background-color: #FFFFFF; position: absolute; display:none; z-index: 2000;'>";
                $zoom_comment .= $recherche;
                $zoom_comment .= "</div>";
                $java_comment = " onmouseover=\"z=document.getElementById('zoom_comment" . $id_bannette . "'); z.style.display=''; \" onmouseout=\"z=document.getElementById('zoom_comment" . $id_bannette . "'); z.style.display='none'; \"";
            }
            $retour_aff .= "<a href=\"" . str_replace("!!id_bannette!!", $id_bannette, $link_to_bannette) . "\" {$java_comment} >";
        }
        $retour_aff .= htmlentities($comment_public, ENT_QUOTES, $charset);
        if ($link_to_bannette) {
            $retour_aff .= "</a>";
            $retour_aff .= $zoom_comment;
        }
        $retour_aff .= "\n</td><td align='center' valign='top'>";
        $retour_aff .= htmlentities($aff_date_last_envoi, ENT_QUOTES, $charset);
        $retour_aff .= "\n</td><td align='center' valign='top'>";
        $retour_aff .= htmlentities($tableau_bannettes[$i]['nb_contenu'], ENT_QUOTES, $charset);
        $retour_aff .= "\n</td><td align='center' valign='top'>";
        $retour_aff .= htmlentities($tableau_bannettes[$i]['periodicite'], ENT_QUOTES, $charset);
        $retour_aff .= "</td></tr>";
    }
    // fermeture du tableau
    $retour_aff .= "</table>\n\t\t\t\t\t<INPUT type='submit' class='bouton' value=\"";
    if ($priv_pub == "PUB") {
        $retour_aff .= $msg[dsi_bannette_gerer_sauver];
    } else {
        $retour_aff .= $msg[dsi_bannette_gerer_supprimer];
    }
    $retour_aff .= "\" />\n\t\t\t\t\t</form></div><!-- fin id='{$htmldiv_id}' class='{$htmldiv_class}' -->";
    return $retour_aff;
}
예제 #10
0
 function do_list()
 {
     global $tpl_search_persopac_liste_tableau, $tpl_search_persopac_liste_tableau_ligne;
     // liste des lien de recherche directe
     $liste = "";
     // pour toute les recherche de l'utilisateur
     $my_search = new search();
     for ($i = 0; $i < count($this->search_persopac_list); $i++) {
         if ($i % 2) {
             $pair_impair = "even";
         } else {
             $pair_impair = "odd";
         }
         //composer le formulaire de la recherche
         $my_search->unserialize_search($this->search_persopac_list[$i]->query);
         $forms_search .= $my_search->make_hidden_search_form("./index.php?search_type_asked=extended_search&limitsearch=" . $this->search_persopac_list[$i]->limitsearch, "search_form" . $this->search_persopac_list[$i]->id);
         $td_javascript = "  onmousedown=\"javascript:document.forms['search_form" . $this->search_persopac_list[$i]->id . "'].submit();\" ";
         $tr_surbrillance = "onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='" . $pair_impair . "'\" ";
         $line = str_replace('!!td_javascript!!', $td_javascript, $tpl_search_persopac_liste_tableau_ligne);
         $line = str_replace('!!tr_surbrillance!!', $tr_surbrillance, $line);
         $line = str_replace('!!pair_impair!!', $pair_impair, $line);
         $line = str_replace('!!id!!', $this->search_persopac_list[$i]->id, $line);
         $line = str_replace('!!name!!', $this->search_persopac_list[$i]->name, $line);
         $line = str_replace('!!human!!', $this->search_persopac_list[$i]->human, $line);
         $line = str_replace('!!shortname!!', $this->search_persopac_list[$i]->shortname, $line);
         $liste .= $line;
     }
     $tpl_search_persopac_liste_tableau = str_replace('!!lignes_tableau!!', $liste, $tpl_search_persopac_liste_tableau);
     return $forms_search . $tpl_search_persopac_liste_tableau;
 }
예제 #11
0
 protected function _get_search_query()
 {
     global $es, $msg;
     if (!is_object($es)) {
         $es = new search();
     }
     if ($this->serialized_query) {
         $es->unserialize_search($this->serialized_query);
     } else {
         global $search;
         //Vérification des champs vides
         for ($i = 0; $i < count($search); $i++) {
             if ($i == 0) {
                 //On supprime le premier opérateur inter (il est renseigné pour les recherches prédéfinies avec plusieurs champs et une recherche avec le premier champ vide
                 $inter = "inter_" . $i . "_" . $search[$i];
                 global ${$inter};
                 ${$inter} = "";
             }
             $op = "op_" . $i . "_" . $search[$i];
             global ${$op};
             $field_ = "field_" . $i . "_" . $search[$i];
             global ${$field_};
             $field = ${$field_};
             $s = explode("_", $search[$i]);
             if ($s[0] == "f") {
                 $champ = $es->fixedfields[$s[1]]["TITLE"];
             } elseif ($s[0] == "s") {
                 $champ = $es->specialfields[$s[1]]["TITLE"];
             } else {
                 $champ = $es->pp->t_fields[$s[1]]["TITRE"];
             }
             if ((string) $field[0] == "" && !$es->op_empty[${$op}]) {
                 $search_error_message = sprintf($msg["extended_empty_field"], $champ);
                 $flag = true;
                 break;
             }
         }
     }
     //$es->remove_forbidden_fields();
     $this->table = $es->make_search();
     return "select notice_id as id_notice from " . $this->table;
 }
예제 #12
0
 function make_human_query()
 {
     //Récupération de la valeur de saisie
     $valeur_ = "field_" . $this->n_ligne . "_s_" . $this->id;
     global ${$valeur_};
     $valeur = ${$valeur_};
     $litteral = array();
     //on stocke l'environnement courant
     $current_search = search::serialize_search();
     //on le détruit
     search::destroy_global_env();
     //et on se met dans le contexte de la requete OpenURL
     $this->s = new search("search_openurl");
     $this->s->unserialize_search($valeur[0]);
     global $search;
     //on génère une human_query
     $litteral[0] = $this->s->make_human_query();
     //et on détruit le contexte d'OpenURL pour revenir en mode normal
     search::destroy_global_env();
     search::unserialize_search($current_search);
     return $litteral;
 }
예제 #13
0
 function list_abonnements($session_id)
 {
     global $dbh, $msg;
     if (!$session_id) {
         return array();
     }
     $session_info = $this->retrieve_session_information($session_id);
     $empr_id = $session_info["empr_id"];
     if (!$empr_id) {
         return array();
     }
     $empr = new emprunteur($empr_id);
     global $opac_allow_resiliation, $opac_allow_bannette_priv;
     $results = array();
     $tableau_bannette_pub = tableau_gerer_bannette($empr_id, $empr->categ, "PUB");
     $tableau_bannette_priv = tableau_gerer_bannette($empr_id, $empr->categ, "PRI");
     $tableau_bannettes = array_merge($tableau_bannette_pub, $tableau_bannette_priv);
     $search = new search();
     foreach ($tableau_bannettes as $abanette) {
         // Construction de l'affichage de l'info bulle de la requette
         $requete = "select * from bannette_equation, equations where num_equation=id_equation and num_bannette=" . $abanette["id_bannette"];
         $resultat = mysql_query($requete);
         if ($r = mysql_fetch_object($resultat)) {
             $equ = new equation($r->num_equation);
             $search->unserialize_search($equ->requete);
             $recherche = $search->make_human_query();
         }
         $a_abonnement = array('abonnement_id' => $abanette["id_bannette"], 'abonnement_type' => $abanette["priv_pub"] == 'PUB' ? "PUBLIC" : 'PRIVATE', 'abonnement_title' => utf8_normalize($abanette["comment_public"]), 'abonnement_lastsentdate' => utf8_normalize($abanette["aff_date_last_envoi"]), 'abonnement_notice_count' => $abanette["nb_contenu"], 'abonnement_equation_human' => utf8_normalize($recherche), 'empr_subscriber' => $abanette["priv_pub"] == 'PUB' ? $abanette["abonn"] == 'checked' : true);
         $results[] = $a_abonnement;
     }
     return $results;
 }
예제 #14
0
function get_last_history()
{
    global $search_type;
    global $opac_search_other_function;
    global $facette_test;
    global $reinit_facette;
    if ($reinit_facette == 1) {
        unset($_SESSION["lq_facette"]);
        unset($_SESSION["lq_facette_search"]);
        unset($_SESSION["lq_facette_test"]);
    }
    $search_type = $_SESSION["search_type" . $_SESSION["last_query"]];
    $facette_test = $_SESSION["lq_facette_test"];
    switch ($search_type) {
        case "simple_search":
            if (!$facette_test) {
                global $user_query, $mode, $count, $typdoc, $clause, $clause_bull, $clause_bull_num_notice, $tri, $pert, $page, $l_typdoc, $join, $id_thes;
                $user_query = $_SESSION["lq_user_query"];
                $mode = $_SESSION["lq_mode"];
                $count = $_SESSION["lq_count"];
                $typdoc = $_SESSION["lq_typdoc"];
                $clause = $_SESSION["lq_clause"];
                $clause_bull = $_SESSION["lq_clause_bull"];
                $clause_bull_num_notice = $_SESSION["lq_clause_bull_num_notice"];
                $tri = $_SESSION["lq_tri"];
                $pert = $_SESSION["lq_pert"];
                $page = $_SESSION["lq_page"];
                $affiliate_page = $_SESSION["lq_affiliate_page"];
                $catalog_page = $_SESSION["lq_catalog_page"];
                $l_typdoc = $_SESSION["lq_l_typdoc"];
                $join = $_SESSION["lq_join"];
                $id_thes = $_SESSION["lq_id_thes"];
                $_SESSION["facette"] = $_SESSION["lq_facette"];
                $_SESSION["level1"] = $_SESSION["lq_level1"];
                if ($opac_search_other_function) {
                    search_other_function_get_history($_SESSION["last_query"]);
                }
            }
            break;
        case "extended_search":
            global $page, $mode, $catalog_page, $affiliate_page;
            get_history($_SESSION["last_query"]);
            $page = $_SESSION["lq_page"];
            $affiliate_page = $_SESSION["lq_affiliate_page"];
            $catalog_page = $_SESSION["lq_catalog_page"];
            $mode = $_SESSION["lq_mode"];
            break;
    }
    if ($facette_test) {
        global $page, $mode, $catalog_page, $affiliate_page;
        $_SESSION["facette"] = $_SESSION["lq_facette"];
        $page = $_SESSION["lq_facette_search"]["lq_page"];
        $affiliate_page = $_SESSION["lq_facette_search"]["lq_affiliate_page"];
        $catalog_page = $_SESSION["lq_facette_search"]["lq_catalog_page"];
        $mode = $_SESSION["lq_facette_search"]["lq_mode"];
        search::unserialize_search($_SESSION["lq_facette_search"]["lq_search"]);
        $_SESSION["notice_view" . $_SESSION["last_query"]] = $_SESSION["lq_facette_search"]["lq_notice_view"];
    }
}
예제 #15
0
function simple_search_content($value = '', $css)
{
    global $dbh;
    global $msg;
    global $charset;
    global $lang;
    global $css;
    global $search_type;
    global $class_path;
    global $es;
    global $lvl;
    global $include_path;
    global $opac_allow_extended_search, $opac_allow_term_search, $opac_allow_external_search;
    global $typdoc;
    global $opac_search_other_function, $opac_search_show_typdoc;
    global $opac_thesaurus;
    global $id_thes;
    global $base_path;
    global $opac_allow_tags_search;
    global $opac_show_onglet_empr;
    global $external_env;
    global $user_query;
    global $source;
    global $opac_recherches_pliables;
    global $opac_show_help;
    global $onglet_persopac, $opac_allow_personal_search;
    global $search_form_perso, $search_form, $search_form_perso_limitsearch, $limitsearch;
    global $opac_show_onglet_help;
    global $search_in_perio;
    global $get_query;
    global $opac_show_onglet_perio_a2z, $opac_autolevel2;
    global $opac_simple_search_suggestions;
    include $include_path . "/templates/simple_search.tpl.php";
    if ($opac_search_other_function) {
        require_once $include_path . "/" . $opac_search_other_function;
    }
    // pour la DSI
    global $opac_allow_bannette_priv;
    // bannettes privees autorisees ?
    global $bt_cree_bannette_priv;
    if ($opac_allow_bannette_priv && ($bt_cree_bannette_priv || $_SESSION['abon_cree_bannette_priv'] == 1)) {
        $_SESSION['abon_cree_bannette_priv'] = 1;
    } else {
        $_SESSION['abon_cree_bannette_priv'] = 0;
    }
    global $script_test_form;
    switch ($opac_show_onglet_empr) {
        case 1:
            $empr_link_onglet = "./index.php?search_type_asked=connect_empr";
            break;
        case 2:
            $empr_link_onglet = "./empr.php";
            break;
    }
    $search_p = new search_persopac();
    $onglets_search_perso = $search_p->directlink_user;
    $onglets_search_perso_form = $search_p->directlink_user_form;
    switch ($search_type) {
        case "simple_search":
            // les tests de formulaire
            $result = $script_test_form;
            $tests = test_field("search_input", "query", "recherche");
            $result = str_replace("!!tests!!", $tests, $result);
            // les typ_doc
            if ($opac_search_show_typdoc) {
                $query = "SELECT typdoc FROM notices where typdoc!='' GROUP BY typdoc";
                $result2 = mysql_query($query, $dbh);
                $toprint_typdocfield = " <select name='typdoc'>";
                $toprint_typdocfield .= "  <option ";
                $toprint_typdocfield .= " value=''";
                if ($typdoc == '') {
                    $toprint_typdocfield .= " selected";
                }
                $toprint_typdocfield .= ">" . $msg["simple_search_all_doc_type"] . "</option>\n";
                $doctype = new marc_list('doctype');
                while ($rt = mysql_fetch_row($result2)) {
                    $obj[$rt[0]] = 1;
                }
                foreach ($doctype->table as $key => $libelle) {
                    if ($obj[$key] == 1) {
                        $toprint_typdocfield .= "  <option ";
                        $toprint_typdocfield .= " value='{$key}'";
                        if ($typdoc == $key) {
                            $toprint_typdocfield .= " selected";
                        }
                        $toprint_typdocfield .= ">" . htmlentities($libelle, ENT_QUOTES, $charset) . "</option>\n";
                    }
                }
                $toprint_typdocfield .= "</select>";
            } else {
                $toprint_typdocfield = "";
            }
            if ($opac_search_other_function) {
                $toprint_typdocfield .= search_other_function_filters();
            }
            $toprint_typdocfield .= "<br />";
            // le contenu
            $result .= $search_input;
            // on met la valeur a jour
            $result = str_replace("!!user_query!!", htmlentities($value, ENT_QUOTES, $charset), $result);
            $result = str_replace("<!--!!typdoc_field!!-->", $toprint_typdocfield, $result);
            if ($opac_autolevel2) {
                $result = str_replace("!!action_simple_search!!", "./index.php?lvl=more_results&autolevel1=1", $result);
            } else {
                $result = str_replace("!!action_simple_search!!", "./index.php?lvl=search_result", $result);
            }
            if (!$opac_recherches_pliables) {
                $ou_chercher = "<div id='simple_search_zone'>" . do_ou_chercher() . "</div>";
            } elseif ($opac_recherches_pliables == 1) {
                $ou_chercher = "<div id='simple_search_zone'>" . gen_plus_form("zsimples", $msg["rechercher_dans"], do_ou_chercher(), false) . "</div>";
            } elseif ($opac_recherches_pliables == 2) {
                $ou_chercher = "<div id='simple_search_zone'>" . gen_plus_form("zsimples", $msg["rechercher_dans"], do_ou_chercher(), true) . "</div>";
            } elseif ($opac_recherches_pliables == 3) {
                // les options de recherches sont invisibles, pas dépliables.
                $ou_chercher = "\n" . do_ou_chercher_hidden() . "\n";
            }
            $result = str_replace("<!--!!ou_chercher!!-->", $ou_chercher, $result);
            // on se place dans le bon champ
            // $result .= form_focus("search_input", "query");
            $others = "";
            if ($opac_allow_personal_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=search_perso\">" . $msg["search_perso_menu"] . "</a></li>";
            }
            $others .= $onglets_search_perso;
            if ($opac_allow_extended_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=extended_search\">" . $msg["extended_search"] . "</a></li>";
            }
            if ($opac_allow_term_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=term_search\">" . $msg["term_search"] . "</a></li>";
            }
            if ($opac_allow_tags_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=tags_search\">" . $msg["tags_search"] . "</a></li>";
            }
            if ($opac_show_onglet_perio_a2z) {
                $others .= "<li><a href=\"./index.php?search_type_asked=perio_a2z\">" . $msg["a2z_onglet"] . "</a></li>";
            }
            if ($opac_show_onglet_empr == 1 || $opac_show_onglet_empr == 2 && $_SESSION["user_code"]) {
                if (!$_SESSION["user_code"]) {
                    $others .= "<li><a href=\"./index.php?search_type_asked=connect_empr\">" . $msg["onglet_empr_connect"] . "</a></li>";
                } else {
                    $others .= "<li><a href=\"{$empr_link_onglet}\">" . $msg["onglet_empr_compte"] . "</a></li>";
                }
            }
            if ($opac_allow_external_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=external_search&external_type=simple\">" . $msg["connecteurs_external_search"] . "</a></li>";
            }
            $result = str_replace("!!others!!", $others, $result);
            $result .= $onglets_search_perso_form;
            break;
            //Recherche avancee
        //Recherche avancee
        case "extended_search":
            global $mode_aff;
            if ($mode_aff) {
                if ($mode_aff == "aff_module") {
                    //ajout de la recherche dans l'historique
                    $_SESSION["nb_queries"] = $_SESSION["nb_queries"] + 1;
                    $n = $_SESSION["nb_queries"];
                    $_SESSION["notice_view" . $n] = $_SESSION["last_module_search"];
                    switch ($_SESSION["last_module_search"]["search_mod"]) {
                        case 'etagere_see':
                            //appel de la fonction tableau_etagere du fichier etagere_func.inc.php
                            $r1 = $msg["etagere_query"];
                            $t = array();
                            $t = tableau_etagere($_SESSION["last_module_search"]["search_id"]);
                            $r = $r1 . " '" . $t[0]["nometagere"] . "'";
                            break;
                        case 'categ_see':
                            // instanciation de la categorie
                            $ourCateg = new categorie($_SESSION["last_module_search"]["search_id"]);
                            $r1 = $msg["category"];
                            $r = $r1 . " '" . $ourCateg->libelle . "'";
                            break;
                        case 'indexint_see':
                            // instanciation de la classe indexation
                            $r1 = $msg["indexint_search"];
                            $ourIndexint = new indexint($_SESSION["last_module_search"]["search_id"]);
                            $r = $r1 . " '" . $ourIndexint->name . " " . $ourIndexint->comment . "'";
                            break;
                        case 'section_see':
                            $resultat = mysql_query("select location_libelle from docs_location where idlocation='" . addslashes($_SESSION["last_module_search"]["search_location"]) . "'");
                            $j = mysql_fetch_array($resultat);
                            $localisation_ = $j["location_libelle"];
                            mysql_free_result($resultat);
                            $resultat = mysql_query("select section_libelle from docs_section where idsection='" . addslashes($_SESSION["last_module_search"]["search_id"]) . "'");
                            $j = mysql_fetch_array($resultat);
                            $section_ = $j["section_libelle"];
                            mysql_free_result($resultat);
                            $r1 = $localisation_ . " => " . $msg["section"];
                            $r = $r1 . " '" . $section_ . "'";
                            break;
                    }
                    $_SESSION["human_query" . $n] = $r;
                    $_SESSION["search_type" . $n] = "module";
                } else {
                    if ($_SESSION["last_query"]) {
                        $n = $_SESSION["last_query"];
                        if ($_SESSION["lq_facette"]) {
                            $facette = true;
                        }
                    } else {
                        $n = $_SESSION["nb_queries"];
                    }
                }
                //générer les critères de la multi_critères
                //Attention ! si on est déjà dans une facette !
                if ($facette) {
                    search::unserialize_search($_SESSION["lq_facette_search"]["lq_search"]);
                } else {
                    global $search;
                    $search[0] = "s_1";
                    $op_ = "EQ";
                    //operateur
                    $op = "op_0_" . $search[0];
                    global ${$op};
                    ${$op} = $op_;
                    //contenu de la recherche
                    $field = "field_0_" . $search[0];
                    $field_ = array();
                    $field_[0] = $n;
                    global ${$field};
                    ${$field} = $field_;
                    //opérateur inter-champ
                    $inter = "inter_0_" . $search[0];
                    global ${$inter};
                    ${$inter} = "";
                    //variables auxiliaires
                    $fieldvar_ = "fieldvar_0_" . $search[0];
                    global ${$fieldvar_};
                    ${$fieldvar_} = "";
                    $fieldvar = ${$fieldvar_};
                }
            }
            if ($search_in_perio) {
                global $search;
                $search[0] = "f_34";
                //opérateur
                $op = "op_0_" . $search[0];
                global ${$op};
                $op_ = "EQ";
                ${$op} = $op_;
                //contenu de la recherche
                $field = "field_0_" . $search[0];
                $field_ = array();
                $field_[0] = $search_in_perio;
                global ${$field};
                ${$field} = $field_;
                $search[1] = "f_42";
                //opérateur
                $op = "op_1_" . $search[0];
                global ${$op};
                $op_ = "BOOLEAN";
                ${$op} = $op_;
            } else {
                if ($get_query) {
                    if ($_SESSION["last_query"] == $get_query && $_SESSION["lq_facette_test"]) {
                        search::unserialize_search($_SESSION["lq_facette_search"]["lq_search"]);
                    } else {
                        get_history($get_query);
                    }
                }
            }
            $es = new search();
            if ($onglet_persopac) {
                $search_form = $search_form_perso;
                global $search;
                if (!$search) {
                    $search_p_direct = new search_persopac($onglet_persopac);
                    $es->unserialize_search($search_p_direct->query);
                }
            }
            if ($limitsearch) {
                $search_form = $search_form_perso_limitsearch;
            }
            if ($onglet_persopac && $lvl == "search_result") {
                $es->reduct_search();
            }
            $result = $es->show_form("./index.php?lvl={$lvl}&search_type_asked=extended_search", "./index.php?lvl=search_result&search_type_asked=extended_search");
            $others = "<li><a href=\"./index.php?search_type_asked=simple_search\">" . $msg["simple_search"] . "</a></li>\n";
            if ($opac_allow_personal_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=search_perso\">" . $msg["search_perso_menu"] . "</a></li>";
            }
            $others .= $onglets_search_perso;
            if ($opac_allow_term_search) {
                $others2 = "<li><a href=\"./index.php?search_type_asked=term_search\">" . $msg["term_search"] . "</a></li>\n";
            } else {
                $others2 = "";
            }
            if ($opac_allow_tags_search) {
                $others2 .= "<li><a href=\"./index.php?search_type_asked=tags_search\">" . $msg["tags_search"] . "</a></li>";
            }
            if ($opac_show_onglet_perio_a2z) {
                $others2 .= "<li><a href=\"./index.php?search_type_asked=perio_a2z\">" . $msg["a2z_onglet"] . "</a></li>";
            }
            if ($opac_show_onglet_empr == 1 || $opac_show_onglet_empr == 2 && $_SESSION["user_code"]) {
                if (!$_SESSION["user_code"]) {
                    $others2 .= "<li><a href=\"./index.php?search_type_asked=connect_empr\">" . $msg["onglet_empr_connect"] . "</a></li>";
                } else {
                    $others2 .= "<li><a href=\"{$empr_link_onglet}\">" . $msg["onglet_empr_compte"] . "</a></li>";
                }
            }
            if ($opac_allow_external_search) {
                $others2 .= "<li><a href=\"./index.php?search_type_asked=external_search&external_type=simple\">" . $msg["connecteurs_external_search"] . "</a></li>";
            }
            $result = str_replace("!!others!!", $others, $result);
            $result = str_replace("!!others2!!", $others2, $result);
            $result = "<div id='search'>" . $result . "</div>";
            $result .= $onglets_search_perso_form;
            break;
            //Recherche avancee
        //Recherche avancee
        case "external_search":
            //Si c'est une multi-critere, on l'affiche telle quelle
            global $external_type;
            if ($external_type) {
                $_SESSION["ext_type"] = $external_type;
            }
            global $mode_aff;
            //Affinage
            if ($mode_aff) {
                if ($mode_aff == "aff_module") {
                    //ajout de la recherche dans l'historique
                    $_SESSION["nb_queries"] = $_SESSION["nb_queries"] + 1;
                    $n = $_SESSION["nb_queries"];
                    $_SESSION["notice_view" . $n] = $_SESSION["last_module_search"];
                    switch ($_SESSION["last_module_search"]["search_mod"]) {
                        case 'etagere_see':
                            //appel de la fonction tableau_etagere du fichier etagere_func.inc.php
                            $r1 = $msg["etagere_query"];
                            $t = array();
                            $t = tableau_etagere($_SESSION["last_module_search"]["search_id"]);
                            $r = $r1 . " '" . $t[0]["nometagere"] . "'";
                            break;
                        case 'categ_see':
                            // instanciation de la catégorie
                            $ourCateg = new categorie($_SESSION["last_module_search"]["search_id"]);
                            $r1 = $msg["category"];
                            $r = $r1 . " '" . $ourCateg->libelle . "'";
                            break;
                        case 'indexint_see':
                            // instanciation de la classe indexation
                            $r1 = $msg["indexint_search"];
                            $ourIndexint = new indexint($_SESSION["last_module_search"]["search_id"]);
                            $r = $r1 . " '" . $ourIndexint->name . " " . $ourIndexint->comment . "'";
                            break;
                        case 'section_see':
                            $resultat = mysql_query("select location_libelle from docs_location where idlocation='" . addslashes($_SESSION["last_module_search"]["search_location"]) . "'");
                            $j = mysql_fetch_array($resultat);
                            $localisation_ = $j["location_libelle"];
                            mysql_free_result($resultat);
                            $resultat = mysql_query("select section_libelle from docs_section where idsection='" . addslashes($_SESSION["last_module_search"]["search_id"]) . "'");
                            $j = mysql_fetch_array($resultat);
                            $section_ = $j["section_libelle"];
                            mysql_free_result($resultat);
                            $r1 = $localisation_ . " => " . $msg["section"];
                            $r = $r1 . " '" . $section_ . "'";
                            break;
                    }
                    $_SESSION["human_query" . $n] = $r;
                    $_SESSION["search_type" . $n] = "module";
                } else {
                    if ($_SESSION["last_query"]) {
                        $n = $_SESSION["last_query"];
                    } else {
                        $n = $_SESSION["nb_queries"];
                    }
                }
            }
            if ($_SESSION["ext_type"] == "multi") {
                global $search;
                if (!$search) {
                    $search[0] = "s_2";
                    $op_0_s_2 = "EQ";
                    $field_0_s_2 = array();
                } else {
                    //Recherche du champp source, s'il n'est pas present, on decale tout et on l'ajoute
                    $flag_found = false;
                    for ($i = 0; $i < count($search); $i++) {
                        if ($search[$i] == "s_2") {
                            $flag_found = true;
                            break;
                        }
                    }
                    if (!$flag_found) {
                        //Pas trouve, on decale tout !!
                        for ($i = count($search) - 1; $i >= 0; $i--) {
                            $search[$i + 1] = $search[$i];
                            decale("field_" . $i . "_" . $search[$i], "field_" . ($i + 1) . "_" . $search[$i]);
                            decale("op_" . $i . "_" . $search[$i], "op_" . ($i + 1) . "_" . $search[$i]);
                            decale("inter_" . $i . "_" . $search[$i], "inter_" . ($i + 1) . "_" . $search[$i]);
                            decale("fieldvar_" . $i . "_" . $search[$i], "fieldvar_" . ($i + 1) . "_" . $search[$i]);
                        }
                        $search[0] = "s_2";
                        $op_0_s_2 = "EQ";
                        $field_0_s_2 = array();
                    }
                }
                if ($mode_aff) {
                    //générer les critères de la multi_critères
                    $search[1] = "s_1";
                    $op_ = "EQ";
                    //opérateur
                    $op = "op_1_" . $search[1];
                    global ${$op};
                    ${$op} = $op_;
                    //contenu de la recherche
                    $field = "field_1_" . $search[1];
                    $field_ = array();
                    $field_[0] = $n;
                    global ${$field};
                    ${$field} = $field_;
                    //opérateur inter-champ
                    $inter = "inter_1_" . $search[1];
                    global ${$inter};
                    ${$inter} = "and";
                    //variables auxiliaires
                    $fieldvar_ = "fieldvar_1_" . $search[1];
                    global ${$fieldvar_};
                    ${$fieldvar_} = "";
                    $fieldvar = ${$fieldvar_};
                }
                $es = new search("search_fields_unimarc");
                $result = $es->show_form("./index.php?lvl={$lvl}&search_type_asked=external_search", "./index.php?lvl=search_result&search_type_asked=external_search");
            } else {
                global $mode_aff;
                //Si il y a une mode d'affichage demandé, on construit l'écran correspondant
                if ($mode_aff) {
                    $f = get_field_text($n);
                    $user_query = $f[0];
                    $look = $f[1];
                    global ${$look};
                    ${$look} = 1;
                    global $look_FIRSTACCESS;
                    $look_FIRSTACCESS = 1;
                } else {
                    if ($external_env) {
                        $external_env = unserialize(stripslashes($external_env));
                        foreach ($external_env as $varname => $varvalue) {
                            global ${$varname};
                            ${$varname} = $varvalue;
                        }
                    }
                }
                $result = $search_input;
                $result = str_replace("!!user_query!!", htmlentities(stripslashes($user_query), ENT_QUOTES, $charset), $result);
                $result = str_replace("<!--!!ou_chercher!!-->", do_ou_chercher(), $result);
                $result = str_replace("<!--!!sources!!-->", do_sources(), $result);
            }
            $others = "<li><a href=\"./index.php?search_type_asked=simple_search\">" . $msg["simple_search"] . "</a></li>\n";
            if ($opac_allow_personal_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=search_perso\">" . $msg["search_perso_menu"] . "</a></li>";
            }
            $others .= $onglets_search_perso;
            if ($opac_allow_extended_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=extended_search\">" . $msg["extended_search"] . "</a></li>";
            }
            if ($opac_allow_term_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=term_search\">" . $msg["term_search"] . "</a></li>\n";
            }
            if ($opac_allow_tags_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=tags_search\">" . $msg["tags_search"] . "</a></li>";
            }
            if ($opac_show_onglet_perio_a2z) {
                $others .= "<li><a href=\"./index.php?search_type_asked=perio_a2z\">" . $msg["a2z_onglet"] . "</a></li>";
            }
            if ($opac_show_onglet_empr == 1 || $opac_show_onglet_empr == 2 && $_SESSION["user_code"]) {
                if (!$_SESSION["user_code"]) {
                    $others .= "<li><a href=\"./index.php?search_type_asked=connect_empr\">" . $msg["onglet_empr_connect"] . "</a></li>";
                } else {
                    $others .= "<li><a href=\"{$empr_link_onglet}\">" . $msg["onglet_empr_compte"] . "</a></li>";
                }
            }
            $others2 = "";
            $result = str_replace("!!others!!", $others, $result);
            $result = str_replace("!!others2!!", $others2, $result);
            $result = "<div id='search'>" . $result . "</div>";
            $result .= $onglets_search_perso_form;
            break;
            //Recherche par termes
        //Recherche par termes
        case "term_search":
            global $search_term;
            global $term_click;
            global $page_search;
            global $opac_term_search_height;
            global $opac_show_help;
            if (!$opac_term_search_height) {
                $height = 300;
            } else {
                $height = $opac_term_search_height;
            }
            $search_form_term = "\n\t\t\t<div id='search'>\n\t\t\t<ul class='search_tabs'>!!others!!" . ($opac_show_onglet_help ? "<li><a href=\"./index.php?lvl=infopages&pagesid={$opac_show_onglet_help}\">" . $msg["search_help"] . "</a></li>" : '') . "\n\t\t\t</ul>\n\t\t\t<div id='search_crl'></div>\n\t\t\t<form class='form-{$current_module}' name='term_search_form' method='post' action='./index.php?lvl={$lvl}&search_type_asked=term_search'>\n\t\t\t\t<div class='form-contenu'>\n\t\t\t\t<!-- sel_thesaurus -->\n\t\t\t\t\t\t\t<span class='libSearchTermes'>" . $msg["term_search_search_for"] . "</span><input type='text' class='saisie-50em' name='search_term' value='" . htmlentities(stripslashes($search_term), ENT_QUOTES, $charset) . "'>\n\t\t\t\t\t<!--\tBouton Rechercher -->\n\t\t\t\t\t\t<input type='submit' class='boutonrechercher' value='{$msg['142']}' onClick=\"this.form.page_search.value=''; this.form.term_click.value='';\"/>\n";
            if ($opac_show_help) {
                $search_form_term .= "<input type='submit' class='bouton' value='{$msg['search_help']}' onClick='window.open(\"help.php?whatis=search_terms\", \"search_help\", \"scrollbars=yes, toolbar=no, dependent=yes, width=400, height=400, resizable=yes\"); return false' />\n";
            }
            $search_form_term .= "<input type='hidden' name='term_click' value='" . htmlentities(stripslashes($term_click), ENT_QUOTES, $charset) . "'/>\n\t\t\t\t<input type='hidden' name='page_search' value='" . $page_search . "'/>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t\t<script type='text/javascript'>\n\t\t\t\tdocument.forms['term_search_form'].elements['search_term'].focus();\n\t\t\t\t</script>\n\t\t\t</div>\n\t\t\t";
            //recuperation du thesaurus session
            if (!$id_thes) {
                $id_thes = thesaurus::getSessionThesaurusId();
            } else {
                thesaurus::setSessionThesaurusId($id_thes);
            }
            //affichage du selectionneur de thesaurus et du lien vers les thesaurus
            $liste_thesaurus = thesaurus::getThesaurusList();
            $sel_thesaurus = '';
            $lien_thesaurus = '';
            if ($opac_thesaurus != 0) {
                //la liste des thesaurus n'est pas affichée en mode monothesaurus
                $sel_thesaurus = "<select class='saisie-30em' id='id_thes' name='id_thes' ";
                $sel_thesaurus .= "onchange = \"document.location = './index.php?lvl=index&search_type_asked=term_search&id_thes='+document.getElementById('id_thes').value; \">";
                foreach ($liste_thesaurus as $id_thesaurus => $libelle_thesaurus) {
                    $sel_thesaurus .= "<option value='" . $id_thesaurus . "' ";
                    if ($id_thesaurus == $id_thes) {
                        $sel_thesaurus .= " selected";
                    }
                    $sel_thesaurus .= ">" . htmlentities($libelle_thesaurus, ENT_QUOTES, $charset) . "</option>";
                }
                $sel_thesaurus .= "<option value=-1 ";
                if ($id_thes == -1) {
                    $sel_thesaurus .= "selected ";
                }
                $sel_thesaurus .= ">" . htmlentities($msg['thes_all'], ENT_QUOTES, $charset) . "</option>";
                $sel_thesaurus .= "</select>&nbsp;";
                $lien_thesaurus = "<a href='./autorites.php?categ=categories&sub=thes'>" . $msg[thes_lien] . "</a>";
            }
            $search_form_term = str_replace("<!-- sel_thesaurus -->", $sel_thesaurus, $search_form_term);
            $search_form_term = str_replace("<!-- lien_thesaurus -->", $lien_thesaurus, $search_form_term);
            $result = $search_form_term;
            $others = "";
            $others .= "<li><a href=\"./index.php?search_type_asked=simple_search\">" . $msg["simple_search"] . "</a></li>";
            if ($opac_allow_personal_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=search_perso\">" . $msg["search_perso_menu"] . "</a></li>";
            }
            $others .= $onglets_search_perso;
            if ($opac_allow_extended_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=extended_search\">" . $msg["extended_search"] . "</a></li>";
            }
            $others .= "<li id='current'>" . $msg["search_by_terms"] . "</li>";
            if ($opac_allow_tags_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=tags_search\">" . $msg["tags_search"] . "</a></li>";
            }
            if ($opac_show_onglet_perio_a2z) {
                $others .= "<li><a href=\"./index.php?search_type_asked=perio_a2z\">" . $msg["a2z_onglet"] . "</a></li>";
            }
            if ($opac_show_onglet_empr == 1 || $opac_show_onglet_empr == 2 && $_SESSION["user_code"]) {
                if (!$_SESSION["user_code"]) {
                    $others .= "<li><a href=\"./index.php?search_type_asked=connect_empr\">" . $msg["onglet_empr_connect"] . "</a></li>";
                } else {
                    $others .= "<li><a href=\"{$empr_link_onglet}\">" . $msg["onglet_empr_compte"] . "</a></li>";
                }
            }
            if ($opac_allow_external_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=external_search&external_type=simple\">" . $msg["connecteurs_external_search"] . "</a></li>";
            }
            $result = str_replace("!!others!!", $others, $result);
            $result .= "\n\t\t\t<a name='search_frame'/>\n\t\t\t<iframe style='border: solid 1px black;' name='term_search' class='frame_term_search' src='" . $base_path . "/term_browse.php?search_term=" . rawurlencode(stripslashes($search_term)) . "&term_click=" . rawurlencode(stripslashes($term_click)) . "&page_search={$page_search}&id_thes={$id_thes}' width='100%' height='" . $height . "'></iframe>\n\t\t\t<br /><br />";
            $result .= $onglets_search_perso_form;
            break;
        case "tags_search":
            // les tests de formulaire
            $result = $script_test_form;
            $tests = test_field("search_input", "query", "recherche");
            $result = str_replace("!!tests!!", $tests, $result);
            if ($opac_search_other_function) {
                $toprint_typdocfield .= search_other_function_filters();
            }
            // le contenu
            $result .= $search_input;
            // on met la valeur a jour
            $result = str_replace("!!user_query!!", htmlentities($value, ENT_QUOTES, $charset), $result);
            $result = str_replace("<!--!!typdoc_field!!-->", "", $result);
            $result = str_replace("<!--!!ou_chercher!!-->", "", $result);
            // on se place dans le bon champ
            // $result .= form_focus("search_input", "query");
            $others = "";
            $others = "<li><a href=\"./index.php?search_type_asked=simple_search\">" . $msg["simple_search"] . "</a></li>\n";
            if ($opac_allow_personal_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=search_perso\">" . $msg["search_perso_menu"] . "</a></li>";
            }
            $others .= $onglets_search_perso;
            if ($opac_allow_extended_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=extended_search\">" . $msg["extended_search"] . "</a></li>";
            }
            if ($opac_allow_term_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=term_search\">" . $msg["term_search"] . "</a></li>";
            }
            if ($opac_allow_tags_search) {
                $others .= "<li id='current'>" . $msg["tags_search"] . "</li>";
            }
            if ($opac_show_onglet_perio_a2z) {
                $others .= "<li><a href=\"./index.php?search_type_asked=perio_a2z\">" . $msg["a2z_onglet"] . "</a></li>";
            }
            if ($opac_show_onglet_empr == 1 || $opac_show_onglet_empr == 2 && $_SESSION["user_code"]) {
                if (!$_SESSION["user_code"]) {
                    $others .= "<li><a href=\"./index.php?search_type_asked=connect_empr\">" . $msg["onglet_empr_connect"] . "</a></li>";
                } else {
                    $others .= "<li><a href=\"{$empr_link_onglet}\">" . $msg["onglet_empr_compte"] . "</a></li>";
                }
            }
            if ($opac_allow_external_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=external_search&external_type=simple\">" . $msg["connecteurs_external_search"] . "</a></li>";
            }
            $result = str_replace("!!others!!", $others, $result);
            // Ajout de la liste des tags
            if ($user_query == "") {
                $result .= "<h3><span>{$msg['search_result_for']}<b>" . htmlentities(stripslashes($user_query), ENT_QUOTES, $charset) . "</b></span></h3>";
                $tag = new tags();
                $result .= $tag->listeAlphabetique();
            }
            $result .= $onglets_search_perso_form;
            break;
            // *****************
            // Pour affichage compte emprunteur en onglet
        // *****************
        // Pour affichage compte emprunteur en onglet
        case "connect_empr":
            // les tests de formulaire
            $result = $search_input;
            $others = "";
            $others = "<li><a href=\"./index.php?search_type_asked=simple_search\">" . $msg["simple_search"] . "</a></li>\n";
            if ($opac_allow_personal_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=search_perso\">" . $msg["search_perso_menu"] . "</a></li>";
            }
            $others .= $onglets_search_perso;
            if ($opac_allow_extended_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=extended_search\">" . $msg["extended_search"] . "</a></li>";
            }
            if ($opac_allow_term_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=term_search\">" . $msg["term_search"] . "</a></li>";
            }
            if ($opac_allow_tags_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=tags_search\">" . $msg["tags_search"] . "</a></li>";
            }
            if ($opac_show_onglet_perio_a2z) {
                $others .= "<li><a href=\"./index.php?search_type_asked=perio_a2z\">" . $msg["a2z_onglet"] . "</a></li>";
            }
            if ($opac_show_onglet_empr) {
                if (!$_SESSION["user_code"]) {
                    $others .= "<li id='current'>" . $msg["onglet_empr_connect"] . "</li>";
                } else {
                    $others .= "<li id='current'>" . $msg["onglet_empr_compte"] . "</li>";
                }
            }
            if ($opac_allow_external_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=external_search&external_type=simple\">" . $msg["connecteurs_external_search"] . "</a></li>";
            }
            $result = str_replace("!!account_or_form_empr_connect!!", affichage_onglet_compte_empr(), $result);
            $result = str_replace("!!others!!", $others, $result);
            $result .= $onglets_search_perso_form;
            break;
        case "search_perso":
            // les tests de formulaire
            $result = $search_input;
            $others = "";
            $others = "<li><a href=\"./index.php?search_type_asked=simple_search\">" . $msg["simple_search"] . "</a></li>\n";
            if ($opac_allow_personal_search) {
                $others .= "<li id='current'>" . $msg["search_perso_menu"] . "</li>";
            }
            $others .= $onglets_search_perso;
            if ($opac_allow_extended_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=extended_search\">" . $msg["extended_search"] . "</a></li>";
            }
            if ($opac_allow_term_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=term_search\">" . $msg["term_search"] . "</a></li>";
            }
            if ($opac_allow_tags_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=tags_search\">" . $msg["tags_search"] . "</a></li>";
            }
            if ($opac_show_onglet_perio_a2z) {
                $others .= "<li><a href=\"./index.php?search_type_asked=perio_a2z\">" . $msg["a2z_onglet"] . "</a></li>";
            }
            if ($opac_show_onglet_empr == 1 || $opac_show_onglet_empr == 2 && $_SESSION["user_code"]) {
                if (!$_SESSION["user_code"]) {
                    $others .= "<li><a href=\"./index.php?search_type_asked=connect_empr\">" . $msg["onglet_empr_connect"] . "</a></li>";
                } else {
                    $others .= "<li><a href=\"{$empr_link_onglet}\">" . $msg["onglet_empr_compte"] . "</a></li>";
                }
            }
            if ($opac_allow_external_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=external_search&external_type=simple\">" . $msg["connecteurs_external_search"] . "</a></li>";
            }
            $search_p = new search_persopac();
            $result = str_replace("!!contenu!!", $search_p->do_list(), $result);
            $result = str_replace("!!others!!", $others, $result);
            break;
        case "perio_a2z":
            global $opac_perio_a2z_abc_search;
            global $opac_perio_a2z_max_per_onglet;
            $result = $search_input;
            $others .= "<li><a href=\"./index.php?search_type_asked=simple_search\">" . $msg["simple_search"] . "</a></li>\n";
            if ($opac_allow_personal_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=search_perso\">" . $msg["search_perso_menu"] . "</a></li>";
            }
            $others .= $onglets_search_perso;
            if ($opac_allow_extended_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=extended_search\">" . $msg["extended_search"] . "</a></li>";
            }
            if ($opac_allow_term_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=term_search\">" . $msg["term_search"] . "</a></li>";
            }
            if ($opac_allow_tags_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=tags_search\">" . $msg["tags_search"] . "</a></li>";
            }
            if ($opac_show_onglet_perio_a2z) {
                $others .= "<li id='current'>" . $msg["a2z_onglet"] . "</li>";
            }
            if ($opac_show_onglet_empr == 1 || $opac_show_onglet_empr == 2 && $_SESSION["user_code"]) {
                if (!$_SESSION["user_code"]) {
                    $others .= "<li><a href=\"./index.php?search_type_asked=connect_empr\">" . $msg["onglet_empr_connect"] . "</a></li>";
                } else {
                    $others .= "<li><a href=\"{$empr_link_onglet}\">" . $msg["onglet_empr_compte"] . "</a></li>";
                }
            }
            if ($opac_allow_external_search) {
                $others .= "<li><a href=\"./index.php?search_type_asked=external_search&external_type=simple\">" . $msg["connecteurs_external_search"] . "</a></li>";
            }
            $result = str_replace("!!others!!", $others, $result);
            // affichage des _perio_a2z
            $a2z = new perio_a2z(0, $opac_perio_a2z_abc_search, $opac_perio_a2z_max_per_onglet);
            $a2z_form = $a2z->get_form();
            $a2z_form .= $onglets_search_perso_form;
            $result = str_replace("!!contenu!!", $a2z_form, $result);
            break;
    }
    return $result;
}
 protected function add_search($rmc)
 {
     global $include_path, $pmb_opac_url;
     global $lang, $msg, $base_path;
     //Template du formulaire de recherches avancées
     global $name;
     global $rmc_encours;
     global $search_form;
     if ($rmc != "new" && !$rmc_encours) {
         $infos = $this->managed_datas['rmcs'][$rmc];
         $name = $infos['name'];
         $search_rmc = $infos['rmc'];
     } elseif ($rmc == "new" && !$rmc_encours) {
         $name = "Nouvelle recherche";
     }
     $search_form = "\n\t\t<script src=\"javascript/ajax.js\"></script>\n\t\t<form name='search_form' action='!!url!!' method='post' onsubmit=\"valid_form_extented_search();\" >\n\t\t\t\n\t\t\t<div class='form-contenu'>\n\t\t\t\t<div class='colonne3'>\n\t\t\t\t\t<label for='name'>" . $this->format_text($this->msg['cms_module_tagcloud_datasource_admin_rmc_name']) . "</label>\n\t\t\t\t</div>\n\t\t\t\t<div class='colonne-suite'>\n\t\t\t\t\t<input id='name' type='text' name='name' value='{$name}'/>\n\t\t\t\t</div>\n\t\t\t\t<!--!!before_form!!--> \n\t\t\t\t<div class='colonne3'>!!limit_search!!\t\t\n\t\t\t\t\t<label class='etiquette' for='add_field'>" . $this->format_text($this->msg['cms_module_tagcloud_datasource_admin_rmc_addlabel']) . "</label> \n\t\t\t\t</div>\t\n\t\t\t\t<div class='colonne-suite'>\n\t\t\t\t\t!!field_list!! \n\t\t\t\t\t<input type='button' class='bouton' value='" . $this->format_text($this->msg['cms_module_tagcloud_datasource_admin_rmc_add']) . "' onClick=\"if (this.form.add_field.value!='') { this.form.action='!!url!!'; this.form.target=''; this.form.submit();} else { alert('" . $msg["multi_select_champ"] . "'); }\"/>\n\t\t\t\t</div>\n\t\t \t\t<br />\n\t\t\t\t<div class='row'>\n\t\t\t\t\t!!already_selected_fields!!\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<input type='button' class='bouton' value='" . $this->format_text($this->msg['cms_module_tagcloud_datasource_admin_rmc_save']) . "' onClick=\"this.form.launch_search.value=1; this.form.action='!!memo_url!!'; this.form.page.value=''; !!target_js!! this.form.submit()\"/>\n\t\t\t</div>\n\t\t\n\t\t\t<input type='hidden' name='delete_field' value=''/>\n\t\t\t<input type='hidden' name='launch_search' value=''/>\n\t\t\t<input type='hidden' name='page' value='!!page!!'/>\n\t\t</form>\n\t\t<script>ajax_parse_dom();\t\n\t\t\tfunction valid_form_extented_search(){\n\t\t\t\tdocument.search_form.launch_search.value=1;\n\t\t\t\tdocument.search_form.action='!!result_url!!';\n\t\t\t\tdocument.search_form.page.value='';\n\t\t\t\t!!target_js!!\n\t\t\t\t//document.search_form.submit();\n\t\t\t}\n\t\t</script>\t\t\n\t\t";
     $save_msg = $msg;
     // Recherche du fichier lang de l'opac
     $url = $pmb_opac_url . "includes/messages/{$lang}.xml";
     $fichier_xml = $base_path . "/temp/opac_lang.xml";
     $this->curl_load_file($url, $fichier_xml);
     $messages = new XMLlist("{$base_path}/temp/opac_lang.xml", 0);
     $messages->analyser();
     $msg = $messages->table;
     $url = $pmb_opac_url . "includes/search_queries/search_fields.xml";
     $fichier_xml = "{$base_path}/temp/search_fields_opac.xml";
     $this->curl_load_file($url, $fichier_xml);
     $my_search = new search(false, "search_fields_opac", "{$base_path}/temp/");
     if ($search_rmc) {
         $my_search->unserialize_search($search_rmc);
     }
     // $url,$result_url,$result_target='',$memo_url=''
     $form = $my_search->show_form("./cms.php?categ=manage&sub=tagcloud&quoi=datasources&elem=" . $this->class_name . "&rmc={$rmc}&action=get_form&type=rmc&rmc_encours=1", "", "", "./cms.php?categ=manage&sub=tagcloud&quoi=datasources&elem=" . $this->class_name . "&rmc={$rmc}&action=save_form&type=rmc");
     $msg = $save_msg;
     return $form;
 }
예제 #17
0
// afin de résoudre un pb d'effacement de la variable $id_empr par empr_included, bug à trouver
if (!$id_empr) {
    $id_empr = $_SESSION["id_empr_session"];
}
print "<div id='aut_details' class='aut_details_bannette'>\n";
print "<h3><span>" . $msg['dsi_bt_bannette_priv'] . "</span></h3>\n";
if ($enregistrer == 1 && !$nom_bannette) {
    $enregistrer = 2;
}
if (!$enregistrer) {
    search::unhistorize_search();
    search::strip_slashes();
    $equation = search::serialize_search();
} else {
    $equation = stripslashes($equation);
    search::unserialize_search($equation);
}
if ($equation) {
    // on arrive de la rech multi-critères
    $s = new search();
    $equ_human = $s->make_serialized_human_query($equation);
    if ($enregistrer == '1') {
        $qui = addslashes($empr_nom . " " . $empr_prenom);
        $rqt_equation = "insert into equations (id_equation, num_classement, nom_equation, comment_equation, requete, proprio_equation) ";
        $rqt_equation .= "VALUES (0,0,'" . addslashes($equ_human) . "','{$qui} -> {$nom_bannette}','" . addslashes($equation) . "', {$id_empr})";
        pmb_mysql_query($rqt_equation);
        $id_equation = pmb_mysql_insert_id();
        // paramétrage OPAC: choix du nom de la bibliothèque comme expéditeur
        $requete = "select location_libelle, email, adr1, cp, town from empr, docs_location where empr_location=idlocation and id_empr='{$id_empr}' ";
        $res = pmb_mysql_query($requete, $dbh);
        $loc = pmb_mysql_fetch_object($res);
예제 #18
0
 function remplir()
 {
     global $dbh;
     global $msg;
     if (!$this->id_bannette) {
         return $msg['dsi_ban_no_access'];
     }
     // impossible d'accéder à cette bannette
     // récupérer les équations associées à la bannette
     $equations = $this->get_equations();
     $res_affichage = "<ul>";
     if ($this->update_type == "C") {
         $colonne_update_create = "create_date";
     } else {
         $colonne_update_create = "update_date";
     }
     for ($i = 0; $i < sizeof($equations); $i++) {
         // pour chaque équation ajouter les notices trouvées au contenu de la bannette
         $equ = new equation($equations[$i]);
         $search = new search();
         $search->unserialize_search($equ->requete);
         $table = $search->make_search();
         if ($this->statut_not_account) {
             $temp_requete = "insert ignore into bannette_contenu (num_bannette, num_notice) (select " . $this->id_bannette . " , notices.notice_id from {$table} , notices where notices.{$colonne_update_create}>='" . $this->date_last_envoi . "' and {$table}.notice_id=notices.notice_id )";
         } else {
             $temp_requete = "insert ignore into bannette_contenu (num_bannette, num_notice) (select " . $this->id_bannette . " , notices.notice_id from {$table} , notices, notice_statut where notices.{$colonne_update_create}>='" . $this->date_last_envoi . "' and {$table}.notice_id=notices.notice_id and statut=id_notice_statut and ((notice_visible_opac=1 and notice_visible_opac_abon=0) or (notice_visible_opac_abon=1 and notice_visible_opac=1))) ";
         }
         @pmb_mysql_query($temp_requete, $dbh);
         $res_affichage .= "<li>" . $equ->human_query . "</li>";
         $temp_requete = "drop table {$table} ";
         @pmb_mysql_query($temp_requete, $dbh);
     }
     // remplissage du panier avec le contenu de la bannette
     if ($this->num_panier) {
         $temp_requete = "delete from caddie_content where caddie_id='" . $this->num_panier . "'";
         pmb_mysql_query($temp_requete, $dbh);
         $temp_requete = "insert into caddie_content (caddie_id, object_id) (select " . $this->num_panier . ", num_notice from bannette_contenu where num_bannette=" . $this->id_bannette . ")";
         pmb_mysql_query($temp_requete, $dbh) or die(pmb_mysql_error() . $temp_requete);
     }
     $res_affichage .= "</ul>";
     $this->compte_elements();
     $temp_requete = "update bannettes set date_last_remplissage=sysdate() where id_bannette='" . $this->id_bannette . "' ";
     pmb_mysql_query($temp_requete, $dbh);
     $this->purger();
     return $res_affichage;
 }
예제 #19
0
function get_last_history()
{
    global $search_type;
    global $opac_search_other_function;
    global $facette_test;
    global $reinit_facette;
    if ($reinit_facette == 1) {
        unset($_SESSION["lq_facette"]);
        unset($_SESSION["lq_facette_search"]);
        unset($_SESSION["lq_facette_test"]);
    }
    $search_type = $_SESSION["search_type" . $_SESSION["last_query"]];
    $facette_test = $_SESSION["lq_facette_test"];
    if ($search_type == "module" && count($_SESSION['facette'] == 0)) {
        //Cas spécial pour section_see
        $ajout_section = '';
        if ($_SESSION['last_module_search']['search_mod'] == 'section_see') {
            $ajout_section = '&location=' . $_SESSION['last_module_search']['search_location'];
            if ($_SESSION['last_module_search']['search_plettreaut']) {
                $ajout_section .= '&plettreaut=' . $_SESSION["last_module_search"]["search_plettreaut"];
            } elseif ($_SESSION["last_module_search"]["search_dcote"] || $_SESSION["last_module_search"]["search_lcote"] || $_SESSION["last_module_search"]["search_nc"] || $_SESSION["last_module_search"]["search_ssub"]) {
                $ajout_section .= '&dcote=' . $_SESSION["last_module_search"]["search_dcote"];
                $ajout_section .= '&lcote=' . $_SESSION["last_module_search"]["search_lcote"];
                $ajout_section .= '&nc=' . $_SESSION["last_module_search"]["search_nc"];
                $ajout_section .= '&ssub=' . $_SESSION["last_module_search"]["search_ssub"];
            }
        } elseif ($_SESSION['last_module_search']['search_mod'] == 'categ_see') {
            if ($_SESSION['last_module_search']['search_nb_level_enfants']) {
                $ajout_section .= '&nb_level_enfants=' . $_SESSION["last_module_search"]["search_nb_level_enfants"];
            }
            if ($_SESSION['last_module_search']['search_nb_level_parents']) {
                $ajout_section .= '&nb_level_parents=' . $_SESSION["last_module_search"]["search_nb_level_parents"];
            }
        }
        header("Location: ./index.php?lvl=" . $_SESSION['last_module_search']['search_mod'] . $ajout_section . "&id=" . $_SESSION['last_module_search']['search_id']);
    }
    switch ($search_type) {
        case "simple_search":
            if (!$facette_test) {
                global $user_query, $mode, $count, $typdoc, $clause, $clause_bull, $clause_bull_num_notice, $tri, $pert, $page, $l_typdoc, $join, $id_thes;
                $user_query = $_SESSION["lq_user_query"];
                $mode = $_SESSION["lq_mode"];
                $count = $_SESSION["lq_count"];
                $typdoc = $_SESSION["lq_typdoc"];
                $clause = $_SESSION["lq_clause"];
                $clause_bull = $_SESSION["lq_clause_bull"];
                $clause_bull_num_notice = $_SESSION["lq_clause_bull_num_notice"];
                $tri = $_SESSION["lq_tri"];
                $pert = $_SESSION["lq_pert"];
                $page = $_SESSION["lq_page"];
                $affiliate_page = $_SESSION["lq_affiliate_page"];
                $catalog_page = $_SESSION["lq_catalog_page"];
                $l_typdoc = $_SESSION["lq_l_typdoc"];
                $join = $_SESSION["lq_join"];
                $id_thes = $_SESSION["lq_id_thes"];
                $_SESSION["facette"] = $_SESSION["lq_facette"];
                $_SESSION["level1"] = $_SESSION["lq_level1"];
                if ($opac_search_other_function) {
                    search_other_function_get_history($_SESSION["last_query"]);
                }
            }
            break;
        case "module":
            global $mode;
            $mode = "extended";
            global $search;
            $search[0] = "s_1";
            $op_ = "EQ";
            //operateur
            $op = "op_0_" . $search[0];
            global ${$op};
            ${$op} = $op_;
            //contenu de la recherche
            $field = "field_0_" . $search[0];
            $field_ = array();
            $field_[0] = $_SESSION['last_query'];
            global ${$field};
            ${$field} = $field_;
            //opérateur inter-champ
            $inter = "inter_0_" . $search[0];
            global ${$inter};
            ${$inter} = "";
            //variables auxiliaires
            $fieldvar_ = "fieldvar_0_" . $search[0];
            global ${$fieldvar_};
            ${$fieldvar_} = "";
            $fieldvar = ${$fieldvar_};
            break;
        case "extended_search":
            global $page, $mode, $catalog_page, $affiliate_page;
            get_history($_SESSION["last_query"]);
            $page = $_SESSION["lq_page"];
            $affiliate_page = $_SESSION["lq_affiliate_page"];
            $catalog_page = $_SESSION["lq_catalog_page"];
            $mode = $_SESSION["lq_mode"];
            break;
    }
    if ($facette_test) {
        global $page, $mode, $catalog_page, $affiliate_page;
        $_SESSION["facette"] = $_SESSION["lq_facette"];
        $page = $_SESSION["lq_facette_search"]["lq_page"];
        $affiliate_page = $_SESSION["lq_facette_search"]["lq_affiliate_page"];
        $catalog_page = $_SESSION["lq_facette_search"]["lq_catalog_page"];
        $mode = $_SESSION["lq_facette_search"]["lq_mode"];
        search::unserialize_search($_SESSION["lq_facette_search"]["lq_search"]);
        $_SESSION["notice_view" . $_SESSION["last_query"]] = $_SESSION["lq_facette_search"]["lq_notice_view"];
    }
}
예제 #20
0
 function do_list()
 {
     global $tpl_search_perso_liste_tableau, $tpl_search_perso_liste_tableau_ligne;
     // liste des lien de recherche directe
     $tpl_search_perso_liste_tableau = str_replace('!!preflink!!', $this->directlink_user, $tpl_search_perso_liste_tableau);
     $liste = "";
     // pour toute les recherche de l'utilisateur
     $my_search = new search();
     for ($i = 0; $i < count($this->search_perso_user); $i++) {
         if ($i % 2) {
             $pair_impair = "even";
         } else {
             $pair_impair = "odd";
         }
         //composer le formulaire de la recherche
         $my_search->unserialize_search($this->search_perso_user[$i]->query);
         $forms_search .= $my_search->make_hidden_search_form("./catalog.php?categ=search&mode=6", "search_form" . $this->search_perso_user[$i]->id);
         $td_javascript = "  onmousedown=\"document.forms['search_form" . $this->search_perso_user[$i]->id . "'].submit();\" ";
         $tr_surbrillance = "onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='" . $pair_impair . "'\" ";
         $line = str_replace('!!td_javascript!!', $td_javascript, $tpl_search_perso_liste_tableau_ligne);
         $line = str_replace('!!tr_surbrillance!!', $tr_surbrillance, $line);
         $line = str_replace('!!pair_impair!!', $pair_impair, $line);
         $line = str_replace('!!id!!', $this->search_perso_user[$i]->id, $line);
         $line = str_replace('!!name!!', $this->search_perso_user[$i]->name, $line);
         $line = str_replace('!!human!!', $this->search_perso_user[$i]->human, $line);
         $line = str_replace('!!shortname!!', $this->search_perso_user[$i]->shortname, $line);
         if ($this->search_perso_user[$i]->directlink) {
             $directlink = "<img src='./images/tick.gif' border='0'  hspace='0' align='middle'  class='bouton-nav' value='=' />";
         } else {
             $directlink = "";
         }
         $line = str_replace('!!directlink!!', $directlink, $line);
         $liste .= $line;
     }
     $tpl_search_perso_liste_tableau = str_replace('!!lignes_tableau!!', $liste, $tpl_search_perso_liste_tableau);
     return $forms_search . $tpl_search_perso_liste_tableau;
 }
예제 #21
0
    }
} else {
    if ($from_mode == 6) {
        //R�cup�ration de l'environnement
        $search = $_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["POST"]["search"];
        //Pour chaque champ
        for ($i = 0; $i < count($search); $i++) {
            //R�cup�ration de l'op�rateur
            $op = "op_" . $i . "_" . $search[$i];
            global ${$op};
            ${$op} = $_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["POST"][$op];
            //R�cup�ration du contenu de la recherche
            $field_ = "field_" . $i . "_" . $search[$i];
            global ${$field_};
            ${$field_} = $_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["POST"][$field_];
            $field = ${$field_};
            //R�cup�ration de l'op�rateur inter-champ
            $inter = "inter_" . $i . "_" . $search[$i];
            global ${$inter};
            ${$inter} = $_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["POST"][$inter];
            //R�cup�ration des variables auxiliaires
            $fieldvar_ = "fieldvar_" . $i . "_" . $search[$i];
            global ${$fieldvar_};
            ${$fieldvar_} = $_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["POST"][$fieldvar_];
            $fieldvar = ${$fieldvar_};
        }
    }
}
if ($serialized_search) {
    $sc->unserialize_search(stripslashes($serialized_search));
}
 function do_form()
 {
     global $msg, $tpl_search_persopac_form, $charset, $base_path;
     global $thesaurus_liste_trad;
     global $id_search_persopac;
     $this->load_xml();
     // titre formulaire
     $my_search = new search(false, "search_fields_opac", "{$base_path}/temp/");
     if ($this->id) {
         $libelle = $msg["search_persopac_form_edit"];
         $link_delete = "<input type='button' class='bouton' value='" . $msg[63] . "' onClick=\"confirm_delete();\" />";
         $button_modif_requete = "<input type='button' class='bouton' value=\"" . $msg["search_perso_modif_requete"] . "\" onClick=\"document.modif_requete_form_" . $this->id . ".submit();\">";
         //Mémorisation de recherche prédéfinie en édition
         if ($id_search_persopac) {
             $this->query = $my_search->serialize_search();
             $this->human = $my_search->make_human_query();
             $my_search->unserialize_search($this->query);
         } else {
             $my_search->unserialize_search($this->query);
             $this->query = $my_search->serialize_search();
             $this->human = $my_search->make_human_query();
         }
         $form_modif_requete = $this->make_hidden_search_form();
     } else {
         $libelle = $msg["search_persopac_form_add"];
         $link_delete = "";
         $button_modif_requete = "";
         $form_modif_requete = "";
         $this->query = $my_search->serialize_search();
         $this->human = $my_search->make_human_query();
     }
     // Champ éditable
     $tpl_search_persopac_form = str_replace('!!id!!', htmlentities($this->id, ENT_QUOTES, $charset), $tpl_search_persopac_form);
     $trans = new translation($this->id, "search_persopac", "search_name", $thesaurus_liste_trad);
     $field_name = $trans->get_form($msg["search_persopac_form_name"], "form_nom", "name", $this->name, "saisie-80em");
     $tpl_search_persopac_form = str_replace('!!name!!', $field_name, $tpl_search_persopac_form);
     $trans = new translation($this->id, "search_persopac", "search_shortname", $thesaurus_liste_trad);
     $field_name = $trans->get_form($msg["search_persopac_form_shortname"], "shortname", "shortname", $this->shortname, "saisie-80em");
     $tpl_search_persopac_form = str_replace('!!shortname!!', $field_name, $tpl_search_persopac_form);
     $checked = '';
     if ($this->directlink) {
         $checked = " checked='checked' ";
     }
     $tpl_search_persopac_form = str_replace('!!directlink!!', $checked, $tpl_search_persopac_form);
     $checked = '';
     if ($this->limitsearch) {
         $checked = " checked='checked' ";
     }
     $tpl_search_persopac_form = str_replace('!!limitsearch!!', $checked, $tpl_search_persopac_form);
     $tpl_search_persopac_form = str_replace('!!query!!', htmlentities($this->query, ENT_QUOTES, $charset), $tpl_search_persopac_form);
     $tpl_search_persopac_form = str_replace('!!human!!', htmlentities($this->human, ENT_QUOTES, $charset), $tpl_search_persopac_form);
     $action = "./admin.php?categ=opac&sub=search_persopac&section=liste&action=collstate_update&serial_id=" . $this->serial_id . "&id=" . $this->id;
     $tpl_search_persopac_form = str_replace('!!action!!', $action, $tpl_search_persopac_form);
     $tpl_search_persopac_form = str_replace('!!delete!!', $link_delete, $tpl_search_persopac_form);
     $tpl_search_persopac_form = str_replace('!!libelle!!', htmlentities($libelle, ENT_QUOTES, $charset), $tpl_search_persopac_form);
     $link_annul = "onClick=\"unload_off();history.go(-1);\"";
     $tpl_search_persopac_form = str_replace('!!annul!!', $link_annul, $tpl_search_persopac_form);
     //restriction aux catégories de lecteur
     $requete = "SELECT id_categ_empr, libelle FROM empr_categ ORDER BY libelle ";
     $res = pmb_mysql_query($requete);
     if (pmb_mysql_num_rows($res) > 0) {
         $categ = "\n\t\t\t<label for='empr_restrict'>" . $msg['search_perso_form_user_restrict'] . "</label><br />\n\t\t\t<select id='empr_restrict' name='empr_restrict[]' multiple>";
         while ($obj = pmb_mysql_fetch_object($res)) {
             $categ .= "\n\t\t\t\t<option value='" . $obj->id_categ_empr . "' " . (in_array($obj->id_categ_empr, $this->empr_categ_restrict) ? "selected=selected" : "") . ">" . $obj->libelle . "</option>";
         }
         $categ .= "\n\t\t\t</select>";
     } else {
         $categ = "";
     }
     $tpl_search_persopac_form = str_replace('!!categorie!!', $categ, $tpl_search_persopac_form);
     $tpl_search_persopac_form = str_replace('!!requete!!', htmlentities($this->query, ENT_QUOTES, $charset), $tpl_search_persopac_form);
     $tpl_search_persopac_form = str_replace('!!requete_human!!', $this->human, $tpl_search_persopac_form);
     $tpl_search_persopac_form = str_replace('!!bouton_modif_requete!!', $button_modif_requete, $tpl_search_persopac_form);
     $tpl_search_persopac_form = str_replace('!!form_modif_requete!!', $form_modif_requete, $tpl_search_persopac_form);
     return $tpl_search_persopac_form;
 }
예제 #23
0
    $sr_form = str_replace('<!-- search_result_extended_affiliate_lvl2_head_link -->', $search_result_extended_affiliate_lvl2_head_wo_link, $sr_form);
} else {
    if ($tab == "affiliate") {
        //l'onglet source affiliées est actif, il faut son contenu...
        $query = $es->serialize_search();
        $as = new affiliate_search_extended($query);
        $as->getResults();
        $sr_form .= $as->results;
    }
    $sr_form .= "\n\t</div>\n\t<div class='row'><span class=\"espaceResultSearch\">&nbsp;</span></div>";
    //Enregistrement des stats
    if ($pmb_logs_activate) {
        global $nb_results_tab;
        $nb_results_tab['extended_affiliate'] = $as->getTotalNbResults();
    }
    $es->unserialize_search($query);
}
print $sr_form;
function extended_get_current_search_map($mode_search = 0)
{
    global $opac_map_activate;
    global $opac_map_max_holds;
    global $dbh;
    global $javascript_path;
    global $opac_map_size_search_result;
    global $page;
    global $aut_id;
    $map = "";
    if ($opac_map_activate) {
        $map_hold = null;
        $current_search = $_SESSION["nb_queries"];
예제 #24
0
 function make_human_query()
 {
     $litteral = array();
     //Récupération de la valeur de saisie
     $valeur_ = "field_" . $this->n_ligne . "_s_" . $this->id;
     global ${$valeur_};
     $valeur = ${$valeur_};
     //enregistrement de l'environnement courant
     $this->search->push();
     //et on se met dans le contexte de la recherche simple
     $mc = unserialize($valeur[0]);
     $es = new search(false, $mc["search_type"]);
     $es->unserialize_search($mc["serialized_search"]);
     //on récupère le human query...
     $litteral[0] = $es->make_human_query();
     //restauration de l'environnement courant
     $this->search->pull();
     return $litteral;
 }