Skip to content
Snippets Groups Projects
Commit 416e34d5 authored by Laurent Destailleur's avatar Laurent Destailleur Committed by Juanjo Menent
Browse files

Fix error management

parent f9a428d5
No related branches found
No related tags found
No related merge requests found
...@@ -53,6 +53,7 @@ $object = new Adherent($db); ...@@ -53,6 +53,7 @@ $object = new Adherent($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
$adht = new AdherentType($db); $adht = new AdherentType($db);
$errmsg=''; $errmsg='';
$errmsgs=array();
$defaultdelay=1; $defaultdelay=1;
$defaultdelayunit='y'; $defaultdelayunit='y';
...@@ -282,7 +283,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ ...@@ -282,7 +283,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
{ {
$error++; $error++;
$errmsg=$object->error; $errmsg=$object->error;
setEventMessage($object->errors, 'errors'); setEventMessages($object->error,$object->errors, 'errors');
} }
if (! $error) if (! $error)
...@@ -319,12 +320,14 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ ...@@ -319,12 +320,14 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
{ {
$error++; $error++;
$errmsg=$acct->error; $errmsg=$acct->error;
$errmsgs=$acct->errors;
} }
} }
else else
{ {
$error++; $error++;
$errmsg=$acct->error; $errmsg=$acct->error;
$errmsgs=$acct->errors;
} }
} }
...@@ -352,6 +355,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ ...@@ -352,6 +355,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
if ($result <= 0) if ($result <= 0)
{ {
$errmsg=$customer->error; $errmsg=$customer->error;
$errmsgs=$acct->errors;
$error++; $error++;
} }
} }
...@@ -378,6 +382,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ ...@@ -378,6 +382,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
if ($result <= 0) if ($result <= 0)
{ {
$errmsg=$invoice->error; $errmsg=$invoice->error;
$errmsgs=$invoice->errors;
$error++; $error++;
} }
} }
...@@ -409,6 +414,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ ...@@ -409,6 +414,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
if ($result <= 0) if ($result <= 0)
{ {
$errmsg=$invoice->error; $errmsg=$invoice->error;
$errmsgs=$invoice->errors;
$error++; $error++;
} }
} }
...@@ -435,6 +441,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ ...@@ -435,6 +441,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
if (! $paiement_id > 0) if (! $paiement_id > 0)
{ {
$errmsg=$paiement->error; $errmsg=$paiement->error;
$errmsgs=$paiement->errors;
$error++; $error++;
} }
} }
...@@ -446,7 +453,8 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ ...@@ -446,7 +453,8 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
if (! ($bank_line_id > 0)) if (! ($bank_line_id > 0))
{ {
$errmsg=$paiement->error; $errmsg=$paiement->error;
setEventMessage($paiement->errors, 'errors'); $errmsgs=$paiement->errors;
setEventMessages($paiement->error, $paiement->errors, 'errors');
$error++; $error++;
} }
} }
...@@ -487,8 +495,6 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ ...@@ -487,8 +495,6 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
//if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) //if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
$invoice->generateDocument($invoice->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $invoice->generateDocument($invoice->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
} }
} }
...@@ -514,7 +520,10 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ ...@@ -514,7 +520,10 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
$texttosend=$object->makeSubstitution($adht->getMailOnSubscription()); $texttosend=$object->makeSubstitution($adht->getMailOnSubscription());
$result=$object->send_an_email($texttosend,$subjecttosend,array(),array(),array(),"","",0,-1); $result=$object->send_an_email($texttosend,$subjecttosend,array(),array(),array(),"","",0,-1);
if ($result < 0) $errmsg=$object->error; if ($result < 0)
{
$errmsg=$object->error;
}
} }
$_POST["cotisation"]=''; $_POST["cotisation"]='';
...@@ -692,7 +701,7 @@ if ($rowid) ...@@ -692,7 +701,7 @@ if ($rowid)
dol_fiche_end(); dol_fiche_end();
dol_htmloutput_errors($errmsg); dol_htmloutput_errors($errmsg,$errmsgs);
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment