Fix error management
This commit is contained in:
parent
dfde0314c6
commit
5fd6c44640
@ -1761,7 +1761,7 @@ if ($action == 'create')
|
|||||||
$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db, $result);
|
dol_print_error($db, $object->error, $object->errors);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->askpricesupplier->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
$fileparams = dol_most_recent_file($conf->askpricesupplier->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
|
|||||||
@ -2327,7 +2327,7 @@ if ($action == 'create')
|
|||||||
if (! $file || ! is_readable($file)) {
|
if (! $file || ! is_readable($file)) {
|
||||||
$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
if ($result <= 0) {
|
if ($result <= 0) {
|
||||||
dol_print_error($db, $result);
|
dol_print_error($db, $object->error, $object->errors);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
|
|||||||
@ -2360,7 +2360,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
if (! $file || ! is_readable($file)) {
|
if (! $file || ! is_readable($file)) {
|
||||||
$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
if ($result <= 0) {
|
if ($result <= 0) {
|
||||||
dol_print_error($db, $result);
|
dol_print_error($db, $object->error, $object->errors);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
|
|||||||
@ -442,7 +442,7 @@ if (empty($reshook))
|
|||||||
$ret = $object->fetch($id); // Reload to get new records
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
|
|
||||||
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
if ($result < 0) dol_print_error($db,$result);
|
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1421,10 +1421,7 @@ if (empty($reshook))
|
|||||||
$ret = $object->fetch($id); // Reload to get new records
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
|
|
||||||
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
if ($result < 0)
|
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||||
{
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($_POST['prod_entry_mode']);
|
unset($_POST['prod_entry_mode']);
|
||||||
@ -3809,7 +3806,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
if (! $file || ! is_readable($file)) {
|
if (! $file || ! is_readable($file)) {
|
||||||
$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
if ($result <= 0) {
|
if ($result <= 0) {
|
||||||
dol_print_error($db, $result);
|
dol_print_error($db, $object->error, $object->errors);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
|
|||||||
@ -3470,7 +3470,16 @@ abstract class CommonObject
|
|||||||
|
|
||||||
if (empty($srctemplatepath))
|
if (empty($srctemplatepath))
|
||||||
{
|
{
|
||||||
$this->error='ErrorGenerationAskedForOdtTemplateWithNoSrcFileFound';
|
$this->error='ErrorGenerationAskedForOdtTemplateWithSrcFileNotDefined';
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($obj->type == 'odt' && ! empty($srctemplatepath))
|
||||||
|
{
|
||||||
|
if (! dol_is_file($srctemplatepath))
|
||||||
|
{
|
||||||
|
$this->error='ErrorGenerationAskedForOdtTemplateWithSrcFileNotFound';
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1597,7 +1597,7 @@ else if ($id || $ref)
|
|||||||
$result = $object->generateDocument(GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$result = $object->generateDocument(GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db,$result);
|
dol_print_error($db,$object->error,$object->errors);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
|
|||||||
@ -526,7 +526,7 @@ if (empty($reshook))
|
|||||||
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db,$result);
|
dol_print_error($db,$object->error,$object->errors);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2296,7 +2296,7 @@ else
|
|||||||
$result = $object->generateDocument(GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$result = $object->generateDocument(GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db,$result);
|
dol_print_error($db,$object->error,$object->errors);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref, preg_quote($ref,'/').'([^\-])+');
|
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref, preg_quote($ref,'/').'([^\-])+');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user