uid = $uid; $this->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; var $memory_engine_allowed = false; var $current_engine = 'MyISAM'; 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"]); } $this->fichier_xml=$fichier_xml; } function strip_slashes() { global $search,$explicit_search; for ($i=0; $imake_stripslashes_test_array($field); } else { for ($j=0; $jfixedfields[$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 make_stripslashes_test_array($value){ //stripslashes récursif car les facette sont des tableaux de tableaux if (is_array($value)) { foreach ($value as $k=>$v) { $value[$k] = $this->make_stripslashes_test_array($value[$k]); } return $value; } else { return stripslashes($value); } } 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->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_".$i."_".$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->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; case "notice" : $requete = "select if(serie_name is not null,if(tnvol is not null,concat(serie_name,', ',tnvol,'. ',tit1),concat(serie_name,'. ',tit1)),tit1) AS tit from notices left join series on serie_id=tparent_id where notice_id='".$v[0]."' "; $res=mysql_query($requete); if($res && mysql_num_rows($res)){ $libelle = mysql_result($res,0,0); }else{ $libelle = $v[0]; } break; default : $libelle = $v[0]; break; } }else $libelle = ""; $r.=" "; }else{ $r.=" "; } $r.=" "; break; case "text": if (substr($ff['INPUT_OPTIONS']["PLACEHOLDER"],0,4)=="msg:") { $input_placeholder = $msg[substr($ff['INPUT_OPTIONS']["PLACEHOLDER"],4,strlen($ff['INPUT_OPTIONS']["PLACEHOLDER"])-4)]; } else { $input_placeholder = $ff['INPUT_OPTIONS']["PLACEHOLDER"]; } $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": $date_formatee = format_date_input($v[0]); $date_clic = "onClick=\"openPopUp('./select.php?what=calendrier&caller=search_form&date_caller=".str_replace('-', '', $v[0])."¶m1=field_".$n."_".$search."_date¶m2=field_".$n."_".$search."[]&auto_submit=NO&date_anterieure=YES&format_return=IN', 'field_".$n."_".$search."_date', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\" "; if (substr($ff['INPUT_OPTIONS']["PLACEHOLDER"],0,4)=="msg:") { $input_placeholder = $msg[substr($ff['INPUT_OPTIONS']["PLACEHOLDER"],4,strlen($ff['INPUT_OPTIONS']["PLACEHOLDER"])-4)]; } else { $input_placeholder = $ff['INPUT_OPTIONS']["PLACEHOLDER"]; } $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.="