merge fixes

This commit is contained in:
Naomi 2011-01-28 11:34:57 -05:00
parent c673b12046
commit 7bd96a7bf4
2 changed files with 116 additions and 123 deletions

View File

@ -60,120 +60,120 @@ class ScheduleController extends Zend_Controller_Action
public function eventFeedAction() public function eventFeedAction()
{ {
$start = $this->_getParam('start', null); $start = $this->_getParam('start', null);
$end = $this->_getParam('end', null); $end = $this->_getParam('end', null);
$weekday = $this->_getParam('weekday', null); $weekday = $this->_getParam('weekday', null);
if(!is_null($weekday)) { if(!is_null($weekday)) {
$weekday = array($weekday); $weekday = array($weekday);
} }
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$show = new Show(new User($userInfo->id, $userInfo->type)); $show = new Show(new User($userInfo->id, $userInfo->type));
$this->view->events = $show->getFullCalendarEvents($start, $end, $weekday); $this->view->events = $show->getFullCalendarEvents($start, $end, $weekday);
} }
public function addShowDialogAction() public function addShowDialogAction()
{ {
$this->view->headScript()->appendFile('/js/fullcalendar/fullcalendar.min.js','text/javascript'); $this->view->headScript()->appendFile('/js/fullcalendar/fullcalendar.min.js','text/javascript');
$this->view->headScript()->appendFile('/js/colorpicker/js/colorpicker.js','text/javascript'); $this->view->headScript()->appendFile('/js/colorpicker/js/colorpicker.js','text/javascript');
$this->view->headScript()->appendFile('/js/airtime/schedule/full-calendar-functions.js','text/javascript'); $this->view->headScript()->appendFile('/js/airtime/schedule/full-calendar-functions.js','text/javascript');
$this->view->headScript()->appendFile('/js/airtime/schedule/add-show.js','text/javascript'); $this->view->headScript()->appendFile('/js/airtime/schedule/add-show.js','text/javascript');
$this->view->headLink()->appendStylesheet('/css/fullcalendar.css'); $this->view->headLink()->appendStylesheet('/css/fullcalendar.css');
$this->view->headLink()->appendStylesheet('/css/colorpicker/css/colorpicker.css'); $this->view->headLink()->appendStylesheet('/css/colorpicker/css/colorpicker.css');
$this->view->headLink()->appendStylesheet('/css/add-show.css'); $this->view->headLink()->appendStylesheet('/css/add-show.css');
$this->view->headLink()->appendStylesheet('/css/pro_dropdown_3.css'); $this->view->headLink()->appendStylesheet('/css/pro_dropdown_3.css');
$this->view->headLink()->appendStylesheet('/css/styles.css'); $this->view->headLink()->appendStylesheet('/css/styles.css');
$request = $this->getRequest(); $request = $this->getRequest();
$formWhat = new Application_Form_AddShowWhat(); $formWhat = new Application_Form_AddShowWhat();
$formWhat->removeDecorator('DtDdWrapper'); $formWhat->removeDecorator('DtDdWrapper');
$formWho = new Application_Form_AddShowWho(); $formWho = new Application_Form_AddShowWho();
$formWho->removeDecorator('DtDdWrapper'); $formWho->removeDecorator('DtDdWrapper');
$formWhen = new Application_Form_AddShowWhen(); $formWhen = new Application_Form_AddShowWhen();
$formWhen->removeDecorator('DtDdWrapper'); $formWhen->removeDecorator('DtDdWrapper');
$formRepeats = new Application_Form_AddShowRepeats(); $formRepeats = new Application_Form_AddShowRepeats();
$formRepeats->removeDecorator('DtDdWrapper'); $formRepeats->removeDecorator('DtDdWrapper');
$formStyle = new Application_Form_AddShowStyle(); $formStyle = new Application_Form_AddShowStyle();
$formStyle->removeDecorator('DtDdWrapper'); $formStyle->removeDecorator('DtDdWrapper');
if ($request->isPost()) { if ($request->isPost()) {
$data = $request->getPost(); $data = $request->getPost();
$what = $formWhat->isValid($data); $what = $formWhat->isValid($data);
$when = $formWhen->isValid($data); $when = $formWhen->isValid($data);
$repeats = $formRepeats->isValid($data); $repeats = $formRepeats->isValid($data);
$who = $formWho->isValid($data); $who = $formWho->isValid($data);
$style = $formStyle->isValid($data); $style = $formStyle->isValid($data);
if ($what && $when && $repeats && $who && $style) { if ($what && $when && $repeats && $who && $style) {
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$show = new Show(new User($userInfo->id, $userInfo->type)); $show = new Show(new User($userInfo->id, $userInfo->type));
$overlap = $show->addShow($data); $overlap = $show->addShow($data);
if(isset($overlap)) { if(isset($overlap)) {
$this->view->overlap = $overlap; $this->view->overlap = $overlap;
} }
else { else {
$this->_redirect('Schedule'); $this->_redirect('Schedule');
} }
} }
} }
$this->view->what = $formWhat; $this->view->what = $formWhat;
$this->view->when = $formWhen; $this->view->when = $formWhen;
$this->view->repeats = $formRepeats; $this->view->repeats = $formRepeats;
$this->view->who = $formWho; $this->view->who = $formWho;
$this->view->style = $formStyle; $this->view->style = $formStyle;
} }
public function moveShowAction() public function moveShowAction()
{ {
$deltaDay = $this->_getParam('day'); $deltaDay = $this->_getParam('day');
$deltaMin = $this->_getParam('min'); $deltaMin = $this->_getParam('min');
$showId = $this->_getParam('showId'); $showId = $this->_getParam('showId');
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$show = new Show(new User($userInfo->id, $userInfo->type)); $show = new Show(new User($userInfo->id, $userInfo->type));
$overlap = $show->moveShow($showId, $deltaDay, $deltaMin); $overlap = $show->moveShow($showId, $deltaDay, $deltaMin);
if(isset($overlap)) if(isset($overlap))
$this->view->overlap = $overlap; $this->view->overlap = $overlap;
} }
public function resizeShowAction() public function resizeShowAction()
{ {
$deltaDay = $this->_getParam('day'); $deltaDay = $this->_getParam('day');
$deltaMin = $this->_getParam('min'); $deltaMin = $this->_getParam('min');
$showId = $this->_getParam('showId'); $showId = $this->_getParam('showId');
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$show = new Show(new User($userInfo->id, $userInfo->type)); $show = new Show(new User($userInfo->id, $userInfo->type));
$overlap = $show->resizeShow($showId, $deltaDay, $deltaMin); $overlap = $show->resizeShow($showId, $deltaDay, $deltaMin);
if(isset($overlap)) if(isset($overlap))
$this->view->overlap = $overlap; $this->view->overlap = $overlap;
} }
public function deleteShowAction() public function deleteShowAction()
{ {
$showId = $this->_getParam('showId'); $showId = $this->_getParam('showId');
$date = $this->_getParam('date'); $date = $this->_getParam('date');
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id, $userInfo->type); $user = new User($userInfo->id, $userInfo->type);
$show = new Show($user, $showId); $show = new Show($user, $showId);
$show->deleteShow($date); $show->deleteShow($date);
} }
public function makeContextMenuAction() public function makeContextMenuAction()
@ -268,31 +268,28 @@ class ScheduleController extends Zend_Controller_Action
public function scheduleShowDialogAction() public function scheduleShowDialogAction()
{ {
$start_timestamp = $this->_getParam('start'); $start_timestamp = $this->_getParam('start');
$end_timestamp = $this->_getParam('end'); $end_timestamp = $this->_getParam('end');
$showId = $this->_getParam('showId'); $showId = $this->_getParam('showId');
$this->sched_sess->showId = $showId; $this->sched_sess->showId = $showId;
$this->sched_sess->showStart = $start_timestamp; $this->sched_sess->showStart = $start_timestamp;
$this->sched_sess->showEnd = $end_timestamp; $this->sched_sess->showEnd = $end_timestamp;
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id, $userInfo->type); $user = new User($userInfo->id, $userInfo->type);
$show = new Show($user, $showId); $show = new Show($user, $showId);
$this->view->playlists = $show->searchPlaylistsForShow($start_timestamp); $this->view->showContent = $show->getShowContent($start_timestamp);
$this->view->showContent = $show->getShowContent($start_timestamp);
$this->view->timeFilled = $show->getTimeScheduled($start_timestamp, $end_timestamp);
$this->view->timeFilled = $show->getTimeScheduled($start_timestamp, $end_timestamp); $this->view->showLength = $show->getShowLength($start_timestamp, $end_timestamp);
$this->view->showLength = $show->getShowLength($start_timestamp, $end_timestamp); $this->view->percentFilled = Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp);
$this->view->percentFilled = Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp);
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
$this->view->choice = $this->view->render('schedule/find-playlists.phtml'); $this->view->dialog = $this->view->render('schedule/schedule-show-dialog.phtml');
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
$this->view->dialog = $this->view->render('schedule/schedule-show-dialog.phtml'); unset($this->view->showContent);
unset($this->view->showContent);
unset($this->view->playlists);
} }
public function showListAction() public function showListAction()

