CC-4071: Prevent shows from overlapping on drag and drop in calendar

-done
This commit is contained in:
denise 2012-07-05 11:01:48 -04:00
parent ae08c54689
commit 771974433b
2 changed files with 7 additions and 1 deletions

View File

@ -913,7 +913,7 @@ class Application_Model_Schedule {
}
}
public static function checkOverlappingShows($show_start, $show_end, $update=false, $instanceId=false) {
public static function checkOverlappingShows($show_start, $show_end, $update=false, $instanceId=null) {
global $CC_CONFIG;
$overlapping = false;

View File

@ -257,6 +257,12 @@ class Application_Model_ShowInstance {
return "Can't move show into past";
}
//check if show is overlapping
$overlapping = Application_Model_Schedule::checkOverlappingShows($newStartsDateTime, $newEndsDateTime, true, $this->getShowInstanceId());
if ($overlapping) {
return "Cannot schedule overlapping shows";
}
if ($this->isRecorded()) {
//rebroadcasts should start at max 1 hour after a recorded show has ended.