From 7f4fbf65e144c05d7427b059e3f15d32b47bb4ec Mon Sep 17 00:00:00 2001 From: drigato Date: Fri, 17 Jul 2015 12:48:57 -0400 Subject: [PATCH] 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