diff --git a/Changelog b/Changelog index b979e0399..0ff1c3f4b 100644 --- a/Changelog +++ b/Changelog @@ -17,6 +17,9 @@ Highlights: - When canceling a playing show, the currently playing audio file still showed as playing. This has been fixed. - Audio files greater than 100MB were not being played. - Fixed uploading audio on Chrome 11 and higher + - Fixed various editing show problems + - Fixed airtime-pypo-stop/start causing playback problems + - Fixed incorrect information being occasionally shown in the top panel 1.8.1 - May 2, 2011 diff --git a/VERSION b/VERSION index b185f70e7..1ec57110d 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ PRODUCT_ID=Airtime -PRODUCT_RELEASE=1.9.0-devel +PRODUCT_RELEASE=1.8.2 diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 706d3082a..3ef84548e 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -53,34 +53,8 @@ class ScheduleController extends Zend_Controller_Action $this->view->headLink()->appendStylesheet($baseUrl.'/css/colorpicker/css/colorpicker.css'); $this->view->headLink()->appendStylesheet($baseUrl.'/css/add-show.css'); $this->view->headLink()->appendStylesheet($baseUrl.'/css/contextmenu.css'); - - $formWhat = new Application_Form_AddShowWhat(); - $formWho = new Application_Form_AddShowWho(); - $formWhen = new Application_Form_AddShowWhen(); - $formRepeats = new Application_Form_AddShowRepeats(); - $formStyle = new Application_Form_AddShowStyle(); - $formRecord = new Application_Form_AddShowRR(); - $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); - $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); - - $formWhat->removeDecorator('DtDdWrapper'); - $formWho->removeDecorator('DtDdWrapper'); - $formWhen->removeDecorator('DtDdWrapper'); - $formRepeats->removeDecorator('DtDdWrapper'); - $formStyle->removeDecorator('DtDdWrapper'); - $formRecord->removeDecorator('DtDdWrapper'); - - $this->view->what = $formWhat; - $this->view->when = $formWhen; - $this->view->repeats = $formRepeats; - $this->view->who = $formWho; - $this->view->style = $formStyle; - $this->view->rr = $formRecord; - $this->view->absoluteRebroadcast = $formAbsoluteRebroadcast; - $this->view->rebroadcast = $formRebroadcast; - $this->view->addNewShow = true; - - $formWhat->populate(array('add_show_id' => '-1')); + + Schedule::createNewFormSections($this->view); $userInfo = Zend_Auth::getInstance()->getStorage()->read(); $user = new User($userInfo->id); @@ -446,10 +420,14 @@ class ScheduleController extends Zend_Controller_Action 'add_show_description' => $show->getDescription())); $formWhen->populate(array('add_show_start_date' => $show->getStartDate(), - 'add_show_start_time' => Show::removeSecondsFromTime($show->getStartTime()), + 'add_show_start_time' => DateHelper::removeSecondsFromTime($show->getStartTime()), 'add_show_duration' => $show->getDuration(), 'add_show_repeats' => $show->isRepeating() ? 1 : 0)); + if ($show->isStartDateTimeInPast()){ + $formWhen->getElement('add_show_start_date')->setOptions(array('disabled' => true)); + } + $days = array(); $showDays = CcShowDaysQuery::create()->filterByDbShowId($showInstance->getShowId())->find(); foreach($showDays as $showDay){ @@ -476,7 +454,7 @@ class ScheduleController extends Zend_Controller_Action $i = 1; foreach ($rebroadcastsRelative as $rebroadcast){ $rebroadcastFormValues["add_show_rebroadcast_date_$i"] = $rebroadcast['day_offset']; - $rebroadcastFormValues["add_show_rebroadcast_time_$i"] = Show::removeSecondsFromTime($rebroadcast['start_time']); + $rebroadcastFormValues["add_show_rebroadcast_time_$i"] = DateHelper::removeSecondsFromTime($rebroadcast['start_time']); $i++; } $formRebroadcast->populate($rebroadcastFormValues); @@ -486,7 +464,7 @@ class ScheduleController extends Zend_Controller_Action $i = 1; foreach ($rebroadcastsAbsolute as $rebroadcast){ $rebroadcastAbsoluteFormValues["add_show_rebroadcast_date_absolute_$i"] = $rebroadcast['start_date']; - $rebroadcastAbsoluteFormValues["add_show_rebroadcast_time_absolute_$i"] = Show::removeSecondsFromTime($rebroadcast['start_time']); + $rebroadcastAbsoluteFormValues["add_show_rebroadcast_time_absolute_$i"] = DateHelper::removeSecondsFromTime($rebroadcast['start_time']); $i++; } $formAbsoluteRebroadcast->populate($rebroadcastAbsoluteFormValues); @@ -506,35 +484,8 @@ class ScheduleController extends Zend_Controller_Action $this->view->entries = 5; } - public function getFormAction(){ - $formWhat = new Application_Form_AddShowWhat(); - $formWho = new Application_Form_AddShowWho(); - $formWhen = new Application_Form_AddShowWhen(); - $formRepeats = new Application_Form_AddShowRepeats(); - $formStyle = new Application_Form_AddShowStyle(); - $formRecord = new Application_Form_AddShowRR(); - $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); - $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); - - $formWhat->removeDecorator('DtDdWrapper'); - $formWho->removeDecorator('DtDdWrapper'); - $formWhen->removeDecorator('DtDdWrapper'); - $formRepeats->removeDecorator('DtDdWrapper'); - $formStyle->removeDecorator('DtDdWrapper'); - $formRecord->removeDecorator('DtDdWrapper'); - - $this->view->what = $formWhat; - $this->view->when = $formWhen; - $this->view->repeats = $formRepeats; - $this->view->who = $formWho; - $this->view->style = $formStyle; - $this->view->rr = $formRecord; - $this->view->absoluteRebroadcast = $formAbsoluteRebroadcast; - $this->view->rebroadcast = $formRebroadcast; - $this->view->addNewShow = true; - - $formWhat->populate(array('add_show_id' => '-1')); - + public function getFormAction(){ + Schedule::createNewFormSections($this->view); $this->view->form = $this->view->render('schedule/add-show-form.phtml'); } @@ -548,6 +499,16 @@ class ScheduleController extends Zend_Controller_Action $data[$j["name"]] = $j["value"]; } + $show = new Show($data['add_show_id']); + + $startDateModified = true; + if ($data['add_show_id'] != -1 && !array_key_exists('add_show_start_date', $data)){ + //show is being updated and changing the start date was disabled, since the + //array key does not exist. We need to repopulate this entry from the db. + $data['add_show_start_date'] = $show->getStartDate(); + $startDateModified = false; + } + $data['add_show_hosts'] = $this->_getParam('hosts'); $data['add_show_day_check'] = $this->_getParam('days'); @@ -573,24 +534,13 @@ class ScheduleController extends Zend_Controller_Action $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); $formRebroadcast->removeDecorator('DtDdWrapper'); - $this->view->what = $formWhat; - $this->view->when = $formWhen; - $this->view->repeats = $formRepeats; - $this->view->who = $formWho; - $this->view->style = $formStyle; - $this->view->rr = $formRecord; - $this->view->absoluteRebroadcast = $formAbsoluteRebroadcast; - $this->view->rebroadcast = $formRebroadcast; - $this->view->addNewShow = true; - $what = $formWhat->isValid($data); $when = $formWhen->isValid($data); if($when) { - $when = $formWhen->checkReliantFields($data); + $when = $formWhen->checkReliantFields($data, $startDateModified); } if($data["add_show_repeats"]) { - $repeats = $formRepeats->isValid($data); if($repeats) { $repeats = $formRepeats->checkReliantFields($data); @@ -636,7 +586,6 @@ class ScheduleController extends Zend_Controller_Action //update this option. $record = false; if ($data['add_show_id'] != -1){ - $show = new Show($data['add_show_id']); $data['add_show_record'] = $show->isRecorded(); $record = $formRecord->isValid($data); $formRecord->getElement('add_show_record')->setOptions(array('disabled' => true)); @@ -650,32 +599,31 @@ class ScheduleController extends Zend_Controller_Action if ($user->isAdmin()) { Show::create($data); } - + //send back a new form for the user. - $formWhat->reset(); - $formWhat->populate(array('add_show_id' => '-1')); - - $formWho->reset(); - $formWhen->reset(); - $formWhen->populate(array('add_show_start_date' => date("Y-m-d"), - 'add_show_start_time' => '0:00', - 'add_show_duration' => '1:00')); - $formRepeats->reset(); - $formRepeats->populate(array('add_show_end_date' => date("Y-m-d"))); - - $formStyle->reset(); - $formRecord->reset(); - $formAbsoluteRebroadcast->reset(); - $formRebroadcast->reset(); + Schedule::createNewFormSections($this->view); $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); } - else { + else { + $this->view->what = $formWhat; + $this->view->when = $formWhen; + $this->view->repeats = $formRepeats; + $this->view->who = $formWho; + $this->view->style = $formStyle; + $this->view->rr = $formRecord; + $this->view->absoluteRebroadcast = $formAbsoluteRebroadcast; + $this->view->rebroadcast = $formRebroadcast; + $this->view->addNewShow = true; + //the form still needs to be "update" since //the validity test failed. if ($data['add_show_id'] != -1){ $this->view->addNewShow = false; } + if (!$startDateModified){ + $formWhen->getElement('add_show_start_date')->setOptions(array('disabled' => true)); + } $this->view->form = $this->view->render('schedule/add-show-form.phtml'); } diff --git a/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php b/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php index 062b959d2..68d4d80ad 100644 --- a/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php +++ b/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php @@ -48,8 +48,8 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm $this->getElement('add_show_rebroadcast_date_absolute_'.$i)->setErrors(array("Day must be specified")); $valid = false; } - - + + if (trim($time) == ""){ $this->getElement('add_show_rebroadcast_time_absolute_'.$i)->setErrors(array("Time must be specified")); $valid = false; @@ -60,7 +60,7 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm continue; } - $show_start_time = $formData['add_show_start_date']."".$formData['add_show_start_time']; + $show_start_time = $formData['add_show_start_date']." ".$formData['add_show_start_time']; $show_end = new DateTime($show_start_time); $duration = $formData['add_show_duration']; @@ -70,7 +70,7 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm $show_end->add(new DateInterval("PT$duration[1]M")); $show_end->add(new DateInterval("PT1H"));//min time to wait until a rebroadcast - $rebroad_start = $day."".$formData['add_show_rebroadcast_time_absolute_'.$i]; + $rebroad_start = $day." ".$formData['add_show_rebroadcast_time_absolute_'.$i]; $rebroad_start = new DateTime($rebroad_start); if($rebroad_start < $show_end) { diff --git a/airtime_mvc/application/forms/AddShowRebroadcastDates.php b/airtime_mvc/application/forms/AddShowRebroadcastDates.php index 015662463..6104d7836 100644 --- a/airtime_mvc/application/forms/AddShowRebroadcastDates.php +++ b/airtime_mvc/application/forms/AddShowRebroadcastDates.php @@ -53,8 +53,8 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm $this->getElement('add_show_rebroadcast_date_'.$i)->setErrors(array("Day must be specified")); $valid = false; } - - + + if (trim($time) == ""){ $this->getElement('add_show_rebroadcast_time_'.$i)->setErrors(array("Time must be specified")); $valid = false; @@ -68,7 +68,7 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm $days = explode(" ", $days); $day = $days[0]; - $show_start_time = $formData['add_show_start_date']."".$formData['add_show_start_time']; + $show_start_time = $formData['add_show_start_date']." ".$formData['add_show_start_time']; $show_end = new DateTime($show_start_time); $duration = $formData['add_show_duration']; @@ -78,7 +78,7 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm $show_end->add(new DateInterval("PT$duration[1]M")); $show_end->add(new DateInterval("PT1H"));//min time to wait until a rebroadcast - $rebroad_start = $formData['add_show_start_date']."".$formData['add_show_rebroadcast_time_'.$i]; + $rebroad_start = $formData['add_show_start_date']." ".$formData['add_show_rebroadcast_time_'.$i]; $rebroad_start = new DateTime($rebroad_start); $rebroad_start->add(new DateInterval("P".$day."D")); diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index 389b12989..847f26005 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -59,20 +59,22 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm } - public function checkReliantFields($formData) { + public function checkReliantFields($formData, $startDateModified) { $valid = true; $now_timestamp = date("Y-m-d H:i:s"); - $start_timestamp = $formData['add_show_start_date']."".$formData['add_show_start_time']; + $start_timestamp = $formData['add_show_start_date']." ".$formData['add_show_start_time']; $now_epoch = strtotime($now_timestamp); $start_epoch = strtotime($start_timestamp); - if($start_epoch < $now_epoch) { - $this->getElement('add_show_start_time')->setErrors(array('Cannot create show in the past')); - $valid = false; - } + if ((($formData['add_show_id'] != -1) && $startDateModified) || ($formData['add_show_id'] == -1)){ + if($start_epoch < $now_epoch) { + $this->getElement('add_show_start_time')->setErrors(array('Cannot create show in the past')); + $valid = false; + } + } if(strtotime("00:00") == strtotime($formData["add_show_duration"])) { $this->getElement('add_show_duration')->setErrors(array('Cannot have duration 00:00')); diff --git a/airtime_mvc/application/layouts/scripts/library.phtml b/airtime_mvc/application/layouts/scripts/library.phtml index 1ea03f7a8..cd55c2ec5 100644 --- a/airtime_mvc/application/layouts/scripts/library.phtml +++ b/airtime_mvc/application/layouts/scripts/library.phtml @@ -19,8 +19,8 @@