update_21.09.23
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
|
||||
namespace App;
|
||||
|
||||
use App\Traits\UsesUuid;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FormData extends Model
|
||||
{
|
||||
use \App\Traits\UsesUuid;
|
||||
use UsesUuid;
|
||||
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Enums\User\RoleEnum;
|
||||
use App\Form;
|
||||
use App\PackageSubscription;
|
||||
use App\User;
|
||||
@@ -143,9 +144,10 @@ class FormController extends Controller
|
||||
$request->session()->forget('validated_protected_form');
|
||||
$nav = false;
|
||||
$iframe_enabled = $request->get('iframe', false);
|
||||
$action_by = auth()->user()->roles->first()->name;
|
||||
|
||||
return view('form.show')
|
||||
->with(compact('form', 'nav', 'is_form_closed', 'form_closed_msg', 'iframe_enabled'));
|
||||
->with(compact('form', 'nav', 'is_form_closed', 'form_closed_msg', 'iframe_enabled', 'action_by'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,7 +170,7 @@ class FormController extends Controller
|
||||
|
||||
//check permission if user is not a creator
|
||||
$has_permission = ($form->created_by != $user_id) ? $this->doUserHavePermission($form->id, 'can_design_form') : true;
|
||||
if (! $has_permission) {
|
||||
if (!$form->created_by !== $user_id && !auth()->user()->hasRole([RoleEnum::ADMIN->value, RoleEnum::SUPERVISOR->value])) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Enums\User\RoleEnum;
|
||||
use App\Form;
|
||||
use App\FormData;
|
||||
use App\Mail\FormSubmitted;
|
||||
@@ -10,6 +11,7 @@ use Carbon\Carbon;
|
||||
use DB;
|
||||
use DNS1D;
|
||||
use DNS2D;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
@@ -78,7 +80,18 @@ class FormDataController extends Controller
|
||||
$existing_token_form_data = [];
|
||||
if (!empty($request->get('token'))) {
|
||||
$existing_token_form_data = FormData::where('form_id', $form->id)
|
||||
->where('token', $request->get('token'))
|
||||
->when(
|
||||
$request->get('token') === 'null',
|
||||
function (Builder $builder) {
|
||||
$builder->whereNull('token');
|
||||
}
|
||||
)
|
||||
->when(
|
||||
$request->get('token') !== 'null',
|
||||
function (Builder $builder) use ($request) {
|
||||
$builder->where('token', $request->get('token'));
|
||||
}
|
||||
)
|
||||
->findOrFail($request->get('form_data_id'));
|
||||
}
|
||||
|
||||
@@ -125,7 +138,18 @@ class FormDataController extends Controller
|
||||
//if token exist update the submitted data
|
||||
if (!empty($request->get('token'))) {
|
||||
$submission = FormData::where('form_id', $form->id)
|
||||
->where('token', $request->get('token'))
|
||||
->when(
|
||||
$request->get('token') === 'null',
|
||||
function (Builder $builder) {
|
||||
$builder->whereNull('token');
|
||||
}
|
||||
)
|
||||
->when(
|
||||
$request->get('token') !== 'null',
|
||||
function (Builder $builder) use ($request) {
|
||||
$builder->where('token', $request->get('token'));
|
||||
}
|
||||
)
|
||||
->findOrFail($request->get('form_data_id'));
|
||||
|
||||
$submission->data = $form_data['data'];
|
||||
@@ -448,13 +472,62 @@ class FormDataController extends Controller
|
||||
$user_id = $request->user()->id;
|
||||
|
||||
$form = Form::findOrFail($form_id);
|
||||
$data = FormData::where('form_id', $form_id)
|
||||
$data = FormData::query()
|
||||
->where('form_id', $form_id)
|
||||
->orderBy('created_at', 'desc')
|
||||
->get();
|
||||
->get()
|
||||
->filter(function (FormData $formData) use ($request) {
|
||||
if (is_array($formData->data)) {
|
||||
$date = strtotime(
|
||||
array_values(
|
||||
array_filter($formData->data, fn($item) => is_string($item) && strtotime($item))
|
||||
)[0]
|
||||
);
|
||||
}
|
||||
|
||||
$date = Carbon::createFromTimestamp($date)->toDateString();
|
||||
$isValidStartDate = $request->filled('start_date') ?
|
||||
$request->get('start_date') <= $date :
|
||||
Carbon::now()->subDays(7)->toDateString() <= $date;
|
||||
$isValidEndDate = $request->filled('end_date') ?
|
||||
$request->get('end_date') >= $date :
|
||||
Carbon::now()->toDateString() >= $date;
|
||||
|
||||
return $isValidStartDate && $isValidEndDate;
|
||||
});
|
||||
|
||||
// ->when(
|
||||
// $request->filled('start_date'),
|
||||
// function (Builder $builder) use ($request) {
|
||||
// $startDate = Carbon::createFromFormat('Y-m-d', $request->get('start_date'));
|
||||
//
|
||||
// $builder->where('created_at', '>=', $startDate->toDateTimeString());
|
||||
// }
|
||||
// )
|
||||
// ->when(
|
||||
// $request->filled('end_date'),
|
||||
// function (Builder $builder) use ($request) {
|
||||
// $endDate = Carbon::createFromFormat('Y-m-d', $request->get('end_date'));
|
||||
//
|
||||
// $builder->where('created_at', '<=', $endDate->toDateTimeString());
|
||||
// }
|
||||
// )
|
||||
// ->when(
|
||||
// !$request->filled('start_date'),
|
||||
// function (Builder $builder) {
|
||||
// $builder->where('created_at', '>=', Carbon::now()->subDays(7)->toDateTimeString());
|
||||
// }
|
||||
// )
|
||||
// ->when(
|
||||
// !$request->filled('end_date'),
|
||||
// function (Builder $builder) {
|
||||
// $builder->where('created_at', '<=', Carbon::now()->toDateTimeString());
|
||||
// }
|
||||
// );
|
||||
|
||||
//check permission if user is not a creator
|
||||
$has_permission = ($form->created_by != $user_id) ? $this->doUserHavePermission($form->id, 'can_view_data') : true;
|
||||
if (! $has_permission) {
|
||||
if (!$form->created_by !== $user_id && !auth()->user()->hasRole([RoleEnum::SUPERVISOR->value, RoleEnum::ADMIN->value]) && !$has_permission) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
@@ -706,7 +779,7 @@ class FormDataController extends Controller
|
||||
}
|
||||
|
||||
$nav = false;
|
||||
$action_by = 'admin';
|
||||
$action_by = auth()->user()->roles->first()->name;
|
||||
|
||||
return view('form.show')
|
||||
->with(compact('form', 'nav', 'action_by'));
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Enums\User\RoleEnum;
|
||||
use App\Form;
|
||||
use App\Mail\TestEmail;
|
||||
use App\PackageSubscription;
|
||||
use App\UserForm;
|
||||
use Carbon\Carbon;
|
||||
use DB;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Yajra\DataTables\Facades\DataTables;
|
||||
@@ -33,14 +35,34 @@ class HomeController extends Controller
|
||||
{
|
||||
$user = request()->user();
|
||||
|
||||
if (request()->ajax()) {
|
||||
$subscription = PackageSubscription::activeSubscription($user->id);
|
||||
|
||||
$forms = Form::leftJoin('form_data', 'forms.id', '=', 'form_data.form_id')
|
||||
->select('name', 'slug', 'description', 'forms.created_at', 'forms.id', DB::raw('COUNT(form_data.form_id) as data_count'), 'schema')
|
||||
if (auth()->user()->hasRole(RoleEnum::SUPERVISOR->value, 'web')) {
|
||||
$forms = Form::query()
|
||||
->withCount('data')
|
||||
->where('is_template', 0)
|
||||
->get();
|
||||
} else {
|
||||
$forms = Form::query()
|
||||
->withCount('data')
|
||||
->where('is_template', 0)
|
||||
->where('created_by', $user->id)
|
||||
->groupBy('id');
|
||||
}
|
||||
|
||||
if (request()->ajax()) {
|
||||
$subscription = PackageSubscription::activeSubscription($user->id);
|
||||
|
||||
if (auth()->user()->hasRole(RoleEnum::SUPERVISOR->value, 'web')) {
|
||||
$forms = Form::query()
|
||||
->withCount('data')
|
||||
->where('is_template', 0)
|
||||
->get();
|
||||
} else {
|
||||
$forms = Form::query()
|
||||
->withCount('data')
|
||||
->where('is_template', 0)
|
||||
->where('created_by', $user->id)
|
||||
->get();
|
||||
}
|
||||
|
||||
return DataTables::of($forms)
|
||||
->addColumn(
|
||||
@@ -61,40 +83,44 @@ class HomeController extends Controller
|
||||
<i class="fa fa-edit" aria-hidden="true"></i>
|
||||
</a>';
|
||||
|
||||
if (auth()->user()->hasRole(RoleEnum::SUPERVISOR->value) || auth()->user()->id === $form->created_by) {
|
||||
$action .= '<button type="button" data-href="' . action([\App\Http\Controllers\FormController::class, 'destroy'], ['form' => $form->id]) . '"' . ' class="btn btn-sm btn-danger delete_form m-1" data-toggle="tooltip"
|
||||
title="' . __('messages.delete') . '">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
</button>';
|
||||
}
|
||||
|
||||
if (auth()->user()->hasRole(RoleEnum::SUPERVISOR->value) || auth()->user()->id === $form->created_by) {
|
||||
$action .= '<button type="button" data-href="' . action([\App\Http\Controllers\FormController::class, 'copyForm'], ['id' => $form->id]) . '"' . ' class="btn btn-sm btn-primary copy_form m-1" data-toggle="tooltip"
|
||||
title="' . __('messages.copy_this_form') . '">
|
||||
<i class="fas fa-copy"></i>
|
||||
</button>';
|
||||
}
|
||||
|
||||
if (auth()->user()->hasRole(RoleEnum::SUPERVISOR->value) || auth()->user()->id === $form->created_by) {
|
||||
$action .= '<button type="button" data-href="' . action([\App\Http\Controllers\FormController::class, 'generateWidget'], ['id' => $form->id]) . '"' . ' class="btn btn-sm btn-info generate_widget m-1" data-toggle="tooltip"
|
||||
title="' . __('messages.widget') . '">
|
||||
<i class="fa fa-random" aria-hidden="true"></i>
|
||||
</button>';
|
||||
}
|
||||
|
||||
$action .= '<a href="' . action([\App\Http\Controllers\FormDataController::class, 'show'], ['id' => $form->id]) . '"' . '"
|
||||
target="_blank"
|
||||
class="btn btn-sm btn-success m-1" data-toggle="tooltip" title="' . __('messages.view_form_data') . '">
|
||||
<i class="fa fa-list" aria-hidden="true"></i>
|
||||
</a>';
|
||||
|
||||
$superadmins = env('SUPERADMIN_EMAILS');
|
||||
$superadmin_emails = explode(',', $superadmins);
|
||||
if (in_array($user->email, $superadmin_emails) ||
|
||||
(is_saas_enabled() && (isset($subscription->package_details['is_form_downloadable']) && $subscription->package_details['is_form_downloadable'])) || ! is_saas_enabled()) {
|
||||
if (auth()->user()->hasRole(RoleEnum::SUPERVISOR->value) || auth()->user()->id === $form->created_by) {
|
||||
$action .= '<a href="' . action([\App\Http\Controllers\FormController::class, 'downloadCode'], ['id' => $form->id]) . '"' . '" class="btn btn-sm btn-dark m-1" data-toggle="tooltip"
|
||||
title="' . __('messages.download_code') . '">
|
||||
<i class="fas fa-download" aria-hidden="true"></i>
|
||||
</a>';
|
||||
}
|
||||
|
||||
if (auth()->user()->hasRole(RoleEnum::SUPERVISOR->value) || auth()->user()->id === $form->created_by) {
|
||||
$action .= '<a data-href="' . action([\App\Http\Controllers\FormController::class, 'getCollab'], ['id' => $form->id]) . '"' . 'class="btn btn-sm btn-primary m-1 collab_btn" data-toggle="tooltip" title="' . __('messages.collaborate') . '">
|
||||
<i class="fas fa-handshake text-white" aria-hidden="true"></i>
|
||||
</a>';
|
||||
}
|
||||
|
||||
return $action;
|
||||
}
|
||||
@@ -128,9 +154,7 @@ class HomeController extends Controller
|
||||
}
|
||||
|
||||
//Count forms
|
||||
$form_count = Form::where('created_by', $user->id)
|
||||
->where('is_template', 0)
|
||||
->count();
|
||||
$form_count = $forms->count();
|
||||
|
||||
//Count templates.
|
||||
$template_count = Form::where('created_by', $user->id)
|
||||
@@ -140,7 +164,9 @@ class HomeController extends Controller
|
||||
//Count submissions.
|
||||
$submission_count = Form::join('form_data as fd', 'forms.id', '=', 'fd.form_id')
|
||||
->where('is_template', 0)
|
||||
->where('created_by', $user->id)
|
||||
->when(auth()->user()->hasRole(RoleEnum::USER->value), function (Builder $builder) use ($user) {
|
||||
$builder->where('created_by', $user->id);
|
||||
})
|
||||
->count();
|
||||
|
||||
return view('home')
|
||||
@@ -259,7 +285,7 @@ class HomeController extends Controller
|
||||
'action',
|
||||
function ($row) {
|
||||
$action = '';
|
||||
if (! empty($row->permissions) && in_array('can_view_form', $row->permissions) && auth()->user()->show_edit_buttons_form) {
|
||||
if ((!empty($row->permissions) && in_array('can_view_form', $row->permissions)) || auth()->user()->hasRole(RoleEnum::SUPERVISOR->value)) {
|
||||
$action = '<a href="' . action([\App\Http\Controllers\FormController::class, 'show'], ['form' => $row->slug ?: $row->form_id]) . '"' . '
|
||||
target="_blank"
|
||||
class="btn btn-sm btn-info m-1" data-toggle="tooltip" title="' . __('messages.view') . '">
|
||||
@@ -267,21 +293,28 @@ class HomeController extends Controller
|
||||
</a>';
|
||||
}
|
||||
|
||||
if (! empty($row->permissions) && in_array('can_design_form', $row->permissions) && auth()->user()->show_edit_buttons_form) {
|
||||
if ((!empty($row->permissions) && in_array('can_design_form', $row->permissions)) || auth()->user()->hasRole(RoleEnum::SUPERVISOR->value)) {
|
||||
$action .= '<a href="' . action([\App\Http\Controllers\FormController::class, 'edit'], ['form' => $row->form_id]) . '"' . '
|
||||
class="btn btn-sm btn-warning m-1" data-toggle="tooltip" title="' . __('messages.edit') . '">
|
||||
<i class="fa fa-edit" aria-hidden="true"></i>
|
||||
</a>';
|
||||
}
|
||||
|
||||
if (! empty($row->permissions) && in_array('can_view_data', $row->permissions) && auth()->user()->show_edit_buttons_form) {
|
||||
if ((!empty($row->permissions) && in_array('can_view_data', $row->permissions)) || auth()->user()->hasRole(RoleEnum::SUPERVISOR->value)) {
|
||||
$action .= '<a href="' . action([\App\Http\Controllers\FormDataController::class, 'show'], ['id' => $row->form_id]) . '"' . '"
|
||||
target="_blank"
|
||||
class="btn btn-sm btn-success m-1" data-toggle="tooltip" title="' . __('messages.view_form_data') . '">
|
||||
<i class="fa fa-list" aria-hidden="true"></i>
|
||||
</a>';
|
||||
}
|
||||
|
||||
if (auth()->user()->hasRole(RoleEnum::SUPERVISOR->value)) {
|
||||
$action .= '<a href="' . action([\App\Http\Controllers\FormDataController::class, 'getReport'], ['id' => $row->form_id]) . '"' . '"
|
||||
target="_blank"
|
||||
class="btn btn-sm btn-success m-1" data-toggle="tooltip" title="' . __('messages.report') . '">
|
||||
<i class="fas fa-chart-pie" aria-hidden="true"></i>
|
||||
</a>';
|
||||
}
|
||||
|
||||
return $action;
|
||||
}
|
||||
)
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
|
||||
namespace App\Http\Controllers\Superadmin;
|
||||
|
||||
use App\Enums\User\RoleEnum;
|
||||
use App\Form;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Notifications\UserNotification;
|
||||
use App\Package;
|
||||
use App\User;
|
||||
use App\UserForm;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Http\Request;
|
||||
use Yajra\DataTables\Facades\DataTables;
|
||||
|
||||
@@ -20,12 +22,20 @@ class ManageUsersController extends Controller
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
if (! auth()->user()->can('superadmin')) {
|
||||
if (!auth()->user()->hasRole([RoleEnum::ADMIN->value, RoleEnum::SUPERVISOR->value], 'web')) {
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
|
||||
if ($request->ajax()) {
|
||||
$users = User::select('name', 'email', 'is_active', 'created_at', 'id');
|
||||
$supervisor = User::role(RoleEnum::SUPERVISOR->value)->first();
|
||||
$users = User::query()
|
||||
->when(
|
||||
!auth()->user()->hasRole(RoleEnum::SUPERVISOR->value),
|
||||
function (Builder $builder) use ($supervisor) {
|
||||
$builder->whereNotIn('id', [$supervisor->id]);
|
||||
}
|
||||
)
|
||||
->select(['id', 'name', 'email', 'is_active', 'created_at']);
|
||||
|
||||
if (! empty($request->input('status'))) {
|
||||
$is_active = ($request->input('status') == 'active') ? 1 : 0;
|
||||
@@ -52,9 +62,11 @@ class ManageUsersController extends Controller
|
||||
<a class="btn btn-link btn-icon btn-sm text-info edit_user pointer" data-href="{{action([\App\Http\Controllers\Superadmin\ManageUsersController::class, "edit"], [$id])}}" title="@lang("messages.edit")">
|
||||
<i class="fas fa-edit font_icon_size"></i>
|
||||
</a>
|
||||
@if(1 === 0)
|
||||
<a class="btn btn-link btn-icon btn-sm text-info upgrade_account pointer" data-href="{{action([\App\Http\Controllers\Superadmin\ManageUsersController::class, "upgrade"], [$id])}}" title="@lang("messages.edit")">
|
||||
<i class="fas fa-money-check font_icon_size"></i>
|
||||
</a>
|
||||
@endif
|
||||
<a class="btn btn-link btn-icon btn-sm text-danger delete_user pointer" data-href="{{action([\App\Http\Controllers\Superadmin\ManageUsersController::class, "destroy"], [$id])}}" title="@lang("messages.delete")">
|
||||
<i class="fas fa-trash-alt font_icon_size"></i>
|
||||
</a>
|
||||
@@ -104,7 +116,6 @@ class ManageUsersController extends Controller
|
||||
$user = request()->user();
|
||||
|
||||
$forms = Form::where('is_template', 0)
|
||||
->where('created_by', $user->id)
|
||||
->pluck('name', 'id')
|
||||
->toArray();
|
||||
|
||||
@@ -126,7 +137,7 @@ class ManageUsersController extends Controller
|
||||
return $this->notAllowedInDemo();
|
||||
}
|
||||
|
||||
$input = $request->only('name', 'email', 'is_active', 'can_create_form', 'show_form_response_user', 'show_edit_buttons_form');
|
||||
$input = $request->only('name', 'email', 'is_active', 'is_admin', 'can_create_form');
|
||||
|
||||
if (! empty($request->input('password'))) {
|
||||
$input['password'] = bcrypt($request->input('password'));
|
||||
@@ -134,10 +145,14 @@ class ManageUsersController extends Controller
|
||||
|
||||
$input['is_active'] = ! empty($input['is_active']) ? 1 : 0;
|
||||
$input['can_create_form'] = ! empty($input['can_create_form']) ? 1 : 0;
|
||||
$input['show_form_response_user'] = ! empty($input['show_form_response_user']) ? 1 : 0;
|
||||
$input['show_edit_buttons_form'] = ! empty($input['show_edit_buttons_form']) ? 1 : 0;
|
||||
|
||||
$user = User::create($input);
|
||||
$user = User::query()->create($input);
|
||||
|
||||
if ($request->filled('is_admin')) {
|
||||
$user->assignRole(RoleEnum::ADMIN->value);
|
||||
} else {
|
||||
$user->assignRole(RoleEnum::USER->value);
|
||||
}
|
||||
|
||||
//save user forms (assgined)
|
||||
$permissions = $request->input('permissions');
|
||||
@@ -190,8 +205,16 @@ class ManageUsersController extends Controller
|
||||
if (request()->ajax()) {
|
||||
$user = User::findOrFail($id);
|
||||
|
||||
$logged_in_user = request()->user();
|
||||
if (auth()->user()->hasRole([RoleEnum::SUPERVISOR->value, RoleEnum::ADMIN->value])) {
|
||||
$forms = Form::where('is_template', 0)
|
||||
->pluck('name', 'id')
|
||||
->toArray();
|
||||
|
||||
$assigned_forms = UserForm::with('form')
|
||||
->where('assigned_to', $id)
|
||||
->get();
|
||||
} else {
|
||||
$logged_in_user = request()->user();
|
||||
$forms = Form::where('is_template', 0)
|
||||
->where('created_by', $logged_in_user->id)
|
||||
->pluck('name', 'id')
|
||||
@@ -201,6 +224,7 @@ class ManageUsersController extends Controller
|
||||
->where('assigned_by', \Auth::id())
|
||||
->where('assigned_to', $id)
|
||||
->get();
|
||||
}
|
||||
|
||||
return view('superadmin.users.edit')
|
||||
->with(compact('user', 'forms', 'assigned_forms'));
|
||||
@@ -221,11 +245,9 @@ class ManageUsersController extends Controller
|
||||
return $this->notAllowedInDemo();
|
||||
}
|
||||
|
||||
$input = $request->only('name', 'email', 'is_active', 'can_create_form', 'show_form_response_user', 'show_edit_buttons_form');
|
||||
$input = $request->only('name', 'email', 'is_active', 'is_admin', 'can_create_form');
|
||||
$input['is_active'] = ! empty($input['is_active']) ? 1 : 0;
|
||||
$input['can_create_form'] = ! empty($input['can_create_form']) ? 1 : 0;
|
||||
$input['show_form_response_user'] = ! empty($input['show_form_response_user']) ? 1 : 0;
|
||||
$input['show_edit_buttons_form'] = ! empty($input['show_edit_buttons_form']) ? 1 : 0;
|
||||
|
||||
if (! empty($request->input('password'))) {
|
||||
$input['password'] = bcrypt($request->input('password'));
|
||||
@@ -234,6 +256,14 @@ class ManageUsersController extends Controller
|
||||
$user = User::findOrFail($id);
|
||||
$user->update($input);
|
||||
|
||||
if ($request->filled('is_admin') && $request->input('is_admin') === 'on') {
|
||||
$user->assignRole(RoleEnum::ADMIN->value);
|
||||
$user->removeRole(RoleEnum::USER->value);
|
||||
} else {
|
||||
$user->removeRole(RoleEnum::ADMIN->value);
|
||||
$user->assignRole(RoleEnum::USER->value);
|
||||
}
|
||||
|
||||
//update user forms (assgined)
|
||||
$edit_permissions = $request->input('edit_permissions');
|
||||
$assgined_form_ids = $request->input('edit_assigned_form_id');
|
||||
|
||||
@@ -45,6 +45,8 @@ class System extends Model
|
||||
public static function dateFormats()
|
||||
{
|
||||
return [
|
||||
'd.m.Y' => 'dd.mm.yyyy',
|
||||
'm.d.Y' => 'mm.dd.yyyy',
|
||||
'd-m-Y' => 'dd-mm-yyyy',
|
||||
'm-d-Y' => 'mm-dd-yyyy',
|
||||
'd/m/Y' => 'dd/mm/yyyy',
|
||||
|
||||
@@ -20,9 +20,6 @@ return new class extends Migration
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
|
||||
$table->boolean('show_form_response_user')->default(false);
|
||||
$table->boolean('show_edit_buttons_form');
|
||||
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
@@ -297,6 +297,9 @@ return [
|
||||
'rtl' => 'Right To Left',
|
||||
'ltr' => 'Left To Right',
|
||||
'display_type' => 'Display Type',
|
||||
'supervisor' => 'Supervisor',
|
||||
'admin' => 'Admin',
|
||||
'user' => 'user',
|
||||
'superadmin' => 'Superadmin',
|
||||
'packages' => 'Packages',
|
||||
'create' => 'Create',
|
||||
@@ -328,6 +331,7 @@ return [
|
||||
'users' => 'Users',
|
||||
'all_users' => 'All Users',
|
||||
'is_active' => 'Is Active ?',
|
||||
'is_admin' => 'Admin',
|
||||
'mark_active' => 'Mark As Active',
|
||||
'mark_inactive' => 'Mark As Inactive',
|
||||
'user_inactive' => 'User Account Is Inactive',
|
||||
@@ -467,6 +471,7 @@ return [
|
||||
'send_email' => 'Send Email',
|
||||
'send_email_tooltip' => 'If checked email address and password will be sent to user',
|
||||
'is_active_tooltip' => 'Check/Uncheck to make a user active/inactive.',
|
||||
'is_admin_tooltip' => 'Check to make a admin user.',
|
||||
'edit_user' => 'Edit User',
|
||||
'dont_want_to_change_keep_it_blank' => "Keep it blank, if you don't want to change",
|
||||
'comment' => 'Comment',
|
||||
@@ -477,10 +482,6 @@ return [
|
||||
'outline' => 'Outline',
|
||||
'can_create_form' => 'Can create form',
|
||||
'can_create_form_tooltip' => 'If checked user can create forms for him/herself',
|
||||
'show_form_response_user' => 'Can view form response author',
|
||||
'show_form_response_user_tooltip' => 'If checked user can view form response author',
|
||||
'show_edit_buttons_form' => 'Can view form edit buttons',
|
||||
'show_edit_buttons_form_tooltip' => 'If checked user can view edit buttons',
|
||||
'assign_forms' => 'Share forms',
|
||||
'permission_for_forms' => 'Permission for shared forms',
|
||||
'can_design_form' => 'Can design form',
|
||||
@@ -623,6 +624,7 @@ return [
|
||||
'loadingRecords' => 'Loading...',
|
||||
'processing' => 'Processing...',
|
||||
'search' => 'Search:',
|
||||
'search_without_dots' => 'Search',
|
||||
'zeroRecords' => 'No matching records found',
|
||||
'first' => 'First',
|
||||
'last' => 'Last',
|
||||
|
||||
@@ -298,6 +298,9 @@ return [
|
||||
'ltr' => 'Vasakule paremale',
|
||||
'display_type' => 'Kuvatüüp',
|
||||
'superadmin' => 'Superadmin',
|
||||
'supervisor' => 'Supervisor',
|
||||
'admin' => 'Admin',
|
||||
'user' => 'User',
|
||||
'packages' => 'Paketid',
|
||||
'create' => 'Loo',
|
||||
'no_of_active_forms' => 'Aktiivsete vormide arv',
|
||||
|
||||
@@ -298,6 +298,9 @@ return [
|
||||
'ltr' => 'Слева направо',
|
||||
'display_type' => 'Тип отображения',
|
||||
'superadmin' => 'Суперадмин',
|
||||
'supervisor' => 'Супервизор',
|
||||
'admin' => 'Админ',
|
||||
'user' => 'Пользователь',
|
||||
'packages' => 'Пакеты',
|
||||
'create' => 'Создать',
|
||||
'no_of_active_forms' => 'Количество активных форм',
|
||||
@@ -328,6 +331,7 @@ return [
|
||||
'users' => 'Пользователи',
|
||||
'all_users' => 'Все пользователи',
|
||||
'is_active' => 'Активен?',
|
||||
'is_admin' => 'Админ',
|
||||
'mark_active' => 'Пометить как активный',
|
||||
'mark_inactive' => 'Пометить как неактивный',
|
||||
'user_inactive' => 'Учетная запись пользователя неактивна',
|
||||
@@ -467,6 +471,7 @@ return [
|
||||
'send_email' => 'Отправить электронную почту',
|
||||
'send_email_tooltip' => 'Если установлено, пользователю будет отправлены адрес электронной почты и пароль',
|
||||
'is_active_tooltip' => 'Отметьте / снимите отметку, чтобы сделать пользователя активным / неактивным.',
|
||||
'is_admin_tooltip' => 'Установите отметку, чтобы сделать пользователя администратором.',
|
||||
'edit_user' => 'Редактировать пользователя',
|
||||
'dont_want_to_change_keep_it_blank' => "Оставьте поле пустым, если вы не хотите менять",
|
||||
'comment' => 'Комментарий',
|
||||
@@ -477,10 +482,6 @@ return [
|
||||
'outline' => 'Контур',
|
||||
'can_create_form' => 'Может создавать форму',
|
||||
'can_create_form_tooltip' => 'Если установлено, пользователь может создавать формы для себя',
|
||||
'show_form_response_user' => 'Can view form response author',
|
||||
'show_form_response_user_tooltip' => 'If checked user can view form response author',
|
||||
'show_edit_buttons_form' => 'Can view form edit buttons',
|
||||
'show_edit_buttons_form_tooltip' => 'If checked user can view edit buttons',
|
||||
'assign_forms' => 'Поделиться формами',
|
||||
'permission_for_forms' => 'Разрешение на общие формы',
|
||||
'can_design_form' => 'Может проектировать форму',
|
||||
@@ -623,6 +624,7 @@ return [
|
||||
'loadingRecords' => 'Загрузка...',
|
||||
'processing' => 'Обработка...',
|
||||
'search' => 'Поиск:',
|
||||
'search_without_dots' => 'Поиск',
|
||||
'zeroRecords' => 'Совпадающих записей не найдено',
|
||||
'first' => 'Первый',
|
||||
'last' => 'Последний',
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
<template>
|
||||
|
||||
<div class="form-group" v-if="element.type == 'text'" :class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]" @mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)" >
|
||||
<div class="form-group" v-if="element.type == 'text'"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
|
||||
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
|
||||
|
||||
<label :for="element.name">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<span :style="{'color': settings.color.label}">
|
||||
{{ element.label }}
|
||||
</span>
|
||||
@@ -44,9 +47,12 @@
|
||||
></popover-help-text-modal>
|
||||
</div>
|
||||
|
||||
<div v-else-if="element.type == 'range'" :class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class, 'mb-4 mt-3']" @mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)" >
|
||||
<div v-else-if="element.type == 'range'"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class, 'mb-4 mt-3']"
|
||||
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
|
||||
<label :for="element.name">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<span :style="{'color': settings.color.label}">
|
||||
{{ element.label }}
|
||||
</span>
|
||||
@@ -59,7 +65,9 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-1">{{ element.min }}</div>
|
||||
<div class="col-sm-10">
|
||||
<input type="range" :name="element.name" :required="element.required && applyValidations" :id="element.name" :min="element.min" :max="element.max" :step="element.step" :data-orientation="element.data_orientation"
|
||||
<input type="range" :name="element.name" :required="element.required && applyValidations"
|
||||
:id="element.name" :min="element.min" :max="element.max" :step="element.step"
|
||||
:data-orientation="element.data_orientation"
|
||||
:value="_.get(submitted_data, element.name, '')"
|
||||
:class="[element.conditional_class]"
|
||||
v-bind="getCustomAttributes(element.custom_attributes)"
|
||||
@@ -82,9 +90,13 @@
|
||||
></popover-help-text-modal>
|
||||
</div>
|
||||
|
||||
<div class="form-group" v-else-if="element.type == 'calendar'" :class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]" @mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)" >
|
||||
<div class="form-group" v-else-if="element.type == 'calendar'"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
|
||||
@mouseover="onMouseHover()"
|
||||
@mouseleave="onMouseLeave(element)">
|
||||
<label :for="element.name">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<span :style="{'color': settings.color.label}">
|
||||
{{ element.label }}
|
||||
</span>
|
||||
@@ -112,9 +124,9 @@
|
||||
readonly
|
||||
:class="[element.size, element.custom_class, element.conditional_class]"
|
||||
:required="element.required && applyValidations"
|
||||
:data-defaultDate="_.get(submitted_data, element.name, '')"
|
||||
v-bind="getCustomAttributes(element.custom_attributes)"
|
||||
:data-msg-required="element.required_error_msg"
|
||||
:disabled="actionBy === 'user'"
|
||||
/>
|
||||
|
||||
<div class="input-group-append"
|
||||
@@ -136,9 +148,12 @@
|
||||
></popover-help-text-modal>
|
||||
</div>
|
||||
|
||||
<div class="form-group" v-else-if="element.type == 'textarea'" :class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]" @mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)" >
|
||||
<div class="form-group" v-else-if="element.type == 'textarea'"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
|
||||
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
|
||||
<label :for="element.name">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<span :style="{'color': settings.color.label}">
|
||||
{{ element.label }}
|
||||
</span>
|
||||
@@ -183,9 +198,12 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group"
|
||||
v-else-if="element.type == 'radio' || element.type == 'checkbox'" :class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]" @mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)" >
|
||||
v-else-if="element.type == 'radio' || element.type == 'checkbox'"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
|
||||
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
|
||||
<label :for="element.name">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
|
||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
||||
@@ -224,9 +242,12 @@
|
||||
></popover-help-text-modal>
|
||||
</div>
|
||||
|
||||
<div class="form-group" v-else-if="element.type == 'dropdown'" :class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]" @mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)" >
|
||||
<div class="form-group" v-else-if="element.type == 'dropdown'"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
|
||||
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
|
||||
<label :for="element.name">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
|
||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
||||
@@ -241,7 +262,9 @@
|
||||
<i :class="'fas ' + element.prefix_icon"></i>
|
||||
</span>
|
||||
</div>
|
||||
<select class="custom-select" :class="[element.size, element.custom_class, element.conditional_class]" :required="element.required && applyValidations" v-bind="getDynamicallyGeneratedAttributeObj(element.validations, element.custom_attributes)"
|
||||
<select class="custom-select" :class="[element.size, element.custom_class, element.conditional_class]"
|
||||
:required="element.required && applyValidations"
|
||||
v-bind="getDynamicallyGeneratedAttributeObj(element.validations, element.custom_attributes)"
|
||||
:id="element.name" :multiple="element.multiselect"
|
||||
:name="(element.multiselect == true ? element.name + '[]' : element.name)"
|
||||
@change="$emit('apply_conditions')"
|
||||
@@ -268,15 +291,23 @@
|
||||
></popover-help-text-modal>
|
||||
</div>
|
||||
|
||||
<div v-else-if="element.type == 'heading'" :class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]" @mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)" >
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<div v-html="'<' + element.tag + ' style=color:' + element.text_color + '>' + element.content + '</' + element.tag + '>'" :class="[element.custom_class]">
|
||||
<div v-else-if="element.type == 'heading'"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
|
||||
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<div
|
||||
v-html="'<' + element.tag + ' style=color:' + element.text_color + '>' + element.content + '</' + element.tag + '>'"
|
||||
:class="[element.custom_class]">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else-if="element.type == 'file_upload'" :class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]" @mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)" class="mb-3">
|
||||
<div v-else-if="element.type == 'file_upload'"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
|
||||
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)" class="mb-3">
|
||||
<label :for="element.name">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
|
||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
||||
@@ -284,9 +315,12 @@
|
||||
|
||||
:data-target="`#${element.name}_modal`"></i>
|
||||
</label>
|
||||
<div class="dropzone" :class="[element.custom_class]" :id="element.name" v-bind="getCustomAttributes(element.custom_attributes)">
|
||||
<div class="dropzone" :class="[element.custom_class]" :id="element.name"
|
||||
v-bind="getCustomAttributes(element.custom_attributes)">
|
||||
</div>
|
||||
<input type="hidden" :name="element.name + '[]'" :id="element.name" :value="_.get(submitted_data, element.name, '')" :required="element.required && applyValidations" :class="element.conditional_class" :data-msg-required="element.required_error_msg">
|
||||
<input type="hidden" :name="element.name + '[]'" :id="element.name"
|
||||
:value="_.get(submitted_data, element.name, '')" :required="element.required && applyValidations"
|
||||
:class="element.conditional_class" :data-msg-required="element.required_error_msg">
|
||||
<small class="form-text text-muted" v-if="element.help_text">
|
||||
{{ element.help_text }}
|
||||
</small>
|
||||
@@ -296,9 +330,12 @@
|
||||
></popover-help-text-modal>
|
||||
</div>
|
||||
|
||||
<div v-else-if="element.type == 'text_editor'" :class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]" @mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)" >
|
||||
<div v-else-if="element.type == 'text_editor'"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
|
||||
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
|
||||
<label :for="element.name">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
|
||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
||||
@@ -323,10 +360,15 @@
|
||||
></popover-help-text-modal>
|
||||
</div>
|
||||
|
||||
<div v-else-if="element.type == 'terms_and_condition'" class="pt-3 mb-3" :class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]" @mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)" >
|
||||
<i class="fas fa-sort handle pointer font_icon_size" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<div v-else-if="element.type == 'terms_and_condition'" class="pt-3 mb-3"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
|
||||
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
|
||||
<i class="fas fa-sort handle pointer font_icon_size" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" :name="element.name" id="terms_and_condition" :required="element.required && applyValidations" :class="[element.custom_class, element.conditional_class]" @change="$emit('apply_conditions')"
|
||||
<input class="custom-control-input" type="checkbox" :name="element.name" id="terms_and_condition"
|
||||
:required="element.required && applyValidations"
|
||||
:class="[element.custom_class, element.conditional_class]" @change="$emit('apply_conditions')"
|
||||
:checked="_.includes(['on'], _.get(submitted_data, element.name, ''))"
|
||||
v-bind="getCustomAttributes(element.custom_attributes)"
|
||||
:data-msg-required="element.required_error_msg"
|
||||
@@ -349,19 +391,27 @@
|
||||
></popover-help-text-modal>
|
||||
</div>
|
||||
|
||||
<div v-else-if="element.type == 'hr'" :class="[element.extras.showConfigurator ? 'active_element' : '']" @mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)" >
|
||||
<i class="fas fa-sort handle pointer font_icon_size" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<div v-else-if="element.type == 'hr'" :class="[element.extras.showConfigurator ? 'active_element' : '']"
|
||||
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
|
||||
<i class="fas fa-sort handle pointer font_icon_size" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<hr :style="{'margin-top' : element.padding_top + 'px', 'margin-bottom' : element.padding_bottom + 'px', 'border-top' : element.border_size + 'px ' + element.border_type + element.border_color, 'margin-left' : element.horizontal_space + 'px', 'margin-right' : element.horizontal_space + 'px'}">
|
||||
</div>
|
||||
|
||||
<div v-else-if="element.type == 'html_text'" :class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]" @mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)" >
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<div v-else-if="element.type == 'html_text'"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
|
||||
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<span v-html="element.html_text" :class="element.custom_class"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-group" v-else-if="element.type == 'rating'" :class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]" @mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)" >
|
||||
<div class="form-group" v-else-if="element.type == 'rating'"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
|
||||
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
|
||||
<label :for="element.name">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
|
||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
||||
@@ -385,11 +435,16 @@
|
||||
:element="element"
|
||||
></popover-help-text-modal>
|
||||
</div>
|
||||
<div v-else-if="element.type == 'switch'" :class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]" @mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)" >
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<div v-else-if="element.type == 'switch'"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
|
||||
@mouseover="onMouseHover()" @mouseleave="onMouseLeave(element)">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<div class="form-group">
|
||||
<span class="switch" :class="element.size">
|
||||
<input type="checkbox" class="switch" :name="element.name" :id="element.name" :required="element.required && applyValidations" @change="$emit('apply_conditions')" :class="element.conditional_class"
|
||||
<input type="checkbox" class="switch" :name="element.name" :id="element.name"
|
||||
:required="element.required && applyValidations" @change="$emit('apply_conditions')"
|
||||
:class="element.conditional_class"
|
||||
:checked="_.includes(['on'], _.get(submitted_data, element.name, ''))"
|
||||
v-bind="getCustomAttributes(element.custom_attributes)"
|
||||
:data-msg-required="element.required_error_msg"
|
||||
@@ -414,8 +469,11 @@
|
||||
:element="element"
|
||||
></popover-help-text-modal>
|
||||
</div>
|
||||
<div v-else-if="element.type == 'signature'" :class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]" @mouseover="onMouseHover" @mouseleave="onMouseLeave(element)">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<div v-else-if="element.type == 'signature'"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
|
||||
@mouseover="onMouseHover" @mouseleave="onMouseLeave(element)">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<label :for="element.name">
|
||||
<span :style="{'color': settings.color.label}" class="ml-2">
|
||||
{{ element.label }}
|
||||
@@ -427,17 +485,22 @@
|
||||
:data-target="`#${element.name}_modal`"></i>
|
||||
</label>
|
||||
<div class="form-group">
|
||||
<canvas :id="element.name" width="300" height="200" class="signature-pad" v-bind="getCustomAttributes(element.custom_attributes)">
|
||||
<canvas :id="element.name" width="300" height="200" class="signature-pad"
|
||||
v-bind="getCustomAttributes(element.custom_attributes)">
|
||||
</canvas>
|
||||
<input type="hidden" :name="element.name" :id="'output_'+element.name" :value="_.get(submitted_data, element.name, '')" :required="element.required && applyValidations" :class="[element.conditional_class, 'signature']"
|
||||
<input type="hidden" :name="element.name" :id="'output_'+element.name"
|
||||
:value="_.get(submitted_data, element.name, '')" :required="element.required && applyValidations"
|
||||
:class="[element.conditional_class, 'signature']"
|
||||
:data-msg-required="element.required_error_msg">
|
||||
</div>
|
||||
<div class="form-text">
|
||||
<span :id="'clear_' + element.name" class="pointer mr-4" :title="trans('messages.clear_signature_pad')" :data-name="element.name">
|
||||
<span :id="'clear_' + element.name" class="pointer mr-4" :title="trans('messages.clear_signature_pad')"
|
||||
:data-name="element.name">
|
||||
<i class="far fa-times-circle"></i>
|
||||
{{ trans('messages.clear') }}
|
||||
</span>
|
||||
<span :id="'undo_' + element.name" class="pointer" :title="trans('messages.undo')" :data-name="element.name">
|
||||
<span :id="'undo_' + element.name" class="pointer" :title="trans('messages.undo')"
|
||||
:data-name="element.name">
|
||||
<i class="fas fa-undo"></i>
|
||||
{{ trans('messages.undo') }}
|
||||
</span>
|
||||
@@ -454,7 +517,8 @@
|
||||
<div v-else-if="_.includes(['page_break'], element.type) && !applyValidations"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '']"
|
||||
@mouseover="onMouseHover" @mouseleave="onMouseLeave(element)">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<div class="divider divider-secondary divider-dashed">
|
||||
<div class="divider-text">
|
||||
{{ trans('messages.page_break') }}
|
||||
@@ -467,7 +531,8 @@
|
||||
class="mt-25 mb-25"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
|
||||
@mouseover="onMouseHover" @mouseleave="onMouseLeave(element)">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<label :for="element.name">
|
||||
<span :style="{'color': settings.color.label}" class="ml-2">
|
||||
{{ element.label }}
|
||||
@@ -483,7 +548,8 @@
|
||||
:height="`${element.height}`"
|
||||
frameborder="0"
|
||||
style="max-width: 100%;"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowfullscreen>
|
||||
</iframe>
|
||||
</div>
|
||||
</div>
|
||||
@@ -493,7 +559,8 @@
|
||||
class="mt-25 mb-25"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
|
||||
@mouseover="onMouseHover" @mouseleave="onMouseLeave(element)">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<label :for="element.name">
|
||||
<span :style="{'color': settings.color.label}" class="ml-2">
|
||||
{{ element.label }}
|
||||
@@ -517,7 +584,8 @@
|
||||
<div v-else-if="element.type == 'pdf'"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class]"
|
||||
class="col-md-12" @mouseover="onMouseHover" @mouseleave="onMouseLeave(element)">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<label :for="element.name">
|
||||
<span :style="{'color': settings.color.label}" class="ml-2">
|
||||
{{ element.label }}
|
||||
@@ -545,7 +613,8 @@
|
||||
<div v-else-if="element.type == 'countdown'"
|
||||
:class="[element.extras.showConfigurator ? 'active_element' : '', element.conditional_class, 'row']"
|
||||
@mouseover="onMouseHover" @mouseleave="onMouseLeave(element)">
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]" :title="trans('messages.drag_element_using_icon')"></i>
|
||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||
:title="trans('messages.drag_element_using_icon')"></i>
|
||||
<label :for="element.name">
|
||||
<span :style="{'color': settings.color.label}" class="ml-2">
|
||||
{{ element.label }}
|
||||
@@ -564,6 +633,7 @@
|
||||
|
||||
<script>
|
||||
import PopoverHelpTextModal from './Shared/PopoverHelpText.vue';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
element: Object,
|
||||
@@ -572,7 +642,9 @@
|
||||
type: Boolean,
|
||||
default: true //If passed false then validation will not be applied to field. Used while creating forms
|
||||
},
|
||||
submitted_data: Object
|
||||
submitted_data: Object,
|
||||
action: String | null,
|
||||
actionBy: String | null
|
||||
},
|
||||
components: {
|
||||
PopoverHelpTextModal
|
||||
@@ -623,8 +695,7 @@
|
||||
|
||||
//datetime picker
|
||||
if (field.type == 'calendar') {
|
||||
|
||||
initialize_datetimepicker(field.name, field.start_date, field.end_date, field.format, field.time_format, field.disabled_days, field.enable_time_picker, field.time_picker_inline);
|
||||
initialize_datetimepicker(field.name, _.get(self.submitted_data, field.name, ''), field.start_date, field.end_date, field.format, field.time_format, field.disabled_days, field.enable_time_picker, field.time_picker_inline);
|
||||
|
||||
//on change of dateTimePicker call applyConditions through event
|
||||
$('#' + field.name).on('change.datetimepicker', function () {
|
||||
@@ -724,9 +795,11 @@
|
||||
box-shadow: 0px 0px 0px 2px #0293e2;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.show {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
:element="element"
|
||||
:settings="settings"
|
||||
:applyValidations="applyValidations"
|
||||
action=""
|
||||
></fieldGenerator>
|
||||
<div class="element-config-action-btn float-right"
|
||||
v-show="element.extras.showConfigurator">
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
: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,6 +213,10 @@
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
window.location.href = document.referrer;
|
||||
}, 3000);
|
||||
} else {
|
||||
toastr.error(response.data.msg);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,16 @@
|
||||
$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"
|
||||
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'>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@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
|
||||
@foreach($schema as $element)
|
||||
@if(in_array($element['name'], $col_visible))
|
||||
<th>
|
||||
@@ -88,6 +104,7 @@
|
||||
<tbody>
|
||||
@foreach($data as $k => $row)
|
||||
<tr>
|
||||
@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"
|
||||
@@ -98,7 +115,8 @@
|
||||
</button>
|
||||
@endif
|
||||
@if(in_array('delete', $btn_enabled))
|
||||
<button type="button" class="btn btn-danger btn-sm delete_form_data m-1"
|
||||
<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')
|
||||
@@ -107,21 +125,21 @@
|
||||
@php
|
||||
$form_id = !empty($form->slug) ? $form->slug : $form->id;
|
||||
@endphp
|
||||
<a class="btn btn-dark btn-sm m-1" target="_blank"
|
||||
<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
|
||||
|
||||
@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>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
@include('layouts/partials/status')
|
||||
</div>
|
||||
</div>
|
||||
@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">
|
||||
@@ -21,9 +21,11 @@
|
||||
</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>
|
||||
<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>
|
||||
@@ -31,6 +33,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-3">
|
||||
<div class="info-box">
|
||||
@@ -44,7 +47,9 @@
|
||||
</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">
|
||||
<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>
|
||||
@@ -54,40 +59,51 @@
|
||||
<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)
|
||||
nav-justified
|
||||
@endif"
|
||||
id="custom-tabs-four-tab" role="tablist">
|
||||
@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)
|
||||
<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">
|
||||
<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 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
|
||||
@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)
|
||||
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)
|
||||
" 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')
|
||||
<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">
|
||||
@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>
|
||||
@@ -103,7 +119,8 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="custome-tabs-templates" role="tabpanel" aria-labelledby="custome-tabs-all-templates">
|
||||
<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>
|
||||
@@ -127,16 +144,20 @@
|
||||
</div>
|
||||
@endif
|
||||
<div class="tab-pane fade
|
||||
@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)
|
||||
active show
|
||||
@endif
|
||||
" id="custome-tabs-shared-forms-assigned" role="tabpanel" aria-labelledby="custome-tabs-shared-forms">
|
||||
" 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>
|
||||
@@ -195,9 +216,13 @@
|
||||
{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 },
|
||||
{
|
||||
data: 'is_global_template', name: 'is_global_template', sortable: false, searchable: false
|
||||
},
|
||||
@endif
|
||||
{ data: 'action', name: 'action', sortable:false }
|
||||
{
|
||||
data: 'action', name: 'action', sortable: false
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
@@ -294,12 +319,26 @@
|
||||
"columnDefs": [
|
||||
{"width": "25%", "targets": 0},
|
||||
{"width": "40%", "targets": 1},
|
||||
{ "width": "20%", "targets": 2 }
|
||||
@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'},
|
||||
{ data: 'action', name: 'action', sortable:false }
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
{
|
||||
data: 'created_by', name: 'forms.created_by'
|
||||
},
|
||||
@endif
|
||||
{
|
||||
data: 'action', name: 'action', sortable: false
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
@@ -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)-->
|
||||
@@ -82,20 +90,27 @@
|
||||
}
|
||||
</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
|
||||
|
||||
@@ -168,9 +183,14 @@
|
||||
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 = '';
|
||||
@@ -226,7 +246,7 @@
|
||||
showClear: true,
|
||||
ignoreReadonly: true,
|
||||
sideBySide: side_by_side,
|
||||
defaultDate: $("input#"+element_name).data("defaultdate")
|
||||
defaultDate: element_date.length ? moment(element_date, format) : ''
|
||||
});
|
||||
}
|
||||
|
||||
@@ -244,6 +264,7 @@
|
||||
}
|
||||
|
||||
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";
|
||||
|
||||
@@ -30,37 +30,42 @@
|
||||
@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'])}}">
|
||||
|
||||
@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>
|
||||
@@ -68,24 +73,28 @@
|
||||
<!-- /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) }}
|
||||
</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>
|
||||
|
||||
@@ -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">
|
||||
@@ -49,52 +50,56 @@
|
||||
</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>
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.is_active_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@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>
|
||||
@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">
|
||||
<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.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="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>
|
||||
</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>
|
||||
<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">
|
||||
@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">
|
||||
<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>
|
||||
<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">
|
||||
<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">
|
||||
@@ -51,54 +53,58 @@
|
||||
</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>
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.is_active_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@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">
|
||||
<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.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="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>
|
||||
<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>
|
||||
<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>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(auth()->user()->id != $user->id)
|
||||
@php
|
||||
$form_ids = $assigned_forms->pluck('form_id')->toArray();
|
||||
@endphp
|
||||
@@ -112,39 +118,50 @@
|
||||
</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"
|
||||
<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>
|
||||
<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"
|
||||
<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>
|
||||
<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"
|
||||
<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>
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_view_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -173,36 +190,44 @@
|
||||
</div>
|
||||
<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">
|
||||
<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>
|
||||
<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="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>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-sm btn-primary submit_btn">
|
||||
@lang('messages.update')
|
||||
|
||||
@@ -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>
|
||||
@@ -117,7 +116,7 @@
|
||||
title: '{{config("app.name") ."-". __("messages.all_users")}}'
|
||||
}
|
||||
],
|
||||
dom: 'lBfrtip',
|
||||
dom: 'lfrtip',
|
||||
fixedHeader: false,
|
||||
columns: [
|
||||
{ data: 'name' , name: 'name'},
|
||||
|
||||
@@ -57,9 +57,9 @@ Route::middleware(['IsInstalled', 'auth', 'bootstrap', 'setDefaultConfig'])->gro
|
||||
Route::get('/get-acelle-list-info', [FormController::class, 'getAcelleMailListInfo']);
|
||||
Route::get('/form/{id}/get-collaborate', [FormController::class, 'getCollab']);
|
||||
Route::post('/form/post-collaborate', [FormController::class, 'postCollab']);
|
||||
Route::get('/edit/{slug}/data/{id}', [FormDataController::class, 'getEditformData']);
|
||||
Route::get('/edit/{slug}/data/{id}', [FormDataController::class, 'getEditformData'])->name('form-data.edit');
|
||||
Route::post('/update/{slug}/data/{id}', [FormDataController::class, 'postEditformData']);
|
||||
Route::get('/form-data/{id}', [FormDataController::class, 'show']);
|
||||
Route::get('/form-data/{id}', [FormDataController::class, 'show'])->name('form-data.show');
|
||||
Route::get('/form-data-view/{id}', [FormDataController::class, 'viewData']);
|
||||
Route::get('/download/{id}/pdf', [FormDataController::class, 'downloadPdf']);
|
||||
Route::delete('/form-data-destroy/{id}', [FormDataController::class, 'destroy']);
|
||||
|
||||
Reference in New Issue
Block a user