예제 #1
0
 function make_search()
 {
     global $opac_indexation_docnum_allfields;
     global $opac_search_other_function;
     //Récupération de la valeur de saisie
     $valeur_ = "field_" . $this->n_ligne . "_s_" . $this->id;
     global ${$valeur_};
     $valeur = ${$valeur_};
     if (!$this->is_empty($valeur)) {
         $table_tempo = "";
         //enregistrement de l'environnement courant
         $this->search->push();
         //on instancie la classe search avec le nom de la nouvelle table temporaire
         switch ($_SESSION["search_type" . $valeur[0]]) {
             case 'simple_search':
                 global $search;
                 if ($opac_search_other_function) {
                     search_other_function_get_history($valeur[0]);
                 }
                 switch ($_SESSION["notice_view" . $valeur[0]]["search_mod"]) {
                     case 'title':
                         $search[0] = "f_6";
                         $op_ = "BOOLEAN";
                         $valeur_champ = $_SESSION["user_query" . $valeur[0]];
                         break;
                     case 'all':
                         $search[0] = "f_7";
                         $op_ = "BOOLEAN";
                         $valeur_champ = $_SESSION["user_query" . $valeur[0]];
                         $t["is_num"][0] = $opac_indexation_docnum_allfields;
                         $t["ck_affiche"][0] = $opac_indexation_docnum_allfields;
                         break;
                     case 'abstract':
                         $search[0] = "f_13";
                         $op_ = "BOOLEAN";
                         $valeur_champ = $_SESSION["user_query" . $valeur[0]];
                         break;
                     case 'keyword':
                         $search[0] = "f_12";
                         $op_ = "BOOLEAN";
                         $valeur_champ = $_SESSION["user_query" . $valeur[0]];
                         break;
                     case 'author_see':
                         $search[0] = "f_8";
                         $op_ = "EQ";
                         $valeur_champ = $_SESSION["notice_view" . $valeur[0]]["search_id"];
                         break;
                     case 'categ_see':
                         $search[0] = "f_1";
                         $op_ = "EQ";
                         $valeur_champ = $_SESSION["notice_view" . $valeur[0]]["search_id"];
                         break;
                     case 'indexint_see':
                         $search[0] = "f_2";
                         $op_ = "EQ";
                         $valeur_champ = $_SESSION["notice_view" . $valeur[0]]["search_id"];
                         break;
                     case 'coll_see':
                         $search[0] = "f_4";
                         $op_ = "EQ";
                         $valeur_champ = $_SESSION["notice_view" . $valeur[0]]["search_id"];
                         break;
                     case 'publisher_see':
                         $search[0] = "f_3";
                         $op_ = "EQ";
                         $valeur_champ = $_SESSION["notice_view" . $valeur[0]]["search_id"];
                         break;
                     case 'subcoll_see':
                         $search[0] = "f_5";
                         $op_ = "EQ";
                         $valeur_champ = $_SESSION["notice_view" . $valeur[0]]["search_id"];
                         break;
                     case 'titre_uniforme_see':
                         $search[0] = "f_6";
                         $op_ = "EQ";
                         $valeur_champ = $_SESSION["notice_view" . $valeur[0]]["search_id"];
                         break;
                     case 'docnum':
                         $search[0] = "f_16";
                         $op_ = "BOOLEAN";
                         $valeur_champ = $_SESSION["user_query" . $valeur[0]]["search_id"];
                         break;
                 }
                 //opérateur
                 $op = "op_0_" . $search[0];
                 global ${$op};
                 ${$op} = $op_;
                 //contenu de la recherche
                 $field = "field_0_" . $search[0];
                 $field_ = array();
                 $field_[0] = $valeur_champ;
                 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_};
                 if ($t) {
                     ${$fieldvar_} = $t;
                 } else {
                     ${$fieldvar_} = "";
                 }
                 $fieldvar = ${$fieldvar_};
                 if ($_SESSION["typdoc" . $valeur[0]]) {
                     $search[1] = "f_9";
                     $op_ = "EQ";
                     $valeur_champ = $_SESSION["typdoc" . $valeur[0]];
                     //opérateur
                     $op = "op_1_" . $search[1];
                     global ${$op};
                     ${$op} = $op_;
                     //contenu de la recherche
                     $field = "field_1_" . $search[1];
                     $field_ = array();
                     $field_[0] = $valeur_champ;
                     global ${$field};
                     ${$field} = $field_;
                     //opérateur inter-champ
                     $inter = "inter_1_" . $search[1];
                     global ${$inter};
                     ${$inter} = "and";
                 }
                 $es = new search("search_simple_fields");
                 break;
             case 'extended_search':
                 get_history($valeur[0]);
                 $searcher = new searcher_extended();
                 $searcher->get_result();
                 $table_tempo = $searcher->table;
                 break;
             case 'term_search':
                 global $search;
                 $search[0] = "f_1";
                 $op_ = "EQ";
                 $valeur_champ = $_SESSION["notice_view" . $valeur[0]]["search_id"];
                 //opérateur
                 $op = "op_0_" . $search[0];
                 global ${$op};
                 ${$op} = $op_;
                 //contenu de la recherche
                 $field = "field_0_" . $search[0];
                 $field_ = array();
                 $field_[0] = $valeur_champ;
                 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_};
                 $es = new search("search_simple_fields");
                 break;
             case 'module':
                 global $search;
                 switch ($_SESSION["notice_view" . $valeur[0]]["search_mod"]) {
                     case 'categ_see':
                         $search[0] = "f_1";
                         break;
                     case 'indexint_see':
                         $search[0] = "f_2";
                         break;
                     case 'etagere_see':
                         $search[0] = "f_14";
                         break;
                     case 'section_see':
                         $search[0] = "f_15";
                         global $search_localisation;
                         $search_localisation = $_SESSION["notice_view" . $valeur[0]]["search_location"];
                         break;
                 }
                 $op_ = "EQ";
                 $valeur_champ = $_SESSION["notice_view" . $valeur[0]]["search_id"];
                 //opérateur
                 $op = "op_0_" . $search[0];
                 global ${$op};
                 ${$op} = $op_;
                 //contenu de la recherche
                 $field = "field_0_" . $search[0];
                 $field_ = array();
                 $field_[0] = $valeur_champ;
                 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 attention pour la section
                 ${$fieldvar_} = "";
                 $fieldvar = ${$fieldvar_};
                 $es = new search("search_simple_fields");
                 break;
         }
         if (!$table_tempo) {
             $table_tempo = $es->make_search("tempo_" . $valeur[0]);
         }
         //restauration de l'environnement courant
         $this->search->pull();
     }
     return $table_tempo;
 }
