From 28997344fc1c69eccbc7b81c99c3dbbd857d221d Mon Sep 17 00:00:00 2001 From: drigato Date: Mon, 11 May 2015 12:16:32 -0400 Subject: [PATCH] CC-5997: Tracks get scheduled outside of the show start and end time --- .../application/services/ShowService.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 0ffff6c77..a7ab3f86e 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -240,7 +240,22 @@ class Application_Service_ShowService $showData["add_show_start_date"] = $this->origCcShowDay->getLocalStartDateAndTime()->format("Y-m-d"); } - $this->adjustSchedule($showData); + // We don't want to adjust the cc_schedule times if ONLY the timezone has changed + + // adjust schedule if the show time changed AND the timezone did not change + if ($this->oldShowTimezone == $showData["add_show_timezone"] && + (substr($this->origCcShowDay->getDbStartTime(), 0, 5) != $showData["add_show_start_time"])) { + + $this->adjustSchedule($showData); + } + + // adjust the schedule if both the timezone changed AND the show time changed + if ($this->oldShowTimezone != $showData["add_show_timezone"] && + (substr($this->origCcShowDay->getDbStartTime(), 0, 5) != $showData["add_show_start_time"])) { + + $this->adjustSchedule($showData); + } + } $con->commit();