diff --git a/airtime_mvc/application/models/ShowBuilder.php b/airtime_mvc/application/models/ShowBuilder.php index cdd7b14c1..738b2f9cc 100644 --- a/airtime_mvc/application/models/ShowBuilder.php +++ b/airtime_mvc/application/models/ShowBuilder.php @@ -344,6 +344,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/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 26c472ec0..b280460bd 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); } }; @@ -953,16 +962,16 @@ var AIRTIME = (function(AIRTIME){ "" + "") .append("
" + - "
") .append("
" + - "
") .append("
" + - "
") .append("
" + - "
"); $toolbar.append($menu); @@ -978,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; } @@ -1009,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; } @@ -1023,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; } @@ -1046,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; } 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 4f5cc398f..c27a1d563 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;