From 3e560bb082d921e8e9ce7167de4710aff3252a17 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 21 Apr 2011 21:50:50 -0400 Subject: [PATCH] CC-2227: Repeating weekday show -> Add weekend -> first weekend after show does not have new shows -Should be fixed --- airtime_mvc/application/models/Shows.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/airtime_mvc/application/models/Shows.php b/airtime_mvc/application/models/Shows.php index ed3f076a2..a0a5ffbd7 100644 --- a/airtime_mvc/application/models/Shows.php +++ b/airtime_mvc/application/models/Shows.php @@ -283,6 +283,7 @@ class Show { $showId = $this->getId(); $sql = "SELECT last_show FROM cc_show_days" ." WHERE show_id = $showId"; + ." ORDER BY last_show DESC"; $endDate = $CC_DBC->GetOne($sql); @@ -367,7 +368,8 @@ class Show { $showId = $this->getId(); $sql = "SELECT first_show FROM cc_show_days" - ." WHERE show_id = $showId"; + ." WHERE show_id = $showId" + ." ORDER BY first_show"; $firstDate = $CC_DBC->GetOne($sql); @@ -661,16 +663,7 @@ class Show { $showId = $ccShow->getDbId(); $show = new Show($showId); - //If show is a new show (not updated), then get - //isRecorded from POST data. Otherwise get it from - //the database since the user is not allowed to - //update this option. - if ($data['add_show_id'] == -1){ - $isRecorded = ($data['add_show_record']) ? 1 : 0; - } else { - $isRecorded = $show->isRecorded(); - } - + $isRecorded = ($data['add_show_record']) ? 1 : 0; if ($data['add_show_id'] != -1){ Show::deletePossiblyInvalidInstances($data, $show, $endDate, $isRecorded, $repeatType);