| '.$langs->trans("UserTitle").' | ';
- print $htmlcompany->select_civilite($adh->civilite_id);
+ print $htmlcompany->select_civilite(isset($_POST["civilite_id"])?$_POST["civilite_id"]:$adh->civilite_id)."\n";
print ' | ';
// Photo
print '';
- print $html->showphoto('memberphoto',$adh);
+ print $html->showphoto('memberphoto',$adh)."\n";
if ($caneditfieldmember)
{
print '
| '.$langs->trans("PhotoFile").' | ';
@@ -737,25 +759,25 @@ if ($action == 'edit')
print '';
print '';
- // Nom
- print '| '.$langs->trans("Lastname").' | | ';
+ // Name
+ print ' | '.$langs->trans("Lastname").' | nom).'"> | ';
print ' ';
- // Prenom
- print '| '.$langs->trans("Firstname").' | | ';
+ // Firstname
+ print ' | '.$langs->trans("Firstname").' | prenom).'"> | ';
print ' ';
// Login
- print '| '.$langs->trans("Login").' | | ';
+ print '| '.$langs->trans("Login").' | login).'"> | ';
// Password
- print '| '.$langs->trans("Password").' | | ';
+ print '| '.$langs->trans("Password").' | pass).'"> | ';
// Type
print '| '.$langs->trans("Type").' | ';
if ($user->rights->adherent->creer)
{
- $html->select_array("typeid", $adht->liste_array(), $adh->typeid);
+ $html->select_array("typeid", $adht->liste_array(), (isset($_POST["typeid"])?$_POST["typeid"]:$adh->typeid));
}
else
{
@@ -766,36 +788,42 @@ if ($action == 'edit')
// Address
print ' | | '.$langs->trans("Address").' | ';
- print ' | ';
+ print '';
- // Cp
- print '| '.$langs->trans("Zip").'/'.$langs->trans("Town").' | | ';
+ // Zip / Town
+ print '| '.$langs->trans("Zip").'/'.$langs->trans("Town").' | cp).'"> ville).'"> | ';
// Country
print '| '.$langs->trans("Country").' | ';
- $html->select_pays($adh->pays_code?$adh->pays_code:$mysoc->pays_code,'pays');
+ $html->select_pays(isset($_POST["pays"])?$_POST["pays"]:$adh->pays_id,'pays',$conf->use_javascript_ajax?' onChange="company_save_refresh_edit()"':'');
+ if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
+ print ' | ';
+
+ // State
+ print '| '.$langs->trans('State').' | ';
+ $htmlcompany->select_departement($adh->fk_departement,$adh->pays_code);
print ' | ';
// Tel
- print '| '.$langs->trans("PhonePro").' | | ';
+ print '| '.$langs->trans("PhonePro").' | phone).'"> | ';
// Tel perso
- print '| '.$langs->trans("PhonePerso").' | | ';
+ print '| '.$langs->trans("PhonePerso").' | phone_perso).'"> | ';
// Tel mobile
- print '| '.$langs->trans("PhoneMobile").' | | ';
+ print '| '.$langs->trans("PhoneMobile").' | phone_mobile).'"> | ';
// EMail
- print '| '.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'':'').' | | ';
+ print '| '.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'':'').' | email).'"> | ';
// Date naissance
print "| ".$langs->trans("Birthday")." | \n";
- $html->select_date(($adh->naiss ? $adh->naiss : -1),'naiss','','',1,'update');
+ $html->select_date(($adh->naiss ? $adh->naiss : -1),'naiss','','',1,'formsoc');
print " | \n";
// Profil public
print "| ".$langs->trans("Public")." | \n";
- print $html->selectyesno("public",$adh->public,1);
+ print $html->selectyesno("public",(isset($_POST["public"])?$_POST["public"]:$adh->public),1);
print " | \n";
// Attributs supplementaires
@@ -831,7 +859,7 @@ if ($action == 'edit')
print '';
print '| ';
- print '';
+ print '';
print ' ';
print '';
print ' | ';
@@ -850,6 +878,28 @@ if ($action == 'create')
/* Fiche creation */
/* */
/* ************************************************************************** */
+ $adh->fk_departement = $_POST["departement_id"];
+
+ // We set pays_id, pays_code and label for the selected country
+ $adh->pays_id=$_POST["pays_id"]?$_POST["pays_id"]:$conf->global->MAIN_INFO_SOCIETE_PAYS;
+ if ($adh->pays_id)
+ {
+ $sql = "SELECT rowid, code, libelle";
+ $sql.= " FROM ".MAIN_DB_PREFIX."c_pays";
+ $sql.= " WHERE rowid = ".$adh->pays_id;
+ $resql=$db->query($sql);
+ if ($resql)
+ {
+ $obj = $db->fetch_object($resql);
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+ $adh->pays_id=$obj->rowid;
+ $adh->pays_code=$obj->code;
+ $adh->pays=$obj->libelle;
+ }
$adht = new AdherentType($db);
@@ -861,37 +911,37 @@ if ($action == 'create')
}
if ($mesg) print ''.$mesg.' ';
- print '
|