CC-3590: Calendar GUI->DJ user should not be able to invoke "Add Show" window

- fixed
This commit is contained in:
James 2012-04-09 12:19:22 -04:00
parent 6785a373a1
commit b32e463350
3 changed files with 65 additions and 55 deletions

View File

@ -90,6 +90,9 @@ class ScheduleController extends Zend_Controller_Action
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id);
if($user->isUserType(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)){
$this->view->preloadShowForm = true;
}
$this->view->headScript()->appendScript("var weekStart = ".Application_Model_Preference::GetWeekStartDay().";");
}
@ -615,9 +618,11 @@ class ScheduleController extends Zend_Controller_Action
}
public function getFormAction(){
if($user->isUserType(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)){
Application_Model_Schedule::createNewFormSections($this->view);
$this->view->form = $this->view->render('schedule/add-show-form.phtml');
}
}
public function editShowInstanceAction(){
$js = $this->_getParam('data');

View File

@ -1,5 +1,7 @@
<form id="add-show-form" method="post" action="" style="display:none;">
<?php echo $this->render('schedule/add-show-form.phtml') ?>
<?php if($this->preloadShowForm){
echo $this->render('schedule/add-show-form.phtml');
}?>
</form>
<div id='schedule_calendar' class="ui-widget-content block-shadow padded omega-block"></div>

View File

@ -20,7 +20,6 @@ function scheduleRefetchEvents(json) {
}
function openAddShowForm() {
if($("#add-show-form").length == 1) {
if( ($("#add-show-form").css('display')=='none')) {
$("#add-show-form").show();
@ -99,7 +98,10 @@ function pad(number, length) {
return str;
}
function dayClick(date, allDay, jsEvent, view) {
function dayClick(date, allDay, jsEvent, view){
// The show from will be preloaded if the user is admin or program manager.
// Hence, if the user if DJ then it won't open anything.
if($.trim($("#add-show-form").html()) != ""){
var now, today, selected, chosenDate, chosenTime;
now = adjustDateToServerDate(new Date(), serverTimezoneOffset);
@ -155,6 +157,7 @@ function dayClick(date, allDay, jsEvent, view) {
openAddShowForm();
}
}
}
function viewDisplay( view ) {