예제 #1
0
 public function getQuestionsCount() {
   return TraitementAgentTable::getInstance()->createQuery('t')
     ->select('COUNT(t.id_traitement_agent)')
     ->where('t.id_qualif_agent is NULL')
     ->andWhere('t.id_agent = ?', $this->getLoggedUserId())
     ->fetchOne(array(), Doctrine_Core::HYDRATE_SINGLE_SCALAR);
 }
예제 #2
0
  public function executeNextQuestionPartial(sfWebRequest $request) {
	  $nextQuestion = TraitementAgentTable::getInstance()->createQuery('t')
		  ->where('t.id_qualif_agent is NULL')
		  ->andWhere('t.id_agent = ?', $this->getUser()->getLoggedUserId())
		  ->orderBy('t.date_creation ASC')
		  ->fetchOne();
		
		if ($nextQuestion) {
		  $this->questionForm = new QuestionForm($nextQuestion->getQuestion());
		  $this->traitementAgentForm = new TraitementAgentForm($nextQuestion);
		  return $this->renderPartial('agentQuestion', array(
		    'questionForm' => $this->questionForm,
		    'traitementAgentForm' => $this->traitementAgentForm
		  ));
		}
  }