diff --git a/airtime_mvc/application/common/UsabilityHints.php b/airtime_mvc/application/common/UsabilityHints.php index 38f09356d..594170cc5 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. To start broadcasting cancel the current linked show and schedule an unlinked show. + %sCreate an unlinked 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 diff --git a/airtime_mvc/application/models/Email.php b/airtime_mvc/application/models/Email.php index 234f20397..774617c1e 100644 --- a/airtime_mvc/application/models/Email.php +++ b/airtime_mvc/application/models/Email.php @@ -12,65 +12,8 @@ class Application_Model_Email */ public static function send($subject, $message, $tos, $from = null) { - $mailServerConfigured = Application_Model_Preference::GetMailServerConfigured() == true ? true : false; - $mailServerRequiresAuth = Application_Model_Preference::GetMailServerRequiresAuth() == true ? true : false; - $success = true; - if ($mailServerConfigured) { - $mailServer = Application_Model_Preference::GetMailServer(); - $mailServerPort = Application_Model_Preference::GetMailServerPort(); - if (!empty($mailServerPort)) { - $port = $mailServerPort; - } - - if ($mailServerRequiresAuth) { - $username = Application_Model_Preference::GetMailServerEmailAddress(); - $password = Application_Model_Preference::GetMailServerPassword(); - - $config = array( - 'auth' => 'login', - 'ssl' => 'ssl', - 'username' => $username, - 'password' => $password - ); - } else { - $config = array( - 'ssl' => 'tls' - ); - } - - if (isset($port)) { - $config['port'] = $port; - } - - $transport = new Zend_Mail_Transport_Smtp($mailServer, $config); - } - - $mail = new Zend_Mail('utf-8'); - $mail->setSubject($subject); - $mail->setBodyText($message); - - foreach ((array) $tos as $to) { - $mail->addTo($to); - } - - if ($mailServerConfigured) { - $mail->setFrom(isset($from) ? $from : Application_Model_Preference::GetMailServerEmailAddress()); - try { - $mail->send($transport); - } catch (Exception $e) { - $success = false; - } - } else { - $mail->setFrom(isset($from) ? $from : Application_Model_Preference::GetSystemEmail()); - try { - $mail->send(); - } catch (Exception $e) { - $success = false; - } - } - - return $success; + return mail($tos, $subject, $message); } } 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)) { diff --git a/airtime_mvc/application/views/scripts/form/login.phtml b/airtime_mvc/application/views/scripts/form/login.phtml index e8d80a84d..c286c45be 100644 --- a/airtime_mvc/application/views/scripts/form/login.phtml +++ b/airtime_mvc/application/views/scripts/form/login.phtml @@ -31,10 +31,10 @@ element->getElement('csrf') ?> -