Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 221 Rev 15444
Línea 33... Línea 33...
33
use LeadersLinked\Model\UserType;
33
use LeadersLinked\Model\UserType;
34
use LeadersLinked\Model\UserPassword;
34
use LeadersLinked\Model\UserPassword;
35
use LeadersLinked\Model\SelfEvaluationForm;
35
use LeadersLinked\Model\SelfEvaluationForm;
36
use LeadersLinked\Factory\Controller\SelfEvaluationFormControllerFactory;
36
use LeadersLinked\Factory\Controller\SelfEvaluationFormControllerFactory;
37
use LeadersLinked\Form\SelfEvaluationFormForm;
37
use LeadersLinked\Form\SelfEvaluationFormForm;
38
use LeadersLinked\Mapper\CompanySelfEvaluationFormMapper;
38
use LeadersLinked\Mapper\SelfEvaluationFormMapper;
39
use LeadersLinked\Mapper\CompanyUserMapper;
39
use LeadersLinked\Mapper\CompanyUserMapper;
40
use LeadersLinked\Mapper\CompanySelfEvaluationFormUserMapper;
40
use LeadersLinked\Mapper\SelfEvaluationFormUserMapper;
41
use LeadersLinked\Model\CompanySelfEvaluationFormUser;
41
use LeadersLinked\Model\SelfEvaluationFormUser;
Línea 42... Línea 42...
42
 
42
 
43
 
43
 
44
class SelfEvaluationFormUserController extends AbstractActionController
44
class SelfEvaluationFormUserController extends AbstractActionController
Línea 131... Línea 131...
131
                    ]);
131
                    ]);
Línea 132... Línea 132...
132
                    
132
                    
Línea 133... Línea 133...
133
                }
133
                }
134
                
134
                
135
                
135
                
136
                $formMapper = CompanySelfEvaluationFormMapper::getInstance($this->adapter);
136
                $formMapper = SelfEvaluationFormMapper::getInstance($this->adapter);
137
                $form = $formMapper->fetchOneByUuid($form_uuid);
137
                $form = $formMapper->fetchOneByUuid($form_uuid);
138
                if(!$form) {
138
                if(!$form) {
Línea 164... Línea 164...
164
                
164
                
165
                if(!in_array($order_direction, ['ASC', 'DESC'])) {
165
                if(!in_array($order_direction, ['ASC', 'DESC'])) {
166
                    $order_direction = 'ASC';
166
                    $order_direction = 'ASC';
Línea 167... Línea 167...
167
                }
167
                }
Línea 168... Línea 168...
168
                
168
                
Línea 286... Línea 286...
286
        $currentCompany = $currentUserPlugin->getCompany();
286
        $currentCompany = $currentUserPlugin->getCompany();
Línea 287... Línea 287...
287
        
287
        
288
        $request    = $this->getRequest();
288
        $request    = $this->getRequest();
289
        $form_uuid  = $this->params()->fromRoute('form_id');
289
        $form_uuid  = $this->params()->fromRoute('form_id');
290
        $user_uuid  = $this->params()->fromRoute('user_id');
290
        $user_uuid  = $this->params()->fromRoute('user_id');
291
        $formMapper = CompanySelfEvaluationFormMapper::getInstance($this->adapter);
291
        $formMapper = SelfEvaluationFormMapper::getInstance($this->adapter);
292
        $form = $formMapper->fetchOneByUuid($form_uuid);
292
        $form = $formMapper->fetchOneByUuid($form_uuid);
293
        if(!$form) {
293
        if(!$form) {
294
            return new JsonModel([
294
            return new JsonModel([
295
                'success' => true,
295
                'success' => true,
Línea 326... Línea 326...
326
            ]);
326
            ]);
327
        }
327
        }
Línea 328... Línea 328...
328
        
328
        
Línea 329... Línea 329...
329
        if($request->isPost()) {
329
        if($request->isPost()) {
330
           
330
           
Línea 331... Línea 331...
331
            $formUserMapper = CompanySelfEvaluationFormUserMapper::getInstance($this->adapter);
331
            $formUserMapper = SelfEvaluationFormUserMapper::getInstance($this->adapter);
332
            $formUser = $formUserMapper->fetchAllByCompanyIdAndFormIdAndUserId($form->company_id, $form->id, $user->id);
332
            $formUser = $formUserMapper->fetchAllByCompanyIdAndFormIdAndUserId($form->company_id, $form->id, $user->id);
333
            
333
            
334
            if($formUser) {
334
            if($formUser) {
335
                return new JsonModel([
335
                return new JsonModel([
336
                    'success'   => false,
336
                    'success'   => false,
Línea 337... Línea 337...
337
                    'data'   => 'ERROR_ALREADY_USER_ACCESS_TO_FORM'
337
                    'data'   => 'ERROR_ALREADY_USER_ACCESS_TO_FORM'
338
                ]);
338
                ]);
339
            }
339
            }
340
            
340
            
Línea 341... Línea 341...
341
            $formUser = new CompanySelfEvaluationFormUser();
341
            $formUser = new SelfEvaluationFormUser();
Línea 379... Línea 379...
379
        $currentCompany = $currentUserPlugin->getCompany();
379
        $currentCompany = $currentUserPlugin->getCompany();
Línea 380... Línea 380...
380
        
380
        
381
        $request    = $this->getRequest();
381
        $request    = $this->getRequest();
382
        $form_uuid  = $this->params()->fromRoute('form_id');
382
        $form_uuid  = $this->params()->fromRoute('form_id');
383
        $user_uuid  = $this->params()->fromRoute('user_id');
383
        $user_uuid  = $this->params()->fromRoute('user_id');
Línea 384... Línea 384...
384
        $formMapper = CompanySelfEvaluationFormMapper::getInstance($this->adapter);
384
        $formMapper = SelfEvaluationFormMapper::getInstance($this->adapter);
385
        
385
        
386
        $form = $formMapper->fetchOneByUuid($form_uuid);
386
        $form = $formMapper->fetchOneByUuid($form_uuid);
387
        if(!$form) {
387
        if(!$form) {
Línea 420... Línea 420...
420
            ]);
420
            ]);
421
        }
421
        }
Línea 422... Línea 422...
422
        
422
        
Línea 423... Línea 423...
423
        if($request->isPost()) {
423
        if($request->isPost()) {
424
            
424
            
Línea 425... Línea 425...
425
            $formUserMapper = CompanySelfEvaluationFormUserMapper::getInstance($this->adapter);
425
            $formUserMapper = SelfEvaluationFormUserMapper::getInstance($this->adapter);