From 19e52e81b547f2ec1c2423cd53ab52c688ec0cf3 Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 3 Jun 2011 14:51:17 -0400 Subject: [PATCH] cc-2351: updating a bi-weekly repeating show is incorrect -fixed --- airtime_mvc/application/models/Shows.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/models/Shows.php b/airtime_mvc/application/models/Shows.php index ca1f0847e..2340a6a1d 100644 --- a/airtime_mvc/application/models/Shows.php +++ b/airtime_mvc/application/models/Shows.php @@ -572,6 +572,16 @@ class Show { } if ($p_data['add_show_repeats']){ + if (($repeatType == 1 || $repeatType == 2) && + $p_data['add_show_start_date'] != $p_show->getStartDate()){ + + //start date has changed when repeat type is bi-weekly or monthly. + //This screws up the repeating positions of show instances, so lets + //just delete them for now. + + $p_show->deleteAllInstances(); + } + if ($p_data['add_show_start_date'] != $p_show->getStartDate() || $p_data['add_show_start_time'] != $p_show->getStartTime()){ //start date/time has changed @@ -584,12 +594,11 @@ class Show { $p_show->updateStartDateTime($p_data, $p_endDate); } - + if ($repeatType != $p_show->getRepeatType()){ //repeat type changed. $p_show->deleteAllInstances(); - } - else { + } else { //repeat type is the same, check if the days of the week are the same $repeatingDaysChanged = false; $showDaysArray = $p_show->getShowDays();