Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 16760 Rev 16766
Línea 2... Línea 2...
2
declare(strict_types=1);
2
declare(strict_types=1);
Línea 3... Línea 3...
3
 
3
 
Línea 4... Línea 4...
4
namespace LeadersLinked\Controller;
4
namespace LeadersLinked\Controller;
5
 
5
 
6
use Laminas\Db\Adapter\AdapterInterface;
6
use Laminas\Db\Adapter\AdapterInterface;
7
use Laminas\Cache\Storage\Adapter\AbstractAdapter;
7
use LeadersLinked\Cache\CacheInterface;
8
use Laminas\Mvc\Controller\AbstractActionController;
8
use Laminas\Mvc\Controller\AbstractActionController;
9
use Laminas\Log\LoggerInterface;
9
use Laminas\Log\LoggerInterface;
10
use Laminas\View\Model\ViewModel;
10
use Laminas\View\Model\ViewModel;
Línea 14... Línea 14...
14
use PhpOffice\PhpSpreadsheet\IOFactory;
14
use PhpOffice\PhpSpreadsheet\IOFactory;
15
use PhpOffice\PhpSpreadsheet\Spreadsheet;
15
use PhpOffice\PhpSpreadsheet\Spreadsheet;
16
use LeadersLinked\Form\DiscoveryContact\ContactDownloadForm;
16
use LeadersLinked\Form\DiscoveryContact\ContactDownloadForm;
17
use LeadersLinked\Mapper\DiscoveryContactMapper;
17
use LeadersLinked\Mapper\DiscoveryContactMapper;
18
use Laminas\Mvc\I18n\Translator;
18
use Laminas\Mvc\I18n\Translator;
-
 
19
use LeadersLinked\Library\Functions;
Línea 19... Línea 20...
19
 
20
 
20
 
21
 
Línea 28... Línea 29...
28
    private $adapter;
29
    private $adapter;
Línea 29... Línea 30...
29
    
30
    
30
    
31
    
31
    /**
32
    /**
32
     *
33
     *
33
     * @var AbstractAdapter
34
     * @var CacheInterface
Línea 34... Línea 35...
34
     */
35
     */
35
    private $cache;
36
    private $cache;
Línea 53... Línea 54...
53
    private $translator;
54
    private $translator;
Línea 54... Línea 55...
54
    
55
    
55
    /**
56
    /**
56
     *
57
     *
57
     * @param AdapterInterface $adapter
58
     * @param AdapterInterface $adapter
58
     * @param AbstractAdapter $cache
59
     * @param CacheInterface $cache
59
     * @param LoggerInterface $logger
60
     * @param LoggerInterface $logger
60
     * @param array $config
61
     * @param array $config
61
     * @param Translator $translator;
62
     * @param Translator $translator;
62
     */
63
     */
Línea 97... Línea 98...
97
                }
98
                }
98
            }
99
            }
Línea 99... Línea 100...
99
            
100
            
