From c45440482a6a5f8522237468034d216147e27afb Mon Sep 17 00:00:00 2001 From: drigato Date: Wed, 30 Jan 2013 08:57:59 -0500 Subject: [PATCH 1/2] CC-4887: Show whether track is scheduled in the future on Library page --- airtime_mvc/application/models/Schedule.php | 15 +++++++++++++++ airtime_mvc/application/models/StoredFile.php | 5 +++++ .../public/js/airtime/library/library.js | 19 +++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 481f22b2d..c0fd53f4b 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -20,6 +20,21 @@ SQL; return (is_numeric($count) && ($count != '0')); } + public static function getAllFutureScheduledFiles() + { + $con = Propel::getConnection(); + $sql = << now() AT TIME ZONE 'UTC' +SQL; + $files = $con->query($sql)->fetchAll(); + $real_files = array(); + foreach ($files as $f) { + $real_files[] = $f['file_id']; + } + return $real_files; + } /** * Returns data related to the scheduled items. * diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index bd50f2826..fd9c3708a 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -771,6 +771,8 @@ SQL; } $results = Application_Model_Datatables::findEntries($con, $displayColumns, $fromTable, $datatables); + + $futureScheduledFiles = Application_Model_Schedule::getAllFutureScheduledFiles(); //Used by the audio preview functionality in the library. foreach ($results['aaData'] as &$row) { @@ -812,6 +814,9 @@ SQL; if ($type == "au") { $row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION); $row['image'] = ''; + if (in_array($row['id'], $futureScheduledFiles)) { + $row['checkbox'] .= ''; + } } elseif ($type == "pl") { $row['image'] = ''; } elseif ($type == "st") { diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index ed28d0c53..c6c5f589b 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -605,6 +605,25 @@ var AIRTIME = (function(AIRTIME) { } return false; }); + + $(nRow).find(".track-future").qtip({ + content: { + text: $.i18n._("Track is scheduled in the future") + }, + position:{ + adjust: { + resize: true, + method: "flip flip" + }, + at: "right center", + my: "left top", + viewport: $(window) + }, + style: { + classes: "ui-tooltip-dark" + }, + show: 'mousedown' + }); // add a tool tip to appear when the user clicks on the type // icon. From 9d99b8ae90831d4a5eef7012dfd4b5748f7afc40 Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 30 Jan 2013 10:33:26 -0500 Subject: [PATCH 2/2] CC-4887: Show whether track is scheduled in the future on Library page --- .../public/js/airtime/library/library.js | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index c6c5f589b..4280b3b4c 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -608,21 +608,23 @@ var AIRTIME = (function(AIRTIME) { $(nRow).find(".track-future").qtip({ content: { - text: $.i18n._("Track is scheduled in the future") + text: $.i18n._("This track is scheduled in the future") }, - position:{ - adjust: { - resize: true, - method: "flip flip" - }, - at: "right center", - my: "left top", - viewport: $(window) + hide: { + delay: 500, + fixed: true }, style: { - classes: "ui-tooltip-dark" + border: { + width: 0, + radius: 4 + }, + classes: "ui-tooltip-dark ui-tooltip-rounded" + }, + position: { + my: "left bottom", + at: "right center" }, - show: 'mousedown' }); // add a tool tip to appear when the user clicks on the type