Exemple #1
0
 public function executeShow(sfWebRequest $request)
 {
     $this->checkProject($request);
     $this->checkProfile($request, $this->ei_project);
     $this->checkSubject($request, $this->ei_project);
     $this->ei_subject_solution = Doctrine_Core::getTable('EiSubjectSolution')->find(array($request->getParameter('id')));
     $this->forward404Unless($this->ei_subject_solution);
     //Gestion des fichiers attachés
     $this->guardUser = $this->getUser()->getGuardUser();
     $this->subjectAttachments = Doctrine_Core::getTable('EiSubjectAttachment')->findBySubjectIdAndType($this->ei_subject->getId(), sfConfig::get('app_bug_attachment_solution'));
     //Formulaire d'ajout d'un nouveau attachment
     $attach = new EiSubjectAttachment();
     $attach->setSubjectId($this->ei_subject->getId());
     $attach->setType(sfConfig::get('app_bug_attachment_solution'));
     $attach->setAuthorId($this->guardUser->getId());
     $this->newAttachForm = new EiSubjectAttachmentForm($attach);
 }
Exemple #2
0
 public function executeCreate(sfWebRequest $request)
 {
     $this->forward404Unless($request->isMethod(sfRequest::POST));
     $this->guardUser = $this->getUser()->getGuardUser();
     $this->checkProject($request);
     $this->checkProfile($request, $this->ei_project);
     $this->checkSubject($request, $this->ei_project);
     $attach = new EiSubjectAttachment();
     $attach->setSubjectId($this->ei_subject->getId());
     //        $attach->setType(sfConfig::get('app_bug_attachment_description'));
     $attach->setAuthorId($this->guardUser->getId());
     $this->form = new EiSubjectAttachmentForm($attach);
     $this->processForm($request, $this->form);
     $this->subjectAttachments = Doctrine_Core::getTable('EiSubjectAttachment')->findBySubjectIdAndType($this->ei_subject->getId(), sfConfig::get('app_bug_attachment_description'));
     //Recherche des utilisateurs assignés et non-assignés au subjet
     $this->getAssignAndNonAssignUserToSubject($this->ei_subject);
     $this->projectUsers = Doctrine_Core::getTable('sfGuardUser')->getProjectUsers($this->ei_project);
     $this->newAttachForm = $this->form;
     //Redirection en cas d'echec de l'opération
     $tainted = $request->getParameter($this->form->getName());
     //On réccupère éventuellement le contexte de création du bug
     $this->ei_context = $this->ei_subject->getBugContextSubject()->getFirst();
     //Méssages sur la description du sujet
     $this->subjectMessages = Doctrine_Core::getTable('EiSubjectMessage')->getMessages($this->subject_id, sfConfig::get("app_bug_description_message"));
     switch ($tainted['type']) {
         case sfConfig::get('app_bug_attachment_description'):
             $this->setTemplate('show', 'eisubject');
             break;
         case sfConfig::get('app_bug_attachment_details'):
             $this->ei_subject_details = $this->ei_subject->getSubjectDetails();
             $this->setTemplate('show', 'eisubjectdetails');
             break;
         case sfConfig::get('app_bug_attachment_solution'):
             $this->ei_subject_solution = $this->ei_subject->getSubjectSolution();
             $this->setTemplate('show', 'eisubjectsolution');
             break;
         case sfConfig::get('app_bug_attachment_migration'):
             $this->ei_subject_migration = $this->ei_subject->getSubjectMigration();
             $this->setTemplate('show', 'eisubjectmigration');
             break;
         default:
             $this->setTemplate('show', 'eisubject');
             break;
     }
 }
Exemple #3
0
 public function executeShow(sfWebRequest $request)
 {
     $this->guardUser = $this->guard_user;
     $this->checkProject($request);
     //Récupération du projet
     $this->defaultIntervention = $this->ei_user->getDefaultIntervention($this->ei_project);
     //Récupération de l'intervention par défaut
     //Récupération du type de méssage question et réponse
     $this->msgQuestion = Doctrine_Core::getTable('EiSubjectMessageType')->findOneByNameAndProjectIdAndProjectRef("Question", $this->ei_project->getProjectId(), $this->ei_project->getRefId());
     $this->msgAnswer = Doctrine_Core::getTable('EiSubjectMessageType')->findOneByNameAndProjectIdAndProjectRef("Answer", $this->ei_project->getProjectId(), $this->ei_project->getRefId());
     $this->checkProfile($request, $this->ei_project);
     //Récupération du profil courant
     $this->checkSubject($request, $this->ei_project);
     /* Recupération de l'historique des assignations au bug */
     $this->bugAssignmentHistorys = $this->ei_subject->getAssignmentsHistory();
     $this->subjectAuthor = Doctrine_Core::getTable('sfGuardUser')->findOneById($this->ei_subject->getAuthorId());
     $this->subjectAttachments = Doctrine_Core::getTable('EiSubjectAttachment')->findBySubjectIdAndType($this->ei_subject->getId(), sfConfig::get('app_bug_attachment_description'));
     //Recherche des utilisateurs assignés et non-assignés au subjet
     $this->getAssignAndNonAssignUserToSubject($this->ei_subject);
     $this->projectUsers = Doctrine_Core::getTable('sfGuardUser')->getProjectUsers($this->ei_project);
     //Méssages sur la description du sujet
     $this->subjectMessages = Doctrine_Core::getTable('EiSubjectMessage')->getMessages($this->subject_id, sfConfig::get("app_bug_description_message"));
     //On réccupère éventuellement le contexte de création du bug
     $this->ei_context = $this->ei_subject->getBugContextSubject()->getFirst();
     //Formulaire d'ajout d'un nouveau attachment
     $attach = new EiSubjectAttachment();
     $attach->setSubjectId($this->ei_subject->getId());
     $attach->setType(sfConfig::get('app_bug_attachment_description'));
     $attach->setAuthorId($this->guardUser->getId());
     $this->newAttachForm = new EiSubjectAttachmentForm($attach);
 }