From bb3ffce071772baba8a45c39e3882970d0bd8385 Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Mon, 17 Sep 2012 16:28:28 -0700 Subject: [PATCH 1/3] CC-3944 : Now Playing -> Time Line view: Cannot cancel record show, cancel button is disabled --- .../application/models/ShowBuilder.php | 4 ++++ .../public/js/airtime/showbuilder/builder.js | 19 ++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/models/ShowBuilder.php b/airtime_mvc/application/models/ShowBuilder.php index b73a341d0..d77fbf823 100644 --- a/airtime_mvc/application/models/ShowBuilder.php +++ b/airtime_mvc/application/models/ShowBuilder.php @@ -332,6 +332,10 @@ class Application_Model_ShowBuilder $this->getScheduledStatus($startsEpoch, $endsEpoch, $row); $this->isAllowed($p_item, $row); + if (intval($p_item["si_record"]) === 1) { + $row["record"] = true; + } + return $row; } diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js index 26c472ec0..1282e6ca5 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js @@ -112,16 +112,25 @@ var AIRTIME = (function(AIRTIME){ }; mod.checkCancelButton = function() { - var $current = $sbTable.find(".sb-current-show.sb-allowed"), + + var $current = $sbTable.find(".sb-current-show"), //this user type should be refactored into a separate users module later //when there's more time and more JS will need to know user data. - userType = localStorage.getItem('user-type'); + userType = localStorage.getItem('user-type'), + canCancel = false; - if ($current.length !== 0 && (userType === 'A' || userType === 'P')) { - AIRTIME.button.enableButton("icon-ban-circle", true); + if ($current.length !== 0 && $current.hasClass("sb-allowed")) { + canCancel = true; + } + else if ($current.length !== 0 && (userType === 'A' || userType === 'P')) { + canCancel = true; + } + + if (canCancel === true) { + AIRTIME.button.enableButton("icon-ban-circle", true); } else { - AIRTIME.button.disableButton("icon-ban-circle", true); + AIRTIME.button.disableButton("icon-ban-circle", true); } }; From a661ab885097ae2ae65f89f78f8eb9b7c7a2111d Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 17 Sep 2012 22:48:03 -0400 Subject: [PATCH 2/3] CC-4289: Airtime 2.2 upgrade script -fixed --- .../upgrades/airtime-2.2.0/data/upgrade.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/install_minimal/upgrades/airtime-2.2.0/data/upgrade.sql b/install_minimal/upgrades/airtime-2.2.0/data/upgrade.sql index 3b6bfbec6..8afb59553 100644 --- a/install_minimal/upgrades/airtime-2.2.0/data/upgrade.sql +++ b/install_minimal/upgrades/airtime-2.2.0/data/upgrade.sql @@ -13,6 +13,17 @@ INSERT INTO cc_stream_setting (keyname, value, type) VALUES ('s1_channels', 'ste INSERT INTO cc_stream_setting (keyname, value, type) VALUES ('s2_channels', 'stereo', 'string'); INSERT INTO cc_stream_setting (keyname, value, type) VALUES ('s3_channels', 'stereo', 'string'); + +--clean up database of scheduled items that weren't properly deleted in 2.1.x +--due to a bug +DELETE +FROM cc_schedule +WHERE id IN + (SELECT s.id + FROM cc_schedule s + LEFT JOIN cc_show_instances si ON s.instance_id = si.id + AND si.modified_instance = 't') + ALTER TABLE cc_files DROP CONSTRAINT cc_files_gunid_idx; From 1698aae251809b6fc55eb4808c2002da34794c25 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 18 Sep 2012 10:53:19 -0400 Subject: [PATCH 3/3] CC-4466: Buttons on Now Playing page are clickable even though they are disabled -fixed --- .../public/js/airtime/buttons/buttons.js | 7 ++++++- .../library/events/library_playlistbuilder.js | 4 ++-- .../library/events/library_showbuilder.js | 4 ++-- .../public/js/airtime/library/library.js | 4 ++-- .../public/js/airtime/showbuilder/builder.js | 18 +++++++++--------- 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/airtime_mvc/public/js/airtime/buttons/buttons.js b/airtime_mvc/public/js/airtime/buttons/buttons.js index 23a904001..a8db230b1 100644 --- a/airtime_mvc/public/js/airtime/buttons/buttons.js +++ b/airtime_mvc/public/js/airtime/buttons/buttons.js @@ -6,8 +6,11 @@ var AIRTIME = (function(AIRTIME) { } mod = AIRTIME.button; - mod.isDisabled = function(c) { + mod.isDisabled = function(c, useParent) { var button = $("." + c); + if (useParent) { + button = button.parent(); + } if (button.hasClass(DISABLED_CLASS)) { return true; @@ -25,6 +28,7 @@ var AIRTIME = (function(AIRTIME) { if (button.hasClass(DISABLED_CLASS)) { button.removeClass(DISABLED_CLASS); + button.removeAttr('disabled'); } }; @@ -37,6 +41,7 @@ var AIRTIME = (function(AIRTIME) { if (!button.hasClass(DISABLED_CLASS)) { button.addClass(DISABLED_CLASS); + button.attr('disabled', 'disabled'); } }; diff --git a/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js b/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js index 17aa3bb4e..92f0bcdbd 100644 --- a/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js +++ b/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js @@ -16,9 +16,9 @@ var AIRTIME = (function(AIRTIME) { } if (check === true) { - AIRTIME.button.enableButton("btn-group #library-plus", true); + AIRTIME.button.enableButton("btn-group #library-plus", false); } else { - AIRTIME.button.disableButton("btn-group #library-plus", true); + AIRTIME.button.disableButton("btn-group #library-plus", false); } }; diff --git a/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js b/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js index 7bddd8049..cf67419cd 100644 --- a/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js +++ b/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js @@ -16,9 +16,9 @@ var AIRTIME = (function(AIRTIME) { } if (check === true) { - AIRTIME.button.enableButton("btn-group #library-plus", true); + AIRTIME.button.enableButton("btn-group #library-plus", false); } else { - AIRTIME.button.disableButton("btn-group #library-plus", true); + AIRTIME.button.disableButton("btn-group #library-plus", false); } }; diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index 3fea72940..70bf2744b 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -138,10 +138,10 @@ var AIRTIME = (function(AIRTIME) { } if (check === true) { - AIRTIME.button.enableButton("btn-group #sb-trash", true); + AIRTIME.button.enableButton("btn-group #sb-trash", false); } else { - AIRTIME.button.disableButton("btn-group #sb-trash", true); + AIRTIME.button.disableButton("btn-group #sb-trash", false); } }; diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js index 1282e6ca5..b280460bd 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js @@ -962,16 +962,16 @@ var AIRTIME = (function(AIRTIME){ "" + "") .append("
" + - "
") .append("
" + - "
") .append("
" + - "
") .append("
" + - "
"); $toolbar.append($menu); @@ -987,7 +987,7 @@ var AIRTIME = (function(AIRTIME){ data, msg = 'Cancel Current Show?'; - if (AIRTIME.button.isDisabled('icon-ban-circle') === true) { + if (AIRTIME.button.isDisabled('icon-ban-circle', true) === true) { return; } @@ -1018,7 +1018,7 @@ var AIRTIME = (function(AIRTIME){ $toolbar.find('.icon-step-forward').parent() .click(function() { - if (AIRTIME.button.isDisabled('icon-step-forward') === true) { + if (AIRTIME.button.isDisabled('icon-step-forward', true) === true) { return; } @@ -1032,10 +1032,10 @@ var AIRTIME = (function(AIRTIME){ }); //delete overbooked tracks. - $toolbar.find('.icon-cut').parent() + $toolbar.find('.icon-cut', true).parent() .click(function() { - if (AIRTIME.button.isDisabled('icon-cut') === true) { + if (AIRTIME.button.isDisabled('icon-cut', true) === true) { return; } @@ -1055,7 +1055,7 @@ var AIRTIME = (function(AIRTIME){ $toolbar.find('.icon-trash').parent() .click(function() { - if (AIRTIME.button.isDisabled('icon-trash') === true) { + if (AIRTIME.button.isDisabled('icon-trash', true) === true) { return; }