CC-4382: Editing the color of a repeating show gives error message

-fixed
This commit is contained in:
denise 2012-09-12 14:27:17 -04:00
parent dd68f6d945
commit 54d18b7bcd
1 changed files with 14 additions and 1 deletions
airtime_mvc/application/forms

View File

@ -202,7 +202,20 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
$repeatShowEnd->add(new DateInterval("P".$daysAdd."D"));
}
while ($repeatShowStart->getTimestamp() < $populateUntilDateTime->getTimestamp()) {
$overlapping = Application_Model_Schedule::checkOverlappingShows($repeatShowStart, $repeatShowEnd, $update, $instanceId);
//need to get each repeating show's instance id
$qry = CcShowInstancesQuery::create()
->filterByDbStarts($repeatShowStart->format('Y-m-d H:i:s'))
->filterByDbEnds($repeatShowEnd->format('Y-m-d H:i:s'))
->find();
$count = $qry->count();
if ($count > 1) {
$overlapping = true;
} elseif ($count == 1) {
$instanceId = $qry->getFirst()->getDbId();
$overlapping = Application_Model_Schedule::checkOverlappingShows($repeatShowStart, $repeatShowEnd, $update, $instanceId);
} else {
$overlapping = false;
}
if ($overlapping) {
$valid = false;
$this->getElement('add_show_duration')->setErrors(array('Cannot schedule overlapping shows'));