CC-3174 : showbuilder

removing columns that no longer should be in cc_schedule.

changing cc_files length column to be of type interval.

adding length formatter to showbuilder.
This commit is contained in:
Naomi Aro 2012-02-24 16:05:01 +01:00
parent 19d13889af
commit c6edfc3208
12 changed files with 101 additions and 450 deletions

View file

@ -1,5 +1,7 @@
<?php
require_once 'formatters/LengthFormatter.php';
class Application_Model_ShowBuilder {
private $timezone;
@ -41,26 +43,6 @@ class Application_Model_ShowBuilder {
$this->epoch_now = time();
}
/*
* @param DateInterval $p_interval
*
* @return string $runtime
*/
private function formatDuration($p_interval){
$hours = $p_interval->format("%h");
$mins = $p_interval->format("%i");
if( $hours == 0) {
$runtime = $p_interval->format("%i:%S");
}
else {
$runtime = $p_interval->format("%h:%I:%S");
}
return $runtime;
}
private function formatTimeFilled($p_sec) {
$formatted = "";
@ -188,13 +170,14 @@ class Application_Model_ShowBuilder {
$this->getItemStatus($p_item, $row);
$runtime = $schedStartDT->diff($schedEndDT);
$row["id"] = intval($p_item["sched_id"]);
$row["instance"] = intval($p_item["si_id"]);
$row["starts"] = $schedStartDT->format("H:i:s");
$row["ends"] = $schedEndDT->format("H:i:s");
$row["runtime"] = $this->formatDuration($runtime);
$formatter = new LengthFormatter($p_item['file_length']);
$row['runtime'] = $formatter->format();
$row["title"] = $p_item["file_track_title"];
$row["creator"] = $p_item["file_artist_name"];
$row["album"] = $p_item["file_album_title"];