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 $specialfields; var $pp; var $error_message; var $link; var $link_expl; var $link_expl_bull; var $link_explnum; var $link_serial; var $link_analysis; var $link_bulletin; var $link_explnum_serial; var $link_explnum_analysis; var $link_explnum_bulletin; var $rec_history; var $tableau_speciaux; var $operator_multi_value; var $full_path=''; var $fichier_xml; var $dynamics_not_visible; var $specials_not_visible; var $isfichier = false; var $memory_engine_allowed = false; var $current_engine = 'MyISAM'; function search($rec_history=false,$fichier_xml="",$full_path='') { global $launch_search; $this->parse_search_file($fichier_xml,$full_path); $this->strip_slashes(); foreach ( $this->dynamicfields as $key => $value ) { $this->pp[$key]=new parametres_perso($value["TYPE"]); } $this->rec_history=$rec_history; $this->full_path = $full_path; $this->fichier_xml=$fichier_xml; } 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 $base_path,$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 editeur($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]); if ($indexint->comment) $libelle = $indexint->name." - ".$indexint->comment; else $libelle = $indexint->name ; if ($thesaurus_classement_mode_pmb != 0) { $libelle="[".$indexint->name_pclass."] ".$libelle; } break; case "titre_uniforme" : $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; } } $$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 $thesaurus_mode_pmb; if($ajax == "categories_mul" and $thesaurus_mode_pmb == 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 editeur($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]); if ($indexint->comment) $libelle = $indexint->name." - ".$indexint->comment; else $libelle = $indexint->name ; if ($thesaurus_classement_mode_pmb != 0) { $libelle="[".$indexint->name_pclass."] ".$libelle; } break; case "titre_uniforme" : $tu = new titre_uniforme($v[0]); $libelle = $tu->name; 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_OPTIONS"]["QUERY"][0]["USE_GLOBAL"]) { $use_global = explode(",", $ff["INPUT_OPTIONS"]["QUERY"][0]["USE_GLOBAL"]); for($j=0; $j"; while ($opt=mysql_fetch_row($resultat)) { $r.="