Compare commits
8 Commits
262b8003f4
...
Lang_funct
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
157a5a1939 | ||
|
|
a46ec03369 | ||
|
|
3485957da4 | ||
|
|
2d0d36af7e | ||
| 4cf46bd449 | |||
| 90ed266998 | |||
| ca3985a551 | |||
| 1bb5406b80 |
@@ -278,7 +278,7 @@ class HomeController extends Controller
|
|||||||
$forms = UserForm::join('forms', 'user_forms.form_id', '=', 'forms.id')
|
$forms = UserForm::join('forms', 'user_forms.form_id', '=', 'forms.id')
|
||||||
->leftJoin('users', 'forms.created_by', '=', 'users.id')
|
->leftJoin('users', 'forms.created_by', '=', 'users.id')
|
||||||
->where('user_forms.assigned_to', \Auth::id())
|
->where('user_forms.assigned_to', \Auth::id())
|
||||||
->select('user_forms.permissions as permissions', 'forms.name as name', 'forms.description as description', 'forms.id as form_id', 'forms.created_at as created_at', 'forms.slug as slug', 'users.name as created_by');
|
->select('user_forms.permissions as permissions', 'forms.name as name', 'forms.name_ru as name_ru', 'forms.name_est as name_est', 'forms.description as description', 'forms.description_ru as description_ru', 'forms.description_est as description_est', 'forms.id as form_id', 'forms.created_at as created_at', 'forms.slug as slug', 'users.name as created_by');
|
||||||
|
|
||||||
return DataTables::of($forms)
|
return DataTables::of($forms)
|
||||||
->addColumn(
|
->addColumn(
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -16,7 +16,8 @@
|
|||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#printSection, #printSection * {
|
#printSection,
|
||||||
|
#printSection * {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,11 +54,13 @@
|
|||||||
|
|
||||||
<form action="{{ @route('form-data.show', ['id' => $form->id]) }}" class="form row mt-3 mx-2 mb-0">
|
<form action="{{ @route('form-data.show', ['id' => $form->id]) }}" class="form row mt-3 mx-2 mb-0">
|
||||||
<div class="form-group mb-0 col-1">
|
<div class="form-group mb-0 col-1">
|
||||||
<input type="date" class="form-control" name="start_date" value="{{ request()->get('start_date') ?? \Carbon\Carbon::now()->subDays(7)->toDateString() }}">
|
<input type="date" class="form-control" name="start_date"
|
||||||
|
value="{{ request()->get('start_date') ?? \Carbon\Carbon::now()->subDays(7)->toDateString() }}">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group mb-0 col-1">
|
<div class="form-group mb-0 col-1">
|
||||||
<input type="date" class="form-control" name="end_date" value="{{ request()->get('end_date') ?? \Carbon\Carbon::now()->toDateString() }}">
|
<input type="date" class="form-control" name="end_date"
|
||||||
|
value="{{ request()->get('end_date') ?? \Carbon\Carbon::now()->toDateString() }}">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group mb-0 col-2 d-flex">
|
<div class="form-group mb-0 col-2 d-flex">
|
||||||
@@ -67,7 +70,10 @@
|
|||||||
|
|
||||||
@php
|
@php
|
||||||
$is_enabled_sub_ref_no = false;
|
$is_enabled_sub_ref_no = false;
|
||||||
if(isset($form->schema['settings']['form_submision_ref']['is_enabled']) && $form->schema['settings']['form_submision_ref']['is_enabled']) {
|
if (
|
||||||
|
isset($form->schema['settings']['form_submision_ref']['is_enabled']) &&
|
||||||
|
$form->schema['settings']['form_submision_ref']['is_enabled']
|
||||||
|
) {
|
||||||
$is_enabled_sub_ref_no = true;
|
$is_enabled_sub_ref_no = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,7 +99,12 @@
|
|||||||
@foreach ($schema as $element)
|
@foreach ($schema as $element)
|
||||||
@if (in_array($element['name'], $col_visible))
|
@if (in_array($element['name'], $col_visible))
|
||||||
<th>
|
<th>
|
||||||
|
{{-- $element['label'] --}}
|
||||||
|
@if (in_array(session()->get('locale'), ['ru', 'est']) && isset($element['label_' . session()->get('locale')]))
|
||||||
|
{{ $element['label_' . session()->get('locale')] }}
|
||||||
|
@else
|
||||||
{{ $element['label'] }}
|
{{ $element['label'] }}
|
||||||
|
@endif
|
||||||
</th>
|
</th>
|
||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -107,7 +118,8 @@
|
|||||||
@if (auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
|
@if (auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
|
||||||
<td>
|
<td>
|
||||||
@if (in_array('view', $btn_enabled))
|
@if (in_array('view', $btn_enabled))
|
||||||
<button type="button" class="btn btn-info btn-sm view_form_data m-1"
|
<button type="button"
|
||||||
|
class="btn btn-info btn-sm view_form_data m-1"
|
||||||
data-href="{{ action([\App\Http\Controllers\FormDataController::class, 'viewData'], [$row->id]) }}"
|
data-href="{{ action([\App\Http\Controllers\FormDataController::class, 'viewData'], [$row->id]) }}"
|
||||||
data-toggle="modal">
|
data-toggle="modal">
|
||||||
<i class="fa fa-eye" aria-hidden="true"></i>
|
<i class="fa fa-eye" aria-hidden="true"></i>
|
||||||
@@ -146,8 +158,10 @@
|
|||||||
<td>
|
<td>
|
||||||
@isset($row->data[$row_element['name']])
|
@isset($row->data[$row_element['name']])
|
||||||
@if ($row_element['type'] == 'file_upload')
|
@if ($row_element['type'] == 'file_upload')
|
||||||
|
@include('form_data.file_view', [
|
||||||
@include('form_data.file_view', ['form_upload' => $row->data[$row_element['name']]])
|
'form_upload' =>
|
||||||
|
$row->data[$row_element['name']],
|
||||||
|
])
|
||||||
@elseif($row_element['type'] == 'signature')
|
@elseif($row_element['type'] == 'signature')
|
||||||
@if (!empty($row->data[$row_element['name']]))
|
@if (!empty($row->data[$row_element['name']]))
|
||||||
<a target="_blank"
|
<a target="_blank"
|
||||||
@@ -162,7 +176,6 @@
|
|||||||
@else
|
@else
|
||||||
{!! nl2br($row->data[$row_element['name']]) !!}
|
{!! nl2br($row->data[$row_element['name']]) !!}
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@endisset
|
@endisset
|
||||||
</td>
|
</td>
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
@@ -23,7 +23,9 @@
|
|||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@if(isset($form_data->form->schema['settings']['form_submision_ref']['is_enabled']) && $form_data->form->schema['settings']['form_submision_ref']['is_enabled'] && !empty($form_data->submission_ref))
|
@if (isset($form_data->form->schema['settings']['form_submision_ref']['is_enabled']) &&
|
||||||
|
$form_data->form->schema['settings']['form_submision_ref']['is_enabled'] &&
|
||||||
|
!empty($form_data->submission_ref))
|
||||||
<b>@lang('messages.submission_numbering'):</b>
|
<b>@lang('messages.submission_numbering'):</b>
|
||||||
{{ $form_data->submission_ref }}
|
{{ $form_data->submission_ref }}
|
||||||
@endif
|
@endif
|
||||||
@@ -41,12 +43,19 @@
|
|||||||
@isset($form_data->data[$element['name']])
|
@isset($form_data->data[$element['name']])
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<strong>{{$element['label']}}</strong>
|
<strong>
|
||||||
|
@if (in_array(session()->get('locale'), ['ru', 'est']) && isset($element['label_' . session()->get('locale')]))
|
||||||
|
{{ $element['label_' . session()->get('locale')] }}
|
||||||
|
@else
|
||||||
|
{{ $element['label'] }}
|
||||||
|
@endif
|
||||||
|
</strong>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@if ($element['type'] == 'file_upload')
|
@if ($element['type'] == 'file_upload')
|
||||||
|
@include('form_data.file_view', [
|
||||||
@include('form_data.file_view', ['form_upload' => $form_data->data[$element['name']]])
|
'form_upload' => $form_data->data[$element['name']],
|
||||||
|
])
|
||||||
@elseif($element['type'] == 'signature')
|
@elseif($element['type'] == 'signature')
|
||||||
@if (!empty($form_data->data[$element['name']]))
|
@if (!empty($form_data->data[$element['name']]))
|
||||||
<a target="_blank" href="{{ $form_data->data[$element['name']] }}"
|
<a target="_blank" href="{{ $form_data->data[$element['name']] }}"
|
||||||
@@ -55,9 +64,7 @@
|
|||||||
</a>
|
</a>
|
||||||
@endif
|
@endif
|
||||||
@elseif(is_array($form_data->data[$element['name']]) && $element['type'] != 'file_upload')
|
@elseif(is_array($form_data->data[$element['name']]) && $element['type'] != 'file_upload')
|
||||||
|
|
||||||
{{ implode(', ', $form_data->data[$element['name']]) }}
|
{{ implode(', ', $form_data->data[$element['name']]) }}
|
||||||
|
|
||||||
@else
|
@else
|
||||||
{!! nl2br($form_data->data[$element['name']]) !!}
|
{!! nl2br($form_data->data[$element['name']]) !!}
|
||||||
@endif
|
@endif
|
||||||
@@ -69,7 +76,9 @@
|
|||||||
</table>
|
</table>
|
||||||
<div class="no-print mt-4">
|
<div class="no-print mt-4">
|
||||||
<hr>
|
<hr>
|
||||||
<form id="add_comment_form" action="{{action([\App\Http\Controllers\FormDataCommentController::class, 'store'])}}" method="POST">
|
<form id="add_comment_form"
|
||||||
|
action="{{ action([\App\Http\Controllers\FormDataCommentController::class, 'store']) }}"
|
||||||
|
method="POST">
|
||||||
{{ csrf_field() }}
|
{{ csrf_field() }}
|
||||||
<!-- hiden fields -->
|
<!-- hiden fields -->
|
||||||
<input type="hidden" name="form_data_id" id="form_data_id" value="{{ $form_data->id }}">
|
<input type="hidden" name="form_data_id" id="form_data_id" value="{{ $form_data->id }}">
|
||||||
@@ -104,7 +113,8 @@
|
|||||||
<i class="fas fa-print"></i>
|
<i class="fas fa-print"></i>
|
||||||
@lang('messages.print')
|
@lang('messages.print')
|
||||||
</button>
|
</button>
|
||||||
<a class="btn float-right btn-primary btn-sm m-1" target="_blank" href="{{action([\App\Http\Controllers\FormDataController::class, 'downloadPdf'], [$form_data->id])}}">
|
<a class="btn float-right btn-primary btn-sm m-1" target="_blank"
|
||||||
|
href="{{ action([\App\Http\Controllers\FormDataController::class, 'downloadPdf'], [$form_data->id]) }}">
|
||||||
<i class="far fa-file-pdf" aria-hidden="true"></i>
|
<i class="far fa-file-pdf" aria-hidden="true"></i>
|
||||||
@lang('messages.download_pdf')
|
@lang('messages.download_pdf')
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -141,9 +141,10 @@
|
|||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table" id="assigned_form_table" style="width: 100%;">
|
<table class="table" id="assigned_form_table" style="width: 100%;">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>@lang('messages.name')</th>
|
|
||||||
<th>@lang('messages.description')</th>
|
<th>@lang('messages.description')</th>
|
||||||
|
<th>@lang('messages.name')</th>
|
||||||
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||||
<th>@lang('messages.created_by')</th>
|
<th>@lang('messages.created_by')</th>
|
||||||
@endif
|
@endif
|
||||||
@@ -407,12 +408,22 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [{
|
columns: [{
|
||||||
data: 'name',
|
data: descColName,
|
||||||
name: 'forms.name'
|
name: 'forms.' + descColName,
|
||||||
|
createdCell: function(td, cellData, rowData, row, col) {
|
||||||
|
if (td.innerHTML.length === 0) {
|
||||||
|
td.innerHTML = rowData.description
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: 'description',
|
data: titleColName,
|
||||||
name: 'forms.description'
|
name: 'forms.' + titleColName,
|
||||||
|
createdCell: function(td, cellData, rowData, row, col) {
|
||||||
|
if (td.innerHTML.length === 0) {
|
||||||
|
td.innerHTML = rowData.name
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||||
{
|
{
|
||||||
@@ -427,6 +438,7 @@
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//form collaborate
|
//form collaborate
|
||||||
$(document).on('click', '.collab_btn', function() {
|
$(document).on('click', '.collab_btn', function() {
|
||||||
var url = $(this).data('href');
|
var url = $(this).data('href');
|
||||||
|
|||||||
Reference in New Issue
Block a user