mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 16:04:32 -04:00
Fix for report checkboxes
This commit is contained in:
parent
bb590830cf
commit
6cd1e2ebb3
@ -62,8 +62,8 @@ class ReportController extends BaseController
|
|||||||
$dateField = Input::get('date_field');
|
$dateField = Input::get('date_field');
|
||||||
$startDate = Utils::toSqlDate(Input::get('start_date'), false);
|
$startDate = Utils::toSqlDate(Input::get('start_date'), false);
|
||||||
$endDate = Utils::toSqlDate(Input::get('end_date'), false);
|
$endDate = Utils::toSqlDate(Input::get('end_date'), false);
|
||||||
$enableReport = Input::get('enable_report') ? true : false;
|
$enableReport = boolval(Input::get('enable_report'));
|
||||||
$enableChart = Input::get('enable_chart') ? true : false;
|
$enableChart = boolval(Input::get('enable_chart'));
|
||||||
} else {
|
} else {
|
||||||
$groupBy = 'MONTH';
|
$groupBy = 'MONTH';
|
||||||
$chartType = 'Bar';
|
$chartType = 'Bar';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
@section('head')
|
@section('head')
|
||||||
@parent
|
@parent
|
||||||
|
|
||||||
<script src="{!! asset('js/Chart.js') !!}" type="text/javascript"></script>
|
<script src="{!! asset('js/Chart.js') !!}" type="text/javascript"></script>
|
||||||
@stop
|
@stop
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@ -11,7 +11,7 @@
|
|||||||
@include('accounts.nav', ['selected' => ACCOUNT_CHARTS_AND_REPORTS, 'advanced' => true])
|
@include('accounts.nav', ['selected' => ACCOUNT_CHARTS_AND_REPORTS, 'advanced' => true])
|
||||||
|
|
||||||
|
|
||||||
{!! Former::open()->rules(['start_date' => 'required', 'end_date' => 'required'])->addClass('warn-on-exit') !!}
|
{!! Former::open()->rules(['start_date' => 'required', 'end_date' => 'required'])->addClass('warn-on-exit') !!}
|
||||||
|
|
||||||
<div style="display:none">
|
<div style="display:none">
|
||||||
{!! Former::text('action') !!}
|
{!! Former::text('action') !!}
|
||||||
@ -19,16 +19,14 @@
|
|||||||
|
|
||||||
{!! Former::populateField('start_date', $startDate) !!}
|
{!! Former::populateField('start_date', $startDate) !!}
|
||||||
{!! Former::populateField('end_date', $endDate) !!}
|
{!! Former::populateField('end_date', $endDate) !!}
|
||||||
{!! Former::populateField('enable_report', intval($enableReport)) !!}
|
|
||||||
{!! Former::populateField('enable_chart', intval($enableChart)) !!}
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h3 class="panel-title">{!! trans('texts.report_settings') !!}</h3>
|
<h3 class="panel-title">{!! trans('texts.report_settings') !!}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
|
||||||
@ -40,23 +38,23 @@
|
|||||||
->append('<i class="glyphicon glyphicon-calendar" onclick="toggleDatePicker(\'end_date\')"></i>') !!}
|
->append('<i class="glyphicon glyphicon-calendar" onclick="toggleDatePicker(\'end_date\')"></i>') !!}
|
||||||
|
|
||||||
<p> </p>
|
<p> </p>
|
||||||
{!! Former::actions(
|
{!! Former::actions(
|
||||||
Button::primary(trans('texts.export'))->withAttributes(array('onclick' => 'onExportClick()'))->appendIcon(Icon::create('export')),
|
Button::primary(trans('texts.export'))->withAttributes(array('onclick' => 'onExportClick()'))->appendIcon(Icon::create('export')),
|
||||||
Button::success(trans('texts.run'))->withAttributes(array('id' => 'submitButton'))->submit()->appendIcon(Icon::create('play'))
|
Button::success(trans('texts.run'))->withAttributes(array('id' => 'submitButton'))->submit()->appendIcon(Icon::create('play'))
|
||||||
) !!}
|
) !!}
|
||||||
|
|
||||||
@if (!Auth::user()->hasFeature(FEATURE_REPORTS))
|
@if (!Auth::user()->hasFeature(FEATURE_REPORTS))
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
$('form.warn-on-exit').find('input, button').prop('disabled', true);
|
$('form.warn-on-exit').find('input, button').prop('disabled', true);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
{!! Former::checkbox('enable_report')->text(trans('texts.enable')) !!}
|
{!! Former::checkbox('enable_report')->text(trans('texts.enable'))->check($enableReport)->forceValue(1) !!}
|
||||||
{!! Former::select('report_type')->options($reportTypes, $reportType)->label(trans('texts.type')) !!}
|
{!! Former::select('report_type')->options($reportTypes, $reportType)->label(trans('texts.type')) !!}
|
||||||
<div id="dateField" style="display:{{ $reportType == ENTITY_TAX_RATE ? 'block' : 'none' }}">
|
<div id="dateField" style="display:{{ $reportType == ENTITY_TAX_RATE ? 'block' : 'none' }}">
|
||||||
{!! Former::select('date_field')->label(trans('texts.filter'))
|
{!! Former::select('date_field')->label(trans('texts.filter'))
|
||||||
@ -64,11 +62,11 @@
|
|||||||
->addOption(trans('texts.payment_date'), FILTER_PAYMENT_DATE) !!}
|
->addOption(trans('texts.payment_date'), FILTER_PAYMENT_DATE) !!}
|
||||||
</div>
|
</div>
|
||||||
<p> </p>
|
<p> </p>
|
||||||
{!! Former::checkbox('enable_chart')->text(trans('texts.enable')) !!}
|
{!! Former::checkbox('enable_chart')->text(trans('texts.enable'))->check($enableChart)->forceValue(1) !!}
|
||||||
{!! Former::select('group_by')->options($dateTypes, $groupBy) !!}
|
{!! Former::select('group_by')->options($dateTypes, $groupBy) !!}
|
||||||
{!! Former::select('chart_type')->options($chartTypes, $chartType) !!}
|
{!! Former::select('chart_type')->options($chartTypes, $chartType) !!}
|
||||||
|
|
||||||
|
|
||||||
{!! Former::close() !!}
|
{!! Former::close() !!}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -79,9 +77,9 @@
|
|||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<table class="table table-striped invoice-table">
|
<table class="table table-striped invoice-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@foreach ($columns as $column)
|
@foreach ($columns as $column)
|
||||||
<th>{{ trans("texts.{$column}") }}</th>
|
<th>{{ trans("texts.{$column}") }}</th>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tr>
|
</tr>
|
||||||
@ -140,7 +138,7 @@
|
|||||||
<div style="padding-bottom:8px">
|
<div style="padding-bottom:8px">
|
||||||
<div style="float:left; height:22px; width:60px; background-color:rgba(78,205,196,.5); border: 1px solid rgba(78,205,196,1)"></div>
|
<div style="float:left; height:22px; width:60px; background-color:rgba(78,205,196,.5); border: 1px solid rgba(78,205,196,1)"></div>
|
||||||
<div style="vertical-align: middle"> Invoices</div>
|
<div style="vertical-align: middle"> Invoices</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="padding-bottom:8px; clear:both">
|
<div style="padding-bottom:8px; clear:both">
|
||||||
<div style="float:left; height:22px; width:60px; background-color:rgba(255,107,107,.5); border: 1px solid rgba(255,107,107,1)"></div>
|
<div style="float:left; height:22px; width:60px; background-color:rgba(255,107,107,.5); border: 1px solid rgba(255,107,107,1)"></div>
|
||||||
<div style="vertical-align: middle"> Payments</div>
|
<div style="vertical-align: middle"> Payments</div>
|
||||||
@ -161,7 +159,7 @@
|
|||||||
function onExportClick() {
|
function onExportClick() {
|
||||||
$('#action').val('export');
|
$('#action').val('export');
|
||||||
$('#submitButton').click();
|
$('#submitButton').click();
|
||||||
$('#action').val('');
|
$('#action').val('');
|
||||||
}
|
}
|
||||||
|
|
||||||
@if ($enableChart)
|
@if ($enableChart)
|
||||||
@ -179,7 +177,7 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
var options = {
|
var options = {
|
||||||
scaleOverride: true,
|
scaleOverride: true,
|
||||||
scaleSteps: 10,
|
scaleSteps: 10,
|
||||||
scaleStepWidth: {!! $scaleStepWidth !!},
|
scaleStepWidth: {!! $scaleStepWidth !!},
|
||||||
@ -222,4 +220,4 @@
|
|||||||
keyboardNavigation: false
|
keyboardNavigation: false
|
||||||
});
|
});
|
||||||
|
|
||||||
@stop
|
@stop
|
||||||
|
Loading…
x
Reference in New Issue
Block a user