Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 1543 | Rev 1546 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1543 Rev 1544
Línea 121... Línea 121...
121
                $allowDelete = $acl->isAllowed($currentUser->usertype_id, 'recruitment-and-selection/vacancies/delete');
121
                $allowDelete = $acl->isAllowed($currentUser->usertype_id, 'recruitment-and-selection/vacancies/delete');
Línea 122... Línea 122...
122
               
122
               
Línea 123... Línea 123...
123
                $allowEdit = $acl->isAllowed($currentUser->usertype_id, 'recruitment-and-selection/vacancies/edit');
123
                $allowEdit = $acl->isAllowed($currentUser->usertype_id, 'recruitment-and-selection/vacancies/edit');
124
 
124
 
Línea 125... Línea 125...
125
                $recruitmentSelectionVacancyMapper = RecruitmentSelectionVacancyMapper::getInstance($this->adapter);
125
                $recruitmentSelectionVacancyMapper = RecruitmentSelectionVacancyMapper::getInstance($this->adapter);
126
                $paginator = $recruitmentSelectionVacancyMapper->fetchAllDataTableByCompanyId($currentCompany->uuid, $search, $page, $records_x_page, $order_field, $order_direction);
126
                $paginator = $recruitmentSelectionVacancyMapper->fetchAllDataTableByCompanyId($currentCompany->id, $search, $page, $records_x_page, $order_field, $order_direction);
127
 
127
 
Línea 158... Línea 158...
158
                        'total' => $paginator->getTotalItemCount(),
158
                        'total' => $paginator->getTotalItemCount(),
159
                    ]
159
                    ]
160
                ]);
160
                ]);
161
            } else {
161
            } else {
Línea 162... Línea 162...
162
 
162
 
Línea 163... Línea 163...
163
                $form = new RecruitmentSelectionVacancyForm($this->adapter, $currentCompany->uuid);
163
                $form = new RecruitmentSelectionVacancyForm($this->adapter, $currentCompany->id);
164
 
-
 
165
                $jobDescriptionMapper = JobDescriptionMapper::getInstance($this->adapter);
164
 
166
                $jobsDescription = $jobDescriptionMapper->fetchAllByDefault($currentCompany->uuid);
-
 
167
                $industryMapper = industryMapper::getInstance($this->adapter);
165
                $jobDescriptionMapper = JobDescriptionMapper::getInstance($this->adapter);
168
                $industry = $industryMapper->fetchAllActives($currentCompany->uuid);
-
 
Línea 169... Línea 166...
169
                $jobCategoryMapper = JobCategoryMapper::getInstance($this->adapter);
166
                $industryMapper = industryMapper::getInstance($this->adapter);
170
                $jobCategory = $jobCategoryMapper->fetchAllActives($currentCompany->uuid);
167
                $jobCategoryMapper = JobCategoryMapper::getInstance($this->adapter);
171
                
168
                
172
                $this->layout()->setTemplate('layout/layout-backend');
169
                $this->layout()->setTemplate('layout/layout-backend');
Línea 196... Línea 193...
196
 
193
 
Línea 197... Línea 194...
197
        $request = $this->getRequest();
194
        $request = $this->getRequest();
198
 
195
 
199
 
196
 
Línea 200... Línea 197...
200
        if ($request->isPost()) {
197
        if ($request->isPost()) {
Línea 230... Línea 227...
230
 
227
 
231
                $vacancy = new RecruitmentSelectionVacancy();
228
                $vacancy = new RecruitmentSelectionVacancy();
Línea 232... Línea 229...
232
                $hydrator->hydrate($dataPost, $vacancy);
229
                $hydrator->hydrate($dataPost, $vacancy);
233
 
230
 
Línea 234... Línea 231...
234
                $vacancy->location_id = $location->id;
231
                $vacancy->location_id = $location->id;
235
                $vacancy->company_id = $currentCompany->uuid;
232
                $vacancy->company_id = $currentCompany->id;
236
 
233
 
Línea 327... Línea 324...
327
            ];
324
            ];
Línea 328... Línea 325...
328
 
325
 
329
            return new JsonModel($data);
326
            return new JsonModel($data);
Línea 330... Línea 327...
330
        }
327
        }
331
 
328
 
332
        if ($vacancyMapper->company_id != $currentCompany->uuid) {
329
        if ($vacancyMapper->company_id != $currentCompany->id) {
333
            return new JsonModel([
330
            return new JsonModel([
334
                'success' => false,
331
                'success' => false,
335
                'data' => 'ERROR_UNAUTHORIZED'
332
                'data' => 'ERROR_UNAUTHORIZED'
Línea 336... Línea 333...
336
            ]);
333
            ]);
337
        }
334
        }
338
 
335
 
339
 
336
 
Línea 340... Línea 337...
340
        if ($request->isPost()) {
337
        if ($request->isPost()) {
Línea 371... Línea 368...
371
                $vacancyMapper->industry = $industry->id;
368
                $vacancyMapper->industry = $industry->id;
Línea 372... Línea 369...
372
 
369
 
Línea 373... Línea 370...
373
                $result = $recruitmentSelectionVacancyMapper->update($vacancyMapper);
370
                $result = $recruitmentSelectionVacancyMapper->update($vacancyMapper);
374
 
371
 
375
                if ($result) {
372
                if ($result) {
376
                    $this->logger->info('Se agrego el candidato' . $vacancyMapper->name, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
373
                    $this->logger->info('Se agrego el proceso de reclutamiento' . $vacancyMapper->name, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
377
                    $data = [
374
                    $data = [
378
                        'success' => true,
375
                        'success' => true,
379
                        'data' => 'LABEL_RECORD_UPDATED'
376
                        'data' => 'LABEL_RECORD_UPDATED'
Línea 426... Línea 423...
426
            $data = [
423
            $data = [
427
                'success' => true,
424
                'success' => true,
428
                'data' => [
425
                'data' => [
429
                    'id' => $vacancyMapper->uuid,
426
                    'id' => $vacancyMapper->uuid,
430
                    'name' => $vacancyMapper->name,
427
                    'name' => $vacancyMapper->name,
431
                    'company'=>$currentCompany->uuid,
-
 
432
                    'job_description_id' => $jobDescription->uuid,
428
                    'job_description_id' => $jobDescription->uuid,
433
                    'location_search' => $location->formatted_address,
429
                    'location_search' => $location->formatted_address,
434
                    'job_category_id' => $jobCategory->uuid,
430
                    'job_category_id' => $jobCategory->uuid,
435
                    'description' => $vacancyMapper->description,
431
                    'description' => $vacancyMapper->description,
436
                    'industry_id' => $industry->uuid, 
432
                    'industry_id' => $industry->uuid, 
Línea 480... Línea 476...
480
            ];
476
            ];
Línea 481... Línea 477...
481
 
477
 
482
            return new JsonModel($data);
478
            return new JsonModel($data);
Línea 483... Línea 479...
483
        }
479
        }
484
 
480
 
485
        if ($vacancyMapper->company_id != $currentCompany->uuid) {
481
        if ($vacancyMapper->company_id != $currentCompany->id) {
486
            return new JsonModel([
482
            return new JsonModel([
487
                'success' => false,
483
                'success' => false,
488
                'data' => 'ERROR_UNAUTHORIZED'
484
                'data' => 'ERROR_UNAUTHORIZED'