update_21.09.23
This commit is contained in:
2
resources/js/app.js
vendored
2
resources/js/app.js
vendored
@@ -82,4 +82,4 @@ $('body').tooltip({
|
||||
|
||||
const app = new Vue({
|
||||
el: '#app',
|
||||
});
|
||||
});
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@
|
||||
<div class="card-header">
|
||||
<p class="card-title">{{trans('messages.elements')}}</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="collapse show" id="basicElements">
|
||||
<div class="card-body pr-1 pl-1 elements_sidebar_height">
|
||||
<draggable class="dragArea list-group"
|
||||
@@ -16,8 +16,8 @@
|
||||
:sort="false"
|
||||
@change="change"
|
||||
>
|
||||
<div class="list-group-item"
|
||||
v-for="element in basic_elements"
|
||||
<div class="list-group-item"
|
||||
v-for="element in basic_elements"
|
||||
:key="element.type"
|
||||
>
|
||||
<button type="button"
|
||||
@@ -53,24 +53,25 @@
|
||||
handle=".handle"
|
||||
@change="change"
|
||||
:animation="200"
|
||||
>
|
||||
>
|
||||
<transition-group
|
||||
name="custom-classes-transition"
|
||||
enter-active-class="animated zoomIn"
|
||||
leave-active-class="animated fadeOut"
|
||||
leave-active-class="animated fadeOut"
|
||||
tag="div"
|
||||
class="row"
|
||||
:class="[(selected_elements.length < 3) ? 'transition-card-body' : '']">
|
||||
<div
|
||||
v-for="(element, index) in selected_elements"
|
||||
v-for="(element, index) in selected_elements"
|
||||
:key="element.id"
|
||||
:class="element.col"
|
||||
:class="element.col"
|
||||
@click="toggleConfigurator(index, true)"
|
||||
>
|
||||
<fieldGenerator
|
||||
:element="element"
|
||||
<fieldGenerator
|
||||
:element="element"
|
||||
:settings="settings"
|
||||
:applyValidations="applyValidations"
|
||||
action=""
|
||||
></fieldGenerator>
|
||||
<div class="element-config-action-btn float-right"
|
||||
v-show="element.extras.showConfigurator">
|
||||
@@ -146,7 +147,7 @@
|
||||
</div>
|
||||
<form-layout
|
||||
:selected_elements="selected_elements"
|
||||
:settings="settings">
|
||||
:settings="settings">
|
||||
</form-layout>
|
||||
<div class="row">
|
||||
<!-- form custom attribute -->
|
||||
@@ -178,7 +179,7 @@
|
||||
<div class="tab-pane fade mb-2" :class="isConfiguratorOpen ? 'active show' : ''" id="configuration" role="tabpanel" aria-labelledby="configuration-tab">
|
||||
<template v-for="(element, index) in selected_elements"
|
||||
v-if="element.extras.showConfigurator && isConfiguratorOpen">
|
||||
<fieldConfigurator
|
||||
<fieldConfigurator
|
||||
v-if="!_.includes(['page_break'], element.type)"
|
||||
:key="element.id"
|
||||
:element="element"
|
||||
@@ -232,7 +233,7 @@
|
||||
return {
|
||||
applyValidations: false,
|
||||
basic_elements: [
|
||||
{ type: 'text',
|
||||
{ type: 'text',
|
||||
subtype:'text',
|
||||
label: self.trans('messages.input'),
|
||||
help_text: '',
|
||||
@@ -248,16 +249,16 @@
|
||||
tooltip: self.trans('messages.text_tooltip'),
|
||||
popover_help_text:{
|
||||
enable: false,
|
||||
content: ''
|
||||
content: ''
|
||||
},
|
||||
allowed_input:{
|
||||
values:'',
|
||||
error_msg: 'This value is not allowed.'
|
||||
}
|
||||
},
|
||||
{ type: 'textarea',
|
||||
{ type: 'textarea',
|
||||
label: self.trans('messages.textarea'),
|
||||
help_text: '',
|
||||
help_text: '',
|
||||
display_icon: 'list',
|
||||
prefix_icon: 'none',
|
||||
suffix_icon: 'none',
|
||||
@@ -271,10 +272,10 @@
|
||||
tooltip: self.trans('messages.textarea_tooltip'),
|
||||
popover_help_text:{
|
||||
enable: false,
|
||||
content: ''
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
{ type: 'dropdown',
|
||||
{ type: 'dropdown',
|
||||
label: self.trans('messages.dropdown'),
|
||||
help_text: '',
|
||||
display_icon: 'caret-square-down',
|
||||
@@ -290,12 +291,12 @@
|
||||
tooltip: self.trans('messages.dropdown_tooltip'),
|
||||
popover_help_text:{
|
||||
enable: false,
|
||||
content: ''
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
{ type: 'radio',
|
||||
{ type: 'radio',
|
||||
label: self.trans('messages.radio'),
|
||||
help_text: '',
|
||||
help_text: '',
|
||||
spread_to_col: {
|
||||
enable: false,
|
||||
column: 2
|
||||
@@ -308,12 +309,12 @@
|
||||
tooltip: self.trans('messages.radio_tooltip'),
|
||||
popover_help_text:{
|
||||
enable: false,
|
||||
content: ''
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
{ type: 'checkbox',
|
||||
{ type: 'checkbox',
|
||||
label: self.trans('messages.checkbox'),
|
||||
help_text: '',
|
||||
help_text: '',
|
||||
spread_to_col: {
|
||||
enable: false,
|
||||
column: 2
|
||||
@@ -326,10 +327,10 @@
|
||||
tooltip: self.trans('messages.checkbox_tooltip'),
|
||||
popover_help_text:{
|
||||
enable: false,
|
||||
content: ''
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
{ type: 'heading',
|
||||
{ type: 'heading',
|
||||
label: self.trans('messages.heading_paragrahp'),
|
||||
tag: 'h1',
|
||||
text_color: '#212529',
|
||||
@@ -342,7 +343,7 @@
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
{ type: 'range',
|
||||
{ type: 'range',
|
||||
label: self.trans('messages.range'),
|
||||
help_text: '',
|
||||
display_icon: 'arrows-alt-h',
|
||||
@@ -356,7 +357,7 @@
|
||||
tooltip: self.trans('messages.range_tooltip'),
|
||||
popover_help_text:{
|
||||
enable: false,
|
||||
content: ''
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
{ type: 'calendar',
|
||||
@@ -380,7 +381,7 @@
|
||||
tooltip: self.trans('messages.datetime_tooltip'),
|
||||
popover_help_text:{
|
||||
enable: false,
|
||||
content: ''
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -401,7 +402,7 @@
|
||||
tooltip: self.trans('messages.file_upload_tooltip'),
|
||||
popover_help_text:{
|
||||
enable: false,
|
||||
content: ''
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -417,7 +418,7 @@
|
||||
tooltip: self.trans('messages.text_editor_tooltip'),
|
||||
popover_help_text:{
|
||||
enable: false,
|
||||
content: ''
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -432,7 +433,7 @@
|
||||
tooltip: self.trans('messages.terms_condition_tooltip'),
|
||||
popover_help_text:{
|
||||
enable: false,
|
||||
content: ''
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -451,7 +452,7 @@
|
||||
tooltip: self.trans('messages.rating_tooltip'),
|
||||
popover_help_text:{
|
||||
enable: false,
|
||||
content: ''
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -466,7 +467,7 @@
|
||||
tooltip: self.trans('messages.switch_tooltip'),
|
||||
popover_help_text:{
|
||||
enable: false,
|
||||
content: ''
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -510,7 +511,7 @@
|
||||
tooltip: self.trans('messages.signature_tooltip'),
|
||||
popover_help_text:{
|
||||
enable: false,
|
||||
content: ''
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -636,7 +637,7 @@
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
change: function(evt) {
|
||||
window.console.log(evt);
|
||||
@@ -681,7 +682,7 @@
|
||||
}
|
||||
this.selected_elements[index].extras.showConfigurator = show;
|
||||
},
|
||||
toggleConfiguratorEvent(values){
|
||||
toggleConfiguratorEvent(values){
|
||||
this.toggleConfigurator(values.index, values.show);
|
||||
this.openElementConfigurator();
|
||||
},
|
||||
@@ -770,4 +771,4 @@
|
||||
.transition-card-body{
|
||||
min-height: 392px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -8,10 +8,12 @@
|
||||
:key="index"
|
||||
:class="[element.col ? element.col : 'col-md-12']"
|
||||
v-show="togglePageVisibility(element.page_num)">
|
||||
<fieldGenerator
|
||||
<fieldGenerator
|
||||
:element="element"
|
||||
:settings="settings"
|
||||
:submitted_data="submitted_data"
|
||||
:action="action"
|
||||
:action-by="actionBy"
|
||||
@apply_conditions="applyConditions">
|
||||
</fieldGenerator>
|
||||
</div>
|
||||
@@ -64,7 +66,7 @@
|
||||
import fieldGenerator from "./FieldGenerator";
|
||||
|
||||
export default{
|
||||
props: ['form', 'actionBy'],
|
||||
props: ['form', 'actionBy', 'action'],
|
||||
components: {
|
||||
fieldGenerator
|
||||
},
|
||||
@@ -121,7 +123,9 @@
|
||||
messages: messages,
|
||||
submitHandler: function(form, e) {
|
||||
e.preventDefault();
|
||||
let disabled = $('#show_form :input:disabled').removeAttr('disabled');
|
||||
var form_data = $('#show_form').serialize();
|
||||
disabled.attr('disabled', 'disabled');
|
||||
$("button.submit_btn, button.draft_btn").attr('disabled', 'disabled');
|
||||
var status = $("input[name=status]").val();
|
||||
if (status == 'complete') {
|
||||
@@ -139,9 +143,9 @@
|
||||
}
|
||||
|
||||
let url = '/form-data/' + self.form_parsed.id + '?token=' + self.token + '&form_data_id=' + self.form_data_id;
|
||||
if (self.actionBy.length && self.actionBy == 'admin') {
|
||||
url = '/update/'+self.form_parsed.id+'/data/'+self.form_data_id;
|
||||
}
|
||||
// if (self.actionBy.length && self.actionBy === 'admin') {
|
||||
// url = '/update/'+self.form_parsed.id+'/data/'+self.form_data_id;
|
||||
// }
|
||||
|
||||
axios
|
||||
.post(url, {form_data})
|
||||
@@ -209,11 +213,15 @@
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
window.location.href = document.referrer;
|
||||
}, 3000);
|
||||
} else {
|
||||
toastr.error(response.data.msg);
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
.catch(function(error) {
|
||||
toastr.error(error);
|
||||
});
|
||||
}
|
||||
@@ -301,7 +309,7 @@
|
||||
} else {
|
||||
form_element_value = document.getElementById(element.condition).value;
|
||||
}
|
||||
|
||||
|
||||
//check if condition_satisfied or not
|
||||
if(logical_operator == 'AND') {
|
||||
if (element.operator == '==') {
|
||||
@@ -430,7 +438,7 @@
|
||||
isCardFormLayout() {
|
||||
const self = this;
|
||||
if (
|
||||
self.settings.layout &&
|
||||
self.settings.layout &&
|
||||
_.includes(['card_form'], self.settings.layout)
|
||||
) {
|
||||
return true
|
||||
@@ -493,7 +501,7 @@
|
||||
) {
|
||||
is_element_valid = $('[name="' + element_name + '"]').valid();
|
||||
}
|
||||
|
||||
|
||||
return is_element_valid;
|
||||
},
|
||||
copyLink(){
|
||||
@@ -509,4 +517,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-1">{{$element['min']}}</div>
|
||||
<div class="col-sm-10">
|
||||
<input type="range"
|
||||
<input type="range"
|
||||
name="fields[{{$element['name']}}]"
|
||||
@if($element['required']) required @endif
|
||||
data-msg-required="{{$element['required_error_msg']}}"
|
||||
@@ -112,7 +112,7 @@
|
||||
data-toggle="datetimepicker"
|
||||
id="{{$element['name']}}"
|
||||
class="form-control datetimepicker-input {{$element['custom_class']}}"
|
||||
readonly
|
||||
readonly
|
||||
data-target="#{{$element['name']}}"
|
||||
@if($element['required']) required @endif
|
||||
data-msg-required="{{$element['required_error_msg']}}"
|
||||
@@ -189,11 +189,11 @@
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
|
||||
@foreach(explode(PHP_EOL, $element['options']) as $option)
|
||||
<div class="custom-control @if($element['type'] == 'radio') custom-radio @else custom-checkbox @endif">
|
||||
<input class="custom-control-input"
|
||||
type="{{$element['type']}}"
|
||||
<input class="custom-control-input"
|
||||
type="{{$element['type']}}"
|
||||
value="{{$option}}"
|
||||
name="fields[{{$element['name']}}][]"
|
||||
id="{{$element['name']}}_{{$loop->index}}"
|
||||
@@ -302,7 +302,7 @@
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<textarea class="form-control summer_note" id="{{$element['name']}}" name="fields[{{$element['name']}}]" @if($element['required']) required @endif data-msg-required="{{$element['required_error_msg']}}"
|
||||
<textarea class="form-control summer_note" id="{{$element['name']}}" name="fields[{{$element['name']}}]" @if($element['required']) required @endif data-msg-required="{{$element['required_error_msg']}}"
|
||||
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])></textarea>
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
@@ -431,7 +431,7 @@
|
||||
id="{{$element['name']}}"
|
||||
name="{{$element['label']}}"
|
||||
title="{{$element['label']}}"
|
||||
class="{{$element['custom_class']}}"
|
||||
class="{{$element['custom_class']}}"
|
||||
width="{{$element['width']}}%"
|
||||
height="{{$element['height']}}"
|
||||
frameborder="0"
|
||||
@@ -451,7 +451,7 @@
|
||||
id="{{$element['name']}}"
|
||||
name="{{$element['label']}}"
|
||||
title="{{$element['label']}}"
|
||||
class="{{$element['custom_class']}}"
|
||||
class="{{$element['custom_class']}}"
|
||||
width="{{$element['width']}}%"
|
||||
height="{{$element['height']}}"
|
||||
frameborder="0"
|
||||
@@ -471,7 +471,7 @@
|
||||
id="{{$element['name']}}"
|
||||
name="{{$element['label']}}"
|
||||
title="{{$element['label']}}"
|
||||
class="{{$element['custom_class']}}"
|
||||
class="{{$element['custom_class']}}"
|
||||
width="{{$element['width']}}%"
|
||||
height="{{$element['height']}}"
|
||||
frameborder="0"
|
||||
@@ -496,4 +496,4 @@
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@@ -4,8 +4,18 @@
|
||||
$error_msg_color = $form->schema['settings']['color']['error_msg'];
|
||||
$bg_type = $form->schema['settings']['background']['bg_type'];
|
||||
$bg_image = $form->schema['settings']['color']['image_path'];
|
||||
$action = '';
|
||||
|
||||
switch (request()->route()->getName()) {
|
||||
case 'form-data.edit':
|
||||
$action = 'edit';
|
||||
break;
|
||||
case 'forms.show':
|
||||
$action = 'show';
|
||||
break;
|
||||
}
|
||||
@endphp
|
||||
<div class="tab-content card-body"
|
||||
<div class="tab-content card-body"
|
||||
id="" role="tabpanel" style='@if(!empty($bg_image) && $bg_type == 'bg_image')background-image: url("{{Storage::url(config('constants.doc_path').'/'.$bg_image)}}"); background-repeat: no-repeat;background-size: cover;background-position: right top;@else background-color: {{$bg_color}}; @endif'>
|
||||
|
||||
@if(!empty($is_form_closed) && $is_form_closed)
|
||||
@@ -13,7 +23,7 @@
|
||||
{!! $form_closed_msg !!}
|
||||
</div>
|
||||
@else
|
||||
<show-form form="{{json_encode($form)}}" action-by="{{$action_by ?? ''}}"></show-form>
|
||||
<show-form form="{{json_encode($form)}}" action-by="{{$action_by ?? ''}}" action="{{ $action }}"></show-form>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
$additional_js = $form->schema['additional_js_css']['js'];
|
||||
$page_color = $form->schema['settings']['color']['page_color'] ?? '#f4f6f9';
|
||||
@endphp
|
||||
|
||||
|
||||
<div class="@if(!empty($iframe_enabled) && $iframe_enabled) container-fluid @else container @endif">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">
|
||||
|
||||
@@ -50,6 +50,21 @@
|
||||
<div class="card-header">
|
||||
{{$form->name}}
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<input type="date" class="form-control" name="start_date" value="{{ request()->get('start_date') ?? \Carbon\Carbon::now()->subDays(7)->toDateString() }}">
|
||||
</div>
|
||||
|
||||
<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() }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-0 col-2 d-flex">
|
||||
<button class="btn btn-primary mx-1" type="submit">@lang('messages.search_without_dots')</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@php
|
||||
$is_enabled_sub_ref_no = false;
|
||||
if(isset($form->schema['settings']['form_submision_ref']['is_enabled']) && $form->schema['settings']['form_submision_ref']['is_enabled']) {
|
||||
@@ -67,13 +82,14 @@
|
||||
<table class="table" id="submitted_data_table" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>@lang('messages.action')</th>
|
||||
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
|
||||
<th>@lang('messages.action')</th>
|
||||
@endif
|
||||
|
||||
@if($is_enabled_sub_ref_no)
|
||||
<th>@lang('messages.submission_numbering')</th>
|
||||
@endif
|
||||
@if(auth()->user()->show_form_response_user)
|
||||
<th>@lang('messages.username')</th>
|
||||
@endif
|
||||
<th>@lang('messages.username')</th>
|
||||
@foreach($schema as $element)
|
||||
@if(in_array($element['name'], $col_visible))
|
||||
<th>
|
||||
@@ -88,40 +104,42 @@
|
||||
<tbody>
|
||||
@foreach($data as $k => $row)
|
||||
<tr>
|
||||
<td>
|
||||
@if(in_array('view', $btn_enabled))
|
||||
<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-toggle="modal">
|
||||
<i class="fa fa-eye" aria-hidden="true"></i>
|
||||
@lang('messages.view')
|
||||
</button>
|
||||
@endif
|
||||
@if(in_array('delete', $btn_enabled))
|
||||
<button type="button" class="btn btn-danger btn-sm delete_form_data m-1"
|
||||
data-href="{{action([\App\Http\Controllers\FormDataController::class, 'destroy'], [$row->id])}}">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
@lang('messages.delete')
|
||||
</button>
|
||||
@endif
|
||||
@php
|
||||
$form_id = !empty($form->slug) ? $form->slug : $form->id;
|
||||
@endphp
|
||||
<a class="btn btn-dark btn-sm m-1" target="_blank"
|
||||
href="{{action([\App\Http\Controllers\FormDataController::class, 'getEditformData'], ['slug' => $form_id,'id' => $row->id])}}">
|
||||
<i class="far fa-edit" aria-hidden="true"></i>
|
||||
@lang('messages.edit')
|
||||
</a>
|
||||
</td>
|
||||
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
|
||||
<td>
|
||||
@if(in_array('view', $btn_enabled))
|
||||
<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-toggle="modal">
|
||||
<i class="fa fa-eye" aria-hidden="true"></i>
|
||||
@lang('messages.view')
|
||||
</button>
|
||||
@endif
|
||||
@if(in_array('delete', $btn_enabled))
|
||||
<button type="button"
|
||||
class="btn btn-danger btn-sm delete_form_data m-1"
|
||||
data-href="{{action([\App\Http\Controllers\FormDataController::class, 'destroy'], [$row->id])}}">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
@lang('messages.delete')
|
||||
</button>
|
||||
@endif
|
||||
@php
|
||||
$form_id = !empty($form->slug) ? $form->slug : $form->id;
|
||||
@endphp
|
||||
<a class="btn btn-dark btn-sm m-1"
|
||||
href="{{action([\App\Http\Controllers\FormDataController::class, 'getEditformData'], ['slug' => $form_id,'id' => $row->id])}}">
|
||||
<i class="far fa-edit" aria-hidden="true"></i>
|
||||
@lang('messages.edit')
|
||||
</a>
|
||||
</td>
|
||||
@endif
|
||||
|
||||
@if($is_enabled_sub_ref_no)
|
||||
<td>
|
||||
{{$row['submission_ref']}}
|
||||
</td>
|
||||
@endif
|
||||
|
||||
@if(auth()->user()->show_form_response_user)
|
||||
<td>{{ $row->submittedBy?->name }}</td>
|
||||
@endif
|
||||
<td>{{ $row->submittedBy?->name }}</td>
|
||||
|
||||
@foreach($schema as $row_element)
|
||||
@if(in_array($row_element['name'], $col_visible))
|
||||
@@ -150,10 +168,10 @@
|
||||
@endif
|
||||
@endforeach
|
||||
<td>
|
||||
{{\Carbon\Carbon::createFromTimestamp(strtotime($row->created_at))->format($date_format)}}
|
||||
{{\Carbon\Carbon::createFromTimestamp(strtotime($row->updated_at))->format($date_format)}}
|
||||
<br/>
|
||||
<small>
|
||||
{{$row->created_at->diffForHumans()}}
|
||||
{{$row->updated_at->diffForHumans()}}
|
||||
</small>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1,96 +1,112 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@include('layouts/partials/status')
|
||||
</div>
|
||||
</div>
|
||||
@if(auth()->user()->can('superadmin') || Auth::user()->can_create_form)
|
||||
<div class="row mb-5">
|
||||
<div class="col-12 col-sm-6 col-md-3">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-info elevation-1"><i class="fas fa-file-alt"></i></span>
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">@lang('messages.forms')</span>
|
||||
<span class="info-box-number">{{$form_count}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-3">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-danger elevation-1"><i class="fas fa-align-justify"></i></span>
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">@lang('messages.templates')</span>
|
||||
<span class="info-box-number">{{$template_count}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-3">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-green elevation-1"><i class="fas fa-hand-pointer"></i></span>
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">@lang('messages.submissions')</span>
|
||||
<span class="info-box-number">{{$submission_count}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-3">
|
||||
<button type="button" data-href="{{action([\App\Http\Controllers\FormController::class, 'create'])}}" class="btn btn-primary float-right col-md-9 createForm mt-3">
|
||||
<i class="fas fa-plus" aria-hidden="true"></i> @lang('messages.new_form')</button>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@include('layouts/partials/status')
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-12">
|
||||
<div class="card card-primary card-outline card-outline-tabs">
|
||||
<div class="card-header p-0 border-bottom-0">
|
||||
<ul class="nav nav-tabs
|
||||
@if(auth()->user()->can('superadmin') || Auth::user()->can_create_form)
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || auth()->user()->can_create_form)
|
||||
<div class="row mb-5">
|
||||
<div class="col-12 col-sm-6 col-md-3">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-info elevation-1"><i class="fas fa-file-alt"></i></span>
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">@lang('messages.forms')</span>
|
||||
<span class="info-box-number">{{$form_count}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::ADMIN->value))
|
||||
<div class="col-12 col-sm-6 col-md-3">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-danger elevation-1"><i
|
||||
class="fas fa-align-justify"></i></span>
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">@lang('messages.templates')</span>
|
||||
<span class="info-box-number">{{$template_count}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-3">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-green elevation-1"><i class="fas fa-hand-pointer"></i></span>
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">@lang('messages.submissions')</span>
|
||||
<span class="info-box-number">{{$submission_count}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-3">
|
||||
<button type="button"
|
||||
data-href="{{action([\App\Http\Controllers\FormController::class, 'create'])}}"
|
||||
class="btn btn-primary float-right col-md-9 createForm mt-3">
|
||||
<i class="fas fa-plus" aria-hidden="true"></i> @lang('messages.new_form')</button>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-12">
|
||||
<div class="card card-primary card-outline card-outline-tabs">
|
||||
<div class="card-header p-0 border-bottom-0">
|
||||
<ul class="nav nav-tabs
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || auth()->user()->can_create_form)
|
||||
nav-justified
|
||||
@endif"
|
||||
id="custom-tabs-four-tab" role="tablist">
|
||||
@if(auth()->user()->can('superadmin') || Auth::user()->can_create_form)
|
||||
id="custom-tabs-four-tab" role="tablist">
|
||||
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value]) || auth()->user()->can_create_form)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="custome-tabs-all-forms" data-toggle="pill"
|
||||
href="#custome-tabs-forms" role="tab" aria-controls="custome-tabs-forms"
|
||||
aria-selected="true">
|
||||
<i class="fas fa-file-alt" aria-hidden="true"></i> @lang('messages.all_forms')
|
||||
</a>
|
||||
</li>
|
||||
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::ADMIN->value))
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="custome-tabs-all-templates" data-toggle="pill"
|
||||
href="#custome-tabs-templates" role="tab"
|
||||
aria-controls="custome-tabs-templates">
|
||||
<i class="fas fa-align-justify"
|
||||
aria-hidden="true"></i> @lang('messages.all_templates')
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
@endif
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="custome-tabs-all-forms" data-toggle="pill" href="#custome-tabs-forms" role="tab" aria-controls="custome-tabs-forms" aria-selected="true">
|
||||
<i class="fas fa-file-alt" aria-hidden="true"></i> @lang('messages.all_forms')
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="custome-tabs-all-templates" data-toggle="pill" href="#custome-tabs-templates" role="tab" aria-controls="custome-tabs-templates">
|
||||
<i class="fas fa-align-justify" aria-hidden="true"></i> @lang('messages.all_templates')
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
<li class="nav-item">
|
||||
<a class="nav-link
|
||||
@if(!auth()->user()->can('superadmin') && !Auth::user()->can_create_form)
|
||||
<a class="nav-link
|
||||
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) && !auth()->user()->can_create_form)
|
||||
active
|
||||
@endif
|
||||
" id="custome-tabs-shared-forms" data-toggle="pill" href="#custome-tabs-shared-forms-assigned" role="tab" aria-controls="custome-tabs-shared-forms-assigned"
|
||||
@if(!auth()->user()->can('superadmin') && !Auth::user()->can_create_form)
|
||||
aria-selected="true"
|
||||
@endif>
|
||||
<i class="fas fa-file-alt" aria-hidden="true"></i> @lang('messages.assigned_forms')
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="tab-content" id="custom-tabs-four-tabContent">
|
||||
@if(auth()->user()->can('superadmin') || Auth::user()->can_create_form)
|
||||
<div class="tab-pane fade active show" id="custome-tabs-forms" role="tabpanel" aria-labelledby="custome-tabs-all-forms">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="form_table" style="width: 100%;">
|
||||
<thead>
|
||||
" id="custome-tabs-shared-forms" data-toggle="pill"
|
||||
href="#custome-tabs-shared-forms-assigned" role="tab"
|
||||
aria-controls="custome-tabs-shared-forms-assigned"
|
||||
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) && !auth()->user()->can_create_form)
|
||||
aria-selected="true"
|
||||
@endif>
|
||||
<i class="fas fa-file-alt"
|
||||
aria-hidden="true"></i> @lang('messages.assigned_forms')
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="tab-content" id="custom-tabs-four-tabContent">
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || auth()->user()->can_create_form)
|
||||
<div class="tab-pane fade active show" id="custome-tabs-forms" role="tabpanel"
|
||||
aria-labelledby="custome-tabs-all-forms">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="form_table" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>@lang('messages.name')</th>
|
||||
<th>@lang('messages.description')</th>
|
||||
@@ -98,15 +114,16 @@
|
||||
<th>@lang('messages.submissions')</th>
|
||||
<th>@lang('messages.action')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="custome-tabs-templates" role="tabpanel" aria-labelledby="custome-tabs-all-templates">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="template_table" style="width: 100%;">
|
||||
<thead>
|
||||
<div class="tab-pane fade" id="custome-tabs-templates" role="tabpanel"
|
||||
aria-labelledby="custome-tabs-all-templates">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="template_table" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>@lang('messages.name')</th>
|
||||
<th>@lang('messages.description')</th>
|
||||
@@ -114,52 +131,56 @@
|
||||
<th>
|
||||
@lang('messages.is_global_template')
|
||||
<i class="fas fa-info-circle"
|
||||
data-toggle="tooltip"
|
||||
title="@lang('messages.is_global_template_tooltip')"></i>
|
||||
data-toggle="tooltip"
|
||||
title="@lang('messages.is_global_template_tooltip')"></i>
|
||||
</th>
|
||||
@endif
|
||||
<th>@lang('messages.action')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="tab-pane fade
|
||||
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || !auth()->user()->can_create_form)
|
||||
active show
|
||||
@endif
|
||||
" id="custome-tabs-shared-forms-assigned" role="tabpanel"
|
||||
aria-labelledby="custome-tabs-shared-forms">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="assigned_form_table" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>@lang('messages.name')</th>
|
||||
<th>@lang('messages.description')</th>
|
||||
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
<th>@lang('messages.created_by')</th>
|
||||
@endif
|
||||
<th>@lang('messages.action')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="tab-pane fade
|
||||
@if(!auth()->user()->can('superadmin') && !Auth::user()->can_create_form)
|
||||
active show
|
||||
@endif
|
||||
" id="custome-tabs-shared-forms-assigned" role="tabpanel" aria-labelledby="custome-tabs-shared-forms">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="assigned_form_table" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>@lang('messages.name')</th>
|
||||
<th>@lang('messages.description')</th>
|
||||
<th>@lang('messages.action')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card -->
|
||||
</div>
|
||||
<!-- /.card -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="collab_modal" role="dialog" aria-hidden="true"></div>
|
||||
<div class="modal fade" id="collab_modal" role="dialog" aria-hidden="true"></div>
|
||||
@endsection
|
||||
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
|
||||
// form dataTable
|
||||
var form_table = $('#form_table').DataTable({
|
||||
// form dataTable
|
||||
var form_table = $('#form_table').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: '/home',
|
||||
@@ -168,23 +189,23 @@
|
||||
fixedHeader: false,
|
||||
aaSorting: [[2, 'desc']],
|
||||
"columnDefs": [
|
||||
{ "width": "22%", "targets": 0 },
|
||||
{ "width": "40%", "targets": 1 },
|
||||
{ "width": "15%", "targets": 2 },
|
||||
{ "width": "3%", "targets": 3 },
|
||||
{ "width": "20%", "targets": 4 }
|
||||
{"width": "22%", "targets": 0},
|
||||
{"width": "40%", "targets": 1},
|
||||
{"width": "15%", "targets": 2},
|
||||
{"width": "3%", "targets": 3},
|
||||
{"width": "20%", "targets": 4}
|
||||
],
|
||||
columns: [
|
||||
{ data: 'name' , name: 'name'},
|
||||
{ data: 'description' , name: 'description'},
|
||||
{ data: 'created_at' , name: 'created_at'},
|
||||
{ data: 'data_count', name: 'data_count', searchable:false},
|
||||
{ data: 'action', name: 'action', sortable:false }
|
||||
{data: 'name', name: 'name'},
|
||||
{data: 'description', name: 'description'},
|
||||
{data: 'created_at', name: 'created_at'},
|
||||
{data: 'data_count', name: 'data_count', searchable: false},
|
||||
{data: 'action', name: 'action', sortable: false}
|
||||
]
|
||||
});
|
||||
|
||||
// template dataTable
|
||||
var template_table = $('#template_table').DataTable({
|
||||
// template dataTable
|
||||
var template_table = $('#template_table').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: '/home-template',
|
||||
@@ -192,191 +213,209 @@
|
||||
dom: 'lfrtip',
|
||||
fixedHeader: false,
|
||||
columns: [
|
||||
{ data: 'name' , name: 'name'},
|
||||
{ data: 'description' , name: 'description'},
|
||||
@if(auth()->user()->can('superadmin'))
|
||||
{ data: 'is_global_template', name: 'is_global_template', sortable:false, searchable:false },
|
||||
@endif
|
||||
{ data: 'action', name: 'action', sortable:false }
|
||||
{data: 'name', name: 'name'},
|
||||
{data: 'description', name: 'description'},
|
||||
@if(auth()->user()->can('superadmin'))
|
||||
{
|
||||
data: 'is_global_template', name: 'is_global_template', sortable: false, searchable: false
|
||||
},
|
||||
@endif
|
||||
{
|
||||
data: 'action', name: 'action', sortable: false
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
//delete form
|
||||
$(document).on('click', '.delete_form', function(){
|
||||
var url = $(this).data("href");
|
||||
var result = confirm('Are You Sure?');
|
||||
if (result == true) {
|
||||
//delete form
|
||||
$(document).on('click', '.delete_form', function () {
|
||||
var url = $(this).data("href");
|
||||
var result = confirm('Are You Sure?');
|
||||
if (result == true) {
|
||||
$.ajax({
|
||||
method: "DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (result) {
|
||||
if (result.success == true) {
|
||||
toastr.success(result.msg);
|
||||
form_table.ajax.reload();
|
||||
} else {
|
||||
toastr.error(result.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//delete template
|
||||
$(document).on('click', '.delete_template', function () {
|
||||
var url = $(this).data("href");
|
||||
var result = confirm('Are You Sure?');
|
||||
if (result == true) {
|
||||
$.ajax({
|
||||
method: "DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (result) {
|
||||
if (result.success == true) {
|
||||
toastr.success(result.msg);
|
||||
template_table.ajax.reload();
|
||||
} else {
|
||||
toastr.error(result.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// create form
|
||||
$(document).on('click', '.createForm', function () {
|
||||
var url = $(this).data('href');
|
||||
$.ajax({
|
||||
method: "DELETE",
|
||||
method: "GET",
|
||||
url: url,
|
||||
dataType: "html",
|
||||
success: function (response) {
|
||||
$("#modal_div").html(response).modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// create widget
|
||||
$(document).on('click', '.generate_widget', function () {
|
||||
var url = $(this).data('href');
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: url,
|
||||
dataType: "html",
|
||||
success: function (response) {
|
||||
$("#modal_div").html(response).modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//copy form
|
||||
$(document).on('click', '.copy_form', function () {
|
||||
var url = $(this).data('href');
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: url,
|
||||
dataType: "html",
|
||||
success: function (response) {
|
||||
$("#modal_div").html(response).modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//assigned form to user
|
||||
var assigned_form_table = $('#assigned_form_table').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: '/home-assigned-forms',
|
||||
buttons: [],
|
||||
dom: 'lfrtip',
|
||||
fixedHeader: false,
|
||||
aaSorting: [[0, 'desc']],
|
||||
"columnDefs": [
|
||||
{"width": "25%", "targets": 0},
|
||||
{"width": "40%", "targets": 1},
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
{
|
||||
"width": "15%", "targets": 2
|
||||
},
|
||||
@endif
|
||||
{
|
||||
"width": "20%",
|
||||
"targets": @php echo auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) ? 3 : 2 @endphp }
|
||||
],
|
||||
columns: [
|
||||
{data: 'name', name: 'forms.name'},
|
||||
{data: 'description', name: 'forms.description'},
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
{
|
||||
data: 'created_by', name: 'forms.created_by'
|
||||
},
|
||||
@endif
|
||||
{
|
||||
data: 'action', name: 'action', sortable: false
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
//form collaborate
|
||||
$(document).on('click', '.collab_btn', function () {
|
||||
var url = $(this).data('href');
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: url,
|
||||
dataType: "html",
|
||||
success: function (response) {
|
||||
$("#collab_modal").html(response).modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#collab_modal").on('shown.bs.modal', function () {
|
||||
if ($("#form_design").length) {
|
||||
$(document).on('change', '#form_design', function () {
|
||||
if ($("#form_design").is(":checked")) {
|
||||
$("#form_view").attr('checked', true);
|
||||
} else {
|
||||
$("#form_view").attr('checked', false);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form#collaborate_form', function (e) {
|
||||
e.preventDefault();
|
||||
var data = $("form#collaborate_form").serialize();
|
||||
var url = $("form#collaborate_form").attr('action');
|
||||
var ladda = Ladda.create(document.querySelector('.submit_btn'));
|
||||
ladda.start();
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function(result){
|
||||
if(result.success == true){
|
||||
toastr.success(result.msg);
|
||||
form_table.ajax.reload();
|
||||
data: data,
|
||||
success: function (response) {
|
||||
ladda.stop();
|
||||
if (response.success) {
|
||||
$("#collab_modal").modal('hide');
|
||||
toastr.success(response.msg);
|
||||
} else {
|
||||
toastr.error(result.msg);
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//delete template
|
||||
$(document).on('click', '.delete_template', function(){
|
||||
var url = $(this).data("href");
|
||||
var result = confirm('Are You Sure?');
|
||||
if (result == true) {
|
||||
$.ajax({
|
||||
method: "DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function(result){
|
||||
if(result.success == true){
|
||||
toastr.success(result.msg);
|
||||
template_table.ajax.reload();
|
||||
} else {
|
||||
toastr.error(result.msg);
|
||||
}
|
||||
$('a[data-toggle="pill"]').on('shown.bs.tab', function (e) {
|
||||
var target = $(e.target).attr('href');
|
||||
if (target == '#custome-tabs-forms') {
|
||||
if (typeof form_table != 'undefined') {
|
||||
form_table.ajax.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// create form
|
||||
$(document).on('click', '.createForm', function(){
|
||||
var url = $(this).data('href');
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: url,
|
||||
dataType: "html",
|
||||
success: function(response) {
|
||||
$("#modal_div").html(response).modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// create widget
|
||||
$(document).on('click', '.generate_widget', function(){
|
||||
var url = $(this).data('href');
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: url,
|
||||
dataType: "html",
|
||||
success: function(response) {
|
||||
$("#modal_div").html(response).modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//copy form
|
||||
$(document).on('click', '.copy_form', function(){
|
||||
var url = $(this).data('href');
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: url,
|
||||
dataType: "html",
|
||||
success: function(response) {
|
||||
$("#modal_div").html(response).modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//assigned form to user
|
||||
var assigned_form_table = $('#assigned_form_table').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: '/home-assigned-forms',
|
||||
buttons: [],
|
||||
dom: 'lfrtip',
|
||||
fixedHeader: false,
|
||||
aaSorting: [[0, 'desc']],
|
||||
"columnDefs": [
|
||||
{ "width": "25%", "targets": 0 },
|
||||
{ "width": "40%", "targets": 1 },
|
||||
{ "width": "20%", "targets": 2 }
|
||||
],
|
||||
columns: [
|
||||
{ data: 'name' , name: 'forms.name'},
|
||||
{ data: 'description' , name: 'forms.description'},
|
||||
{ data: 'action', name: 'action', sortable:false }
|
||||
]
|
||||
});
|
||||
|
||||
//form collaborate
|
||||
$(document).on('click', '.collab_btn', function() {
|
||||
var url = $(this).data('href');
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: url,
|
||||
dataType: "html",
|
||||
success: function(response) {
|
||||
$("#collab_modal").html(response).modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#collab_modal").on('shown.bs.modal', function () {
|
||||
if ($("#form_design").length) {
|
||||
$(document).on('change', '#form_design', function(){
|
||||
if ($("#form_design").is(":checked")) {
|
||||
$("#form_view").attr('checked', true);
|
||||
} else {
|
||||
$("#form_view").attr('checked', false);
|
||||
} else if (target == '#custome-tabs-templates') {
|
||||
if (typeof template_table != 'undefined') {
|
||||
template_table.ajax.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form#collaborate_form', function (e) {
|
||||
e.preventDefault();
|
||||
var data = $("form#collaborate_form").serialize();
|
||||
var url = $("form#collaborate_form").attr('action');
|
||||
var ladda = Ladda.create(document.querySelector('.submit_btn'));
|
||||
ladda.start();
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: data,
|
||||
success: function (response) {
|
||||
ladda.stop();
|
||||
if (response.success) {
|
||||
$("#collab_modal").modal('hide');
|
||||
toastr.success(response.msg);
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
} else if (target == '#custome-tabs-shared-forms-assigned') {
|
||||
if (typeof assigned_form_table != 'undefined') {
|
||||
assigned_form_table.ajax.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('a[data-toggle="pill"]').on('shown.bs.tab', function (e) {
|
||||
var target = $(e.target).attr('href');
|
||||
if (target == '#custome-tabs-forms') {
|
||||
if(typeof form_table != 'undefined') {
|
||||
form_table.ajax.reload();
|
||||
}
|
||||
} else if (target == '#custome-tabs-templates') {
|
||||
if(typeof template_table != 'undefined') {
|
||||
template_table.ajax.reload();
|
||||
}
|
||||
} else if (target == '#custome-tabs-shared-forms-assigned') {
|
||||
if(typeof assigned_form_table != 'undefined') {
|
||||
assigned_form_table.ajax.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@if(auth()->user()->can('superadmin'))
|
||||
$(document).on('click', '.toggle_global_template', function() {
|
||||
@if(auth()->user()->can('superadmin'))
|
||||
$(document).on('click', '.toggle_global_template', function () {
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{route('toggle.global.template')}}",
|
||||
dataType: "json",
|
||||
data: {
|
||||
is_checked : $(this).is(":checked") ? 1 : 0,
|
||||
form_id : $(this).data("form_id"),
|
||||
is_checked: $(this).is(":checked") ? 1 : 0,
|
||||
form_id: $(this).data("form_id"),
|
||||
},
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
@@ -387,7 +426,7 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
@endif
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
$form = !empty($form) ? $form : '';
|
||||
@endphp
|
||||
|
||||
<!-- reCaptcha -->
|
||||
<!-- reCaptcha -->
|
||||
<script src="//www.google.com/recaptcha/api.js?v={{$asset_version}}" async defer></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
if(typeof jQuery == 'undefined'){
|
||||
document.write('<script src="//code.jquery.com/jquery-3.4.1.min.js?v={{$asset_version}}"></'+'script>');
|
||||
if (typeof jQuery == 'undefined') {
|
||||
document.write('<script src="//code.jquery.com/jquery-3.4.1.min.js?v={{$asset_version}}"></' + 'script>');
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -20,18 +20,26 @@
|
||||
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/moment@2.24.0/moment.min.js?v={{$asset_version}}"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/toastr@2.1.4/build/toastr.min.js?v={{$asset_version}}"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/jquery-validation@1.17.0/dist/jquery.validate.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/rangeslider.js/2.3.2/rangeslider.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.1.2/js/tempusdominus-bootstrap-4.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/rangeslider.js/2.3.2/rangeslider.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.1.2/js/tempusdominus-bootstrap-4.min.js?v={{$asset_version}}"></script>
|
||||
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/dropzone/5.5.1/min/dropzone.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/dropzone/5.5.1/min/dropzone.min.js?v={{$asset_version}}"></script>
|
||||
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.10/js/bootstrap-select.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-bs4.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.10/js/bootstrap-select.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-bs4.min.js?v={{$asset_version}}"></script>
|
||||
|
||||
<!-- Boostrap star rating -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/js/star-rating.min.js?v={{$asset_version}}" type="text/javascript"></script>
|
||||
<script
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/js/star-rating.min.js?v={{$asset_version}}"
|
||||
type="text/javascript"></script>
|
||||
<!-- if you need to use a theme, then include the theme Js file -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/themes/krajee-svg/theme.js?v={{$asset_version}}"></script>
|
||||
<script
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/themes/krajee-svg/theme.js?v={{$asset_version}}"></script>
|
||||
<!-- optionally if you need translation for your language then include locale file as mentioned below -->
|
||||
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/js/locales/<lang>.js"></script> -->
|
||||
<!-- signature pad (https://github.com/szimek/signature_pad)-->
|
||||
@@ -56,7 +64,7 @@
|
||||
APP.ACELLE_MAIL_ENABLED = true;
|
||||
@endif
|
||||
$.ajaxSetup({
|
||||
beforeSend: function(jqXHR, settings) {
|
||||
beforeSend: function (jqXHR, settings) {
|
||||
if (settings.url.indexOf('http') === -1) {
|
||||
settings.url = APP.APP_URL + settings.url;
|
||||
}
|
||||
@@ -82,27 +90,34 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<script src="//cdn.jsdelivr.net/npm/jquery-validation-unobtrusive@3.2.10/dist/jquery.validate.unobtrusive.min.js?v={{$asset_version}}"></script>
|
||||
<script
|
||||
src="//cdn.jsdelivr.net/npm/jquery-validation-unobtrusive@3.2.10/dist/jquery.validate.unobtrusive.min.js?v={{$asset_version}}"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript" src="//cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.10.18/b-1.5.6/b-colvis-1.5.6/b-flash-1.5.6/b-html5-1.5.6/b-print-1.5.6/fc-3.3.1/fh-3.1.4/datatables.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="//cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.10.18/b-1.5.6/b-colvis-1.5.6/b-flash-1.5.6/b-html5-1.5.6/b-print-1.5.6/fc-3.3.1/fh-3.1.4/datatables.min.js?v={{$asset_version}}"></script>
|
||||
|
||||
<!-- ladda.js -->
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/spin.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/ladda.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/spin.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/ladda.min.js?v={{$asset_version}}"></script>
|
||||
<!-- localization -->
|
||||
<script src="{{ url('/js/lang.js') . '?v=' . $asset_version }}"></script>
|
||||
<script src="{{ asset(mix('js/app.js')) }}" defer></script>
|
||||
<!-- intro.js -->
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/intro.js/2.9.3/intro.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/intro.js/2.9.3/intro.min.js?v={{$asset_version}}"></script>
|
||||
<script src="{{ asset('js/iframeResizercontentWindow.js') }}"></script>
|
||||
@endif
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
jQuery.validator.setDefaults({
|
||||
errorPlacement: function(error, element) {
|
||||
errorPlacement: function (error, element) {
|
||||
if (element.hasClass('select2') && element.parent().hasClass('input-group')) {
|
||||
error.insertAfter(element.parent());
|
||||
} else if (element.hasClass('select2')) {
|
||||
@@ -111,11 +126,11 @@
|
||||
error.insertAfter(element.parent());
|
||||
} else if (element.parent().hasClass('multi-input')) {
|
||||
error.insertAfter(element.closest('.multi-input'));
|
||||
} else if(element.hasClass('summer_note')){
|
||||
} else if (element.hasClass('summer_note')) {
|
||||
error.insertAfter(element.next('.note-editor'));
|
||||
} else if(element.hasClass('custom-control-input')) {
|
||||
} else if (element.hasClass('custom-control-input')) {
|
||||
error.insertAfter(element.parent().parent().parent());
|
||||
} else if(element.hasClass('star_rating')) {
|
||||
} else if (element.hasClass('star_rating')) {
|
||||
error.insertAfter(element.parent().parent());
|
||||
} else if (element.hasClass('switch')) {
|
||||
error.insertAfter(element.parent().parent());
|
||||
@@ -125,52 +140,57 @@
|
||||
error.insertAfter(element);
|
||||
}
|
||||
},
|
||||
invalidHandler: function() {
|
||||
invalidHandler: function () {
|
||||
toastr.error("{{ __('messages.some_error_in_input_field') }}");
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$(document).ready(function () {
|
||||
@if(!$is_download)
|
||||
jQuery.extend($.fn.dataTable.defaults, {
|
||||
fixedHeader: false,
|
||||
aLengthMenu: [
|
||||
[25, 50, 100, 200, 500, 1000, -1], [25, 50, 100, 200, 500, 1000, "{{__('messages.all')}}"]
|
||||
],
|
||||
iDisplayLength: 25,
|
||||
dom: 'lfrtip',
|
||||
"language": {
|
||||
"emptyTable": "{{__('messages.emptyTable')}}",
|
||||
"info": "{{__('messages.dt_info')}}",
|
||||
"infoEmpty": "{{__('messages.infoEmpty')}}",
|
||||
"infoFiltered": "{{__('messages.infoFiltered')}}",
|
||||
"lengthMenu": "{{__('messages.lengthMenu')}}",
|
||||
"loadingRecords": "{{__('messages.loadingRecords')}}",
|
||||
"processing": "{{__('messages.processing')}}",
|
||||
"search": "{{__('messages.search')}}",
|
||||
"zeroRecords": "{{__('messages.zeroRecords')}}",
|
||||
"paginate": {
|
||||
"first": "{{__('messages.first')}}",
|
||||
"last": "{{__('messages.last')}}",
|
||||
"next": "{{__('messages.next')}}",
|
||||
"previous": "{{__('messages.previous')}}"
|
||||
},
|
||||
buttons: {
|
||||
copyTitle: "{{__('messages.copy_to_clipboard')}}",
|
||||
copySuccess: {
|
||||
_: "{{__('messages.copied_n_rows_to_clipboard')}}"
|
||||
}
|
||||
jQuery.extend($.fn.dataTable.defaults, {
|
||||
fixedHeader: false,
|
||||
aLengthMenu: [
|
||||
[25, 50, 100, 200, 500, 1000, -1], [25, 50, 100, 200, 500, 1000, "{{__('messages.all')}}"]
|
||||
],
|
||||
iDisplayLength: 25,
|
||||
dom: 'lfrtip',
|
||||
"language": {
|
||||
"emptyTable": "{{__('messages.emptyTable')}}",
|
||||
"info": "{{__('messages.dt_info')}}",
|
||||
"infoEmpty": "{{__('messages.infoEmpty')}}",
|
||||
"infoFiltered": "{{__('messages.infoFiltered')}}",
|
||||
"lengthMenu": "{{__('messages.lengthMenu')}}",
|
||||
"loadingRecords": "{{__('messages.loadingRecords')}}",
|
||||
"processing": "{{__('messages.processing')}}",
|
||||
"search": "{{__('messages.search')}}",
|
||||
"zeroRecords": "{{__('messages.zeroRecords')}}",
|
||||
"paginate": {
|
||||
"first": "{{__('messages.first')}}",
|
||||
"last": "{{__('messages.last')}}",
|
||||
"next": "{{__('messages.next')}}",
|
||||
"previous": "{{__('messages.previous')}}"
|
||||
},
|
||||
buttons: {
|
||||
copyTitle: "{{__('messages.copy_to_clipboard')}}",
|
||||
copySuccess: {
|
||||
_: "{{__('messages.copied_n_rows_to_clipboard')}}"
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }
|
||||
});
|
||||
$.ajaxSetup({
|
||||
headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}
|
||||
});
|
||||
@endif
|
||||
|
||||
$('button[type=reset]').on('click', function () {
|
||||
$(this).parents('form').find('input').val('');
|
||||
window.location.href = $(this).parents('form').attr('action');
|
||||
});
|
||||
});
|
||||
|
||||
function initialize_datetimepicker(element_name, start_date, end_date, date_format, time_format, disabled_days, enable_time_picker, time_picker_inline){
|
||||
function initialize_datetimepicker(element_name, element_date, start_date, end_date, date_format, time_format, disabled_days, enable_time_picker, time_picker_inline) {
|
||||
var start = null;
|
||||
var end = null;
|
||||
var format = '';
|
||||
@@ -215,7 +235,7 @@
|
||||
end = moment().endOf('month');
|
||||
}
|
||||
|
||||
$('#'+element_name).datetimepicker({
|
||||
$('#' + element_name).datetimepicker({
|
||||
icons: {
|
||||
time: 'far fa-clock',
|
||||
},
|
||||
@@ -226,24 +246,25 @@
|
||||
showClear: true,
|
||||
ignoreReadonly: true,
|
||||
sideBySide: side_by_side,
|
||||
defaultDate: $("input#"+element_name).data("defaultdate")
|
||||
defaultDate: element_date.length ? moment(element_date, format) : ''
|
||||
});
|
||||
}
|
||||
|
||||
function initialize_rangeslider(element_name) {
|
||||
$('#'+element_name).rangeslider({
|
||||
$('#' + element_name).rangeslider({
|
||||
polyfill: false,
|
||||
//Callback function
|
||||
onInit: function() {
|
||||
onInit: function () {
|
||||
},
|
||||
// Callback function
|
||||
onSlide: function(position, value) {
|
||||
$('.'+element_name).text(value);
|
||||
onSlide: function (position, value) {
|
||||
$('.' + element_name).text(value);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Dropzone.autoDiscover = false;
|
||||
|
||||
function initialize_dropzone(element_name, file_upload_msg, no_of_files_can_be_uploaded, max_file_size, allowed_file_type, url = null) {
|
||||
|
||||
var file_remove_url = "library/delete_file.php";
|
||||
@@ -254,11 +275,11 @@
|
||||
|
||||
var file_names = [];
|
||||
|
||||
if ($('input#'+element_name).val().length > 0) {
|
||||
file_names.push($('input#'+element_name).val());
|
||||
if ($('input#' + element_name).val().length > 0) {
|
||||
file_names.push($('input#' + element_name).val());
|
||||
}
|
||||
|
||||
$('#'+element_name).dropzone({
|
||||
$('#' + element_name).dropzone({
|
||||
paramName: "file",
|
||||
addRemoveLinks: true,
|
||||
url: url,
|
||||
@@ -266,23 +287,23 @@
|
||||
dictDefaultMessage: file_upload_msg,
|
||||
maxFiles: no_of_files_can_be_uploaded,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
acceptedFiles: allowed_file_type,
|
||||
init: function() {
|
||||
init: function () {
|
||||
//function to be use on editing a form, to display existing files
|
||||
if ($('input#'+element_name).val().length > 0) {
|
||||
if ($('input#' + element_name).val().length > 0) {
|
||||
window[`${element_name}_myDropzone`] = this;
|
||||
var file_obj = { files : $('input#'+element_name).val()};
|
||||
var file_obj = {files: $('input#' + element_name).val()};
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: '/existing-file-display',
|
||||
dataType: "json",
|
||||
data: file_obj,
|
||||
success: function(result){
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
$.each(result.files, function(key,file) {
|
||||
var mockFile = { name: file.name, uploaded_as: file.uploaded_as, size: file.size};
|
||||
$.each(result.files, function (key, file) {
|
||||
var mockFile = {name: file.name, uploaded_as: file.uploaded_as, size: file.size};
|
||||
window[`${element_name}_myDropzone`].emit("addedfile", mockFile);
|
||||
window[`${element_name}_myDropzone`].emit("thumbnail", mockFile, file.path);
|
||||
window[`${element_name}_myDropzone`].emit("complete", mockFile);
|
||||
@@ -293,35 +314,35 @@
|
||||
}
|
||||
|
||||
//function to be use on removeing a file
|
||||
this.on("removedfile", function(file) {
|
||||
this.on("removedfile", function (file) {
|
||||
$.ajax({
|
||||
url: file_remove_url,
|
||||
data: { "file_name": file.uploaded_as },
|
||||
data: {"file_name": file.uploaded_as},
|
||||
type: "POST",
|
||||
success: function(result) {
|
||||
if (typeof(result) == 'string') {
|
||||
success: function (result) {
|
||||
if (typeof (result) == 'string') {
|
||||
var result = JSON.parse(result);
|
||||
}
|
||||
|
||||
if(result.success == 1){
|
||||
if (result.success == 1) {
|
||||
toastr.success(result.msg);
|
||||
var index = file_names.indexOf(file.uploaded_as);
|
||||
|
||||
if(index!=-1){
|
||||
file_names.splice(index, 1);
|
||||
if (index != -1) {
|
||||
file_names.splice(index, 1);
|
||||
}
|
||||
|
||||
var elementVal = $('input#'+element_name).val();
|
||||
var elementVal = $('input#' + element_name).val();
|
||||
var oldVal = elementVal.split(",");
|
||||
|
||||
index = oldVal.indexOf(file.uploaded_as);
|
||||
|
||||
if(index!=-1){
|
||||
oldVal.splice(index, 1);
|
||||
if (index != -1) {
|
||||
oldVal.splice(index, 1);
|
||||
}
|
||||
|
||||
var newVal = oldVal.join(",");
|
||||
$('input#'+element_name).val(newVal);
|
||||
$('input#' + element_name).val(newVal);
|
||||
} else {
|
||||
toastr.error(result.msg);
|
||||
}
|
||||
@@ -329,15 +350,15 @@
|
||||
});
|
||||
});
|
||||
},
|
||||
success:function(file, response) {
|
||||
if (typeof(response) == 'string') {
|
||||
success: function (file, response) {
|
||||
if (typeof (response) == 'string') {
|
||||
var response = JSON.parse(response);
|
||||
}
|
||||
if (response.success == true) {
|
||||
toastr.success(response.msg);
|
||||
file_names.push(response.path);
|
||||
file.uploaded_as = response.path;
|
||||
$('input#'+element_name).val(file_names); //store file_names
|
||||
$('input#' + element_name).val(file_names); //store file_names
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
@@ -347,14 +368,14 @@
|
||||
|
||||
function initialize_text_editor(element_name, placeholder, height) {
|
||||
|
||||
$('#'+element_name).summernote({
|
||||
$('#' + element_name).summernote({
|
||||
placeholder: placeholder,
|
||||
height: height
|
||||
});
|
||||
}
|
||||
|
||||
function initialize_star_rating(element_name) {
|
||||
$("#"+element_name).rating({
|
||||
function initialize_star_rating(element_name) {
|
||||
$("#" + element_name).rating({
|
||||
theme: 'krajee-fas',
|
||||
filledStar: '<i class="fas fa-star"></i>',
|
||||
emptyStar: '<i class="fas fa-star"></i>'
|
||||
@@ -388,58 +409,58 @@
|
||||
var signaturePad = element;
|
||||
var canvas = document.getElementById(element);
|
||||
signaturePad = new SignaturePad(canvas, {
|
||||
onEnd: function(event) {
|
||||
onEnd: function (event) {
|
||||
var element = $(this)[0]._canvas.id
|
||||
var signature = $(this)[0].toDataURL();
|
||||
$('#output_'+element).val(signature);
|
||||
$('#output_' + element).val(signature);
|
||||
}
|
||||
});
|
||||
|
||||
if ($('#output_'+element).val().length > 0) {
|
||||
if ($('#output_' + element).val().length > 0) {
|
||||
|
||||
signaturePad.fromDataURL($('#output_'+element).val());
|
||||
signaturePad.fromDataURL($('#output_' + element).val());
|
||||
}
|
||||
|
||||
$(document).on('click', '#clear_'+element, function() {
|
||||
signaturePad.clear();
|
||||
$('#output_'+$(this).data('name')).val('');
|
||||
$(document).on('click', '#clear_' + element, function () {
|
||||
signaturePad.clear();
|
||||
$('#output_' + $(this).data('name')).val('');
|
||||
});
|
||||
|
||||
$(document).on('click', '#undo_'+element, function() {
|
||||
var data = signaturePad.toData();
|
||||
$(document).on('click', '#undo_' + element, function () {
|
||||
var data = signaturePad.toData();
|
||||
if (data) {
|
||||
data.pop(); // remove the last dot or line
|
||||
signaturePad.fromData(data); //draw signature from array of data
|
||||
if (data.length > 0) {
|
||||
var signature = signaturePad.toDataURL();
|
||||
$('#output_'+$(this).data('name')).val(signature);
|
||||
$('#output_' + $(this).data('name')).val(signature);
|
||||
} else {
|
||||
$('#output_'+$(this).data('name')).val('');
|
||||
$('#output_' + $(this).data('name')).val('');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initializeToastrSettingsForForm (position) {
|
||||
function initializeToastrSettingsForForm(position) {
|
||||
var toastr_position = 'toast-top-right';
|
||||
if (position) {
|
||||
toastr_position = position;
|
||||
}
|
||||
toastr.options = {
|
||||
"positionClass": toastr_position
|
||||
"positionClass": toastr_position
|
||||
}
|
||||
}
|
||||
|
||||
function initialize_countdowntimer(element) {
|
||||
$("#"+element.name).countdowntimer({
|
||||
$("#" + element.name).countdowntimer({
|
||||
hours: element.hours,
|
||||
minutes: element.minutes,
|
||||
seconds: element.seconds,
|
||||
size : element.size,
|
||||
labelsFormat : element.labels_format,
|
||||
borderColor : element.border_color,
|
||||
size: element.size,
|
||||
labelsFormat: element.labels_format,
|
||||
borderColor: element.border_color,
|
||||
fontColor: element.font_color,
|
||||
backgroundColor : element.bg_color,
|
||||
backgroundColor: element.bg_color,
|
||||
timeSeparator: element.time_separator,
|
||||
displayFormat: element.display_format
|
||||
});
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
<nav class="main-header navbar navbar-expand navbar-light @guest navbar-laravel @else navbar-white @endguest">
|
||||
<div class="container">
|
||||
@auth
|
||||
<a href="{{action([\App\Http\Controllers\HomeController::class, 'index'])}}" class="navbar-brand">
|
||||
<!-- <img src="dist/img/AdminLTELogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3"
|
||||
style="opacity: .8"> -->
|
||||
<span class="brand-text font-weight-light">{{ config('app.name', 'Laravel') }}</span>
|
||||
</a>
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item d-none d-sm-inline-block">
|
||||
<a class="nav-link" href="{{ action([\App\Http\Controllers\HomeController::class, 'index']) }}">
|
||||
<i class="fas fa-home"></i>
|
||||
{{ __('messages.home') }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
<a href="{{action([\App\Http\Controllers\HomeController::class, 'index'])}}" class="navbar-brand">
|
||||
<!-- <img src="dist/img/AdminLTELogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3"
|
||||
style="opacity: .8"> -->
|
||||
<span class="brand-text font-weight-light">{{ config('app.name', 'Laravel') }}</span>
|
||||
</a>
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item d-none d-sm-inline-block">
|
||||
<a class="nav-link" href="{{ action([\App\Http\Controllers\HomeController::class, 'index']) }}">
|
||||
<i class="fas fa-home"></i>
|
||||
{{ __('messages.home') }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
@endauth
|
||||
|
||||
<!-- Right Side Of Navbar -->
|
||||
@@ -30,68 +30,77 @@
|
||||
@endif
|
||||
@else
|
||||
<!-- superadmin menu -->
|
||||
@php
|
||||
$superadmin_emails = env('SUPERADMIN_EMAILS');
|
||||
$email_array = explode(',', $superadmin_emails);
|
||||
@endphp
|
||||
@if(in_array(Auth::user()->email, $email_array))
|
||||
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
|
||||
<li class="nav-item dropdown">
|
||||
<a id="superadminDropdown" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="nav-link dropdown-toggle">
|
||||
<a id="superadminDropdown" href="#" data-toggle="dropdown" aria-haspopup="true"
|
||||
aria-expanded="false" class="nav-link dropdown-toggle">
|
||||
<i class="fas fa-universal-access"></i>
|
||||
@lang('messages.superadmin')
|
||||
@lang('messages.' . auth()->user()->roles->first()->name)
|
||||
</a>
|
||||
|
||||
<ul aria-labelledby="superadminDropdown" class="dropdown-menu border-0 shadow">
|
||||
<li>
|
||||
@if($__enable_saas)
|
||||
<a href="{{action([\App\Http\Controllers\Superadmin\PackageController::class, 'index'])}}" class="dropdown-item">
|
||||
<a href="{{action([\App\Http\Controllers\Superadmin\PackageController::class, 'index'])}}"
|
||||
class="dropdown-item">
|
||||
<i class="fas fa-money-check"></i>
|
||||
@lang('messages.packages')
|
||||
</a>
|
||||
<a href="{{action([\App\Http\Controllers\Superadmin\PackageSubscriptionsController::class, 'index'])}}" class="dropdown-item">
|
||||
<a href="{{action([\App\Http\Controllers\Superadmin\PackageSubscriptionsController::class, 'index'])}}"
|
||||
class="dropdown-item">
|
||||
<i class="fas fa-sync"></i>
|
||||
@lang('messages.package_subscription')
|
||||
</a>
|
||||
@endif
|
||||
<a href="{{action([\App\Http\Controllers\Superadmin\ManageUsersController::class, 'index'])}}" class="dropdown-item">
|
||||
|
||||
<a href="{{action([\App\Http\Controllers\Superadmin\ManageUsersController::class, 'index'])}}"
|
||||
class="dropdown-item">
|
||||
<i class="fas fa-users"></i>
|
||||
@lang('messages.users')
|
||||
</a>
|
||||
<a class="dropdown-item" href="{{action([\App\Http\Controllers\Superadmin\SuperadminSettingsController::class, 'create'])}}">
|
||||
<i class="fa fa-cogs"></i>
|
||||
@lang('messages.system_settings')
|
||||
</a>
|
||||
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
<a class="dropdown-item"
|
||||
href="{{action([\App\Http\Controllers\Superadmin\SuperadminSettingsController::class, 'create'])}}">
|
||||
<i class="fa fa-cogs"></i>
|
||||
@lang('messages.system_settings')
|
||||
</a>
|
||||
@endif
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@endif
|
||||
<!-- /superadmin menu -->
|
||||
|
||||
|
||||
<li class="nav-item dropdown">
|
||||
<a id="navbarDropdown" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="nav-link dropdown-toggle">
|
||||
<a id="navbarDropdown" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
|
||||
class="nav-link dropdown-toggle">
|
||||
<i class="fas fa-user-tie"></i>
|
||||
{{ ucfirst(Auth::user()->name) }}
|
||||
{{ ucfirst(Auth::user()->name) }}
|
||||
</a>
|
||||
|
||||
<ul aria-labelledby="navbarDropdown" class="dropdown-menu border-0 shadow">
|
||||
<li>
|
||||
<a class="dropdown-item" href="{{action([\App\Http\Controllers\ManageProfileController::class, 'getProfile'])}}">
|
||||
<a class="dropdown-item"
|
||||
href="{{action([\App\Http\Controllers\ManageProfileController::class, 'getProfile'])}}">
|
||||
<i class="fas fa-user-edit"></i>
|
||||
@lang('messages.profile')
|
||||
</a>
|
||||
@if($__enable_saas)
|
||||
<a class="dropdown-item" href="{{action([\App\Http\Controllers\SubscriptionsController::class, 'index'])}}">
|
||||
<a class="dropdown-item"
|
||||
href="{{action([\App\Http\Controllers\SubscriptionsController::class, 'index'])}}">
|
||||
<i class="fas fa-sync"></i>
|
||||
@lang('messages.my_subscription')
|
||||
</a>
|
||||
@endif
|
||||
<a class="dropdown-item" href="{{action([\App\Http\Controllers\ManageSettingsController::class, 'getSettings'])}}">
|
||||
<a class="dropdown-item"
|
||||
href="{{action([\App\Http\Controllers\ManageSettingsController::class, 'getSettings'])}}">
|
||||
<i class="fas fa-user-cog"></i>
|
||||
@lang('messages.my_settings')
|
||||
</a>
|
||||
<a class="dropdown-item"
|
||||
href="{{ route('logout') }}"
|
||||
onclick="event.preventDefault();
|
||||
<a class="dropdown-item"
|
||||
href="{{ route('logout') }}"
|
||||
onclick="event.preventDefault();
|
||||
document.getElementById('logout-form').submit();">
|
||||
<i class="fas fa-sign-out-alt"></i>
|
||||
{{ __('Logout') }}
|
||||
@@ -106,7 +115,7 @@
|
||||
@endguest
|
||||
</ul>
|
||||
|
||||
<!-- Left navbar links -->
|
||||
<!-- Left navbar links -->
|
||||
<!-- <ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
</li>
|
||||
@@ -131,4 +140,4 @@
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
<!-- /.navbar -->
|
||||
<!-- /.navbar -->
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<form id="add_user_form" action="{{action([\App\Http\Controllers\Superadmin\ManageUsersController::class, 'store'])}}" method="POST">
|
||||
<form id="add_user_form"
|
||||
action="{{action([\App\Http\Controllers\Superadmin\ManageUsersController::class, 'store'])}}" method="POST">
|
||||
{{ csrf_field() }}
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@@ -20,7 +21,7 @@
|
||||
</label>
|
||||
|
||||
<input type="text" class="form-control"
|
||||
name="name" id="name" required>
|
||||
name="name" id="name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
@@ -31,7 +32,7 @@
|
||||
</label>
|
||||
|
||||
<input type="email" class="form-control"
|
||||
name="email" id="email" required>
|
||||
name="email" id="email" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -44,57 +45,61 @@
|
||||
</label>
|
||||
|
||||
<input type="password" class="form-control"
|
||||
name="password" id="password" required>
|
||||
name="password" id="password" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" id="is_active" name="is_active" value="1" checked>
|
||||
<input type="checkbox" class="form-check-input" id="is_active" name="is_active" value="1"
|
||||
checked>
|
||||
<label class="form-check-label" for="is_active">
|
||||
@lang('messages.is_active')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.is_active_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="send_email" id="send_email" value="1">
|
||||
<label class="form-check-label" for="send_email">
|
||||
@lang('messages.send_email')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.send_email_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="can_create_form" id="can_create_form" value="1">
|
||||
<label class="form-check-label" for="can_create_form">
|
||||
@lang('messages.can_create_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_create_form_tooltip')"></i>
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.is_active_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="show_form_response_user" id="show_form_response_user" value="1">
|
||||
<label class="form-check-label" for="show_form_response_user">
|
||||
@lang('messages.show_form_response_user')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.show_form_response_user_tooltip')"></i>
|
||||
</label>
|
||||
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value]))
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" id="is_admin" name="is_admin">
|
||||
<label class="form-check-label" for="is_admin">
|
||||
@lang('messages.is_admin')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.is_admin_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="show_edit_buttons_form" id="show_edit_buttons_form" value="1">
|
||||
<label class="form-check-label" for="show_edit_buttons_form">
|
||||
@lang('messages.show_edit_buttons_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.show_edit_buttons_form_tooltip')"></i>
|
||||
</label>
|
||||
@endif
|
||||
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="send_email" id="send_email"
|
||||
value="1">
|
||||
<label class="form-check-label" for="send_email">
|
||||
@lang('messages.send_email')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.send_email_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="can_create_form"
|
||||
id="can_create_form" value="1">
|
||||
<label class="form-check-label" for="can_create_form">
|
||||
@lang('messages.can_create_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_create_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="card assign-form p-3">
|
||||
<div class="row">
|
||||
@@ -115,30 +120,40 @@
|
||||
</div>
|
||||
<h5>@lang('messages.permission_for_forms'):</h5>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_design" value="can_design_form">
|
||||
<label class="form-check-label" for="form_design">
|
||||
@lang('messages.can_design_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_design_form_tooltip')"></i>
|
||||
</label>
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]"
|
||||
id="form_design"
|
||||
value="can_design_form">
|
||||
<label class="form-check-label" for="form_design">
|
||||
@lang('messages.can_design_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_design_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_data" value="can_view_data">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_data"
|
||||
value="can_view_data">
|
||||
<label class="form-check-label" for="form_data">
|
||||
@lang('messages.can_view_data')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_data_tooltip')"></i>
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_view_data_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_view" value="can_view_form">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_view"
|
||||
value="can_view_form">
|
||||
<label class="form-check-label" for="form_view">
|
||||
@lang('messages.can_view_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_form_tooltip')"></i>
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_view_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<form id="edit_user_form" action="{{action([\App\Http\Controllers\Superadmin\ManageUsersController::class, 'update'], [$user->id])}}" method="PUT">
|
||||
<form id="edit_user_form"
|
||||
action="{{action([\App\Http\Controllers\Superadmin\ManageUsersController::class, 'update'], [$user->id])}}"
|
||||
method="PUT">
|
||||
{{ csrf_field() }}
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@@ -21,7 +23,7 @@
|
||||
</label>
|
||||
|
||||
<input type="text" class="form-control"
|
||||
name="name" id="name" value="{{$user->name}}" required>
|
||||
name="name" id="name" value="{{$user->name}}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
@@ -32,7 +34,7 @@
|
||||
</label>
|
||||
|
||||
<input type="email" class="form-control"
|
||||
name="email" id="email" value="{{$user->email}}" required>
|
||||
name="email" id="email" value="{{$user->email}}" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -43,7 +45,7 @@
|
||||
@lang('messages.password')
|
||||
</label>
|
||||
<input type="password" class="form-control"
|
||||
name="password" id="password" aria-describedby="passwordHelp">
|
||||
name="password" id="password" aria-describedby="passwordHelp">
|
||||
<small id="passwordHelp" class="form-text text-muted">
|
||||
@lang('messages.dont_want_to_change_keep_it_blank')
|
||||
</small>
|
||||
@@ -51,166 +53,189 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" id="is_active" name="is_active" value="1" @if($user->is_active) checked @endif>
|
||||
<input type="checkbox" class="form-check-input" id="is_active" name="is_active" value="1"
|
||||
@if($user->is_active) checked @endif>
|
||||
<label class="form-check-label" for="is_active">
|
||||
@lang('messages.is_active')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.is_active_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="send_email" id="send_email" value="1">
|
||||
<label class="form-check-label" for="send_email">
|
||||
@lang('messages.send_email')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.send_email_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="can_create_form" id="can_create_form" value="1" @if($user->can_create_form) checked @endif>
|
||||
<label class="form-check-label" for="can_create_form">
|
||||
@lang('messages.can_create_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_create_form_tooltip')"></i>
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.is_active_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="show_form_response_user" id="show_form_response_user" value="1" @if($user->show_form_response_user) checked @endif>
|
||||
<label class="form-check-label" for="show_form_response_user">
|
||||
@lang('messages.show_form_response_user')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.show_form_response_user_tooltip')"></i>
|
||||
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" id="is_admin" name="is_admin"
|
||||
@if($user->hasRole(\App\Enums\User\RoleEnum::ADMIN->value)) checked @endif>
|
||||
<label class="form-check-label" for="is_admin">
|
||||
@lang('messages.is_admin')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.is_admin_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="send_email" id="send_email"
|
||||
value="1">
|
||||
<label class="form-check-label" for="send_email">
|
||||
@lang('messages.send_email')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.send_email_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="can_create_form"
|
||||
id="can_create_form" value="1" @if($user->can_create_form) checked @endif>
|
||||
<label class="form-check-label" for="can_create_form">
|
||||
@lang('messages.can_create_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_create_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@php
|
||||
$form_ids = $assigned_forms->pluck('form_id')->toArray();
|
||||
@endphp
|
||||
@if($assigned_forms->count() > 0)
|
||||
<h5>@lang('messages.assigned_forms'):</h5>
|
||||
@foreach($assigned_forms as $key => $assigned_form)
|
||||
<div class="card edit-assigned-form mb-4 p-3">
|
||||
<label>
|
||||
<i class="fab fa-wpforms"></i>
|
||||
{{$assigned_form->form->name}}
|
||||
</label>
|
||||
<div class="row">
|
||||
<input type="hidden" name="edit_assigned_form_id[]" value="{{$assigned_form->id}}">
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input"
|
||||
name="edit_permissions[{{$assigned_form->id}}][]"
|
||||
id="form_design_{{$key}}" value="can_design_form"
|
||||
@if(in_array('can_design_form', $assigned_form->permissions))
|
||||
checked
|
||||
@endif>
|
||||
<label class="form-check-label" for="form_design_{{$key}}">
|
||||
@lang('messages.can_design_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_design_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input"
|
||||
name="edit_permissions[{{$assigned_form->id}}][]"
|
||||
id="form_data_{{$key}}" value="can_view_data"
|
||||
@if(in_array('can_view_data', $assigned_form->permissions))
|
||||
checked
|
||||
@endif>
|
||||
<label class="form-check-label" for="form_data_{{$key}}">
|
||||
@lang('messages.can_view_data')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_view_data_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input"
|
||||
name="edit_permissions[{{$assigned_form->id}}][]"
|
||||
id="can_view_form_{{$key}}" value="can_view_form"
|
||||
@if(in_array('can_view_form', $assigned_form->permissions))
|
||||
checked
|
||||
@endif>
|
||||
<label class="form-check-label" for="can_view_form_{{$key}}">
|
||||
@lang('messages.can_view_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_view_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<div class="card assign-form p-3">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="assign_form">
|
||||
@lang('messages.assign_forms'):
|
||||
</label>
|
||||
<select multiple class="form-control" id="assign_form" name="form_id[]">
|
||||
@foreach($forms as $key => $value)
|
||||
@if(!in_array($key, $form_ids))
|
||||
<option value="{{$key}}">
|
||||
{{$value}}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="show_edit_buttons_form" id="show_edit_buttons_form" value="1" @if($user->show_edit_buttons_form) checked @endif>
|
||||
<label class="form-check-label" for="show_edit_buttons_form">
|
||||
@lang('messages.show_edit_buttons_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.show_edit_buttons_form_tooltip')"></i>
|
||||
</label>
|
||||
<h5>@lang('messages.permission_for_forms'):</h5>
|
||||
<div class="row">
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]"
|
||||
id="form_design" value="can_design_form">
|
||||
<label class="form-check-label" for="form_design">
|
||||
@lang('messages.can_design_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_design_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_data"
|
||||
value="can_view_data">
|
||||
<label class="form-check-label" for="form_data">
|
||||
@lang('messages.can_view_data')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_view_data_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_view"
|
||||
value="can_view_form">
|
||||
<label class="form-check-label" for="form_view">
|
||||
@lang('messages.can_view_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_view_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(auth()->user()->id != $user->id)
|
||||
@php
|
||||
$form_ids = $assigned_forms->pluck('form_id')->toArray();
|
||||
@endphp
|
||||
@if($assigned_forms->count() > 0)
|
||||
<h5>@lang('messages.assigned_forms'):</h5>
|
||||
@foreach($assigned_forms as $key => $assigned_form)
|
||||
<div class="card edit-assigned-form mb-4 p-3">
|
||||
<label>
|
||||
<i class="fab fa-wpforms"></i>
|
||||
{{$assigned_form->form->name}}
|
||||
</label>
|
||||
<div class="row">
|
||||
<input type="hidden" name="edit_assigned_form_id[]" value="{{$assigned_form->id}}">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="edit_permissions[{{$assigned_form->id}}][]" id="form_design_{{$key}}" value="can_design_form"
|
||||
@if(in_array('can_design_form', $assigned_form->permissions))
|
||||
checked
|
||||
@endif>
|
||||
<label class="form-check-label" for="form_design_{{$key}}">
|
||||
@lang('messages.can_design_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_design_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="edit_permissions[{{$assigned_form->id}}][]" id="form_data_{{$key}}" value="can_view_data"
|
||||
@if(in_array('can_view_data', $assigned_form->permissions))
|
||||
checked
|
||||
@endif>
|
||||
<label class="form-check-label" for="form_data_{{$key}}">
|
||||
@lang('messages.can_view_data')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_data_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="edit_permissions[{{$assigned_form->id}}][]" id="can_view_form_{{$key}}" value="can_view_form"
|
||||
@if(in_array('can_view_form', $assigned_form->permissions))
|
||||
checked
|
||||
@endif>
|
||||
<label class="form-check-label" for="can_view_form_{{$key}}">
|
||||
@lang('messages.can_view_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<div class="card assign-form p-3">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="assign_form">
|
||||
@lang('messages.assign_forms'):
|
||||
</label>
|
||||
<select multiple class="form-control" id="assign_form" name="form_id[]">
|
||||
@foreach($forms as $key => $value)
|
||||
@if(!in_array($key, $form_ids))
|
||||
<option value="{{$key}}">
|
||||
{{$value}}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h5>@lang('messages.permission_for_forms'):</h5>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_design" value="can_design_form">
|
||||
<label class="form-check-label" for="form_design">
|
||||
@lang('messages.can_design_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_design_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_data" value="can_view_data">
|
||||
<label class="form-check-label" for="form_data">
|
||||
@lang('messages.can_view_data')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_data_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_view" value="can_view_form">
|
||||
<label class="form-check-label" for="form_view">
|
||||
@lang('messages.can_view_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-sm btn-primary submit_btn">
|
||||
@lang('messages.update')
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-sm btn-primary submit_btn">
|
||||
@lang('messages.update')
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -60,7 +60,6 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<div id="export-btns" class="float-right"></div>
|
||||
<table class="table" id="users_table">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -83,7 +82,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal" id="user_modal" tabindex="-1" role="dialog"></div>
|
||||
@endsection
|
||||
@@ -115,9 +114,9 @@
|
||||
columns: [0,1,2,3]
|
||||
},
|
||||
title: '{{config("app.name") ."-". __("messages.all_users")}}'
|
||||
}
|
||||
}
|
||||
],
|
||||
dom: 'lBfrtip',
|
||||
dom: 'lfrtip',
|
||||
fixedHeader: false,
|
||||
columns: [
|
||||
{ data: 'name' , name: 'name'},
|
||||
@@ -140,7 +139,7 @@
|
||||
if(response.success == true){
|
||||
toastr.success(response.msg);
|
||||
users_table.ajax.reload();
|
||||
} else {
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
@@ -159,7 +158,7 @@
|
||||
if(response.success == true){
|
||||
toastr.success(response.msg);
|
||||
users_table.ajax.reload();
|
||||
} else {
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
@@ -311,7 +310,7 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).on('submit', 'form[data-type="form"]', function (e) {
|
||||
e.preventDefault();
|
||||
var data = $(this).serialize();
|
||||
@@ -352,4 +351,4 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user