".$nb_results." ".$msg["search_extended_authorities_found"]."
\n"; } protected function show_objects_results($table, $has_sort) { global $dbh; global $search; global $nb_per_page_search; global $page; $start_page=$nb_per_page_search*$page; $nb = 0; $query = "select ".$table.".*,authorities.num_object,authorities.type_object from ".$table.",authorities where authorities.id_authority=".$table.".id_authority"; if(count($search) > 1 && !$has_sort) { //Tri à appliquer par défaut } $query .= " limit ".$start_page.",".$nb_per_page_search; $result = pmb_mysql_query($query, $dbh); $objects_ids = array(); while ($row=pmb_mysql_fetch_object($result)) { $objects_ids[] = $row->id_authority; } if(count($objects_ids)) { $elements_authorities_list_ui = new elements_authorities_list_ui($objects_ids, count($objects_ids), 1); $elements = $elements_authorities_list_ui->get_elements_list(); print $elements; } } protected function get_display_actions() { return ""; } protected function get_display_icons($nb_results, $recherche_externe = false) { return ""; } public function show_results($url,$url_to_search_form,$hidden_form=true,$search_target="", $acces=false) { global $dbh; global $begin_result_liste; global $nb_per_page_search; global $page; global $charset; global $search; global $msg; global $pmb_nb_max_tri; global $pmb_allow_external_search; global $debug; //Y-a-t-il des champs ? if (count($search)==0) { array_pop($_SESSION["session_history"]); error_message_history($msg["search_empty_field"], $msg["search_no_fields"], 1); exit(); } $recherche_externe=true;//Savoir si l'on peut faire une recherche externe à partir des critères choisis //Verification des champs vides for ($i=0; $iget_global_value("op_".$i."_".$search[$i]); $field=$this->get_global_value("field_".$i."_".$search[$i]); $field1=$this->get_global_value("field_".$i."_".$search[$i]."_1"); $s=explode("_",$search[$i]); $bool=false; if ($s[0]=="f") { $champ=$this->fixedfields[$s[1]]["TITLE"]; if ((string)$field[0]=="" && (string)$field1[0]=="") { $bool=true; } } elseif(array_key_exists($s[0],$this->pp)) { $champ=$this->pp[$s[0]]->t_fields[$s[1]]["TITRE"]; if ((string)$field[0]=="" && (string)$field1[0]=="") { $bool=true; } } elseif($s[0]=="s") { $recherche_externe=false; $champ=$this->specialfields[$s[1]]["TITLE"]; $type=$this->specialfields[$s[1]]["TYPE"]; for ($is=0; $istableau_speciaux["TYPE"]); $is++) { if ($this->tableau_speciaux["TYPE"][$is]["NAME"]==$type) { $sf=$this->specialfields[$s[1]]; global $include_path; require_once($include_path."/search_queries/specials/".$this->tableau_speciaux["TYPE"][$is]["PATH"]."/search.class.php"); $specialclass= new $this->tableau_speciaux["TYPE"][$is]["CLASS"]($s[1],$i,$sf,$this); $bool=$specialclass->is_empty($field); break; } } }//elseif (substr($s,0,9)=="authperso") {} if (($bool)&&(!$this->op_empty[$op])) { $query_data = array_pop($_SESSION["session_history"]); error_message_history($msg["search_empty_field"], sprintf($msg["search_empty_error_message"],$champ), 1); print $this->get_back_button($query_data); exit(); } } $table=$this->make_search(); if ($acces==true) { $this->filter_searchtable_from_accessrights($table); } $requete="select count(1) from $table"; if($res=pmb_mysql_query($requete)){ $nb_results=pmb_mysql_result($res,0,0); }else{ $query_data = array_pop($_SESSION["session_history"]); error_message_history("",$msg["search_impossible"], 1); print $this->get_back_button($query_data); exit(); } //gestion du tri $has_sort = false; if ($nb_results <= $pmb_nb_max_tri) { if ($_SESSION["tri"]) { $table = $this->sort_results($table); $has_sort = true; } } // fin gestion tri //Y-a-t-il une erreur lors de la recherche ? if ($this->error_message) { $query_data = array_pop($_SESSION["session_history"]); error_message_history("", $this->error_message, 1); print $this->get_back_button($query_data); exit(); } if ($hidden_form) { print $this->make_hidden_search_form($url,"search_form","",false); print facette_search_compare::form_write_facette_compare(); print ""; } $human_requete = $this->make_human_query(); print "".$msg["search_search_extended"]." : ".$human_requete ; if ($debug) print "
".$this->serialize_search(); if ($nb_results) { print $this->get_display_nb_results($nb_results); print $begin_result_liste; print $this->get_display_icons($nb_results, $recherche_externe); } else print "
".$msg["1915"]." "; self::get_caddie_link(); print ""; print $this->get_display_actions(); print $this->get_current_search_map(); $this->show_objects_results($table, $has_sort); //Gestion de la pagination if ($nb_results) { $n_max_page=ceil($nb_results/$nb_per_page_search); $etendue=10; if (!$page) $page_en_cours=0 ; else $page_en_cours=$page ; $nav_bar = ''; //Première if(($page_en_cours+1)-$etendue > 1) { $nav_bar .= "".$msg["; } // affichage du lien precedent si necessaire if ($page>0) { $nav_bar .= ""; $nav_bar .= "[".$msg[48]."]"; $nav_bar .= ""; } $deb = $page_en_cours - 10 ; if ($deb<0) $deb=0; for($i = $deb; ($i < $n_max_page) && ($i<$page_en_cours+10); $i++) { if($i==$page_en_cours) $nav_bar .= "".($i+1).""; else { $nav_bar .= ""; $nav_bar .= ($i+1); $nav_bar .= ""; } if($i<$n_max_page) $nav_bar .= " "; } if(($page+1)<$n_max_page) { $nav_bar .= ""; $nav_bar .= "[".$msg[49]."]"; $nav_bar .= ""; } else $nav_bar .= ""; //Dernière if((($page_en_cours+1)+$etendue)<$n_max_page){ $nav_bar .= "".$msg["; } $nav_bar = "
$nav_bar
"; echo $nav_bar ; } } public static function get_caddie_link() { global $msg; print " \"".$msg["histo_add_to_cart"]."\" "; } public static function get_type_from_mode() { global $mode; $type = "MIXED"; switch ($mode) { case 1 : $type = "AUTHORS"; break; case 2 : $type = "CATEGORIES"; break; case 3 : $type = "PUBLISHERS"; break; case 4 : $type = "COLLECTIONS"; break; case 5 : $type = "SUBCOLLECTIONS"; break; case 6 : $type = "SERIES"; break; case 7 : $type = "TITRES_UNIFORMES"; break; case 8 : $type = "INDEXINT"; break; case 9 : $type = "CONCEPTS"; break; } return $type; } } ?>