From 22ecc3f1fc4fa5a28f8bc17b034c2597e840945f Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 18 Jan 2013 14:28:45 -0500 Subject: [PATCH 1/2] CC-4855: System->Preferences->Fade in/out settings: Number's format is incorrect. -fixed --- airtime_mvc/application/common/DateHelper.php | 11 +++++++++++ airtime_mvc/application/models/Scheduler.php | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/airtime_mvc/application/common/DateHelper.php b/airtime_mvc/application/common/DateHelper.php index cc02544cd..8ad1e438b 100644 --- a/airtime_mvc/application/common/DateHelper.php +++ b/airtime_mvc/application/common/DateHelper.php @@ -417,5 +417,16 @@ class Application_Common_DateHelper return $res; } + + /* Returns a string of seconds converted into 'H:i:s.t' format + * + */ + public static function convertSecondsToTimeFormat($p_seconds) + { + $time = explode('.', $p_seconds); + $seconds = $time[0]; + $milliseconds = $time[1]; + return sprintf("%02d%s%02d%s%02d%s%d", floor($seconds/3600), ':', ($seconds/60)%60, ':', $seconds%60, '.', $milliseconds); + } } diff --git a/airtime_mvc/application/models/Scheduler.php b/airtime_mvc/application/models/Scheduler.php index 18716f1e9..bac2618bd 100644 --- a/airtime_mvc/application/models/Scheduler.php +++ b/airtime_mvc/application/models/Scheduler.php @@ -448,6 +448,12 @@ class Application_Model_Scheduler } else { $sched = new CcSchedule(); } + + // default fades are in seconds + // we need to convert to '00:00:00' format + $file['fadein'] = Application_Common_DateHelper::convertSecondsToTimeFormat($file['fadein']); + $file['fadeout'] = Application_Common_DateHelper::convertSecondsToTimeFormat($file['fadeout']); + $sched->setDbStarts($nextStartDT) ->setDbEnds($endTimeDT) ->setDbCueIn($file['cuein']) From ad0879996d9d55235e3f38b947bd2152f51ffbc1 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 18 Jan 2013 14:35:17 -0500 Subject: [PATCH 2/2] CC-4855: System->Preferences->Fade in/out settings: Number's format is incorrect. -use existing function to convert seconds to time format --- airtime_mvc/application/common/DateHelper.php | 11 ----------- airtime_mvc/application/models/Scheduler.php | 4 ++-- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/airtime_mvc/application/common/DateHelper.php b/airtime_mvc/application/common/DateHelper.php index 8ad1e438b..cc02544cd 100644 --- a/airtime_mvc/application/common/DateHelper.php +++ b/airtime_mvc/application/common/DateHelper.php @@ -417,16 +417,5 @@ class Application_Common_DateHelper return $res; } - - /* Returns a string of seconds converted into 'H:i:s.t' format - * - */ - public static function convertSecondsToTimeFormat($p_seconds) - { - $time = explode('.', $p_seconds); - $seconds = $time[0]; - $milliseconds = $time[1]; - return sprintf("%02d%s%02d%s%02d%s%d", floor($seconds/3600), ':', ($seconds/60)%60, ':', $seconds%60, '.', $milliseconds); - } } diff --git a/airtime_mvc/application/models/Scheduler.php b/airtime_mvc/application/models/Scheduler.php index bac2618bd..2530eb7bf 100644 --- a/airtime_mvc/application/models/Scheduler.php +++ b/airtime_mvc/application/models/Scheduler.php @@ -451,8 +451,8 @@ class Application_Model_Scheduler // default fades are in seconds // we need to convert to '00:00:00' format - $file['fadein'] = Application_Common_DateHelper::convertSecondsToTimeFormat($file['fadein']); - $file['fadeout'] = Application_Common_DateHelper::convertSecondsToTimeFormat($file['fadeout']); + $file['fadein'] = Application_Common_DateHelper::secondsToPlaylistTime($file['fadein']); + $file['fadeout'] = Application_Common_DateHelper::secondsToPlaylistTime($file['fadeout']); $sched->setDbStarts($nextStartDT) ->setDbEnds($endTimeDT)