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("