".$msg["1500"]."\n"; $deflt_user="
".$msg["1501"]."
\n"; $i = 0; while ($i < mysql_num_fields($res_param)) { $field = mysql_field_name($res_param, $i) ; $field_deb = substr($field,0,6); switch ($field_deb) { case "deflt_" : if ($field=="deflt_styles") { $deflt_user_style="
". $msg[$field]." : 
\n
" .make_user_style_combo($field_values[$i]). "
\n"; } elseif ($field=="deflt_docs_location") { //visibilité des exemplaires if ($pmb_droits_explr_localises && $explr_visible_mod) $where_clause_explr = "idlocation in (".$explr_visible_mod.") and"; else $where_clause_explr = ""; $selector = gen_liste ("select distinct idlocation, location_libelle from docs_location, docsloc_section where $where_clause_explr num_location=idlocation order by 2 ", "idlocation", "location_libelle", 'form_'.$field, "account_calcule_section(this);", $field_values[$i], "", "","","",0); $deflt_user.="
". $msg[$field]." : 
\n
" .$selector. "
\n"; } elseif ($field=="deflt_collstate_location") { $selector = gen_liste ("select distinct idlocation, location_libelle from docs_location order by 2 ", "idlocation", "location_libelle", 'form_'.$field, "", $field_values[$i], "", "","0",$msg["all_location"],0); $deflt_user.="
". $msg[$field]." : 
\n
" .$selector. "
\n"; } elseif ($field=="deflt_resas_location") { $selector = gen_liste ("select distinct idlocation, location_libelle from docs_location order by 2 ", "idlocation", "location_libelle", 'form_'.$field, "", $field_values[$i], "", "","0",$msg["all_location"],0); $deflt_user.="
". $msg[$field]." : 
\n
" .$selector. "
\n"; } elseif ($field=="deflt_docs_section") { // calcul des sections $selector=""; if ($pmb_droits_explr_localises && $explr_visible_mod) $where_clause_explr = "where idlocation in (".$explr_visible_mod.")"; else $where_clause_explr = ""; $rqtloc = "SELECT idlocation FROM docs_location $where_clause_explr order by location_libelle"; $resloc = mysql_query($rqtloc, $dbh); while ($loc=mysql_fetch_object($resloc)) { $requete = "SELECT idsection, section_libelle FROM docs_section, docsloc_section where idsection=num_section and num_location='$loc->idlocation' order by section_libelle"; $result = mysql_query($requete, $dbh); $nbr_lignes = mysql_num_rows($result); if ($nbr_lignes) { if ($loc->idlocation==$deflt_docs_location ) $selector .= "
idlocation."\" style=\"display:block\">\r\n"; else $selector .= "
idlocation."\" style=\"display:none\">\r\n"; $selector .= "
'; } } $deflt_user.="
". $msg[$field]." : 
\n
" .$selector. "
\n"; } elseif ($field=="deflt_upload_repertoire") { $selector = ""; $req = "select repertoire_id, repertoire_nom from upload_repertoire"; $res = mysql_query($req, $dbh); $selector .= "
"; $selector .= "
"; $deflt_user.="
".$msg[$field]." : 
".$selector."
"; } elseif($field=="deflt_import_thesaurus"){ $requete="select * from thesaurus order by 2"; $resultat_liste=mysql_query($requete,$dbh); $nb_liste=mysql_num_rows($resultat_liste); if ($nb_liste==0) { $deflt_user.="" ; } else { $deflt_user.="
".$msg[$field]." : 
\n
\n" ; } }else { $deflt_table = substr($field,6); if($deflt_table == "integration_notice_statut") $deflt_table= "notice_statut"; $requete="select * from ".$deflt_table." order by 2"; $resultat_liste=mysql_query($requete,$dbh); $nb_liste=mysql_num_rows($resultat_liste); if ($nb_liste==0) { $deflt_user.="" ; } else { $deflt_user.="
". $msg[$field]." : 
\n"; $deflt_user.= "

\n" ; } } // fin else break; case "param_" : if ($field=="param_allloc") { $param_user_allloc="
".$msg[$field]."
\n
table[$field_values[$i]]; $value_user.="
$msg[$field] : 
\n

"; } else if ($field == 'value_deflt_lang'){ $llist=new marc_list('lang'); $l=$llist->table[$field_values[$i]]; $value_user.="
$msg[$field] : 
\n

