Example #1
0
 public function formNewProjectSubmitted(Form $form)
 {
     $values = $form->getValues();
     if ($this->user->identity->canAddProject()) {
         try {
             $project = $this->projectFacade->createProject($values, $this->me);
             $this->log($project, Activity::CREATE_PROJECT);
             $this->redirect('Project:', array('id' => $project->getId()));
         } catch (ExistingProjectException $e) {
             $this->flash($e->getMessage(), 'error');
         }
     } else {
         $this->flash('You cannot add more projects.', 'error');
         $this->redirect('this');
     }
 }