From e6802e0e3b80dfea4c8a51fb1c4be4c4d3638754 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 21 Jul 2017 17:15:37 +0300 Subject: [PATCH] Default documents --- app/Services/DatatableService.php | 18 ++++++++---- .../views/accounts/invoice_settings.blade.php | 29 ++++++++++++------- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/app/Services/DatatableService.php b/app/Services/DatatableService.php index 45a36cdc9e2d..df68b89c708b 100644 --- a/app/Services/DatatableService.php +++ b/app/Services/DatatableService.php @@ -119,13 +119,19 @@ class DatatableService $dropdown_contents .= '
  • '; } - if (($datatable->entityType != ENTITY_USER || $model->public_id) && $can_edit) { - $dropdown_contents .= "
  • entityType}('archive', {$model->public_id})\">" - . mtrans($datatable->entityType, "archive_{$datatable->entityType}") . '
  • '; + if (! $model->deleted_at || $model->deleted_at == '0000-00-00') { + if (($datatable->entityType != ENTITY_USER || $model->public_id) && $can_edit) { + $dropdown_contents .= "
  • entityType}('archive', {$model->public_id})\">" + . mtrans($datatable->entityType, "archive_{$datatable->entityType}") . '
  • '; + } + } + } + + if ($model->deleted_at && $model->deleted_at != '0000-00-00') { + if ($can_edit) { + $dropdown_contents .= "
  • entityType}('restore', {$model->public_id})\">" + . mtrans($datatable->entityType, "restore_{$datatable->entityType}") . '
  • '; } - } elseif ($can_edit) { - $dropdown_contents .= "
  • entityType}('restore', {$model->public_id})\">" - . mtrans($datatable->entityType, "restore_{$datatable->entityType}") . '
  • '; } if (property_exists($model, 'is_deleted') && ! $model->is_deleted && $can_edit) { diff --git a/resources/views/accounts/invoice_settings.blade.php b/resources/views/accounts/invoice_settings.blade.php index 65ec0bc27579..3bca7d0f921a 100644 --- a/resources/views/accounts/invoice_settings.blade.php +++ b/resources/views/accounts/invoice_settings.blade.php @@ -330,7 +330,7 @@

    {!! trans('texts.defaults') !!}

    -
    +
    @@ -347,32 +352,36 @@
    {!! Former::textarea('invoice_terms') ->label(trans('texts.default_invoice_terms')) - ->rows(4) !!} + ->rows(8) + ->raw() !!}
    {!! Former::textarea('quote_terms') ->label(trans('texts.default_quote_terms')) - ->rows(4) !!} + ->rows(8) + ->raw() !!}
    @if ($account->hasFeature(FEATURE_DOCUMENTS))
    - -
    +