15443 |
efrain |
1 |
<?php
|
|
|
2 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
|
|
3 |
$currentUser = $this->currentUserHelper();
|
|
|
4 |
|
|
|
5 |
$roleName = $currentUser->getUserTypeId();
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
$routeAdd = $this->url('settings/actitudes/add');
|
|
|
9 |
$routeDatatable = $this->url('settings/actitudes');
|
|
|
10 |
$routeDashboard = $this->url('dashboard');
|
|
|
11 |
|
|
|
12 |
$allowAdd = $acl->isAllowed($roleName, 'settings/actitudes/add') ? 1 : 0;
|
|
|
13 |
$allowEdit = $acl->isAllowed($roleName, 'settings/actitudes/edit') ? 1 : 0;
|
|
|
14 |
$allowDelete = $acl->isAllowed($roleName, 'settings/actitudes/delete') ? 1 : 0;
|
|
|
15 |
|
|
|
16 |
|
16822 |
efrain |
17 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
|
|
|
18 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
|
15443 |
efrain |
19 |
|
16822 |
efrain |
20 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
|
15443 |
efrain |
21 |
|
|
|
22 |
|
16822 |
efrain |
23 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/jquery.validate.js'));
|
|
|
24 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/additional-methods.js'));
|
|
|
25 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/localization/messages_es.js'));
|
15443 |
efrain |
26 |
|
16822 |
efrain |
27 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
|
|
|
28 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
|
15443 |
efrain |
29 |
|
16822 |
efrain |
30 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
|
|
|
31 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
|
|
|
32 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
|
|
|
33 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
|
15443 |
efrain |
34 |
|
|
|
35 |
|
16822 |
efrain |
36 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
|
|
37 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
15443 |
efrain |
38 |
|
|
|
39 |
|
|
|
40 |
|
16822 |
efrain |
41 |
|
|
|
42 |
|
15443 |
efrain |
43 |
$status_active = \LeadersLinked\Model\Skill::STATUS_ACTIVE;
|
|
|
44 |
|
|
|
45 |
$this->inlineScript()->captureStart();
|
|
|
46 |
echo <<<JS
|
|
|
47 |
jQuery( document ).ready(function( $ ) {
|
|
|
48 |
|
|
|
49 |
$.validator.setDefaults({
|
|
|
50 |
debug: true,
|
|
|
51 |
highlight: function(element) {
|
|
|
52 |
$(element).addClass('is-invalid');
|
|
|
53 |
},
|
|
|
54 |
unhighlight: function(element) {
|
|
|
55 |
$(element).removeClass('is-invalid');
|
|
|
56 |
},
|
|
|
57 |
errorElement: 'span',
|
|
|
58 |
errorClass: 'error invalid-feedback',
|
|
|
59 |
errorPlacement: function(error, element) {
|
|
|
60 |
if(element.parent('.form-group').length) {
|
|
|
61 |
error.insertAfter(element);
|
|
|
62 |
} else if(element.parent('.toggle').length) {
|
|
|
63 |
error.insertAfter(element.parent().parent());
|
|
|
64 |
} else {
|
|
|
65 |
error.insertAfter(element.parent());
|
|
|
66 |
}
|
|
|
67 |
}
|
|
|
68 |
});
|
|
|
69 |
|
|
|
70 |
|
|
|
71 |
$.fn.showFormErrorValidator = function(fieldname, errors) {
|
|
|
72 |
var field = $(fieldname);
|
|
|
73 |
if(field) {
|
|
|
74 |
$(field).addClass('is-invalid');
|
|
|
75 |
|
|
|
76 |
|
|
|
77 |
var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
|
|
|
78 |
if(field.parent('.form-group').length) {
|
|
|
79 |
error.insertAfter(field);
|
|
|
80 |
} else if(field.parent('.toggle').length) {
|
|
|
81 |
error.insertAfter(field.parent().parent());
|
|
|
82 |
} else {
|
|
|
83 |
error.insertAfter(field.parent());
|
|
|
84 |
}
|
|
|
85 |
}
|
|
|
86 |
};
|
|
|
87 |
});
|
|
|
88 |
JS;
|
|
|
89 |
$this->inlineScript()->captureEnd();
|
|
|
90 |
|
|
|
91 |
$js = <<<JS
|
|
|
92 |
const urlsVar = {
|
|
|
93 |
linkTable: '$routeDatatable',
|
|
|
94 |
addUrl: '$routeAdd',
|
|
|
95 |
allowAdd: '$allowAdd',
|
|
|
96 |
allowEdit: '$allowEdit',
|
|
|
97 |
allowDelete: '$allowDelete',
|
|
|
98 |
}
|
|
|
99 |
JS;
|
|
|
100 |
|
|
|
101 |
$this->inlineScript()->appendScript($js);
|
|
|
102 |
$this->inlineScript()->appendFile('/react-bundles/settings/actitudes/actitudesBundle.js');
|
|
|
103 |
?>
|
|
|
104 |
|
|
|
105 |
<!-- Content Header (Page header) -->
|
|
|
106 |
<div id="actitudes">
|
|
|
107 |
</div>
|