1631 |
eleazar |
1 |
<?php
|
|
|
2 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
|
|
3 |
$currentUser = $this->currentUserHelper();
|
|
|
4 |
$roleName = $currentUser->getUserTypeId();
|
1481 |
eleazar |
5 |
|
1482 |
eleazar |
6 |
$routeDatatable = $this->url('recruitment-and-selection/candidates');
|
1637 |
eleazar |
7 |
$routeEmail = $this->url('recruitment-and-selection/user-by-email');
|
1506 |
eleazar |
8 |
$routeAdd = $this->url('recruitment-and-selection/candidates/add', ['vacancy_uuid' => 'UUID_PLACEHOLDER']);
|
1481 |
eleazar |
9 |
|
1482 |
eleazar |
10 |
$allowAdd = $acl->isAllowed($roleName, 'recruitment-and-selection/candidates/add') ? 1 : 0;
|
|
|
11 |
$allowDelete = $acl->isAllowed($roleName, 'recruitment-and-selection/candidates/delete') ? 1 : 0;
|
1613 |
eleazar |
12 |
$allowEdit = $acl->isAllowed($roleName, 'recruitment-and-selection/candidates/edit') ? 1 : 0;
|
1636 |
eleazar |
13 |
$allowEmail = $acl->isAllowed($roleName, 'recruitment-and-selection/user-by-email') ? 1 : 0;
|
1481 |
eleazar |
14 |
|
10135 |
stevensc |
15 |
$jsonVacancies = json_encode($vacancies);
|
10131 |
stevensc |
16 |
|
9954 |
stevensc |
17 |
$js = <<<JS
|
|
|
18 |
const backendVariables= {
|
|
|
19 |
email_link: "$routeEmail",
|
|
|
20 |
add_link: "$routeAdd",
|
|
|
21 |
table_link: "$routeDatatable",
|
10753 |
stevensc |
22 |
vacancies: $jsonVacancies,
|
9954 |
stevensc |
23 |
permisions: {
|
|
|
24 |
allowAdd: $allowAdd,
|
|
|
25 |
allowEdit: $allowEdit,
|
|
|
26 |
allowDelete: $allowDelete,
|
|
|
27 |
allowEmail: $allowEmail
|
|
|
28 |
}
|
|
|
29 |
}
|
|
|
30 |
JS;
|
|
|
31 |
|
|
|
32 |
$this->inlineScript()->appendScript($js);
|
16822 |
efrain |
33 |
#$this->headLink()->appendStylesheet($this->basePath('/react-bundles/recruitment_and_selection/candidates/main.css'));
|
|
|
34 |
#$this->inlineScript()->appendFile('/react-bundles/recruitment_and_selection/candidates/candidatesBundle.js');
|
1481 |
eleazar |
35 |
?>
|
|
|
36 |
|
9954 |
stevensc |
37 |
<div id="recruitment-candidates">
|
11070 |
stevensc |
38 |
</div>
|