Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16784 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 16784 Rev 16787
Línea 21... Línea 21...
21
    public function __construct($adapter, $company_id, $job_description_id = 0) 
21
    public function __construct($adapter, $company_id, $job_description_id = 0) 
22
    {
22
    {
23
        parent::__construct();
23
        parent::__construct();
24
        $this->setInputFilter(new JobDescriptionFilter($adapter));
24
        $this->setInputFilter(new JobDescriptionFilter($adapter));
Línea -... Línea 25...
-
 
25
        
Línea 25... Línea 26...
25
        
26
        
26
 
27
 
27
        $this->add([
28
        $this->add([
28
            'name' => 'competencies',
29
            'name' => 'competencies',
Línea 72... Línea 73...
72
                'unchecked_value' => \LeadersLinked\Model\JobDescription::STATUS_INACTIVE,
73
                'unchecked_value' => \LeadersLinked\Model\JobDescription::STATUS_INACTIVE,
73
                'checked_value'=> \LeadersLinked\Model\JobDescription::STATUS_ACTIVE,
74
                'checked_value'=> \LeadersLinked\Model\JobDescription::STATUS_ACTIVE,
74
            ]
75
            ]
75
        ]);
76
        ]);
Línea -... Línea 77...
-
 
77
        
-
 
78
        $this->add([
-
 
79
            'name' => 'job_description_id_boss',
-
 
80
            'type' => \Laminas\Form\Element\Select::class,
-
 
81
            'attributes' => [
-
 
82
                'id' 			=> 'job_description_id_boss',
-
 
83
            ],
-
 
84
            'options' => [
-
 
85
                'empty_option' => 'LABEL_JOB_DESCRIPTION_BOSS_OPTION',
-
 
86
                'value_options' => $this->getJobDescriptionIdBoss($adapter, $company_id, $job_description_id),
-
 
87
            ]
-
 
88
        ]);
Línea 76... Línea 89...
76
        
89
        
-
 
90
        
-
 
91
    }
-
 
92
    
-
 
93
    private function getJobDescriptionIdBoss($adapter, $company_id, $job_description_id = 0)
-
 
94
    {
-
 
95
        $jobDescriptionMapper = JobDescriptionMapper::getInstance($adapter);
-
 
96
        if($company_id) {
-
 
97
            $records = $jobDescriptionMapper->fetchAllByCompanyId($company_id);
-
 
98
        } else {
-
 
99
            $records = $jobDescriptionMapper->fetchAllByDefault();
-
 
100
        }
-
 
101
        
-
 
102
        $items = [];
-
 
103
        foreach($records as $record)
-
 
104
        {
-
 
105
            if($job_description_id == $record->id) {
-
 
106
                continue;
-
 
107
            }
-
 
108
            
-
 
109
            $items[ $record->uuid ] = $record->name;
-
 
110
        }
77
        
111
        return $items;
78
    }
112
    }