diff --git a/airtime_mvc/application/controllers/ShowbuilderController.php b/airtime_mvc/application/controllers/ShowbuilderController.php index d3e5b5400..b16717bde 100644 --- a/airtime_mvc/application/controllers/ShowbuilderController.php +++ b/airtime_mvc/application/controllers/ShowbuilderController.php @@ -22,6 +22,10 @@ class ShowbuilderController extends Zend_Controller_Action $request = $this->getRequest(); $baseUrl = $request->getBaseUrl(); + $user = Application_Model_User::GetCurrentUser(); + + $userType = $user->getType(); + $this->view->headScript()->appendScript("localStorage.setItem( 'user-type', '$userType' );"); $data = Application_Model_Preference::GetValue("library_datatable", true); if ($data != "") { @@ -60,8 +64,7 @@ class ShowbuilderController extends Zend_Controller_Action $this->view->headLink()->appendStylesheet($baseUrl.'/css/datatables/css/ColReorder.css?'.$CC_CONFIG['airtime_version']); $this->view->headScript()->appendFile($this->view->baseUrl('/js/airtime/library/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version']),'text/javascript'); - - $user = Application_Model_User::GetCurrentUser(); + $refer_sses = new Zend_Session_Namespace('referrer'); if ($request->isPost()) { diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js index a18701239..10110aa78 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js @@ -103,9 +103,12 @@ var AIRTIME = (function(AIRTIME){ }; mod.checkCancelButton = function() { - var $current = $sbTable.find(".sb-current-show.sb-allowed"); + var $current = $sbTable.find(".sb-current-show.sb-allowed"), + //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'); - if ($current.length !== 0) { + if ($current.length !== 0 && (userType === 'A' || userType === 'P')) { AIRTIME.button.enableButton("sb-button-cancel"); } else {