1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Support editing reminders when they're not automatically sent

This commit is contained in:
Hillel Coren 2017-02-02 22:07:17 +02:00
parent 7f18b121ee
commit a33b088a93
4 changed files with 15 additions and 19 deletions

View File

@ -841,12 +841,9 @@ class AccountController extends BaseController
foreach ([REMINDER1, REMINDER2, REMINDER3] as $type) {
$enableField = "enable_{$type}";
$account->$enableField = Input::get($enableField) ? true : false;
if ($account->$enableField) {
$account->{"num_days_{$type}"} = Input::get("num_days_{$type}");
$account->{"field_{$type}"} = Input::get("field_{$type}");
$account->{"direction_{$type}"} = Input::get("field_{$type}") == REMINDER_FIELD_INVOICE_DATE ? REMINDER_DIRECTION_AFTER : Input::get("direction_{$type}");
}
$account->{"num_days_{$type}"} = Input::get("num_days_{$type}");
$account->{"field_{$type}"} = Input::get("field_{$type}");
$account->{"direction_{$type}"} = Input::get("field_{$type}") == REMINDER_FIELD_INVOICE_DATE ? REMINDER_DIRECTION_AFTER : Input::get("direction_{$type}");
}
$account->save();

View File

@ -864,8 +864,8 @@ $LANG = array(
'created_invoices' => 'Successfully created :count invoice(s)',
'next_invoice_number' => 'The next invoice number is :number.',
'next_quote_number' => 'The next quote number is :number.',
'days_before' => 'days before',
'days_after' => 'days after',
'days_before' => 'days before the',
'days_after' => 'days after the',
'field_due_date' => 'due date',
'field_invoice_date' => 'invoice date',
'schedule' => 'Schedule',
@ -2346,6 +2346,7 @@ $LANG = array(
'statement_date' => 'Statement Date',
'inactivity_logout' => 'Due to inactivity, you have been automatically logged out.',
'mark_active' => 'Mark Active',
'send_automatically' => 'Send Automatically',
);

View File

@ -4,13 +4,14 @@
{!! Former::populateField('enable_' . $field, intval($account->{'enable_' . $field})) !!}
<div class="row" style="padding-bottom:20px">
<div class="col-md-6">
<div class="row well" style="padding-bottom:20px">
<div class="col-md-4" style="padding-top:10px">
{!! Former::checkbox('enable_' . $field)
->text(trans('texts.enable'))->label('')
->text(trans('texts.send_automatically'))->label('')
->value(1) !!}
{!! Former::plaintext('schedule')
</div>
<div class="col-md-8">
{!! Former::plaintext('')
->value(
Former::input('num_days_' . $field)
->addClass('enable-' . $field)
@ -39,8 +40,7 @@
{!! Former::text('email_subject_' . $field)
->label(trans('texts.subject'))
->appendIcon('question-sign')
->addGroupClass('email-subject')
->addClass('enable-' . $field) !!}
->addGroupClass('email-subject') !!}
</div>
<div class="col-md-6">
<p>&nbsp;<p/>
@ -53,9 +53,8 @@
<div class="pull-right"><a href="#" onclick="return resetText('{{ 'template' }}', '{{ $field }}')">{{ trans("texts.reset") }}</a></div>
{!! Former::textarea('email_template_' . $field)
->label(trans('texts.body'))
->addClass('enable-' . $field)
->style('display:none') !!}
<div id="{{ $field }}Editor" class="form-control enable-{{ $field }}" style="min-height:160px">
<div id="{{ $field }}Editor" class="form-control" style="min-height:160px">
</div>
</div>
<div class="col-md-6">
@ -68,7 +67,7 @@
<div class="col-md-9 show-when-ready" style="display:none">
@include('partials/quill_toolbar', ['name' => $field])
</div>
<div class="col-md-3 pull-right" style="padding-top:10px">
<div class="col-md-3 pull-right" style="padding-top:10px;text-align:right">
{!! Button::normal(trans('texts.raw'))->withAttributes(['onclick' => 'showRaw("'.$field.'")'])->small() !!}
{!! Button::primary(trans('texts.preview'))->withAttributes(['onclick' => 'serverPreview("'.$field.'")'])->small() !!}
</div>

View File

@ -245,7 +245,6 @@
function enableReminder(id) {
var checked = $('#enable_reminder' + id).is(':checked');
$('.enable-reminder' + id).attr('disabled', !checked)
editors['reminder' + id].editor.enable(checked);
}
function setDirectionShown(field) {