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');
|
||||
|
||||
Setting::set([
|
||||
'general.date_format' => 'd M Y',
|
||||
'general.financial_start' => Date::now()->startOfYear()->format('d F'),
|
||||
'general.date_separator' => 'space',
|
||||
'general.timezone' => 'Europe/London',
|
||||
'general.date_format' => 'd M Y',
|
||||
'general.date_separator' => 'space',
|
||||
'general.percent_position' => 'after',
|
||||
'general.invoice_number_prefix' => 'INV-',
|
||||
'general.invoice_number_digit' => '5',
|
||||
|
@ -11,9 +11,10 @@ return [
|
||||
],
|
||||
'localisation' => [
|
||||
'tab' => 'Localisation',
|
||||
'financial_start' => 'Financial Year Start',
|
||||
'timezone' => 'Time Zone',
|
||||
'date' => [
|
||||
'format' => 'Date Format',
|
||||
'financial_start' => 'Financial year start',
|
||||
'separator' => 'Date Separator',
|
||||
'dash' => 'Dash (-)',
|
||||
'dot' => 'Dot (.)',
|
||||
@ -21,7 +22,6 @@ return [
|
||||
'slash' => 'Slash (/)',
|
||||
'space' => 'Space ( )',
|
||||
],
|
||||
'timezone' => 'Time Zone',
|
||||
'percent' => [
|
||||
'title' => 'Percent (%) Position',
|
||||
'before' => 'Before Number',
|
||||
|
@ -44,14 +44,15 @@
|
||||
</div>
|
||||
|
||||
<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('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, []) }}
|
||||
</div>
|
||||
|
||||
@ -155,10 +156,15 @@
|
||||
@endsection
|
||||
|
||||
@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>
|
||||
@endpush
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
|
||||
@endpush
|
||||
|
||||
@ -222,6 +228,14 @@
|
||||
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({
|
||||
text : '{{ trans('general.form.select.file') }}',
|
||||
style : 'btn-default',
|
||||
|
Reference in New Issue
Block a user