Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 1385 Rev 1386
Línea 9... Línea 9...
9
use Laminas\Mvc\Controller\AbstractActionController;
9
use Laminas\Mvc\Controller\AbstractActionController;
10
use Laminas\Log\LoggerInterface;
10
use Laminas\Log\LoggerInterface;
11
use Laminas\View\Model\ViewModel;
11
use Laminas\View\Model\ViewModel;
12
use Laminas\View\Model\JsonModel;
12
use Laminas\View\Model\JsonModel;
13
use LeadersLinked\Library\Functions;
13
use LeadersLinked\Library\Functions;
14
use LeadersLinked\Mapper\RecruitCandidateMapper;
14
use LeadersLinked\Mapper\RecruitmentSelectionVacancyMapper;
15
use LeadersLinked\Form\RecruitForm;
-
 
16
use LeadersLinked\Model\RecruitmentForm;
15
use LeadersLinked\Model\RecruitmentForm;
17
use LeadersLinked\Hydrator\ObjectPropertyHydrator;
16
use LeadersLinked\Hydrator\ObjectPropertyHydrator;
18
use LeadersLinked\Model\Location;
17
use LeadersLinked\Model\Location;
19
use LeadersLinked\Mapper\LocationMapper;
18
use LeadersLinked\Mapper\LocationMapper;
20
use LeadersLinked\Mapper\IndustryMapper;
19
use LeadersLinked\Mapper\IndustryMapper;
Línea 119... Línea 118...
119
 
118
 
120
                if (!in_array($order_direction, ['ASC', 'DESC'])) {
119
                if (!in_array($order_direction, ['ASC', 'DESC'])) {
121
                    $order_direction = 'ASC';
120
                    $order_direction = 'ASC';
Línea 122... Línea 121...
122
                }
121
                }
123
 
122
 
Línea 124... Línea 123...
124
                $recruitCandidateMapper = RecruitCandidateMapper::getInstance($this->adapter);
123
                $recruitmentSelectionVacancyMapper = RecruitmentSelectionVacancyMapper::getInstance($this->adapter);
125
                $paginator = $recruitCandidateMapper->fetchAllDataTableByCompanyId($currentCompany->id, $search, $page, $records_x_page, $order_field, $order_direction);
124
                $paginator = $recruitmentSelectionVacancyMapper->fetchAllDataTableByCompanyId($currentCompany->id, $search, $page, $records_x_page, $order_field, $order_direction);
126
 
125
 
Línea 127... Línea 126...
127
                $jobDescriptionMapper = JobDescriptionMapper::getInstance($this->adapter);
126
                $jobDescriptionMapper = JobDescriptionMapper::getInstance($this->adapter);
128
                $industryMapper = IndustryMApper::getInstance($this->adapter);
127
                $industryMapper = IndustryMapper::getInstance($this->adapter);
129
                $jobCategoryMapper = JobCategoryMapper::getInstance($this->adapter);
128
                $jobCategoryMapper = JobCategoryMapper::getInstance($this->adapter);
Línea 218... Línea 217...
218
 
217
 
219
                if (!$recruitmentForm->status) {
218
                if (!$recruitmentForm->status) {
220
                    $recruitmentForm->status = RecruitmentForm::STATUS_INACTIVE;
219
                    $recruitmentForm->status = RecruitmentForm::STATUS_INACTIVE;
221
                }
220
                }
222
                $recruitmentForm->company_id = $currentCompany->id;
221
                $recruitmentForm->company_id = $currentCompany->id;
Línea 223... Línea 222...
223
                $recruitCandidateMapper = RecurtingForm::getInstance($this->adapter);;
222
                $recruitmentSelectionVacancyMapper = RecurtingForm::getInstance($this->adapter);;
Línea 224... Línea 223...
224
 
223
 
225
                $result = $recruitCandidateMapper->insert($recruitmentForm);
224
                $result = $recruitmentSelectionVacancyMapper->insert($recruitmentForm);
Línea 234... Línea 233...
234
                    ];
233
                    ];
Línea 235... Línea 234...
235
 
234
 
236
                } else {
235
                } else {
237
                    $data = [
236
                    $data = [
238
                        'success' => false,
237
                        'success' => false,
239
                        'data' => $recruitCandidateMapper->getError()
238
                        'data' => $recruitmentSelectionVacancyMapper->getError()
240
                    ];
239
                    ];
Línea 241... Línea 240...
241
                }
240
                }
242
 
241
 
