CC-2365 Shows from the past can be dragged into the future
adding a backend check if the show has started in the past.
This commit is contained in:
parent
1de4777de3
commit
02e259c0ea
|
@ -1172,7 +1172,7 @@ class Show {
|
||||||
$options["percent"] = $show_instance->getPercentScheduled();
|
$options["percent"] = $show_instance->getPercentScheduled();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($editable && strtotime($today_timestamp) < strtotime($show["starts"])) {
|
if ($editable && (strtotime($today_timestamp) < strtotime($show["starts"]))) {
|
||||||
$options["editable"] = true;
|
$options["editable"] = true;
|
||||||
$events[] = Show::makeFullCalendarEvent($show, $options);
|
$events[] = Show::makeFullCalendarEvent($show, $options);
|
||||||
}
|
}
|
||||||
|
@ -1382,16 +1382,20 @@ class ShowInstance {
|
||||||
|
|
||||||
$mins = abs($deltaMin%60);
|
$mins = abs($deltaMin%60);
|
||||||
|
|
||||||
|
$today_timestamp = date("Y-m-d H:i:s");
|
||||||
$starts = $this->getShowStart();
|
$starts = $this->getShowStart();
|
||||||
$ends = $this->getShowEnd();
|
$ends = $this->getShowEnd();
|
||||||
|
|
||||||
|
if(strtotime($today_timestamp) > strtotime($starts)) {
|
||||||
|
return "can't move a past show";
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "SELECT timestamp '{$starts}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'";
|
$sql = "SELECT timestamp '{$starts}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'";
|
||||||
$new_starts = $CC_DBC->GetOne($sql);
|
$new_starts = $CC_DBC->GetOne($sql);
|
||||||
|
|
||||||
$sql = "SELECT timestamp '{$ends}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'";
|
$sql = "SELECT timestamp '{$ends}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'";
|
||||||
$new_ends = $CC_DBC->GetOne($sql);
|
$new_ends = $CC_DBC->GetOne($sql);
|
||||||
|
|
||||||
$today_timestamp = date("Y-m-d H:i:s");
|
|
||||||
if(strtotime($today_timestamp) > strtotime($new_starts)) {
|
if(strtotime($today_timestamp) > strtotime($new_starts)) {
|
||||||
return "can't move show into past";
|
return "can't move show into past";
|
||||||
}
|
}
|
||||||
|
@ -1430,9 +1434,14 @@ class ShowInstance {
|
||||||
|
|
||||||
$mins = abs($deltaMin%60);
|
$mins = abs($deltaMin%60);
|
||||||
|
|
||||||
|
$today_timestamp = date("Y-m-d H:i:s");
|
||||||
$starts = $this->getShowStart();
|
$starts = $this->getShowStart();
|
||||||
$ends = $this->getShowEnd();
|
$ends = $this->getShowEnd();
|
||||||
|
|
||||||
|
if(strtotime($today_timestamp) > strtotime($starts)) {
|
||||||
|
return "can't resize a past show";
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "SELECT timestamp '{$ends}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'";
|
$sql = "SELECT timestamp '{$ends}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'";
|
||||||
$new_ends = $CC_DBC->GetOne($sql);
|
$new_ends = $CC_DBC->GetOne($sql);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue