Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 240 Rev 3639
Línea 23... Línea 23...
23
use LeadersLinked\Model\CompanyFollower;
23
use LeadersLinked\Model\CompanyFollower;
24
use LeadersLinked\Mapper\UserBlockedMapper;
24
use LeadersLinked\Mapper\UserBlockedMapper;
25
use LeadersLinked\Mapper\UserMapper;
25
use LeadersLinked\Mapper\UserMapper;
26
use LeadersLinked\Model\Company;
26
use LeadersLinked\Model\Company;
27
use LeadersLinked\Model\CompanyUser;
27
use LeadersLinked\Model\CompanyUser;
28
use LeadersLinked\Mapper\UserNotificationSettingMapper;
-
 
29
use LeadersLinked\Mapper\QueryMapper;
28
use LeadersLinked\Mapper\QueryMapper;
30
use phpDocumentor\Reflection\PseudoTypes\True_;
-
 
31
use LeadersLinked\Mapper\CompanyUserRoleMapper;
-
 
32
use LeadersLinked\Library\Functions;
-
 
33
use LeadersLinked\Mapper\NotificationMapper;
29
use LeadersLinked\Mapper\NotificationMapper;
34
use LeadersLinked\Model\Notification;
30
use LeadersLinked\Model\Network;
Línea 35... Línea 31...
35
 
31
 
