report fields

This commit is contained in:
denisdulici
2020-01-16 15:39:37 +03:00
parent 7d3c7619d1
commit 893970ffae
23 changed files with 233 additions and 230 deletions

View File

@@ -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>

View File

@@ -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>

View 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

View File

@@ -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',
]) !!}

View File

@@ -1,4 +1,4 @@
@section('title', $class->report->name)
@section('title', $class->model->name)
@section('new_button')
<span>

View File

@@ -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

View File

@@ -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

View File

@@ -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