add minimum test
This commit is contained in:
parent
6824d7bf99
commit
e91c4e1373
@ -117,23 +117,32 @@ class Don
|
|||||||
{
|
{
|
||||||
$error_string[$err] = "Le montant du don contient un/des caractère(s) invalide(s)";
|
$error_string[$err] = "Le montant du don contient un/des caractère(s) invalide(s)";
|
||||||
$err++;
|
$err++;
|
||||||
|
$amount_invalid = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->amount == 0)
|
if (! $amount_invalid)
|
||||||
{
|
{
|
||||||
$error_string[$err] = "Le montant du don est null";
|
if ($this->amount == 0)
|
||||||
$err++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ($this->amount < $minimum && $minimum > 0)
|
|
||||||
{
|
{
|
||||||
$error_string[$err] = "Le montant minimum du don est de $minimum";
|
$error_string[$err] = "Le montant du don est null";
|
||||||
$err++;
|
$err++;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($this->amount < $minimum && $minimum > 0)
|
||||||
|
{
|
||||||
|
$error_string[$err] = "Le montant minimum du don est de $minimum";
|
||||||
|
$err++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return errors
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
if ($err)
|
if ($err)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -50,7 +50,7 @@ if ($conf->don->enabled)
|
|||||||
if ($HTTP_POST_VARS["action"] == 'add')
|
if ($HTTP_POST_VARS["action"] == 'add')
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($don->check())
|
if ($don->check($conf->don->minimum))
|
||||||
{
|
{
|
||||||
require("valid.php");
|
require("valid.php");
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@ if ($conf->don->enabled)
|
|||||||
elseif ($HTTP_POST_VARS["action"] == 'valid')
|
elseif ($HTTP_POST_VARS["action"] == 'valid')
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($don->check())
|
if ($don->check($conf->don->minimum))
|
||||||
{
|
{
|
||||||
$return = $don->create(0);
|
$return = $don->create(0);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user