From 37a0c271f6eec14e47dedb2f825ae6b88a90dfcc Mon Sep 17 00:00:00 2001 From: drigato Date: Thu, 3 Oct 2013 18:02:15 -0400 Subject: [PATCH 01/15] CC-5359: Update show fails sometimes with overlapping check Some DateTime objects were not getting created in correct timezone Used format() to get the day of week value instead of getTimestamp() getTimestamp() sometimes returns the wrong value --- airtime_mvc/application/forms/AddShowWhen.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index 62b8004c5..518b07405 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -168,9 +168,9 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm if ($valid) { $utc = new DateTimeZone('UTC'); $showTimezone = new DateTimeZone($formData["add_show_timezone"]); - $show_start = new DateTime($start_time); + $show_start = new DateTime($start_time, $showTimezone); $show_start->setTimezone($utc); - $show_end = new DateTime($end_time); + $show_end = new DateTime($end_time, $showTimezone); $show_end->setTimezone($utc); if ($formData["add_show_repeats"]) { @@ -188,7 +188,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm } elseif (!$formData["add_show_no_end"]) { $popUntil = $formData["add_show_end_date"]." ".$formData["add_show_end_time"]; - $populateUntilDateTime = new DateTime($popUntil); + $populateUntilDateTime = new DateTime($popUntil, $showTimezone); $populateUntilDateTime->setTimezone($utc); } @@ -216,7 +216,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm * Do this for each show day */ if (!$overlapping) { - $startDow = date("w", $show_start->getTimestamp()); + $startDow = $show_start->format("w"); if (!isset($formData['add_show_day_check'])) { return false; From 60b4eb5c8a78dbc4a62086e951ce549e15582877 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 4 Oct 2013 09:49:23 -0400 Subject: [PATCH 02/15] Removed unnecessary formating when comparing DateTime objects --- airtime_mvc/application/services/ShowService.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index c3f4af401..c303049a4 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -912,9 +912,8 @@ SQL; * (NOTE: We cannot call getTimestamp() to compare the dates because of * a PHP 5.3.3 bug with DatePeriod objects - See CC-5159 for more details) */ - if ($utcStartDateTime->format("Y-m-d H:i:s") <= $populateUntil->format("Y-m-d H:i:s") && - ( is_null($utcLastShowDateTime) || - $utcStartDateTime->format("Y-m-d H:i:s") < $utcLastShowDateTime->format("Y-m-d H:i:s")) ) { + if ($utcStartDateTime <= $populateUntil && + ( is_null($utcLastShowDateTime) || $utcStartDateTime < $utcLastShowDateTime) ) { $lastCreatedShow = clone $utcStartDateTime; /* There may not always be an instance when editing a show From 4ca255499932e8e3b3bedb1384d4ccdbe8e15c87 Mon Sep 17 00:00:00 2001 From: Naomi Date: Fri, 4 Oct 2013 11:05:35 -0400 Subject: [PATCH 03/15] CC-5362 : In Calendar Week/Day view crappy JS for now playing show makes everything a record show fc-show-instance is now a class since agenda day/week are prerendered, thought only 1 was rendered at a time. better handling of adding the now playing icon. --- .../schedule/full-calendar-functions.js | 80 +++++++------------ 1 file changed, 30 insertions(+), 50 deletions(-) diff --git a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js index 883b430b6..b5eb6bee9 100644 --- a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js +++ b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js @@ -217,7 +217,7 @@ function viewDisplay( view ) { } function eventRender(event, element, view) { - $(element).attr("id", "fc-show-instance-"+event.id); + $(element).addClass("fc-show-instance-"+event.id); $(element).attr("data-show-id", event.showId); $(element).attr("data-show-linked", event.linked); $(element).data("event", event); @@ -412,13 +412,13 @@ function checkSCUploadStatus(){ $.post(url, {format: "json", id: id, type:"show"}, function(json){ if (json.sc_id > 0){ - $("#fc-show-instance-"+id) + $(".fc-show-instance-"+id) .find(".progress") .removeClass("progress") .addClass("soundcloud"); } else if (json.sc_id == "-3"){ - $("#fc-show-instance-"+id) + $(".fc-show-instance-"+id) .find(".progress") .removeClass("progress") .addClass("sc-error"); @@ -428,59 +428,39 @@ function checkSCUploadStatus(){ }); }); } + /** This function adds and removes the current * show icon */ -function getCurrentShow(){ - var url = baseUrl+'Schedule/get-current-show/format/json', - id, - $el; - $.post(url, {format: "json"}, function(json) { +function getCurrentShow() { + + var url = baseUrl+'Schedule/get-current-show/format/json'; + + function addNowPlaying(json) { + + var $el, + span = ''; + + $(".now-playing").remove(); + if (json.current_show === true) { - $el = $("div[class*=fc-event-time]"); - if (view_name === 'agendaDay' || view_name === 'agendaWeek') { - - /* Need to remove now-playing class because if user - * is switching from week view to day view (and vice versa) - * the icon may already be there from previous view - */ - $el.siblings().remove("span.now-playing"); - if (!$el.siblings().hasClass("small-icon now-playing")) { - if ($el.siblings().hasClass("small-icon recording")) { - - /* Without removing recording icon, the now playing - * icon will overwrite it. - */ - $el.siblings().remove("span.recording"); - $el.before(''); - } else if ($el.siblings().hasClass("small-icon rebroadcast")) { - - /* Without removing rebroadcast icon, the now playing - * icon will overwrite it. - */ - $el.siblings().remove("span.rebroadcast"); - $el.before(''); - } else { - $el.before(''); - } - } - } else if (view_name === 'month') { - if (!$("span[class*=fc-event-title]").siblings().hasClass("now-playing")) { - $("span[class*=fc-event-title]").after(''); - } - } + + $el = $(".fc-show-instance-"+json.si_id); + + if (view_name === 'agendaDay' || view_name === 'agendaWeek') { + + $el.find(".fc-event-time").before(span); + } + else if (view_name === 'month') { + + $el.find(".fc-event-title").after(span); + } } - //remove icon from shows that have ended - $(".now-playing").each(function(){ - id = $(this).parents("div.fc-event").data("event").id; - - if (id != json.si_id) { - $(this).remove("span.now-playing"); - } - }); - + setTimeout(getCurrentShow, 5000); - }); + } + + $.post(url, {format: "json"}, addNowPlaying); } function addQtipsToIcons(ele, id){ From 7b1cd5c908e6919e79a0e2df97c807cf41667fff Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Fri, 4 Oct 2013 14:15:23 -0400 Subject: [PATCH 04/15] CC-5354: Remove PHP short open tags for better compatibility --- .../scripts/audiopreview/audio-preview.phtml | 20 ++--- .../views/scripts/dashboard/about.phtml | 2 +- .../scripts/dashboard/stream-player.phtml | 8 +- .../views/scripts/error/error.phtml | 4 +- .../scripts/form/add-show-live-stream.phtml | 2 +- .../form/add-show-rebroadcast-absolute.phtml | 6 +- .../scripts/form/add-show-rebroadcast.phtml | 6 +- .../views/scripts/form/edit-user.phtml | 2 +- .../views/scripts/form/login.phtml | 2 +- .../views/scripts/form/preferences.phtml | 4 +- .../scripts/form/preferences_livestream.phtml | 10 +-- .../form/preferences_watched_dirs.phtml | 4 +- .../views/scripts/form/register-dialog.phtml | 4 +- .../views/scripts/form/showbuilder.phtml | 2 +- .../scripts/form/smart-block-criteria.phtml | 4 +- .../scripts/form/stream-setting-form.phtml | 4 +- .../views/scripts/form/support-setting.phtml | 4 +- .../library/get-file-metadata.ajax.phtml | 74 +++++++++---------- .../views/scripts/login/index.phtml | 2 +- .../views/scripts/login/password-change.phtml | 4 +- .../login/password-restore-after.phtml | 6 +- .../scripts/login/password-restore.phtml | 2 +- .../views/scripts/partialviews/header.phtml | 18 ++--- .../views/scripts/partialviews/trialBox.phtml | 6 +- .../views/scripts/playlist/playlist.phtml | 28 +++---- .../views/scripts/playlist/smart-block.phtml | 26 +++---- .../scripts/preference/directory-config.phtml | 2 +- .../views/scripts/preference/index.phtml | 6 +- .../scripts/schedule/add-show-form.phtml | 14 ++-- .../schedule/show-content-dialog.phtml | 12 +-- .../scripts/showbuilder/builderDialog.phtml | 4 +- .../views/scripts/systemstatus/index.phtml | 14 ++-- .../views/scripts/user/add-user.phtml | 14 ++-- .../views/scripts/webstream/webstream.phtml | 22 +++--- 34 files changed, 171 insertions(+), 171 deletions(-) diff --git a/airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml b/airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml index fcade27d9..27aac26eb 100644 --- a/airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml +++ b/airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml @@ -20,26 +20,26 @@ @@ -76,8 +76,8 @@ diff --git a/airtime_mvc/application/views/scripts/dashboard/about.phtml b/airtime_mvc/application/views/scripts/dashboard/about.phtml index 3f50f42f8..05f65cd80 100644 --- a/airtime_mvc/application/views/scripts/dashboard/about.phtml +++ b/airtime_mvc/application/views/scripts/dashboard/about.phtml @@ -1,5 +1,5 @@
-

+

-

+