Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 4300 Rev 4398
Línea 22... Línea 22...
22
use LeadersLinked\Mapper\PerformanceEvaluationFormMapper;
22
use LeadersLinked\Mapper\PerformanceEvaluationFormMapper;
23
use LeadersLinked\Model\PerformanceEvaluationEvaluation;
23
use LeadersLinked\Model\PerformanceEvaluationEvaluation;
24
use LeadersLinked\Mapper\JobDescriptionMapper;
24
use LeadersLinked\Mapper\JobDescriptionMapper;
25
use LeadersLinked\Mapper\CompanyUserMapper;
25
use LeadersLinked\Mapper\CompanyUserMapper;
26
use LeadersLinked\Model\CompanyUser;
26
use LeadersLinked\Model\CompanyUser;
-
 
27
use LeadersLinked\Mapper\CompanyMapper;
Línea 27... Línea 28...
27
 
28
 
28
 
29
 
29
class CalendarController extends AbstractActionController
30
class CalendarController extends AbstractActionController
Línea 142... Línea 143...
142
            //3 días
143
            //3 días
143
            $expirePeriod = 86400 * 3; 
144
            $expirePeriod = 86400 * 3; 
144
            $t1 = time();
145
            $t1 = time();
Línea -... Línea 146...
-
 
146
            
-
 
147
            
-
 
148
            $companies = [];
145
            
149
            $companyMapper = CompanyMapper::getInstance($this->adapter);
146
            
150
            
147
            $companyUser = [];
151
            $companyUsers = [];
Línea 148... Línea 152...
148
            $companyUserMapper = CompanyUserMapper::getInstance($this->adapter);
152
            $companyUserMapper = CompanyUserMapper::getInstance($this->adapter);
149
            $records = $companyUserMapper->fetchAllByUserId($currentUser->id);
153
            $records = $companyUserMapper->fetchAllByUserId($currentUser->id);
150
            
154
            
Línea -... Línea 155...
-
 
155
            foreach($records as $record) {
Línea 151... Línea 156...
151
            foreach($records as $record) {
156
                $companyUsers[$record->company_id] = $record->backend == CompanyUser::BACKEND_YES;
152
                $companyUsers[$record->company_id] = $record->backend == CompanyUser::BACKEND_YES;
157
             }
153
             }
158
            
154
            
159
            
Línea 174... Línea 179...
174
                        
179
                        
175
                        $performanceEvaluationEvaluation = $performanceEvaluationEvaluationMapper->fetchOne($record->relational_id);
180
                        $performanceEvaluationEvaluation = $performanceEvaluationEvaluationMapper->fetchOne($record->relational_id);
Línea 176... Línea 181...
176
                        if($performanceEvaluationEvaluation) {
181
                        if($performanceEvaluationEvaluation) {
177
                            
182
                            
178
                            $performanceEvaluationForm = $performanceEvaluationFormMapper->fetchOne($performanceEvaluationEvaluation->form_id);
-
 
179
                            if(!$performanceEvaluationForm) {
-
 
180
                                continue;
-
 
181
                            }
183
                            $performanceEvaluationForm = $performanceEvaluationFormMapper->fetchOne($performanceEvaluationEvaluation->form_id);
182
                            
184
                            if($performanceEvaluationForm) {
183
                            $jobDescription = $jobDescriptionMapper->fetchOne($performanceEvaluationForm->job_description_id);
-
 
184
                            if(!$jobDescription) {
-
 
185
                                continue;
-
 
Línea 186... Línea -...
186
                            }
-
 
187
                            
-
 
188
                            
-
 
189
                            if($performanceEvaluationEvaluation->supervisor_id) {
-
 
190
                                $supervisor = $userMapper->fetchOne($performanceEvaluationEvaluation->supervisor_id);
-
 
191
                            } else {
-
 
192
                                $supervisor = '';
-
 
193
                            }
-
 
194
                            
-
 
195
                            if($performanceEvaluationEvaluation->employee_id) {
-
 
196
                                $employee = $userMapper->fetchOne($performanceEvaluationEvaluation->employee_id);
-
 
197
                            } else {
-
 
198
                                $employee = '';
-
 
199
                            }
-
 
200
                             
-
 
Línea 201... Línea 185...
201
 
185
                                $jobDescription = $jobDescriptionMapper->fetchOne($performanceEvaluationForm->job_description_id);
202
                            $agenda = " LABEL_PERFORMANCE_EVALUATION_FORM_NAME : " . $performanceEvaluationForm->name . "<br>";
-
 
203
                            $agenda .= " LABEL_PERFORMANCE_EVALUATION_JOB_DESCRIPTION : " . $jobDescription->name . "<br>";
186
                                if($jobDescription) {
204
                            
-
 
205
                            switch($performanceEvaluationEvaluation->type)
187
                            
206
                            {
-
 
207
                                case PerformanceEvaluationEvaluation::TYPE_BOTH :
-
 
208
                                    $agenda .= " LABEL_PERFORMANCE_EVALUATION_TYPE : LABEL_PERFORMANCE_EVALUATION_TYPE_BOTH <br>";
-
 
209
                                    break;
188
                            
210
                                    
-
 
211
                                case PerformanceEvaluationEvaluation::TYPE_SUPERVISOR :
-
 
212
                                    $agenda .= " LABEL_PERFORMANCE_EVALUATION_TYPE : LABEL_PERFORMANCE_EVALUATION_TYPE_SUPERVISOR <br>";
-
 
213
                                    break;
189
                                    if($performanceEvaluationEvaluation->supervisor_id) {
Línea -... Línea 190...
-
 
190
                                        $supervisor = $userMapper->fetchOne($performanceEvaluationEvaluation->supervisor_id);
-
 
191
                                    } else {
-
 
192
                                        $supervisor = '';
-
 
193
                                    }
-
 
194
                                    
Línea -... Línea 195...
-
 
195
                                    if($performanceEvaluationEvaluation->employee_id) {
-
 
196
                                        $employee = $userMapper->fetchOne($performanceEvaluationEvaluation->employee_id);
-
 
197
                                    } else {
-
 
198
                                        $employee = '';
-
 
199
                                    }
-
 
200
                                    
-
 
201
                                    
-
 
202
                                    $hasLink = false;
-
 
203
                                    if(isset($companyUsers[$currentUser->id])) {
-
 
204
                                        if($companyUsers[$currentUser->id]) {
-
 
205
                                            $hasLink = true;
-
 
206
                                        }
-
 
207
                                    }
-
 
208
                                     
-
 
209
                                    if($hasLink) {
-
 
210
                                        
-
 
211
                                        if(!isset($companies[$performanceEvaluationEvaluation->company_id])) {
-
 
212
                                            $company  = $companyMapper->fetchOne($performanceEvaluationEvaluation->company_id);
-
 
213
                                            
-
 
214
                                            $companies[ $company->id ]  = $company; 
-
 
215
                                        } else {
-
 
216
                                            $company = $companies[ $performanceEvaluationEvaluation->company_id ];
-
 
217
                                        }
-
 
218
                                            
-
 
219
                                        
-
 
220
                                        $href = $this->url()->fromRoute('backend/signin-company', [
-
 
221
                                            'id' => $company->uuid, 
-
 
222
                                            'relational' => $performanceEvaluationEvaluation->uuid, 
-
 
223
                                            'type' => CalendarEvent::TYPE_PERFORMANCE_EVALUATION
-
 
224
                                        ]);
-
 
225
                                        
-
 
226
                                        
-
 
227
                                        $agenda = '<a href="'.$href.'" class="goto-backend"><br>'; 
-
 
228
                                    }
-
 
229
                                        
-
 
230
                                    $agenda .= " LABEL_PERFORMANCE_EVALUATION_FORM_NAME : " . $performanceEvaluationForm->name . "<br>";
-
 
231
                                    $agenda .= " LABEL_PERFORMANCE_EVALUATION_JOB_DESCRIPTION : " . $jobDescription->name . "<br>";
-
 
232
                                    
-
 
233
                                    switch($performanceEvaluationEvaluation->type)
-
 
234
                                    {
-
 
235
                                        case PerformanceEvaluationEvaluation::TYPE_BOTH :
-
 
236
                                            $agenda .= " LABEL_PERFORMANCE_EVALUATION_TYPE : LABEL_PERFORMANCE_EVALUATION_TYPE_BOTH <br>";
-
 
237
                                            break;
-
 
238
                                            
-
 
239
                                        case PerformanceEvaluationEvaluation::TYPE_SUPERVISOR :
-
 
240
                                            $agenda .= " LABEL_PERFORMANCE_EVALUATION_TYPE : LABEL_PERFORMANCE_EVALUATION_TYPE_SUPERVISOR <br>";
-
 
241
                                            break;
-
 
242
                                            
-
 
243
                                        case PerformanceEvaluationEvaluation::TYPE_EMPLOYEE :
-
 
244
                                            $agenda .= " LABEL_PERFORMANCE_EVALUATION_TYPE : LABEL_PERFORMANCE_EVALUATION_TYPE_EMPLOYEE <br>";
-
 
245
                                            break;
-
 
246
                                            
-
 
247
                                            
-
 
248
                                    }
-
 
249
                                    
-
 
250
                                    if($supervisor) {
-
 
251
                                        $agenda .= " LABEL_PERFORMANCE_EVALUATION_SUPERVISOR : " . trim($supervisor->first_name . ' ' . $supervisor->last_name) . " <br>";
-
 
252
                                        
-
 
253
                                    }
-
 
254
                                    if($employee) {
-
 
255
                                        $agenda .= " LABEL_PERFORMANCE_EVALUATION_EMPLOYEE : " . trim($employee->first_name . ' ' . $employee->last_name) . " <br>";
-
 
256
                                        
-
 
257
                                    }
-
 
258
                                    
-
 
259
                                    $dtStart = \DateTime::createFromFormat('Y-m-d', $performanceEvaluationEvaluation->last_date);
-
 
260
                                    $agenda .= " LABEL_PERFORMANCE_EVALUATION_LAST_DATE : " . $dtStart->format('Y-m-d') . "<br>" ;
-
 
261
                                    
-
 
262
                                    if($hasLink) {
-
 
263
                                        $agenda .= "</a><br>";
-
 
264
                                    }
-
 
265
                                    
-
 
266
                                    
-
 
267
                                    array_push($events, [
-
 
268
                                        'id'                => $performanceEvaluationEvaluation->uuid,
-
 
269
                                        'title'             =>  $performanceEvaluationForm->name,
-
 
270
                                        'agenda'            => $agenda,
214
                                    
271
                                        'start'             => $start,
Línea 215... Línea -...
215
                                case PerformanceEvaluationEvaluation::TYPE_EMPLOYEE :
-
 
216
                                    $agenda .= " LABEL_PERFORMANCE_EVALUATION_TYPE : LABEL_PERFORMANCE_EVALUATION_TYPE_EMPLOYEE <br>";
-
 
217
                                    break;
-
 
218
                                    
-
 
219
                                    
-
 
220
                            }
-
 
221
                            
-
 
222
                            if($supervisor) {
-
 
223
                                $agenda .= " LABEL_PERFORMANCE_EVALUATION_SUPERVISOR : " . trim($supervisor->first_name . ' ' . $supervisor->last_name) . " <br>";
-
 
224
                                
-
 
225
                            }
-
 
226
                            if($employee) {
-
 
227
                                $agenda .= " LABEL_PERFORMANCE_EVALUATION_EMPLOYEE : " . trim($employee->first_name . ' ' . $employee->last_name) . " <br>";
-
 
228
                                
-
 
229
                            }
-
 
230
                            
-
 
231
                            $dtStart = \DateTime::createFromFormat('Y-m-d', $performanceEvaluationEvaluation->last_date);
-
 
232
                            $agenda .= " LABEL_PERFORMANCE_EVALUATION_LAST_DATE : " . $dtStart->format('Y-m-d') . "<br>" ;
-
 
233
                            
-
 
234
                            array_push($events, [
-
 
235
                                'id'                => $performanceEvaluationEvaluation->uuid,
-
 
236
                                'title'             =>  $performanceEvaluationForm->name,
-
 
237
                                'agenda'            => $agenda,
-
 
238
                                'start'             => $start,
-
 
239
                                'url'               => '',
272
                                        'url'               => '',