| Línea 28... |
Línea 28... |
| 28 |
use LeadersLinked\Mapper\IndustryMapper;
|
28 |
use LeadersLinked\Mapper\IndustryMapper;
|
| 29 |
use LeadersLinked\Mapper\CompanySizeMapper;
|
29 |
use LeadersLinked\Mapper\CompanySizeMapper;
|
| 30 |
use LeadersLinked\Mapper\ConnectionMapper;
|
30 |
use LeadersLinked\Mapper\ConnectionMapper;
|
| 31 |
use LeadersLinked\Mapper\UserBlockedMapper;
|
31 |
use LeadersLinked\Mapper\UserBlockedMapper;
|
| 32 |
use LeadersLinked\Model\Connection;
|
32 |
use LeadersLinked\Model\Connection;
|
| - |
|
33 |
use LeadersLinked\Model\Network;
|
| 33 |
use LeadersLinked\Mapper\ProfileVisitMapper;
|
34 |
use LeadersLinked\Mapper\ProfileVisitMapper;
|
| 34 |
use LeadersLinked\Model\ProfileVisit;
|
35 |
use LeadersLinked\Model\ProfileVisit;
|
| 35 |
use LeadersLinked\Mapper\QueryMapper;
|
36 |
use LeadersLinked\Mapper\QueryMapper;
|
| 36 |
use Laminas\Paginator\Adapter\DbSelect;
|
37 |
use Laminas\Paginator\Adapter\DbSelect;
|
| 37 |
use Laminas\Paginator\Paginator;
|
38 |
use Laminas\Paginator\Paginator;
|
| Línea 113... |
Línea 114... |
| 113 |
{
|
114 |
{
|
| Línea 114... |
Línea 115... |
| 114 |
|
115 |
|
| 115 |
$currentUserPlugin = $this->plugin('currentUserPlugin');
|
116 |
$currentUserPlugin = $this->plugin('currentUserPlugin');
|
| Línea -... |
Línea 117... |
| - |
|
117 |
$currentUser = $currentUserPlugin->getUser();
|
| - |
|
118 |
|
| - |
|
119 |
$currentNetworkPlugin = $this->plugin('currentNetworkPlugin');
|
| - |
|
120 |
$currentNetwork= $currentNetworkPlugin->getNetwork();
|
| 116 |
$currentUser = $currentUserPlugin->getUser();
|
121 |
|
| 117 |
|
122 |
|
| Línea 118... |
Línea 123... |
| 118 |
$request = $this->getRequest();
|
123 |
$request = $this->getRequest();
|
| Línea 318... |
Línea 323... |
| 318 |
$userSkills[$skill->uuid] = $skill->name;
|
323 |
$userSkills[$skill->uuid] = $skill->name;
|
| 319 |
}
|
324 |
}
|
| 320 |
}
|
325 |
}
|
| Línea -... |
Línea 326... |
| - |
|
326 |
|
| - |
|
327 |
|
| Línea -... |
Línea 328... |
| - |
|
328 |
|
| Línea 321... |
Línea -... |
| 321 |
|
- |
|
| 322 |
|
- |
|
| 323 |
|
- |
|
| 324 |
|
329 |
|
| 325 |
$companyFollowerMapper = CompanyFollowerMapper::getInstance($this->adapter);
|
330 |
|
| 326 |
$following = $companyFollowerMapper->getCountFollowing($user->id);
|
331 |
if($currentNetwork->relationship_user_mode == Network::RELATIONSHIP_USER_MODE_USER_2_USER) {
|
| 327 |
|
332 |
|
| 328 |
$connectionMapper = ConnectionMapper::getInstance($this->adapter);
|
333 |
$connectionMapper = ConnectionMapper::getInstance($this->adapter);
|
| 329 |
$total_connections = $connectionMapper->fetchTotalConnectionByUser($user->id);
|
334 |
$total_connections = $connectionMapper->fetchTotalConnectionByUser($user->id);
|
| - |
|
335 |
|
| - |
|
336 |
$request_connection = 0;
|
| - |
|
337 |
if($connection) {
|
| 330 |
|
338 |
if($connection->status == Connection::STATUS_REJECTED || $connection->status == Connection::STATUS_CANCELLED) {
|
| 331 |
$request_connection = 0;
|
339 |
$request_connection = 1;
|
| 332 |
if($connection) {
|
- |
|
| - |
|
340 |
}
|
| - |
|
341 |
} else {
|
| - |
|
342 |
$request_connection = 1;
|
| 333 |
if($connection->status == Connection::STATUS_REJECTED || $connection->status == Connection::STATUS_CANCELLED) {
|
343 |
}
|
| 334 |
$request_connection = 1;
|
344 |
|
| Línea 335... |
Línea -... |
| 335 |
}
|
- |
|
| 336 |
} else {
|
- |
|
| 337 |
$request_connection = 1;
|
345 |
|
| 338 |
}
|
346 |
|
| Línea 364... |
Línea 372... |
| 364 |
|
372 |
|
| Línea 365... |
Línea 373... |
| 365 |
|
373 |
|
| 366 |
if($isJson) {
|
- |
|
| 367 |
|
- |
|
| 368 |
$data = [
|
374 |
if($isJson) {
|
| 369 |
'following' => $following ,
|
375 |
|
| 370 |
'total_connections' => $total_connections,
|
376 |
$data = [
|
| 371 |
'user_id' => $user->uuid,
|
377 |
'user_id' => $user->uuid,
|
| 372 |
'user_uuid' => ($user->uuid),
|
378 |
'user_uuid' => ($user->uuid),
|
| Línea 385... |
Línea 391... |
| 385 |
'user_languages' => $userLanguages,
|
391 |
'user_languages' => $userLanguages,
|
| 386 |
'user_educations' => $userEducations,
|
392 |
'user_educations' => $userEducations,
|
| 387 |
'user_experiences' => $userExperiences,
|
393 |
'user_experiences' => $userExperiences,
|
| 388 |
'user_aptitudes' => $userAptitudes,
|
394 |
'user_aptitudes' => $userAptitudes,
|
| 389 |
'user_hobbies_and_interests' => $userHobbiesAndInterests,
|
395 |
'user_hobbies_and_interests' => $userHobbiesAndInterests,
|
| 390 |
'common_connection' => $common_connection,
|
- |
|
| 391 |
'views' => $views,
|
396 |
'views' => $views,
|
| 392 |
'show_contact' => $user->id != $currentUser->id,
|
397 |
'show_contact' => $user->id != $currentUser->id,
|
| 393 |
'request_connection' => $request_connection,
|
- |
|
| 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]),
|
- |
|
| 395 |
'link_request' => $request_connection ? $this->url()->fromRoute('connection/request',['id' => $user->uuid ]) : '',
|
- |
|
| 396 |
'link_inmail' => $this->url()->fromRoute('inmail',['id' => $user->uuid ]),
|
398 |
'link_inmail' => $this->url()->fromRoute('inmail',['id' => $user->uuid ]),
|
| 397 |
|
- |
|
| 398 |
];
|
399 |
];
|
| Línea -... |
Línea 400... |
| - |
|
400 |
|
| - |
|
401 |
|
| - |
|
402 |
if($currentNetwork->default == Network::DEFAULT_YES) {
|
| - |
|
403 |
|
| - |
|
404 |
$companyFollowerMapper = CompanyFollowerMapper::getInstance($this->adapter);
|
| - |
|
405 |
$data['following'] = $companyFollowerMapper->getCountFollowing($user->id);
|
| - |
|
406 |
$data['view_following'] = 1;
|
| - |
|
407 |
} else {
|
| - |
|
408 |
$data['following'] = 0;
|
| - |
|
409 |
$data['view_following'] = 0;
|
| - |
|
410 |
}
|
| - |
|
411 |
|
| - |
|
412 |
|
| - |
|
413 |
if($currentNetwork->relationship_user_mode == Network::RELATIONSHIP_USER_MODE_USER_2_USER) {
|
| - |
|
414 |
$data['total_connections'] = $total_connections;
|
| - |
|
415 |
$data['view_total_connections'] = 1;
|
| - |
|
416 |
$data['request_connection'] = $request_connection;
|
| - |
|
417 |
$data['common_connection'] = $common_connection;
|
| - |
|
418 |
$data['link_cancel'] = $connection && $connection->status == Connection::STATUS_SENT ? $this->url()->fromRoute('connection/delete',['id' => $user->uuid ]) : $this->url()->fromRoute('connection/cancel',['id' => $user->uuid]);
|
| - |
|
419 |
$data['link_request'] = $request_connection ? $this->url()->fromRoute('connection/request',['id' => $user->uuid ]) : '';
|
| - |
|
420 |
} else {
|
| - |
|
421 |
$data['total_connections'] = 0;
|
| - |
|
422 |
$data['view_total_connections'] = 0;
|
| - |
|
423 |
$data['request_connection'] = 0;
|
| - |
|
424 |
$data['common_connection'] = 0;
|
| - |
|
425 |
$data['link_cancel'] = '';
|
| - |
|
426 |
$data['link_request'] = '';
|
| - |
|
427 |
}
|
| 399 |
|
428 |
|
| Línea 400... |
Línea 429... |
| 400 |
return new JsonModel($data);
|
429 |
return new JsonModel($data);
|
| Línea -... |
Línea 430... |
| - |
|
430 |
|
| - |
|
431 |
} else {
|
| - |
|
432 |
|
| - |
|
433 |
if($currentNetwork->relationship_user_mode == Network::RELATIONSHIP_USER_MODE_USER_2_USER) {
|
| - |
|
434 |
$data = [
|
| - |
|
435 |
'total_connections' => $total_connections,
|
| - |
|
436 |
'view_total_connections' => 1,
|
| - |
|
437 |
'user_id' => $user->uuid,
|
| - |
|
438 |
'user_uuid' => ($user->uuid),
|
| - |
|
439 |
'full_name' => trim($user->first_name . ' ' . $user->last_name),
|
| - |
|
440 |
'user_profile_id' => $userProfile->id,
|
| - |
|
441 |
'user_profile_uuid' => $userProfile->uuid,
|
| - |
|
442 |
'image' => $userProfile->image,
|
| - |
|
443 |
'cover' => $userProfile->cover,
|
| - |
|
444 |
'overview' => $userProfile->description,
|
| - |
|
445 |
'facebook' => $userProfile->facebook,
|
| - |
|
446 |
'instagram' => $userProfile->instagram,
|
| - |
|
447 |
'twitter' => $userProfile->twitter,
|
| - |
|
448 |
'formatted_address' => $formattedAddress,
|
| - |
|
449 |
'country' => $country,
|
| - |
|
450 |
'user_skills' => $userSkills,
|
| - |
|
451 |
'user_languages' => $userLanguages,
|
| - |
|
452 |
'user_educations' => $userEducations,
|
| - |
|
453 |
'user_experiences' => $userExperiences,
|
| - |
|
454 |
'user_aptitudes' => $userAptitudes,
|
| - |
|
455 |
'user_hobbies_and_interests' => $userHobbiesAndInterests,
|
| - |
|
456 |
'show_contact' => $user->id != $currentUser->id,
|
| - |
|
457 |
'request_connection' => $request_connection,
|
| - |
|
458 |
'link_cancel' => $connection && $connection->status == Connection::STATUS_SENT ? $this->url()->fromRoute('connection/delete',['id' => $user->uuid ]) : $this->url()->fromRoute('connection/cancel',['id' => $user->uuid]),
|
| - |
|
459 |
'link_request' => $request_connection ? $this->url()->fromRoute('connection/request',['id' => $user->uuid ]) : '',
|
| - |
|
460 |
'link_inmail' => $this->url()->fromRoute('inmail',['id' => $user->uuid ]),
|
| - |
|
461 |
];
|
| - |
|
462 |
} else {
|
| - |
|
463 |
$data = [
|
| - |
|
464 |
'total_connections' => 0,
|
| - |
|
465 |
'view_total_connections' => 0,
|
| - |
|
466 |
'user_id' => $user->uuid,
|
| - |
|
467 |
'user_uuid' => ($user->uuid),
|
| - |
|
468 |
'full_name' => trim($user->first_name . ' ' . $user->last_name),
|
| - |
|
469 |
'user_profile_id' => $userProfile->id,
|
| - |
|
470 |
'user_profile_uuid' => $userProfile->uuid,
|
| - |
|
471 |
'image' => $userProfile->image,
|
| - |
|
472 |
'cover' => $userProfile->cover,
|
| - |
|
473 |
'overview' => $userProfile->description,
|
| - |
|
474 |
'facebook' => $userProfile->facebook,
|
| - |
|
475 |
'instagram' => $userProfile->instagram,
|
| - |
|
476 |
'twitter' => $userProfile->twitter,
|
| - |
|
477 |
'formatted_address' => $formattedAddress,
|
| - |
|
478 |
'country' => $country,
|
| - |
|
479 |
'user_skills' => $userSkills,
|
| - |
|
480 |
'user_languages' => $userLanguages,
|
| - |
|
481 |
'user_educations' => $userEducations,
|
| - |
|
482 |
'user_experiences' => $userExperiences,
|
| - |
|
483 |
'user_aptitudes' => $userAptitudes,
|
| - |
|
484 |
'user_hobbies_and_interests' => $userHobbiesAndInterests,
|
| - |
|
485 |
'show_contact' => $user->id != $currentUser->id,
|
| - |
|
486 |
'request_connection' => 0,
|
| - |
|
487 |
'link_cancel' => '',
|
| - |
|
488 |
'link_request' => '',
|
| - |
|
489 |
'link_inmail' => $this->url()->fromRoute('inmail',['id' => $user->uuid ]),
|
| - |
|
490 |
];
|
| - |
|
491 |
}
|
| - |
|
492 |
|
| - |
|
493 |
if($currentNetwork->default == Network::DEFAULT_YES) {
|
| - |
|
494 |
|
| - |
|
495 |
$companyFollowerMapper = CompanyFollowerMapper::getInstance($this->adapter);
|
| - |
|
496 |
$data['following'] = $companyFollowerMapper->getCountFollowing($user->id);
|
| - |
|
497 |
$data['view_following'] = 1;
|
| - |
|
498 |
} else {
|
| - |
|
499 |
$data['following'] = 0;
|
| - |
|
500 |
$data['view_following'] = 0;
|
| Línea 401... |
Línea 501... |
| 401 |
|
501 |
}
|
| 402 |
} else {
|
502 |
|
| 403 |
|
503 |
|
| 404 |
|
504 |
|
| 405 |
$this->layout()->setTemplate('layout/layout.phtml');
|
- |
|
| 406 |
$viewModel = new ViewModel();
|
- |
|
| 407 |
$viewModel->setTemplate('leaders-linked/profile/view.phtml');
|
- |
|
| 408 |
$viewModel->setVariables([
|
- |
|
| 409 |
'following' => $following ,
|
- |
|
| 410 |
'total_connections' => $total_connections,
|
- |
|
| 411 |
'user_id' => $user->uuid,
|
- |
|
| 412 |
'user_uuid' => ($user->uuid),
|
- |
|
| 413 |
'full_name' => trim($user->first_name . ' ' . $user->last_name),
|
- |
|
| 414 |
'user_profile_id' => $userProfile->id,
|
- |
|
| 415 |
'user_profile_uuid' => $userProfile->uuid,
|
- |
|
| 416 |
'image' => $userProfile->image,
|
- |
|
| 417 |
'cover' => $userProfile->cover,
|
- |
|
| 418 |
'overview' => $userProfile->description,
|
- |
|
| 419 |
'facebook' => $userProfile->facebook,
|
- |
|
| 420 |
'instagram' => $userProfile->instagram,
|
- |
|
| 421 |
'twitter' => $userProfile->twitter,
|
- |
|
| 422 |
'formatted_address' => $formattedAddress,
|
- |
|
| 423 |
'country' => $country,
|
- |
|
| 424 |
'user_skills' => $userSkills,
|
- |
|
| 425 |
'user_languages' => $userLanguages,
|
- |
|
| 426 |
'user_educations' => $userEducations,
|
- |
|
| 427 |
'user_experiences' => $userExperiences,
|
- |
|
| 428 |
'user_aptitudes' => $userAptitudes,
|
- |
|
| 429 |
'user_hobbies_and_interests' => $userHobbiesAndInterests,
|
- |
|
| 430 |
'show_contact' => $user->id != $currentUser->id,
|
- |
|
| 431 |
'request_connection' => $request_connection,
|
- |
|
| 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]),
|
- |
|
| 433 |
'link_request' => $request_connection ? $this->url()->fromRoute('connection/request',['id' => $user->uuid ]) : '',
|
505 |
$this->layout()->setTemplate('layout/layout.phtml');
|
| 434 |
'link_inmail' => $this->url()->fromRoute('inmail',['id' => $user->uuid ]),
|
506 |
$viewModel = new ViewModel();
|
| 435 |
|
507 |
$viewModel->setTemplate('leaders-linked/profile/view.phtml');
|
| Línea 436... |
Línea 508... |
| 436 |
]);
|
508 |
$viewModel->setVariables($data);
|