Example #1
0
 public function executeSetDefaultPhases(sfWebRequest $request)
 {
     if ($phase = Doctrine_Core::getTable('Phases')->find($request->getParameter('phase_id'))) {
         foreach (explode("\n", $phase->getDefaultValues()) as $v) {
             if (strlen(trim($v)) > 0) {
                 $p = new ProjectsPhases();
                 $p->setName($v)->setProjectsId($request->getParameter('projects_id'));
                 if ($status = app::getDefaultValueByTable('PhasesStatus')) {
                     $p->setPhasesStatusId($status);
                 }
                 $p->save();
             }
         }
     }
     $this->redirect('projectsPhases/index?projects_id=' . $request->getParameter('projects_id'));
 }