diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index ed44072c7cd..5e3f7784c4a 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -155,43 +155,45 @@ if ($_POST["action"] == 'add') // Test validite des paramètres if(!isset($type) || $type==''){ - $error+=1; - $errmsg .="Le type d'adhérent n'est pas renseigné. Vous devez configurer les types d'adhérents avant de pouvoir les ajouter.
\n"; + $error++; + $errmsg .= $langs->trans("ErrorMemberTypeNotDefined")."
\n"; } // Test si le login existe deja if(!isset($login) || $login==''){ - $error+=1; + $error++; $errmsg .= $langs->trans("ErrorFieldRequired",$langs->trans("Login"))."
\n"; } - $sql = "SELECT login FROM ".MAIN_DB_PREFIX."adherent WHERE login='$login';"; - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows($result); + else { + $sql = "SELECT login FROM ".MAIN_DB_PREFIX."adherent WHERE login='$login';"; + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + } + if ($num) { + $error++; + $errmsg .= $langs->trans("ErrorLoginAlreadyExists",$login)."
\n"; + } } if (!isset($nom) || $nom=='') { - $error+=1; + $error++; $errmsg .= $langs->trans("ErrorFieldRequired",$langs->trans("Lastname"))."
\n"; } if (!isset($prenom) || $prenom=='') { - $error+=1; + $error++; $errmsg .= $langs->trans("ErrorFieldRequired",$langs->trans("Firstname"))."
\n"; } if (ADHERENT_MAIL_REQUIRED && ADHERENT_MAIL_REQUIRED == 1 && ! ValidEMail($email)) { - $error+=1; - $errmsg .= "Adresse Email invalide
\n"; - } - if ($num !=0) { - $error+=1; - $errmsg .= "Login deja utilise. Veuillez en changer
\n"; + $error++; + $errmsg .= $langs->trans("ErrorBadEMail",$email)."
\n"; } if (!isset($pass) || $pass == '' ) { - $error+=1; + $error++; $errmsg .= $langs->trans("ErrorFieldRequired",$langs->trans("Password"))."
\n"; } if (isset($naiss) && $naiss !=''){ if (!preg_match("/^\d\d\d\d-\d\d-\d\d$/",$naiss)) { - $error+=1; - $errmsg .="Date de naissance invalide (Format AAAA-MM-JJ)
\n"; + $error++; + $errmsg .= $langs->trans("DateSubscription")." (".$langs->trans("DateFormatYYYYMMDD").")
\n"; } } if (isset($public)) { @@ -252,8 +254,6 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes') Header("Location: liste.php"); } -llxHeader(); - if ($_POST["action"] == 'confirm_valid' && $_POST["confirm"] == 'yes') { @@ -349,6 +349,11 @@ if ($_POST["action"] == 'confirm_add_spip' && $_POST["confirm"] == 'yes') } + +llxHeader(); + + + /* ************************************************************************** */ /* */ /* Création d'une fiche */ @@ -364,7 +369,9 @@ if ($errmsg != '') // fetch optionals attributes and labels $adho->fetch_optionals(); -if ($action == 'create') { + +if ($action == 'create') +{ print_titre($langs->trans("NewMember")); print "
\n"; @@ -375,8 +382,13 @@ if ($action == 'create') { $htmls = new Form($db); $adht = new AdherentType($db); - print ''.$langs->trans("Type").''; - $htmls->select_array("type", $adht->liste_array()); + print ''.$langs->trans("MemberType").''; + $listetype=$adht->liste_array(); + if (sizeof($listetype)) { + $htmls->select_array("type", $listetype); + } else { + print ''.$langs->trans("NoTypeDefinedGoToSetup").''; + } print "\n"; print ''.$langs->trans("Comments").' :'; @@ -384,7 +396,7 @@ if ($action == 'create') { $morphys["phy"] = "Physique"; $morphys["mor"] = "Morale"; - print "Personne\n"; + print "".$langs->trans("Person")."\n"; $htmls->select_array("morphy", $morphys); print "\n"; @@ -400,13 +412,13 @@ if ($action == 'create') { print ''.$langs->trans("EMail").(ADHERENT_MAIL_REQUIRED&&ADHERENT_MAIL_REQUIRED==1?'*':'').''; print ''.$langs->trans("Login").'*'; print ''.$langs->trans("Password").'*'; - print ''.$langs->trans("Birthday").'
(AAAA-MM-JJ)'; + print ''.$langs->trans("Birthday").'
('.$langs->trans("DateFormatYYYYMMDD").')'; print 'Url photo'; foreach($adho->attribute_label as $key=>$value){ print "$value\n"; } - print "Date de cotisation\n"; + print "".$langs->trans("DateSubscription")."\n"; $htmls->select_date(); print "\n"; print 'Mode de paiment'; @@ -424,23 +436,27 @@ if ($action == 'create') { // $paiement->select("modepaiement","crédit"); print "\n"; + if (defined("ADHERENT_BANK_USE") && ADHERENT_BANK_USE !=0 && defined("ADHERENT_BANK_USE_AUTO") && ADHERENT_BANK_USE_AUTO !=0){ print "Numero de cheque\n"; print ''; print "\n"; } - print 'Cotisation euros'; + print ''.$langs->trans("Subscription").' euros'; + if (defined("ADHERENT_BANK_USE") && ADHERENT_BANK_USE !=0 && defined("ADHERENT_BANK_USE_AUTO") && ADHERENT_BANK_USE_AUTO !=0){ - print ''.$langs->trans("Label").''; + print ''.$langs->trans("Label").''; } - print ''; + + print ''; print "
\n"; print "\n"; } + /* ************************************************************************** */ /* */ /* Edition de la fiche */ @@ -762,5 +778,5 @@ if ($rowid) $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index ee1a3833ca9..24b1f6abdf3 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -86,52 +86,56 @@ if ($_GET["action"] == 'commentaire') llxHeader(); -print_titre($langs->trans("MembersTypeSetup")); -print '
'; /* ************************************************************************** */ /* */ -/* */ +/* Liste des types d'adhérents */ /* */ /* ************************************************************************** */ -$sql = "SELECT d.rowid, d.libelle, d.cotisation, d.vote"; -$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d"; +if ($_GET["action"] != 'create' && $_GET["action"] != 'edit') { -$result = $db->query($sql); -if ($result) -{ - $num = $db->num_rows(); - $i = 0; - - print ''; - - print ''; - print ""; - print ''; - print "\n"; - - $var=True; - while ($i < $num) + print_titre($langs->trans("MembersTypeSetup")); + print '
'; + + + $sql = "SELECT d.rowid, d.libelle, d.cotisation, d.vote"; + $sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d"; + + $result = $db->query($sql); + if ($result) { - $objp = $db->fetch_object($result); - $var=!$var; - print ""; - print "\n"; - print ''; - print ''; - print ''; - print ''; - print ""; - $i++; + $num = $db->num_rows($result); + $i = 0; + + print '
Id'.$langs->trans("Label").'Cotisation ?Vote ? 
".$objp->rowid."'.$objp->libelle.''.$langs->trans($objp->cotisation).''.$langs->trans($objp->vote).''.img_edit().'
'; + + print ''; + print ""; + print ''; + print ''; + print "\n"; + + $var=True; + while ($i < $num) + { + $objp = $db->fetch_object($result); + $var=!$var; + print ""; + print "\n"; + print ''; + print ''; + print ''; + print ''; + print ""; + $i++; + } + print "
Id'.$langs->trans("Label").''.$langs->trans("SubscriptionRequired").''.$langs->trans("VoteAllowed").' 
".$objp->rowid."'.$objp->libelle.''.$langs->trans($objp->cotisation).''.$langs->trans($objp->vote).''.img_edit().'
"; + } + else + { + dolibarr_print_error($db); } - print ""; -} -else -{ - dolibarr_print_error($db); -} - /* @@ -142,6 +146,7 @@ else print "".$langs->trans("NewType").""; print ""; +} /* ************************************************************************** */ @@ -154,7 +159,7 @@ else if ($_GET["action"] == 'create') { $htmls = new Form($db); - print_titre("Nouveau type"); + print_titre($langs->trans("NewMemberType")); print '
'; print "
"; @@ -164,21 +169,21 @@ if ($_GET["action"] == 'create') { print ''.$langs->trans("Label").''; - print 'Soumis à cotisation'; + print ''.$langs->trans("SubscriptionRequired").''; $htmls->selectyesno("cotisation",""); print ''; - print 'Droit de vote'; + print ''.$langs->trans("VoteAllowed").''; $htmls->selectyesno("vote",""); print ''; - print ''.$langs->trans("Comments").' :'; + print ''.$langs->trans("Comments").''; print ""; - print 'Mail d\'accueil :'; + print ''.$langs->trans("WelcomeEMail").''; print ""; - print '  '; + print '  '; print ''; print "
\n"; @@ -199,7 +204,7 @@ if ($_GET["rowid"] > 0 && $_GET["action"] == 'edit') $adht->id = $_GET["rowid"]; $adht->fetch($_GET["rowid"]); - print_titre("Edition de la fiche"); + print_titre($langs->trans("EditType")); print '
'; print '
'; @@ -209,18 +214,18 @@ if ($_GET["rowid"] > 0 && $_GET["action"] == 'edit') print ''.$langs->trans("Label").''; - print 'Soumis à cotisation'; + print ''.$langs->trans("SubscriptionRequired").''; $htmls->selectyesno("cotisation",$adht->cotisation); print ''; - print 'Droit de vote'; + print ''.$langs->trans("VoteAllowed").''; $htmls->selectyesno("vote",$adht->vote); print ''; - print ''.$langs->trans("Comments").' :'; + print ''.$langs->trans("Comments").''; print ""; - print 'Mail d\'accueil :'; + print ''.$langs->trans("WelcomeEMail").''; print ""; print '  ';