CC-2336: Some Show Editing Features Seem to have been lost
-fixed shows in the past being edited!
This commit is contained in:
parent
413c752b22
commit
308efaeadc
|
@ -887,6 +887,9 @@ class Show {
|
||||||
$sql = "SELECT timestamp '{$start}' + interval '{$duration}'";
|
$sql = "SELECT timestamp '{$start}' + interval '{$duration}'";
|
||||||
$end = $CC_DBC->GetOne($sql);
|
$end = $CC_DBC->GetOne($sql);
|
||||||
|
|
||||||
|
$date = new DateHelper();
|
||||||
|
$currentTimestamp = $date->getTimestamp();
|
||||||
|
|
||||||
$show = new Show($show_id);
|
$show = new Show($show_id);
|
||||||
if ($show->hasInstance()){
|
if ($show->hasInstance()){
|
||||||
$ccShowInstance = $show->getInstance();
|
$ccShowInstance = $show->getInstance();
|
||||||
|
@ -896,8 +899,8 @@ class Show {
|
||||||
$ccShowInstance = new CcShowInstances();
|
$ccShowInstance = new CcShowInstances();
|
||||||
$newInstance = true;
|
$newInstance = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($start > $currentTimestamp){
|
if ($newInstance || $ccShowInstance->getDbStarts() > $currentTimestamp){
|
||||||
$ccShowInstance->setDbShowId($show_id);
|
$ccShowInstance->setDbShowId($show_id);
|
||||||
$ccShowInstance->setDbStarts($start);
|
$ccShowInstance->setDbStarts($start);
|
||||||
$ccShowInstance->setDbEnds($end);
|
$ccShowInstance->setDbEnds($end);
|
||||||
|
@ -912,9 +915,6 @@ class Show {
|
||||||
$showInstance->correctScheduleStartTimes();
|
$showInstance->correctScheduleStartTimes();
|
||||||
}
|
}
|
||||||
|
|
||||||
$date = new DateHelper();
|
|
||||||
$currentTimestamp = $date->getTimestamp();
|
|
||||||
|
|
||||||
$sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id={$show_id}";
|
$sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id={$show_id}";
|
||||||
$rebroadcasts = $CC_DBC->GetAll($sql);
|
$rebroadcasts = $CC_DBC->GetAll($sql);
|
||||||
|
|
||||||
|
@ -960,6 +960,9 @@ class Show {
|
||||||
$rebroadcasts = $CC_DBC->GetAll($sql);
|
$rebroadcasts = $CC_DBC->GetAll($sql);
|
||||||
$show = new Show($show_id);
|
$show = new Show($show_id);
|
||||||
|
|
||||||
|
$date = new DateHelper();
|
||||||
|
$currentTimestamp = $date->getTimestamp();
|
||||||
|
|
||||||
while(strtotime($next_date) <= strtotime($end_timestamp) && (strtotime($last_show) > strtotime($next_date) || is_null($last_show))) {
|
while(strtotime($next_date) <= strtotime($end_timestamp) && (strtotime($last_show) > strtotime($next_date) || is_null($last_show))) {
|
||||||
|
|
||||||
$start = $next_date;
|
$start = $next_date;
|
||||||
|
@ -967,9 +970,6 @@ class Show {
|
||||||
$sql = "SELECT timestamp '{$start}' + interval '{$duration}'";
|
$sql = "SELECT timestamp '{$start}' + interval '{$duration}'";
|
||||||
$end = $CC_DBC->GetOne($sql);
|
$end = $CC_DBC->GetOne($sql);
|
||||||
|
|
||||||
$date = new DateHelper();
|
|
||||||
$currentTimestamp = $date->getTimestamp();
|
|
||||||
|
|
||||||
if ($show->hasInstanceOnDate($start)){
|
if ($show->hasInstanceOnDate($start)){
|
||||||
$ccShowInstance = $show->getInstanceOnDate($start);
|
$ccShowInstance = $show->getInstanceOnDate($start);
|
||||||
$newInstance = false;
|
$newInstance = false;
|
||||||
|
@ -977,8 +977,11 @@ class Show {
|
||||||
$ccShowInstance = new CcShowInstances();
|
$ccShowInstance = new CcShowInstances();
|
||||||
$newInstance = true;
|
$newInstance = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($start > $currentTimestamp){
|
/* When editing the start/end time of a repeating show, we don't want to
|
||||||
|
* change shows that started in the past. So check the start time.
|
||||||
|
*/
|
||||||
|
if ($newInstance || $ccShowInstance->getDbStarts() > $currentTimestamp){
|
||||||
$ccShowInstance->setDbShowId($show_id);
|
$ccShowInstance->setDbShowId($show_id);
|
||||||
$ccShowInstance->setDbStarts($start);
|
$ccShowInstance->setDbStarts($start);
|
||||||
$ccShowInstance->setDbEnds($end);
|
$ccShowInstance->setDbEnds($end);
|
||||||
|
|
Loading…
Reference in New Issue