CC-3030: Repeating shows is broken in devel branch.

-working towards using only DateTime objects
This commit is contained in:
Martin Konecny 2011-11-11 14:54:08 -05:00
parent 74d3c3aebc
commit 42cde33648
7 changed files with 95 additions and 52 deletions

View file

@ -352,7 +352,10 @@ class ApiController extends Zend_Controller_Action
$now = new DateTime($today_timestamp);
$end_timestamp = $now->add(new DateInterval("PT2H"));
$end_timestamp = $end_timestamp->format("Y-m-d H:i:s");
$this->view->shows = Application_Model_Show::getShows($today_timestamp, $end_timestamp, $excludeInstance=NULL, $onlyRecord=TRUE);
$this->view->shows = Application_Model_Show::getShows(Application_Model_DateHelper::ConvertToUtcDateTime($today_timestamp, date_default_timezone_get()),
Application_Model_DateHelper::ConvertToUtcDateTime($end_timestamp, date_default_timezone_get()),
$excludeInstance=NULL, $onlyRecord=TRUE);
$this->view->is_recording = false;

View file

@ -68,8 +68,8 @@ class ScheduleController extends Zend_Controller_Action
public function eventFeedAction()
{
$start = $this->_getParam('start', null);
$end = $this->_getParam('end', null);
$start = new DateTime($this->_getParam('start', null));
$end = new DateTime($this->_getParam('end', null));
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id);
@ -355,11 +355,14 @@ class ScheduleController extends Zend_Controller_Action
$this->view->show_error = true;
return false;
}
$start_timestamp = $show->getShowStart();
$end_timestamp = $show->getShowEnd();
//check to make sure show doesn't overlap.
if(Application_Model_Show::getShows($start_timestamp, $end_timestamp, array($showInstanceId))) {
if(Application_Model_Show::getShows(new DateTime($start_timestamp, new DateTimeZone("UTC")),
new DateTime($end_timestamp, new DateTimeZone("UTC")),
array($showInstanceId))) {
$this->view->error = "cannot schedule an overlapping show.";
return;
}
@ -563,7 +566,7 @@ class ScheduleController extends Zend_Controller_Action
foreach($js as $j){
$data[$j["name"]] = $j["value"];
}
Logging::log("id:".$data['add_show_id']);
$show = new Application_Model_Show($data['add_show_id']);
$startDateModified = true;