diff --git a/app/Ninja/Presenters/EntityPresenter.php b/app/Ninja/Presenters/EntityPresenter.php index 5ea6a7384c2a..72e1f430ce0f 100644 --- a/app/Ninja/Presenters/EntityPresenter.php +++ b/app/Ninja/Presenters/EntityPresenter.php @@ -29,7 +29,7 @@ class EntityPresenter extends Presenter return $this->url() . '/edit'; } - public function statusLabel() + public function statusLabel($label = false) { $class = $text = ''; @@ -41,7 +41,7 @@ class EntityPresenter extends Presenter $label = trans('texts.archived'); } else { $class = $this->entity->statusClass(); - $label = $this->entity->statusLabel(); + $label = $label ?: $this->entity->statusLabel(); } return "{$label}"; diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 8ca03297ce5a..4dad536f445c 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2345,6 +2345,7 @@ $LANG = array( 'statement' => 'Statement', 'statement_date' => 'Statement Date', 'inactivity_logout' => 'Due to inactivity, you have been automatically logged out.', + 'mark_active' => 'Mark Active', ); diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index 3a41a4652f8b..c237427cf18d 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -51,7 +51,11 @@
  • {!! link_to(($entityType == ENTITY_QUOTE ? 'quotes' : 'invoices'), trans('texts.' . ($entityType == ENTITY_QUOTE ? 'quotes' : 'invoices'))) !!}
  • {{ $invoice->invoice_number }}
  • @endif - {!! $invoice->present()->statusLabel !!} + @if ($invoice->is_recurring && $invoice->isSent() && (! $invoice->last_sent_date || $invoice->last_sent_date == '0000-00-00')) + {!! $invoice->present()->statusLabel(trans('texts.active')) !!} + @else + {!! $invoice->present()->statusLabel !!} + @endif @endif @@ -559,7 +563,7 @@ {!! Button::success(trans("texts.save_{$entityType}"))->withAttributes(array('id' => 'saveButton', 'onclick' => 'onSaveClick()'))->appendIcon(Icon::create('floppy-disk')) !!} @else {!! Button::normal(trans("texts.save_draft"))->withAttributes(array('id' => 'draftButton', 'onclick' => 'onSaveDraftClick()'))->appendIcon(Icon::create('floppy-disk')) !!} - {!! Button::success(trans("texts.mark_sent"))->withAttributes(array('id' => 'saveButton', 'onclick' => 'onMarkSentClick()'))->appendIcon(Icon::create('globe')) !!} + {!! Button::success(trans($invoice->is_recurring ? "texts.mark_active" : "texts.mark_sent"))->withAttributes(array('id' => 'saveButton', 'onclick' => 'onMarkSentClick()'))->appendIcon(Icon::create('globe')) !!} @endif {!! Button::info(trans("texts.email_{$entityType}"))->withAttributes(array('id' => 'emailButton', 'onclick' => 'onEmailClick()'))->appendIcon(Icon::create('send')) !!} @if (!$invoice->trashed()) @@ -1246,13 +1250,16 @@ var invoice = model.invoice(); if (invoice.is_recurring()) { var recurring = false; - var label = "{{ trans('texts.enable_recurring')}}"; + var enableLabel = "{{ trans('texts.enable_recurring')}}"; + var actionLabel = "{{ trans('texts.mark_sent') }}"; } else { var recurring = true; - var label = "{{ trans('texts.disable_recurring')}}"; + var enableLabel = "{{ trans('texts.disable_recurring')}}"; + var actionLabel = "{{ trans('texts.mark_active') }}"; } invoice.is_recurring(recurring); - $('#recurrButton').html(label + ""); + $('#recurrButton').html(enableLabel + ""); + $('#saveButton').html(actionLabel + ""); } function onEmailClick() {