Línea 100... Línea 101...
100
            if($isJson) {
101
            if($isJson) {
101
                
102
                
102
                $first_name      = filter_var($this->params()->fromQuery('first_name', ''), FILTER_SANITIZE_STRING);
103
                $first_name      = Functions::sanitizeFilterString($this->params()->fromQuery('first_name', ''));
103
                $last_name	     = filter_var($this->params()->fromQuery('last_name', ''), FILTER_SANITIZE_STRING);
104
                $last_name	     = Functions::sanitizeFilterString($this->params()->fromQuery('last_name', ''));
104
                $corporate_email = filter_var($this->params()->fromQuery('corporate_email', ''), FILTER_SANITIZE_STRING);
105
                $corporate_email = Functions::sanitizeFilterString($this->params()->fromQuery('corporate_email', ''));
105
                $company         = filter_var($this->params()->fromQuery('company', ''), FILTER_SANITIZE_STRING);
106
                $company         = Functions::sanitizeFilterString($this->params()->fromQuery('company', ''));
106
                $position        = filter_var($this->params()->fromQuery('position', ''), FILTER_SANITIZE_STRING);
107
                $position        = Functions::sanitizeFilterString($this->params()->fromQuery('position', ''));
107
                $country	     = filter_var($this->params()->fromQuery('country', ''), FILTER_SANITIZE_STRING);
108
                $country	     = Functions::sanitizeFilterString($this->params()->fromQuery('country', ''));
108
                $state	         = filter_var($this->params()->fromQuery('state', ''), FILTER_SANITIZE_STRING);
109
                $state	         = Functions::sanitizeFilterString($this->params()->fromQuery('state', ''));
109
                $city	         = filter_var($this->params()->fromQuery('city', ''), FILTER_SANITIZE_STRING);
110
                $city	         = Functions::sanitizeFilterString($this->params()->fromQuery('city', ''));
110
                $personal_email  = filter_var($this->params()->fromQuery('personal_email', ''), FILTER_SANITIZE_STRING);
111
                $personal_email  = Functions::sanitizeFilterString($this->params()->fromQuery('personal_email', ''));
111
                $phone	         = filter_var($this->params()->fromQuery('phone', ''), FILTER_SANITIZE_STRING);
112
                $phone	         = Functions::sanitizeFilterString($this->params()->fromQuery('phone', ''));
112
                $phone_extension = filter_var($this->params()->fromQuery('phone_extension', ''), FILTER_SANITIZE_STRING);
113
                $phone_extension = Functions::sanitizeFilterString($this->params()->fromQuery('phone_extension', ''));
113
                $celular	     = filter_var($this->params()->fromQuery('celular', ''), FILTER_SANITIZE_STRING);
114
                $celular	     = Functions::sanitizeFilterString($this->params()->fromQuery('celular', ''));
Línea 114... Línea 115...
114
                $whatsapp        = filter_var($this->params()->fromQuery('whatsapp', ''), FILTER_SANITIZE_STRING);
115
                $whatsapp        = Functions::sanitizeFilterString($this->params()->fromQuery('whatsapp', ''));
115
                $linkedin	     = filter_var($this->params()->fromQuery('linkedin', ''), FILTER_SANITIZE_STRING);
116
                $linkedin	     = Functions::sanitizeFilterString($this->params()->fromQuery('linkedin', ''));
Línea 116... Línea 117...
116
                
117
                
Línea 197... Línea 198...
197
        if($request->isGet()) {
198
        if($request->isGet()) {
198
            $currentUserPlugin = $this->plugin('currentUserPlugin');
199
            $currentUserPlugin = $this->plugin('currentUserPlugin');
199
            $currentUser = $currentUserPlugin->getUser();
200
            $currentUser = $currentUserPlugin->getUser();
200
            $currentCompany = $currentUserPlugin->getCompany();
201
            $currentCompany = $currentUserPlugin->getCompany();
Línea 201... Línea 202...
201
            
202
            
202
            $first_name      = filter_var($this->params()->fromQuery('first_name', ''), FILTER_SANITIZE_STRING);
203
            $first_name      = Functions::sanitizeFilterString($this->params()->fromQuery('first_name', ''));
203
            $last_name	     = filter_var($this->params()->fromQuery('last_name', ''), FILTER_SANITIZE_STRING);
204
            $last_name	     = Functions::sanitizeFilterString($this->params()->fromQuery('last_name', ''));
204
            $corporate_email = filter_var($this->params()->fromQuery('corporate_email', ''), FILTER_SANITIZE_STRING);
205
            $corporate_email = Functions::sanitizeFilterString($this->params()->fromQuery('corporate_email', ''));
205
            $company         = filter_var($this->params()->fromQuery('company', ''), FILTER_SANITIZE_STRING);
206
            $company         = Functions::sanitizeFilterString($this->params()->fromQuery('company', ''));
206
            $position        = filter_var($this->params()->fromQuery('position', ''), FILTER_SANITIZE_STRING);
207
            $position        = Functions::sanitizeFilterString($this->params()->fromQuery('position', ''));
207
            $country	     = filter_var($this->params()->fromQuery('country', ''), FILTER_SANITIZE_STRING);
208
            $country	     = Functions::sanitizeFilterString($this->params()->fromQuery('country', ''));
208
            $state	         = filter_var($this->params()->fromQuery('state', ''), FILTER_SANITIZE_STRING);
209
            $state	         = Functions::sanitizeFilterString($this->params()->fromQuery('state', ''));
209
            $city	         = filter_var($this->params()->fromQuery('city', ''), FILTER_SANITIZE_STRING);
210
            $city	         = Functions::sanitizeFilterString($this->params()->fromQuery('city', ''));
210
            $personal_email  = filter_var($this->params()->fromQuery('personal_email', ''), FILTER_SANITIZE_STRING);
211
            $personal_email  = Functions::sanitizeFilterString($this->params()->fromQuery('personal_email', ''));
211
            $phone	         = filter_var($this->params()->fromQuery('phone', ''), FILTER_SANITIZE_STRING);
212
            $phone	         = Functions::sanitizeFilterString($this->params()->fromQuery('phone', ''));
212
            $phone_extension = filter_var($this->params()->fromQuery('phone_extension', ''), FILTER_SANITIZE_STRING);
213
            $phone_extension = Functions::sanitizeFilterString($this->params()->fromQuery('phone_extension', ''));
213
            $celular	     = filter_var($this->params()->fromQuery('celular', ''), FILTER_SANITIZE_STRING);
214
            $celular	     = Functions::sanitizeFilterString($this->params()->fromQuery('celular', ''));
214
            $whatsapp        = filter_var($this->params()->fromQuery('whatsapp', ''), FILTER_SANITIZE_STRING);
215
            $whatsapp        = Functions::sanitizeFilterString($this->params()->fromQuery('whatsapp', ''));
-
 
216
            $linkedin	     = Functions::sanitizeFilterString($this->params()->fromQuery('linkedin', ''));
Línea 215... Línea 217...
215
            $linkedin	     = filter_var($this->params()->fromQuery('linkedin', ''), FILTER_SANITIZE_STRING);
217
            $scholarship	 = Functions::sanitizeFilterString($this->params()->fromQuery('scholarship', ''));
216
                
218
                
217
            $queryMapper = QueryMapper::getInstance($this->adapter);
219
            $queryMapper = QueryMapper::getInstance($this->adapter);
218
            $select = $queryMapper->getSql()->select(DiscoveryContactMapper::_TABLE);
220
            $select = $queryMapper->getSql()->select(DiscoveryContactMapper::_TABLE);
Línea 230... Línea 232...
230
                'phone_extension',
232
                'phone_extension',
231
                'celular', 
233
                'celular', 
232
                'whatsapp', 
234
                'whatsapp', 
233
                'linkedin', 
235
                'linkedin', 
234
                'sector', 
236
                'sector', 
-
 
237
                'scholarship',
235
                'added_on'
238
                'added_on'
236
            ]);
239
            ]);
