Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 5050 Rev 6749
Línea 7... Línea 7...
7
declare(strict_types=1);
7
declare(strict_types=1);
Línea 8... Línea 8...
8
 
8
 
Línea 9... Línea 9...
9
namespace LeadersLinked\Controller;
9
namespace LeadersLinked\Controller;
10
 
10
 
11
use Laminas\Db\Adapter\AdapterInterface;
11
use Laminas\Db\Adapter\AdapterInterface;
12
use Laminas\Cache\Storage\Adapter\AbstractAdapter;
12
use LeadersLinked\Cache\CacheInterface;
13
use Laminas\Mvc\Controller\AbstractActionController;
13
use Laminas\Mvc\Controller\AbstractActionController;
14
use Laminas\Log\LoggerInterface;
14
use Laminas\Log\LoggerInterface;
15
use Laminas\View\Model\ViewModel;
15
use Laminas\View\Model\ViewModel;
Línea 26... Línea 26...
26
use LeadersLinked\Model\Company;
26
use LeadersLinked\Model\Company;
27
use LeadersLinked\Model\CompanyUser;
27
use LeadersLinked\Model\CompanyUser;
28
use LeadersLinked\Mapper\QueryMapper;
28
use LeadersLinked\Mapper\QueryMapper;
29
use LeadersLinked\Mapper\NotificationMapper;
29
use LeadersLinked\Mapper\NotificationMapper;
30
use LeadersLinked\Model\Network;
30
use LeadersLinked\Model\Network;
-
 
31
use LeadersLinked\Library\Functions;
Línea 31... Línea 32...
31
 
32
 
