FIX: consistent UX when calling a tab from the invoice card with empty ref / id
This commit is contained in:
parent
cd09099409
commit
2da16ade6c
@ -2756,6 +2756,17 @@ if (empty($reshook))
|
||||
* View
|
||||
*/
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$head = facture_prepare_head($object);
|
||||
$langs->load('errors');
|
||||
echo dol_get_fiche_head($head, 'compta', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
||||
llxFooter();
|
||||
dol_shutdown();
|
||||
exit;
|
||||
}
|
||||
|
||||
$form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
$formfile = new FormFile($db);
|
||||
|
||||
@ -118,6 +118,17 @@ elseif ($action == 'deletecontact' && $user->rights->facture->creer)
|
||||
* View
|
||||
*/
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$head = facture_prepare_head($object);
|
||||
$langs->load('errors');
|
||||
echo dol_get_fiche_head($head, 'contact', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
||||
llxFooter();
|
||||
dol_shutdown();
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('ContactsAddresses');
|
||||
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
||||
llxHeader('', $title, $helpurl);
|
||||
|
||||
@ -85,6 +85,17 @@ require_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
||||
* View
|
||||
*/
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$head = facture_prepare_head($object);
|
||||
$langs->load('errors');
|
||||
echo dol_get_fiche_head($head, 'documents', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
||||
llxFooter();
|
||||
dol_shutdown();
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Documents');
|
||||
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
||||
llxHeader('', $title, $helpurl);
|
||||
|
||||
@ -43,6 +43,17 @@ $ref = GETPOST("ref", 'alpha');
|
||||
* View
|
||||
*/
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$head = facture_prepare_head($object);
|
||||
$langs->load('errors');
|
||||
echo dol_get_fiche_head($head, 'info', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
||||
llxFooter();
|
||||
dol_shutdown();
|
||||
exit;
|
||||
}
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Info');
|
||||
|
||||
@ -64,6 +64,17 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
|
||||
* View
|
||||
*/
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$head = facture_prepare_head($object);
|
||||
$langs->load('errors');
|
||||
echo dol_get_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
||||
llxFooter();
|
||||
dol_shutdown();
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Notes');
|
||||
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
||||
llxHeader('', $title, $helpurl);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user