From 0dd2958333d5271f70e5e8a68d64e24a7b5d06dd Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Thu, 16 Jul 2015 14:24:07 -0400 Subject: [PATCH 1/6] SAAS-922 - urlencode content headers to ensure compatibility --- .../application/cloud_storage/Amazon_S3StorageBackend.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/cloud_storage/Amazon_S3StorageBackend.php b/airtime_mvc/application/cloud_storage/Amazon_S3StorageBackend.php index 0d86ef52c..2f023aeea 100644 --- a/airtime_mvc/application/cloud_storage/Amazon_S3StorageBackend.php +++ b/airtime_mvc/application/cloud_storage/Amazon_S3StorageBackend.php @@ -46,7 +46,7 @@ class Amazon_S3StorageBackend extends StorageBackend { $urls = array(); - $s3args = array('ResponseContentDisposition' => 'attachment; filename="' . $contentDispositionFilename. '"'); + $s3args = array('ResponseContentDisposition' => 'attachment; filename="' . urlencode($contentDispositionFilename) . '"'); $signedS3Url = $this->s3Client->getObjectUrl($this->getBucket(), $resourceId, '+60 minutes', $s3args); //If we're using the proxy cache, we need to modify the request URL after it has @@ -65,7 +65,7 @@ class Amazon_S3StorageBackend extends StorageBackend $p["path"] = substr($p["path"], 1 + strlen($this->getBucket())); } $proxyUrl = $p["scheme"] . "://" . $p["host"] . $p["path"] . "?" . $p["query"]; - //Add this proxy cache URL to the list of download URLs. + //Add this proxy cache URL to the list of download URLs.s array_push($urls, $proxyUrl); } From 07f02260dbe4ab04121c9dd07d9f671f535d25b8 Mon Sep 17 00:00:00 2001 From: drigato Date: Fri, 17 Jul 2015 09:57:24 -0400 Subject: [PATCH 2/6] Fix undefined index: nextMediaName --- airtime_mvc/application/models/Schedule.php | 1 + 1 file changed, 1 insertion(+) diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 07e72136b..811b90bd7 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -288,6 +288,7 @@ SQL; ->orderByDbStarts(Criteria::ASC) ->findOne(); if (isset($nextMedia)) { + $nextMediaName = ""; $nextMediaFileId = $nextMedia->getDbFileId(); $nextMediaStreamId = $nextMedia->getDbStreamId(); if (isset($nextMediaFileId)) { From 7f4fbf65e144c05d7427b059e3f15d32b47bb4ec Mon Sep 17 00:00:00 2001 From: drigato Date: Fri, 17 Jul 2015 12:48:57 -0400 Subject: [PATCH 3/6] SAAS-960 Change hint for currently playing linked show --- .../application/common/UsabilityHints.php | 37 ++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/common/UsabilityHints.php b/airtime_mvc/application/common/UsabilityHints.php index 38f09356d..837c9e747 100644 --- a/airtime_mvc/application/common/UsabilityHints.php +++ b/airtime_mvc/application/common/UsabilityHints.php @@ -67,12 +67,22 @@ class Application_Common_UsabilityHints ""); } } else if (self::isCurrentShowEmpty()) { - if ($userIsOnCalendarPage) { - return _("To start broadcasting, click on the current show and select 'Add / Remove Content'"); + // If the current show is linked users cannot add content to it so we have to provide a different message. + if (self::isCurrentShowLinked()) { + if ($userIsOnCalendarPage) { + return _("To start broadcasting, first you need to cancel the current linked show by clicking on it and selecting 'Cancel Current Show'."); + } else { + return sprintf(_("Linked shows need to be filled with tracks before it starts. You need to schedule a non-linked show to start broadcasting. + %sCreate a non-linked show now.%s"), "", ""); + } } else { - return sprintf(_("It looks like the current show needs more tracks. %sAdd tracks to your show now.%s"), - "", - ""); + if ($userIsOnCalendarPage) { + return _("To start broadcasting, click on the current show and select 'Add / Remove Content'"); + } else { + return sprintf(_("It looks like the current show needs more tracks. %sAdd tracks to your show now.%s"), + "", + ""); + } } } else if (!self::getCurrentShow() && self::isNextShowEmpty()) { if ($userIsOnCalendarPage) { @@ -181,4 +191,21 @@ class Application_Common_UsabilityHints ->orderByDbStarts() ->findOne(); } + + private static function isCurrentShowLinked() + { + $currentShow = self::getCurrentShow(); + if (!is_null($currentShow)) { + $show = CcShowQuery::create() + ->filterByDbId($currentShow->getDbShowId()) + ->findOne(); + if ($show->isLinked()) { + return true; + } else { + return false; + } + } else { + return false; + } + } } \ No newline at end of file From a6854ea507983fed7f810b616b02961edc60c424 Mon Sep 17 00:00:00 2001 From: drigato Date: Fri, 17 Jul 2015 16:28:33 -0400 Subject: [PATCH 4/6] SAAS-957: Error on "update show" --- airtime_mvc/public/js/airtime/schedule/add-show.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/public/js/airtime/schedule/add-show.js b/airtime_mvc/public/js/airtime/schedule/add-show.js index 36910bdd5..f6b359953 100644 --- a/airtime_mvc/public/js/airtime/schedule/add-show.js +++ b/airtime_mvc/public/js/airtime/schedule/add-show.js @@ -48,7 +48,6 @@ function toggleAddShowButton(){ } function setupStartTimeWidgets() { - if ($('input[name=add_show_start_now]:checked').val() == 'now') { $('#add_show_start_date').prop('disabled', 'true'); $('#add_show_start_time').prop('disabled', 'true'); @@ -66,8 +65,16 @@ function setupStartTimeWidgets() { $('#add_show_end_time').val(nowShowEnd.format('HH:mm')); } else { - $('#add_show_start_date').removeProp('disabled'); - $('#add_show_start_time').removeProp('disabled'); + //Prevent enabling of elements that should always be disabled. + //i.e. when editing a show that has already started + if (!$('#add_show_start_date').prop('disabled')) { + $('#add_show_start_date').removeProp('disabled'); + } + + if (!$('#add_show_start_time').prop('disabled')) { + $('#add_show_start_time').removeProp('disabled'); + } + } } From 3e60713590aa88e91e98bb06bb3f0a55ebc66389 Mon Sep 17 00:00:00 2001 From: drigato Date: Mon, 20 Jul 2015 15:20:50 -0400 Subject: [PATCH 5/6] SAAS-962: "Now" option should not be available for linked shows Also added fix for SAAS-957 --- .../public/js/airtime/schedule/add-show.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/airtime_mvc/public/js/airtime/schedule/add-show.js b/airtime_mvc/public/js/airtime/schedule/add-show.js index f6b359953..3e3ceec0b 100644 --- a/airtime_mvc/public/js/airtime/schedule/add-show.js +++ b/airtime_mvc/public/js/airtime/schedule/add-show.js @@ -64,14 +64,14 @@ function setupStartTimeWidgets() { $('#add_show_end_date_no_repeat').val(nowShowEnd.format('YYYY-MM-DD')); $('#add_show_end_time').val(nowShowEnd.format('HH:mm')); - } else { - //Prevent enabling of elements that should always be disabled. - //i.e. when editing a show that has already started - if (!$('#add_show_start_date').prop('disabled')) { - $('#add_show_start_date').removeProp('disabled'); - } + //Disabled linked show option since user won't be able to schedule + //content + $('#add_show_linked').prop('disabled', 'true'); - if (!$('#add_show_start_time').prop('disabled')) { + } else { + //Do not enable start date and time option when a show has already started + if (!$('#add_show_start_now-now').prop('disabled')) { + $('#add_show_start_date').removeProp('disabled'); $('#add_show_start_time').removeProp('disabled'); } @@ -248,6 +248,10 @@ function setAddShowEvents(form) { form.find('input:radio[name=add_show_start_now]').click(function() { setupStartTimeWidgets(); + + if ($(this).val() == "future") { + $('#add_show_linked').removeProp('disabled'); + } }); From 6f09ef4af154d6846ef907c362d944fe32246a0f Mon Sep 17 00:00:00 2001 From: drigato Date: Tue, 21 Jul 2015 07:27:26 -0400 Subject: [PATCH 6/6] Change usability hint wording --- airtime_mvc/application/common/UsabilityHints.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/common/UsabilityHints.php b/airtime_mvc/application/common/UsabilityHints.php index 837c9e747..594170cc5 100644 --- a/airtime_mvc/application/common/UsabilityHints.php +++ b/airtime_mvc/application/common/UsabilityHints.php @@ -72,8 +72,8 @@ class Application_Common_UsabilityHints if ($userIsOnCalendarPage) { return _("To start broadcasting, first you need to cancel the current linked show by clicking on it and selecting 'Cancel Current Show'."); } else { - return sprintf(_("Linked shows need to be filled with tracks before it starts. You need to schedule a non-linked show to start broadcasting. - %sCreate a non-linked show now.%s"), "", ""); + return sprintf(_("Linked shows need to be filled with tracks before it starts. To start broadcasting cancel the current linked show and schedule an unlinked show. + %sCreate an unlinked show now.%s"), "", ""); } } else { if ($userIsOnCalendarPage) {