Rev 11070 | AutorÃa | Comparar con el anterior | Ultima modificación | Ver Log |
<?php
$acl = $this->viewModel()->getRoot()->getVariable('acl');
$currentUser = $this->currentUserHelper();
$roleName = $currentUser->getUserTypeId();
$routeDatatable = $this->url('recruitment-and-selection/candidates');
$routeEmail = $this->url('recruitment-and-selection/user-by-email');
$routeAdd = $this->url('recruitment-and-selection/candidates/add', ['vacancy_uuid' => 'UUID_PLACEHOLDER']);
$allowAdd = $acl->isAllowed($roleName, 'recruitment-and-selection/candidates/add') ? 1 : 0;
$allowDelete = $acl->isAllowed($roleName, 'recruitment-and-selection/candidates/delete') ? 1 : 0;
$allowEdit = $acl->isAllowed($roleName, 'recruitment-and-selection/candidates/edit') ? 1 : 0;
$allowEmail = $acl->isAllowed($roleName, 'recruitment-and-selection/user-by-email') ? 1 : 0;
$jsonVacancies = json_encode($vacancies);
$js = <<<JS
const backendVariables= {
email_link: "$routeEmail",
add_link: "$routeAdd",
table_link: "$routeDatatable",
vacancies: $jsonVacancies,
permisions: {
allowAdd: $allowAdd,
allowEdit: $allowEdit,
allowDelete: $allowDelete,
allowEmail: $allowEmail
}
}
JS;
$this->inlineScript()->appendScript($js);
#$this->headLink()->appendStylesheet($this->basePath('/react-bundles/recruitment_and_selection/candidates/main.css'));
#$this->inlineScript()->appendFile('/react-bundles/recruitment_and_selection/candidates/candidatesBundle.js');
?>
<div id="recruitment-candidates">
</div>