Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6866 Rev 7300
Línea 149... Línea 149...
149
            $currentUser = $currentUserPlugin->getUser();
149
            $currentUser = $currentUserPlugin->getUser();
Línea 150... Línea 150...
150
            
150
            
151
            $companyUserMapper = CompanyUserMapper::getInstance($this->adapter);
151
            $companyUserMapper = CompanyUserMapper::getInstance($this->adapter);
Línea -... Línea 152...
-
 
152
            $now = $companyUserMapper->getDatebaseNow();
-
 
153
            
-
 
154
            
-
 
155
            $headers  = $request->getHeaders();
-
 
156
            
-
 
157
            $isJson = false;
-
 
158
            if($headers->has('Accept')) {
-
 
159
                $accept = $headers->get('Accept');
-
 
160
                
-
 
161
                $prioritized = $accept->getPrioritized();
-
 
162
                
-
 
163
                foreach($prioritized as $key => $value) {
-
 
164
                    $raw = trim($value->getRaw());
-
 
165
                    
-
 
166
                    if(!$isJson) {
-
 
167
                        $isJson = strpos($raw, 'json');
-
 
168
                    }
-
 
169
                    
-
 
170
                }
-
 
171
            }
-
 
172
            
152
            $now = $companyUserMapper->getDatebaseNow();
173
            
Línea 153... Línea 174...
153
            
174
            
154
            $companyUser = $companyUserMapper->fetchOneByCompanyIdAndUserId($company->id, $currentUser->id);
175
            $companyUser = $companyUserMapper->fetchOneByCompanyIdAndUserId($company->id, $currentUser->id);
Línea 311... Línea 332...
311
            {
332
            {
312
                $user_profiles[$record->uuid] = $record->name;
333
                $user_profiles[$record->uuid] = $record->name;
313
            }
334
            }
Línea 314... Línea -...
314
            
-
 
315
            
-
 
316
            
335
            
Línea 317... Línea -...
317
            
-
 
318
            $timeElapsed = Functions::timeAgo($job->updated_on, $now);
-
 
319
            
-
 
320
            $formApply = new ApplyForm($this->adapter, $currentUser->id);
-
 
321
 
336
            
322
            
-
 
323
            $this->layout()->setTemplate('layout/layout.phtml');
337
            $timeElapsed = Functions::timeAgo($job->updated_on, $now);
324
            $viewModel = new ViewModel();
338
            
325
            $viewModel->setTemplate('leaders-linked/job/view.phtml');
339
            if($isJson) {
326
            $viewModel->setVariables([
340
                return new JsonModel([
327
                'company_uuid'  => $company->uuid,
341
                    'company_uuid'  => $company->uuid,
328
                'company_image'         => $company->image,
342
                    'company_image'         => $company->image,
329
                'job_uuid'              => $job->uuid,
343
                    'job_uuid'              => $job->uuid,
330
                'job_title'             => $job->title,
344
                    'job_title'             => $job->title,
331
                'job_description'       => $job->description,
345
                    'job_description'       => $job->description,
332
                'total_applications'    => $total_applications,
346
                    'total_applications'    => $total_applications,
333
                'location'              => $location->formatted_address,
347
                    'location'              => $location->formatted_address,
334
                'employment_type'       => $employment_type,
348
                    'employment_type'       => $employment_type,
335
                'last_date_of_application'  => $last_date_of_application,
349
                    'last_date_of_application'  => $last_date_of_application,
336
                'job_category'              => $jobCategory->name,
350
                    'job_category'              => $jobCategory->name,
337
                'timeElapsed'               => $timeElapsed,
351
                    'timeElapsed'               => $timeElapsed,
338
                'experience'                => $job->experience_visible ? $job->experience_min . '-' . $job->experience_max : '',
352
                    'experience'                => $job->experience_visible ? $job->experience_min . '-' . $job->experience_max : '',
339
                'salary'                    => $job->salary_visible ? $job->salary_min . '-' . $job->salary_max . ' (' . $job->salary_currency . ')' : '',
353
                    'salary'                    => $job->salary_visible ? $job->salary_min . '-' . $job->salary_max . ' (' . $job->salary_currency . ')' : '',
340
                'job_degrees'               => $job_degrees,
354
                    'job_degrees'               => $job_degrees,
341
                'job_languages'             => $job_languages,
355
                    'job_languages'             => $job_languages,
342
                'job_skills'                => $job_skills,
356
                    'job_skills'                => $job_skills,
343
                'job_visits'                => $job->visits,
357
                    'job_visits'                => $job->visits,
344
                'job_apply_operation'       => $job_apply_operation,
358
                    'job_apply_operation'       => $job_apply_operation,
345
                'job_save_operation'        => $job_save_operation,
359
                    'job_save_operation'        => $job_save_operation,
346
                'company_name'              => $company->name,
360
                    'company_name'              => $company->name,
347
                'company_foundation_year'   => $company->foundation_year,
361
                    'company_foundation_year'   => $company->foundation_year,
348
                'company_website'           => $company->website,
362
                    'company_website'           => $company->website,
-
 
363
                    'company_industry'          => $industry->name,
349
                'company_industry'          => $industry->name,
364
                    'company_size'              => $companySize->minimum_no_of_employee . '-' . $companySize->maximum_no_of_employee,
350
                'company_size'              => $companySize->minimum_no_of_employee . '-' . $companySize->maximum_no_of_employee,
365
                    'company_address'           => $company_address,
-
 
366
                    'user_profiles'             => $user_profiles,
-
 
367
                    'skills'                    => $skills,
-
 
368
                    'languages'                 => $languages,
-
 
369
                    'degrees'                   => $degrees,
351
                'company_address'           => $company_address,
370
                ]);
Línea -... Línea 371...
-
 
371
            } else {
-
 
372
                $formApply = new ApplyForm($this->adapter, $currentUser->id);
-
 
373
    
-
 
374
                
-
 
375
                $this->layout()->setTemplate('layout/layout.phtml');
-
 
376
                $viewModel = new ViewModel();
-
 
377
                $viewModel->setTemplate('leaders-linked/job/view.phtml');
-
 
378
                $viewModel->setVariables([
-
 
379
                    'company_uuid'  => $company->uuid,
-
 
380
                    'company_image'         => $company->image,
-
 
381
                    'job_uuid'              => $job->uuid,
-
 
382
                    'job_title'             => $job->title,
-
 
383
                    'job_description'       => $job->description,
-
 
384
                    'total_applications'    => $total_applications,
-
 
385
                    'location'              => $location->formatted_address,
-
 
386
                    'employment_type'       => $employment_type,
-
 
387
                    'last_date_of_application'  => $last_date_of_application,
-
 
388
                    'job_category'              => $jobCategory->name,
-
 
389
                    'timeElapsed'               => $timeElapsed,
-
 
390
                    'experience'                => $job->experience_visible ? $job->experience_min . '-' . $job->experience_max : '',
-
 
391
                    'salary'                    => $job->salary_visible ? $job->salary_min . '-' . $job->salary_max . ' (' . $job->salary_currency . ')' : '',
-
 
392
                    'job_degrees'               => $job_degrees,
-
 
393
                    'job_languages'             => $job_languages,
-
 
394
                    'job_skills'                => $job_skills,
-
 
395
                    'job_visits'                => $job->visits,
-
 
396
                    'job_apply_operation'       => $job_apply_operation,
-
 
397
                    'job_save_operation'        => $job_save_operation,
-
 
398
                    'company_name'              => $company->name,
-
 
399
                    'company_foundation_year'   => $company->foundation_year,
-
 
400
                    'company_website'           => $company->website,
-
 
401
                    'company_industry'          => $industry->name,
-
 
402
                    'company_size'              => $companySize->minimum_no_of_employee . '-' . $companySize->maximum_no_of_employee,
-
 
403
                    'company_address'           => $company_address,
-
 
404
                    'formApply'                 => $formApply,
352
                'formApply'                 => $formApply,
405
                    'user_profiles'             => $user_profiles
353
                'user_profiles'             => $user_profiles
406
    
Línea 354... Línea 407...
354
 
407
                    
355
                
408
                ]);
356
            ]);
409
            }