\n";
$acquisition_user_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") {
$deflt_user_style="
".$msg[$field]." :
".make_user_style_combo($field_values[$i])."
\n";
} elseif ($field=="deflt_docs_location") {
//visibilité des exemplaires
if ($pmb_droits_explr_localises && $usr->explr_visible_mod) $where_clause_explr = "idlocation in (".$usr->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";
//localisation de l'utilisateur pour le calcul de la section
$location_user_section = $field_values[$i];
} 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 (!$location_user_section) $location_user_section = $deflt_docs_location;
if ($pmb_droits_explr_localises && $usr->explr_visible_mod) $where_clause_explr = "where idlocation in (".$usr->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==$location_user_section ) $selector .= "
\n" ;
} elseif ($field=="deflt_cashdesk"){
$requete="select * from cashdesk order by cashdesk_name";
$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";
switch($field) {
case "deflt_entites":
$requete="select id_entite, raison_sociale from ".$deflt_table." where type_entite='1' order by 2 ";
break;
case "deflt_exercices":
$requete="select id_exercice, libelle from ".$deflt_table." order by 2 ";
break;
case "deflt_rubriques":
$requete="select id_rubrique, concat(budgets.libelle,':', rubriques.libelle) from ".$deflt_table." join budgets on num_budget=id_budget order by 2 ";
break;
default :
$requete="select * from ".$deflt_table." order by 2";
break;
}
$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" ;
}
}
break;
case "param_" :
if ($field=="param_allloc") {
$param_user_allloc="
\n";
}
break ;
case "value_" :
switch ($field) {
case "value_deflt_fonction" :
$flist=new marc_list('function');
$f=$flist->table[$field_values[$i]];
$value_user.="
$msg[$field] :
\n
";
break;
case "value_deflt_lang" :
$llist=new marc_list('lang');
$l=$llist->table[$field_values[$i]];
$value_user.="
$msg[$field] :
\n
";
break;
case "value_deflt_relation" :
case "value_deflt_relation_serial" :
case "value_deflt_relation_bulletin" :
case "value_deflt_relation_analysis" :
$value_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);
$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.'($id, $field_values, $i, \'userform\');');
break;
case "explr_" :
$$field=$field_values[$i];
break;
default :
break ;
}
$i++;
}
//visibilité des exemplaires
if ($pmb_droits_explr_localises) {
$explr_tab_invis=explode(",",$explr_invisible);
$explr_tab_unmod=explode(",",$explr_visible_unmod);
$explr_tab_modif=explode(",",$explr_visible_mod);
$visibilite_expl_user="
".$msg["expl_visibilite"]." :
\n";
$requete_droits_expl="select idlocation, location_libelle from docs_location order by location_libelle";
$resultat_droits_expl=mysql_query($requete_droits_expl);
$temp="";
while ($j=mysql_fetch_array($resultat_droits_expl)) {
$temp.=$j["idlocation"].",";
$visibilite_expl_user.= "
".$j["location_libelle"]." :
\n" ;
}
mysql_free_result($resultat_droits_expl);
if ((!$explr_invisible)&&(!$explr_visible_unmod)&&(!$explr_visible_mod)) {
$rqt="UPDATE users SET explr_invisible=0,explr_visible_mod=0,explr_visible_unmod='".substr($temp,0,strlen($temp)-1)."' WHERE userid=$id";
@mysql_query($rqt);
}
$deflt_user .=$visibilite_expl_user;
} //fin visibilité des exemplaires
$param_default="