36
class CompanyController extends AbstractActionController
32
class CompanyController extends AbstractActionController
37
{
33
{
38
    /**
34
    /**
Línea 118... Línea 114...
118
        
114
        
119
        $request = $this->getRequest();
115
        $request = $this->getRequest();
120
        if($request->isGet()) {
116
        if($request->isGet()) {
121
            $currentUserPlugin = $this->plugin('currentUserPlugin');
117
            $currentUserPlugin = $this->plugin('currentUserPlugin');
122
            $currentUser = $currentUserPlugin->getUser();
118
            $currentUser = $currentUserPlugin->getUser();
123
        
119
            
124
            $request = $this->getRequest();
120
            $request = $this->getRequest();
Línea 125... Línea 121...
125
            $id = $this->params()->fromRoute('id');
121
            $id = $this->params()->fromRoute('id');
Línea 154... Línea 150...
154
                    ]);
150
                    ]);
Línea 155... Línea 151...
155
 
151
 
Línea 156... Línea 152...
156
                }
152
                }
157
                
153
                
158
                $companyMapper = CompanyMapper::getInstance($this->adapter);
154
                $companyMapper = CompanyMapper::getInstance($this->adapter);
Línea 159... Línea 155...
159
                $company = $companyMapper->fetchOneByUuid($id);
155
                $company = $companyMapper->fetchOneByUuidAndNetworkId($id, $currentUser->network_id);
160
                if(!$company) {
156
                if(!$company) {
161
                    
157
                    
Línea 243... Línea 239...
243
                    'link_inmail'           => $link_inmail,
239
                    'link_inmail'           => $link_inmail,
244
                    'show_contact'          => $userBlocked ? 0 : 1,
240
                    'show_contact'          => $userBlocked ? 0 : 1,
245
                ];
241
                ];
Línea -... Línea 242...
-
 
242
                
Línea 246... Línea 243...
246
                
243
 
247
 
244
 
248
                
245
                
Línea 304... Línea 301...
304
                    $flashMessenger->addErrorMessage('ERROR_INVALID_PARAMETER');
301
                    $flashMessenger->addErrorMessage('ERROR_INVALID_PARAMETER');
305
                    return $this->redirect()->toRoute('dashboard');
302
                    return $this->redirect()->toRoute('dashboard');
306
                }
303
                }
Línea 307... Línea 304...
307
                
304
                
308
                $companyMapper = CompanyMapper::getInstance($this->adapter);
305
                $companyMapper = CompanyMapper::getInstance($this->adapter);
309
                $company = $companyMapper->fetchOneByUuid($id);
306
                $company = $companyMapper->fetchOneByUuidAndNetworkId($id, $currentUser->network_id);
310
                if(!$company || $company->status != Company::STATUS_ACTIVE) {
307
                if(!$company || $company->status != Company::STATUS_ACTIVE) {
311
                    $flashMessenger->addErrorMessage('ERROR_RECORD_NOT_FOUND');
308
                    $flashMessenger->addErrorMessage('ERROR_RECORD_NOT_FOUND');
312
                    return $this->redirect()->toRoute('dashboard');
309
                    return $this->redirect()->toRoute('dashboard');
Línea 424... Línea 421...
424
        }
421
        }
425
    }
422
    }
Línea 426... Línea 423...
426
    
423
    
427
    public function followAction()
424
    public function followAction()
-
 
425
    {
-
 
426
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
427
        $currentUser = $currentUserPlugin->getUser();
428
    {
428
        
429
        $flashMessenger = $this->plugin('FlashMessenger');
429
        $flashMessenger = $this->plugin('FlashMessenger');
430
        $request = $this->getRequest();
430
        $request = $this->getRequest();
Línea 431... Línea 431...
431
        $id = $this->params()->fromRoute('id');
431
        $id = $this->params()->fromRoute('id');
Línea 440... Línea 440...
440
        }
440
        }
Línea 441... Línea 441...
441
        
441
        
442
        
442
        
443
        
443
        
444
        $companyMapper = CompanyMapper::getInstance($this->adapter);
444
        $companyMapper = CompanyMapper::getInstance($this->adapter);
445
        $company = $companyMapper->fetchOneByUuid($id);
445
        $company = $companyMapper->fetchOneByUuidAndNetworkId($id, $currentUser->network_id);
446
        if(!$company) {
446
        if(!$company) {
447
            $data = [
447
            $data = [
Línea 519... Línea 519...
519
        return new JsonModel($data);
519
        return new JsonModel($data);
520
    }
520
    }
Línea 521... Línea 521...
521
    
521
    
522
    public function unfollowAction()
522
    public function unfollowAction()
-
 
523
    {
-
 
524
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
525
        $currentUser = $currentUserPlugin->getUser();
523
    {
526
        
524
        $flashMessenger = $this->plugin('FlashMessenger');
527
        $flashMessenger = $this->plugin('FlashMessenger');
525
        $request = $this->getRequest();
528
        $request = $this->getRequest();
Línea 526... Línea 529...
526
        $id = $this->params()->fromRoute('id');
529
        $id = $this->params()->fromRoute('id');
Línea 535... Línea 538...
535
        }
538
        }
Línea 536... Línea 539...
536
        
539
        
537
        
540
        
538
        
541
        
539
        $companyMapper = CompanyMapper::getInstance($this->adapter);
542
        $companyMapper = CompanyMapper::getInstance($this->adapter);
540
        $company = $companyMapper->fetchOneByUuid($id);
543
        $company = $companyMapper->fetchOneByUuidAndNetworkId($id, $currentUser->network_id);
541
        if(!$company) {
544
        if(!$company) {
542
            $data = [
545
            $data = [
Línea 613... Línea 616...
613
    public function leaveAction()
616
    public function leaveAction()
614
    {
617
    {
615
        $flashMessenger = $this->plugin('FlashMessenger');
618
        $flashMessenger = $this->plugin('FlashMessenger');
616
        $currentUserPlugin = $this->plugin('currentUserPlugin');
619
        $currentUserPlugin = $this->plugin('currentUserPlugin');
617
        $currentUser = $currentUserPlugin->getUser();
620
        $currentUser = $currentUserPlugin->getUser();
-
 
621
 
Línea 618... Línea 622...
618
        
622
        
619
        $request = $this->getRequest();
623
        $request = $this->getRequest();
620
        if($request->isPost()) {
624
        if($request->isPost()) {
621
            $id = $this->params()->fromRoute('id');
625
            $id = $this->params()->fromRoute('id');
Línea 630... Línea 634...
630
                ]);
634
                ]);
Línea 631... Línea 635...
631
                
635
                
Línea 632... Línea 636...
632
            }
636
            }
633
            
637
            
Línea 634... Línea 638...
634
            $companyMapper = CompanyMapper::getInstance($this->adapter);
638
            $companyMapper = CompanyMapper::getInstance($this->adapter);
635
            $company = $companyMapper->fetchOneByUuid($id);
639
            $company = $companyMapper->fetchOneByUuidAndNetworkId($id, $currentUser->network_id);
636
            
640
            
637
            if(!$company) {
641
            if(!$company) {