Línea 283... Línea 282...
283
            ];
282
            ];
Línea 284... Línea 283...
284
 
283
 
285
            return new JsonModel($data);
284
            return new JsonModel($data);
Línea 286... Línea 285...
286
        }
285
        }
287
 
286
 
288
        $recruitCandidateMapper = RecruitCandidateMapper::getInstance($this->adapter);
287
        $recruitmentSelectionVacancyMapper = RecruitmentSelectionVacancyMapper::getInstance($this->adapter);
289
        $recruitmentCandidate = $recruitCandidateMapper->fetchOneByUuid($uuid);
288
        $recruitmentCandidate = $recruitmentSelectionVacancyMapper->fetchOneByUuid($uuid);
290
        if (!$recruitmentCandidate) {
289
        if (!$recruitmentCandidate) {
291
            $data = [
290
            $data = [
292
                'success' => false,
291
                'success' => false,
Línea 325... Línea 324...
325
                $jobDescription = $jobDescriptionMapper->fetchOneByUuid($dataPost['job_description_id']);
324
                $jobDescription = $jobDescriptionMapper->fetchOneByUuid($dataPost['job_description_id']);
326
                $recruitmentCandidate->job_description_id = $jobDescription->id;
325
                $recruitmentCandidate->job_description_id = $jobDescription->id;
Línea 327... Línea 326...
327
 
326
 
Línea 328... Línea 327...
328
                $recruitmentCandidate->job_description_id = $jobDescription->id;
327
                $recruitmentCandidate->job_description_id = $jobDescription->id;
Línea 329... Línea 328...
329
 
328
 
330
                $result = $recruitCandidateMapper->update($recruitmentCandidate);
329
                $result = $recruitmentSelectionVacancyMapper->update($recruitmentCandidate);
331
 
330
 
332
                if ($result) {
331
                if ($result) {
Línea 338... Línea 337...
338
                        'data' => 'LABEL_RECORD_UPDATED'
337
                        'data' => 'LABEL_RECORD_UPDATED'
339
                    ];
338
                    ];
340
                } else {
339
                } else {
341
                    $data = [
340
                    $data = [
342
                        'success' => false,
341
                        'success' => false,
343
                        'data' => $recruitCandidateMapper->getError()
342
                        'data' => $recruitmentSelectionVacancyMapper->getError()
344
                    ];
343
                    ];
345
                }
344
                }
Línea 346... Línea 345...
346
 
345
 
347
                return new JsonModel($data);
346
                return new JsonModel($data);
Línea 417... Línea 416...
417
            ];
416
            ];
Línea 418... Línea 417...
418
 
417
 
419
            return new JsonModel($data);
418
            return new JsonModel($data);
Línea 420... Línea 419...
420
        }
419
        }
421
 
420
 
422
        $recruitCandidateMapper = RecruitCandidateMapper::getInstance($this->adapter);
421
        $recruitmentSelectionVacancyMapper = RecruitmentSelectionVacancyMapper::getInstance($this->adapter);
423
        $recruitmentCandidate = $recruitCandidateMapper->fetchOneByUuid($uuid);
422
        $recruitmentCandidate = $recruitmentSelectionVacancyMapper->fetchOneByUuid($uuid);
424
        if (!$recruitmentCandidate) {
423
        if (!$recruitmentCandidate) {
425
            $data = [
424
            $data = [
426
                'success' => false,
425
                'success' => false,
Línea 438... Línea 437...
438
        }
437
        }
Línea 439... Línea 438...
439
 
438
 
Línea 440... Línea 439...
440
        if ($request->isPost()) {
439
        if ($request->isPost()) {
441
 
440
 
442
 
441
 
Línea 443... Línea 442...
443
            $result = $recruitCandidateMapper->delete($recruitmentCandidate->id);
442
            $result = $recruitmentSelectionVacancyMapper->delete($recruitmentCandidate->id);
444
            if ($result) {
443
            if ($result) {
Línea 450... Línea 449...
450
                ];
449
                ];
451
            } else {
450
            } else {
Línea 452... Línea 451...
452
 
451
 
453
                $data = [
452
                $data = [
454
                    'success' => false,
453
                    'success' => false,
455
                    'data' => $recruitCandidateMapper->getError()
454
                    'data' => $recruitmentSelectionVacancyMapper->getError()
Línea 456... Línea 455...
456
                ];
455
                ];
457
 
456
 
458
                return new JsonModel($data);
457
                return new JsonModel($data);