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); } };