32
class CompanyController extends AbstractActionController
33
class CompanyController extends AbstractActionController
33
{
34
{
34
    /**
35
    /**
Línea 38... Línea 39...
38
    private $adapter;
39
    private $adapter;
Línea 39... Línea 40...
39
    
40
    
40
    
41
    
41
    /**
42
    /**
42
     *
43
     *
43
     * @var AbstractAdapter
44
     * @var CacheInterface
Línea 44... Línea 45...
44
     */
45
     */
45
    private $cache;
46
    private $cache;
Línea 58... Línea 59...
58
    private $config;
59
    private $config;
Línea 59... Línea 60...
59
    
60
    
60
    /**
61
    /**
61
     *
62
     *
62
     * @param AdapterInterface $adapter
63
     * @param AdapterInterface $adapter
63
     * @param AbstractAdapter $cache
64
     * @param CacheInterface $cache
64
     * @param LoggerInterface $logger
65
     * @param LoggerInterface $logger
65
     * @param array $config
66
     * @param array $config
66
     */
67
     */
67
    public function __construct($adapter, $cache , $logger,  $config)
68
    public function __construct($adapter, $cache , $logger,  $config)
Línea 469... Línea 470...
469
        $currentUserPlugin = $this->plugin('currentUserPlugin');
470
        $currentUserPlugin = $this->plugin('currentUserPlugin');
470
        $currentUser = $currentUserPlugin->getUser();
471
        $currentUser = $currentUserPlugin->getUser();
Línea 471... Línea 472...
471
        
472
        
472
        
473
        
473
        if($request->isPost()) {
474
        if($request->isPost()) {
Línea 474... Línea 475...
474
            $flash =  filter_var($this->params()->fromPost('flash', 'false'), FILTER_SANITIZE_STRING);
475
            $flash = Functions::sanitizeFilterString($this->params()->fromPost('flash', 'false'));
475
            $flash = $flash === 'true'? true: false;
476
            $flash = $flash === 'true'? true: false;
476
            
477
            
Línea 567... Línea 568...
567
        $currentUserPlugin = $this->plugin('currentUserPlugin');
568
        $currentUserPlugin = $this->plugin('currentUserPlugin');
568
        $currentUser = $currentUserPlugin->getUser();
569
        $currentUser = $currentUserPlugin->getUser();
Línea 569... Línea 570...
569
        
570
        
570
        
571
        
571
        if($request->isPost()) {
572
        if($request->isPost()) {
Línea 572... Línea 573...
572
            $flash =  filter_var($this->params()->fromPost('flash', 'false'), FILTER_SANITIZE_STRING);
573
            $flash =  Functions::sanitizeFilterString($this->params()->fromPost('flash', 'false'));
573
            $flash = $flash === 'true'? true: false;
574
            $flash = $flash === 'true'? true: false;
Línea 624... Línea 625...
624
 
625
 
625
        
626
        
626
        $request = $this->getRequest();
627
        $request = $this->getRequest();
627
        if($request->isPost()) {
628
        if($request->isPost()) {
628
            $id = $this->params()->fromRoute('id');
629
            $id = $this->params()->fromRoute('id');
Línea 629... Línea 630...
629
            $flash =  filter_var($this->params()->fromPost('flash', 'false'), FILTER_SANITIZE_STRING);
630
            $flash =  Functions::sanitizeFilterString($this->params()->fromPost('flash', 'false'));
630
            $flash = $flash === 'true'? true: false;
631
            $flash = $flash === 'true'? true: false;
Línea 722... Línea 723...
722
        $currentUser = $currentUserPlugin->getUser();
723
        $currentUser = $currentUserPlugin->getUser();
Línea 723... Línea 724...
723
        
724
        
724
        $request = $this->getRequest();
725
        $request = $this->getRequest();
725
        if($request->isPost()) {
726
        if($request->isPost()) {
726
            $id = $this->params()->fromRoute('id');
727
            $id = $this->params()->fromRoute('id');
727
            $flash =  filter_var($this->params()->fromPost('flash', 'false'), FILTER_SANITIZE_STRING);
728
            $flash =  Functions::sanitizeFilterString($this->params()->fromPost('flash', 'false'));
Línea 728... Línea 729...
728
            $flash = $flash === 'true'? true: false;
729
            $flash = $flash === 'true'? true: false;
729
            
730
            
730
            if(!$id) {
731
            if(!$id) {
Línea 816... Línea 817...
816
        $currentUser = $currentUserPlugin->getUser();
817
        $currentUser = $currentUserPlugin->getUser();
Línea 817... Línea 818...
817
        
818
        
818
        $request = $this->getRequest();
819
        $request = $this->getRequest();
819
        if($request->isPost()) {
820
        if($request->isPost()) {
820
            $id = $this->params()->fromRoute('id');
821
            $id = $this->params()->fromRoute('id');
821
            $flash =  filter_var($this->params()->fromPost('flash', 'false'), FILTER_SANITIZE_STRING);
822
            $flash =  Functions::sanitizeFilterString($this->params()->fromPost('flash', 'false'));
Línea 822... Línea 823...
822
            $flash = $flash === 'true'? true: false;
823
            $flash = $flash === 'true'? true: false;
823
            
824
            
824
            if(!$id) {
825
            if(!$id) {
Línea 913... Línea 914...
913
        $currentUser = $currentUserPlugin->getUser();
914
        $currentUser = $currentUserPlugin->getUser();
Línea 914... Línea 915...
914
        
915
        
915
        $request = $this->getRequest();
916
        $request = $this->getRequest();
916
        if($request->isPost()) {
917
        if($request->isPost()) {
917
            $id = $this->params()->fromRoute('id');
918
            $id = $this->params()->fromRoute('id');
918
            $flash =  filter_var($this->params()->fromPost('flash', 'false'), FILTER_SANITIZE_STRING);
919
            $flash =  Functions::sanitizeFilterString($this->params()->fromPost('flash', 'false'));
Línea 919... Línea 920...
919
            $flash = $flash === 'true'? true: false;
920
            $flash = $flash === 'true'? true: false;
920
            
921
            
921
            if(!$id) {
922
            if(!$id) {
Línea 1003... Línea 1004...
1003
        $currentUser = $currentUserPlugin->getUser();
1004
        $currentUser = $currentUserPlugin->getUser();
Línea 1004... Línea 1005...
1004
        
1005
        
1005
        $request = $this->getRequest();
1006
        $request = $this->getRequest();
1006
        if($request->isPost()) {
1007
        if($request->isPost()) {
1007
            $id = $this->params()->fromRoute('id');
1008
            $id = $this->params()->fromRoute('id');
1008
            $flash =  filter_var($this->params()->fromPost('flash', 'false'), FILTER_SANITIZE_STRING);
1009
            $flash =  Functions::sanitizeFilterString($this->params()->fromPost('flash', 'false'));
Línea 1009... Línea 1010...
1009
            $flash = $flash === 'true'? true: false;
1010
            $flash = $flash === 'true'? true: false;
1010
            
1011
            
1011
            if(!$id) {
1012
            if(!$id) {
Línea 1131... Línea 1132...
1131
                    
1132
                    
1132
                }
1133
                }
Línea 1133... Línea 1134...
1133
            }
1134
            }
1134
            
1135
            
Línea 1135... Línea 1136...
1135
            if($isJson) {
1136
            if($isJson) {
Línea 1222... Línea 1223...
1222
                    
1223
                    
1223
                }
1224
                }
Línea 1224... Línea 1225...
1224
            }
1225
            }
1225
            
1226
            
Línea 1226... Línea 1227...
1226
            if($isJson) {
1227
            if($isJson) {
Línea 1311... Línea 1312...
1311
                    
1312
                    
1312
                }
1313
                }
Línea 1313... Línea 1314...
1313
            }
1314
            }
1314
            
1315
            
Línea 1315... Línea 1316...
1315
            if($isJson) {
1316
            if($isJson) {
Línea 1426... Línea 1427...
1426
                    
1427
                    
1427
                }
1428
                }
Línea 1428... Línea 1429...
1428
            }
1429
            }
1429
            
1430
            
1430
            if($isJson) {
1431
            if($isJson) {
Línea 1431... Línea 1432...
1431
                $search = trim(filter_var($this->params()->fromQuery('search', ''), FILTER_SANITIZE_STRING));
1432
                $search = Functions::sanitizeFilterString($this->params()->fromQuery('search', ''));
1432
                $queryMapper = QueryMapper::getInstance($this->adapter);
1433
                $queryMapper = QueryMapper::getInstance($this->adapter);
1433
                
1434