CC-2289:Differentiate between time and duration

- End date and time is added
- duration field is readonly now and is autocalculated
- now playing duration field format is changed( 0h 0m 0s )
- removed millisecond from start and end time in now playing
This commit is contained in:
james 2011-06-03 14:53:01 -04:00
parent 143e68bd56
commit 1dabbacca2
7 changed files with 207 additions and 32 deletions

View file

@ -423,7 +423,9 @@ class ScheduleController extends Zend_Controller_Action
$formWhen->populate(array('add_show_start_date' => $show->getStartDate(),
'add_show_start_time' => DateHelper::removeSecondsFromTime($show->getStartTime()),
'add_show_duration' => $show->getDuration(),
'add_show_end_date_no_repeat' => $show->getEndDate(),
'add_show_end_time' => DateHelper::removeSecondsFromTime($show->getEndTime()),
'add_show_duration' => $show->getDuration(true),
'add_show_repeats' => $show->isRepeating() ? 1 : 0));
if ($show->isStartDateTimeInPast()){
@ -541,7 +543,23 @@ class ScheduleController extends Zend_Controller_Action
if($when) {
$when = $formWhen->checkReliantFields($data, $startDateModified);
}
// format add_show_duration value to hh:mm so it can be compatible with
// existing code
$hPos = strpos($data["add_show_duration"], 'h');
$mPos = strpos($data["add_show_duration"], 'm');
$hValue = 0;
$mValue = 0;
if($hPos !== false){
$hValue = trim(substr($data["add_show_duration"], 0, $hPos));
}
if($mPos !== false){
$mValue = trim(substr($data["add_show_duration"], $hPos+1, -1 ));
}
$data["add_show_duration"] = $hValue.":".$mValue;
if($data["add_show_repeats"]) {
$repeats = $formRepeats->isValid($data);
if($repeats) {