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()
|
||||
{
|
||||
$showInstanceId = $this->_getParam('id');
|
||||
$this->sched_sess->showInstanceId = $showInstanceId;
|
||||
|
||||
$show = new ShowInstance($showInstanceId);
|
||||
|
||||
$start_timestamp = $this->_getParam('start');
|
||||
$end_timestamp = $this->_getParam('end');
|
||||
|
||||
$this->sched_sess->showId = $showId;
|
||||
$this->sched_sess->showStart = $start_timestamp;
|
||||
$this->sched_sess->showEnd = $end_timestamp;
|
||||
$start_timestamp = $show->getShowStart();
|
||||
$end_timestamp = $show->getShowEnd();
|
||||
|
||||
$start = explode(" ", $start_timestamp);
|
||||
$end = explode(" ", $end_timestamp);
|
||||
|
@ -295,16 +291,11 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$endTime = explode(":", $end[1]);
|
||||
$dateInfo = getDate(strtotime($start_timestamp));
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
|
||||
$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->showContent = $show->getShowContent();
|
||||
$this->view->timeFilled = $show->getTimeScheduled();
|
||||
$this->view->showName = $show->getName();
|
||||
$this->view->showLength = $show->getShowLength($start_timestamp, $end_timestamp);
|
||||
$this->view->percentFilled = Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp);
|
||||
$this->view->showLength = $show->getShowLength();
|
||||
$this->view->percentFilled = $show->getPercentScheduledInRange();
|
||||
|
||||
$this->view->wday = $dateInfo['weekday'];
|
||||
$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->dialog = $this->view->render('schedule/schedule-show-dialog.phtml');
|
||||
|
||||
unset($this->view->showContent);
|
||||
}
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ class Show {
|
|||
$showHost->save();
|
||||
}
|
||||
|
||||
$this->populateShowUntilLastGeneratedDate($showId);
|
||||
Show::populateShowUntilLastGeneratedDate($showId);
|
||||
}
|
||||
|
||||
public function deleteShow($timestamp, $dayId=NULL) {
|
||||
|
@ -374,6 +374,11 @@ class ShowInstance {
|
|||
return $showInstance->getDbShowId();
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
$show = CcShowQuery::create()->findPK($this->getShowId());
|
||||
return $show->getDbName();
|
||||
}
|
||||
|
||||
public function getShowStart() {
|
||||
$showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId);
|
||||
return $showInstance->getDbStarts();
|
||||
|
@ -478,6 +483,7 @@ class ShowInstance {
|
|||
|
||||
$sched = new ScheduleGroup();
|
||||
$lastGroupId = $this->getLastGroupId();
|
||||
$pos = $this->getNextPos();
|
||||
|
||||
if(is_null($lastGroupId)) {
|
||||
|
||||
|
@ -578,7 +584,7 @@ class ShowInstance {
|
|||
$start_timestamp = $this->getShowStart();
|
||||
$end_timestamp = $this->getShowEnd();
|
||||
|
||||
Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp);
|
||||
return Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp);
|
||||
}
|
||||
|
||||
public function getShowLength(){
|
||||
|
|
|
@ -32,7 +32,7 @@ CREATE FUNCTION show_content() RETURNS trigger AS
|
|||
BEGIN
|
||||
IF(TG_OP=''DELETE'') THEN
|
||||
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;
|
||||
RETURN NULL;
|
||||
END;
|
||||
|
|
Loading…
Reference in New Issue