From 54b6b12ec0b67a6cc81e229d8ead034b02d41c09 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 17 Sep 2012 15:41:27 -0400 Subject: [PATCH] CC-4094: Dashboard -> Source Info panel: DJ assigned to current show can turn off the Master Resouce but cannot disconnect it. - fixed --- airtime_mvc/application/controllers/DashboardController.php | 4 +--- airtime_mvc/application/models/User.php | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/airtime_mvc/application/controllers/DashboardController.php b/airtime_mvc/application/controllers/DashboardController.php index 327321383..9609a1ef8 100644 --- a/airtime_mvc/application/controllers/DashboardController.php +++ b/airtime_mvc/application/controllers/DashboardController.php @@ -25,9 +25,7 @@ class DashboardController extends Zend_Controller_Action $user = new Application_Model_User($userInfo->id); $show = Application_Model_Show::getCurrentShow(); - - $show_id = isset($show['id'])?$show['id']:0; - + $show_id = isset($show[0]['id'])?$show[0]['id']:0; $source_connected = Application_Model_Preference::GetSourceStatus($sourcename); if ($user->canSchedule($show_id) && $source_connected) { diff --git a/airtime_mvc/application/models/User.php b/airtime_mvc/application/models/User.php index d07552472..1d9d94e07 100644 --- a/airtime_mvc/application/models/User.php +++ b/airtime_mvc/application/models/User.php @@ -35,7 +35,6 @@ class Application_Model_User public function isHostOfShow($showId) { $userId = $this->_userInstance->getDbId(); - return CcShowHostsQuery::create() ->filterByDbShow($showId) ->filterByDbHost($userId)->count() > 0; @@ -63,10 +62,9 @@ class Application_Model_User if ($type === UTYPE_ADMIN || $type === UTYPE_PROGRAM_MANAGER || - CcShowHostsQuery::create()->filterByDbShow($p_showId)->filterByDbHost($this->getId())->count() > 0) { + self::isHostOfShow($p_showId)) { $result = true; } - return $result; } @@ -210,7 +208,7 @@ class Application_Model_User $this->_userInstance->delete(); } } - public function getOwnedFiles() + public function getOwnedFiles() { $user = $this->_userInstance; // do we need a find call at the end here?