fixed cancel button path for document form refs #1729
This commit is contained in:
parent
00ed7bcd49
commit
7b001d039c
@ -49,6 +49,9 @@ abstract class DocumentForm extends Base
|
|||||||
/** @var string */
|
/** @var string */
|
||||||
public $routeUpdate;
|
public $routeUpdate;
|
||||||
|
|
||||||
|
/** @var string */
|
||||||
|
public $routeCancel;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
public $formId;
|
public $formId;
|
||||||
|
|
||||||
@ -195,7 +198,7 @@ abstract class DocumentForm extends Base
|
|||||||
bool $hideLogo = false, bool $hideDocumentTitle = false, bool $hideDocumentSubheading = false, bool $hideCompanyEdit = false,
|
bool $hideLogo = false, bool $hideDocumentTitle = false, bool $hideDocumentSubheading = false, bool $hideCompanyEdit = false,
|
||||||
/** Company Component End */
|
/** Company Component End */
|
||||||
/** Content Component Start */
|
/** Content Component Start */
|
||||||
string $routeStore = '', string $routeUpdate = '', string $formId = 'document', string $formSubmit = 'onSubmit',
|
string $routeStore = '', string $routeUpdate = '', string $formId = 'document', string $formSubmit = 'onSubmit', string $routeCancel = '',
|
||||||
bool $hideCompany = false, bool $hideAdvanced = false, bool $hideFooter = false, bool $hideButtons = false,
|
bool $hideCompany = false, bool $hideAdvanced = false, bool $hideFooter = false, bool $hideButtons = false,
|
||||||
/** Content Component End */
|
/** Content Component End */
|
||||||
/** Metadata Component Start */
|
/** Metadata Component Start */
|
||||||
@ -232,6 +235,7 @@ abstract class DocumentForm extends Base
|
|||||||
/** Content Component Start */
|
/** Content Component Start */
|
||||||
$this->routeStore = $this->getRouteStore($type, $routeStore);
|
$this->routeStore = $this->getRouteStore($type, $routeStore);
|
||||||
$this->routeUpdate = $this->getRouteUpdate($type, $routeUpdate, $document);
|
$this->routeUpdate = $this->getRouteUpdate($type, $routeUpdate, $document);
|
||||||
|
$this->routeCancel = $this->getRouteCancel($type, $routeCancel);
|
||||||
$this->formId = $formId;
|
$this->formId = $formId;
|
||||||
$this->formSubmit = $formSubmit;
|
$this->formSubmit = $formSubmit;
|
||||||
|
|
||||||
@ -322,6 +326,21 @@ abstract class DocumentForm extends Base
|
|||||||
return 'invoices.update';
|
return 'invoices.update';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getRouteCancel($type, $routeCancel)
|
||||||
|
{
|
||||||
|
if (!empty($routeCancel)) {
|
||||||
|
return $routeCancel;
|
||||||
|
}
|
||||||
|
|
||||||
|
$route = $this->getRouteFromConfig($type, 'index');
|
||||||
|
|
||||||
|
if (!empty($route)) {
|
||||||
|
return $route;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'invoices.index';
|
||||||
|
}
|
||||||
|
|
||||||
protected function getContacts($type, $contacts)
|
protected function getContacts($type, $contacts)
|
||||||
{
|
{
|
||||||
if (!empty($contacts)) {
|
if (!empty($contacts)) {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
<div class="row save-buttons">
|
<div class="row save-buttons">
|
||||||
{{ Form::saveButtons('invoices.index') }}
|
{{ Form::saveButtons($routeCancel) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -88,6 +88,7 @@
|
|||||||
<x-documents.form.buttons
|
<x-documents.form.buttons
|
||||||
type="{{ $type }}"
|
type="{{ $type }}"
|
||||||
:document="$document"
|
:document="$document"
|
||||||
|
route-cancel="{{ $routeCancel }}"
|
||||||
/>
|
/>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user