CC-4555: Can create overlapping shows with a repeating show if another show is on the last repeating day

-fixed
This commit is contained in:
denise 2012-10-12 15:34:42 -04:00
parent 8f5830757f
commit e60a23aab4
1 changed files with 7 additions and 2 deletions

View File

@ -163,7 +163,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
} elseif (!$formData["add_show_no_end"]) { } elseif (!$formData["add_show_no_end"]) {
$popUntil = $formData["add_show_end_date"]." ".$formData["add_show_end_time"]; $popUntil = $formData["add_show_end_date"]." ".$formData["add_show_end_time"];
$populateUntilDateTime = new DateTime($popUntil, new DateTimeZone('UTC')); $populateUntilDateTime = new DateTime($popUntil);
$populateUntilDateTime->setTimezone(new DateTimeZone('UTC'));
} }
//get repeat interval //get repeat interval
@ -198,8 +199,12 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
$repeatShowStart->add(new DateInterval("P".$daysAdd."D")); $repeatShowStart->add(new DateInterval("P".$daysAdd."D"));
$repeatShowEnd->add(new DateInterval("P".$daysAdd."D")); $repeatShowEnd->add(new DateInterval("P".$daysAdd."D"));
} }
/* Here we are checking each repeating show by
* the show day.
* (i.e: every wednesday, then every thursday)
*/
while ($repeatShowStart->getTimestamp() < $populateUntilDateTime->getTimestamp()) { while ($repeatShowStart->getTimestamp() < $populateUntilDateTime->getTimestamp()) {
if (!$formData['add_show_id']) { if ($formData['add_show_id'] == -1) {
//this is a new show //this is a new show
$overlapping = Application_Model_Schedule::checkOverlappingShows( $overlapping = Application_Model_Schedule::checkOverlappingShows(
$repeatShowStart, $repeatShowEnd); $repeatShowStart, $repeatShowEnd);