Línea 237... Línea 240...
237
                
240
                
238
            if($first_name) {
241
            if($first_name) {
Línea 275... Línea 278...
275
                $select->where->like('whatsapp', '%'.$whatsapp.'%');
278
                $select->where->like('whatsapp', '%'.$whatsapp.'%');
276
            }
279
            }
277
            if($linkedin) {
280
            if($linkedin) {
278
                $select->where->like('linkedin', '%'.$linkedin.'%');
281
                $select->where->like('linkedin', '%'.$linkedin.'%');
279
            }
282
            }
-
 
283
            if($scholarship) {
-
 
284
               // scholarship
-
 
285
            }
Línea 280... Línea 286...
280
 
286
 
281
            $spreadsheet = new Spreadsheet();
287
            $spreadsheet = new Spreadsheet();
Línea 282... Línea 288...
282
            $spreadsheet->getProperties()->setTitle('Relevamiento de Contactos');
288
            $spreadsheet->getProperties()->setTitle('Relevamiento de Contactos');
Línea 311... Línea 317...
311
                        $this->translator->translate('LABEL_PHONE_EXTENSION'),
317
                        $this->translator->translate('LABEL_PHONE_EXTENSION'),
312
                        $this->translator->translate('LABEL_CELULAR'),
318
                        $this->translator->translate('LABEL_CELULAR'),
313
                        $this->translator->translate('LABEL_WHATSAPP'),
319
                        $this->translator->translate('LABEL_WHATSAPP'),
314
                        $this->translator->translate('LABEL_LINKEDIN'),
320
                        $this->translator->translate('LABEL_LINKEDIN'),
315
                        $this->translator->translate('LABEL_SECTOR'),
321
                        $this->translator->translate('LABEL_SECTOR'),
-
 
322
                        $this->translator->translate('LABEL_SCHOLARSHIP'),
316
                        $this->translator->translate('LABEL_ADDED_DATE')
323
                        $this->translator->translate('LABEL_ADDED_DATE')
317
                    ];
324
                    ];
Línea 318... Línea 325...
318
                    
325