1 Commits

Author SHA1 Message Date
abdurahman
9250b863f7 added a way to add an image from a smartphone camera 2023-12-24 10:42:21 +05:00
26 changed files with 2899 additions and 3980 deletions

87
.env
View File

@@ -1,87 +0,0 @@
APP_NAME="AKNAPROFF"
APP_ENV="live"
APP_KEY=base64:dvbkNw1BmEGND2DRWIauV7ub306TMEiPws0A9yOhiMU=
APP_DEBUG=true
APP_URL=https://uniquesoft.es
APP_LOCALE="en"
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST="smtp.mailtrap.io"
MAIL_PORT="2525"
MAIL_USERNAME="hello@example.com"
MAIL_PASSWORD="12345"
MAIL_ENCRYPTION="TLS/SSL"
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="Example"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
ENVATO_PURCHASE_CODE="780fc1cd-62c9-4b1f-8798-7f4f6f7048ef"
SUPERADMIN_EMAILS=admin@admin.com
ENABLE_REGISTRATION="0"
CURRENCY_NAME="Euro"
CURRENCY_SYMBOL="€"
CURRENCY_CODE="EUR"
APP_TIMEZONE="Europe/Helsinki"
ENABLE_SAAS_MODULE="0"
PAYPAL_MODE="sandbox"
#PayPal Setting & API Credentials - sandbox
PAYPAL_SANDBOX_API_USERNAME=
PAYPAL_SANDBOX_API_PASSWORD=
PAYPAL_SANDBOX_API_SECRET=
PAYPAL_SANDBOX_API_CERTIFICATE=
#PayPal Setting & API Credentials - live
PAYPAL_LIVE_API_USERNAME=
PAYPAL_LIVE_API_PASSWORD=
PAYPAL_LIVE_API_SECRET=
PAYPAL_LIVE_API_CERTIFICATE=
#Stripe Payment Api & Credentials
STRIPE_PUB_KEY=
STRIPE_SECRET_KEY=
APP_DATE_FORMAT="d.m.Y"
APP_TIME_FORMAT="24"
DEBUGBAR_ENABLED=false
ENABLE_OFFLINE_PAYMENT="0"
ACELLE_MAIL_NAME=""
ACELLE_MAIL_API=""
APP_TITLE="Vormid"

View File