예제 #2
0
            $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;
        }
    }
}
if (!$flag) {
    $searcher_extended = new searcher_extended();
    $searcher_extended->get_result();
    $nb_result_extended = $searcher_extended->get_nb_results();
    //	Enregistrement des stats
    if ($pmb_logs_activate) {
        global $nb_results_tab;
        $nb_results_tab['extended'] = $nb_result_extended;
    }
    if ($opac_allow_affiliate_search && $allow_search_affiliate_and_external) {
        $search_result_affiliate_extented = str_replace("!!mode!!", "extended", $search_extented_result_affiliate_lvl1);
        $search_result_affiliate_extented = str_replace("!!search_type!!", "notices", $search_result_affiliate_extented);
        $search_result_affiliate_extented = str_replace("!!label!!", $es->make_human_query(), $search_result_affiliate_extented);
        $search_result_affiliate_extented = str_replace("!!nb_result!!", $nb_result_extended, $search_result_affiliate_extented);
        if ($nb_result_extended) {
            $link = "<a href='#' onclick=\"document.search_form.action = './index.php?lvl=more_results&mode=extended&tab=catalog'; document.search_form.submit();return false;\">" . $msg['suite'] . "&nbsp;<img src='./images/search.gif' border='0' align='absmiddle'/></a>";
        } else {
            $link = "";
예제 #3
0
 /**
  * Fonction de création de la requête (retourne une table temporaire)
  * @return string Nom de la table temporaire
  */
 function make_search()
 {
     //Récupération de la valeur de saisie
     $valeur_ = "field_" . $this->n_ligne . "_s_" . $this->id;
     global ${$valeur_};
     $valeur = ${$valeur_};
     if (!$this->is_empty($valeur)) {
         //enregistrement de l'environnement courant
         $this->search->push();
         $mc = self::simple2mc($valeur[0]);
         $es = $mc['search_instance'];
         if ($mc["search_type"] == "search_simple_fields") {
             $table_tempo = $es->make_search("tempo_" . $valeur[0]);
         } else {
             $searcher = new searcher_extended();
             $searcher->get_result();
             $table_tempo = $searcher->table;
         }
         //restauration de l'environnement courant
         $this->search->pull();
     }
     return $table_tempo;
 }