rec_history($n); if ($opac_search_other_function) search_other_function_rec_history($n); break; case "extended_search": global $es; $_SESSION["nb_queries"]=$_SESSION["nb_queries"]+1; $n=$_SESSION["nb_queries"]; $_SESSION["human_query".$n]=$es->make_human_query(); global $search; $_SESSION["nb_search".$n]=count($search); for ($i=0; $iget_history($n); if ($opac_search_other_function) search_other_function_get_history($n); break; case "extended_search": global $search; for ($i=0; $i<$_SESSION["nb_search".$n]; $i++) { $search[$i]=$_SESSION["search_".$i."_".$n]; $inter="inter_".$i."_".$search[$i]; global $$inter; $$inter=$_SESSION["inter_".$i."_".$search[$i]."_".$n]; $op="op_".$i."_".$search[$i]; global $$op; $$op=$_SESSION["op_".$i."_".$search[$i]."_".$n]; $n_fields=$_SESSION["n_fields_".$i."_".$search[$i]."_".$n]; $field=array(); for ($j=0; $j<$n_fields; $j++) { $field[$j]=$_SESSION["field_".$i."_".$search[$i]."_".$j."_".$n]; } $field_="field_".$i."_".$search[$i]; global $$field_; $$field_=$field; $fieldvar=$_SESSION["fieldvar_".$i."_".$search[$i]."_".$n]; $fieldvar_="fieldvar_".$i."_".$search[$i]; global $$fieldvar_; $$fieldvar_=$fieldvar; } break; case "term_search": global $search_term; global $term_click; global $page_search; $search_term=$_SESSION["search_term".$n]; $term_click=$_SESSION["term_click".$n]; $page_search=$_SESSION["page_search".$n]; break; } $_SESSION["search_type"]=$search_type; } function get_human_query($n) { global $msg; global $opac_search_other_function, $opac_indexation_docnum_allfields; global $include_path; if ($opac_search_other_function) require_once($include_path."/".$opac_search_other_function); switch ($_SESSION["search_type".$n]) { case "simple_search": if ($_SESSION["look_TITLE".$n]) $r1.=$msg["titles"]." "; if ($_SESSION["look_AUTHOR".$n]) $r1.=$msg["authors"]." "; if ($_SESSION["look_PUBLISHER".$n]) $r1.=$msg["publishers"]." "; if ($_SESSION["look_TITRE_UNIFORME".$n]) $r1.=$msg["titres_uniformes"]." "; if ($_SESSION["look_COLLECTION".$n]) $r1.=$msg["collections"]." "; if ($_SESSION["look_SUBCOLLECTION".$n]) $r1.=$msg["subcollections"]." "; if ($_SESSION["look_CATEGORY".$n]) $r1.=$msg["categories"]." "; if ($_SESSION["look_INDEXINT".$n]) $r1.=$msg["indexint"]." "; if ($_SESSION["look_KEYWORDS".$n]) $r1.=$msg["keywords"]." "; if ($_SESSION["look_ABSTRACT".$n]) $r1.=$msg["abstract"]." "; if ($_SESSION["look_ALL".$n]) $r1.=$msg["tous"]." ".($opac_indexation_docnum_allfields ? "[".$msg[docnum_search_with]."] " : ''); if ($_SESSION["look_DOCNUM".$n]) $r1.=$msg["docnum"]." "; if ($_SESSION["look_CONTENT".$n]) $r1.=" "; if ($_SESSION["look_CONCEPT".$n]) $r1.=$msg["skos_concept"]." "; $authpersos=new authpersos(); $r1.=$authpersos->get_human_query($n); if ($_SESSION["typdoc".$n]) { $doctype = new marc_list('doctype'); $r2=sprintf($msg["simple_search_history_doc_type"],$doctype->table[$_SESSION["typdoc".$n]]); } else $r2=$msg["simple_search_history_all_doc_types"]; if ($opac_search_other_function) { $r3=search_other_function_human_query($n); if ($r3) $r2.=", ".$r3; } $r=sprintf($msg["simple_search_history"],stripslashes($_SESSION["user_query".$n]),$r1,$r2); if($_SESSION["map_emprises_query".$n]){ $r.=$msg["map_history_emprises"]. implode(" ", $_SESSION["map_emprises_query".$n]); } break; case "extended_search": $r=sprintf($msg["extended_search_history"],stripslashes($_SESSION["human_query".$n])); break; case "term_search": if ($_SESSION["search_term".$n]=="") $r1="(tous les termes)"; else $r1=stripslashes($_SESSION["search_term".$n]); $r=sprintf($msg["term_search_history"],$r1,($_SESSION["page_search".$n]+1),$_SESSION["term_click".$n]); break; case "module": $r=sprintf($msg["navigation_search_libelle"],stripslashes($_SESSION["human_query".$n])); break; } return $r; } function get_human_query_level_two($n) { global $msg; global $opac_search_other_function, $opac_indexation_docnum_allfields; global $include_path; if ($opac_search_other_function) require_once($include_path."/".$opac_search_other_function); if ($_SESSION["search_type".$n]=="simple_search") { $valeur_champ=""; switch ($_SESSION["notice_view".$n]["search_mod"]) { case 'abstract': $r1=$msg["abstract"]." "; break; case 'title': $r1=$msg["title_search"]." "; break; case 'all': $r1=$msg["global_search"]." ".($opac_indexation_docnum_allfields ? "[".$msg[docnum_search_with]."] " : ''); break; case 'keyword': $r1=$msg["keyword_search"]." "; break; case 'categ_see': $categ_id=$_SESSION["notice_view".$n]["search_id"]; $requete="select libelle_categorie from categories where num_noeud=".$categ_id; $r_cat=pmb_mysql_query($requete); if (@pmb_mysql_num_rows($r_cat)) { $valeur_champ=pmb_mysql_result($r_cat,0,0); } $r1=$msg["category"]." "; break; case 'author_see': $author_id=$_SESSION["notice_view".$n]["search_id"]; $requete="select concat(author_name,', ',author_rejete) from authors where author_id=".$author_id; $r_author=pmb_mysql_query($requete); if (@pmb_mysql_num_rows($r_author)) { $valeur_champ=pmb_mysql_result($r_author,0,0); } $r1=$msg["author_search"]." "; break; case 'indexint_see': $indexint_id=$_SESSION["notice_view".$n]["search_id"]; $requete="select indexint_name from indexint where indexint_id=".$indexint_id; $r_indexint=pmb_mysql_query($requete); if (@pmb_mysql_num_rows($r_indexint)) { $valeur_champ=pmb_mysql_result($r_indexint,0,0); } $r1=$msg["indexint_search"]." "; break; case 'publisher_see': $publisher_id=$_SESSION["notice_view".$n]["search_id"]; $requete="select ed_name from publishers where ed_id=".$publisher_id; $r_pub=pmb_mysql_query($requete); if (@pmb_mysql_num_rows($r_pub)) { $valeur_champ=pmb_mysql_result($r_pub,0,0); } $r1=$msg["publisher_search"]." "; break; case 'titre_uniforme_see': $titre_uniforme_id=$_SESSION["notice_view".$n]["search_id"]; $requete="select tu_name from publishers where tu_id=".$titre_uniforme_id; $r_tu=pmb_mysql_query($requete); if (@pmb_mysql_num_rows($r_tu)) { $valeur_champ=pmb_mysql_result($r_tu,0,0); } $r1=$msg["titre_uniforme_search"]." "; break; case 'coll_see': $coll_id=$_SESSION["notice_view".$n]["search_id"]; $requete="select collection_name from collections where collection_id=".$coll_id; $r_coll=pmb_mysql_query($requete); if (@pmb_mysql_num_rows($r_coll)) { $valeur_champ=pmb_mysql_result($r_coll,0,0); } $r1=$msg["coll_search"]." "; break; case 'subcoll_see': $subcoll_id=$_SESSION["notice_view".$n]["search_id"]; $requete="select sub_coll_name from sub_collections where sub_coll_id=".$subcoll_id; $r_subcoll=pmb_mysql_query($requete); if (@pmb_mysql_num_rows($r_subcoll)) { $valeur_champ=pmb_mysql_result($r_subcoll,0,0); } $r1=$msg["subcoll_search"]." "; break; case 'docnum': $r1=$msg["docnum"]; break; case 'concept_see': $concept_id=$_SESSION["notice_view".$n]["search_id"]; $requete="select value from skos_field_global_index where code_champ = 1 and code_ss_champ = 1 and id_item = ".$concept_id; $r_concept=pmb_mysql_query($requete); if (@pmb_mysql_num_rows($r_concept)) { $valeur_champ=pmb_mysql_result($r_concept,0,0); } $r1=$msg["skos_concept"]." "; break; case 'authperso_see': $auth_id=$_SESSION["notice_view".$n]["search_id"]; $ourAuth = new authperso_authority($auth_id); $r1 = $ourAuth->info['authperso']['name']." "; $valeur_champ = $ourAuth->info['isbd']; break; } if ($_SESSION["typdoc".$n]) { $doctype = new marc_list('doctype'); $r2 .= sprintf($msg["simple_search_history_doc_type"],$doctype->table[$_SESSION["typdoc".$n]]); } else $r2 .= $msg["simple_search_history_all_doc_types"]; if ($opac_search_other_function) { $r3=search_other_function_human_query($n); if ($r3) $r2.=", ".$r3; } $r=sprintf($msg["simple_search_history"],(!$valeur_champ?stripslashes($_SESSION["user_query".$n]):$valeur_champ),$r1,$r2); if($_SESSION["map_emprises_query".$n]){ $r.=$msg["map_history_emprises"]. implode(" ", $_SESSION["map_emprises_query".$n]); } } else { $r= get_human_query($n); } return $r; } function rec_last_history() { global $page; global $msg; global $opac_search_other_function; global $facette_test; if ($page=="") $page_=1; else $page_=$page; if ($facette_test) $search_type=$_SESSION["search_type".$_SESSION["last_query"]]; else $search_type=$_SESSION["search_type"]; $_SESSION["lq_facette_test"]=($facette_test?2:0); switch ($search_type) { case "simple_search": global $user_query,$mode,$count,$typdoc,$clause,$clause_bull,$clause_bull_num_notice,$tri,$pert,$page,$l_typdoc, $join,$id_thes; global $affiliate_page, $catalog_page; if (!$facette_test) { $_SESSION["lq_user_query"]=$user_query; $_SESSION["lq_mode"]=$mode; $_SESSION["lq_count"]=$count; $_SESSION["lq_typdoc"]=$typdoc; $_SESSION["lq_clause"]=$clause; $_SESSION["lq_clause_bull"]=$clause_bull; $_SESSION["lq_clause_bull_num_notice"]=$clause_bull_num_notice; $_SESSION["lq_tri"]=$tri; $_SESSION["lq_pert"]=$pert; $_SESSION["lq_page"]=$page_; $_SESSION["lq_affiliate_page"]=$affiliate_page; $_SESSION["lq_catalog_page"]=$catalog_page; $_SESSION["lq_l_typdoc"]=$l_typdoc; $_SESSION["lq_join"]=$join; $_SESSION["lq_id_thes"]=$id_thes; $_SESSION["lq_level1"]=$_SESSION["level1"]; unset($_SESSION["lq_facette"]); if ($opac_search_other_function) search_other_function_rec_history($_SESSION["last_query"]); switch ($mode) { case "tous" : $_SESSION["list_name"]=$msg["list_tous"]; $_SESSION["list_name_msg"]="list_tous"; break; case "auteur": $_SESSION["list_name"]=$msg["list_authors"]; $_SESSION["list_name_msg"]="list_authors"; break; case "titre": $_SESSION["list_name"]=$msg["list_titles"]; $_SESSION["list_name_msg"]="list_titles"; break; case "editeur": $_SESSION["list_name"]=$msg["list_publishers"]; $_SESSION["list_name_msg"]="list_publishers"; break; case "titre_uniforme": $_SESSION["list_name"]=$msg["list_titres_uniformes"]; $_SESSION["list_name_msg"]="list_titres_uniformes"; break; case "collection": $_SESSION["list_name"]=$msg["list_collections"]; $_SESSION["list_name_msg"]="list_collections"; break; case "souscollection": $_SESSION["list_name"]=$msg["list_subcollections"]; $_SESSION["list_name_msg"]="list_subcollections"; break; case "categorie": $_SESSION["list_name"]=$msg["list_categories"]; $_SESSION["list_name_msg"]="list_categories"; break; case "indexint": $_SESSION["list_name"]=$msg["list_indexint"]; $_SESSION["list_name_msg"]="list_indexint"; break; case "keyword": $_SESSION["list_name"]=$msg["list_keywords"]; $_SESSION["list_name_msg"]="list_keywords"; break; case "docnum": $_SESSION["list_name"]=$msg["docnum_list"]; $_SESSION["list_name_msg"]="docnum_list"; break; } } break; case "extended_search": if (!$facette_test || (strpos($_SERVER['HTTP_REFERER'],$_SESSION['last_authority']['lvl']) !== false && $_SESSION['last_authority']['need_new_search'])) { $_SESSION["lq_page"]=$page_; $_SESSION["lq_affiliate_page"]=$affiliate_page; $_SESSION["lq_catalog_page"]=$catalog_page; $_SESSION["lq_mode"]="extended"; $_SESSION["list_name"]=$msg["list_titles"]; $_SESSION["list_name_msg"]="list_titles"; } break; } //Si on est en navigation par facette if ($facette_test) { $_SESSION["lq_facette"]=$_SESSION["facette"]; //La recherche étendue pour les facettes $_SESSION["lq_facette_search"]["lq_page"]=$page_; $_SESSION["lq_facette_search"]["lq_affiliate_page"]=$affiliate_page; $_SESSION["lq_facette_search"]["lq_catalog_page"]=$catalog_page; $_SESSION["lq_facette_search"]["lq_mode"]="extended"; $_SESSION["lq_facette_search"]["lq_search"]=search::serialize_search(); $_SESSION["lq_facette_search"]["lq_notice_view"]=$_SESSION["notice_view".$_SESSION["last_query"]]; } } 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"]; } } 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"]; } } /** * Stocke la dernière autorité consultée dans la session * * @return void */ function rec_last_authorities(){ global $lvl,$id,$page,$from; global $location,$plettreaut,$dcote,$lcote,$nc,$ssub; $_SESSION["last_module_search"]["search_mod"]="$lvl"; $_SESSION["last_module_search"]["search_id"]=$id; $_SESSION["last_module_search"]["search_page"]=$page; $_SESSION["last_module_search"]['need_new_search'] = true; if ($lvl=='section_see') { $_SESSION["last_module_search"]["search_location"]=$location; $_SESSION["last_module_search"]["search_plettreaut"]=$plettreaut; $_SESSION["last_module_search"]["search_dcote"]=$dcote; $_SESSION["last_module_search"]["search_lcote"]=$lcote; $_SESSION["last_module_search"]["search_nc"]=$nc; $_SESSION["last_module_search"]["search_ssub"]=$ssub; } if($from == "search"){ $_SESSION["last_module_search"]['need_new_search'] = false; if ($_SESSION["last_query"]) { $n=$_SESSION["last_query"]; } else { $n=$_SESSION["nb_queries"]; } $_SESSION["notice_view".$n]["search_mod"]="$lvl"; $_SESSION["notice_view".$n]["search_id"]=$id; $_SESSION["notice_view".$n]["search_page"]=$page; } } ?>