Possibilité de saisir une adhésion à 0
This commit is contained in:
parent
d0858b2cfc
commit
d029ebe44f
@ -60,10 +60,10 @@ $typeid=isset($_GET["typeid"])?$_GET["typeid"]:$_POST["typeid"];
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($_POST["action"] == 'cotisation' && ! $_POST["cancel"])
|
if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisation' && ! $_POST["cancel"])
|
||||||
{
|
{
|
||||||
$langs->load("banks");
|
$langs->load("banks");
|
||||||
|
|
||||||
$adh->id = $rowid;
|
$adh->id = $rowid;
|
||||||
$result=$adh->fetch($rowid);
|
$result=$adh->fetch($rowid);
|
||||||
|
|
||||||
@ -93,18 +93,22 @@ if ($_POST["action"] == 'cotisation' && ! $_POST["cancel"])
|
|||||||
|
|
||||||
if ($adht->cotisation)
|
if ($adht->cotisation)
|
||||||
{
|
{
|
||||||
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE)
|
if (! is_numeric($_POST["cotisation"]))
|
||||||
{
|
|
||||||
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 field is '' or not a numeric value
|
||||||
$errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
|
$errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
|
||||||
$action='addsubscription';
|
$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')
|
if ($action=='cotisation')
|
||||||
|
|||||||
@ -216,7 +216,7 @@ if ($_GET["action"] == 'create')
|
|||||||
print $htmls->selectyesno("vote",0,1);
|
print $htmls->selectyesno("vote",0,1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Comments").'</td><td>';
|
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
||||||
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"60\" rows=\"3\"></textarea></td></tr>";
|
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"60\" rows=\"3\"></textarea></td></tr>";
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||||
@ -277,7 +277,7 @@ if ($rowid > 0)
|
|||||||
print yn($adht->vote);
|
print yn($adht->vote);
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Comments").'</td><td>';
|
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
||||||
print nl2br($adht->commentaire)."</td></tr>";
|
print nl2br($adht->commentaire)."</td></tr>";
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||||
@ -347,7 +347,7 @@ if ($rowid > 0)
|
|||||||
print $htmls->selectyesno("vote",$adht->vote,1);
|
print $htmls->selectyesno("vote",$adht->vote,1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Comments").'</td><td>';
|
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
||||||
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"90\" rows=\"3\">".$adht->commentaire."</textarea></td></tr>";
|
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"90\" rows=\"3\">".$adht->commentaire."</textarea></td></tr>";
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user