CC-5347 : isScheduled doesn't work for webstreams
This commit is contained in:
parent
a34ae69d4b
commit
4d01e3b11f
4 changed files with 43 additions and 9 deletions
|
@ -638,7 +638,10 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
public function updateFutureIsScheduledAction()
|
public function updateFutureIsScheduledAction()
|
||||||
{
|
{
|
||||||
$schedId = $this->_getParam('schedId');
|
$schedId = $this->_getParam('schedId');
|
||||||
$redrawLibTable = Application_Model_StoredFile::setIsScheduled($schedId, false);
|
|
||||||
|
$scheduleService = new Application_Service_SchedulerService();
|
||||||
|
$redrawLibTable = $scheduleService->updateFutureIsScheduled($schedId, false);
|
||||||
|
|
||||||
$this->_helper->json->sendJson(array("redrawLibTable" => $redrawLibTable));
|
$this->_helper->json->sendJson(array("redrawLibTable" => $redrawLibTable));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1325,20 +1325,14 @@ SQL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function setIsScheduled($p_scheduleItem, $p_status,
|
public static function setIsScheduled($fileId, $status) {
|
||||||
$p_fileId=null) {
|
|
||||||
|
|
||||||
if (is_null($p_fileId)) {
|
|
||||||
$fileId = Application_Model_Schedule::GetFileId($p_scheduleItem);
|
|
||||||
} else {
|
|
||||||
$fileId = $p_fileId;
|
|
||||||
}
|
|
||||||
$file = self::RecallById($fileId);
|
$file = self::RecallById($fileId);
|
||||||
$updateIsScheduled = false;
|
$updateIsScheduled = false;
|
||||||
|
|
||||||
if (!is_null($fileId) && !in_array($fileId,
|
if (!is_null($fileId) && !in_array($fileId,
|
||||||
Application_Model_Schedule::getAllFutureScheduledFiles())) {
|
Application_Model_Schedule::getAllFutureScheduledFiles())) {
|
||||||
$file->_file->setDbIsScheduled($p_status)->save();
|
$file->_file->setDbIsScheduled($status)->save();
|
||||||
$updateIsScheduled = true;
|
$updateIsScheduled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -408,6 +408,23 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
||||||
|
|
||||||
return $webstream->getDbId();
|
return $webstream->getDbId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* method is not used, webstreams aren't currently kept track of for isScheduled.
|
||||||
|
*/
|
||||||
|
public static function setIsScheduled($p_webstreamId, $p_status) {
|
||||||
|
|
||||||
|
$webstream = CcWebstreamQuery::create()->findPK($p_webstreamId);
|
||||||
|
$updateIsScheduled = false;
|
||||||
|
|
||||||
|
if (isset($webstream) && !in_array($p_webstreamId,
|
||||||
|
Application_Model_Schedule::getAllFutureScheduledWebstreams())) {
|
||||||
|
//$webstream->setDbIsScheduled($p_status)->save();
|
||||||
|
$updateIsScheduled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $updateIsScheduled;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class WebstreamNoPermissionException extends Exception {}
|
class WebstreamNoPermissionException extends Exception {}
|
||||||
|
|
|
@ -407,4 +407,24 @@ class Application_Service_SchedulerService
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TODO in the future this should probably support webstreams.
|
||||||
|
*/
|
||||||
|
public function updateFutureIsScheduled($scheduleId, $status)
|
||||||
|
{
|
||||||
|
$sched = CcScheduleQuery::create()->findPk($scheduleId);
|
||||||
|
$redraw = false;
|
||||||
|
|
||||||
|
if (isset($sched)) {
|
||||||
|
|
||||||
|
$fileId = $sched->getDbFileId();
|
||||||
|
|
||||||
|
if (isset($fileId)) {
|
||||||
|
$redraw = Application_Model_StoredFile::setIsScheduled($fileId, $status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $redraw;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue