CC-3174 : showbuilder

fixing bug moving item to beginning of show
This commit is contained in:
Naomi Aro 2012-02-17 12:19:42 +01:00
parent ac11d8bcf6
commit 09ae26a531
2 changed files with 26 additions and 6 deletions

View File

@ -93,10 +93,14 @@ class ShowbuilderController extends Zend_Controller_Action
catch (OutDatedScheduleException $e) {
$this->view->error = $e->getMessage();
Logging::log($e->getMessage());
Logging::log("{$e->getFile()}");
Logging::log("{$e->getLine()}");
}
catch (Exception $e) {
$this->view->error = $e->getMessage();
Logging::log($e->getMessage());
Logging::log("{$e->getFile()}");
Logging::log("{$e->getLine()}");
}
$this->view->data = $json;
@ -114,10 +118,14 @@ class ShowbuilderController extends Zend_Controller_Action
catch (OutDatedScheduleException $e) {
$this->view->error = $e->getMessage();
Logging::log($e->getMessage());
Logging::log("{$e->getFile()}");
Logging::log("{$e->getLine()}");
}
catch (Exception $e) {
$this->view->error = $e->getMessage();
Logging::log($e->getMessage());
Logging::log("{$e->getFile()}");
Logging::log("{$e->getLine()}");
}
}
@ -134,10 +142,14 @@ class ShowbuilderController extends Zend_Controller_Action
catch (OutDatedScheduleException $e) {
$this->view->error = $e->getMessage();
Logging::log($e->getMessage());
Logging::log("{$e->getFile()}");
Logging::log("{$e->getLine()}");
}
catch (Exception $e) {
$this->view->error = $e->getMessage();
Logging::log($e->getMessage());
Logging::log("{$e->getFile()}");
Logging::log("{$e->getLine()}");
}
$this->view->data = $json;

View File

@ -139,7 +139,7 @@ class Application_Model_Scheduler {
//selected empty row to add after
else {
$instance = CcShowInstancesQuery::create()->findPK($schedule["instance"], $this->con);
$nextStartDT = $showInstance->getDbStarts(null);
$nextStartDT = $instance->getDbStarts(null);
}
$currTs = intval($instance->getDbLastScheduled("U")) ? : 0;
@ -276,14 +276,22 @@ class Application_Model_Scheduler {
Logging::log("After {$afterItems[0]["id"]}");
$selected = CcScheduleQuery::create()->findPk($selectedItems[0]["id"], $this->con);
$after = CcScheduleQuery::create()->findPk($afterItems[0]["id"], $this->con);
if (is_null($selected) || is_null($after)) {
if (is_null($selected)) {
throw new OutDatedScheduleException("The schedule you're viewing is out of date!");
}
$selectedInstance = $selected->getCcShowInstances($this->con);
$afterInstance = $after->getCcShowInstances($this->con);
if (intval($afterItems[0]["id"]) === 0) {
$afterInstance = CcShowInstancesQuery::create()->findPK($afterItems[0]["instance"], $this->con);
}
else {
$after = CcScheduleQuery::create()->findPk($afterItems[0]["id"], $this->con);
if (is_null($after)) {
throw new OutDatedScheduleException("The schedule you're viewing is out of date!");
}
$afterInstance = $after->getCcShowInstances($this->con);
}
if (is_null($selectedInstance) || is_null($afterInstance)) {
throw new OutDatedScheduleException("The schedule you're viewing is out of date!");