Línea 4... |
Línea 4... |
4 |
namespace LeadersLinked\Controller;
|
4 |
namespace LeadersLinked\Controller;
|
Línea 5... |
Línea 5... |
5 |
|
5 |
|
6 |
use Laminas\Authentication\AuthenticationService;
|
6 |
use Laminas\Authentication\AuthenticationService;
|
7 |
use Laminas\Authentication\Result as AuthResult;
|
7 |
use Laminas\Authentication\Result as AuthResult;
|
8 |
use Laminas\Db\Adapter\AdapterInterface;
|
8 |
use Laminas\Db\Adapter\AdapterInterface;
|
9 |
use Laminas\Cache\Storage\Adapter\AbstractAdapter;
|
9 |
use LeadersLinked\Cache\CacheInterface;
|
10 |
use Laminas\Mvc\Controller\AbstractActionController;
|
10 |
use Laminas\Mvc\Controller\AbstractActionController;
|
11 |
use Laminas\Mvc\I18n\Translator;
|
11 |
use Laminas\Mvc\I18n\Translator;
|
12 |
use Laminas\Log\LoggerInterface;
|
12 |
use Laminas\Log\LoggerInterface;
|
13 |
use Laminas\View\Model\ViewModel;
|
13 |
use Laminas\View\Model\ViewModel;
|
Línea 40... |
Línea 40... |
40 |
private $adapter;
|
40 |
private $adapter;
|
Línea 41... |
Línea 41... |
41 |
|
41 |
|
42 |
|
42 |
|
43 |
/**
|
43 |
/**
|
44 |
*
|
44 |
*
|
45 |
* @var AbstractAdapter
|
45 |
* @var CacheInterface
|
Línea 46... |
Línea 46... |
46 |
*/
|
46 |
*/
|
47 |
private $cache;
|
47 |
private $cache;
|
Línea 61... |
Línea 61... |
61 |
|
61 |
|
62 |
|
62 |
|
63 |
/**
|
63 |
/**
|
64 |
*
|
64 |
*
|
65 |
* @param AdapterInterface $adapter
|
65 |
* @param AdapterInterface $adapter
|
66 |
* @param AbstractAdapter $cache
|
66 |
* @param CacheInterface $cache
|
67 |
* @param LoggerInterface $logger
|
67 |
* @param LoggerInterface $logger
|
68 |
* @param array $config
|
68 |
* @param array $config
|
69 |
*/
|
69 |
*/
|
Línea 155... |
Línea 155... |
155 |
|
155 |
|
Línea 156... |
Línea 156... |
156 |
if($isJson) {
|
156 |
if($isJson) {
|
Línea 157... |
Línea 157... |
157 |
|
157 |
|
158 |
$acl = $this->getEvent()->getViewModel()->getVariable('acl');
|
158 |
$acl = $this->getEvent()->getViewModel()->getVariable('acl');
|
159 |
|
159 |
|
160 |
$allowAdd = $acl->isAllowed($currentUser->usertype_id, 'planning-objectives-and-goals/objectives/goals/task/add');
|
160 |
$allowAdd = $acl->isAllowed($currentUser->usertype_id, 'planning/objectives/goals/task/add');
|
Línea 161... |
Línea 161... |
161 |
$allowEdit = $acl->isAllowed($currentUser->usertype_id, 'planning-objectives-and-goals/objectives/goals/task/edit');
|
161 |
$allowEdit = $acl->isAllowed($currentUser->usertype_id, 'planning/objectives/goals/task/edit');
|
162 |
$allowDelete = $acl->isAllowed($currentUser->usertype_id, 'planning-objectives-and-goals/objectives/goals/task/delete');
|
162 |
$allowDelete = $acl->isAllowed($currentUser->usertype_id, 'planning/objectives/goals/task/delete');
|
Línea 163... |
Línea 163... |
163 |
$allowView = $acl->isAllowed($currentUser->usertype_id, 'planning-objectives-and-goals/objectives/goals/task/view');
|
163 |
$allowView = $acl->isAllowed($currentUser->usertype_id, 'planning/objectives/goals/task/view');
|
164 |
|
164 |
|
165 |
$search = $this->params()->fromQuery('search', []);
|
165 |
$search = $this->params()->fromQuery('search', []);
|
166 |
$search = empty($search['value']) ? '' : filter_var($search['value'], FILTER_SANITIZE_STRING);
|
166 |
$search = empty($search['value']) ? '' : Functions::sanitizeFilterString($search['value']);
|
167 |
|
167 |
|
Línea 168... |
Línea 168... |
168 |
$records_x_page = intval($this->params()->fromQuery('length', 10), 10);
|
168 |
$records_x_page = intval($this->params()->fromQuery('length', 10), 10);
|
169 |
$page = (intval($this->params()->fromQuery('start', 1), 10)/$records_x_page)+1;
|
169 |
$page = (intval($this->params()->fromQuery('start', 1), 10)/$records_x_page)+1;
|
Línea 170... |
Línea 170... |
170 |
$order = $this->params()->fromQuery('order', []);
|
170 |
$order = $this->params()->fromQuery('order', []);
|
Línea 237... |
Línea 237... |
237 |
'description' => $record->description,
|
237 |
'description' => $record->description,
|
238 |
'progress'=> $record->indicator,
|
238 |
'progress'=> $record->indicator,
|
239 |
'cost'=> $record->cost,
|
239 |
'cost'=> $record->cost,
|
240 |
'status' => $record->status,
|
240 |
'status' => $record->status,
|
241 |
'actions' => [
|
241 |
'actions' => [
|
242 |
'link_edit' => $allowEdit ? $this->url()->fromRoute('planning-objectives-and-goals/objectives/goals/task/edit', ['objective_id' => $objective_uuid,'goal_id' => $goal_uuid,'id' => $record->uuid]) : '',
|
242 |
'link_edit' => $allowEdit ? $this->url()->fromRoute('planning/objectives/goals/task/edit', ['objective_id' => $objective_uuid,'goal_id' => $goal_uuid,'id' => $record->uuid]) : '',
|
243 |
'link_delete' => $allowDelete ? $this->url()->fromRoute('planning-objectives-and-goals/objectives/goals/task/delete', ['objective_id' => $objective_uuid,'goal_id' => $goal_uuid,'id' => $record->uuid]) : ''
|
243 |
'link_delete' => $allowDelete ? $this->url()->fromRoute('planning/objectives/goals/task/delete', ['objective_id' => $objective_uuid,'goal_id' => $goal_uuid,'id' => $record->uuid]) : ''
|
244 |
]
|
244 |
]
|
Línea 245... |
Línea 245... |
245 |
|
245 |
|
246 |
];
|
246 |
];
|
247 |
array_push($items, $item);
|
247 |
array_push($items, $item);
|
Línea 287... |
Línea 287... |
287 |
]);
|
287 |
]);
|
288 |
} else {
|
288 |
} else {
|
289 |
$formAdd = new PlanningObjectivesAndGoalsTaskForm($this->adapter, $currentCompany->id);
|
289 |
$formAdd = new PlanningObjectivesAndGoalsTaskForm($this->adapter, $currentCompany->id);
|
290 |
$this->layout()->setTemplate('layout/layout-backend');
|
290 |
$this->layout()->setTemplate('layout/layout-backend');
|
291 |
$viewModel = new ViewModel();
|
291 |
$viewModel = new ViewModel();
|
292 |
$viewModel->setTemplate('leaders-linked/planning-objectives-and-goals-task/index.phtml');
|
292 |
$viewModel->setTemplate('leaders-linked/planning-task/index.phtml');
|
293 |
$viewModel->setVariables([
|
293 |
$viewModel->setVariables([
|
294 |
'formAdd' => $formAdd,
|
294 |
'formAdd' => $formAdd,
|
295 |
'objective_uuid'=> $objective_uuid,
|
295 |
'objective_uuid'=> $objective_uuid,
|
296 |
'goal_uuid'=> $goal_uuid,
|
296 |
'goal_uuid'=> $goal_uuid,
|