From dc410f428920fd197b5aee70717b206f1bb2cc71 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 9 Oct 2012 14:20:00 -0400 Subject: [PATCH 1/2] CC-4528: Calendar: Can drag and drop current show into past (it's forbidden to set it by editing show) -fixed --- airtime_mvc/application/models/Show.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index ccbcc59d9..bb58409fd 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -179,14 +179,19 @@ SQL; if ($deltaDay > 0) { return "Shows can have a max length of 24 hours."; } + + $utc = new DateTimeZone("UTC"); + + $nowDateTime = new DateTime("now", $utc); $showInstances = CcShowInstancesQuery::create() ->filterByDbShowId($this->_showId) ->find($con); - /* Check if the show being resized and any of its repeats * overlap - with other scheduled shows */ - $utc = new DateTimeZone("UTC"); + /* Check two things: + 1. If the show being resized and any of its repeats end in the past + 2. If the show being resized and any of its repeats overlap + with other scheduled shows */ foreach ($showInstances as $si) { $startsDateTime = new DateTime($si->getDbStarts(), new DateTimeZone("UTC")); @@ -201,6 +206,10 @@ SQL; $newStartsDateTime = Application_Model_ShowInstance::addDeltas($startsDateTime, $deltaDay, $deltaMin); $newEndsDateTime = Application_Model_ShowInstance::addDeltas($endsDateTime, $deltaDay, $deltaMin); + + if ($newEndsDateTime->getTimestamp() < $nowDateTime->getTimestamp()) { + return "End date/time cannot be in the past"; + } //convert our new starts/ends to UTC. $newStartsDateTime->setTimezone($utc); From c9ac675a1060ae1327c92d82d342cabdb4bce445 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 9 Oct 2012 14:39:29 -0400 Subject: [PATCH 2/2] CC-4529: Playlist Builder: The panel of 'Adding n items' will be bigger than usual if there is a item in Playlist has expanded cue in/out setting -fixed --- .../public/js/airtime/library/events/library_playlistbuilder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js b/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js index 8c3239927..4b139f66e 100644 --- a/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js +++ b/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js @@ -65,7 +65,7 @@ var AIRTIME = (function(AIRTIME) { var $el = $(this), selected = mod .getChosenAudioFilesLength(), container, message, li = $("#side_playlist ul[id='spl_sortable'] li:first"), width = li - .width(), height = li.height(); + .width(), height = 55; // dragging an element that has an unselected // checkbox.