CC-3590: Calendar GUI->DJ user should not be able to invoke "Add Show" window
- fixed
This commit is contained in:
parent
6785a373a1
commit
b32e463350
|
@ -90,6 +90,9 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$user = new Application_Model_User($userInfo->id);
|
$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().";");
|
$this->view->headScript()->appendScript("var weekStart = ".Application_Model_Preference::GetWeekStartDay().";");
|
||||||
}
|
}
|
||||||
|
@ -615,9 +618,11 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFormAction(){
|
public function getFormAction(){
|
||||||
|
if($user->isUserType(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)){
|
||||||
Application_Model_Schedule::createNewFormSections($this->view);
|
Application_Model_Schedule::createNewFormSections($this->view);
|
||||||
$this->view->form = $this->view->render('schedule/add-show-form.phtml');
|
$this->view->form = $this->view->render('schedule/add-show-form.phtml');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function editShowInstanceAction(){
|
public function editShowInstanceAction(){
|
||||||
$js = $this->_getParam('data');
|
$js = $this->_getParam('data');
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<form id="add-show-form" method="post" action="" style="display:none;">
|
<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>
|
</form>
|
||||||
|
|
||||||
<div id='schedule_calendar' class="ui-widget-content block-shadow padded omega-block"></div>
|
<div id='schedule_calendar' class="ui-widget-content block-shadow padded omega-block"></div>
|
||||||
|
|
|
@ -20,7 +20,6 @@ function scheduleRefetchEvents(json) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function openAddShowForm() {
|
function openAddShowForm() {
|
||||||
|
|
||||||
if($("#add-show-form").length == 1) {
|
if($("#add-show-form").length == 1) {
|
||||||
if( ($("#add-show-form").css('display')=='none')) {
|
if( ($("#add-show-form").css('display')=='none')) {
|
||||||
$("#add-show-form").show();
|
$("#add-show-form").show();
|
||||||
|
@ -100,6 +99,9 @@ function pad(number, length) {
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
var now, today, selected, chosenDate, chosenTime;
|
||||||
|
|
||||||
now = adjustDateToServerDate(new Date(), serverTimezoneOffset);
|
now = adjustDateToServerDate(new Date(), serverTimezoneOffset);
|
||||||
|
@ -156,6 +158,7 @@ function dayClick(date, allDay, jsEvent, view) {
|
||||||
openAddShowForm();
|
openAddShowForm();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function viewDisplay( view ) {
|
function viewDisplay( view ) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue