Fix: more better of better
This commit is contained in:
parent
4dd8119a9e
commit
dcfc34e64e
@ -96,12 +96,24 @@ $object = new Propal($db);
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$ret=$object->fetch($id, $ref);
|
||||
if ($ret == 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans('ErrorRecordNotFound'), 'errors');
|
||||
$error++;
|
||||
}
|
||||
else if ($ret < 0)
|
||||
{
|
||||
setEventMessage($object->error, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans('ErrorRecordNotFound'), 'errors');
|
||||
Header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -47,18 +47,30 @@ $result = restrictedArea($user, 'propal', $id);
|
||||
|
||||
$object = new Propal($db);
|
||||
|
||||
// Load object
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$ret=$object->fetch($id, $ref);
|
||||
$object->fetch_thirdparty();
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans('ErrorRecordNotFound'), 'errors');
|
||||
Header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php');
|
||||
exit;
|
||||
// Load object
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$ret=$object->fetch($id, $ref);
|
||||
if ($ret == 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans('ErrorRecordNotFound'), 'errors');
|
||||
$error++;
|
||||
}
|
||||
else if ($ret < 0)
|
||||
{
|
||||
setEventMessage($object->error, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
}
|
||||
else
|
||||
{
|
||||
Header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user