"; } else if ($field == 'value_deflt_relation'){ $value_user.="
$msg[value_deflt_relation] : 
\n
"; //Recuperation des types de relation $liste_type_relation=new marc_select("relationtypeup","form_value_deflt_relation",$field_values[$i]); $type_relation=$liste_type_relation->display; $value_user.=$type_relation; $value_user.="

"; } else { $value_user.="
$msg[$field] : 
\n

"; } break ; case "deflt2" : if ($field=="deflt2docs_location") { // localisation des lecteurs $deflt_table = substr($field,6); $requete="select * from ".$deflt_table." order by 2"; $resultat_liste=mysql_query($requete,$dbh); $nb_liste=mysql_num_rows($resultat_liste); if ($nb_liste==0) { $deflt_user.="" ; } else { $deflt_user.="
". $msg[$field]." : 
\n"; $deflt_user.= "
!!param_allloc!!
\n" ; } } else { $deflt_table = substr($field,6); $requete="select * from ".$deflt_table." order by 2 "; $resultat_liste=mysql_query($requete,$dbh); $nb_liste=mysql_numrows($resultat_liste); if ($nb_liste==0) { $deflt_user.="" ; } else { $deflt_user.="
". $msg[$field]." : 
\n"; $deflt_user.= "
\n" ; } } break; case "xmlta_" : switch($field) { case "xmlta_doctype_serial" : $deflt_user.="
". $msg[$field]." : 
\n"; $deflt_user.= "
"; $select_doc = new marc_select("doctype", "form_".$field, $field_values[$i], ""); $deflt_user.= $select_doc->display ; $deflt_user.="
\n" ; break; case "xmlta_doctype_bulletin" : case "xmlta_doctype_analysis" : $deflt_user.="
". $msg[$field]." : 
\n"; $deflt_user.= "
"; $select_doc = new marc_select("doctype", "form_".$field, $field_values[$i], "","0",$msg[$field."_parent"]); $deflt_user.= $select_doc->display ; $deflt_user.="
\n" ; break; default : $deflt_table = substr($field,6); $deflt_user.="
". $msg[$field]." : 
\n"; $deflt_user.= "
"; $select_doc = new marc_select("$deflt_table", "form_".$field, $field_values[$i], ""); $deflt_user.= $select_doc->display ; $deflt_user.="
\n" ; break; } case "deflt3" : $q=''; $t=array(); switch($field) { case "deflt3bibli": $q="select 0,'".addslashes($msg['deflt3none'])."' union "; $q.="select id_entite, raison_sociale from entites where type_entite='1' order by 2 "; break; case "deflt3exercice": $q="select 0,'".addslashes($msg['deflt3none'])."' union "; $q.="select id_exercice, libelle from exercices order by 2 "; break; case "deflt3rubrique": $q="select 0,'".addslashes($msg['deflt3none'])."' union "; $q.="select id_rubrique, concat(budgets.libelle,':',rubriques.libelle) from rubriques join budgets on num_budget=id_budget order by 2 "; break; case "deflt3dev_statut": $t=actes::getStatelist(TYP_ACT_DEV); break; case "deflt3cde_statut": $t=actes::getStatelist(TYP_ACT_CDE); break; case "deflt3liv_statut": $t=actes::getStatelist(TYP_ACT_LIV); break; case "deflt3fac_statut": $t=actes::getStatelist(TYP_ACT_FAC); break; case "deflt3sug_statut": $m=new suggestions_map(); $t=$m->getStateList(); break; case 'deflt3lgstatcde': case 'deflt3lgstatdev': $q=lgstat::getList('QUERY'); break; case 'deflt3receptsugstat': $m=new suggestions_map(); $t=$m->getStateList('ORDERED',TRUE); break; } if($q) { $r=mysql_query($q, $dbh) or die ("
".mysql_error()."
".$q."
"); $nb=mysql_num_rows($r); while($row=mysql_fetch_row($r)) { $t[$row[0]]=$row[1]; } } if (count($t)) { $deflt3user.="
".$msg[$field]." : 
\n"; $deflt3user.= "

\n"; } break; case "speci_" : $speci_func = substr($field, 6); eval('$speci_user.= get_'.$speci_func.'($PMBuserid, $field_values, $i, \'account_form\');'); break; default : break ; } $i++; } $param_default="

$param_user

".str_replace("!!param_allloc!!",$param_user_allloc,$deflt_user)."

$value_user"; if ($speci_user || $deflt3user) { $param_default.= "

