From 34cf1c368d4d6cb17be2c6ae31674298a2e7c87f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Mon, 20 Jan 2020 10:34:10 +0300 Subject: [PATCH] Report edit and fields input name and edit fields fixed --- resources/views/common/reports/edit.blade.php | 35 +++++++++++++------ .../views/partials/reports/fields.blade.php | 8 ++--- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/resources/views/common/reports/edit.blade.php b/resources/views/common/reports/edit.blade.php index 5ef6ea18f..487148b92 100644 --- a/resources/views/common/reports/edit.blade.php +++ b/resources/views/common/reports/edit.blade.php @@ -19,23 +19,42 @@
{{ Form::textGroup('name', trans('general.name'), 'font') }} - {{ Form::selectGroup('class', trans_choice('general.types', 1), 'bars', $classes, $report->class, ['required' => 'required', 'change' => 'onChangeClass']) }} + {{ Form::textGroup('class_disabled', trans_choice('general.types', 1), 'bars', ['required' => 'required', 'disabled' => 'disabled'], $classes[$report->class]) }} + {{ Form::hidden('class', $report->class) }} {{ Form::textareaGroup('description', trans('general.description'), null, null, ['rows' => '3', 'required' => 'required']) }} + {{ Form::hidden('report', 'invalid', ['data-field' => 'settings']) }} + @foreach($class->getFields() 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']) }} + {{ Form::$type($field['name'], $field['title'], $field['icon'], array_merge([ + 'data-field' => 'settings' + ], + $field['attributes']) + ) }} @elseif ($type == 'textareaGroup') - {{ Form::$type('settings[' . $field['name'] . ']', $field['title']) }} + {{ Form::$type($field['name'], $field['title']) }} @elseif ($type == 'selectGroup') - {{ Form::$type('settings[' . $field['name'] . ']', $field['title'], $field['icon'], $field['values'], $report->settings->{$field['name']}, $field['attributes']) }} + {{ Form::$type($field['name'], $field['title'], $field['icon'], $field['values'], $report->settings->{$field['name']}, array_merge([ + 'data-field' => 'settings' + ], + $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']) }} + {{ Form::$type($field['name'], $field['title'], isset($report->settings->{$field['name']}) ? $report->settings->{$field['name']} : 1, $field['enable'], $field['disable'], array_merge([ + 'data-field' => 'settings' + ], + $field['attributes']) + ) }} @elseif ($type == 'checkboxGroup') - {{ Form::$type('settings[' . $field['name'] . ']', $field['title'], $field['items'], $report->settings->{$field['name']}, $field['id'], $field['attributes']) }} + {{ Form::$type($field['name'], $field['title'], $field['items'], $report->settings->{$field['name']}, $field['id'], array_merge([ + 'data-field' => 'settings' + ], + $field['attributes']) + ) }} @endif @endforeach
@@ -51,9 +70,5 @@ @endsection @push('scripts_start') - - @endpush diff --git a/resources/views/partials/reports/fields.blade.php b/resources/views/partials/reports/fields.blade.php index a83a080c3..440793ec7 100644 --- a/resources/views/partials/reports/fields.blade.php +++ b/resources/views/partials/reports/fields.blade.php @@ -2,13 +2,13 @@ @php $type = $field['type']; @endphp @if (($type == 'textGroup') || ($type == 'emailGroup') || ($type == 'passwordGroup')) - {{ Form::$type('settings[' . $field['name'] . ']', $field['title'], $field['icon'], array_merge([ + {{ Form::$type($field['name'], $field['title'], $field['icon'], array_merge([ 'data-field' => 'settings' ], $field['attributes']) ) }} @elseif ($type == 'textareaGroup') - {{ Form::$type('settings[' . $field['name'] . ']', $field['title']) }} + {{ Form::$type($field['name'], $field['title']) }} @elseif ($type == 'selectGroup') {{ Form::$type($field['name'], $field['title'], $field['icon'], $field['values'], $field['selected'], array_merge([ 'data-field' => 'settings' @@ -16,13 +16,13 @@ $field['attributes']) ) }} @elseif ($type == 'radioGroup') - {{ Form::$type('settings[' . $field['name'] . ']', $field['title'], 1, $field['enable'], $field['disable'], array_merge([ + {{ Form::$type($field['name'], $field['title'], 1, $field['enable'], $field['disable'], array_merge([ 'data-field' => 'settings' ], $field['attributes']) ) }} @elseif ($type == 'checkboxGroup') - {{ Form::$type('settings[' . $field['name'] . ']', $field['title'], $field['items'], $field['value'], $field['id'], array_merge([ + {{ Form::$type($field['name'], $field['title'], $field['items'], $field['value'], $field['id'], array_merge([ 'data-field' => 'settings' ], $field['attributes'])