@@ -16,11 +16,6 @@ use ZipArchive;
class FormController extends Controller
{
public function __construct() {
$this->middleware('auth');
}
/**
* Display a listing of the resource.
*
@@ -196,7 +191,7 @@ class FormController extends Controller
public function update($id)
{
try {
$input = request()->only('name', 'name_ru', 'name_est', 'description', 'description_ru', 'description_est', 'slug');
$input = request()->only('name', 'description', 'slug');
$form_data = [
'form' => request()->input('form'),
'emailConfig' => request()->input('email_config'),
@@ -206,8 +201,6 @@ class FormController extends Controller
'form_attributes' => request()->input('form_attributes'),
'contains_page_break' => request()->input('contains_page_break'),
];
// dd($form_data);
$is_template = request()->input('is_template');
$input['schema'] = $form_data;
@@ -215,12 +208,8 @@ class FormController extends Controller
$form = Form::find($id);
$form->name = $input['name'];
$form->name_ru = $input['name_ru'];
$form->name_est = $input['name_est'];
$form->slug = $input['slug'];
$form->description = $input['description'];
$form->description_ru = $input['description_ru'];
$form->description_est = $input['description_est'];
$form->schema = $input['schema'];
$form->is_template = $is_template;
$form->mailchimp_details = request()->input('mailchimp_details');

View File

@@ -183,7 +183,7 @@ class HomeController extends Controller
if (request()->ajax()) {
$user_id = request()->user()->id;
$forms = Form::select('name', 'name_est', 'name_ru', 'description', 'description_ru', 'description_est', 'id', 'slug', 'is_global_template')
$forms = Form::select('name', 'description', 'id', 'slug', 'is_global_template')
->where(function ($query) use ($user_id) {
$query->where('is_template', 1)
->where('created_by', $user_id)
@@ -278,7 +278,7 @@ class HomeController extends Controller
$forms = UserForm::join('forms', 'user_forms.form_id', '=', 'forms.id')
->leftJoin('users', 'forms.created_by', '=', 'users.id')
->where('user_forms.assigned_to', \Auth::id())
->select('user_forms.permissions as permissions', 'forms.name as name', 'forms.name_ru as name_ru', 'forms.name_est as name_est', 'forms.description as description', 'forms.description_ru as description_ru', 'forms.description_est as description_est', 'forms.id as form_id', 'forms.created_at as created_at', 'forms.slug as slug', 'users.name as created_by');
->select('user_forms.permissions as permissions', 'forms.name as name', 'forms.description as description', 'forms.id as form_id', 'forms.created_at as created_at', 'forms.slug as slug', 'users.name as created_by');
return DataTables::of($forms)
->addColumn(

View File

@@ -1,31 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\UserSetting;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Session;
class LocaleController extends Controller
{
public function __invoke($locale) {
if (! in_array($locale, ['en', 'ru', 'est'])) {
abort(400);
}
Session::put('locale', $locale);
app()->setLocale($locale);
$userSetting = UserSetting::where('user_id', auth()->user()->id)->first();
if (!empty($userSetting)) {
$userSetting->update([
'language' => $locale
]);
}
return redirect()->back();
}
}

View File

@@ -5,7 +5,6 @@ namespace App\Http\Controllers;
use App\UserSetting;
use DateTimeZone;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Session;
class ManageSettingsController extends Controller
{
@@ -58,14 +57,6 @@ class ManageSettingsController extends Controller
$setting = UserSetting::where('user_id', $input['user_id'])->first();
if (! in_array($request->language, ['en', 'ru', 'est'])) {
abort(400);
}
Session::put('locale', $request->language);
app()->setLocale($request->language);
if (empty($setting)) {
UserSetting::create($input);
} else {

View File

@@ -64,6 +64,5 @@ class Kernel extends HttpKernel
'bootstrap' => \App\Http\Middleware\Callbacks::class,
'setDefaultConfig' => \App\Http\Middleware\SetDefaultConfigForUser::class,
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
'locale' => \App\Http\Middleware\LocaleMiddleware::class,
];
}

View File

@@ -1,37 +0,0 @@
<?php
namespace App\Http\Middleware;
use App\UserSetting;
use Closure;
use Illuminate\Support\Facades\Session;
class LocaleMiddleware
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (empty(Session::get('locale'))) {
$userSetting = UserSetting::where('user_id', auth()->user()->id)->first();
$locale = 'en';
if (!empty($userSetting)) {
if (!in_array($userSetting->language, ['en', 'ru', 'est'])) {
$locale = $userSetting->language;
}
}
Session::put('locale', $locale);
app()->setLocale($locale);
}
return $next($request);
}
}

View File

@@ -1,35 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('forms', function (Blueprint $table) {
$table->string('name_ru')->after('name')->nullable();
$table->string('name_est')->after('name_ru')->nullable();
$table->string('description_ru')->after('description')->nullable();
$table->string('description_est')->after('description_ru')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('forms', function (Blueprint $table) {
//
});
}
};

File diff suppressed because one or more lines are too long

View File

@@ -81,8 +81,8 @@ return [
'click_to_add_tags' => 'Click to add the tags',
'body' => 'Body',
'email_body' => 'Email Body',
'auto_restonse_settings' => 'Auto Restonse Settings',
'enable_auto_restonse' => 'Enable Auto Restonse?',
'auto_response_settings' => 'Auto Response Settings',
'enable_auto_response' => 'Enable Auto Response?',
'smtp_settings' => 'SMTP Settings',
'use_system_smtp' => 'Use System SMTP?',
'host' => 'Host',
@@ -115,6 +115,7 @@ return [
'file_size_limit_help' => 'Enter file size limit in MB',
'allowed_file' => 'Allowed File Type',
'specify_file_type' => 'Specify allowed types',
'image_file_type' => 'Camera + file',
'all_types' => 'All types',
'add_file_type' => 'Add file types',
'add_file_type_help_text' => 'Comma separated string of file types.Ex: .jpg, .png, .jpeg',
@@ -425,7 +426,7 @@ return [
'tour_step_2_intro' => '<b class="text-success">Step 2:</b></br> Drop the element here & click it to configure.',
'tour_step_3_intro' => '<b class="text-success">Step 3:</b></br> Form & Element configuration will appear here.',
'tour_step_4_intro' => '<b class="text-success">Step 4:</b></br> Add conditions to show/hide element based on other element values.',
'tour_step_5_intro' => '<b class="text-success">Step 5:</b></br> Configure receiving of submission email & auto-restond email to the user.',
'tour_step_5_intro' => '<b class="text-success">Step 5:</b></br> Configure receiving of submission email & auto-respond email to the user.',
'tour_step_6_intro' => '<b class="text-success">Step 6:</b></br> Configure form reCaptcha, design, notifications, scheduling, submission reference number & others.',
'tour_step_7_intro' => '<b class="text-success">Step 7:</b></br> Integrate mailchimp.',
'tour_step_8_intro' => '<b class="text-success">Step 8:</b></br> Add additional Js/css in the form.',
@@ -451,7 +452,7 @@ return [
'field_name_should_nt_have_space' => 'Field name should not have space',
'duplicate_field_name_choose_unique' => 'Duplicate field name, choose unique name',
'field_dont_have_name_property' => ":input field don't have name property",
'field_contain_space' => ':input field contain whitestace in name',
'field_contain_space' => ':input field contain whitespace in name',
'field_contain_duplicate_field_name' => ':input field contain duplicate name',
'key' => 'Key',
'add_form_custom_attribute' => 'Add form custom attribute',
@@ -677,16 +678,4 @@ return [
'error_msg_for_not_allowed_value' => 'Error message for not allowed value',
'enter_allowed_value_per_line' => 'Enter one allowed value per line.',
'values_allowed_tooltip' => 'Values provided here will only be allowed while submitting the form, keep it empty to allow all values',
'field_label_est' => 'Field Label in est',
'field_label_ru' => 'Field Label in Ru',
'content_est' => 'Content in est',
'content_ru' => 'Content in Ru',
'placeholder_est' => 'Placeholder in est',
'placeholder_ru' => 'Placeholder in Ru',
'options_est' => 'Options in est',
'options_ru' => 'Options in Ru',
'form_name_est' => 'Form Name est',
'form_name_ru' => 'Form Name ru',
'form_description_est' => 'Form Description est',
'form_description_ru' => 'Form Description ru',
];

View File

@@ -115,6 +115,7 @@ return [
'file_size_limit_help' => 'Sisestage faili suuruse piirang megabaitides',
'allowed_file' => 'Lubatud failitüüp',
'specify_file_type' => 'Määrake lubatud tüübid',
'image_file_type' => 'Camera + file',
'all_types' => 'Kõik tüübid',
'add_file_type' => 'Lisa failitüüpe',
'add_file_type_help_text' => 'Failitüüpide komaga eraldatud string. Näiteks: .jpg, .png, .jpeg',

View File

@@ -115,6 +115,7 @@ return [
'file_size_limit_help' => 'Введите ограничение размера файла в МБ',
'allowed_file' => 'Допустимый тип файла',
'specify_file_type' => 'Укажите разрешенные типы',
'image_file_type' => 'Camera + file',
'all_types' => 'Все типы',
'add_file_type' => 'Добавить типы файлов',
'add_file_type_help_text' => 'Строка с разделенными запятыми типами файлов. Например, .jpg, .png, .jpeg',

2
package-lock.json generated
View File

@@ -1,5 +1,5 @@
{
"name": "Aknaproff",
"name": "Aknaproff1",
"lockfileVersion": 3,
"requires": true,
"packages": {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@
<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}">
{{ form_trans_label(element, '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"
@@ -24,7 +24,7 @@
</div>
<input :type="element.subtype" class="form-control"
:name="element.name"
:placeholder="form_trans_label(element, 'placeholder')"
:placeholder="element.placeholder"
:class="[element.size, element.custom_class, element.conditional_class]"
:required="element.required && applyValidations"
v-bind="getDynamicallyGeneratedAttributeObj(element.validations, element.custom_attributes)"
@@ -54,7 +54,7 @@
<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}">
{{ form_trans_label(element, '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"
@@ -98,7 +98,7 @@
<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}">
{{ form_trans_label(element, '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"
@@ -155,7 +155,7 @@
<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}">
{{ form_trans_label(element, '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"
@@ -175,7 +175,7 @@
:name="element.name"
:id="element.name"
:cols="element.columns"
:placeholder="form_trans_label(element, 'placeholder')"
:placeholder="element.placeholder"
:class="[element.custom_class, element.conditional_class]"
:required="element.required && applyValidations"
v-bind="getDynamicallyGeneratedAttributeObj(element.validations, element.custom_attributes)"
@@ -204,7 +204,7 @@
<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>
<span :style="{'color': settings.color.label}">{{ form_trans_label(element, 'label') }} </span>
<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"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
@@ -213,7 +213,7 @@
</label>
<div class="row">
<div :class="[spreadColumnForElement(element)]"
v-for="(option, index) in form_trans_label(element, 'options').split('\n')">
v-for="(option, index) in element.options.split('\n')">
<div class="custom-control" :class="[element.type == 'radio' ? 'custom-radio' : 'custom-checkbox']">
<input class="custom-control-input"
:type="element.type"
@@ -248,7 +248,7 @@
<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>
<span :style="{'color': settings.color.label}">{{ form_trans_label(element, 'label') }}</span>
<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"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
@@ -270,7 +270,7 @@
@change="$emit('apply_conditions')"
:data-msg-required="element.required_error_msg"
>
<option v-for="option in form_trans_label(element, 'options').split('\n')"
<option v-for="option in element.options.split('\n')"
:selected="_.includes(_.get(submitted_data, element.name, ''), option)"
>
{{ option }}
@@ -297,7 +297,7 @@
<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 + '>' + form_trans_label(element, 'content') + '</' + element.tag + '>'"
v-html="'<' + element.tag + ' style=color:' + element.text_color + '>' + element.content + '</' + element.tag + '>'"
:class="[element.custom_class]">
</div>
</div>
@@ -308,7 +308,7 @@
<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>
<span :style="{'color': settings.color.label}">{{ form_trans_label(element, 'label') }}</span>
<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"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
@@ -336,7 +336,7 @@
<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>
<span :style="{'color': settings.color.label}">{{ form_trans_label(element, 'label') }}</span>
<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"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
@@ -375,9 +375,9 @@
>
<label class="custom-control-label" for="terms_and_condition">
<a :href="element.link" target="_blank" v-if="element.link">
{{ form_trans_label(element, 'label') }}
{{ element.label }}
</a>
<span v-else>{{ form_trans_label(element, 'label') }}</span>
<span v-else>{{ 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"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
@@ -412,7 +412,7 @@
<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>
<span :style="{'color': settings.color.label}">{{ form_trans_label(element, 'label') }}</span>
<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"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
@@ -451,7 +451,7 @@
>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ form_trans_label(element, '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"
@@ -476,7 +476,7 @@
:title="trans('messages.drag_element_using_icon')"></i>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ form_trans_label(element, '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"
@@ -535,7 +535,7 @@
:title="trans('messages.drag_element_using_icon')"></i>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ form_trans_label(element, 'label') }}
{{ element.label }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
</label>
@@ -563,7 +563,7 @@
:title="trans('messages.drag_element_using_icon')"></i>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ form_trans_label(element, 'label') }}
{{ element.label }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
</label>
@@ -588,7 +588,7 @@
:title="trans('messages.drag_element_using_icon')"></i>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ form_trans_label(element, 'label') }}
{{ element.label }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
</label>
@@ -617,7 +617,7 @@
:title="trans('messages.drag_element_using_icon')"></i>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ form_trans_label(element, 'label') }}
{{ element.label }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
</label>

File diff suppressed because it is too large Load Diff

View File

@@ -508,21 +508,6 @@ export default {
initialize_countdowntimer(element);
}, 2000); //initialize after 2 sec
}
},
form_trans_label (data, key) {
const currLang = document.documentElement.lang
if (currLang === 'ru') {
if (data[`${key}_ru`] == '' || data[`${key}_ru`] === undefined || data[`${key}_ru`] === null) {
return data[key];
}
return data[`${key}_ru`]
} else if (currLang === 'est') {
if (data[`${key}_est`] == '' || data[`${key}_est`] === undefined || data[`${key}_est`] === null) {
return data[key];
}
return data[`${key}_est`]
}
return data[key];
}
},
};

View File

@@ -8,6 +8,7 @@
$additional_js = $form->schema['additional_js_css']['js'];
$page_color = $form->schema['settings']['color']['page_color'] ?? '#f4f6f9';
@endphp
<div class="@if(!empty($iframe_enabled) && $iframe_enabled) container-fluid @else container @endif">
<div class="row justify-content-center">
<div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">

View File

@@ -16,8 +16,7 @@
visibility: hidden;
}
#printSection,
#printSection * {
#printSection, #printSection * {
visibility: visible;
}
@@ -41,7 +40,7 @@
$date_format = config('constants.APP_DATE_FORMAT');
if (config('constants.APP_TIME_FORMAT') == '12') {
$date_format .= ' h:i A';
} elseif (config('constants.APP_TIME_FORMAT') == '24') {
} else if (config('constants.APP_TIME_FORMAT') == '24') {
$date_format .= ' H:i';
} else {
$date_format = 'm/d/Y h:i A';
@@ -49,18 +48,16 @@
@endphp
<div class="card">
<div class="card-header">
{{ $form->name }}
{{$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() }}">
<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() }}">
<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">
@@ -70,16 +67,13 @@
@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']
) {
if(isset($form->schema['settings']['form_submision_ref']['is_enabled']) && $form->schema['settings']['form_submision_ref']['is_enabled']) {
$is_enabled_sub_ref_no = true;
}
@endphp
<div class="tab-content card-body table-responsive" role="tabpanel">
@if (!empty($form->schema))
@if(!empty($form->schema))
@php
$schema = $form->schema['form'];
$col_visible = $form['schema']['settings']['form_data']['col_visible'];
@@ -87,108 +81,101 @@
@endphp
<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
<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>
@if($is_enabled_sub_ref_no)
<th>@lang('messages.submission_numbering')</th>
@endif
<th>@lang('messages.username')</th>
@foreach($schema as $element)
@if(in_array($element['name'], $col_visible))
<th>
{{$element['label']}}
</th>
@endif
<th>@lang('messages.username')</th>
@foreach ($schema as $element)
@if (in_array($element['name'], $col_visible))
<th>
{{-- $element['label'] --}}
@if (in_array(session()->get('locale'), ['ru', 'est']) && isset($element['label_' . session()->get('locale')]))
{{ $element['label_' . session()->get('locale')] }}
@else
{{ $element['label'] }}
@endif
</th>
@endif
@endforeach
<th>@lang('messages.submitted_on')</th>
</tr>
@endforeach
<th>@lang('messages.submitted_on')</th>
</tr>
</thead>
<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"
data-href="{{ action([\App\Http\Controllers\FormDataController::class, 'viewData'], [$row->id]) }}"
data-toggle="modal">
<i class="fa fa-eye" aria-hidden="true"></i>
@lang('messages.view')
</button>
@endif
@if (in_array('delete', $btn_enabled))
<button type="button"
class="btn btn-danger btn-sm delete_form_data m-1"
data-href="{{ action([\App\Http\Controllers\FormDataController::class, 'destroy'], [$row->id]) }}">
<i class="fa fa-trash" aria-hidden="true"></i>
@lang('messages.delete')
</button>
@endif
@php
$form_id = !empty($form->slug) ? $form->slug : $form->id;
@endphp
<a class="btn btn-dark btn-sm m-1"
href="{{ action([\App\Http\Controllers\FormDataController::class, 'getEditformData'], ['slug' => $form_id, 'id' => $row->id]) }}">
<i class="far fa-edit" aria-hidden="true"></i>
@lang('messages.edit')
</a>
</td>
@endif
@if ($is_enabled_sub_ref_no)
<td>
{{ $row['submission_ref'] }}
</td>
@endif
<td>{{ $row->submittedBy?->name }}</td>
@foreach ($schema as $row_element)
@if (in_array($row_element['name'], $col_visible))
<td>
@isset($row->data[$row_element['name']])
@if ($row_element['type'] == 'file_upload')
@include('form_data.file_view', [
'form_upload' =>
$row->data[$row_element['name']],
])
@elseif($row_element['type'] == 'signature')
@if (!empty($row->data[$row_element['name']]))
<a target="_blank"
href="{{ $row->data[$row_element['name']] }}"
download="Signature">
<img src="{{ $row->data[$row_element['name']] }}"
class="signature">
</a>
@endif
@elseif(is_array($row->data[$row_element['name']]) && $row_element['type'] != 'file_upload')
{{ implode(', ', $row->data[$row_element['name']]) }}
@else
{!! nl2br($row->data[$row_element['name']]) !!}
@endif
@endisset
</td>
@endif
@endforeach
@foreach($data as $k => $row)
<tr>
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
<td>
{{ \Carbon\Carbon::createFromTimestamp(strtotime($row->updated_at))->format($date_format) }}
<br />
<small>
{{ $row->updated_at->diffForHumans() }}
</small>
@if(in_array('view', $btn_enabled))
<button type="button" class="btn btn-info btn-sm view_form_data m-1"
data-href="{{action([\App\Http\Controllers\FormDataController::class, 'viewData'], [$row->id])}}"
data-toggle="modal">
<i class="fa fa-eye" aria-hidden="true"></i>
@lang('messages.view')
</button>
@endif
@if(in_array('delete', $btn_enabled))
<button type="button"
class="btn btn-danger btn-sm delete_form_data m-1"
data-href="{{action([\App\Http\Controllers\FormDataController::class, 'destroy'], [$row->id])}}">
<i class="fa fa-trash" aria-hidden="true"></i>
@lang('messages.delete')
</button>
@endif
@php
$form_id = !empty($form->slug) ? $form->slug : $form->id;
@endphp
<a class="btn btn-dark btn-sm m-1"
href="{{action([\App\Http\Controllers\FormDataController::class, 'getEditformData'], ['slug' => $form_id,'id' => $row->id])}}">
<i class="far fa-edit" aria-hidden="true"></i>
@lang('messages.edit')
</a>
</td>
</tr>
@endforeach
@endif
@if($is_enabled_sub_ref_no)
<td>
{{$row['submission_ref']}}
</td>
@endif
<td>{{ $row->submittedBy?->name }}</td>
@foreach($schema as $row_element)
@if(in_array($row_element['name'], $col_visible))
<td>
@isset($row->data[$row_element['name']])
@if($row_element['type'] == 'file_upload')
@include('form_data.file_view', ['form_upload' => $row->data[$row_element['name']]])
@elseif($row_element['type'] == 'signature')
@if(!empty($row->data[$row_element['name']]))
<a target="_blank"
href="{{$row->data[$row_element['name']]}}"
download="Signature">
<img src="{{$row->data[$row_element['name']]}}"
class="signature">
</a>
@endif
@elseif(is_array($row->data[$row_element['name']]) && $row_element['type'] != 'file_upload')
{{implode(', ', $row->data[$row_element['name']])}}
@else
{!! nl2br($row->data[$row_element['name']]) !!}
@endif
@endisset
</td>
@endif
@endforeach
<td>
{{\Carbon\Carbon::createFromTimestamp(strtotime($row->updated_at))->format($date_format)}}
<br/>
<small>
{{$row->updated_at->diffForHumans()}}
</small>
</td>
</tr>
@endforeach
</tbody>
</table>
@else
@@ -202,7 +189,7 @@
@endsection
@section('footer')
<script type="text/javascript">
$(document).ready(function() {
$(document).ready(function () {
$('#submitted_data_table').DataTable({
scrollY: "600px",
scrollX: true,
@@ -213,20 +200,20 @@
}
});
// view form data
$(document).on('click', '.view_form_data', function() {
$(document).on('click', '.view_form_data', function () {
var url = $(this).data("href");
$.ajax({
method: "GET",
dataType: "html",
url: url,
success: function(result) {
success: function (result) {
$("#modal_div").html(result).modal("show");
}
});
});
//delete form data
$(document).on('click', '.delete_form_data', function() {
$(document).on('click', '.delete_form_data', function () {
var url = $(this).data("href");
var result = confirm('Are You Sure?');
if (result == true) {
@@ -234,10 +221,10 @@
method: "DELETE",
url: url,
dataType: "json",
success: function(result) {
success: function (result) {
if (result.success == true) {
toastr.success(result.msg);
setTimeout(function() {
setTimeout(function () {
location.reload();
}, 1000);
} else {
@@ -249,17 +236,17 @@
});
//print form data on btn click
$(document).on('click', '.formDataPrintBtn', function() {
$(document).on('click', '.formDataPrintBtn', function () {
printElement(document.getElementById("print_form_data"));
});
$("#modal_div").on('shown.bs.modal', function() {
$("#modal_div").on('shown.bs.modal', function () {
if ($("form#add_comment_form").length) {
$("form#add_comment_form").validate();
}
});
$(document).on('submit', 'form#add_comment_form', function(e) {
$(document).on('submit', 'form#add_comment_form', function (e) {
e.preventDefault();
var data = $("form#add_comment_form").serialize();
var url = $("form#add_comment_form").attr('action');
@@ -270,7 +257,7 @@
url: url,
dataType: "json",
data: data,
success: function(response) {
success: function (response) {
ladda.stop();
if (response.success) {
$("#comment").val('');
@@ -283,7 +270,7 @@
});
});
$(document).on('click', '.delete-comment', function(e) {
$(document).on('click', '.delete-comment', function (e) {
e.preventDefault();
var element = $(this);
var comment_id = $(this).data('comment_id');
@@ -293,7 +280,7 @@
method: 'DELETE',
dataType: 'json',
url: '/form-data-comment/' + comment_id + '?form_data_id=' + form_data_id,
success: function(response) {
success: function (response) {
if (response.success) {
toastr.success(response.msg);
element.closest('.direct-chat-msg').remove();

View File

@@ -2,12 +2,12 @@
<div class="modal-content" id="print_form_data">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
{{ ucFirst($form_data->form->name) }}
@if (!empty($form_data->submittedBy))
{{ucFirst($form_data->form->name)}}
@if(!empty($form_data->submittedBy))
<small>
(
<b>@lang('messages.submitted_by'): </b>
{{ $form_data->submittedBy->name }}
<b>@lang('messages.submitted_by'): </b>
{{$form_data->submittedBy->name}}
)
</small>
@endif
@@ -23,11 +23,9 @@
<div class="modal-body">
<div class="row mb-2">
<div class="col-md-6">
@if (isset($form_data->form->schema['settings']['form_submision_ref']['is_enabled']) &&
$form_data->form->schema['settings']['form_submision_ref']['is_enabled'] &&
!empty($form_data->submission_ref))
<b>@lang('messages.submission_numbering'):</b>
{{ $form_data->submission_ref }}
@if(isset($form_data->form->schema['settings']['form_submision_ref']['is_enabled']) && $form_data->form->schema['settings']['form_submision_ref']['is_enabled'] && !empty($form_data->submission_ref))
<b>@lang('messages.submission_numbering'):</b>
{{$form_data->submission_ref}}
@endif
</div>
</div>
@@ -39,49 +37,42 @@
</tr>
</thead>
<tbody>
@foreach ($form_data->form->schema['form'] as $element)
@foreach($form_data->form->schema['form'] as $element)
@isset($form_data->data[$element['name']])
<tr>
<td>
<strong>
@if (in_array(session()->get('locale'), ['ru', 'est']) && isset($element['label_' . session()->get('locale')]))
{{ $element['label_' . session()->get('locale')] }}
@else
{{ $element['label'] }}
@endif
</strong>
</td>
<td>
@if ($element['type'] == 'file_upload')
@include('form_data.file_view', [
'form_upload' => $form_data->data[$element['name']],
])
@elseif($element['type'] == 'signature')
@if (!empty($form_data->data[$element['name']]))
<a target="_blank" href="{{ $form_data->data[$element['name']] }}"
download="Signature">
<img src="{{ $form_data->data[$element['name']] }}" class="signature">
</a>
@endif
@elseif(is_array($form_data->data[$element['name']]) && $element['type'] != 'file_upload')
{{ implode(', ', $form_data->data[$element['name']]) }}
@else
{!! nl2br($form_data->data[$element['name']]) !!}
<tr>
<td>
<strong>{{$element['label']}}</strong>
</td>
<td>
@if($element['type'] == 'file_upload')
@include('form_data.file_view', ['form_upload' => $form_data->data[$element['name']]])
@elseif($element['type'] == 'signature')
@if(!empty($form_data->data[$element['name']]))
<a target="_blank" href="{{$form_data->data[$element['name']]}}"
download="Signature">
<img src="{{$form_data->data[$element['name']]}}" class="signature">
</a>
@endif
</td>
</tr>
@elseif(is_array($form_data->data[$element['name']]) && $element['type'] != 'file_upload')
{{implode(', ', $form_data->data[$element['name']])}}
@else
{!! nl2br($form_data->data[$element['name']]) !!}
@endif
</td>
</tr>
@endisset
@endforeach
</tbody>
</table>
<div class="no-print mt-4">
<hr>
<form id="add_comment_form"
action="{{ action([\App\Http\Controllers\FormDataCommentController::class, 'store']) }}"
method="POST">
<form id="add_comment_form" action="{{action([\App\Http\Controllers\FormDataCommentController::class, 'store'])}}" method="POST">
{{ csrf_field() }}
<!-- hiden fields -->
<input type="hidden" name="form_data_id" id="form_data_id" value="{{ $form_data->id }}">
<input type="hidden" name="form_data_id" id="form_data_id" value="{{$form_data->id}}">
<div class="form-group">
<label for="comment">
@lang('messages.comment'):
@@ -113,11 +104,10 @@
<i class="fas fa-print"></i>
@lang('messages.print')
</button>
<a class="btn float-right btn-primary btn-sm m-1" target="_blank"
href="{{ action([\App\Http\Controllers\FormDataController::class, 'downloadPdf'], [$form_data->id]) }}">
<a class="btn float-right btn-primary btn-sm m-1" target="_blank" href="{{action([\App\Http\Controllers\FormDataController::class, 'downloadPdf'], [$form_data->id])}}">
<i class="far fa-file-pdf" aria-hidden="true"></i>
@lang('messages.download_pdf')
</a>
</div>
</div>
</div>
</div>

View File

@@ -8,7 +8,7 @@
@include('layouts/partials/status')
</div>
</div>
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || 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">
@@ -16,19 +16,20 @@
<div class="info-box-content">
<span class="info-box-text">@lang('messages.forms')</span>
<span class="info-box-number">{{ $form_count }}</span>
<span class="info-box-number">{{$form_count}}</span>
</div>
</div>
</div>
@if (!auth()->user()->hasRole(\App\Enums\User\RoleEnum::ADMIN->value))
@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>
<span class="info-box-number">{{ $template_count }}</span>
<span class="info-box-number">{{$template_count}}</span>
</div>
</div>
</div>
@@ -40,14 +41,15 @@
<div class="info-box-content">
<span class="info-box-text">@lang('messages.submissions')</span>
<span class="info-box-number">{{ $submission_count }}</span>
<span class="info-box-number">{{$submission_count}}</span>
</div>
</div>
</div>
<div class="col-12 col-sm-6 col-md-3">
<button type="button" data-href="{{ action([\App\Http\Controllers\FormController::class, 'create']) }}"
class="btn btn-primary float-right col-md-9 createForm mt-3">
<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>
@@ -57,76 +59,84 @@
<div class="card card-primary card-outline card-outline-tabs">
<div class="card-header p-0 border-bottom-0">
<ul class="nav nav-tabs
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || auth()->user()->can_create_form) nav-justified @endif"
@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()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value]) || 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">
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))
@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')
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()->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()->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')
@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()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) && !auth()->user()->can_create_form)
aria-selected="true"
@endif>
<i class="fas fa-file-alt"
aria-hidden="true"></i> @lang('messages.assigned_forms')
</a>
</li>
</ul>
</div>
<div class="card-body">
<div class="tab-content" id="custom-tabs-four-tabContent">
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || auth()->user()->can_create_form)
@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">
aria-labelledby="custome-tabs-all-forms">
<div class="table-responsive">
<table class="table" id="form_table" style="width: 100%;">
<thead>
<tr>
<th>@lang('messages.description')</th>
<th>@lang('messages.name')</th>
<th>@lang('messages.created_at')</th>
<th>@lang('messages.submissions')</th>
<th>@lang('messages.action')</th>
</tr>
<tr>
<th>@lang('messages.name')</th>
<th>@lang('messages.description')</th>
<th>@lang('messages.created_at')</th>
<th>@lang('messages.submissions')</th>
<th>@lang('messages.action')</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div class="tab-pane fade" id="custome-tabs-templates" role="tabpanel"
aria-labelledby="custome-tabs-all-templates">
aria-labelledby="custome-tabs-all-templates">
<div class="table-responsive">
<table class="table" id="template_table" style="width: 100%;">
<thead>
<tr>
<th>@lang('messages.description')</th>
<th>@lang('messages.name')</th>
@if (auth()->user()->can('superadmin'))
<th>
@lang('messages.is_global_template')
<i class="fas fa-info-circle" data-toggle="tooltip"
title="@lang('messages.is_global_template_tooltip')"></i>
</th>
@endif
<th>@lang('messages.action')</th>
</tr>
<tr>
<th>@lang('messages.name')</th>
<th>@lang('messages.description')</th>
@if(auth()->user()->can('superadmin'))
<th>
@lang('messages.is_global_template')
<i class="fas fa-info-circle"
data-toggle="tooltip"
title="@lang('messages.is_global_template_tooltip')"></i>
</th>
@endif
<th>@lang('messages.action')</th>
</tr>
</thead>
<tbody></tbody>
</table>
@@ -134,22 +144,22 @@
</div>
@endif
<div class="tab-pane fade
@if (!auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || !auth()->user()->can_create_form) active show @endif
"
id="custome-tabs-shared-forms-assigned" role="tabpanel"
aria-labelledby="custome-tabs-shared-forms">
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || !auth()->user()->can_create_form)
active show
@endif
" id="custome-tabs-shared-forms-assigned" role="tabpanel"
aria-labelledby="custome-tabs-shared-forms">
<div class="table-responsive">
<table class="table" id="assigned_form_table" style="width: 100%;">
<thead>
<tr>
<th>@lang('messages.description')</th>
<th>@lang('messages.name')</th>
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
<th>@lang('messages.created_by')</th>
@endif
<th>@lang('messages.action')</th>
</tr>
<tr>
<th>@lang('messages.name')</th>
<th>@lang('messages.description')</th>
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
<th>@lang('messages.created_by')</th>
@endif
<th>@lang('messages.action')</th>
</tr>
</thead>
<tbody></tbody>
</table>
@@ -167,21 +177,7 @@
@section('footer')
<script type="text/javascript">
$(document).ready(function() {
var lang = `{{ session()->get('locale') }}`
var titleColName = 'name';
if (lang === 'est') {
titleColName = 'name_est'
} else if (lang === 'ru') {
titleColName = 'name_ru'
}
var descColName = 'description';
if (lang === 'est') {
descColName = 'description_est'
} else if (lang === 'ru') {
descColName = 'description_ru'
}
$(document).ready(function () {
// form dataTable
var form_table = $('#form_table').DataTable({
@@ -191,62 +187,20 @@
buttons: [],
dom: 'lfrtip',
fixedHeader: false,
aaSorting: [
[1, 'desc']
aaSorting: [[2, 'desc']],
"columnDefs": [
{"width": "22%", "targets": 0},
{"width": "40%", "targets": 1},
{"width": "15%", "targets": 2},
{"width": "3%", "targets": 3},
{"width": "20%", "targets": 4}
],
"columnDefs": [{
"width": "22%",
"targets": 0
},
{
"width": "40%",
"targets": 1
},
{
"width": "15%",
"targets": 2
},
{
"width": "3%",
"targets": 3
},
{
"width": "20%",
"targets": 4
}
],
columns: [{
data: descColName,
name: descColName,
createdCell: function(td, cellData, rowData, row, col) {
if (td.innerHTML.length === 0) {
td.innerHTML = rowData.name
}
},
},
{
data: titleColName,
name: titleColName,
createdCell: function(td, cellData, rowData, row, col) {
if (td.innerHTML.length === 0) {
td.innerHTML = rowData.name
}
},
},
{
data: 'created_at',
name: 'created_at'
},
{
data: 'data_count',
name: 'data_count',
searchable: false
},
{
data: 'action',
name: 'action',
sortable: false
}
columns: [
{data: 'name', name: 'name'},
{data: 'description', name: 'description'},
{data: 'created_at', name: 'created_at'},
{data: 'data_count', name: 'data_count', searchable: false},
{data: 'action', name: 'action', sortable: false}
]
});
@@ -258,41 +212,22 @@
buttons: [],
dom: 'lfrtip',
fixedHeader: false,
columns: [{
data: descColName,
name: descColName,
createdCell: function(td, cellData, rowData, row, col) {
if (td.innerHTML.length === 0) {
td.innerHTML = rowData.name
}
},
},
columns: [
{data: 'name', name: 'name'},
{data: 'description', name: 'description'},
@if(auth()->user()->can('superadmin'))
{
data: titleColName,
name: titleColName,
createdCell: function(td, cellData, rowData, row, col) {
if (td.innerHTML.length === 0) {
td.innerHTML = rowData.name
}
},
data: 'is_global_template', name: 'is_global_template', sortable: false, searchable: false
},
@if (auth()->user()->can('superadmin'))
{
data: 'is_global_template',
name: 'is_global_template',
sortable: false,
searchable: false
},
@endif {
data: 'action',
name: 'action',
sortable: false
@endif
{
data: 'action', name: 'action', sortable: false
}
]
});
//delete form
$(document).on('click', '.delete_form', function() {
$(document).on('click', '.delete_form', function () {
var url = $(this).data("href");
var result = confirm('Are You Sure?');
if (result == true) {
@@ -300,7 +235,7 @@
method: "DELETE",
url: url,
dataType: "json",
success: function(result) {
success: function (result) {
if (result.success == true) {
toastr.success(result.msg);
form_table.ajax.reload();
@@ -313,7 +248,7 @@
});
//delete template
$(document).on('click', '.delete_template', function() {
$(document).on('click', '.delete_template', function () {
var url = $(this).data("href");
var result = confirm('Are You Sure?');
if (result == true) {
@@ -321,7 +256,7 @@
method: "DELETE",
url: url,
dataType: "json",
success: function(result) {
success: function (result) {
if (result.success == true) {
toastr.success(result.msg);
template_table.ajax.reload();
@@ -334,39 +269,39 @@
});
// create form
$(document).on('click', '.createForm', function() {
$(document).on('click', '.createForm', function () {
var url = $(this).data('href');
$.ajax({
method: "GET",
url: url,
dataType: "html",
success: function(response) {
success: function (response) {
$("#modal_div").html(response).modal("show");
}
});
});
// create widget
$(document).on('click', '.generate_widget', function() {
$(document).on('click', '.generate_widget', function () {
var url = $(this).data('href');
$.ajax({
method: "GET",
url: url,
dataType: "html",
success: function(response) {
success: function (response) {
$("#modal_div").html(response).modal("show");
}
});
});
//copy form
$(document).on('click', '.copy_form', function() {
$(document).on('click', '.copy_form', function () {
var url = $(this).data('href');
$.ajax({
method: "GET",
url: url,
dataType: "html",
success: function(response) {
success: function (response) {
$("#modal_div").html(response).modal("show");
}
});
@@ -380,81 +315,49 @@
buttons: [],
dom: 'lfrtip',
fixedHeader: false,
aaSorting: [
[0, 'desc']
],
"columnDefs": [{
"width": "25%",
"targets": 0
},
aaSorting: [[0, 'desc']],
"columnDefs": [
{"width": "25%", "targets": 0},
{"width": "40%", "targets": 1},
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
{
"width": "40%",
"targets": 1
"width": "15%", "targets": 2
},
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
{
"width": "15%",
"targets": 2
},
@endif {
@endif
{
"width": "20%",
"targets": @php
echo auth()
->user()
->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value)
? 3
: 2;
@endphp
}
"targets": @php echo auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) ? 3 : 2 @endphp }
],
columns: [{
data: descColName,
name: 'forms.' + descColName,
createdCell: function(td, cellData, rowData, row, col) {
if (td.innerHTML.length === 0) {
td.innerHTML = rowData.description
}
},
},
columns: [
{data: 'name', name: 'forms.name'},
{data: 'description', name: 'forms.description'},
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
{
data: titleColName,
name: 'forms.' + titleColName,
createdCell: function(td, cellData, rowData, row, col) {
if (td.innerHTML.length === 0) {
td.innerHTML = rowData.name
}
},
data: 'created_by', name: 'forms.created_by'
},
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
{
data: 'created_by',
name: 'forms.created_by'
},
@endif {
data: 'action',
name: 'action',
sortable: false
@endif
{
data: 'action', name: 'action', sortable: false
}
]
});
//form collaborate
$(document).on('click', '.collab_btn', function() {
$(document).on('click', '.collab_btn', function () {
var url = $(this).data('href');
$.ajax({
method: "GET",
url: url,
dataType: "html",
success: function(response) {
success: function (response) {
$("#collab_modal").html(response).modal("show");
}
});
});
$("#collab_modal").on('shown.bs.modal', function() {
$("#collab_modal").on('shown.bs.modal', function () {
if ($("#form_design").length) {
$(document).on('change', '#form_design', function() {
$(document).on('change', '#form_design', function () {
if ($("#form_design").is(":checked")) {
$("#form_view").attr('checked', true);
} else {
@@ -464,7 +367,7 @@
}
});
$(document).on('submit', 'form#collaborate_form', function(e) {
$(document).on('submit', 'form#collaborate_form', function (e) {
e.preventDefault();
var data = $("form#collaborate_form").serialize();
var url = $("form#collaborate_form").attr('action');
@@ -475,7 +378,7 @@
url: url,
dataType: "json",
data: data,
success: function(response) {
success: function (response) {
ladda.stop();
if (response.success) {
$("#collab_modal").modal('hide');
@@ -487,7 +390,7 @@
});
});
$('a[data-toggle="pill"]').on('shown.bs.tab', function(e) {
$('a[data-toggle="pill"]').on('shown.bs.tab', function (e) {
var target = $(e.target).attr('href');
if (target == '#custome-tabs-forms') {
if (typeof form_table != 'undefined') {
@@ -504,25 +407,25 @@
}
});
@if (auth()->user()->can('superadmin'))
$(document).on('click', '.toggle_global_template', function() {
$.ajax({
method: "POST",
url: "{{ route('toggle.global.template') }}",
dataType: "json",
data: {
is_checked: $(this).is(":checked") ? 1 : 0,
form_id: $(this).data("form_id"),
},
success: function(response) {
if (response.success) {
template_table.ajax.reload();
} else {
toastr.error(response.msg);
}
@if(auth()->user()->can('superadmin'))
$(document).on('click', '.toggle_global_template', function () {
$.ajax({
method: "POST",
url: "{{route('toggle.global.template')}}",
dataType: "json",
data: {
is_checked: $(this).is(":checked") ? 1 : 0,
form_id: $(this).data("form_id"),
},
success: function (response) {
if (response.success) {
template_table.ajax.reload();
} else {
toastr.error(response.msg);
}
});
}
});
});
@endif
});
</script>

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', session()->get('locale', 'en')) }}">
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

View File

@@ -3,52 +3,56 @@
$form = !empty($form) ? $form : '';
@endphp
<!-- reCaptcha -->
<script src="//www.google.com/recaptcha/api.js?v={{$asset_version}}" async defer></script>
<!-- reCaptcha -->
<script src="//www.google.com/recaptcha/api.js?v={{ $asset_version }}" async defer></script>
<script type="text/javascript">
if (typeof jQuery == 'undefined') {
document.write('<script src="//code.jquery.com/jquery-3.4.1.min.js?v={{$asset_version}}"></' + 'script>');
document.write('<script src="//code.jquery.com/jquery-3.4.1.min.js?v={{ $asset_version }}"></' + 'script>');
}
</script>
<!-- Bootstrap Js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js?v={{$asset_version}}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js?v={{ $asset_version }}"></script>
<script src="//stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js?v={{$asset_version}}"></script>
<script src="//stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js?v={{ $asset_version }}"></script>
<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="//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>
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>
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>
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>
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>
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}}"
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>
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)-->
<script src="https://cdn.jsdelivr.net/npm/signature_pad@2.3.2/dist/signature_pad.min.js?v={{$asset_version}}"></script>
<script src="https://cdn.jsdelivr.net/npm/signature_pad@2.3.2/dist/signature_pad.min.js?v={{ $asset_version }}">
</script>
<script src="{{asset('/plugins/countdowntimer/countdowntimer.min.js').'?v='.$asset_version}}"></script>
@if(!$is_download)
<script src="{{ asset('/plugins/countdowntimer/countdowntimer.min.js') . '?v=' . $asset_version }}"></script>
@if (!$is_download)
<!-- app js values -->
<script type="application/javascript">
var APP = {};
@@ -91,33 +95,35 @@
</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>
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 src="/js/sweetalert2.all.js"></script> --}}
<script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js?v={{$asset_version}}"></script>
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>
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>
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>
src="https://cdnjs.cloudflare.com/ajax/libs/intro.js/2.9.3/intro.min.js?v={{ $asset_version }}"></script>
<script src="{{ asset('js/iframeResizercontentWindow.js') }}"></script>
@endif
<script type="text/javascript">
jQuery.validator.setDefaults({
errorPlacement: function (error, element) {
errorPlacement: function(error, element) {
if (element.hasClass('select2') && element.parent().hasClass('input-group')) {
error.insertAfter(element.parent());
} else if (element.hasClass('select2')) {
@@ -140,57 +146,61 @@
error.insertAfter(element);
}
},
invalidHandler: function () {
invalidHandler: function() {
toastr.error("{{ __('messages.some_error_in_input_field') }}");
}
});
$(document).ready(function () {
@if(!$is_download)
jQuery.extend($.fn.dataTable.defaults, {
fixedHeader: false,
aLengthMenu: [
[25, 50, 100, 200, 500, 1000, -1], [25, 50, 100, 200, 500, 1000, "{{__('messages.all')}}"]
],
iDisplayLength: 25,
dom: 'lfrtip',
"language": {
"emptyTable": "{{__('messages.emptyTable')}}",
"info": "{{__('messages.dt_info')}}",
"infoEmpty": "{{__('messages.infoEmpty')}}",
"infoFiltered": "{{__('messages.infoFiltered')}}",
"lengthMenu": "{{__('messages.lengthMenu')}}",
"loadingRecords": "{{__('messages.loadingRecords')}}",
"processing": "{{__('messages.processing')}}",
"search": "{{__('messages.search')}}",
"zeroRecords": "{{__('messages.zeroRecords')}}",
"paginate": {
"first": "{{__('messages.first')}}",
"last": "{{__('messages.last')}}",
"next": "{{__('messages.next')}}",
"previous": "{{__('messages.previous')}}"
},
buttons: {
copyTitle: "{{__('messages.copy_to_clipboard')}}",
copySuccess: {
_: "{{__('messages.copied_n_rows_to_clipboard')}}"
$(document).ready(function() {
@if (!$is_download)
jQuery.extend($.fn.dataTable.defaults, {
fixedHeader: false,
aLengthMenu: [
[25, 50, 100, 200, 500, 1000, -1],
[25, 50, 100, 200, 500, 1000, "{{ __('messages.all') }}"]
],
iDisplayLength: 25,
dom: 'lfrtip',
"language": {
"emptyTable": "{{ __('messages.emptyTable') }}",
"info": "{{ __('messages.dt_info') }}",
"infoEmpty": "{{ __('messages.infoEmpty') }}",
"infoFiltered": "{{ __('messages.infoFiltered') }}",
"lengthMenu": "{{ __('messages.lengthMenu') }}",
"loadingRecords": "{{ __('messages.loadingRecords') }}",
"processing": "{{ __('messages.processing') }}",
"search": "{{ __('messages.search') }}",
"zeroRecords": "{{ __('messages.zeroRecords') }}",
"paginate": {
"first": "{{ __('messages.first') }}",
"last": "{{ __('messages.last') }}",
"next": "{{ __('messages.next') }}",
"previous": "{{ __('messages.previous') }}"
},
buttons: {
copyTitle: "{{ __('messages.copy_to_clipboard') }}",
copySuccess: {
_: "{{ __('messages.copied_n_rows_to_clipboard') }}"
}
}
}
}
});
});
$.ajaxSetup({
headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}
});
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
@endif
$('button[type=reset]').on('click', function () {
$('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, element_date, 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 = '';
@@ -254,10 +264,9 @@
$('#' + element_name).rangeslider({
polyfill: false,
//Callback function
onInit: function () {
},
onInit: function() {},
// Callback function
onSlide: function (position, value) {
onSlide: function(position, value) {
$('.' + element_name).text(value);
},
});
@@ -265,12 +274,13 @@
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) {
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";
if (url == null) {
url = "{{ url('/file-upload')}}";
file_remove_url = "{{ url('/file-delete')}}";
url = "{{ url('/file-upload') }}";
file_remove_url = "{{ url('/file-delete') }}";
}
var file_names = [];
@@ -286,27 +296,37 @@
maxFilesize: max_file_size,
dictDefaultMessage: file_upload_msg,
maxFiles: no_of_files_can_be_uploaded,
capture: allowed_file_type == 'image/*' ? 'image/*' : null,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
acceptedFiles: allowed_file_type,
init: function () {
init: function() {
//function to be use on editing a form, to display existing files
if ($('input#' + element_name).val().length > 0) {
window[`${element_name}_myDropzone`] = this;
var file_obj = {files: $('input#' + element_name).val()};
var file_obj = {
files: $('input#' + element_name).val()
};
$.ajax({
method: "GET",
url: '/existing-file-display',
dataType: "json",
data: file_obj,
success: function (result) {
success: function(result) {
if (result.success) {
$.each(result.files, function (key, file) {
var mockFile = {name: file.name, uploaded_as: file.uploaded_as, size: file.size};
window[`${element_name}_myDropzone`].emit("addedfile", mockFile);
window[`${element_name}_myDropzone`].emit("thumbnail", mockFile, file.path);
window[`${element_name}_myDropzone`].emit("complete", mockFile);
$.each(result.files, function(key, file) {
var mockFile = {
name: file.name,
uploaded_as: file.uploaded_as,
size: file.size
};
window[`${element_name}_myDropzone`].emit(
"addedfile", mockFile);
window[`${element_name}_myDropzone`].emit(
"thumbnail", mockFile, file.path);
window[`${element_name}_myDropzone`].emit(
"complete", mockFile);
});
}
}
@@ -314,13 +334,15 @@
}
//function to be use on removeing a file
this.on("removedfile", function (file) {
this.on("removedfile", function(file) {
$.ajax({
url: file_remove_url,
data: {"file_name": file.uploaded_as},
data: {
"file_name": file.uploaded_as
},
type: "POST",
success: function (result) {
if (typeof (result) == 'string') {
success: function(result) {
if (typeof(result) == 'string') {
var result = JSON.parse(result);
}
@@ -350,8 +372,8 @@
});
});
},
success: function (file, response) {
if (typeof (response) == 'string') {
success: function(file, response) {
if (typeof(response) == 'string') {
var response = JSON.parse(response);
}
if (response.success == true) {
@@ -409,7 +431,7 @@
var signaturePad = element;
var canvas = document.getElementById(element);
signaturePad = new SignaturePad(canvas, {
onEnd: function (event) {
onEnd: function(event) {
var element = $(this)[0]._canvas.id
var signature = $(this)[0].toDataURL();
$('#output_' + element).val(signature);
@@ -421,12 +443,12 @@
signaturePad.fromDataURL($('#output_' + element).val());
}
$(document).on('click', '#clear_' + element, function () {
$(document).on('click', '#clear_' + element, function() {
signaturePad.clear();
$('#output_' + $(this).data('name')).val('');
});
$(document).on('click', '#undo_' + element, function () {
$(document).on('click', '#undo_' + element, function() {
var data = signaturePad.toData();
if (data) {
data.pop(); // remove the last dot or line
@@ -467,8 +489,8 @@
}
</script>
<!-- Application additional js -->
@if(!$is_download && !isset($nav))
@if(!empty($__additional_js))
{!!$__additional_js!!}
@if (!$is_download && !isset($nav))
@if (!empty($__additional_js))
{!! $__additional_js !!}
@endif
@endif

View File

@@ -19,33 +19,6 @@
<!-- Right Side Of Navbar -->
<ul class="navbar-nav ml-auto">
<!-- Authentication Links -->
<li class="nav-item dropdown">
<a id="superadminDropdown" href="#" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false" class="nav-link dropdown-toggle">
{{str(session()->get('locale'))->upper()}}
</a>
<ul aria-labelledby="superadminDropdown" class="dropdown-menu border-0 shadow">
<li>
<a href="{{route('locale', 'en')}}"
class="dropdown-item @if (session()->get('locale') == 'en') active @endif">
English
</a>
</li>
<li>
<a href="{{route('locale', 'ru')}}"
class="dropdown-item @if (session()->get('locale') == 'ru') active @endif">
Русский
</a>
</li>
<li>
<a href="{{route('locale', 'est')}}"
class="dropdown-item @if (session()->get('locale') == 'est') active @endif">
Eesti keel
</a>
</li>
</ul>
</li>
@guest
<li class="nav-item d-none d-sm-inline-block">
<a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
@@ -167,4 +140,4 @@
</div>
</nav>
<!-- /.navbar -->
<!-- /.navbar -->

View File

@@ -4,7 +4,6 @@ use App\Http\Controllers\FormController;
use App\Http\Controllers\FormDataCommentController;
use App\Http\Controllers\FormDataController;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\LocaleController;
use App\Http\Controllers\ManageProfileController;
use App\Http\Controllers\ManageSettingsController;
use App\Http\Controllers\RegistrationController;
@@ -34,15 +33,13 @@ Route::get('/', function () {
return view('welcome');
});
Route::get('locale/{locale}', LocaleController::class)->name('locale');
Route::middleware(['IsInstalled'])->group(function () {
Auth::routes(['register' => env('ENABLE_REGISTRATION', false)]);
Route::post('registration', [RegistrationController::class, 'store']);
});
Route::middleware(['IsInstalled', 'auth', 'bootstrap', 'setDefaultConfig', 'locale',])->group(function () {
Route::middleware(['IsInstalled', 'auth', 'bootstrap', 'setDefaultConfig'])->group(function () {
Route::get('/home', [HomeController::class, 'index'])->name('home');
Route::get('/home-template', [HomeController::class, 'getTemplate']);
Route::get('/home-assigned-forms', [HomeController::class, 'getAssignedForms']);