From 559acfd5a1067e9d7000209adaff79180b8f2651 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 15 Mar 2012 14:33:59 -0400 Subject: [PATCH] CC-3452: Live Stream: DJs assigned to the show and Program Managers should be able to control switches and able to kick out connection - refactoring code --- .../application/layouts/scripts/builder.phtml | 3 +-- .../application/layouts/scripts/layout.phtml | 3 +-- .../layouts/scripts/playouthistory.phtml | 3 +-- .../views/helpers/IsPermissionAllowed.php | 18 ------------------ 4 files changed, 3 insertions(+), 24 deletions(-) delete mode 100644 airtime_mvc/application/views/helpers/IsPermissionAllowed.php diff --git a/airtime_mvc/application/layouts/scripts/builder.phtml b/airtime_mvc/application/layouts/scripts/builder.phtml index 1293cb873..02a9b8253 100644 --- a/airtime_mvc/application/layouts/scripts/builder.phtml +++ b/airtime_mvc/application/layouts/scripts/builder.phtml @@ -13,11 +13,10 @@ versionNotify(); $sss = $this->SourceSwitchStatus(); $scs = $this->SourceConnectionStatus(); - $isPermissionAllowed = $this->IsPermissionAllowed(); ?> partial('partialviews/header.phtml', array("user" => $this->loggedInAs(), "is_trial"=>$this->isTrial(), "trial_remain"=> $this->trialRemaining(), "live_dj_switch"=>$sss['live_dj'], "live_dj_connection"=>$scs['live_dj'], "master_dj_switch"=>$sss['master_dj'], "master_dj_connection"=>$scs['master_dj'], - "scheduled_play_switch"=>$sss['scheduled_play'], "isPermissionAllowed"=>$isPermissionAllowed)) ?> + "scheduled_play_switch"=>$sss['scheduled_play'])) ?> navigation()->menu()->setPartial($partial); ?> diff --git a/airtime_mvc/application/layouts/scripts/layout.phtml b/airtime_mvc/application/layouts/scripts/layout.phtml index f2cdf2b4b..92d38eef9 100644 --- a/airtime_mvc/application/layouts/scripts/layout.phtml +++ b/airtime_mvc/application/layouts/scripts/layout.phtml @@ -14,11 +14,10 @@ versionNotify(); $sss = $this->SourceSwitchStatus(); $scs = $this->SourceConnectionStatus(); - $isPermissionAllowed = $this->IsPermissionAllowed(); ?> partial('partialviews/header.phtml', array("user" => $this->loggedInAs(), "is_trial"=>$this->isTrial(), "trial_remain"=> $this->trialRemaining(), "live_dj_switch"=>$sss['live_dj'], "live_dj_connection"=>$scs['live_dj'], "master_dj_switch"=>$sss['master_dj'], "master_dj_connection"=>$scs['master_dj'], - "scheduled_play_switch"=>$sss['scheduled_play'], "isPermissionAllowed"=>$isPermissionAllowed)) ?> + "scheduled_play_switch"=>$sss['scheduled_play'])) ?> navigation()->menu()->setPartial($partial); ?> diff --git a/airtime_mvc/application/layouts/scripts/playouthistory.phtml b/airtime_mvc/application/layouts/scripts/playouthistory.phtml index 47e01b11a..1e8028866 100644 --- a/airtime_mvc/application/layouts/scripts/playouthistory.phtml +++ b/airtime_mvc/application/layouts/scripts/playouthistory.phtml @@ -14,11 +14,10 @@ versionNotify(); $sss = $this->SourceSwitchStatus(); $scs = $this->SourceConnectionStatus(); - $isPermissionAllowed = $this->IsPermissionAllowed(); ?> partial('partialviews/header.phtml', array("user" => $this->loggedInAs(), "is_trial"=>$this->isTrial(), "trial_remain"=> $this->trialRemaining(), "live_dj_switch"=>$sss['live_dj'], "live_dj_connection"=>$scs['live_dj'], "master_dj_switch"=>$sss['master_dj'], "master_dj_connection"=>$scs['master_dj'], - "scheduled_play_switch"=>$sss['scheduled_play'], "isPermissionAllowed"=>$isPermissionAllowed)) ?> + "scheduled_play_switch"=>$sss['scheduled_play'])) ?> navigation()->menu()->setPartial($partial); ?> diff --git a/airtime_mvc/application/views/helpers/IsPermissionAllowed.php b/airtime_mvc/application/views/helpers/IsPermissionAllowed.php deleted file mode 100644 index 77d331339..000000000 --- a/airtime_mvc/application/views/helpers/IsPermissionAllowed.php +++ /dev/null @@ -1,18 +0,0 @@ -getStorage()->read(); - $user = new Application_Model_User($userInfo->id); - - $show = Application_Model_Show::GetCurrentShow(); - $show_id = isset($show['id'])?$show['id']:0; - if($user->canSchedule($show_id)){ - return true; - }else{ - return false; - } - } -} \ No newline at end of file