From d029ebe44f14ee702e291653ad1ce0b41d1a8c21 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 28 May 2007 11:11:46 +0000 Subject: [PATCH] =?UTF-8?q?Possibilit=E9=20de=20saisir=20une=20adh=E9sion?= =?UTF-8?q?=20=E0=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/adherents/card_subscriptions.php | 24 ++++++++++++++---------- htdocs/adherents/type.php | 6 +++--- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index dff1107be08..e073fd0616b 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -60,10 +60,10 @@ $typeid=isset($_GET["typeid"])?$_GET["typeid"]:$_POST["typeid"]; * Actions */ -if ($_POST["action"] == 'cotisation' && ! $_POST["cancel"]) +if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisation' && ! $_POST["cancel"]) { $langs->load("banks"); - + $adh->id = $rowid; $result=$adh->fetch($rowid); @@ -93,18 +93,22 @@ if ($_POST["action"] == 'cotisation' && ! $_POST["cancel"]) if ($adht->cotisation) { - if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) - { - if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")); - if (! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); - if (! $_POST["accountid"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("FinancialAccount")); - if ($errmsg) $action='addsubscription'; - } - if (! $_POST["cotisation"] > 0) + if (! is_numeric($_POST["cotisation"])) { + // If field is '' or not a numeric value $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")); $action='addsubscription'; } + else + { + if ($_POST["cotisation"] && $conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) + { + if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")); + if (! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); + if (! $_POST["accountid"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("FinancialAccount")); + if ($errmsg) $action='addsubscription'; + } + } } if ($action=='cotisation') diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 4dd447e64bc..9c3d787f2d9 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -216,7 +216,7 @@ if ($_GET["action"] == 'create') print $htmls->selectyesno("vote",0,1); print ''; - print ''.$langs->trans("Comments").''; + print ''.$langs->trans("Description").''; print ""; print ''.$langs->trans("WelcomeEMail").''; @@ -277,7 +277,7 @@ if ($rowid > 0) print yn($adht->vote); print ''; - print ''.$langs->trans("Comments").''; + print ''.$langs->trans("Description").''; print nl2br($adht->commentaire).""; print ''.$langs->trans("WelcomeEMail").''; @@ -347,7 +347,7 @@ if ($rowid > 0) print $htmls->selectyesno("vote",$adht->vote,1); print ''; - print ''.$langs->trans("Comments").''; + print ''.$langs->trans("Description").''; print ""; print ''.$langs->trans("WelcomeEMail").'';