From ac86fc50e8642a555da1476632e4cb3ca09a3ddd Mon Sep 17 00:00:00 2001 From: Naomi Date: Thu, 10 Feb 2011 11:25:28 -0500 Subject: [PATCH] add show button only appears for admin users --- .../controllers/ScheduleController.php | 4 +++ .../views/scripts/schedule/index.phtml | 28 ++----------------- .../schedule/full-calendar-functions.js | 2 +- 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/application/controllers/ScheduleController.php b/application/controllers/ScheduleController.php index 31150f5a5..4e584d726 100644 --- a/application/controllers/ScheduleController.php +++ b/application/controllers/ScheduleController.php @@ -95,6 +95,10 @@ class ScheduleController extends Zend_Controller_Action $this->view->repeats = $formRepeats; $this->view->who = $formWho; $this->view->style = $formStyle; + + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new User($userInfo->id); + $this->view->isAdmin = $user->isAdmin(); } public function eventFeedAction() diff --git a/application/views/scripts/schedule/index.phtml b/application/views/scripts/schedule/index.phtml index be67d9afc..3aad9bd0e 100644 --- a/application/views/scripts/schedule/index.phtml +++ b/application/views/scripts/schedule/index.phtml @@ -1,27 +1,5 @@ - +isAdmin) : ?> + render('schedule/add-show-form.phtml') ?> +
diff --git a/public/js/airtime/schedule/full-calendar-functions.js b/public/js/airtime/schedule/full-calendar-functions.js index 9c1d1f4ac..d5e0e5926 100644 --- a/public/js/airtime/schedule/full-calendar-functions.js +++ b/public/js/airtime/schedule/full-calendar-functions.js @@ -53,7 +53,7 @@ function viewDisplay( view ) { } - if($('.fc-header-left tbody td').length === 5) { + if($("#add-show-form").length == 1 && $('.fc-header-left tbody td').length === 5) { $('.fc-header-left tbody tr:first') .append('') .append('Show')