CC-5077: Calendar -> Context menu -> Show Content -> shows incorrect time filled on edited repeat instances

- We weren't updating the time_filled column in cc_show_instances when creating the new show
This commit is contained in:
denise 2013-04-30 15:54:04 -04:00
parent 4ca60ca676
commit ec2f36efa8
2 changed files with 12 additions and 15 deletions

View file

@ -343,22 +343,16 @@ class Application_Service_ShowFormService
*/
public function getNextFutureRepeatShowTime()
{
$sql = <<<SQL
SELECT starts, ends FROM cc_show_instances
WHERE ends > now() at time zone 'UTC'
AND show_id = :showId
AND modified_instance = FALSE
ORDER BY starts
LIMIT 1
SQL;
$result = Application_Common_Database::prepareAndExecute( $sql,
array( 'showId' => $this->ccShow->getDbId() ), 'all' );
foreach ($result as $r) {
$starts = new DateTime($r["starts"], new DateTimeZone('UTC'));
$ends = new DateTime($r["ends"], new DateTimeZone('UTC'));
}
$ccShowInstance = CcShowInstancesQuery::create()
->filterByDbShowId($this->ccShow->getDbId())
->filterByDbModifiedInstance(false)
->filterByDbEnds(gmdate("Y-m-d H:i:s"), Criteria::GREATER_THAN)
->orderByDbStarts()
->limit(1)
->findOne();
$starts = new DateTime($ccShowInstance->getDbStarts(), new DateTimeZone("UTC"));
$ends = new DateTime($ccShowInstance->getDbEnds(), new DateTimeZone("UTC"));
$userTimezone = Application_Model_Preference::GetTimezone();
$starts->setTimezone(new DateTimeZone($userTimezone));

View file

@ -91,6 +91,9 @@ class Application_Service_ShowService
$ccSchedule->save();
}
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME);
$ccShowInstance->updateDbTimeFilled($con);
//delete the edited instance from the repeating sequence
$ccShowInstanceOrig->setDbModifiedInstance(true)->save();