예제 #1
0
 public function addShowAction()
 {
     $js = $this->_getParam('data');
     $data = array();
     //need to convert from serialized jQuery array.
     foreach ($js as $j) {
         $data[$j["name"]] = $j["value"];
     }
     $data['add_show_hosts'] = $this->_getParam('hosts');
     $data['add_show_day_check'] = $this->_getParam('days');
     if ($data['add_show_day_check'] == "") {
         $data['add_show_day_check'] = null;
     }
     $validateStartDate = true;
     $success = Application_Model_Schedule::addUpdateShow($data, $this, $validateStartDate);
     if ($success) {
         $this->view->addNewShow = true;
         $this->view->newForm = $this->view->render('schedule/add-show-form.phtml');
         Logging::debug("Show creation succeeded");
     } else {
         $this->view->addNewShow = true;
         $this->view->form = $this->view->render('schedule/add-show-form.phtml');
         Logging::debug("Show creation failed");
     }
 }