| Línea 76... |
Línea 76... |
| 76 |
|
76 |
|
| 77 |
|
77 |
|
| 78 |
|
78 |
|
| 79 |
public function indexAction()
|
79 |
public function indexAction()
|
| 80 |
{
|
80 |
{
|
| Línea 81... |
Línea 81... |
| 81 |
$uuidObjective = $this->params()->fromRoute('uuid_objective');
|
81 |
$objective_uuid = $this->params()->fromRoute('objective_id');
|
| Línea 127... |
Línea 127... |
| 127 |
if(!in_array($order_direction, ['ASC', 'DESC'])) {
|
127 |
if(!in_array($order_direction, ['ASC', 'DESC'])) {
|
| 128 |
$order_direction = 'ASC';
|
128 |
$order_direction = 'ASC';
|
| 129 |
}
|
129 |
}
|
| Línea 130... |
Línea 130... |
| 130 |
|
130 |
|
| 131 |
$planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);
|
131 |
$planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);
|
| Línea 132... |
Línea 132... |
| 132 |
$objective = $planningObjectivesAndGoalsObjectivesMapper->fetchOneByUuid($uuidObjective);
|
132 |
$objective = $planningObjectivesAndGoalsObjectivesMapper->fetchOneByUuid($objective_uuid);
|
| 133 |
|
133 |
|
| 134 |
if (!$objective) {
|
134 |
if (!$objective) {
|
| 135 |
$data = [
|
135 |
$data = [
|
| Línea 141... |
Línea 141... |
| 141 |
return new JsonModel($data);
|
141 |
return new JsonModel($data);
|
| Línea 142... |
Línea 142... |
| 142 |
|
142 |
|
| 143 |
}else{
|
143 |
}else{
|
| 144 |
if($objective->company_id==$currentCompany->id){
|
144 |
if($objective->company_id==$currentCompany->id){
|
| 145 |
$planningObjectivesAndGoalsGoalsMapper = PlanningObjectivesAndGoalsGoalsMapper::getInstance($this->adapter);
|
145 |
$planningObjectivesAndGoalsGoalsMapper = PlanningObjectivesAndGoalsGoalsMapper::getInstance($this->adapter);
|
| Línea 146... |
Línea 146... |
| 146 |
$goals = $planningObjectivesAndGoalsGoalsMapper->fetchOneByUuid($uuidGoals);
|
146 |
$goals = $planningObjectivesAndGoalsGoalsMapper->fetchOneByUuid($goal_uuid);
|
| 147 |
|
147 |
|
| 148 |
if(!$goals){
|
148 |
if(!$goals){
|
| 149 |
$data = [
|
149 |
$data = [
|
| Línea 184... |
Línea 184... |
| 184 |
'description' => $record->description,
|
184 |
'description' => $record->description,
|
| 185 |
'progress'=> $record->indicator,
|
185 |
'progress'=> $record->indicator,
|
| 186 |
'cost'=> $record->cost,
|
186 |
'cost'=> $record->cost,
|
| 187 |
'status' => $record->status,
|
187 |
'status' => $record->status,
|
| 188 |
'actions' => [
|
188 |
'actions' => [
|
| 189 |
'link_edit' => $allowEdit ? $this->url()->fromRoute('planning-objectives-and-goals/objectives/goals/task/edit', ['uuid_objective' => $uuidObjective,'uuid_goal' => $uuidGoals,'id' => $record->uuid]) : '',
|
189 |
'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]) : '',
|
| 190 |
'link_delete' => $allowDelete ? $this->url()->fromRoute('planning-objectives-and-goals/objectives/goals/task/delete', ['uuid_objective' => $uuidObjective,'uuid_goal' => $uuidGoals,'id' => $record->uuid]) : ''
|
190 |
'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]) : ''
|
| 191 |
]
|
191 |
]
|
| Línea 192... |
Línea 192... |
| 192 |
|
192 |
|
| 193 |
];
|
193 |
];
|
| 194 |
array_push($items, $item);
|
194 |
array_push($items, $item);
|
| Línea 235... |
Línea 235... |
| 235 |
$this->layout()->setTemplate('layout/layout-backend');
|
235 |
$this->layout()->setTemplate('layout/layout-backend');
|
| 236 |
$viewModel = new ViewModel();
|
236 |
$viewModel = new ViewModel();
|
| 237 |
$viewModel->setTemplate('leaders-linked/planning-objectives-and-goals-task/index.phtml');
|
237 |
$viewModel->setTemplate('leaders-linked/planning-objectives-and-goals-task/index.phtml');
|
| 238 |
$viewModel->setVariables([
|
238 |
$viewModel->setVariables([
|
| 239 |
'formAdd' => $formAdd,
|
239 |
'formAdd' => $formAdd,
|
| 240 |
'uuid_objective'=> $uuidObjective,
|
240 |
'objective_uuid'=> $objective_uuid,
|
| 241 |
'uuid_goal'=> $uuidGoals,
|
241 |
'goal_uuid'=> $goal_uuid,
|
| Línea 242... |
Línea 242... |
| 242 |
|
242 |
|
| 243 |
|
243 |
|
| 244 |
]);
|
244 |
]);
|
| Línea 254... |
Línea 254... |
| 254 |
public function addAction()
|
254 |
public function addAction()
|
| 255 |
{
|
255 |
{
|
| 256 |
$currentUserPlugin = $this->plugin('currentUserPlugin');
|
256 |
$currentUserPlugin = $this->plugin('currentUserPlugin');
|
| 257 |
$currentUser = $currentUserPlugin->getUser();
|
257 |
$currentUser = $currentUserPlugin->getUser();
|
| 258 |
$currentCompany = $currentUserPlugin->getCompany();
|
258 |
$currentCompany = $currentUserPlugin->getCompany();
|
| 259 |
$uuidObjective = $this->params()->fromRoute('uuid_objective');
|
259 |
$objective_uuid = $this->params()->fromRoute('objective_id');
|
| 260 |
$uuidGoals = $this->params()->fromRoute('uuid_goal');
|
260 |
$goal_uuid = $this->params()->fromRoute('goal_id');
|
| 261 |
$request = $this->getRequest();
|
261 |
$request = $this->getRequest();
|
| 262 |
$planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);
|
262 |
$planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);
|
| 263 |
$objective = $planningObjectivesAndGoalsObjectivesMapper->fetchOneByUuid($uuidObjective);
|
263 |
$objective = $planningObjectivesAndGoalsObjectivesMapper->fetchOneByUuid($objective_uuid);
|
| Línea 264... |
Línea 264... |
| 264 |
|
264 |
|
| 265 |
if (!$objective) {
|
265 |
if (!$objective) {
|
| 266 |
$data = [
|
266 |
$data = [
|
| 267 |
'success' => false,
|
267 |
'success' => false,
|
| Línea 272... |
Línea 272... |
| 272 |
return new JsonModel($data);
|
272 |
return new JsonModel($data);
|
| Línea 273... |
Línea 273... |
| 273 |
|
273 |
|
| 274 |
}else{
|
274 |
}else{
|
| 275 |
if($objective->company_id==$currentCompany->id){
|
275 |
if($objective->company_id==$currentCompany->id){
|
| 276 |
$planningObjectivesAndGoalsGoalsMapper = PlanningObjectivesAndGoalsGoalsMapper::getInstance($this->adapter);
|
276 |
$planningObjectivesAndGoalsGoalsMapper = PlanningObjectivesAndGoalsGoalsMapper::getInstance($this->adapter);
|
| Línea 277... |
Línea 277... |
| 277 |
$goals = $planningObjectivesAndGoalsGoalsMapper->fetchOneByUuid($uuidGoals);
|
277 |
$goals = $planningObjectivesAndGoalsGoalsMapper->fetchOneByUuid($goal_uuid);
|
| 278 |
|
278 |
|
| 279 |
if(!$goals){
|
279 |
if(!$goals){
|
| 280 |
$data = [
|
280 |
$data = [
|
| Línea 424... |
Línea 424... |
| 424 |
];
|
424 |
];
|
| Línea 425... |
Línea 425... |
| 425 |
|
425 |
|
| 426 |
return new JsonModel($data);
|
426 |
return new JsonModel($data);
|
| Línea 427... |
Línea 427... |
| 427 |
}
|
427 |
}
|
| 428 |
|
428 |
|
| 429 |
$uuidObjective = $this->params()->fromRoute('uuid_objective');
|
429 |
$objective_uuid = $this->params()->fromRoute('objective_id');
|
| 430 |
$uuidGoals = $this->params()->fromRoute('uuid_goal');
|
430 |
$goal_uuid = $this->params()->fromRoute('goal_id');
|
| 431 |
$currentUserPlugin = $this->plugin('currentUserPlugin');
|
431 |
$currentUserPlugin = $this->plugin('currentUserPlugin');
|
| 432 |
$currentCompany = $currentUserPlugin->getCompany();
|
432 |
$currentCompany = $currentUserPlugin->getCompany();
|
| Línea 433... |
Línea 433... |
| 433 |
$planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);
|
433 |
$planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);
|
| 434 |
$objective = $planningObjectivesAndGoalsObjectivesMapper->fetchOneByUuid($uuidObjective);
|
434 |
$objective = $planningObjectivesAndGoalsObjectivesMapper->fetchOneByUuid($objective_uuid);
|
| 435 |
|
435 |
|
| 436 |
if (!$objective) {
|
436 |
if (!$objective) {
|
| Línea 443... |
Línea 443... |
| 443 |
return new JsonModel($data);
|
443 |
return new JsonModel($data);
|
| Línea 444... |
Línea 444... |
| 444 |
|
444 |
|
| 445 |
}else{
|
445 |
}else{
|
| 446 |
if($objective->company_id==$currentCompany->id){
|
446 |
if($objective->company_id==$currentCompany->id){
|
| 447 |
$planningObjectivesAndGoalsGoalsMapper = PlanningObjectivesAndGoalsGoalsMapper::getInstance($this->adapter);
|
447 |
$planningObjectivesAndGoalsGoalsMapper = PlanningObjectivesAndGoalsGoalsMapper::getInstance($this->adapter);
|
| Línea 448... |
Línea 448... |
| 448 |
$goals = $planningObjectivesAndGoalsGoalsMapper->fetchOneByUuid($uuidGoals);
|
448 |
$goals = $planningObjectivesAndGoalsGoalsMapper->fetchOneByUuid($goal_uuid);
|
| 449 |
|
449 |
|
| 450 |
if(!$goals){
|
450 |
if(!$goals){
|
| 451 |
$data = [
|
451 |
$data = [
|
| Línea 611... |
Línea 611... |
| 611 |
'data' => 'ERROR_INVALID_PARAMETER'
|
611 |
'data' => 'ERROR_INVALID_PARAMETER'
|
| 612 |
];
|
612 |
];
|
| Línea 613... |
Línea 613... |
| 613 |
|
613 |
|
| 614 |
return new JsonModel($data);
|
614 |
return new JsonModel($data);
|
| 615 |
}
|
615 |
}
|
| 616 |
$uuidObjective = $this->params()->fromRoute('uuid_objective');
|
616 |
$objective_uuid = $this->params()->fromRoute('objective_id');
|
| 617 |
$uuidGoals = $this->params()->fromRoute('uuid_goal');
|
617 |
$goal_uuid = $this->params()->fromRoute('goal_id');
|
| 618 |
$currentUserPlugin = $this->plugin('currentUserPlugin');
|
618 |
$currentUserPlugin = $this->plugin('currentUserPlugin');
|
| 619 |
$currentCompany = $currentUserPlugin->getCompany();
|
619 |
$currentCompany = $currentUserPlugin->getCompany();
|
| 620 |
$planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);
|
620 |
$planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);
|
| Línea 621... |
Línea 621... |
| 621 |
$objective = $planningObjectivesAndGoalsObjectivesMapper->fetchOneByUuid($uuidObjective);
|
621 |
$objective = $planningObjectivesAndGoalsObjectivesMapper->fetchOneByUuid($objective_uuid);
|
| 622 |
|
622 |
|
| 623 |
if (!$objective) {
|
623 |
if (!$objective) {
|
| 624 |
$data = [
|
624 |
$data = [
|
| Línea 628... |
Línea 628... |
| 628 |
return new JsonModel($data);
|
628 |
return new JsonModel($data);
|
| Línea 629... |
Línea 629... |
| 629 |
|
629 |
|
| 630 |
}else{
|
630 |
}else{
|
| 631 |
if($objective->company_id==$currentCompany->id){
|
631 |
if($objective->company_id==$currentCompany->id){
|
| 632 |
$planningObjectivesAndGoalsGoalsMapper = PlanningObjectivesAndGoalsGoalsMapper::getInstance($this->adapter);
|
632 |
$planningObjectivesAndGoalsGoalsMapper = PlanningObjectivesAndGoalsGoalsMapper::getInstance($this->adapter);
|
| Línea 633... |
Línea 633... |
| 633 |
$goals = $planningObjectivesAndGoalsGoalsMapper->fetchOneByUuid($uuidGoals);
|
633 |
$goals = $planningObjectivesAndGoalsGoalsMapper->fetchOneByUuid($goal_uuid);
|
| 634 |
|
634 |
|
| 635 |
if(!$goals){
|
635 |
if(!$goals){
|
| 636 |
$data = [
|
636 |
$data = [
|