Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 3454 Rev 3639
Línea 127... Línea 127...
127
     */
127
     */
128
    public function peopleYouMayKnowAction()
128
    public function peopleYouMayKnowAction()
129
    {
129
    {
130
        $request = $this->getRequest();
130
        $request = $this->getRequest();
131
        if($request->isGet()) {
131
        if($request->isGet()) {
132
            
-
 
133
            $currentUserPlugin = $this->plugin('currentUserPlugin');
132
            $currentUserPlugin = $this->plugin('currentUserPlugin');
134
            $currentUser = $currentUserPlugin->getUser();
133
            $currentUser = $currentUserPlugin->getUser();
Línea 135... Línea 134...
135
    
134
    
136
            $connectionMapper = ConnectionMapper::getInstance($this->adapter);
135
            $connectionMapper = ConnectionMapper::getInstance($this->adapter);
137
            $first_degree_connections_ids = $connectionMapper->fetchAllConnectionsByUserReturnIds($currentUser->id);
136
            $first_degree_connections_ids = $connectionMapper->fetchAllConnectionsByUserReturnIds($currentUser->id);
138
            $first_degree_connections_ids = $first_degree_connections_ids ? $first_degree_connections_ids : [0];
-
 
Línea 139... Línea -...
139
            
-
 
140
 
137
            $first_degree_connections_ids = $first_degree_connections_ids ? $first_degree_connections_ids : [0];
141
            
138
 
Línea 142... Línea -...
142
            $second_degree_connections_ids = $connectionMapper->fetchAllSecondDegreeConnectionsForUserIdReturnIds($currentUser->id);
-
 
143
            $second_degree_connections_ids = $second_degree_connections_ids ? $second_degree_connections_ids : [0];
-
 
144
            
-
 
145
 
139
            $second_degree_connections_ids = $connectionMapper->fetchAllSecondDegreeConnectionsForUserIdReturnIds($currentUser->id);
146
           
140
            $second_degree_connections_ids = $second_degree_connections_ids ? $second_degree_connections_ids : [0];
147
            
141
            
Línea 148... Línea 142...
148
            /*Usuarios de la empresas donde trabajo o soy dueño */
142
            /*Usuarios de la empresas donde trabajo o soy dueño */
Línea 250... Línea 244...
250
            $items = [];
244
            $items = [];
251
            $queryMapper = QueryMapper::getInstance($this->adapter);
245
            $queryMapper = QueryMapper::getInstance($this->adapter);
252
            $select = $queryMapper->getSql()->select();
246
            $select = $queryMapper->getSql()->select();
253
            $select->columns(['id', 'uuid',  'first_name','last_name', 'image']);
247
            $select->columns(['id', 'uuid',  'first_name','last_name', 'image']);
254
            $select->from(['u' => UserMapper::_TABLE]);
248
            $select->from(['u' => UserMapper::_TABLE]);
-
 
249
            $select->where->equalTo('network_id', $currentUser->network_id);
255
            $select->where->in('u.id', $other_users);
250
            $select->where->in('u.id', $other_users);
256
            $select->where->notIn('u.id', $first_degree_connections_ids);
251
            $select->where->notIn('u.id', $first_degree_connections_ids);
257
            $select->where->notEqualTo('u.id', $currentUser->id);
252
            $select->where->notEqualTo('u.id', $currentUser->id);
258
            $select->where->equalTo('u.status', User::STATUS_ACTIVE);
253
            $select->where->equalTo('u.status', User::STATUS_ACTIVE);
259
            $select->where->in('u.usertype_id', [UserType::ADMIN, UserType::USER]);
254
            $select->where->in('u.usertype_id', [UserType::ADMIN, UserType::USER]);
Línea 356... Línea 351...
356
     */
351
     */
357
    public function peopleViewedProfileAction()
352
    public function peopleViewedProfileAction()
358
    {
353
    {
359
        $request = $this->getRequest();
354
        $request = $this->getRequest();
360
        if($request->isGet()) {
355
        if($request->isGet()) {
-
 
356
            $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
357
            $currentUser = $currentUserPlugin->getUser();
Línea 361... Línea 358...
361
            
358
            
362
            $items = [];
359
            $items = [];
Línea 363... Línea 360...
363
            $user_profile_id = $this->params()->fromRoute('user_profile_id');
360
            $user_profile_id = $this->params()->fromRoute('user_profile_id');
Línea 380... Línea 377...
380
                
377
                
381
                $mapper = QueryMapper::getInstance($this->adapter);
378
                $mapper = QueryMapper::getInstance($this->adapter);
382
                $select = $mapper->getSql()->select( UserMapper::_TABLE);
379
                $select = $mapper->getSql()->select( UserMapper::_TABLE);
383
                $select->columns(['id', 'uuid', 'first_name', 'last_name', 'image']);
380
                $select->columns(['id', 'uuid', 'first_name', 'last_name', 'image']);
-
 
381
                $select->where->in('id', $user_ids);
384
                $select->where->in('id', $user_ids);
382
                $select->where->equalTo('network_id', $currentUser->network_id);
385
                $select->where->equalTo('status',User::STATUS_ACTIVE);
383
                $select->where->equalTo('status',User::STATUS_ACTIVE);
Línea 386... Línea 384...
386
                $select->order(['last_name ASC', 'first_name ASC']);
384
                $select->order(['last_name ASC', 'first_name ASC']);
387
                
385
                
Línea 437... Línea 435...
437
    {
435
    {
Línea 438... Línea 436...
438
 
436
 
439
        
437
        
-
 
438
        $request = $this->getRequest();
-
 
439
        if($request->isGet()) {
Línea 440... Línea 440...
440
        $request = $this->getRequest();
440
            $currentUserPlugin = $this->plugin('currentUserPlugin');
Línea 441... Línea 441...
441
        if($request->isGet()) {
441
            $currentUser = $currentUserPlugin->getUser();
442
            
442
            
Línea 443... Línea 443...
443
            $company_uuid  = $this->params()->fromRoute('company_id');
443
            $company_uuid  = $this->params()->fromRoute('company_id');
444
            
444
            
Línea 468... Línea 468...
468
                if($ids) {
468
                if($ids) {
Línea 469... Línea 469...
469
                    
469
                    
470
                    $mapper = QueryMapper::getInstance($this->adapter);
470
                    $mapper = QueryMapper::getInstance($this->adapter);
471
                    $select = $mapper->getSql()->select(UserMapper::_TABLE);
471
                    $select = $mapper->getSql()->select(UserMapper::_TABLE);
-
 
472
                    $select->columns(['id', 'uuid', 'first_name', 'last_name', 'image']);
472
                    $select->columns(['id', 'uuid', 'first_name', 'last_name', 'image']);
473
                    $select->where->equalTo('network_id', $currentUser->network_id);
473
                    $select->where->in('id',$ids);
474
                    $select->where->in('id',$ids);
474
                    $select->where->equalTo('status',User::STATUS_ACTIVE);
475
                    $select->where->equalTo('status',User::STATUS_ACTIVE);
Línea 475... Línea 476...
475
                    $select->order(['last_name','first_name']);
476
                    $select->order(['last_name','first_name']);
Línea 508... Línea 509...
508
    
509
    
509
    public function companySuggestionAction()
510
    public function companySuggestionAction()
510
    {
511
    {
511
        $request = $this->getRequest();
512
        $request = $this->getRequest();
-
 
513
        if($request->isGet()) {
-
 
514
            $currentUserPlugin = $this->plugin('currentUserPlugin');
Línea 512... Línea 515...
512
        if($request->isGet()) {
515
            $currentUser = $currentUserPlugin->getUser();
Línea 513... Línea 516...
513
            
516
            
514
            $company_id = $this->params()->fromRoute('company_id');
517
            $company_uuid = $this->params()->fromRoute('company_id');
Línea 515... Línea 518...
515
            
518
            
516
            $companyMapper = CompanyMapper::getInstance($this->adapter);
519
            $companyMapper = CompanyMapper::getInstance($this->adapter);
Línea 517... Línea 520...
517
            $company = $companyMapper->fetchOneByUuid($company_id);
520
            $company = $companyMapper->fetchOneByUuidAndNetworkId($company_uuid, $currentUser->network_id);
518
            
521
            
519
            $items = [];
522
            $items = [];
-
 
523
            if($company && $company->status == Company::STATUS_ACTIVE) {
520
            if($company && $company->status == Company::STATUS_ACTIVE) {
524
                
521
                
525
                
522
                
526
                $mapper = QueryMapper::getInstance($this->adapter);
523
                $mapper = QueryMapper::getInstance($this->adapter);
527
                $select = $mapper->getSql()->select(CompanyMapper::_TABLE);
524
                $select = $mapper->getSql()->select(CompanyMapper::_TABLE);
528
                $select->columns(['id', 'uuid', 'name', 'image']);
Línea 580... Línea 584...
580
     */
584
     */
581
    public function groupMembersAction()
585
    public function groupMembersAction()
582
    {
586
    {
583
        $currentUserPlugin = $this->plugin('currentUserPlugin');
587
        $currentUserPlugin = $this->plugin('currentUserPlugin');
584
        $currentUser = $currentUserPlugin->getUser();
588
        $currentUser = $currentUserPlugin->getUser();
585
        
589
 
586
        $request = $this->getRequest();
590
        $request = $this->getRequest();
587
        if($request->isGet()) {
591
        if($request->isGet()) {
Línea 588... Línea 592...
588
            
592
            
Línea 589... Línea 593...
589
            $group_uuid = $this->params()->fromRoute('group_id');
593
            $group_uuid = $this->params()->fromRoute('group_id');
590
            
594
            
Línea 591... Línea 595...
591
            $groupMapper = GroupMapper::getInstance($this->adapter);
595
            $groupMapper = GroupMapper::getInstance($this->adapter);
592
            $group = $groupMapper->fetchOneByUuid($group_uuid);
596
            $group = $groupMapper->fetchOneByUuidAndNetworkId($group_uuid, $currentUser->network_id);
Línea 593... Línea 597...
593
            
597
            
594
            $items = [];
598
            $items = [];
595
            if($group && $group->status == Group::STATUS_ACTIVE) {
599
            if($group && $group->status == Group::STATUS_ACTIVE) {
596
                
600
                
597
                $mapper = QueryMapper::getInstance($this->adapter);
601
                $mapper = QueryMapper::getInstance($this->adapter);
598
                $select = $mapper->getSql()->select();
602
                $select = $mapper->getSql()->select();
-
 
603
                $select->columns(['id', 'uuid', 'first_name', 'last_name', 'image']);
-
 
604
                $select->from(['u' => UserMapper::_TABLE]);
599
                $select->columns(['id', 'uuid', 'first_name', 'last_name', 'image']);
605
                $select->join(['gm' => GroupMemberMapper::_TABLE], 'gm.user_id = u.id ', ['user_id', 'status']);
Línea 600... Línea 606...
600
                $select->from(['u' => UserMapper::_TABLE]);
606
                $select->join(['g' => GroupMapper::_TABLE], 'gm.group_id = g.id', ['group_uuid' => 'uuid']  );
601
                $select->join(['gm' => GroupMemberMapper::_TABLE], 'gm.user_id = u.id ', ['user_id', 'status']);
607
                $select->where->equalTo('u.network_id',  $currentUser->network_id);
602
                $select->join(['g' => GroupMapper::_TABLE], 'gm.group_id = g.id', ['group_uuid' => 'uuid']  );
608
                $select->where->equalTo('g.network_id', $currentUser->network_id);
Línea 678... Línea 684...
678
        }
684
        }
679
    }
685
    }
Línea 680... Línea 686...
680
    
686
    
681
    public function groupMemberInviteAction()
687
    public function groupMemberInviteAction()
682
    {
-
 
683
 
-
 
684
        
688
    {
685
        $currentUserPlugin = $this->plugin('currentUserPlugin');
689
        $currentUserPlugin = $this->plugin('currentUserPlugin');
686
        $currentUser = $currentUserPlugin->getUser();
690
        $currentUser = $currentUserPlugin->getUser();
687
        
691
 
Línea 688... Línea 692...
688
        $group_uuid = $this->params()->fromRoute('group_id');
692
        $group_uuid = $this->params()->fromRoute('group_id');
689
        
693
        
Línea 690... Línea 694...
690
        $groupMapper = GroupMapper::getInstance($this->adapter);
694
        $groupMapper = GroupMapper::getInstance($this->adapter);
691
        $group = $groupMapper->fetchOneByUuid($group_uuid);
695
        $group = $groupMapper->fetchOneByUuidAndNetworkId($group_uuid, $currentUser->network_id);
692
        
696
        
693
        if(!$group) {
697
        if(!$group) {
Línea 716... Línea 720...
716
        if($request->isGet()) {
720
        if($request->isGet()) {
717
            $search = filter_var($this->params()->fromQuery('search', ''));
721
            $search = filter_var($this->params()->fromQuery('search', ''));
718
            if(strlen($search) >= 3) {
722
            if(strlen($search) >= 3) {
Línea 719... Línea 723...
719
 
723
 
720
                $userMapper = UserMapper::getInstance($this->adapter);
724
                $userMapper = UserMapper::getInstance($this->adapter);
Línea 721... Línea 725...
721
                $records  = $userMapper->fetchAllSuggestForInvitationByGroupId($group->id, $search);
725
                $records  = $userMapper->fetchAllSuggestForInvitationByGroupIdAndNetworkIdAndSearch($group->id, $currentUser->network_id, $search);
722
                
726
                
723
                $users = [];
727
                $users = [];
724
                foreach($records as $record)
728
                foreach($records as $record)
Línea 758... Línea 762...
758
                    'data'      => 'ERROR_INVALID_PARAMETER'
762
                    'data'      => 'ERROR_INVALID_PARAMETER'
759
                ]);
763
                ]);
760
            }
764
            }
Línea 761... Línea 765...
761
            
765
            
762
            $userMapper = UserMapper::getInstance($this->adapter);
766
            $userMapper = UserMapper::getInstance($this->adapter);
Línea 763... Línea 767...
763
            $user = $userMapper->fetchOneByUuid($uuid);
767
            $user = $userMapper->fetchOneByUuidAndNetworkId($uuid, $currentUser->network_id);
764
            
768
            
765
            if(!$user) {
769
            if(!$user) {
766
                return new JsonModel([
770
                return new JsonModel([
Línea 866... Línea 870...
866
                $userNotification = $userNotificationMapper->fetchOne($user->id);
870
                $userNotification = $userNotificationMapper->fetchOne($user->id);
Línea 867... Línea 871...
867
                
871
                
868
                if($userNotification && $userNotification->receive_invitation_group)
872
                if($userNotification && $userNotification->receive_invitation_group)
869
                {
873
                {
870
                    $emailTemplateMapper = EmailTemplateMapper::getInstance($this->adapter);
874
                    $emailTemplateMapper = EmailTemplateMapper::getInstance($this->adapter);
Línea 871... Línea 875...
871
                    $emailTemplate = $emailTemplateMapper->fetchOne(EmailTemplate::ID_RECEIVE_INVITATION_GROUP);
875
                    $emailTemplate = $emailTemplateMapper->fetchOneByCodeAndNetworkId(EmailTemplate::CODE_RECEIVE_INVITATION_GROUP, $currentUser->network_id);
872
                    
876
                    
873
                    if($emailTemplate) {
877
                    if($emailTemplate) {
874
                        $arrayCont = [
878
                        $arrayCont = [
Línea 914... Línea 918...
914
    
918
    
915
    public function  groupMemberCancelAction()
919
    public function  groupMemberCancelAction()
916
    {
920
    {
917
        $currentUserPlugin = $this->plugin('currentUserPlugin');
921
        $currentUserPlugin = $this->plugin('currentUserPlugin');
918
        $currentUser = $currentUserPlugin->getUser();
922
        $currentUser = $currentUserPlugin->getUser();
919
        
923
 
920
        $request = $this->getRequest();
924
        $request = $this->getRequest();
921
        if($request->isPost()) {
925
        if($request->isPost()) {
922
            $group_uuid = $this->params()->fromRoute('group_id');
926
            $group_uuid = $this->params()->fromRoute('group_id');
Línea 923... Línea 927...
923
            $user_uuid  = $this->params()->fromRoute('user_id'); 
927
            $user_uuid  = $this->params()->fromRoute('user_id'); 
924
            
928
            
Línea 925... Línea 929...
925
            $groupMapper = GroupMapper::getInstance($this->adapter);
929
            $groupMapper = GroupMapper::getInstance($this->adapter);
926
            $group = $groupMapper->fetchOneByUuid($group_uuid);
930
            $group = $groupMapper->fetchOneByUuidAndNetworkId($group_uuid, $currentUser->network_id);
927
            
931
            
928
            if(!$group) {
932
            if(!$group) {
Línea 945... Línea 949...
945
                    'data' => 'ERROR_GROUP_IS_NOT_YOU_ARE_THE_OWNER_OF_THIS_GROUP'
949
                    'data' => 'ERROR_GROUP_IS_NOT_YOU_ARE_THE_OWNER_OF_THIS_GROUP'
946
                ]);
950
                ]);
947
            }
951
            }
Línea 948... Línea 952...
948
            
952
            
949
            $userMapper = UserMapper::getInstance($this->adapter);
953
            $userMapper = UserMapper::getInstance($this->adapter);
Línea 950... Línea 954...
950
            $user = $userMapper->fetchOneByUuid($user_uuid);
954
            $user = $userMapper->fetchOneByUuidAndNetworkId($user_uuid, $currentUser->network_id);
951
            
955
            
952
            if(!$user) {
956
            if(!$user) {
953
                return new JsonModel([
957
                return new JsonModel([
Línea 1019... Línea 1023...
1019
        if($request->isPost()) {
1023
        if($request->isPost()) {
1020
            $group_uuid = $this->params()->fromRoute('group_id');
1024
            $group_uuid = $this->params()->fromRoute('group_id');
1021
            $user_uuid  = $this->params()->fromRoute('user_id');
1025
            $user_uuid  = $this->params()->fromRoute('user_id');
Línea 1022... Línea 1026...
1022
            
1026
            
1023
            $groupMapper = GroupMapper::getInstance($this->adapter);
1027
            $groupMapper = GroupMapper::getInstance($this->adapter);
Línea 1024... Línea 1028...
1024
            $group = $groupMapper->fetchOneByUuid($group_uuid);
1028
            $group = $groupMapper->fetchOneByUuidAndNetworkId($group_uuid, $currentUser->network_id);
1025
            
1029
            
1026
            if(!$group) {
1030
            if(!$group) {
1027
                return new JsonModel([
1031
                return new JsonModel([
Línea 1043... Línea 1047...
1043
                    'data' => 'ERROR_GROUP_IS_NOT_YOU_ARE_THE_OWNER_OF_THIS_GROUP'
1047
                    'data' => 'ERROR_GROUP_IS_NOT_YOU_ARE_THE_OWNER_OF_THIS_GROUP'
1044
                ]);
1048
                ]);
1045
            }
1049
            }
Línea 1046... Línea 1050...
1046
            
1050
            
1047
            $userMapper = UserMapper::getInstance($this->adapter);
1051
            $userMapper = UserMapper::getInstance($this->adapter);
Línea 1048... Línea 1052...
1048
            $user = $userMapper->fetchOneByUuid($user_uuid);
1052
            $user = $userMapper->fetchOneByUuidAndNetworkId($user_uuid, $currentUser->network_id);
1049
            
1053
            
1050
            if(!$user) {
1054
            if(!$user) {
1051
                return new JsonModel([
1055
                return new JsonModel([
Línea 1115... Línea 1119...
1115
        if($request->isPost()) {
1119
        if($request->isPost()) {
1116
            $group_uuid = $this->params()->fromRoute('group_id');
1120
            $group_uuid = $this->params()->fromRoute('group_id');
1117
            $user_uuid  = $this->params()->fromRoute('user_id');
1121
            $user_uuid  = $this->params()->fromRoute('user_id');
Línea 1118... Línea 1122...
1118
            
1122
            
1119
            $groupMapper = GroupMapper::getInstance($this->adapter);
1123
            $groupMapper = GroupMapper::getInstance($this->adapter);
Línea 1120... Línea 1124...
1120
            $group = $groupMapper->fetchOneByUuid($group_uuid);
1124
            $group = $groupMapper->fetchOneByUuidAndNetworkId($group_uuid, $currentUser->network_id);
1121
            
1125
            
1122
            if(!$group) {
1126
            if(!$group) {
1123
                return new JsonModel([
1127
                return new JsonModel([
Línea 1139... Línea 1143...
1139
                    'data' => 'ERROR_GROUP_IS_NOT_YOU_ARE_THE_OWNER_OF_THIS_GROUP'
1143
                    'data' => 'ERROR_GROUP_IS_NOT_YOU_ARE_THE_OWNER_OF_THIS_GROUP'
1140
                ]);
1144
                ]);
1141
            }
1145
            }
Línea 1142... Línea 1146...
1142
            
1146
            
1143
            $userMapper = UserMapper::getInstance($this->adapter);
1147
            $userMapper = UserMapper::getInstance($this->adapter);
Línea 1144... Línea 1148...
1144
            $user = $userMapper->fetchOneByUuid($user_uuid);
1148
            $user = $userMapper->fetchOneByUuidAndNetworkId($user_uuid, $currentUser->network_id);
1145
            
1149
            
1146
            if(!$user) {
1150
            if(!$user) {
1147
                return new JsonModel([
1151
                return new JsonModel([
Línea 1184... Línea 1188...
1184
                        $userNotification = $userNotificationMapper->fetchOne($user->id);
1188
                        $userNotification = $userNotificationMapper->fetchOne($user->id);
Línea 1185... Línea 1189...
1185
                        
1189
                        
1186
                        if($userNotification && $userNotification->receive_invitation_group)
1190
                        if($userNotification && $userNotification->receive_invitation_group)
1187
                        {
1191
                        {
1188
                            $emailTemplateMapper = EmailTemplateMapper::getInstance($this->adapter);
1192
                            $emailTemplateMapper = EmailTemplateMapper::getInstance($this->adapter);
Línea 1189... Línea 1193...
1189
                            $emailTemplate = $emailTemplateMapper->fetchOne(EmailTemplate::ID_ACCEPT_MY_REQUEST_JOIN_GROUP);
1193
                            $emailTemplate = $emailTemplateMapper->fetchOneByCodeAndNetworkId(EmailTemplate::CODE_ACCEPT_MY_REQUEST_JOIN_GROUP, $currentUser->network_id);
1190
                            
1194
                            
1191
                            if($emailTemplate) {
1195
                            if($emailTemplate) {
1192
                                $arrayCont = [
1196
                                $arrayCont = [
Línea 1269... Línea 1273...
1269
        if($request->isGet()) {
1273
        if($request->isGet()) {
Línea 1270... Línea 1274...
1270
            
1274
            
1271
            $currentUserPlugin = $this->plugin('currentUserPlugin');
1275
            $currentUserPlugin = $this->plugin('currentUserPlugin');
Línea 1272... Línea -...
1272
            $currentUser = $currentUserPlugin->getUser();
-
 
1273
            
-
 
1274
         
1276
            $currentUser = $currentUserPlugin->getUser();
1275
            
1277
            
1276
            $connectionMapper = ConnectionMapper::getInstance($this->adapter);
1278
            $connectionMapper = ConnectionMapper::getInstance($this->adapter);
Línea 1277... Línea -...
1277
            $first_degree_connections_ids = $connectionMapper->fetchAllConnectionsByUserReturnIds($currentUser->id);
-
 
1278
            $first_degree_connections_ids = $first_degree_connections_ids ? $first_degree_connections_ids : [0];
-
 
1279
            
1279
            $first_degree_connections_ids = $connectionMapper->fetchAllConnectionsByUserReturnIds($currentUser->id);
1280
            
1280
            $first_degree_connections_ids = $first_degree_connections_ids ? $first_degree_connections_ids : [0];
Línea 1281... Línea -...
1281
            
-
 
1282
            $second_degree_connections_ids = $connectionMapper->fetchAllSecondDegreeConnectionsForUserIdReturnIds($currentUser->id);
1281
            
1283
            $second_degree_connections_ids = $second_degree_connections_ids ? $second_degree_connections_ids : [0];
1282
            $second_degree_connections_ids = $connectionMapper->fetchAllSecondDegreeConnectionsForUserIdReturnIds($currentUser->id);
1284
            
1283
            $second_degree_connections_ids = $second_degree_connections_ids ? $second_degree_connections_ids : [0];
Línea 1285... Línea 1284...
1285
            
1284
            
Línea 1386... Línea 1385...
1386
                
1385
                
1387
   
1386
   
1388
            $select = $queryMapper->getSql()->select();
1387
            $select = $queryMapper->getSql()->select();
-
 
1388
            $select->columns(['id', 'uuid', 'name','image','status','privacy', 'priority' => new Expression('0') ]);
1389
            $select->columns(['id', 'uuid', 'name','image','status','privacy', 'priority' => new Expression('0') ]);
1389
            $select->from(['g' => GroupMapper::_TABLE]); 
1390
            $select->from(['g' => GroupMapper::_TABLE]); 
1390
            $select->where->equalTo('network_id', $currentUser->network_id);
1391
            $select->where->equalTo('privacy', Group::PRIVACY_IS_PUBLIC);
1391
            $select->where->equalTo('privacy', Group::PRIVACY_IS_PUBLIC);
1392
            $select->where->equalTo('status', Group::STATUS_ACTIVE);
1392
            $select->where->equalTo('status', Group::STATUS_ACTIVE);
1393
            $select->where->in('g.id', $group_ids);
1393
            $select->where->in('g.id', $group_ids);
Línea 1438... Línea 1438...
1438
        }
1438
        }
1439
    }
1439
    }
Línea 1440... Línea 1440...
1440
    
1440
    
1441
    public function postsAction()
1441
    public function postsAction()
1442
    {
1442
    {
1443
        $request = $this->getRequest();
1443
        $request = $this-x>getRequest();
-
 
1444
        if($request->isGet()) {
-
 
1445
            $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
1446
            $currentUser = $currentUserPlugin->getUser();
1444
        if($request->isGet()) {
1447
            
1445
            $items = [];
1448
            $items = [];
1446
            $postMapper = PostMapper::getInstance($this->adapter);
1449
            $postMapper = PostMapper::getInstance($this->adapter);
Línea 1447... Línea 1450...
1447
            $posts = $postMapper->fetchAllActive();
1450
            $posts = $postMapper->fetchAllActiveByNetworkId($currentUser->network_id);
Línea 1448... Línea 1451...
1448
            
1451
            
1449
            //print_r($posts);
1452
            //print_r($posts);
Línea 1476... Línea 1479...
1476
    
1479
    
1477
    public function searchPeopleAction()
1480
    public function searchPeopleAction()
1478
    {
1481
    {
1479
        $request = $this->getRequest();
1482
        $request = $this->getRequest();
1480
        if($request->isGet()) {
-
 
1481
            
1483
        if($request->isGet()) {
1482
            
1484
 
1483
            $currentUserPlugin = $this->plugin('currentUserPlugin');
1485
            $currentUserPlugin = $this->plugin('currentUserPlugin');
1484
            $currentUser = $currentUserPlugin->getUser();
1486
            $currentUser = $currentUserPlugin->getUser();
1485
            
1487
 
1486
            $search = trim(filter_var( $this->params()->fromQuery('search'), FILTER_SANITIZE_STRING)) ;
1488
            $search = trim(filter_var( $this->params()->fromQuery('search'), FILTER_SANITIZE_STRING)) ;
Línea 1487... Línea 1489...
1487
            if(strlen($search) >= 3) {
1489
            if(strlen($search) >= 3) {
1488
                
1490
                
Línea 1489... Línea 1491...
1489
                
1491
                
1490
                $userMapper = UserMapper::getInstance($this->adapter);
1492
                $userMapper = UserMapper::getInstance($this->adapter);
1491
                $records  = $userMapper->fetchAllSuggest($search);
1493
                $records  = $userMapper->fetchAllSuggestByNetworkIdAndSearch($currentUser->network_id, $search);
1492
                
1494