Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6521 Rev 6547
Línea 156... Línea 156...
156
        $select = $queryMapper->getSql()->select();
156
        $select = $queryMapper->getSql()->select();
157
        $select->columns(['id']);
157
        $select->columns(['id']);
158
        $select->from(['c' => MyCoachCategoryMapper::_TABLE]);
158
        $select->from(['c' => MyCoachCategoryMapper::_TABLE]);
159
        $select->join(['cu' => MyCoachCategoryUserMapper::_TABLE], 'c.id = cu.category_id', []);
159
        $select->join(['cu' => MyCoachCategoryUserMapper::_TABLE], 'c.id = cu.category_id', []);
160
        $select->where->equalTo('cu.user_id', $user_id);
160
        $select->where->equalTo('cu.user_id', $user_id);
161
        $select->where->equalTo('c.privacy', MyCoachCategory::PRIVACY_COMPANY);
161
        //$select->where->equalTo('c.privacy', MyCoachCategory::PRIVACY_COMPANY);
162
        $select->where->equalTo('c.status', MyCoachCategory::STATUS_ACTIVE);
162
        $select->where->equalTo('c.status', MyCoachCategory::STATUS_ACTIVE);
163
        $select->where->in('cu.role', [MyCoachCategoryUser::ROLE_EDITOR, MyCoachCategoryUser::ROLE_ADMINISTRATOR]);
163
        $select->where->in('cu.role', [MyCoachCategoryUser::ROLE_EDITOR, MyCoachCategoryUser::ROLE_ADMINISTRATOR]);
Línea 164... Línea 164...
164
 
164
 
Línea 165... Línea 165...
165
        
165
        
166
        // echo $select->getSqlString($this->adapter->platform); exit;
166
        //echo $select->getSqlString($this->adapter->platform); exit;
167
        
167
        
Línea 356... Línea 356...
356
        
356
        
357
 
357
 
358
        $message_error = 'ERROR_MY_COACH_QUESTION_UNAUTHORIZED';
358
        $message_error = 'ERROR_MY_COACH_QUESTION_UNAUTHORIZED';
-
 
359
        return false;
-
 
360
    }
-
 
361
 
Línea 359... Línea 362...
359
        return false;
362
    
360
    }
363
    
361
    
364
    
362
    /**
365
    /**
Línea 378... Línea 381...
378
        } else {
381
        } else {
379
            $myCoachQuestion = $myCoachQuestionMapper->fetchOneByUuidAndNetworkId($question_id,  $network_id);
382
            $myCoachQuestion = $myCoachQuestionMapper->fetchOneByUuidAndNetworkId($question_id,  $network_id);
Línea 380... Línea 383...
380
            
383
            
Línea -... Línea 384...
-
 
384
        }
-
 
385
        
-
 
386
        
381
        }
387
        
382
        
388
        
383
        if(!$myCoachQuestion) {
389
        if(!$myCoachQuestion) {
384
            $message_error = 'ERROR_MY_COACH_QUESTION_NOT_FOUND';
390
            $message_error = 'ERROR_MY_COACH_QUESTION_NOT_FOUND';
Línea 385... Línea 391...
385
            return false;
391
            return false;
Línea 386... Línea -...
386
        }
-
 
Línea 387... Línea 392...
387
 
392
        }
388
        
393
 
Línea -... Línea 394...
-
 
394
        
389
        $category_ids = $this->getCategoryIdsWithEdition($user_id);
395
        $category_ids = $this->getCategoryIdsWithEdition($user_id);
390
        
396
        
391
        
397
 
392
 
398
        $myCoachQuestionCategoryMapper = MyCoachQuestionCategoryMapper::getInstance($this->adapter);
393
        $myCoachQuestionCategoryMapper = MyCoachQuestionCategoryMapper::getInstance($this->adapter);
399
        $records = $myCoachQuestionCategoryMapper->fetchAllByQuestionId($myCoachQuestion->id);
Línea 466... Línea 472...
466
        if(is_numeric($answer_id)) {
472
        if(is_numeric($answer_id)) {
467
            $myCoachAnswer = $myCoachAnswerMapper->fetchOne($answer_id);
473
            $myCoachAnswer = $myCoachAnswerMapper->fetchOne($answer_id);
468
        } else {
474
        } else {
469
            $myCoachAnswer = $myCoachAnswerMapper->fetchOneByUuid($answer_id);
475
            $myCoachAnswer = $myCoachAnswerMapper->fetchOneByUuid($answer_id);
470
        }
476
        }
-
 
477
 
Línea 471... Línea 478...
471
        
478
        
472
        if(!$myCoachAnswer) {
479
        if(!$myCoachAnswer) {
473
            $message_error = 'ERROR_MY_COACH_ANSWER_NOT_FOUND';
480
            $message_error = 'ERROR_MY_COACH_ANSWER_NOT_FOUND';
474
            return false;
481
            return false;
Línea 475... Línea 482...
475
        }
482
        }
476
        
483
        
Línea 477... Línea 484...
477
 
484
 
Línea 478... Línea 485...
478
        $myCoachQuestionMapper = MyCoachQuestionMapper::getInstance($this->adapter);
485
        $myCoachQuestionMapper = MyCoachQuestionMapper::getInstance($this->adapter);
479
        $myCoachQuestion = $myCoachQuestionMapper->fetchOneByIdAndNetworkId($myCoachAnswer->id,  $network_id);
486
        $myCoachQuestion = $myCoachQuestionMapper->fetchOneByIdAndNetworkId($myCoachAnswer->question_id,  $network_id);
480
 
487
 
481
        
488
        
482
        $category_ids = $this->getCategoryIdsWithEdition($user_id);
489
        $category_ids = $this->getCategoryIdsWithEdition($user_id);
483
        
490
        
484
        $myCoachCategoryUserMapper = MyCoachCategoryUserMapper::getInstance($this->adapter);
491
        $myCoachCategoryUserMapper = MyCoachCategoryUserMapper::getInstance($this->adapter);
485
        $myCoachQuestionCategoryMapper = MyCoachQuestionCategoryMapper::getInstance($this->adapter);
492
        $myCoachQuestionCategoryMapper = MyCoachQuestionCategoryMapper::getInstance($this->adapter);
486
        $records = $myCoachQuestionCategoryMapper->fetchAllByQuestionId($myCoachQuestion->id);
493
        $records = $myCoachQuestionCategoryMapper->fetchAllByQuestionId($myCoachQuestion->id);
Línea 506... Línea 513...
506
                }
513
                }
Línea 507... Línea 514...
507
      
514
      
508
            }
515
            }
Línea 509... Línea 516...
509
        }
516
        }
510
        
517
        
511
        if($ok) {
518
        if(!$ok) {
512
            $message_error = 'ERROR_MY_COACH_QUESTION_UNAUTHORIZED';
519
            $message_error = 'ERROR_MY_COACH_QUESTION_UNAUTHORIZED';
Línea 513... Línea 520...
513
            return false;
520
            return false;
Línea 518... Línea 525...
518
        } else {
525
        } else {
519
            $message_error =  'ERROR_MY_COACH_ANSWER_UNAUTHORIZED';
526
            $message_error =  'ERROR_MY_COACH_ANSWER_UNAUTHORIZED';
520
            return false;
527
            return false;
Línea 521... Línea 528...
521
            
528
            
522
        }
-
 
523
        
-
 
524
 
-
 
525
        
-
 
526
        
-
 
527
 
529
        }
528
    }
530
    }
529
}
531
}