Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 3639 Rev 4842
Línea 41... Línea 41...
41
use LeadersLinked\Mapper\UserBlockedMapper;
41
use LeadersLinked\Mapper\UserBlockedMapper;
42
use LeadersLinked\Mapper\CompanyUserMapper;
42
use LeadersLinked\Mapper\CompanyUserMapper;
43
use LeadersLinked\Model\CompanyUser;
43
use LeadersLinked\Model\CompanyUser;
44
use LeadersLinked\Model\Company;
44
use LeadersLinked\Model\Company;
45
use LeadersLinked\Model\Group;
45
use LeadersLinked\Model\Group;
-
 
46
use LeadersLinked\Model\Network;
Línea 46... Línea 47...
46
 
47
 
47
class SearchController extends AbstractActionController
48
class SearchController extends AbstractActionController
48
{
49
{
49
    /**
50
    /**
Línea 88... Línea 89...
88
        $this->config       = $config;
89
        $this->config       = $config;
89
    }
90
    }
Línea 90... Línea 91...
90
    
91
    
91
    public function indexAction()
92
    public function indexAction()
-
 
93
    {
-
 
94
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
95
        $currentUser = $currentUserPlugin->getUser();
-
 
96
        
-
 
97
        $currentNetworkPlugin = $this->plugin('currentNetworkPlugin');
-
 
98
        $currentNetwork= $currentNetworkPlugin->getNetwork();
-
 
99
        
92
    {
100
        
93
        $page       = (int) filter_var($this->params()->fromQuery('page'), FILTER_SANITIZE_NUMBER_INT);
101
        $page       = (int) filter_var($this->params()->fromQuery('page'), FILTER_SANITIZE_NUMBER_INT);
94
        $keyword    = filter_var($this->params()->fromQuery('keyword'), FILTER_SANITIZE_STRING);
102
        $keyword    = filter_var($this->params()->fromQuery('keyword'), FILTER_SANITIZE_STRING);
95
        $entity     = $this->params()->fromRoute('entity');
103
        $entity     = $this->params()->fromRoute('entity');
96
        $country    = filter_var($this->params()->fromQuery('country'), FILTER_SANITIZE_STRING);
104
        $country    = filter_var($this->params()->fromQuery('country'), FILTER_SANITIZE_STRING);
Línea 124... Línea 132...
124
                }
132
                }
125
            }
133
            }
Línea 126... Línea 134...
126
            
134
            
127
 
-
 
128
            if($isJson) {
-
 
129
                $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
130
                $currentUser = $currentUserPlugin->getUser();
135
 
Línea 131... Línea 136...
131
          
136
            if($isJson) {
132
             
137
 
Línea 133... Línea 138...
133
                
138
                
Línea 556... Línea 561...
556
                            }
561
                            }
Línea 557... Línea 562...
557
                            
562
                            
558
                            $industry       = $record['industry_id'] ? $industryMapper->fetchOne($record['industry_id']) : '';
563
                            $industry       = $record['industry_id'] ? $industryMapper->fetchOne($record['industry_id']) : '';
Línea 559... Línea -...
559
                            $views          = $profileVisitMapper->getTotalByVisitedId($record['id']);
-
 
560
                            
564
                            $views          = $profileVisitMapper->getTotalByVisitedId($record['id']);
561
                            $common_connection = count($connectionMapper->fetchAllCommonConnectionsUserIdByUser1ReturnIds($currentUser->id, $record['id']));
565
                            
562
                            
566
            
563
                            $item = [
567
                            $item = [
564
                                'id' => $record['user_uuid'],
568
                                'id' => $record['user_uuid'],
565
                                'id_encripted' => $record['user_uuid'],
569
                                'id_encripted' => $record['user_uuid'],
566
                                'name' => $record['first_name'] . ' ' . $record['last_name'], 
570
                                'name' => $record['first_name'] . ' ' . $record['last_name'], 
567
                                'description' => $record['description'],
571
                                'description' => $record['description'],
568
                                'image' => $this->url()->fromRoute('storage',['type' => 'user', 'code' =>  $record['user_uuid'], 'filename' => $record['image']]),
572
                                'image' => $this->url()->fromRoute('storage',['type' => 'user', 'code' =>  $record['user_uuid'], 'filename' => $record['image']]),
569
                                'url' => $this->url()->fromRoute('profile/view',['id' => $record['user_uuid'] ]),
573
                                'url' => $this->url()->fromRoute('profile/view',['id' => $record['user_uuid'] ]),
570
                                'industry' => $industry? $industry->name : '',
-
 
-
 
574
                                'industry' => $industry? $industry->name : '',
571
                                'skills' => $skills ? $skills : [],
575
                                'skills' => $skills ? $skills : [],
572
                                'common_connection' => $common_connection,
576
                                
-
 
577
                                'views' => $views
-
 
578
                            ];
-
 
579
                            
-
 
580
                            if($currentNetwork->relationship_user_mode == Network::RELATIONSHIP_USER_MODE_USER_2_USER)  {
-
 
581
                                $common_connection = count($connectionMapper->fetchAllCommonConnectionsUserIdByUser1ReturnIds($currentUser->id, $record['id']));
-
 
582
                                
-
 
583
                                $item['common_connection'] = $common_connection;
-
 
584
                                $item['view_common_connection'] = 1;
-
 
585
                            } else {
-
 
586
                                $item['common_connection'] = 0;
-
 
587
                                $item['view_common_connection'] = 0;
-
 
588
                            }
573
                                'views' => $views
589
                            
Línea 574... Línea 590...
574
                            ];
590
                            
Línea 575... Línea 591...
575
                            array_push($items, $item);                                
591
                            array_push($items, $item);