From ff5aebfd6b862675c9e081e3f6d704e263c1de61 Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Mon, 14 May 2012 15:06:56 +0200 Subject: [PATCH] CC-3817 : Should use soundcloud icon for recorded & uploaded shows in timeline for past shows to match calendar --- airtime_mvc/application/models/Schedule.php | 4 +++- airtime_mvc/application/models/ShowBuilder.php | 6 ++++++ airtime_mvc/public/js/airtime/showbuilder/builder.js | 8 ++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 97d8c9f03..e00c48f74 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -246,7 +246,7 @@ class Application_Model_Schedule { si.starts AS si_starts, si.ends AS si_ends, si.time_filled AS si_time_filled, si.record AS si_record, si.rebroadcast AS si_rebroadcast, si.instance_id AS parent_show, - si.id AS si_id, si.last_scheduled AS si_last_scheduled, + si.id AS si_id, si.last_scheduled AS si_last_scheduled, si.file_id AS si_file_id, sched.starts AS sched_starts, sched.ends AS sched_ends, sched.id AS sched_id, sched.cue_in AS cue_in, sched.cue_out AS cue_out, @@ -274,6 +274,8 @@ class Application_Model_Schedule { } $sql .= " ORDER BY si.starts, sched.starts;"; + + Logging::debug($sql); $rows = $con->query($sql)->fetchAll(); return $rows; diff --git a/airtime_mvc/application/models/ShowBuilder.php b/airtime_mvc/application/models/ShowBuilder.php index cc3844f6d..cdb4e1e1b 100644 --- a/airtime_mvc/application/models/ShowBuilder.php +++ b/airtime_mvc/application/models/ShowBuilder.php @@ -175,6 +175,12 @@ class Application_Model_ShowBuilder { } else if (intval($p_item["si_record"]) === 1) { $row["record"] = true; + + if (Application_Model_Preference::GetUploadToSoundcloudOption()) { + $file = Application_Model_StoredFile::Recall($p_item["si_file_id"]); + $sid = $file->getSoundCloudId(); + $row["soundcloud_id"] = $sid; + } } if ($startsEpoch < $this->epoch_now && $endsEpoch > $this->epoch_now) { diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js index 212416e9f..242121d80 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js @@ -339,7 +339,8 @@ var AIRTIME = (function(AIRTIME){ r,g,b,a, $nRow = $(nRow), $image, - $div; + $div, + headerIcon; fnPrepareSeparatorRow = function fnPrepareSeparatorRow(sRowContent, sClass, iNodeIndex) { @@ -364,8 +365,11 @@ var AIRTIME = (function(AIRTIME){ cl = 'sb-header'; if (aData.record === true) { + + headerIcon = (aData.soundcloud_id > 0) ? "soundcloud" : "recording"; + $div = $("
", { - "class": "small-icon recording" + "class": "small-icon " + headerIcon }); $node.append($div); }