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:
parent
4ca60ca676
commit
ec2f36efa8
2 changed files with 12 additions and 15 deletions
|
@ -343,22 +343,16 @@ class Application_Service_ShowFormService
|
||||||
*/
|
*/
|
||||||
public function getNextFutureRepeatShowTime()
|
public function getNextFutureRepeatShowTime()
|
||||||
{
|
{
|
||||||
$sql = <<<SQL
|
$ccShowInstance = CcShowInstancesQuery::create()
|
||||||
SELECT starts, ends FROM cc_show_instances
|
->filterByDbShowId($this->ccShow->getDbId())
|
||||||
WHERE ends > now() at time zone 'UTC'
|
->filterByDbModifiedInstance(false)
|
||||||
AND show_id = :showId
|
->filterByDbEnds(gmdate("Y-m-d H:i:s"), Criteria::GREATER_THAN)
|
||||||
AND modified_instance = FALSE
|
->orderByDbStarts()
|
||||||
ORDER BY starts
|
->limit(1)
|
||||||
LIMIT 1
|
->findOne();
|
||||||
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'));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$starts = new DateTime($ccShowInstance->getDbStarts(), new DateTimeZone("UTC"));
|
||||||
|
$ends = new DateTime($ccShowInstance->getDbEnds(), new DateTimeZone("UTC"));
|
||||||
$userTimezone = Application_Model_Preference::GetTimezone();
|
$userTimezone = Application_Model_Preference::GetTimezone();
|
||||||
|
|
||||||
$starts->setTimezone(new DateTimeZone($userTimezone));
|
$starts->setTimezone(new DateTimeZone($userTimezone));
|
||||||
|
|
|
@ -91,6 +91,9 @@ class Application_Service_ShowService
|
||||||
$ccSchedule->save();
|
$ccSchedule->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME);
|
||||||
|
$ccShowInstance->updateDbTimeFilled($con);
|
||||||
|
|
||||||
//delete the edited instance from the repeating sequence
|
//delete the edited instance from the repeating sequence
|
||||||
$ccShowInstanceOrig->setDbModifiedInstance(true)->save();
|
$ccShowInstanceOrig->setDbModifiedInstance(true)->save();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue