Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 3648 Rev 3912
Línea 37... Línea 37...
37
use Laminas\Paginator\Paginator;
37
use Laminas\Paginator\Paginator;
38
use LeadersLinked\Model\User;
38
use LeadersLinked\Model\User;
39
use Laminas\Db\Sql\Expression;
39
use Laminas\Db\Sql\Expression;
40
use LeadersLinked\Mapper\LanguageMapper;
40
use LeadersLinked\Mapper\LanguageMapper;
41
use LeadersLinked\Mapper\SkillMapper;
41
use LeadersLinked\Mapper\SkillMapper;
-
 
42
use LeadersLinked\Mapper\AptitudeMapper;
-
 
43
use LeadersLinked\Mapper\UserAptitudeMapper;
-
 
44
use LeadersLinked\Mapper\HobbyAndInterestMapper;
-
 
45
use LeadersLinked\Mapper\UserHobbyAndInterestMapper;
Línea 42... Línea 46...
42
 
46
 
43
 
47
 
44
class ProfileController extends AbstractActionController
48
class ProfileController extends AbstractActionController
Línea 275... Línea 279...
275
                    'to_month' => $userExperience->to_month,
279
                    'to_month' => $userExperience->to_month,
276
                    'description' => $userExperience->description,
280
                    'description' => $userExperience->description,
277
                    'is_current' => $userExperience->is_current,
281
                    'is_current' => $userExperience->is_current,
278
                ];
282
                ];
279
            }
283
            }
280
                
284
             
-
 
285
            $userAptitudes = [];
-
 
286
            $aptitudeMapper = AptitudeMapper::getInstance($this->adapter);
-
 
287
            $userAptitudeMapper = UserAptitudeMapper::getInstance($this->adapter);
-
 
288
            $records  = $userAptitudeMapper->fetchAllByUserProfileId($userProfile->id);
-
 
289
            foreach($records as $record)
-
 
290
            {
-
 
291
                $aptitude = $aptitudeMapper->fetchOne($record->skill_id);
-
 
292
                if($aptitude) {
-
 
293
                    $userAptitudes[$aptitude->uuid] = $aptitude->name;
-
 
294
                }
-
 
295
            }
-
 
296
            
-
 
297
            $userHobbiesAndInterests = [];
-
 
298
            $hobbyAndInterestMapper = HobbyAndInterestMapper::getInstance($this->adapter);
-
 
299
            $userHobbyAndInterestMapper = UserHobbyAndInterestMapper::getInstance($this->adapter);
-
 
300
            $records  = $userHobbyAndInterestMapper->fetchAllByUserProfileId($userProfile->id);
-
 
301
            foreach($records as $record)
-
 
302
            {
-
 
303
                $hobbyAndInterest = $hobbyAndInterestMapper->fetchOne($record->skill_id);
-
 
304
                if($hobbyAndInterest) {
-
 
305
                    $userHobbiesAndInterests[$hobbyAndInterest->uuid] = $hobbyAndInterest->name;
-
 
306
                }
-
 
307
            }
-
 
308
            
-
 
309
            
281
            $userSkills = [];
310
            $userSkills = [];
282
            $skillMapper = SkillMapper::getInstance($this->adapter);
311
            $skillMapper = SkillMapper::getInstance($this->adapter);
283
            $userSkillMapper = UserSkillMapper::getInstance($this->adapter);
312
            $userSkillMapper = UserSkillMapper::getInstance($this->adapter);
284
            $records  = $userSkillMapper->fetchAllByUserProfileId($userProfile->id);
313
            $records  = $userSkillMapper->fetchAllByUserProfileId($userProfile->id);
285
            foreach($records as $record)
314
            foreach($records as $record)
286
            {
315
            {
287
                $skill = $skillMapper->fetchOne($record->skill_id);
316
                $skill = $skillMapper->fetchOne($record->skill_id);
-
 
317
                if($skill) {
288
                $userSkills[$skill->uuid] = $skill->name;
318
                    $userSkills[$skill->uuid] = $skill->name;
-
 
319
                }
289
            }
320
            }
Línea -... Línea 321...
-
 
321
            
-
 
322
            
290
            
323
            
291
            
324
            
Línea 292... Línea 325...
292
            $companyFollowerMapper = CompanyFollowerMapper::getInstance($this->adapter);
325
            $companyFollowerMapper = CompanyFollowerMapper::getInstance($this->adapter);
293
            $following = $companyFollowerMapper->getCountFollowing($user->id);
326
            $following = $companyFollowerMapper->getCountFollowing($user->id);
Línea 331... Línea 364...
331
            
364
            
Línea 332... Línea 365...
332
            
365
            
333
            if($isJson) {
366
            if($isJson) {
334
            
367
            
335
                $data = [
368
                $data = [
336
                    'following'         => $following ,
369
                    'following'                     => $following ,
337
                    'total_connections' => $total_connections,
370
                    'total_connections'             => $total_connections,
338
                    'user_id'           => $user->uuid,
371
                    'user_id'                       => $user->uuid,
339
                    'user_uuid'         => ($user->uuid),
372
                    'user_uuid'                     => ($user->uuid),
340
                    'full_name'         => trim($user->first_name . ' ' . $user->last_name),
373
                    'full_name'                     => trim($user->first_name . ' ' . $user->last_name),
341
                    'user_profile_id'   => $userProfile->id,
374
                    'user_profile_id'               => $userProfile->id,
342
                    'user_profile_uuid' => $userProfile->uuid,
375
                    'user_profile_uuid'             => $userProfile->uuid,
343
                    'image'             => $this->url()->fromRoute('storage',['code' => $user->uuid, 'type' => 'user-profile', 'filename' => $user->image]),
376
                    'image'                         => $this->url()->fromRoute('storage',['code' => $user->uuid, 'type' => 'user-profile', 'filename' => $user->image]),
344
                    'cover'             => $this->url()->fromRoute('storage',['code' => $user->uuid, 'type' => 'user-cover', 'filename' => $userProfile->cover]),
377
                    'cover'                         => $this->url()->fromRoute('storage',['code' => $user->uuid, 'type' => 'user-cover', 'filename' => $userProfile->cover]),
345
                    'overview'          => $userProfile->description,
378
                    'overview'                      => $userProfile->description,
346
                    'facebook'          => $userProfile->facebook,
379
                    'facebook'                      => $userProfile->facebook,
347
                    'instagram'         => $userProfile->instagram,
380
                    'instagram'                     => $userProfile->instagram,
348
                    'twitter'           => $userProfile->twitter,
381
                    'twitter'                       => $userProfile->twitter,
349
                    'formatted_address' => $formattedAddress,
382
                    'formatted_address'             => $formattedAddress,
350
                    'country'           => $country,
383
                    'country'                       => $country,
351
                    'user_skills'       => $userSkills,
384
                    'user_skills'                   => $userSkills,
-
 
385
                    'user_languages'                => $userLanguages,
-
 
386
                    'user_educations'               => $userEducations,
352
                    'user_languages'    => $userLanguages,
387
                    'user_experiences'              => $userExperiences,
353
                    'user_educations'   => $userEducations,
388
                    'user_aptitudes'                => $userAptitudes,
354
                    'user_experiences'  => $userExperiences,
389
                    'user_hobbies_and_interests'    => $userHobbiesAndInterests,
355
                    'common_connection' => $common_connection,
390
                    'common_connection'             => $common_connection,
356
                    'views'             => $views,
391
                    'views'                         => $views,
357
                    'show_contact'          => $user->id != $currentUser->id,
392
                    'show_contact'                  => $user->id != $currentUser->id,
358
                    'request_connection'    => $request_connection,
393
                    'request_connection'            => $request_connection,
Línea 359... Línea 394...
359
                    'link_cancel'           => $connection && $connection->status == Connection::STATUS_SENT ? $this->url()->fromRoute('connection/delete',['id' => $user->uuid ]) :  $this->url()->fromRoute('connection/cancel',['id' => $user->uuid]),
394
                    'link_cancel'                   => $connection && $connection->status == Connection::STATUS_SENT ? $this->url()->fromRoute('connection/delete',['id' => $user->uuid ]) :  $this->url()->fromRoute('connection/cancel',['id' => $user->uuid]),
Línea 360... Línea 395...
360
                    'link_request'          => $request_connection ? $this->url()->fromRoute('connection/request',['id' => $user->uuid ]) : '',
395
                    'link_request'                  => $request_connection ? $this->url()->fromRoute('connection/request',['id' => $user->uuid ]) : '',
Línea 369... Línea 404...
369
            
404
            
370
                $this->layout()->setTemplate('layout/layout.phtml');
405
                $this->layout()->setTemplate('layout/layout.phtml');
371
                $viewModel = new ViewModel();
406
                $viewModel = new ViewModel();
372
                $viewModel->setTemplate('leaders-linked/profile/view.phtml');
407
                $viewModel->setTemplate('leaders-linked/profile/view.phtml');
373
                $viewModel->setVariables([
408
                $viewModel->setVariables([
374
                    'following'         => $following ,
409
                    'following'                     => $following ,
375
                    'total_connections' => $total_connections,
410
                    'total_connections'             => $total_connections,
376
                    'user_id'           => $user->uuid,
411
                    'user_id'                       => $user->uuid,
377
                    'user_uuid' => ($user->uuid),
412
                    'user_uuid'                     => ($user->uuid),
378
                    'full_name'         => trim($user->first_name . ' ' . $user->last_name),
413
                    'full_name'                     => trim($user->first_name . ' ' . $user->last_name),
379
                    'user_profile_id'   => $userProfile->id,
414
                    'user_profile_id'               => $userProfile->id,
380
                    'user_profile_uuid' => $userProfile->uuid,
415
                    'user_profile_uuid'             => $userProfile->uuid,
381
                    'image'             => $userProfile->image,
416
                    'image'                         => $userProfile->image,
382
                    'cover'             => $userProfile->cover,
417
                    'cover'                         => $userProfile->cover,
383
                    'overview'          => $userProfile->description,
418
                    'overview'                      => $userProfile->description,
384
                    'facebook'          => $userProfile->facebook,
419
                    'facebook'                      => $userProfile->facebook,
385
                    'instagram'         => $userProfile->instagram,
420
                    'instagram'                     => $userProfile->instagram,
386
                    'twitter'           => $userProfile->twitter,
421
                    'twitter'                       => $userProfile->twitter,
387
                    'formatted_address' => $formattedAddress,
422
                    'formatted_address'             => $formattedAddress,
388
                    'country'           => $country,
423
                    'country'                       => $country,
389
                    'user_skills'       => $userSkills,
424
                    'user_skills'                   => $userSkills,
390
                    'user_languages'    => $userLanguages,
425
                    'user_languages'                => $userLanguages,
391
                    'user_educations'   => $userEducations,
426
                    'user_educations'               => $userEducations,
-
 
427
                    'user_experiences'              => $userExperiences,
-
 
428
                    'user_aptitudes'                => $userAptitudes,
392
                    'user_experiences'  => $userExperiences,
429
                    'user_hobbies_and_interests'    => $userHobbiesAndInterests,
393
                    'show_contact'          => $user->id != $currentUser->id,
430
                    'show_contact'                  => $user->id != $currentUser->id,
394
                    'request_connection'    => $request_connection, 
431
                    'request_connection'            => $request_connection, 
395
                    'link_cancel'           => $connection && $connection->status == Connection::STATUS_SENT ? $this->url()->fromRoute('connection/delete',['id' => $user->uuid ]) :  $this->url()->fromRoute('connection/cancel',['id' => $user->uuid]),
432
                    'link_cancel'                   => $connection && $connection->status == Connection::STATUS_SENT ? $this->url()->fromRoute('connection/delete',['id' => $user->uuid ]) :  $this->url()->fromRoute('connection/cancel',['id' => $user->uuid]),
396
                    'link_request'          => $request_connection ? $this->url()->fromRoute('connection/request',['id' => $user->uuid ]) : '',
433
                    'link_request'                  => $request_connection ? $this->url()->fromRoute('connection/request',['id' => $user->uuid ]) : '',
Línea 397... Línea 434...
397
                    'link_inmail'           => $this->url()->fromRoute('inmail',['id' => $user->uuid ]),
434
                    'link_inmail'                   => $this->url()->fromRoute('inmail',['id' => $user->uuid ]),
398
                    
435
                    
399
                ]);
436
                ]);
400
                return $viewModel ;
437
                return $viewModel ;