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";
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 "| Id | ";
- print ''.$langs->trans("Label").' | Cotisation ? | Vote ? | | ';
- 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 "| ".$objp->rowid." | \n";
- print ''.$objp->libelle.' | ';
- print ''.$langs->trans($objp->cotisation).' | ';
- print ''.$langs->trans($objp->vote).' | ';
- print ''.img_edit().' | ';
- print "
";
- $i++;
+ $num = $db->num_rows($result);
+ $i = 0;
+
+ print '';
+
+ print '';
+ print "| Id | ";
+ print ''.$langs->trans("Label").' | '.$langs->trans("SubscriptionRequired").' | ';
+ print ''.$langs->trans("VoteAllowed").' | | ';
+ print "
\n";
+
+ $var=True;
+ while ($i < $num)
+ {
+ $objp = $db->fetch_object($result);
+ $var=!$var;
+ print "";
+ print "| ".$objp->rowid." | \n";
+ print ''.$objp->libelle.' | ';
+ print ''.$langs->trans($objp->cotisation).' | ';
+ print ''.$langs->trans($objp->vote).' | ';
+ print ''.img_edit().' | ';
+ print "
";
+ $i++;
+ }
+ print "
";
+ }
+ 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 "\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 '