report fields
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true
|
||||
'novalidate' => true,
|
||||
]) !!}
|
||||
|
||||
<div class="card-body">
|
||||
@@ -22,13 +22,7 @@
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description'), null, null, ['rows' => '3', 'required' => 'required']) }}
|
||||
|
||||
{{ Form::selectGroup('group', trans('general.group_by'), 'folder', $groups, 'category') }}
|
||||
|
||||
{{ Form::selectGroup('period', trans('general.period'), 'calendar', $periods, 'yearly') }}
|
||||
|
||||
{{ Form::selectGroup('basis', trans('general.basis'), 'file', $basises, 'accrual') }}
|
||||
|
||||
{{ Form::selectGroup('chart', trans_choice('general.charts', 1), 'chart-pie', $charts, 'line') }}
|
||||
<component v-bind:is="report_fields"></component>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true
|
||||
'novalidate' => true,
|
||||
]) !!}
|
||||
|
||||
<div class="card-body">
|
||||
@@ -23,13 +23,21 @@
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description'), null, null, ['rows' => '3', 'required' => 'required']) }}
|
||||
|
||||
{{ Form::selectGroup('group', trans('general.group_by'), 'folder', $groups, $report->group) }}
|
||||
@foreach($class->getFields() as $field)
|
||||
@php $type = $field['type']; @endphp
|
||||
|
||||
{{ Form::selectGroup('period', trans('general.period'), 'calendar', $periods, $report->period) }}
|
||||
|
||||
{{ Form::selectGroup('basis', trans('general.basis'), 'file', $basises, $report->basis) }}
|
||||
|
||||
{{ Form::selectGroup('chart', trans_choice('general.charts', 1), 'chart-pie', $charts, $report->chart) }}
|
||||
@if (($type == 'textGroup') || ($type == 'emailGroup') || ($type == 'passwordGroup'))
|
||||
{{ Form::$type('settings[' . $field['name'] . ']', $field['title'], $field['icon'], $field['attributes']) }}
|
||||
@elseif ($type == 'textareaGroup')
|
||||
{{ Form::$type('settings[' . $field['name'] . ']', $field['title']) }}
|
||||
@elseif ($type == 'selectGroup')
|
||||
{{ Form::$type('settings[' . $field['name'] . ']', $field['title'], $field['icon'], $field['values'], $report->settings->{$field['name']}, $field['attributes']) }}
|
||||
@elseif ($type == 'radioGroup')
|
||||
{{ Form::$type('settings[' . $field['name'] . ']', $field['title'], isset($report->settings->{$field['name']}) ? $report->settings->{$field['name']} : 1, $field['enable'], $field['disable'], $field['attributes']) }}
|
||||
@elseif ($type == 'checkboxGroup')
|
||||
{{ Form::$type('settings[' . $field['name'] . ']', $field['title'], $field['items'], $report->settings->{$field['name']}, $field['id'], $field['attributes']) }}
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
15
resources/views/partials/reports/fields.blade.php
Normal file
15
resources/views/partials/reports/fields.blade.php
Normal file
@@ -0,0 +1,15 @@
|
||||
@foreach($fields as $field)
|
||||
@php $type = $field['type']; @endphp
|
||||
|
||||
@if (($type == 'textGroup') || ($type == 'emailGroup') || ($type == 'passwordGroup'))
|
||||
{{ Form::$type('settings[' . $field['name'] . ']', $field['title'], $field['icon'], $field['attributes']) }}
|
||||
@elseif ($type == 'textareaGroup')
|
||||
{{ Form::$type('settings[' . $field['name'] . ']', $field['title']) }}
|
||||
@elseif ($type == 'selectGroup')
|
||||
{{ Form::$type('settings[' . $field['name'] . ']', $field['title'], $field['icon'], $field['values'], $field['selected'], $field['attributes']) }}
|
||||
@elseif ($type == 'radioGroup')
|
||||
{{ Form::$type('settings[' . $field['name'] . ']', $field['title'], 1, $field['enable'], $field['disable'], $field['attributes']) }}
|
||||
@elseif ($type == 'checkboxGroup')
|
||||
{{ Form::$type('settings[' . $field['name'] . ']', $field['title'], $field['items'], $field['value'], $field['id'], $field['attributes']) }}
|
||||
@endif
|
||||
@endforeach
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="card-header">
|
||||
{!! Form::open([
|
||||
'url' => 'common/reports/' . $class->report->id,
|
||||
'url' => 'common/reports/' . $class->model->id,
|
||||
'role' => 'form',
|
||||
'method' => 'GET',
|
||||
]) !!}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@section('title', $class->report->name)
|
||||
@section('title', $class->model->name)
|
||||
|
||||
@section('new_button')
|
||||
<span>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
@extends('layouts.print')
|
||||
|
||||
@section('title', $class->report->name)
|
||||
@section('title', $class->model->name)
|
||||
|
||||
@section('content')
|
||||
@if($class->report->chart)
|
||||
@if($class->model->settings->chart)
|
||||
@include($class->views['chart'])
|
||||
@endif
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="card">
|
||||
@include($class->views['filter'])
|
||||
|
||||
@if($class->report->chart)
|
||||
@if(!empty($class->model->settings->chart))
|
||||
@include($class->views['chart'])
|
||||
@endif
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
@if ($table == 'default')
|
||||
<th>{{ $class->groups[$class->report->group] }}</th>
|
||||
@if (($table == 'default') && !empty($class->groups))
|
||||
<th>{{ $class->groups[$class->model->settings->group] }}</th>
|
||||
@else
|
||||
<th>{{ $table }}</th>
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user