From 75620be7615f91ec8a0ced8c5bbba2cb72d43120 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 17 Sep 2012 16:46:51 -0400 Subject: [PATCH] remove all mosty carriage return characters --- airtime_mvc/application/common/DateHelper.php | 100 ++++++------ .../models/airtime/CcBlockcontents.php | 152 +++++++++--------- .../models/airtime/CcShowInstances.php | 54 +++---- .../include/airtime-db-install.php | 2 +- 4 files changed, 154 insertions(+), 154 deletions(-) diff --git a/airtime_mvc/application/common/DateHelper.php b/airtime_mvc/application/common/DateHelper.php index eb32c0393..c13543d8e 100644 --- a/airtime_mvc/application/common/DateHelper.php +++ b/airtime_mvc/application/common/DateHelper.php @@ -366,56 +366,56 @@ class Application_Common_DateHelper return $retVal; } - /** - * This function is used for calculations! Don't modify for display purposes! - * - * Convert playlist time value to float seconds - * - * @param string $plt - * playlist interval value (HH:mm:ss.dddddd) - * @return int - * seconds - */ - public static function playlistTimeToSeconds($plt) - { - $arr = preg_split('/:/', $plt); - if (isset($arr[2])) { - return (intval($arr[0])*60 + intval($arr[1]))*60 + floatval($arr[2]); - } - if (isset($arr[1])) { - return intval($arr[0])*60 + floatval($arr[1]); - } - - return floatval($arr[0]); - } - - - /** - * This function is used for calculations! Don't modify for display purposes! - * - * Convert float seconds value to playlist time format - * - * @param float $seconds - * @return string - * interval in playlist time format (HH:mm:ss.d) - */ - public static function secondsToPlaylistTime($p_seconds) - { - $info = explode('.', $p_seconds); - $seconds = $info[0]; - if (!isset($info[1])) { - $milliStr = 0; - } else { - $milliStr = $info[1]; - } - $hours = floor($seconds / 3600); - $seconds -= $hours * 3600; - $minutes = floor($seconds / 60); - $seconds -= $minutes * 60; - - $res = sprintf("%02d:%02d:%02d.%s", $hours, $minutes, $seconds, $milliStr); - - return $res; + /** + * This function is used for calculations! Don't modify for display purposes! + * + * Convert playlist time value to float seconds + * + * @param string $plt + * playlist interval value (HH:mm:ss.dddddd) + * @return int + * seconds + */ + public static function playlistTimeToSeconds($plt) + { + $arr = preg_split('/:/', $plt); + if (isset($arr[2])) { + return (intval($arr[0])*60 + intval($arr[1]))*60 + floatval($arr[2]); + } + if (isset($arr[1])) { + return intval($arr[0])*60 + floatval($arr[1]); + } + + return floatval($arr[0]); + } + + + /** + * This function is used for calculations! Don't modify for display purposes! + * + * Convert float seconds value to playlist time format + * + * @param float $seconds + * @return string + * interval in playlist time format (HH:mm:ss.d) + */ + public static function secondsToPlaylistTime($p_seconds) + { + $info = explode('.', $p_seconds); + $seconds = $info[0]; + if (!isset($info[1])) { + $milliStr = 0; + } else { + $milliStr = $info[1]; + } + $hours = floor($seconds / 3600); + $seconds -= $hours * 3600; + $minutes = floor($seconds / 60); + $seconds -= $minutes * 60; + + $res = sprintf("%02d:%02d:%02d.%s", $hours, $minutes, $seconds, $milliStr); + + return $res; } } diff --git a/airtime_mvc/application/models/airtime/CcBlockcontents.php b/airtime_mvc/application/models/airtime/CcBlockcontents.php index f6de2dd45..5fcfbbf24 100644 --- a/airtime_mvc/application/models/airtime/CcBlockcontents.php +++ b/airtime_mvc/application/models/airtime/CcBlockcontents.php @@ -14,82 +14,82 @@ * @package propel.generator.airtime */ class CcBlockcontents extends BaseCcBlockcontents { - /** - * Get the [optionally formatted] temporal [fadein] column value. - * - * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getDbFadein($format = "s.u") - { - return parent::getDbFadein($format); - } - - /** - * Get the [optionally formatted] temporal [fadein] column value. - * - * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getDbFadeout($format = "s.u") - { - return parent::getDbFadeout($format); - } - - /** - * - * @param String in format SS.uuuuuu, Datetime, or DateTime accepted string. - * - * @return CcBlockcontents The current object (for fluent API support) - */ - public function setDbFadein($v) - { - if ($v instanceof DateTime) { - $dt = $v; - } - else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) { - $dt = DateTime::createFromFormat("s.u", $v); - } - else { - try { - $dt = new DateTime($v); - } catch (Exception $x) { - throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x); - } - } - - $this->fadein = $dt->format('H:i:s.u'); - $this->modifiedColumns[] = CcBlockcontentsPeer::FADEIN; - - return $this; - } // setDbFadein() - - /** - * - * @param String in format SS.uuuuuu, Datetime, or DateTime accepted string. - * - * @return CcBlockcontents The current object (for fluent API support) - */ - public function setDbFadeout($v) - { - if ($v instanceof DateTime) { - $dt = $v; - } - else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) { - $dt = DateTime::createFromFormat("s.u", $v); - } - else { - try { - $dt = new DateTime($v); - } catch (Exception $x) { - throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x); - } - } - - $this->fadeout = $dt->format('H:i:s.u'); - $this->modifiedColumns[] = CcBlockcontentsPeer::FADEOUT; - - return $this; + /** + * Get the [optionally formatted] temporal [fadein] column value. + * + * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL + * @throws PropelException - if unable to parse/validate the date/time value. + */ + public function getDbFadein($format = "s.u") + { + return parent::getDbFadein($format); + } + + /** + * Get the [optionally formatted] temporal [fadein] column value. + * + * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL + * @throws PropelException - if unable to parse/validate the date/time value. + */ + public function getDbFadeout($format = "s.u") + { + return parent::getDbFadeout($format); + } + + /** + * + * @param String in format SS.uuuuuu, Datetime, or DateTime accepted string. + * + * @return CcBlockcontents The current object (for fluent API support) + */ + public function setDbFadein($v) + { + if ($v instanceof DateTime) { + $dt = $v; + } + else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) { + $dt = DateTime::createFromFormat("s.u", $v); + } + else { + try { + $dt = new DateTime($v); + } catch (Exception $x) { + throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x); + } + } + + $this->fadein = $dt->format('H:i:s.u'); + $this->modifiedColumns[] = CcBlockcontentsPeer::FADEIN; + + return $this; + } // setDbFadein() + + /** + * + * @param String in format SS.uuuuuu, Datetime, or DateTime accepted string. + * + * @return CcBlockcontents The current object (for fluent API support) + */ + public function setDbFadeout($v) + { + if ($v instanceof DateTime) { + $dt = $v; + } + else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) { + $dt = DateTime::createFromFormat("s.u", $v); + } + else { + try { + $dt = new DateTime($v); + } catch (Exception $x) { + throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x); + } + } + + $this->fadeout = $dt->format('H:i:s.u'); + $this->modifiedColumns[] = CcBlockcontentsPeer::FADEOUT; + + return $this; } // setDbFadeout() } // CcBlockcontents diff --git a/airtime_mvc/application/models/airtime/CcShowInstances.php b/airtime_mvc/application/models/airtime/CcShowInstances.php index ed598c5ee..4625d1f91 100644 --- a/airtime_mvc/application/models/airtime/CcShowInstances.php +++ b/airtime_mvc/application/models/airtime/CcShowInstances.php @@ -139,40 +139,40 @@ class CcShowInstances extends BaseCcShowInstances { $this->save($con); } - /** - * Computes the value of the aggregate column time_filled - * - * @param PropelPDO $con A connection object - * - * @return mixed The scalar result from the aggregate query - */ - public function computeDbTimeFilled(PropelPDO $con) - { - $stmt = $con->prepare('SELECT SUM(clip_length) FROM "cc_schedule" WHERE cc_schedule.INSTANCE_ID = :p1'); - $stmt->bindValue(':p1', $this->getDbId()); - $stmt->execute(); - return $stmt->fetchColumn(); - } - - /** - * Updates the aggregate column time_filled - * - * @param PropelPDO $con A connection object - */ - public function updateDbTimeFilled(PropelPDO $con) + /** + * Computes the value of the aggregate column time_filled + * + * @param PropelPDO $con A connection object + * + * @return mixed The scalar result from the aggregate query + */ + public function computeDbTimeFilled(PropelPDO $con) + { + $stmt = $con->prepare('SELECT SUM(clip_length) FROM "cc_schedule" WHERE cc_schedule.INSTANCE_ID = :p1'); + $stmt->bindValue(':p1', $this->getDbId()); + $stmt->execute(); + return $stmt->fetchColumn(); + } + + /** + * Updates the aggregate column time_filled + * + * @param PropelPDO $con A connection object + */ + public function updateDbTimeFilled(PropelPDO $con) { $timefilled = $this->computeDbTimeFilled($con); if(is_null($timefilled)){ $timefilled = "00:00:00"; - } - $this->setDbTimeFilled($timefilled); - $this->save($con); + } + $this->setDbTimeFilled($timefilled); + $this->save($con); } public function preInsert(PropelPDO $con = null) { - $now = new DateTime("now", new DateTimeZone("UTC")); - $this->setDbCreated($now); - return true; + $now = new DateTime("now", new DateTimeZone("UTC")); + $this->setDbCreated($now); + return true; } } // CcShowInstances diff --git a/install_minimal/include/airtime-db-install.php b/install_minimal/include/airtime-db-install.php index 862ce3756..3d9a80ed3 100644 --- a/install_minimal/include/airtime-db-install.php +++ b/install_minimal/include/airtime-db-install.php @@ -11,7 +11,7 @@ require_once(__DIR__.'/airtime-constants.php'); require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php'); require_once 'propel/runtime/lib/Propel.php'; -Propel::init(AirtimeInstall::GetAirtimeSrcDir()."/application/configs/airtime-conf-production.php"); +Propel::init(AirtimeInstall::GetAirtimeSrcDir()."/application/configs/airtime-conf-production.php"); echo PHP_EOL."* Database Installation".PHP_EOL;