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

@ -256,6 +256,12 @@ class Application_Model_ShowInstance {
if ($today_timestamp > $newStartsDateTime->getTimestamp()) {
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()) {