| Línea 2... |
Línea 2... |
| 2 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
2 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
| 3 |
$currentUser = $this->currentUserHelper();
|
3 |
$currentUser = $this->currentUserHelper();
|
| Línea 4... |
Línea 4... |
| 4 |
|
4 |
|
| Línea 5... |
Línea -... |
| 5 |
$roleName = $currentUser->getUserTypeId();
|
- |
|
| 6 |
|
5 |
$roleName = $currentUser->getUserTypeId();
|
| 7 |
|
6 |
|
| 8 |
$routeAdd = $this->url('settings/aptitudes/add');
|
7 |
$routeAdd = $this->url('settings/aptitudes/add');
|
| Línea 9... |
Línea 8... |
| 9 |
$routeDatatable = $this->url('settings/aptitudes');
|
8 |
$routeDatatable = $this->url('settings/aptitudes');
|
| 10 |
$routeDashboard = $this->url('dashboard');
|
9 |
$routeDashboard = $this->url('dashboard');
|
| 11 |
|
10 |
|
| Línea 12... |
Línea -... |
| 12 |
$allowAdd = $acl->isAllowed($roleName, 'settings/aptitudes/add') ? 1 : 0;
|
- |
|
| 13 |
$allowEdit = $acl->isAllowed($roleName, 'settings/aptitudes/edit') ? 1 : 0;
|
- |
|
| 14 |
$allowDelete = $acl->isAllowed($roleName, 'settings/aptitudes/delete') ? 1 : 0;
|
- |
|
| 15 |
|
- |
|
| 16 |
|
11 |
$allowAdd = $acl->isAllowed($roleName, 'settings/aptitudes/add') ? 1 : 0;
|
| Línea 17... |
Línea -... |
| 17 |
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
|
- |
|
| 18 |
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
|
- |
|
| 19 |
|
- |
|
| 20 |
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
|
- |
|
| 21 |
|
- |
|
| 22 |
|
- |
|
| 23 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
|
- |
|
| 24 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
|
- |
|
| 25 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
|
- |
|
| 26 |
|
- |
|
| 27 |
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
|
- |
|
| 28 |
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
|
- |
|
| 29 |
|
- |
|
| 30 |
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
|
- |
|
| 31 |
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
|
12 |
$allowEdit = $acl->isAllowed($roleName, 'settings/aptitudes/edit') ? 1 : 0;
|
| 32 |
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
|
13 |
$allowDelete = $acl->isAllowed($roleName, 'settings/aptitudes/delete') ? 1 : 0;
|
| Línea 33... |
Línea 14... |
| 33 |
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
|
14 |
|
| 34 |
|
15 |
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
|
| Línea 35... |
Línea -... |
| 35 |
|
- |
|
| 36 |
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
- |
|
| 37 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
- |
|
| 38 |
|
- |
|
| 39 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
|
- |
|
| 40 |
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
|
- |
|
| 41 |
|
- |
|
| 42 |
|
- |
|
| 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 |
}
|
16 |
|
| 85 |
}
|
17 |
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
| 86 |
};
|
18 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
| 87 |
});
|
19 |
|
| 88 |
JS;
|
20 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
|