"; $param_default.=$deflt3user; $param_default.=$speci_user; $param_default.= "
"; } $account_form = str_replace('!!all_user_param!!', $param_default, $account_form); // fin gestion des paramètres personalisés du user $account_form = str_replace('!!combo_user_style!!', make_user_style_combo($stylesheet), $account_form); $account_form = str_replace('!!combo_user_lang!!', make_user_lang_combo($user_params->user_lang), $account_form); $account_form = str_replace('!!nb_per_page_search!!', $user_params->nb_per_page_search, $account_form); $account_form = str_replace('!!nb_per_page_select!!', $user_params->nb_per_page_select, $account_form); $account_form = str_replace('!!nb_per_page_gestion!!', $user_params->nb_per_page_gestion, $account_form); print $account_form; } else { // code de mise à jour // constitution des variables MySQL // mise à jour de la date d'update $names[] = 'last_updated_dt'; $values[] = "'".today()."'"; $names[] = 'user_lang'; $values[] = "'$user_lang'"; if ($form_pwd) { $names[] = 'pwd'; $values[] = "password('$form_pwd')"; $names[] = 'user_digest'; $values[]= "'".md5(SESSlogin.":".md5($pmb_url_base).":".$form_pwd)."'"; } if($form_nb_per_page_search >= 1) { $names[] = 'nb_per_page_search'; $values[] = "'$form_nb_per_page_search'"; } if($form_nb_per_page_select >= 1) { $names[] = 'nb_per_page_select'; $values[] = "'$form_nb_per_page_select'"; } if($form_nb_per_page_gestion >= 1) { $names[] = 'nb_per_page_gestion'; $values[] = "'$form_nb_per_page_gestion'"; } if(strcmp($form_style, $stylesheet)) { $names[] .= 'deflt_styles'; $values[] .= "'$form_style'"; } /* insérer ici la maj des param et deflt */ //maj thesaurus par defaut en session if ($form_deflt_thesaurus) thesaurus::setSessionThesaurusId($form_deflt_thesaurus); $requete_param = "SELECT * FROM users WHERE userid='$PMBuserid' LIMIT 1 "; $res_param = mysql_query($requete_param, $dbh); $field_values = mysql_fetch_row ( $res_param ); $i = 0; while ($i < mysql_num_fields($res_param)) { $field = mysql_field_name($res_param, $i) ; $field_deb = substr($field,0,6); switch ($field_deb) { case "deflt_" : if ($field == "deflt_styles") { $dummy[$i+8]=$field."='".$form_style."'"; } elseif ($field == "deflt_docs_section") { $formlocid="f_ex_section".$form_deflt_docs_location ; $dummy[$i+8]=$field."='".$$formlocid."'"; } else { $var_form = "form_".$field; $dummy[$i+8]=$field."='".$$var_form."'"; } break; case "deflt2" : $var_form = "form_".$field; $dummy[$i+8]=$field."='".$$var_form."'"; break ; case "param_" : $var_form = "form_".$field; $dummy[$i+8]=$field."='".$$var_form."'"; break ; case "value_" : $var_form = "form_".$field; $dummy[$i+8]=$field."='".$$var_form."'"; break ; case "xmlta_" : $var_form = "form_".$field; $dummy[$i+8]=$field."='".$$var_form."'"; break ; case "deflt3" : $var_form = "form_".$field; $dummy[$i+8]=$field."='".$$var_form."'"; break ; case "speci_" : $speci_func = substr($field, 6); eval('$dummy[$i+8].= set_'.$speci_func.'();'); break; default : break ; } $i++; } if(!empty($dummy)) { $set = join($dummy, ", "); $set = " , ".$set ; } else $set = "" ; if(sizeof($names) == sizeof($values)) { while(list($cle, $valeur) = each($names)) { $n_values ? $n_values .= ", $valeur=${values[$cle]}" : $n_values = "$valeur=${values[$cle]}"; } $requete = "UPDATE users SET $n_values $set , last_updated_dt=curdate() WHERE username='".SESSlogin."' "; $result = @mysql_query($requete, $dbh); if($result) { $loc = "index.php" ; if (SESSrights & ADMINISTRATION_AUTH) $loc="admin.php"; if (SESSrights & EDIT_AUTH) $loc="edit.php"; if (SESSrights & AUTORITES_AUTH) $loc="autorites.php"; if (SESSrights & CATALOGAGE_AUTH) $loc="catalog.php"; if (SESSrights & CIRCULATION_AUTH) $loc="circ.php"; print $msg["937"]." "; } else { // c'est parti en vrac : erreur MySQL warning($msg["281"], $msg["936"]); } } } print "
"; print $account_layout_end; print $extra; print $extra_info; print $footer; mysql_close($dbh);