예제 #1
0
 public function executeSave()
 {
     $i18n = new sfI18N();
     $i18n->initialize($this->getContext());
     $i18n->setCulture($this->getUser()->getCulture());
     $action_i18n = $i18n->globalMessageFormat->format('save as new');
     $action_type = $this->getRequestParameter('action_type');
     #$c = new Criteria();
     #$c->add(RegTestPeriodPeer::REG_PERIOD_ID, $this->getRequestParameter('reg_period_id'));
     #$reg_test_period = RegTestPeriodPeer::doSelectOne($c);
     $reg_test_period = new RegTestPeriod();
     $reg_test_period->setName($this->getRequestParameter('name'));
     $reg_test_period->setRegPeriodId($this->getRequestParameter('reg_period_id'));
     $reg_test_period->save();
     $test_schedule = new TestSchedule();
     $test_schedule->setRegTestPeriod($reg_test_period);
     #$test_schedule->setTestSubjectId($this->getRequestParameter('test_subject_id'));
     $test_schedule->setLocationId($this->getRequestParameter('location_id'));
     if ($this->getRequestParameter('start')) {
         $test_schedule->setStart($this->getRequestParameter('start'));
     }
     if ($this->hasRequestParameter('end')) {
         $test_schedule->setEnd($this->getRequestParameter('end'));
     }
     $test_schedule->save();
     return $this->redirect('test_schedule/list');
 }
예제 #2
0
 public function addRegTestPeriod(RegTestPeriod $l)
 {
     $this->collRegTestPeriods[] = $l;
     $l->setRegPeriod($this);
 }