View File

@ -1814,7 +1814,6 @@ class StoredFile {
$totalRows = $CC_DBC->getOne($sql); $totalRows = $CC_DBC->getOne($sql);
// Where clause // Where clause
if(isset($data["optWhere"])) { if(isset($data["optWhere"])) {
$where[] = join(" AND ", $data["optWhere"]); $where[] = join(" AND ", $data["optWhere"]);
@ -1845,18 +1844,15 @@ class StoredFile {
} }
$where[] = "(".join(" AND ", $outerCond).")"; $where[] = "(".join(" AND ", $outerCond).")";
} }
// End Where clause // End Where clause
// Order By clause // Order By clause
$orderby = array(); $orderby = array();
for($i=0; $i<$data["iSortingCols"]; $i++){ for($i=0; $i<$data["iSortingCols"]; $i++){
$orderby[] = $columnsDisplayed[$data["iSortCol_".$i]]." ".$data["sSortDir_".$i]; $orderby[] = $columnsDisplayed[$data["iSortCol_".$i]]." ".$data["sSortDir_".$i];
} }
$orderby[] = "id"; $orderby[] = "id";
$orderby = join("," , $orderby); $orderby = join("," , $orderby);
// End Order By clause // End Order By clause
//ordered by integer as expected by datatables. //ordered by integer as expected by datatables.