Rev 12314 | Rev 15457 | 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();
$routeDashboard = $this->url('dashboard');
$routeDatatable = $this->url('recruitment-and-selection/vacancies');
$routeAdd = $this->url('recruitment-and-selection/vacancies/add');
$allowAdd = $acl->isAllowed($roleName, 'recruitment-and-selection/vacancies/add') ? 1 : 0;
$allowEdit = $acl->isAllowed($roleName, 'recruitment-and-selection/vacancies/edit') ? 1 : 0;
$allowDelete = $acl->isAllowed($roleName, 'recruitment-and-selection/vacancies/delete') ? 1 : 0;
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.min.css'));
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.full.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'));
$jsonJobCategories = json_encode($jobCategories);
$jsonIndustries = json_encode($industries);
$jsonJobDescritions = json_encode($jobDescritions);
$js = <<<JS
const backendVariables= {
dashboard_link: "$routeDashboard",
add_link: "$routeAdd",
table_link: "$routeDatatable",
googleApiKey: "$google_map_key",
jobCategories: $jsonJobCategories,
industries: $jsonIndustries,
jobDescritions: $jsonJobDescritions,
permisions: {
allowAdd: $allowAdd,
allowEdit: $allowEdit,
allowDelete: $allowDelete
}
}
JS;
$this->inlineScript()->appendScript($js);
$this->headLink()->appendStylesheet($this->basePath('/react-bundles/recruitment_and_selection/vacancies/main.css'));
$this->inlineScript()->appendFile('/react-bundles/recruitment_and_selection/vacancies/vacanciesBundle.js');
?>
<!-- Content Header (Page header) -->
<div id="recruitment_and_selection-vacancies">
</div>