Merge branch 'saas-dev' into saas-showbuilder
This commit is contained in:
commit
5e58403c7f
|
@ -67,12 +67,22 @@ class Application_Common_UsabilityHints
|
||||||
"</a>");
|
"</a>");
|
||||||
}
|
}
|
||||||
} else if (self::isCurrentShowEmpty()) {
|
} else if (self::isCurrentShowEmpty()) {
|
||||||
if ($userIsOnCalendarPage) {
|
// If the current show is linked users cannot add content to it so we have to provide a different message.
|
||||||
return _("To start broadcasting, click on the current show and select 'Add / Remove Content'");
|
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"), "<a href=\"/schedule\">", "</a>");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return sprintf(_("It looks like the current show needs more tracks. %sAdd tracks to your show now.%s"),
|
if ($userIsOnCalendarPage) {
|
||||||
"<a href=\"/schedule\">",
|
return _("To start broadcasting, click on the current show and select 'Add / Remove Content'");
|
||||||
"</a>");
|
} else {
|
||||||
|
return sprintf(_("It looks like the current show needs more tracks. %sAdd tracks to your show now.%s"),
|
||||||
|
"<a href=\"/schedule\">",
|
||||||
|
"</a>");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (!self::getCurrentShow() && self::isNextShowEmpty()) {
|
} else if (!self::getCurrentShow() && self::isNextShowEmpty()) {
|
||||||
if ($userIsOnCalendarPage) {
|
if ($userIsOnCalendarPage) {
|
||||||
|
@ -181,4 +191,21 @@ class Application_Common_UsabilityHints
|
||||||
->orderByDbStarts()
|
->orderByDbStarts()
|
||||||
->findOne();
|
->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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -12,65 +12,8 @@ class Application_Model_Email
|
||||||
*/
|
*/
|
||||||
public static function send($subject, $message, $tos, $from = null)
|
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) {
|
return mail($tos, $subject, $message);
|
||||||
$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;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -288,6 +288,7 @@ SQL;
|
||||||
->orderByDbStarts(Criteria::ASC)
|
->orderByDbStarts(Criteria::ASC)
|
||||||
->findOne();
|
->findOne();
|
||||||
if (isset($nextMedia)) {
|
if (isset($nextMedia)) {
|
||||||
|
$nextMediaName = "";
|
||||||
$nextMediaFileId = $nextMedia->getDbFileId();
|
$nextMediaFileId = $nextMedia->getDbFileId();
|
||||||
$nextMediaStreamId = $nextMedia->getDbStreamId();
|
$nextMediaStreamId = $nextMedia->getDbStreamId();
|
||||||
if (isset($nextMediaFileId)) {
|
if (isset($nextMediaFileId)) {
|
||||||
|
|
|
@ -31,10 +31,10 @@
|
||||||
<?php echo $this->element->getElement('csrf') ?>
|
<?php echo $this->element->getElement('csrf') ?>
|
||||||
|
|
||||||
<?php if (Application_Model_Preference::GetEnableSystemEmail()): ?>
|
<?php if (Application_Model_Preference::GetEnableSystemEmail()): ?>
|
||||||
<dt id="reset-label" class="hidden"> </dt>
|
<dt id="reset-label" class="hidden"> </dt>
|
||||||
<dd id="reset-element" class="text-right">
|
<dd id="reset-element" class="text-right">
|
||||||
<a href="<?php echo $this->baseUrl('login/password-restore'); ?>" class="link reset"><?php echo _("Reset password") ?></a>
|
<a href="<?php echo $this->baseUrl('login/password-restore'); ?>" class="link reset"><?php echo _("Reset password") ?></a>
|
||||||
</dd>
|
</dd>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php echo $this->element->getElement('captcha') ?>
|
<?php echo $this->element->getElement('captcha') ?>
|
||||||
<dt id="submit-label"> </dt>
|
<dt id="submit-label"> </dt>
|
||||||
|
|
|
@ -48,7 +48,6 @@ function toggleAddShowButton(){
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupStartTimeWidgets() {
|
function setupStartTimeWidgets() {
|
||||||
|
|
||||||
if ($('input[name=add_show_start_now]:checked').val() == 'now') {
|
if ($('input[name=add_show_start_now]:checked').val() == 'now') {
|
||||||
$('#add_show_start_date').prop('disabled', 'true');
|
$('#add_show_start_date').prop('disabled', 'true');
|
||||||
$('#add_show_start_time').prop('disabled', 'true');
|
$('#add_show_start_time').prop('disabled', 'true');
|
||||||
|
@ -65,9 +64,17 @@ function setupStartTimeWidgets() {
|
||||||
$('#add_show_end_date_no_repeat').val(nowShowEnd.format('YYYY-MM-DD'));
|
$('#add_show_end_date_no_repeat').val(nowShowEnd.format('YYYY-MM-DD'));
|
||||||
$('#add_show_end_time').val(nowShowEnd.format('HH:mm'));
|
$('#add_show_end_time').val(nowShowEnd.format('HH:mm'));
|
||||||
|
|
||||||
|
//Disabled linked show option since user won't be able to schedule
|
||||||
|
//content
|
||||||
|
$('#add_show_linked').prop('disabled', 'true');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$('#add_show_start_date').removeProp('disabled');
|
//Do not enable start date and time option when a show has already started
|
||||||
$('#add_show_start_time').removeProp('disabled');
|
if (!$('#add_show_start_now-now').prop('disabled')) {
|
||||||
|
$('#add_show_start_date').removeProp('disabled');
|
||||||
|
$('#add_show_start_time').removeProp('disabled');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,6 +248,10 @@ function setAddShowEvents(form) {
|
||||||
|
|
||||||
form.find('input:radio[name=add_show_start_now]').click(function() {
|
form.find('input:radio[name=add_show_start_now]').click(function() {
|
||||||
setupStartTimeWidgets();
|
setupStartTimeWidgets();
|
||||||
|
|
||||||
|
if ($(this).val() == "future") {
|
||||||
|
$('#add_show_linked').removeProp('disabled');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue