ufield=$ufield; $this->op=$op; $this->values=$values; $this->vars=$vars; $this->inter=$inter; } function set_sub($sub) { $this->sub=$sub; } } class search { var $operators; var $op_empty; var $fixedfields; var $dynamicfields; var $dynamics_not_visible; var $specialfields; var $pp; var $error_message; var $link; var $link_expl; var $link_explnum; var $link_serial; var $link_analysis; var $link_bulletin; var $link_explnum_serial; var $tableau_speciaux; var $operator_multi_value; var $tableau_access_rights; function search($fichier_xml="") { global $launch_search; $this->parse_search_file($fichier_xml); $this->strip_slashes(); foreach ( $this->dynamicfields as $key => $value ) { $this->pp[$key]=new parametres_perso($value["TYPE"]); } } function strip_slashes() { global $search,$explicit_search; for ($i=0; $ifixedfields[$s[1]]; switch ($ff["INPUT_TYPE"]) { case "date": if(!preg_match("/^\d{4}-\d{2}-\d{2}$/",$field[0])) { $field_temp=extraitdate($field[0]); $field[0]=$field_temp; } break; default: //Rien a faire break; } } } $$field_=$field; } } function get_id_from_datatype($datatype, $fieldType = "d") { reset($this->dynamicfields[$fieldType]["FIELD"]); while (list($key,$val)=each($this->dynamicfields[$fieldType]["FIELD"])) { if ($val["DATATYPE"]==$datatype) return $key; } return ""; } function get_field($i,$n,$search,$pp) { global $charset; global $aff_list_empr_search; global $msg; global $include_path; global $thesaurus_classement_mode_pmb; $r=""; $s=explode("_",$search); //Champ $val="field_".$i."_".$search; global $$val; $v=$$val; if ($v=="") $v=array(); //Variables $fieldvar_="fieldvar_".$i."_".$search; global $$fieldvar_; $fieldvar=$$fieldvar_; if ($s[0]=="f") { //Champs fixes $ff=$this->fixedfields[$s[1]]; //Variables globales et input for ($j=0; $jrejete) $libelle = $aut->name.', '.$aut->rejete; else $libelle = $aut->name; if($aut->date) $libelle .= " ($aut->author_date)"; break; case "categorie": $libelle = categories::getlibelle($v[0],$lang); break; case "editeur": $ed = new publisher($v[0]); $libelle=$ed->name; if ($ed->ville) if ($ed->pays) $libelle.=" ($ed->ville - $ed->pays)"; else $libelle.=" ($ed->ville)"; break; case "collection" : $coll = new collection($v[0]); $libelle = $coll->name; break; case "subcollection" : $coll = new subcollection($v[0]); $libelle = $coll->name; break; case "serie" : $serie = new serie($v[0]); $libelle = $serie->name; break; case "indexint" : $indexint = new indexint($v[0]); $libelle = $indexint->display ; break; case "titres_uniformes" : $tu = new titre_uniforme($v[0]); $libelle = $tu->name; break; default : $libelle = $v[0]; break; } } $$op == "BOOLEAN"; $r=""; } if($libelle){ $r=""; }else{ $r=""; } break; case "authoritie": $fnamesans="field_".$n."_".$search; $fname="field_".$n."_".$search."[]"; $fname_id="field_".$n."_".$search."_id"; $fnamesanslib="field_".$n."_".$search."_lib"; $fnamelib="field_".$n."_".$search."_lib[]"; $fname_name_aut_id="fieldvar_".$n."_".$search."[authority_id][]"; $fname_aut_id="fieldvar_".$n."_".$search."_authority_id"; $ajax=$ff["INPUT_OPTIONS"]["AJAX"]; $selector=$ff["INPUT_OPTIONS"]["SELECTOR"]; $p1=$ff["INPUT_OPTIONS"]["P1"]; $p2=$ff["INPUT_OPTIONS"]["P2"]; global $opac_thesaurus; if($ajax == "categories" and $opac_thesaurus == 1){ $fnamevar_id = "linkfield=\"fieldvar_".$n."_".$search."[id_thesaurus][]\""; }else{ $fnamevar_id = ""; } $op = "op_".$n."_".$search; global $$op; global $lang; $r= " "; if ($$op == "AUTHORITY"){ if($v[0]!= 0){ switch ($ff['INPUT_OPTIONS']['SELECTOR']){ case "auteur": $aut=new auteur($v[0]); if($aut->rejete) $libelle = $aut->name.', '.$aut->rejete; else $libelle = $aut->name; if($aut->date) $libelle .= " ($aut->author_date)"; break; case "categorie": $libelle = categories::getlibelle($v[0],$lang); break; case "editeur": $ed = new publisher($v[0]); $libelle=$ed->name; if ($ed->ville) if ($ed->pays) $libelle.=" ($ed->ville - $ed->pays)"; else $libelle.=" ($ed->ville)"; break; case "collection" : $coll = new collection($v[0]); $libelle = $coll->name; break; case "subcollection" : $coll = new subcollection($v[0]); $libelle = $coll->name; break; case "serie" : $serie = new serie($v[0]); $libelle = $serie->name; break; case "indexint" : $indexint = new indexint($v[0]); $libelle = $indexint->display ; break; case "titres_uniformes" : $tu = new titre_uniforme($v[0]); $libelle = $tu->name; break; default : $libelle = $v[0]; break; } }else $libelle = ""; $r.=" "; }else{ $r.=" "; } $r.=" "; break; case "text": $r=""; break; case "query_list": $requete=$ff["INPUT_OPTIONS"]["QUERY"][0]["value"]; if ($ff["INPUT_FILTERING"] == "yes") { $this->access_rights(); $requete = str_replace("!!acces_j!!", $this->tableau_access_rights["acces_j"], $requete); $requete = str_replace("!!statut_j!!", $this->tableau_access_rights["statut_j"], $requete); $requete = str_replace("!!statut_r!!", $this->tableau_access_rights["statut_r"], $requete); } $resultat=mysql_query($requete); $r=""; break; case "list": $options=$ff["INPUT_OPTIONS"]["OPTIONS"][0]; $r=""; break; case "marc_list": $options=new marc_list($ff["INPUT_OPTIONS"]["NAME"][0]["value"]); // gestion restriction par code utilise. if ($ff["INPUT_OPTIONS"]["RESTRICTQUERY"][0]["value"]) { $restrictquery=@mysql_query($ff["INPUT_OPTIONS"]["RESTRICTQUERY"][0]["value"]); if ($restrictqueryrow=@mysql_fetch_row($restrictquery)) { if ($restrictqueryrow[0]) { $restrictqueryarray=explode(",",$restrictqueryrow[0]); $existrestrict=true; } else $existrestrict=false; } else $existrestrict=false; } else $existrestrict=false; $r=""; break; case "date": $r=""; break; } //Traitement des variables d'entree //Variables for ($j=0; $j\n"; $query_list_result=@mysql_query($input["QUERY"][0]["value"]); $var_tmp=$concat=""; while ($line=mysql_fetch_array($query_list_result)) { if($concat)$concat.=","; $concat.=$line[0]; $var_tmp.="