can schedule/remove playlists from a show instance.
This commit is contained in:
parent
51b6a79f6f
commit
12cd80fe13
|
@ -279,15 +279,11 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
public function scheduleShowDialogAction()
|
public function scheduleShowDialogAction()
|
||||||
{
|
{
|
||||||
$showInstanceId = $this->_getParam('id');
|
$showInstanceId = $this->_getParam('id');
|
||||||
|
$this->sched_sess->showInstanceId = $showInstanceId;
|
||||||
|
|
||||||
$show = new ShowInstance($showInstanceId);
|
$show = new ShowInstance($showInstanceId);
|
||||||
|
$start_timestamp = $show->getShowStart();
|
||||||
$start_timestamp = $this->_getParam('start');
|
$end_timestamp = $show->getShowEnd();
|
||||||
$end_timestamp = $this->_getParam('end');
|
|
||||||
|
|
||||||
$this->sched_sess->showId = $showId;
|
|
||||||
$this->sched_sess->showStart = $start_timestamp;
|
|
||||||
$this->sched_sess->showEnd = $end_timestamp;
|
|
||||||
|
|
||||||
$start = explode(" ", $start_timestamp);
|
$start = explode(" ", $start_timestamp);
|
||||||
$end = explode(" ", $end_timestamp);
|
$end = explode(" ", $end_timestamp);
|
||||||
|
@ -295,16 +291,11 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$endTime = explode(":", $end[1]);
|
$endTime = explode(":", $end[1]);
|
||||||
$dateInfo = getDate(strtotime($start_timestamp));
|
$dateInfo = getDate(strtotime($start_timestamp));
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$this->view->showContent = $show->getShowContent();
|
||||||
|
$this->view->timeFilled = $show->getTimeScheduled();
|
||||||
$user = new User($userInfo->id, $userInfo->type);
|
|
||||||
$show = new Show($user, $showId);
|
|
||||||
|
|
||||||
$this->view->showContent = $show->getShowContent($start_timestamp);
|
|
||||||
$this->view->timeFilled = $show->getTimeScheduled($start_timestamp, $end_timestamp);
|
|
||||||
$this->view->showName = $show->getName();
|
$this->view->showName = $show->getName();
|
||||||
$this->view->showLength = $show->getShowLength($start_timestamp, $end_timestamp);
|
$this->view->showLength = $show->getShowLength();
|
||||||
$this->view->percentFilled = Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp);
|
$this->view->percentFilled = $show->getPercentScheduledInRange();
|
||||||
|
|
||||||
$this->view->wday = $dateInfo['weekday'];
|
$this->view->wday = $dateInfo['weekday'];
|
||||||
$this->view->month = $dateInfo['month'];
|
$this->view->month = $dateInfo['month'];
|
||||||
|
@ -314,7 +305,6 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
|
|
||||||
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
|
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
|
||||||
$this->view->dialog = $this->view->render('schedule/schedule-show-dialog.phtml');
|
$this->view->dialog = $this->view->render('schedule/schedule-show-dialog.phtml');
|
||||||
|
|
||||||
unset($this->view->showContent);
|
unset($this->view->showContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ class Show {
|
||||||
$showHost->save();
|
$showHost->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->populateShowUntilLastGeneratedDate($showId);
|
Show::populateShowUntilLastGeneratedDate($showId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteShow($timestamp, $dayId=NULL) {
|
public function deleteShow($timestamp, $dayId=NULL) {
|
||||||
|
@ -374,6 +374,11 @@ class ShowInstance {
|
||||||
return $showInstance->getDbShowId();
|
return $showInstance->getDbShowId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getName() {
|
||||||
|
$show = CcShowQuery::create()->findPK($this->getShowId());
|
||||||
|
return $show->getDbName();
|
||||||
|
}
|
||||||
|
|
||||||
public function getShowStart() {
|
public function getShowStart() {
|
||||||
$showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId);
|
$showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId);
|
||||||
return $showInstance->getDbStarts();
|
return $showInstance->getDbStarts();
|
||||||
|
@ -478,6 +483,7 @@ class ShowInstance {
|
||||||
|
|
||||||
$sched = new ScheduleGroup();
|
$sched = new ScheduleGroup();
|
||||||
$lastGroupId = $this->getLastGroupId();
|
$lastGroupId = $this->getLastGroupId();
|
||||||
|
$pos = $this->getNextPos();
|
||||||
|
|
||||||
if(is_null($lastGroupId)) {
|
if(is_null($lastGroupId)) {
|
||||||
|
|
||||||
|
@ -578,7 +584,7 @@ class ShowInstance {
|
||||||
$start_timestamp = $this->getShowStart();
|
$start_timestamp = $this->getShowStart();
|
||||||
$end_timestamp = $this->getShowEnd();
|
$end_timestamp = $this->getShowEnd();
|
||||||
|
|
||||||
Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp);
|
return Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getShowLength(){
|
public function getShowLength(){
|
||||||
|
|
|
@ -32,7 +32,7 @@ CREATE FUNCTION show_content() RETURNS trigger AS
|
||||||
BEGIN
|
BEGIN
|
||||||
IF(TG_OP=''DELETE'') THEN
|
IF(TG_OP=''DELETE'') THEN
|
||||||
UPDATE cc_show_schedule SET position = (position - 1)
|
UPDATE cc_show_schedule SET position = (position - 1)
|
||||||
WHERE (show_id = old.show_id AND show_day = old.show_day AND position > old.position);
|
WHERE (instance_id = old.instance_id AND position > old.position);
|
||||||
END IF;
|
END IF;
|
||||||
RETURN NULL;
|
RETURN NULL;
|
||||||
END;
|
END;
|
||||||
|
|
Loading…
Reference in New Issue