added date picker #681
This commit is contained in:
30
app/Listeners/Updates/Version135.php
Normal file
30
app/Listeners/Updates/Version135.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Listeners\Updates;
|
||||||
|
|
||||||
|
use App\Events\UpdateFinished;
|
||||||
|
|
||||||
|
class Version135 extends Listener
|
||||||
|
{
|
||||||
|
const ALIAS = 'core';
|
||||||
|
|
||||||
|
const VERSION = '1.3.5';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle the event.
|
||||||
|
*
|
||||||
|
* @param $event
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function handle(UpdateFinished $event)
|
||||||
|
{
|
||||||
|
// Check if should listen
|
||||||
|
if (!$this->check($event)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add financial year start to settings
|
||||||
|
setting(['general.financial_start' => Date::now()->startOfYear()->format('d F')]);
|
||||||
|
setting()->save();
|
||||||
|
}
|
||||||
|
}
|
@ -28,10 +28,10 @@ class Settings extends Seeder
|
|||||||
$company_id = $this->command->argument('company');
|
$company_id = $this->command->argument('company');
|
||||||
|
|
||||||
Setting::set([
|
Setting::set([
|
||||||
'general.date_format' => 'd M Y',
|
|
||||||
'general.financial_start' => Date::now()->startOfYear()->format('d F'),
|
'general.financial_start' => Date::now()->startOfYear()->format('d F'),
|
||||||
'general.date_separator' => 'space',
|
|
||||||
'general.timezone' => 'Europe/London',
|
'general.timezone' => 'Europe/London',
|
||||||
|
'general.date_format' => 'd M Y',
|
||||||
|
'general.date_separator' => 'space',
|
||||||
'general.percent_position' => 'after',
|
'general.percent_position' => 'after',
|
||||||
'general.invoice_number_prefix' => 'INV-',
|
'general.invoice_number_prefix' => 'INV-',
|
||||||
'general.invoice_number_digit' => '5',
|
'general.invoice_number_digit' => '5',
|
||||||
|
@ -11,17 +11,17 @@ return [
|
|||||||
],
|
],
|
||||||
'localisation' => [
|
'localisation' => [
|
||||||
'tab' => 'Localisation',
|
'tab' => 'Localisation',
|
||||||
'date' => [
|
'financial_start' => 'Financial Year Start',
|
||||||
'format' => 'Date Format',
|
|
||||||
'financial_start' => 'Financial year start',
|
|
||||||
'separator' => 'Date Separator',
|
|
||||||
'dash' => 'Dash (-)',
|
|
||||||
'dot' => 'Dot (.)',
|
|
||||||
'comma' => 'Comma (,)',
|
|
||||||
'slash' => 'Slash (/)',
|
|
||||||
'space' => 'Space ( )',
|
|
||||||
],
|
|
||||||
'timezone' => 'Time Zone',
|
'timezone' => 'Time Zone',
|
||||||
|
'date' => [
|
||||||
|
'format' => 'Date Format',
|
||||||
|
'separator' => 'Date Separator',
|
||||||
|
'dash' => 'Dash (-)',
|
||||||
|
'dot' => 'Dot (.)',
|
||||||
|
'comma' => 'Comma (,)',
|
||||||
|
'slash' => 'Slash (/)',
|
||||||
|
'space' => 'Space ( )',
|
||||||
|
],
|
||||||
'percent' => [
|
'percent' => [
|
||||||
'title' => 'Percent (%) Position',
|
'title' => 'Percent (%) Position',
|
||||||
'before' => 'Before Number',
|
'before' => 'Before Number',
|
||||||
|
@ -44,14 +44,15 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane tab-margin" id="localisation">
|
<div class="tab-pane tab-margin" id="localisation">
|
||||||
{{ Form::selectGroup('date_format', trans('settings.localisation.date.format'), 'calendar', $date_formats, null, ['autocomplete' => 'off']) }}
|
|
||||||
|
|
||||||
{{ Form::textGroup('financial_start', trans('settings.localisation.date.financial_start'), 'calendar-check-o', []) }}
|
|
||||||
|
|
||||||
{{ Form::selectGroup('date_separator', trans('settings.localisation.date.separator'), 'minus', $date_separators, null, []) }}
|
{{ Form::textGroup('financial_start', trans('settings.localisation.financial_start'), 'calendar-check-o', ['id' => 'financial_start', 'class' => 'form-control', 'data-inputmask' => '\'alias\': \'dd MM\'', 'data-mask' => '', 'autocomplete' => 'off']) }}
|
||||||
|
|
||||||
{{ Form::selectGroup('timezone', trans('settings.localisation.timezone'), 'globe', $timezones, null, []) }}
|
{{ Form::selectGroup('timezone', trans('settings.localisation.timezone'), 'globe', $timezones, null, []) }}
|
||||||
|
|
||||||
|
{{ Form::selectGroup('date_format', trans('settings.localisation.date.format'), 'calendar', $date_formats, null, ['autocomplete' => 'off']) }}
|
||||||
|
|
||||||
|
{{ Form::selectGroup('date_separator', trans('settings.localisation.date.separator'), 'minus', $date_separators, null, []) }}
|
||||||
|
|
||||||
{{ Form::selectGroup('percent_position', trans('settings.localisation.percent.title'), 'percent', $percent_positions, null, []) }}
|
{{ Form::selectGroup('percent_position', trans('settings.localisation.percent.title'), 'percent', $percent_positions, null, []) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -155,10 +156,15 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@push('js')
|
@push('js')
|
||||||
|
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
|
||||||
|
@if (language()->getShortCode() != 'en')
|
||||||
|
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
|
||||||
|
@endif
|
||||||
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
|
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@push('css')
|
@push('css')
|
||||||
|
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
|
||||||
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
|
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@ -222,6 +228,14 @@
|
|||||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans('settings.system.session.handler')]) }}"
|
placeholder: "{{ trans('general.form.select.field', ['field' => trans('settings.system.session.handler')]) }}"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#financial_start').datepicker({
|
||||||
|
format: 'dd MM',
|
||||||
|
todayBtn: 'linked',
|
||||||
|
weekStart: 1,
|
||||||
|
autoclose: true,
|
||||||
|
language: '{{ language()->getShortCode() }}'
|
||||||
|
});
|
||||||
|
|
||||||
$('#company_logo').fancyfile({
|
$('#company_logo').fancyfile({
|
||||||
text : '{{ trans('general.form.select.file') }}',
|
text : '{{ trans('general.form.select.file') }}',
|
||||||
style : 'btn-default',
|
style : 'btn-default',
|
||||||
|
Reference in New Issue
Block a user