Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
<?php
$acl = $this->viewModel()->getRoot()->getVariable('acl');
$currentUser = $this->currentUserHelper();
$roleName = $currentUser->getUserTypeId();
$routeAdd = $this->url('settings/actitudes/add');
$routeDatatable = $this->url('settings/actitudes');
$routeDashboard = $this->url('dashboard');
$allowAdd = $acl->isAllowed($roleName, 'settings/actitudes/add') ? 1 : 0;
$allowEdit = $acl->isAllowed($roleName, 'settings/actitudes/edit') ? 1 : 0;
$allowDelete = $acl->isAllowed($roleName, 'settings/actitudes/delete') ? 1 : 0;
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
$status_active = \LeadersLinked\Model\Skill::STATUS_ACTIVE;
$this->inlineScript()->captureStart();
echo <<<JS
jQuery( document ).ready(function( $ ) {
$.validator.setDefaults({
debug: true,
highlight: function(element) {
$(element).addClass('is-invalid');
},
unhighlight: function(element) {
$(element).removeClass('is-invalid');
},
errorElement: 'span',
errorClass: 'error invalid-feedback',
errorPlacement: function(error, element) {
if(element.parent('.form-group').length) {
error.insertAfter(element);
} else if(element.parent('.toggle').length) {
error.insertAfter(element.parent().parent());
} else {
error.insertAfter(element.parent());
}
}
});
$.fn.showFormErrorValidator = function(fieldname, errors) {
var field = $(fieldname);
if(field) {
$(field).addClass('is-invalid');
var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
if(field.parent('.form-group').length) {
error.insertAfter(field);
} else if(field.parent('.toggle').length) {
error.insertAfter(field.parent().parent());
} else {
error.insertAfter(field.parent());
}
}
};
});
JS;
$this->inlineScript()->captureEnd();
$js = <<<JS
const urlsVar = {
linkTable: '$routeDatatable',
addUrl: '$routeAdd',
allowAdd: '$allowAdd',
allowEdit: '$allowEdit',
allowDelete: '$allowDelete',
}
JS;
$this->inlineScript()->appendScript($js);
$this->inlineScript()->appendFile('/react-bundles/settings/actitudes/actitudesBundle.js');
?>
<!-- Content Header (Page header) -->
<div id="actitudes">
</div>