close #596 Fixed: Settings Invoice logo attachment is passive
This commit is contained in:
parent
e97c305d79
commit
2da5ad838c
@ -252,39 +252,50 @@
|
|||||||
});
|
});
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
$('#invoice_logo').fancyfile({
|
var invoice_file = false;
|
||||||
text : '{{ trans('general.form.select.file') }}',
|
|
||||||
style : 'btn-default',
|
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
|
||||||
@if($setting['invoice_logo'])
|
var target = $(e.target).attr("href");
|
||||||
placeholder : '{{ $setting['invoice_logo']->basename }}',
|
|
||||||
@else
|
if (target == '#invoice' && !invoice_file) {
|
||||||
placeholder : '{{ trans('general.form.no_file_selected') }}',
|
$(target + ' #invoice_logo').fancyfile({
|
||||||
@endif
|
text : '{{ trans('general.form.select.file') }}',
|
||||||
|
style : 'btn-default',
|
||||||
|
@if($setting['invoice_logo'])
|
||||||
|
placeholder : '{{ $setting['invoice_logo']->basename }}',
|
||||||
|
@else
|
||||||
|
placeholder : '{{ trans('general.form.no_file_selected') }}',
|
||||||
|
@endif
|
||||||
|
});
|
||||||
|
|
||||||
|
@if($setting['invoice_logo'])
|
||||||
|
invoice_logo_html = '<span class="invoice_logo">';
|
||||||
|
invoice_logo_html += ' <a href="{{ url('uploads/' . $setting['invoice_logo']->id . '/download') }}">';
|
||||||
|
invoice_logo_html += ' <span id="download-invoice_logo" class="text-primary">';
|
||||||
|
invoice_logo_html += ' <i class="fa fa-file-{{ $setting['invoice_logo']->aggregate_type }}-o"></i> {{ $setting['invoice_logo']->basename }}';
|
||||||
|
invoice_logo_html += ' </span>';
|
||||||
|
invoice_logo_html += ' </a>';
|
||||||
|
invoice_logo_html += ' {!! Form::open(['id' => 'invoice_logo-' . $setting['invoice_logo']->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $setting['invoice_logo']->id)], 'style' => 'display:inline']) !!}';
|
||||||
|
invoice_logo_html += ' <a id="remove-invoice_logo" href="javascript:void();">';
|
||||||
|
invoice_logo_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
|
||||||
|
invoice_logo_html += ' </a>';
|
||||||
|
invoice_logo_html += ' <input type="hidden" name="page" value="setting" />';
|
||||||
|
invoice_logo_html += ' <input type="hidden" name="key" value="general.invoice_logo" />';
|
||||||
|
invoice_logo_html += ' <input type="hidden" name="value" value="{{ $setting['invoice_logo']->id }}" />';
|
||||||
|
invoice_logo_html += ' {!! Form::close() !!}';
|
||||||
|
invoice_logo_html += '</span>';
|
||||||
|
|
||||||
|
$(target + ' .fancy-file .fake-file').append(invoice_logo_html);
|
||||||
|
|
||||||
|
$(document).on('click', '#remove-invoice_logo', function (e) {
|
||||||
|
confirmDelete("#invoice_logo-{!! $setting['invoice_logo']->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $setting['invoice_logo']->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||||
|
});
|
||||||
|
@endif
|
||||||
|
|
||||||
|
invoice_file = true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@if($setting['invoice_logo'])
|
|
||||||
invoice_logo_html = '<span class="invoice_logo">';
|
|
||||||
invoice_logo_html += ' <a href="{{ url('uploads/' . $setting['invoice_logo']->id . '/download') }}">';
|
|
||||||
invoice_logo_html += ' <span id="download-invoice_logo" class="text-primary">';
|
|
||||||
invoice_logo_html += ' <i class="fa fa-file-{{ $setting['invoice_logo']->aggregate_type }}-o"></i> {{ $setting['invoice_logo']->basename }}';
|
|
||||||
invoice_logo_html += ' </span>';
|
|
||||||
invoice_logo_html += ' </a>';
|
|
||||||
invoice_logo_html += ' {!! Form::open(['id' => 'invoice_logo-' . $setting['invoice_logo']->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $setting['invoice_logo']->id)], 'style' => 'display:inline']) !!}';
|
|
||||||
invoice_logo_html += ' <a id="remove-invoice_logo" href="javascript:void();">';
|
|
||||||
invoice_logo_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
|
|
||||||
invoice_logo_html += ' </a>';
|
|
||||||
invoice_logo_html += ' <input type="hidden" name="page" value="setting" />';
|
|
||||||
invoice_logo_html += ' <input type="hidden" name="key" value="general.invoice_logo" />';
|
|
||||||
invoice_logo_html += ' <input type="hidden" name="value" value="{{ $setting['invoice_logo']->id }}" />';
|
|
||||||
invoice_logo_html += ' {!! Form::close() !!}';
|
|
||||||
invoice_logo_html += '</span>';
|
|
||||||
|
|
||||||
$('#invoice .fancy-file .fake-file').append(invoice_logo_html);
|
|
||||||
|
|
||||||
$(document).on('click', '#remove-invoice_logo', function (e) {
|
|
||||||
confirmDelete("#invoice_logo-{!! $setting['invoice_logo']->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $setting['invoice_logo']->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
|
||||||
});
|
|
||||||
@endif
|
|
||||||
$("select[name='email_protocol']").on('change', function() {
|
$("select[name='email_protocol']").on('change', function() {
|
||||||
var selection = $(this).val();
|
var selection = $(this).val();
|
||||||
|
|
||||||
@ -295,16 +306,14 @@
|
|||||||
$("input[name='email_smtp_password']").prop('disabled', true);
|
$("input[name='email_smtp_password']").prop('disabled', true);
|
||||||
$("input[name='email_smtp_port']").prop('disabled', true);
|
$("input[name='email_smtp_port']").prop('disabled', true);
|
||||||
$("select[name='email_smtp_encryption']").prop('disabled', true);
|
$("select[name='email_smtp_encryption']").prop('disabled', true);
|
||||||
}
|
} else if(selection == 'sendmail') {
|
||||||
else if(selection == 'sendmail') {
|
|
||||||
$("input[name='email_sendmail_path']").prop('disabled', false);
|
$("input[name='email_sendmail_path']").prop('disabled', false);
|
||||||
$("input[name='email_smtp_host']").prop('disabled', true);
|
$("input[name='email_smtp_host']").prop('disabled', true);
|
||||||
$("input[name='email_smtp_username']").prop('disabled', true);
|
$("input[name='email_smtp_username']").prop('disabled', true);
|
||||||
$("input[name='email_smtp_password']").prop('disabled', true);
|
$("input[name='email_smtp_password']").prop('disabled', true);
|
||||||
$("input[name='email_smtp_port']").prop('disabled', true);
|
$("input[name='email_smtp_port']").prop('disabled', true);
|
||||||
$("select[name='email_smtp_encryption']").prop('disabled', true);
|
$("select[name='email_smtp_encryption']").prop('disabled', true);
|
||||||
}
|
} else if (selection == 'smtp') {
|
||||||
else if (selection == 'smtp') {
|
|
||||||
$("input[name='email_sendmail_path']").prop('disabled', true);
|
$("input[name='email_sendmail_path']").prop('disabled', true);
|
||||||
$("input[name='email_smtp_host']").prop('disabled', false);
|
$("input[name='email_smtp_host']").prop('disabled', false);
|
||||||
$("input[name='email_smtp_username']").prop('disabled', false);
|
$("input[name='email_smtp_username']").prop('disabled', false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user