style(legacy): format files (#1946)
This commit is contained in:
parent
eb19283d96
commit
4d393fa14e
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Auth adaptor for FreeIPA.
|
||||
*/
|
||||
|
|
|
@ -9,9 +9,11 @@ class WidgetHelper
|
|||
// weekStart is in station time.
|
||||
$weekStartDateTime = Application_Common_DateHelper::getWeekStartDateTime();
|
||||
|
||||
$dow = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday',
|
||||
$dow = [
|
||||
'monday', 'tuesday', 'wednesday', 'thursday', 'friday',
|
||||
'saturday', 'sunday', 'nextmonday', 'nexttuesday', 'nextwednesday',
|
||||
'nextthursday', 'nextfriday', 'nextsaturday', 'nextsunday', ];
|
||||
'nextthursday', 'nextfriday', 'nextsaturday', 'nextsunday',
|
||||
];
|
||||
|
||||
$result = [];
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: asantoni
|
||||
|
@ -9,7 +10,8 @@ class AirtimeTableView
|
|||
{
|
||||
private static function _getTableJavaScriptDependencies()
|
||||
{
|
||||
return ['js/airtime/widgets/table.js',
|
||||
return [
|
||||
'js/airtime/widgets/table.js',
|
||||
'js/datatables/js/jquery.dataTables.js',
|
||||
'js/datatables/plugin/dataTables.pluginAPI.js',
|
||||
'js/datatables/plugin/dataTables.fnSetFilteringDelay.js',
|
||||
|
@ -17,7 +19,8 @@ class AirtimeTableView
|
|||
'js/datatables/plugin/dataTables.colReorder.min.js?',
|
||||
'js/datatables/plugin/dataTables.FixedColumns.js',
|
||||
'js/datatables/plugin/dataTables.FixedHeader.js',
|
||||
'js/datatables/plugin/dataTables.columnFilter.js?', ];
|
||||
'js/datatables/plugin/dataTables.columnFilter.js?',
|
||||
];
|
||||
}
|
||||
|
||||
public static function injectTableJavaScriptDependencies(&$headScript, $baseUrl, $airtimeVersion)
|
||||
|
|
|
@ -25,107 +25,108 @@ $r2 = array_reduce($externalServices, 'booleanReduce', true);
|
|||
$result = $r1 && $r2;
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="css/bootstrap-3.3.1.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/setup/config-check.css">
|
||||
</head>
|
||||
<style>
|
||||
/*
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="css/bootstrap-3.3.1.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/setup/config-check.css">
|
||||
</head>
|
||||
<style>
|
||||
/*
|
||||
This is here because we're using the config-check css for
|
||||
both this page and the system status page
|
||||
*/
|
||||
html {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
html {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
body {
|
||||
padding: 2em;
|
||||
min-width: 600px;
|
||||
text-align: center;
|
||||
margin: 3em ;
|
||||
border: 1px solid lightgray;
|
||||
border-radius: 5px;
|
||||
}
|
||||
</style>
|
||||
body {
|
||||
padding: 2em;
|
||||
min-width: 600px;
|
||||
text-align: center;
|
||||
margin: 3em;
|
||||
border: 1px solid lightgray;
|
||||
border-radius: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<h2>
|
||||
<img class="logo" src="css/images/airtime_logo_jp.png" /><br/>
|
||||
<strong>Configuration Checklist</strong>
|
||||
</h2>
|
||||
<body>
|
||||
<h2>
|
||||
<img class="logo" src="css/images/airtime_logo_jp.png" /><br />
|
||||
<strong>Configuration Checklist</strong>
|
||||
</h2>
|
||||
|
||||
<?php
|
||||
if (!$result) {
|
||||
?>
|
||||
<br/>
|
||||
<h3 class="error">Looks like something went wrong!</h3>
|
||||
<p>
|
||||
Take a look at the checklist below for possible solutions. If you're tried the suggestions and are
|
||||
still experiencing issues, read the
|
||||
<a href="https://github.com/libretime/libretime/releases">release notes</a>,
|
||||
come <a href="https://discourse.libretime.org/">visit our discourse</a>
|
||||
or, check <a href="http://www.libretime.org/">the website and main docs</a>.
|
||||
</p>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<p>
|
||||
Your Airtime station is up and running! Get started by logging in with the default username and password: admin/admin
|
||||
</p>
|
||||
<button onclick="location = location.pathname;">Log in to Airtime!</button>
|
||||
<?php
|
||||
}
|
||||
<?php
|
||||
if (!$result) {
|
||||
?>
|
||||
<br />
|
||||
<h3 class="error">Looks like something went wrong!</h3>
|
||||
<p>
|
||||
Take a look at the checklist below for possible solutions. If you're tried the suggestions and are
|
||||
still experiencing issues, read the
|
||||
<a href="https://github.com/libretime/libretime/releases">release notes</a>,
|
||||
come <a href="https://discourse.libretime.org/">visit our discourse</a>
|
||||
or, check <a href="http://www.libretime.org/">the website and main docs</a>.
|
||||
</p>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<p>
|
||||
Your Airtime station is up and running! Get started by logging in with the default username and password: admin/admin
|
||||
</p>
|
||||
<button onclick="location = location.pathname;">Log in to Airtime!</button>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="component">
|
||||
Component
|
||||
</th>
|
||||
<th class="description">
|
||||
<strong>Description</strong>
|
||||
</th>
|
||||
<th class="solution">
|
||||
<strong>Status or Solution</strong>
|
||||
</th>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="component">
|
||||
Component
|
||||
</th>
|
||||
<th class="description">
|
||||
<strong>Description</strong>
|
||||
</th>
|
||||
<th class="solution">
|
||||
<strong>Status or Solution</strong>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<div class="checklist">
|
||||
<table class="table table-striped">
|
||||
<caption class="caption">
|
||||
PHP Dependencies
|
||||
</caption>
|
||||
<tbody>
|
||||
<tr class="<?php echo $postgres ? 'success' : 'danger'; ?>">
|
||||
<td class="component">
|
||||
Postgres
|
||||
</td>
|
||||
<td class="description">
|
||||
PDO and PostgreSQL libraries
|
||||
</td>
|
||||
<td class="solution <?php if ($postgres) {
|
||||
echo 'check'; ?>">
|
||||
<?php
|
||||
} else {
|
||||
?>">
|
||||
Try running <code>sudo apt-get install php5-pgsql</code>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="checklist">
|
||||
<table class="table table-striped">
|
||||
<caption class="caption">
|
||||
PHP Dependencies
|
||||
</caption>
|
||||
<tbody>
|
||||
<tr class="<?php echo $postgres ? 'success' : 'danger'; ?>">
|
||||
<td class="component">
|
||||
Postgres
|
||||
</td>
|
||||
<td class="description">
|
||||
PDO and PostgreSQL libraries
|
||||
</td>
|
||||
<td class="solution <?php if ($postgres) {
|
||||
echo 'check'; ?>">
|
||||
<?php
|
||||
} else {
|
||||
?>">
|
||||
Try running <code>sudo apt-get install php5-pgsql</code>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table class="table table-striped">
|
||||
<caption class="caption">
|
||||
External Services
|
||||
</caption>
|
||||
<tbody>
|
||||
<table class="table table-striped">
|
||||
<caption class="caption">
|
||||
External Services
|
||||
</caption>
|
||||
<tbody>
|
||||
<tr class="<?php echo $database ? 'success' : 'danger'; ?>">
|
||||
<td class="component">
|
||||
Database
|
||||
|
@ -134,16 +135,16 @@ $result = $r1 && $r2;
|
|||
Database configuration for Airtime
|
||||
</td>
|
||||
<td class="solution <?php if ($database) {
|
||||
echo 'check'; ?>">
|
||||
echo 'check'; ?>">
|
||||
<?php
|
||||
} else {
|
||||
?>">
|
||||
Make sure you aren't missing any of the Postgres dependencies in the table above.
|
||||
If your dependencies check out, make sure your database configuration settings in
|
||||
<code><?php echo LIBRETIME_CONFIG_FILEPATH; ?></code> are correct and the Airtime database was installed correctly.
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
} else {
|
||||
?>">
|
||||
Make sure you aren't missing any of the Postgres dependencies in the table above.
|
||||
If your dependencies check out, make sure your database configuration settings in
|
||||
<code><?php echo LIBRETIME_CONFIG_FILEPATH; ?></code> are correct and the Airtime database was installed correctly.
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="<?php echo $rabbitmq ? 'success' : 'danger'; ?>">
|
||||
|
@ -154,17 +155,17 @@ $result = $r1 && $r2;
|
|||
RabbitMQ configuration for Airtime
|
||||
</td>
|
||||
<td class="solution <?php if ($rabbitmq) {
|
||||
echo 'check'; ?>">
|
||||
echo 'check'; ?>">
|
||||
<?php
|
||||
} else {
|
||||
?>">
|
||||
Make sure RabbitMQ is installed correctly, and that your settings in <?php echo LIBRETIME_CONFIG_FILEPATH; ?>
|
||||
are correct. Try using <code>sudo rabbitmqctl list_users</code> and <code>sudo rabbitmqctl list_vhosts</code>
|
||||
to see if the airtime user (or your custom RabbitMQ user) exists, then checking that
|
||||
<code>sudo rabbitmqctl list_exchanges</code> contains entries for airtime-pypo and airtime-uploads.
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
} else {
|
||||
?>">
|
||||
Make sure RabbitMQ is installed correctly, and that your settings in <?php echo LIBRETIME_CONFIG_FILEPATH; ?>
|
||||
are correct. Try using <code>sudo rabbitmqctl list_users</code> and <code>sudo rabbitmqctl list_vhosts</code>
|
||||
to see if the airtime user (or your custom RabbitMQ user) exists, then checking that
|
||||
<code>sudo rabbitmqctl list_exchanges</code> contains entries for airtime-pypo and airtime-uploads.
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="<?php echo $analyzer ? 'success' : 'danger'; ?>">
|
||||
|
@ -175,17 +176,17 @@ $result = $r1 && $r2;
|
|||
<?php echo _('LibreTime media analyzer service'); ?>
|
||||
</td>
|
||||
<td class="solution <?php if ($analyzer) {
|
||||
echo 'check'; ?>">
|
||||
echo 'check'; ?>">
|
||||
<?php
|
||||
} else {
|
||||
?>">
|
||||
<?php echo _('Check that the libretime-analyzer service is installed correctly in '); ?><code>/etc/systemd/system/</code>,
|
||||
<?php echo _(" and ensure that it's running with "); ?>
|
||||
<br/><code>systemctl status libretime-analyzer</code><br/>
|
||||
<?php echo _('If not, try '); ?><br/><code>sudo systemctl restart libretime-analyzer</code>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
} else {
|
||||
?>">
|
||||
<?php echo _('Check that the libretime-analyzer service is installed correctly in '); ?><code>/etc/systemd/system/</code>,
|
||||
<?php echo _(" and ensure that it's running with "); ?>
|
||||
<br /><code>systemctl status libretime-analyzer</code><br />
|
||||
<?php echo _('If not, try '); ?><br /><code>sudo systemctl restart libretime-analyzer</code>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="<?php echo $pypo ? 'success' : 'danger'; ?>">
|
||||
|
@ -196,17 +197,17 @@ $result = $r1 && $r2;
|
|||
<?php echo _('LibreTime playout service'); ?>
|
||||
</td>
|
||||
<td class="solution <?php if ($pypo) {
|
||||
echo 'check'; ?>">
|
||||
echo 'check'; ?>">
|
||||
<?php
|
||||
} else {
|
||||
?>">
|
||||
<?php echo _('Check that the libretime-playout service is installed correctly in '); ?><code>/etc/systemd/system/</code>,
|
||||
<?php echo _(" and ensure that it's running with "); ?>
|
||||
<br/><code>systemctl status libretime-playout</code><br/>
|
||||
<?php echo _('If not, try '); ?><br/><code>sudo systemctl restart libretime-playout</code>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
} else {
|
||||
?>">
|
||||
<?php echo _('Check that the libretime-playout service is installed correctly in '); ?><code>/etc/systemd/system/</code>,
|
||||
<?php echo _(" and ensure that it's running with "); ?>
|
||||
<br /><code>systemctl status libretime-playout</code><br />
|
||||
<?php echo _('If not, try '); ?><br /><code>sudo systemctl restart libretime-playout</code>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="<?php echo $liquidsoap ? 'success' : 'danger'; ?>">
|
||||
|
@ -217,17 +218,17 @@ $result = $r1 && $r2;
|
|||
<?php echo _('LibreTime liquidsoap service'); ?>
|
||||
</td>
|
||||
<td class="solution <?php if ($liquidsoap) {
|
||||
echo 'check'; ?>" >
|
||||
echo 'check'; ?>">
|
||||
<?php
|
||||
} else {
|
||||
?>">
|
||||
<?php echo _('Check that the libretime-liquidsoap service is installed correctly in '); ?><code>/etc/systemd/system/</code>,
|
||||
<?php echo _(" and ensure that it's running with "); ?>
|
||||
<br/><code>systemctl status libretime-liquidsoap</code><br/>
|
||||
<?php echo _('If not, try '); ?><br/><code>sudo systemctl restart libretime-liquidsoap</code>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
} else {
|
||||
?>">
|
||||
<?php echo _('Check that the libretime-liquidsoap service is installed correctly in '); ?><code>/etc/systemd/system/</code>,
|
||||
<?php echo _(" and ensure that it's running with "); ?>
|
||||
<br /><code>systemctl status libretime-liquidsoap</code><br />
|
||||
<?php echo _('If not, try '); ?><br /><code>sudo systemctl restart libretime-liquidsoap</code>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="<?php echo $celery ? 'success' : 'danger'; ?>">
|
||||
|
@ -238,17 +239,17 @@ $result = $r1 && $r2;
|
|||
<?php echo _('LibreTime Celery Task service'); ?>
|
||||
</td>
|
||||
<td class="solution <?php if ($celery) {
|
||||
echo 'check'; ?>" >
|
||||
echo 'check'; ?>">
|
||||
<?php
|
||||
} else {
|
||||
?>">
|
||||
<?php echo _('Check that the libretime-celery service is installed correctly in '); ?><code>/etc/systemd/system/</code>,
|
||||
<?php echo _(" and ensure that it's running with "); ?>
|
||||
<br/><code>systemctl status libretime-celery</code><br/>
|
||||
<?php echo _('If not, try '); ?><br/><code>sudo systemctl restart libretime-celery</code>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
} else {
|
||||
?>">
|
||||
<?php echo _('Check that the libretime-celery service is installed correctly in '); ?><code>/etc/systemd/system/</code>,
|
||||
<?php echo _(" and ensure that it's running with "); ?>
|
||||
<br /><code>systemctl status libretime-celery</code><br />
|
||||
<?php echo _('If not, try '); ?><br /><code>sudo systemctl restart libretime-celery</code>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="<?php echo $api ? 'success' : 'danger'; ?>">
|
||||
|
@ -259,38 +260,38 @@ $result = $r1 && $r2;
|
|||
<?php echo _('LibreTime API service'); ?>
|
||||
</td>
|
||||
<td class="solution <?php if ($api) {
|
||||
echo 'check'; ?>" >
|
||||
echo 'check'; ?>">
|
||||
<?php
|
||||
} else {
|
||||
?>">
|
||||
<?php echo _('Check that the libretime-api service is installed correctly in '); ?><code>/etc/init.d/</code>,
|
||||
<?php echo _(" and ensure that it's running with "); ?>
|
||||
<br/><code>systemctl status libretime-api</code><br/>
|
||||
<?php echo _('If not, try '); ?><br/><code>sudo systemctl restart libretime-api</code>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
} else {
|
||||
?>">
|
||||
<?php echo _('Check that the libretime-api service is installed correctly in '); ?><code>/etc/init.d/</code>,
|
||||
<?php echo _(" and ensure that it's running with "); ?>
|
||||
<br /><code>systemctl status libretime-api</code><br />
|
||||
<?php echo _('If not, try '); ?><br /><code>sudo systemctl restart libretime-api</code>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<h3>
|
||||
PHP Extension List
|
||||
</h3>
|
||||
<p>
|
||||
<?php
|
||||
global $extensions;
|
||||
$first = true;
|
||||
foreach ($extensions as $ext) {
|
||||
if (!$first) {
|
||||
echo ' | ';
|
||||
} else {
|
||||
$first = false;
|
||||
}
|
||||
echo $ext;
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<h3>
|
||||
PHP Extension List
|
||||
</h3>
|
||||
<p>
|
||||
<?php
|
||||
global $extensions;
|
||||
$first = true;
|
||||
foreach ($extensions as $ext) {
|
||||
if (!$first) {
|
||||
echo ' | ';
|
||||
} else {
|
||||
$first = false;
|
||||
}
|
||||
echo $ext;
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Navigation container (config/array).
|
||||
*
|
||||
|
|
|
@ -184,7 +184,8 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
{
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$elementMap = ['element_title' => isset($track['track_title']) ? $track['track_title'] : '',
|
||||
$elementMap = [
|
||||
'element_title' => isset($track['track_title']) ? $track['track_title'] : '',
|
||||
'element_artist' => isset($track['artist_name']) ? $track['artist_name'] : '',
|
||||
'element_id' => isset($track['id']) ? $track['id'] : '',
|
||||
'element_position' => isset($track['position']) ? $track['position'] : '',
|
||||
|
|
|
@ -12,7 +12,8 @@ class FeedsController extends Zend_Controller_Action
|
|||
|
||||
if ((Application_Model_Preference::getStationPodcastPrivacy()
|
||||
&& $request->getParam('sharing_token') != Application_Model_Preference::getStationPodcastDownloadKey())
|
||||
&& !RestAuth::verifyAuth(true, false, $this)) {
|
||||
&& !RestAuth::verifyAuth(true, false, $this)
|
||||
) {
|
||||
$response->setHttpResponseCode(401);
|
||||
|
||||
return;
|
||||
|
|
|
@ -12,9 +12,9 @@ final class LocaleController extends Zend_Controller_Action
|
|||
echo 'var datatables_dict =' .
|
||||
file_get_contents(
|
||||
Application_Common_OsPath::join(
|
||||
// $_SERVER["DOCUMENT_ROOT"],
|
||||
dirname(__FILE__) . '/../../public/', // Fixing this... -- Albert
|
||||
'js/datatables/i18n/',
|
||||
// $_SERVER["DOCUMENT_ROOT"],
|
||||
dirname(__FILE__) . '/../../public/', // Fixing this... -- Albert
|
||||
'js/datatables/i18n/',
|
||||
$locale . '.txt'
|
||||
)
|
||||
);
|
||||
|
|
|
@ -221,9 +221,9 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$type = $this->_getParam('type');
|
||||
$objInfo = Application_Model_Library::getObjInfo($type);
|
||||
|
||||
// if (!is_null($id)) {
|
||||
// if (!is_null($id)) {
|
||||
Application_Model_Library::changePlaylist($id, $type);
|
||||
// }
|
||||
// }
|
||||
|
||||
try {
|
||||
$obj = new $objInfo['className']($id);
|
||||
|
|
|
@ -53,13 +53,13 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
$this->view->headScript()->appendScript(
|
||||
"var calendarPref = {};\n" .
|
||||
'calendarPref.weekStart = ' . Application_Model_Preference::GetWeekStartDay() . ";\n" .
|
||||
'calendarPref.timestamp = ' . time() . ";\n" .
|
||||
'calendarPref.timezoneOffset = ' . Application_Common_DateHelper::getUserTimezoneOffset() . ";\n" .
|
||||
"calendarPref.timeScale = '" . Application_Model_Preference::GetCalendarTimeScale() . "';\n" .
|
||||
'calendarPref.timeInterval = ' . Application_Model_Preference::GetCalendarTimeInterval() . ";\n" .
|
||||
'calendarPref.weekStartDay = ' . Application_Model_Preference::GetWeekStartDay() . ";\n" .
|
||||
"var calendarEvents = {$events};"
|
||||
'calendarPref.weekStart = ' . Application_Model_Preference::GetWeekStartDay() . ";\n" .
|
||||
'calendarPref.timestamp = ' . time() . ";\n" .
|
||||
'calendarPref.timezoneOffset = ' . Application_Common_DateHelper::getUserTimezoneOffset() . ";\n" .
|
||||
"calendarPref.timeScale = '" . Application_Model_Preference::GetCalendarTimeScale() . "';\n" .
|
||||
'calendarPref.timeInterval = ' . Application_Model_Preference::GetCalendarTimeInterval() . ";\n" .
|
||||
'calendarPref.weekStartDay = ' . Application_Model_Preference::GetWeekStartDay() . ";\n" .
|
||||
"var calendarEvents = {$events};"
|
||||
);
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/contextmenu/jquery.contextMenu.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
@ -731,8 +731,10 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$baseUrl = $this->getRequest()->getBaseUrl();
|
||||
$url = $file->getRelativeFileUrl($baseUrl) . 'download/true';
|
||||
$menu = [];
|
||||
$menu[] = ['action' => ['type' => 'gourl', 'url' => $url],
|
||||
'title' => _('Download'), ];
|
||||
$menu[] = [
|
||||
'action' => ['type' => 'gourl', 'url' => $url],
|
||||
'title' => _('Download'),
|
||||
];
|
||||
|
||||
// returns format jjmenu is looking for.
|
||||
$this->_helper->json->sendJson($menu);
|
||||
|
|
|
@ -106,7 +106,7 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
$userService = new Application_Service_UserService();
|
||||
$currentUser = $userService->getCurrentUser();
|
||||
$previousPageWasLoginScreen = (strpos($previousPage, 'login') !== false)
|
||||
|| (strpos($previousPage, SAAS_LOGIN_REFERRER) !== false);
|
||||
|| (strpos($previousPage, SAAS_LOGIN_REFERRER) !== false);
|
||||
|
||||
// If current user is Super Admin, and they came from the login page,
|
||||
// and they have not seen the setup popup before
|
||||
|
@ -218,9 +218,11 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
|
||||
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($request);
|
||||
|
||||
$opts = ['myShows' => $my_shows,
|
||||
$opts = [
|
||||
'myShows' => $my_shows,
|
||||
'showFilter' => $show_filter,
|
||||
'showInstanceFilter' => $show_instance_filter, ];
|
||||
'showInstanceFilter' => $show_instance_filter,
|
||||
];
|
||||
$showBuilder = new Application_Model_ShowBuilder($startsDT, $endsDT, $opts);
|
||||
|
||||
$data = $showBuilder->getItems();
|
||||
|
|
|
@ -133,8 +133,10 @@ class UserController extends Zend_Controller_Action
|
|||
if ($request->isPost()) {
|
||||
$formData = $request->getPost();
|
||||
|
||||
if ($form->isValid($formData)
|
||||
&& $form->validateLogin($formData['cu_login'], $formData['cu_user_id'])) {
|
||||
if (
|
||||
$form->isValid($formData)
|
||||
&& $form->validateLogin($formData['cu_login'], $formData['cu_user_id'])
|
||||
) {
|
||||
$user = new Application_Model_User($formData['cu_user_id']);
|
||||
// Stupid hack because our schema enforces non-null first_name
|
||||
// even though by default the admin user has no first name... (....)
|
||||
|
@ -154,8 +156,10 @@ class UserController extends Zend_Controller_Action
|
|||
// We don't allow 6 x's as a password.
|
||||
// The reason is because we use that as a password placeholder
|
||||
// on the client side.
|
||||
if (array_key_exists('cu_password', $formData) && ($formData['cu_password'] != 'xxxxxx')
|
||||
&& (!empty($formData['cu_password']))) {
|
||||
if (
|
||||
array_key_exists('cu_password', $formData) && ($formData['cu_password'] != 'xxxxxx')
|
||||
&& (!empty($formData['cu_password']))
|
||||
) {
|
||||
$user->setPassword($formData['cu_password']);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,9 +25,11 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
*/
|
||||
public function __construct(Zend_Acl $aclData, $roleName = 'G')
|
||||
{
|
||||
$this->_errorPage = ['module' => 'default',
|
||||
$this->_errorPage = [
|
||||
'module' => 'default',
|
||||
'controller' => 'error',
|
||||
'action' => 'error', ];
|
||||
'action' => 'error',
|
||||
];
|
||||
|
||||
$this->_roleName = $roleName;
|
||||
|
||||
|
@ -82,9 +84,11 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
*/
|
||||
public function setErrorPage($action, $controller = 'error', $module = 'default')
|
||||
{
|
||||
$this->_errorPage = ['module' => $module,
|
||||
$this->_errorPage = [
|
||||
'module' => $module,
|
||||
'controller' => $controller,
|
||||
'action' => $action, ];
|
||||
'action' => $action,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,8 +36,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
|
|||
'upgrade',
|
||||
'embed',
|
||||
'feeds',
|
||||
])
|
||||
) {
|
||||
])) {
|
||||
// Start the session
|
||||
Zend_Session::start();
|
||||
Application_Model_Auth::pinSessionToClient(Zend_Auth::getInstance());
|
||||
|
|
|
@ -25,7 +25,8 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
|||
->setLabel(_('Custom Username'))
|
||||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new ConditionalNotEmpty(['cb_custom_auth' => '1']), ]);
|
||||
new ConditionalNotEmpty(['cb_custom_auth' => '1']),
|
||||
]);
|
||||
$this->addElement($custom_username);
|
||||
|
||||
// custom password
|
||||
|
@ -37,7 +38,8 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
|||
->setLabel(_('Custom Password'))
|
||||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new ConditionalNotEmpty(['cb_custom_auth' => '1']), ]);
|
||||
new ConditionalNotEmpty(['cb_custom_auth' => '1']),
|
||||
]);
|
||||
$this->addElement($custom_password);
|
||||
|
||||
$showSourceParams = parse_url(Application_Model_Preference::GetLiveDJSourceConnectionURL());
|
||||
|
|
|
@ -106,9 +106,11 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
|
|||
{
|
||||
$elements = $this->getElements();
|
||||
foreach ($elements as $element) {
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden'
|
||||
if (
|
||||
$element->getType() != 'Zend_Form_Element_Hidden'
|
||||
// We should still be able to remove the show logo
|
||||
&& $element->getName() != 'add_show_logo_current_remove') {
|
||||
&& $element->getName() != 'add_show_logo_current_remove'
|
||||
) {
|
||||
$element->setAttrib('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
$notEmptyValidator,
|
||||
$dateValidator, ])
|
||||
$dateValidator,
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$startDate->setAttrib('alt', 'date');
|
||||
$this->addElement($startDate);
|
||||
|
@ -64,7 +65,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
$notEmptyValidator,
|
||||
$dateValidator, ])
|
||||
$dateValidator,
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$endDate->setAttrib('alt', 'date');
|
||||
$this->addElement($endDate);
|
||||
|
@ -77,7 +79,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
$notEmptyValidator,
|
||||
$regexValidator, ])
|
||||
$regexValidator,
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$endTime->setAttrib('alt', 'time');
|
||||
$this->addElement($endTime);
|
||||
|
@ -173,10 +176,12 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
} elseif ($showStartDateTime == $showEndDateTime) {
|
||||
$this->getElement('add_show_duration')->setErrors([_('Cannot have duration 00h 00m')]);
|
||||
$valid = false;
|
||||
} elseif (intval($duration->format('%d')) > 0
|
||||
&& (intval($duration->format('%h')) > 0
|
||||
|| intval($duration->format('%i')) > 0
|
||||
|| intval($duration->format('%s')) > 0)) {
|
||||
} elseif (
|
||||
intval($duration->format('%d')) > 0
|
||||
&& (intval($duration->format('%h')) > 0
|
||||
|| intval($duration->format('%i')) > 0
|
||||
|| intval($duration->format('%s')) > 0)
|
||||
) {
|
||||
$this->getElement('add_show_duration')->setErrors([_('Cannot have duration greater than 24h')]);
|
||||
$valid = false;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,8 @@ class Application_Form_DateRange extends Zend_Form_SubForm
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['YYYY-MM-DD']], ])
|
||||
['date', false, ['YYYY-MM-DD']],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$startDate->setAttrib('alt', 'date');
|
||||
$this->addElement($startDate);
|
||||
|
@ -31,7 +32,8 @@ class Application_Form_DateRange extends Zend_Form_SubForm
|
|||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['HH:mm']],
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$startTime->setAttrib('alt', 'time');
|
||||
$this->addElement($startTime);
|
||||
|
@ -45,7 +47,8 @@ class Application_Form_DateRange extends Zend_Form_SubForm
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['YYYY-MM-DD']], ])
|
||||
['date', false, ['YYYY-MM-DD']],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$endDate->setAttrib('alt', 'date');
|
||||
$this->addElement($endDate);
|
||||
|
@ -59,7 +62,8 @@ class Application_Form_DateRange extends Zend_Form_SubForm
|
|||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['HH:mm']],
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$endTime->setAttrib('alt', 'time');
|
||||
$this->addElement($endTime);
|
||||
|
|
|
@ -198,7 +198,8 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new Zend_Validate_StringLength(['min' => 0, 'max' => 8]),
|
||||
new Zend_Validate_Digits(), ]);
|
||||
new Zend_Validate_Digits(),
|
||||
]);
|
||||
$this->addElement($bpm);
|
||||
|
||||
// Add copyright field
|
||||
|
|
|
@ -18,7 +18,8 @@ class Application_Form_EditUser extends Zend_Form
|
|||
$notDemoValidator = new Application_Validate_NotDemoValidate();
|
||||
|
||||
$this->setDecorators([
|
||||
['ViewScript', ['viewScript' => 'form/edit-user.phtml', 'currentUser' => $currentUser->getLogin()]], ]);
|
||||
['ViewScript', ['viewScript' => 'form/edit-user.phtml', 'currentUser' => $currentUser->getLogin()]],
|
||||
]);
|
||||
$this->setAttrib('id', 'current-user-form');
|
||||
|
||||
$csrf_namespace = new Zend_Session_Namespace('csrf_namespace');
|
||||
|
|
|
@ -127,7 +127,8 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
|||
$podcast_album_override->setValue(Application_Model_Preference::GetPodcastAlbumOverride());
|
||||
$podcast_album_override->setDescription(_('Enabling this feature will cause podcast episode tracks to have their Artist, Title, and Album metatags set from podcast feed values. Note that enabling this feature is recommended in order to ensure reliable scheduling of episodes via smartblocks.'));
|
||||
$podcast_album_override->setSeparator(' '); // No <br> between radio buttons
|
||||
$podcast_album_override->addDecorator('HtmlTag', ['tag' => 'dd',
|
||||
$podcast_album_override->addDecorator('HtmlTag', [
|
||||
'tag' => 'dd',
|
||||
'id' => 'podcastAlbumOverride-element',
|
||||
'class' => 'radio-inline-list',
|
||||
]);
|
||||
|
@ -142,7 +143,8 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
|||
$podcast_auto_smartblock->setValue(Application_Model_Preference::GetPodcastAutoSmartblock());
|
||||
$podcast_auto_smartblock->setDescription(_('If this option is enabled, a new smartblock and playlist matching the newest track of a podcast will be generated immediately upon creation of a new podcast. Note that the "Overwrite Podcast Episode Metatags" feature must also be enabled in order for smartblocks to reliably find episodes.'));
|
||||
$podcast_auto_smartblock->setSeparator(' '); // No <br> between radio buttons
|
||||
$podcast_auto_smartblock->addDecorator('HtmlTag', ['tag' => 'dd',
|
||||
$podcast_auto_smartblock->addDecorator('HtmlTag', [
|
||||
'tag' => 'dd',
|
||||
'id' => 'podcastAutoSmartblock-element',
|
||||
'class' => 'radio-inline-list',
|
||||
]);
|
||||
|
@ -162,7 +164,8 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
|||
to external widgets that can be embedded in your website.'));
|
||||
$third_party_api->setSeparator(' '); // No <br> between radio buttons
|
||||
// $third_party_api->addDecorator(new Zend_Form_Decorator_Label(array('tag' => 'dd', 'class' => 'radio-inline-list')));
|
||||
$third_party_api->addDecorator('HtmlTag', ['tag' => 'dd',
|
||||
$third_party_api->addDecorator('HtmlTag', [
|
||||
'tag' => 'dd',
|
||||
'id' => 'thirdPartyApi-element',
|
||||
'class' => 'radio-inline-list',
|
||||
]);
|
||||
|
@ -219,7 +222,8 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
|||
$feature_preview_mode->setValue(Application_Model_Preference::GetFeaturePreviewMode());
|
||||
$feature_preview_mode->setDescription(_('Enable this to opt-in to test new features.'));
|
||||
$feature_preview_mode->setSeparator(' '); // No <br> between radio buttons
|
||||
$feature_preview_mode->addDecorator('HtmlTag', ['tag' => 'dd',
|
||||
$feature_preview_mode->addDecorator('HtmlTag', [
|
||||
'tag' => 'dd',
|
||||
'id' => 'featurePreviewMode-element',
|
||||
'class' => 'radio-inline-list',
|
||||
]);
|
||||
|
|
|
@ -29,8 +29,10 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
$transition_fade = new Zend_Form_Element_Text('transition_fade');
|
||||
$transition_fade->setLabel(_('Switch Transition Fade (s):'))
|
||||
->setFilters(['StringTrim'])
|
||||
->addValidator('regex', false, ['/^\d*(\.\d+)?$/',
|
||||
'messages' => _('Please enter a time in seconds (eg. 0.5)'), ])
|
||||
->addValidator('regex', false, [
|
||||
'/^\d*(\.\d+)?$/',
|
||||
'messages' => _('Please enter a time in seconds (eg. 0.5)'),
|
||||
])
|
||||
->setValue($defaultFade);
|
||||
$this->addElement($transition_fade);
|
||||
|
||||
|
@ -85,7 +87,8 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
$masterSourceMount->setLabel(_('Master Source Mount:'))
|
||||
->setValue($m_mount)
|
||||
->setValidators([
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ]);
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]],
|
||||
]);
|
||||
$this->addElement($masterSourceMount);
|
||||
|
||||
$showSourceParams = parse_url(Application_Model_Preference::GetLiveDJSourceConnectionURL());
|
||||
|
@ -112,7 +115,8 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
$showSourceMount->setLabel(_('Show Source Mount:'))
|
||||
->setValue($l_mount)
|
||||
->setValidators([
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ]);
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]],
|
||||
]);
|
||||
$this->addElement($showSourceMount);
|
||||
}
|
||||
|
||||
|
@ -126,7 +130,8 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
|
||||
$this->setDecorators(
|
||||
[
|
||||
['ViewScript',
|
||||
[
|
||||
'ViewScript',
|
||||
[
|
||||
'viewScript' => 'form/preferences_livestream.phtml',
|
||||
'master_source_host' => isset($masterSourceHost) ? Application_Model_Preference::GetMasterDJSourceConnectionURL() : '',
|
||||
|
|
|
@ -40,7 +40,8 @@ class Application_Form_Login extends Zend_Form
|
|||
->setAttribs([
|
||||
'autofocus' => 'true',
|
||||
'class' => 'input_text',
|
||||
'required' => 'true', ])
|
||||
'required' => 'true',
|
||||
])
|
||||
->setValue((isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) ? 'admin' : '')
|
||||
->addFilter('StringTrim')
|
||||
->setDecorators(['ViewHelper'])
|
||||
|
|
|
@ -15,8 +15,10 @@ class Application_Form_PasswordChange extends Zend_Form
|
|||
'label' => _('Password'),
|
||||
'required' => true,
|
||||
'filters' => ['stringTrim'],
|
||||
'validators' => [$notEmptyValidator,
|
||||
$stringLengthValidator, ],
|
||||
'validators' => [
|
||||
$notEmptyValidator,
|
||||
$stringLengthValidator,
|
||||
],
|
||||
'decorators' => [
|
||||
'ViewHelper',
|
||||
],
|
||||
|
|
|
@ -12,7 +12,8 @@ class Application_Form_PodcastPreferences extends Zend_Form_SubForm
|
|||
_('Private'),
|
||||
]);
|
||||
$stationPodcastPrivacy->setSeparator(' ');
|
||||
$stationPodcastPrivacy->addDecorator('HtmlTag', ['tag' => 'dd',
|
||||
$stationPodcastPrivacy->addDecorator('HtmlTag', [
|
||||
'tag' => 'dd',
|
||||
'id' => 'stationPodcastPrivacy-element',
|
||||
'class' => 'radio-inline-list',
|
||||
]);
|
||||
|
|
|
@ -5,7 +5,8 @@ class Application_Form_SetupLanguageTimezone extends Zend_Form_SubForm
|
|||
public function init()
|
||||
{
|
||||
$this->setDecorators([
|
||||
['ViewScript', ['viewScript' => 'form/setup-lang-timezone.phtml']], ]);
|
||||
['ViewScript', ['viewScript' => 'form/setup-lang-timezone.phtml']],
|
||||
]);
|
||||
|
||||
$csrf_namespace = new Zend_Session_Namespace('csrf_namespace');
|
||||
$csrf_element = new Zend_Form_Element_Hidden('csrf');
|
||||
|
|
|
@ -19,7 +19,8 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['YYYY-MM-DD']], ])
|
||||
['date', false, ['YYYY-MM-DD']],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$startDate->setAttrib('alt', 'date');
|
||||
$this->addElement($startDate);
|
||||
|
@ -33,7 +34,8 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
|||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['HH:mm']],
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$startTime->setAttrib('alt', 'time');
|
||||
$this->addElement($startTime);
|
||||
|
@ -47,7 +49,8 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['YYYY-MM-DD']], ])
|
||||
['date', false, ['YYYY-MM-DD']],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$endDate->setAttrib('alt', 'date');
|
||||
$this->addElement($endDate);
|
||||
|
@ -61,7 +64,8 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
|||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['HH:mm']],
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$endTime->setAttrib('alt', 'time');
|
||||
$this->addElement($endTime);
|
||||
|
|
|
@ -17,7 +17,8 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['YYYY-MM-DD']], ])
|
||||
['date', false, ['YYYY-MM-DD']],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$startDate->setAttrib('alt', 'date');
|
||||
$this->addElement($startDate);
|
||||
|
@ -31,7 +32,8 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
|
|||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['HH:mm']],
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$startTime->setAttrib('alt', 'time');
|
||||
$this->addElement($startTime);
|
||||
|
@ -45,7 +47,8 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['YYYY-MM-DD']], ])
|
||||
['date', false, ['YYYY-MM-DD']],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$endDate->setAttrib('alt', 'date');
|
||||
$this->addElement($endDate);
|
||||
|
@ -59,7 +62,8 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
|
|||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['HH:mm']],
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$endTime->setAttrib('alt', 'time');
|
||||
$this->addElement($endTime);
|
||||
|
|
|
@ -235,7 +235,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
Application_Common_DateHelper::UTCStringToUserTimezoneString($constraint['value']);
|
||||
if (isset($constraint['extra'])) {
|
||||
$constraint['extra'] =
|
||||
Application_Common_DateHelper::UTCStringToUserTimezoneString($constraint['extra']);
|
||||
Application_Common_DateHelper::UTCStringToUserTimezoneString($constraint['extra']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -382,8 +382,10 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
// The challenge here is that datetime
|
||||
if (isset($criteriaKeys[$i])) {
|
||||
$modifierTest = (string) $storedCrit['crit'][$criteriaKeys[$i]][$j]['modifier'];
|
||||
if (isset($criteriaType) && $criteriaType == 'tt'
|
||||
&& preg_match('/is|is not/', $modifierTest) == 1) {
|
||||
if (
|
||||
isset($criteriaType) && $criteriaType == 'tt'
|
||||
&& preg_match('/is|is not/', $modifierTest) == 1
|
||||
) {
|
||||
$criteriaValue = new Zend_Form_Element_Select('sp_criteria_value_' . $i . '_' . $j);
|
||||
$criteriaValue->setAttrib('class', 'input_select sp_input_select')->setDecorators(['viewHelper']);
|
||||
|
||||
|
@ -411,13 +413,17 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
// this is used below to test whether the datetime select should be shown or hidden
|
||||
$relativeDateTime = false;
|
||||
$modifierTest = (string) $storedCrit['crit'][$criteriaKeys[$i]][$j]['modifier'];
|
||||
if (isset($criteriaType) && $criteriaType == 'd'
|
||||
&& preg_match('/before|after|between/', $modifierTest) == 1) {
|
||||
if (
|
||||
isset($criteriaType) && $criteriaType == 'd'
|
||||
&& preg_match('/before|after|between/', $modifierTest) == 1
|
||||
) {
|
||||
// set relativeDatetime boolean to true so that the datetime select is displayed below
|
||||
$relativeDateTime = true;
|
||||
$criteriaValue->setValue(filter_var($storedCrit['crit'][$criteriaKeys[$i]][$j]['value'], FILTER_SANITIZE_NUMBER_INT));
|
||||
} elseif (isset($criteriaType) && $criteriaType == 'tt'
|
||||
&& preg_match('/is|is not/', $modifierTest) == 1) {
|
||||
} elseif (
|
||||
isset($criteriaType) && $criteriaType == 'tt'
|
||||
&& preg_match('/is|is not/', $modifierTest) == 1
|
||||
) {
|
||||
// set relativeDatetime boolean to true so that the datetime select is displayed below
|
||||
$relativeDateTime = false;
|
||||
|
||||
|
@ -449,9 +455,11 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
$criteriaDatetimeSelect->setAttrib('disabled', 'disabled');
|
||||
}
|
||||
// check if the value is stored and it is a relative datetime field
|
||||
if (isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['value'], $criteriaType)
|
||||
&& $criteriaType == 'd'
|
||||
&& preg_match('/before|after|between/', $modifierTest) == 1) {
|
||||
if (
|
||||
isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['value'], $criteriaType)
|
||||
&& $criteriaType == 'd'
|
||||
&& preg_match('/before|after|between/', $modifierTest) == 1
|
||||
) {
|
||||
// need to remove any leading numbers stored in the database
|
||||
$dateTimeSelectValue = preg_replace('/[0-9]+/', '', $storedCrit['crit'][$criteriaKeys[$i]][$j]['value']);
|
||||
// need to strip white from front and ago from the end to match with the value of the time unit select dropdown
|
||||
|
@ -489,8 +497,10 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
$criteriaExtraDatetimeSelect->setAttrib('class', 'input_select sp_input_select')
|
||||
->setDecorators(['viewHelper']);
|
||||
|
||||
if (isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['extra'])
|
||||
&& $modifierTest == 'between') {
|
||||
if (
|
||||
isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['extra'])
|
||||
&& $modifierTest == 'between'
|
||||
) {
|
||||
// need to remove the leading numbers stored in the database
|
||||
$extraDateTimeSelectValue = preg_replace('/[0-9]+/', '', $storedCrit['crit'][$criteriaKeys[$i]][$j]['extra']);
|
||||
// need to strip white from front and ago from the end to match with the value of the time unit select dropdown
|
||||
|
@ -505,8 +515,8 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
$criteriaExtraDatetimeSelect->setAttrib('disabled', 'disabled');
|
||||
}
|
||||
$this->addElement($criteriaExtraDatetimeSelect);
|
||||
}// for
|
||||
}// for
|
||||
} // for
|
||||
} // for
|
||||
|
||||
$repeatTracks = new Zend_Form_Element_Checkbox('sp_repeat_tracks');
|
||||
$repeatTracks->setDecorators(['viewHelper'])
|
||||
|
@ -576,8 +586,10 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
$this->addElement($shuffle);
|
||||
|
||||
$this->setDecorators([
|
||||
['ViewScript', ['viewScript' => 'form/smart-block-criteria.phtml', 'openOption' => $openSmartBlockOption,
|
||||
'criteriasLength' => $numElements, 'modRowMap' => $modRowMap, ]],
|
||||
['ViewScript', [
|
||||
'viewScript' => 'form/smart-block-criteria.phtml', 'openOption' => $openSmartBlockOption,
|
||||
'criteriasLength' => $numElements, 'modRowMap' => $modRowMap,
|
||||
]],
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -889,8 +901,10 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
}
|
||||
}
|
||||
}
|
||||
} elseif ($column->getType() == PropelColumnTypes::INTEGER
|
||||
&& $d['sp_criteria_field'] != 'owner_id') {
|
||||
} elseif (
|
||||
$column->getType() == PropelColumnTypes::INTEGER
|
||||
&& $d['sp_criteria_field'] != 'owner_id'
|
||||
) {
|
||||
if (!is_numeric($d['sp_criteria_value'])) {
|
||||
$element->addError(_('The value has to be numeric'));
|
||||
$isValid = false;
|
||||
|
@ -912,9 +926,9 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
$element->addError(_('Value cannot be empty'));
|
||||
$isValid = false;
|
||||
}
|
||||
}// end foreach
|
||||
}// for loop
|
||||
}// if
|
||||
} // end foreach
|
||||
} // for loop
|
||||
} // if
|
||||
|
||||
return $isValid;
|
||||
}
|
||||
|
|
|
@ -81,8 +81,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
$output = new Zend_Form_Element_Select('output');
|
||||
$output->setLabel(_('Service Type:'))
|
||||
->setMultiOptions(['icecast' => 'Icecast', 'shoutcast' => 'SHOUTcast'])
|
||||
->setValue($useDefaults ? $streamDefaults['output'] :
|
||||
(isset($setting[$prefix . '_output']) ? $setting[$prefix . '_output'] : 'icecast'))
|
||||
->setValue($useDefaults ? $streamDefaults['output'] : (isset($setting[$prefix . '_output']) ? $setting[$prefix . '_output'] : 'icecast'))
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($output);
|
||||
|
||||
|
@ -96,18 +95,17 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
|
||||
$host = new Zend_Form_Element_Text('host');
|
||||
$host->setLabel(_('Server'))
|
||||
->setValue($useDefaults ? $streamDefaults['host'] :
|
||||
(isset($setting[$prefix . '_host']) ? $setting[$prefix . '_host'] : ''))
|
||||
->setValue($useDefaults ? $streamDefaults['host'] : (isset($setting[$prefix . '_host']) ? $setting[$prefix . '_host'] : ''))
|
||||
->setValidators([
|
||||
['regex', false, ['/^[0-9a-zA-Z-_.]+$/', 'messages' => _('Invalid character entered')]], ])
|
||||
['regex', false, ['/^[0-9a-zA-Z-_.]+$/', 'messages' => _('Invalid character entered')]],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$host->setAttrib('alt', 'domain');
|
||||
$this->addElement($host);
|
||||
|
||||
$port = new Zend_Form_Element_Text('port');
|
||||
$port->setLabel(_('Port'))
|
||||
->setValue($useDefaults ? $streamDefaults['port'] :
|
||||
(isset($setting[$prefix . '_port']) ? $setting[$prefix . '_port'] : ''))
|
||||
->setValue($useDefaults ? $streamDefaults['port'] : (isset($setting[$prefix . '_port']) ? $setting[$prefix . '_port'] : ''))
|
||||
->setValidators([new Zend_Validate_Between(['min' => 0, 'max' => 99999])])
|
||||
->addValidator('regex', false, ['pattern' => '/^[0-9]+$/', 'messages' => ['regexNotMatch' => _('Only numbers are allowed.')]])
|
||||
->setDecorators(['ViewHelper']);
|
||||
|
@ -115,10 +113,10 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
|
||||
$pass = new Zend_Form_Element_Text('pass');
|
||||
$pass->setLabel(_('Password'))
|
||||
->setValue($useDefaults ? $streamDefaults['pass'] :
|
||||
(isset($setting[$prefix . '_pass']) ? $setting[$prefix . '_pass'] : ''))
|
||||
->setValue($useDefaults ? $streamDefaults['pass'] : (isset($setting[$prefix . '_pass']) ? $setting[$prefix . '_pass'] : ''))
|
||||
->setValidators([
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$pass->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($pass);
|
||||
|
@ -133,7 +131,8 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
$url->setLabel(_('URL'))
|
||||
->setValue(isset($setting[$prefix . '_url']) ? $setting[$prefix . '_url'] : '')
|
||||
->setValidators([
|
||||
['regex', false, ['/^[0-9a-zA-Z\-_.:\/]+$/', 'messages' => _('Invalid character entered')]], ])
|
||||
['regex', false, ['/^[0-9a-zA-Z\-_.:\/]+$/', 'messages' => _('Invalid character entered')]],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$url->setAttrib('alt', 'url');
|
||||
$this->addElement($url);
|
||||
|
@ -152,20 +151,20 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
|
||||
$mount = new Zend_Form_Element_Text('mount');
|
||||
$mount->setLabel(_('Mount Point'))
|
||||
->setValue($useDefaults ? $streamDefaults['mount'] :
|
||||
(isset($setting[$prefix . '_mount']) ? $setting[$prefix . '_mount'] : ''))
|
||||
->setValue($useDefaults ? $streamDefaults['mount'] : (isset($setting[$prefix . '_mount']) ? $setting[$prefix . '_mount'] : ''))
|
||||
->setValidators([
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$mount->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($mount);
|
||||
|
||||
$user = new Zend_Form_Element_Text('user');
|
||||
$user->setLabel(_('Username'))
|
||||
->setValue($useDefaults ? $streamDefaults['user'] :
|
||||
(isset($setting[$prefix . '_user']) ? $setting[$prefix . '_user'] : ''))
|
||||
->setValue($useDefaults ? $streamDefaults['user'] : (isset($setting[$prefix . '_user']) ? $setting[$prefix . '_user'] : ''))
|
||||
->setValidators([
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$user->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($user);
|
||||
|
@ -174,7 +173,8 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
$adminUser->setLabel(_('Admin User'))
|
||||
->setValue(Application_Model_StreamSetting::getAdminUser($prefix))
|
||||
->setValidators([
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$adminUser->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($adminUser);
|
||||
|
@ -183,7 +183,8 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
$adminPass->setLabel(_('Admin Password'))
|
||||
->setValue(Application_Model_StreamSetting::getAdminPass($prefix))
|
||||
->setValidators([
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]],
|
||||
])
|
||||
->setDecorators(['ViewHelper']);
|
||||
$adminPass->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($adminPass);
|
||||
|
@ -191,10 +192,12 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
$liquidsoap_error_msg = '<div class="stream-status status-info"><p>' . _('Getting information from the server...') . '</p></div>';
|
||||
|
||||
$this->setDecorators([
|
||||
['ViewScript', ['viewScript' => 'form/stream-setting-form.phtml',
|
||||
['ViewScript', [
|
||||
'viewScript' => 'form/stream-setting-form.phtml',
|
||||
'stream_number' => $stream_number,
|
||||
'enabled' => $enable->getValue(),
|
||||
'liquidsoap_error_msg' => $liquidsoap_error_msg, ]],
|
||||
'liquidsoap_error_msg' => $liquidsoap_error_msg,
|
||||
]],
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -236,7 +239,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
if (Application_Model_Preference::getUsingCustomStreamSettings()) {
|
||||
$element->setAttrib('disabled', null);
|
||||
} elseif (!(in_array($element->getName(), static::$customizable)
|
||||
|| $element->getType() == 'Zend_Form_Element_Hidden')) {
|
||||
|| $element->getType() == 'Zend_Form_Element_Hidden')) {
|
||||
$element->setAttrib('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* custom filter for image uploads.
|
||||
*
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Check if a field is empty but only when specific fields have specific values.
|
||||
*
|
||||
|
|
|
@ -52,7 +52,8 @@ class Application_Model_Block implements Application_Model_LibraryEditable
|
|||
'is in the range' => Criteria::CUSTOM,
|
||||
'before' => Criteria::CUSTOM,
|
||||
'after' => Criteria::CUSTOM,
|
||||
'between' => Criteria::CUSTOM, ];
|
||||
'between' => Criteria::CUSTOM,
|
||||
];
|
||||
|
||||
private static $criteria2PeerMap = [
|
||||
0 => 'Select criteria',
|
||||
|
@ -978,8 +979,10 @@ SQL;
|
|||
throw $e;
|
||||
}
|
||||
|
||||
return ['cliplength' => $cliplength, 'cueIn' => $cueIn, 'cueOut' => $cueOut, 'length' => $this->getUnformatedLength(),
|
||||
'fadeIn' => $fadeIn, 'fadeOut' => $fadeOut, ];
|
||||
return [
|
||||
'cliplength' => $cliplength, 'cueIn' => $cueIn, 'cueOut' => $cueOut, 'length' => $this->getUnformatedLength(),
|
||||
'fadeIn' => $fadeIn, 'fadeOut' => $fadeOut,
|
||||
];
|
||||
}
|
||||
|
||||
public function getAllPLMetaData()
|
||||
|
@ -1487,7 +1490,8 @@ SQL;
|
|||
$storedCrit['limit'] = [
|
||||
'value' => $value,
|
||||
'modifier' => $modifier,
|
||||
'display_modifier' => _($modifier), ];
|
||||
'display_modifier' => _($modifier),
|
||||
];
|
||||
} elseif ($criteria == 'repeat_tracks') {
|
||||
$storedCrit['repeat_tracks'] = ['value' => $value];
|
||||
} elseif ($criteria == 'overflow_tracks') {
|
||||
|
@ -1502,7 +1506,8 @@ SQL;
|
|||
'extra' => $extra,
|
||||
'criteria_group' => $criteriagroup,
|
||||
'display_name' => $criteriaOptions[$criteria],
|
||||
'display_modifier' => $modifierOptions[$modifier], ];
|
||||
'display_modifier' => $modifierOptions[$modifier],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1583,7 +1588,8 @@ SQL;
|
|||
$storedCrit['limit'] = [
|
||||
'value' => $value,
|
||||
'modifier' => $modifier,
|
||||
'display_modifier' => _($modifier), ];
|
||||
'display_modifier' => _($modifier),
|
||||
];
|
||||
} elseif ($criteria == 'repeat_tracks') {
|
||||
$storedCrit['repeat_tracks'] = ['value' => $value];
|
||||
} elseif ($criteria == 'overflow_tracks') {
|
||||
|
@ -1597,7 +1603,8 @@ SQL;
|
|||
'modifier' => $modifier,
|
||||
'extra' => $extra,
|
||||
'display_name' => $criteriaOptions[$criteria],
|
||||
'display_modifier' => $modifierOptions[$modifier], ];
|
||||
'display_modifier' => $modifierOptions[$modifier],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,30 +17,38 @@ class Application_Model_Dashboard
|
|||
return null;
|
||||
}
|
||||
|
||||
return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
|
||||
return [
|
||||
'name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
|
||||
'starts' => $row[0]['starts'],
|
||||
'ends' => $row[0]['ends'], ];
|
||||
'ends' => $row[0]['ends'],
|
||||
];
|
||||
}
|
||||
if (count($row) == 0) {
|
||||
if ($showInstance->isRecorded()) {
|
||||
// last item is a show instance
|
||||
return ['name' => $showInstance->getName(),
|
||||
return [
|
||||
'name' => $showInstance->getName(),
|
||||
'starts' => $showInstance->getShowInstanceStart(),
|
||||
'ends' => $showInstance->getShowInstanceEnd(), ];
|
||||
'ends' => $showInstance->getShowInstanceEnd(),
|
||||
];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
// return the one that started later.
|
||||
if ($row[0]['starts'] >= $showInstance->getShowInstanceStart()) {
|
||||
return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
|
||||
return [
|
||||
'name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
|
||||
'starts' => $row[0]['starts'],
|
||||
'ends' => $row[0]['ends'], ];
|
||||
'ends' => $row[0]['ends'],
|
||||
];
|
||||
}
|
||||
|
||||
return ['name' => $showInstance->getName(),
|
||||
return [
|
||||
'name' => $showInstance->getName(),
|
||||
'starts' => $showInstance->getShowInstanceStart(),
|
||||
'ends' => $showInstance->getShowInstanceEnd(), ];
|
||||
'ends' => $showInstance->getShowInstanceEnd(),
|
||||
];
|
||||
}
|
||||
|
||||
public static function GetCurrentItem($p_timeNow)
|
||||
|
@ -65,30 +73,36 @@ class Application_Model_Dashboard
|
|||
* in the future.
|
||||
*/
|
||||
|
||||
return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
|
||||
return [
|
||||
'name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
|
||||
'artwork_data' => $row[0]['artwork_data'],
|
||||
'starts' => $row[0]['starts'],
|
||||
'ends' => $row[0]['ends'], ];
|
||||
'ends' => $row[0]['ends'],
|
||||
];
|
||||
}
|
||||
if (count($row) == 0) {
|
||||
// last item is a show instance
|
||||
if ($showInstance->isRecorded()) {
|
||||
return ['name' => $showInstance->getName(),
|
||||
return [
|
||||
'name' => $showInstance->getName(),
|
||||
'starts' => $showInstance->getShowInstanceStart(),
|
||||
'ends' => $showInstance->getShowInstanceEnd(),
|
||||
'media_item_played' => false,
|
||||
'record' => true, ];
|
||||
'record' => true,
|
||||
];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
|
||||
return [
|
||||
'name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
|
||||
'artwork_data' => $row[0]['artwork_data'],
|
||||
'starts' => $row[0]['starts'],
|
||||
'ends' => $row[0]['ends'],
|
||||
'media_item_played' => $row[0]['media_item_played'],
|
||||
'record' => 0, ];
|
||||
'record' => 0,
|
||||
];
|
||||
}
|
||||
|
||||
public static function GetNextItem($p_timeNow)
|
||||
|
@ -106,17 +120,21 @@ class Application_Model_Dashboard
|
|||
return null;
|
||||
}
|
||||
|
||||
return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
|
||||
return [
|
||||
'name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
|
||||
'artwork_data' => $row[0]['artwork_data'],
|
||||
'starts' => $row[0]['starts'],
|
||||
'ends' => $row[0]['ends'], ];
|
||||
'ends' => $row[0]['ends'],
|
||||
];
|
||||
}
|
||||
if (count($row) == 0) {
|
||||
if ($showInstance->isRecorded()) {
|
||||
// last item is a show instance
|
||||
return ['name' => $showInstance->getName(),
|
||||
return [
|
||||
'name' => $showInstance->getName(),
|
||||
'starts' => $showInstance->getShowInstanceStart(),
|
||||
'ends' => $showInstance->getShowInstanceEnd(), ];
|
||||
'ends' => $showInstance->getShowInstanceEnd(),
|
||||
];
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -124,14 +142,18 @@ class Application_Model_Dashboard
|
|||
// return the one that starts sooner.
|
||||
|
||||
if ($row[0]['starts'] <= $showInstance->getShowInstanceStart()) {
|
||||
return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
|
||||
return [
|
||||
'name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
|
||||
'artwork_data' => $row[0]['artwork_data'],
|
||||
'starts' => $row[0]['starts'],
|
||||
'ends' => $row[0]['ends'], ];
|
||||
'ends' => $row[0]['ends'],
|
||||
];
|
||||
}
|
||||
|
||||
return ['name' => $showInstance->getName(),
|
||||
return [
|
||||
'name' => $showInstance->getName(),
|
||||
'starts' => $showInstance->getShowInstanceStart(),
|
||||
'ends' => $showInstance->getShowInstanceEnd(), ];
|
||||
'ends' => $showInstance->getShowInstanceEnd(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,7 +105,8 @@ class Application_Model_Datatables
|
|||
$debug = [
|
||||
'$new_index' => $new_index,
|
||||
'$currentPos' => $currentPos,
|
||||
'$orig2searchTerm' => $orig2searchTerm, ];
|
||||
'$orig2searchTerm' => $orig2searchTerm,
|
||||
];
|
||||
Logging::warn($debug);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ SQL;
|
|||
|
||||
foreach ($enabledStreamIds as $sId) {
|
||||
$sql = 'SELECT value FROM cc_stream_setting'
|
||||
. ' WHERE keyname = :key';
|
||||
. ' WHERE keyname = :key';
|
||||
|
||||
$result = Application_Common_Database::prepareAndExecute($sql, ['key' => $sId . '_mount'], 'single');
|
||||
|
||||
|
@ -120,8 +120,10 @@ SQL;
|
|||
// tricking javascript so it thinks the server timezone is in UTC
|
||||
$average_listeners = array_sum(array_column($data, 'listeners')) / count($data);
|
||||
$max_num_listeners = max(array_column($data, 'listeners'));
|
||||
$entry = ['show' => $showName, 'time' => $t->format('Y-m-d H:i:s'), 'average_number_of_listeners' => $average_listeners,
|
||||
'maximum_number_of_listeners' => $max_num_listeners, ];
|
||||
$entry = [
|
||||
'show' => $showName, 'time' => $t->format('Y-m-d H:i:s'), 'average_number_of_listeners' => $average_listeners,
|
||||
'maximum_number_of_listeners' => $max_num_listeners,
|
||||
];
|
||||
array_push($showData, $entry);
|
||||
}
|
||||
}
|
||||
|
@ -195,7 +197,8 @@ SQL;
|
|||
|
||||
Application_Common_Database::prepareAndExecute(
|
||||
$stats_sql,
|
||||
['timestamp_id' => $timestamp_id,
|
||||
[
|
||||
'timestamp_id' => $timestamp_id,
|
||||
'listener_count' => $dp['num_listeners'],
|
||||
'mount_name_id' => $mount_name_id,
|
||||
]
|
||||
|
|
|
@ -6,9 +6,9 @@ class Application_Model_LiveLog
|
|||
{
|
||||
try {
|
||||
$sql = 'SELECT * FROM CC_LIVE_LOG'
|
||||
. ' WHERE state = :state'
|
||||
. " and (start_time >= (now() - INTERVAL '1 day'))"
|
||||
. ' ORDER BY id';
|
||||
. ' WHERE state = :state'
|
||||
. " and (start_time >= (now() - INTERVAL '1 day'))"
|
||||
. ' ORDER BY id';
|
||||
$rows = Application_Common_Database::prepareAndExecute(
|
||||
$sql,
|
||||
[':state' => 'L'],
|
||||
|
@ -37,7 +37,7 @@ class Application_Model_LiveLog
|
|||
array_push($rows, $last_row);
|
||||
foreach ($rows as $row) {
|
||||
$sql_delete = 'DELETE FROM CC_LIVE_LOG'
|
||||
. ' WHERE id = :id';
|
||||
. ' WHERE id = :id';
|
||||
Application_Common_Database::prepareAndExecute(
|
||||
$sql_delete,
|
||||
[':id' => $row['id']],
|
||||
|
@ -88,7 +88,7 @@ class Application_Model_LiveLog
|
|||
if (!$p_keepData) {
|
||||
// Delete data we just used to start a new log history
|
||||
$sql_delete = 'DELETE FROM CC_LIVE_LOG'
|
||||
. ' WHERE id = :id';
|
||||
. ' WHERE id = :id';
|
||||
Application_Common_Database::prepareAndExecute(
|
||||
$sql_delete,
|
||||
[':id' => $row['id']],
|
||||
|
@ -118,9 +118,9 @@ class Application_Model_LiveLog
|
|||
{
|
||||
try {
|
||||
$sql_get_logs = 'SELECT * FROM CC_LIVE_LOG'
|
||||
. ' WHERE state = :state'
|
||||
. " and (start_time >= (now() - INTERVAL '1 day'))"
|
||||
. ' ORDER BY id';
|
||||
. ' WHERE state = :state'
|
||||
. " and (start_time >= (now() - INTERVAL '1 day'))"
|
||||
. ' ORDER BY id';
|
||||
|
||||
$rows = Application_Common_Database::prepareAndExecute(
|
||||
$sql_get_logs,
|
||||
|
@ -150,7 +150,7 @@ class Application_Model_LiveLog
|
|||
array_push($rows, $last_row);
|
||||
foreach ($rows as $row) {
|
||||
$sql_delete = 'DELETE FROM CC_LIVE_LOG'
|
||||
. ' WHERE id = :id';
|
||||
. ' WHERE id = :id';
|
||||
Application_Common_Database::prepareAndExecute(
|
||||
$sql_delete,
|
||||
[':id' => $row['id']],
|
||||
|
@ -171,10 +171,10 @@ class Application_Model_LiveLog
|
|||
*/
|
||||
foreach ($rows as $row) {
|
||||
$sql_get_tracks = 'SELECT * FROM cc_schedule'
|
||||
. ' WHERE starts >= :starts1'
|
||||
. ' AND starts < :starts2'
|
||||
. ' AND file_id IS NOT NULL'
|
||||
. ' AND media_item_played IS TRUE';
|
||||
. ' WHERE starts >= :starts1'
|
||||
. ' AND starts < :starts2'
|
||||
. ' AND file_id IS NOT NULL'
|
||||
. ' AND media_item_played IS TRUE';
|
||||
$params = [
|
||||
':starts1' => $row['start_time'],
|
||||
':starts2' => $row['end_time'],
|
||||
|
@ -269,7 +269,7 @@ class Application_Model_LiveLog
|
|||
if (!$p_keepData) {
|
||||
// Delete row because we do not need data anymore
|
||||
$sql_delete = 'DELETE FROM CC_LIVE_LOG'
|
||||
. ' WHERE id = :id';
|
||||
. ' WHERE id = :id';
|
||||
Application_Common_Database::prepareAndExecute(
|
||||
$sql_delete,
|
||||
[':id' => $row['id']],
|
||||
|
@ -320,7 +320,7 @@ class Application_Model_LiveLog
|
|||
* has ended
|
||||
*/
|
||||
$sql_select = 'SELECT max(id) from CC_LIVE_LOG'
|
||||
. ' WHERE (state= :state1 and end_time is NULL) or (state= :state2 and end_time is NULL)';
|
||||
. ' WHERE (state= :state1 and end_time is NULL) or (state= :state2 and end_time is NULL)';
|
||||
$params = [
|
||||
':state1' => 'L',
|
||||
':state2' => 'S',
|
||||
|
@ -333,7 +333,7 @@ class Application_Model_LiveLog
|
|||
|
||||
if ($id == null) {
|
||||
$sql_insert = 'INSERT INTO CC_LIVE_LOG (state, start_time)'
|
||||
. ' VALUES (:state, :start)';
|
||||
. ' VALUES (:state, :start)';
|
||||
$params = [
|
||||
':state' => $state,
|
||||
':start' => $dateTime->format(DEFAULT_TIMESTAMP_FORMAT),
|
||||
|
@ -364,7 +364,7 @@ class Application_Model_LiveLog
|
|||
|
||||
if (($dj_live == 'off' && $master_live == 'off') || $state == 'S' || $override) {
|
||||
$sql = 'SELECT id, state from cc_live_log'
|
||||
. ' where id in (select max(id) from cc_live_log)';
|
||||
. ' where id in (select max(id) from cc_live_log)';
|
||||
$row = Application_Common_Database::prepareAndExecute(
|
||||
$sql,
|
||||
[],
|
||||
|
@ -376,8 +376,8 @@ class Application_Model_LiveLog
|
|||
*/
|
||||
if ($row['state'] == $state) {
|
||||
$update_sql = 'UPDATE CC_LIVE_LOG'
|
||||
. ' SET end_time = :end'
|
||||
. ' WHERE id = :id';
|
||||
. ' SET end_time = :end'
|
||||
. ' WHERE id = :id';
|
||||
$params = [
|
||||
':end' => $dateTime->format(DEFAULT_TIMESTAMP_FORMAT),
|
||||
':id' => $row['id'],
|
||||
|
|
|
@ -230,7 +230,8 @@ SQL;
|
|||
// Logging::info($sql);
|
||||
|
||||
$params = [
|
||||
':playlist_id1' => $this->id, ':playlist_id2' => $this->id, ':playlist_id3' => $this->id, ];
|
||||
':playlist_id1' => $this->id, ':playlist_id2' => $this->id, ':playlist_id3' => $this->id,
|
||||
];
|
||||
if ($filterFiles) {
|
||||
$params[':file_exists'] = $filterFiles;
|
||||
}
|
||||
|
@ -401,7 +402,8 @@ SQL;
|
|||
if (isset($obj)) {
|
||||
if (($obj instanceof CcFiles && $obj->visible())
|
||||
|| $obj instanceof CcWebstream
|
||||
|| $obj instanceof CcBlock) {
|
||||
|| $obj instanceof CcBlock
|
||||
) {
|
||||
$entry = $this->plItem;
|
||||
$entry['id'] = $obj->getDbId();
|
||||
$entry['pos'] = $pos;
|
||||
|
@ -409,19 +411,19 @@ SQL;
|
|||
|
||||
if ($obj instanceof CcFiles && $obj) {
|
||||
$entry['cuein'] = isset($p_item['cuein']) ?
|
||||
$p_item['cuein'] : $obj->getDbCuein();
|
||||
$p_item['cuein'] : $obj->getDbCuein();
|
||||
|
||||
$entry['cueout'] = isset($p_item['cueout']) ?
|
||||
$p_item['cueout'] : $obj->getDbCueout();
|
||||
$p_item['cueout'] : $obj->getDbCueout();
|
||||
|
||||
$cue_in = isset($p_item['cueInSec']) ?
|
||||
$p_item['cueInSec'] : Application_Common_DateHelper::calculateLengthInSeconds($entry['cuein']);
|
||||
$p_item['cueInSec'] : Application_Common_DateHelper::calculateLengthInSeconds($entry['cuein']);
|
||||
|
||||
$cue_out = isset($p_item['cueOutSec']) ?
|
||||
$p_item['cueOutSec'] : Application_Common_DateHelper::calculateLengthInSeconds($entry['cueout']);
|
||||
$p_item['cueOutSec'] : Application_Common_DateHelper::calculateLengthInSeconds($entry['cueout']);
|
||||
|
||||
$entry['cliplength'] = isset($p_item['length']) ?
|
||||
$p_item['length'] : Application_Common_DateHelper::secondsToPlaylistTime($cue_out - $cue_in);
|
||||
$p_item['length'] : Application_Common_DateHelper::secondsToPlaylistTime($cue_out - $cue_in);
|
||||
} elseif ($obj instanceof CcWebstream && $obj) {
|
||||
$entry['cuein'] = '00:00:00';
|
||||
$entry['cueout'] = $entry['cliplength'];
|
||||
|
@ -914,8 +916,10 @@ SQL;
|
|||
throw $e;
|
||||
}
|
||||
|
||||
return ['cliplength' => $cliplength, 'cueIn' => $cueIn, 'cueOut' => $cueOut, 'length' => $this->getLength(),
|
||||
'fadeIn' => $fadeIn, 'fadeOut' => $fadeOut, ];
|
||||
return [
|
||||
'cliplength' => $cliplength, 'cueIn' => $cueIn, 'cueOut' => $cueOut, 'length' => $this->getLength(),
|
||||
'fadeIn' => $fadeIn, 'fadeOut' => $fadeOut,
|
||||
];
|
||||
}
|
||||
|
||||
public function getAllPLMetaData()
|
||||
|
|
|
@ -157,7 +157,7 @@ class Application_Model_Preference
|
|||
|
||||
// Check if key already exists
|
||||
$sql = 'SELECT COUNT(*) FROM cc_pref'
|
||||
. ' WHERE keystr = :key';
|
||||
. ' WHERE keystr = :key';
|
||||
|
||||
$paramMap = [];
|
||||
$paramMap[':key'] = $key;
|
||||
|
@ -177,7 +177,7 @@ class Application_Model_Preference
|
|||
$res = '';
|
||||
} else {
|
||||
$sql = 'SELECT valstr FROM cc_pref'
|
||||
. ' WHERE keystr = :key';
|
||||
. ' WHERE keystr = :key';
|
||||
|
||||
$paramMap = [];
|
||||
$paramMap[':key'] = $key;
|
||||
|
@ -667,10 +667,12 @@ class Application_Model_Preference
|
|||
if (isset($info[1])) {
|
||||
$key = str_replace(' ', '_', trim($info[0]));
|
||||
$key = strtoupper($key);
|
||||
if ($key == 'WEB_SERVER' || $key == 'CPU' || $key == 'OS' || $key == 'TOTAL_RAM'
|
||||
|| $key == 'FREE_RAM' || $key == 'AIRTIME_VERSION' || $key == 'KERNAL_VERSION'
|
||||
|| $key == 'MACHINE_ARCHITECTURE' || $key == 'TOTAL_MEMORY_MBYTES' || $key == 'TOTAL_SWAP_MBYTES'
|
||||
|| $key == 'PLAYOUT_ENGINE_CPU_PERC') {
|
||||
if (
|
||||
$key == 'WEB_SERVER' || $key == 'CPU' || $key == 'OS' || $key == 'TOTAL_RAM'
|
||||
|| $key == 'FREE_RAM' || $key == 'AIRTIME_VERSION' || $key == 'KERNAL_VERSION'
|
||||
|| $key == 'MACHINE_ARCHITECTURE' || $key == 'TOTAL_MEMORY_MBYTES' || $key == 'TOTAL_SWAP_MBYTES'
|
||||
|| $key == 'PLAYOUT_ENGINE_CPU_PERC'
|
||||
) {
|
||||
if ($key == 'AIRTIME_VERSION') {
|
||||
// remove hash tag on the version string
|
||||
$version = explode('+', $info[1]);
|
||||
|
@ -1206,7 +1208,9 @@ class Application_Model_Preference
|
|||
{
|
||||
$v = self::getValue($pref_param, true);
|
||||
|
||||
$id = function ($x) { return $x; };
|
||||
$id = function ($x) {
|
||||
return $x;
|
||||
};
|
||||
|
||||
if ($v === '') {
|
||||
return $id;
|
||||
|
|
|
@ -180,8 +180,10 @@ final class Application_Model_Scheduler
|
|||
$ccShowInstances = $ccShow->getCcShowInstancess();
|
||||
$timeNowUTC = gmdate(DEFAULT_TIMESTAMP_FORMAT);
|
||||
foreach ($ccShowInstances as $ccShowInstance) {
|
||||
if ($ccShowInstance->getDbStarts() <= $timeNowUTC
|
||||
&& $ccShowInstance->getDbEnds() > $timeNowUTC) {
|
||||
if (
|
||||
$ccShowInstance->getDbStarts() <= $timeNowUTC
|
||||
&& $ccShowInstance->getDbEnds() > $timeNowUTC
|
||||
) {
|
||||
throw new Exception(_('Content in linked shows cannot be changed while on air!'));
|
||||
}
|
||||
}
|
||||
|
@ -745,7 +747,7 @@ final class Application_Model_Scheduler
|
|||
// each show. In case the position does not exist we need to select
|
||||
// the end time of the last position
|
||||
$maxPos_sql = 'SELECT max(position) from cc_schedule ' .
|
||||
"WHERE instance_id = {$instanceId}";
|
||||
"WHERE instance_id = {$instanceId}";
|
||||
$pos = Application_Common_Database::prepareAndExecute(
|
||||
$maxPos_sql,
|
||||
[],
|
||||
|
@ -923,7 +925,8 @@ final class Application_Model_Scheduler
|
|||
|
||||
break;
|
||||
|
||||
default: break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if ($this->applyCrossfades) {
|
||||
|
@ -975,7 +978,7 @@ final class Application_Model_Scheduler
|
|||
|
||||
$nextStartDT = $this->findTimeDifference($endTimeDT, $this->crossfadeDuration);
|
||||
++$pos;
|
||||
}// all files have been inserted/moved
|
||||
} // all files have been inserted/moved
|
||||
if ($doInsert) {
|
||||
$insert_sql = 'INSERT INTO cc_schedule ' .
|
||||
'(starts, ends, cue_in, cue_out, fade_in, fade_out, ' .
|
||||
|
@ -1044,8 +1047,8 @@ final class Application_Model_Scheduler
|
|||
if ($moveAction) {
|
||||
$this->calculateCrossfades($instanceId);
|
||||
}
|
||||
}// for each instance
|
||||
}// for each schedule location
|
||||
} // for each instance
|
||||
} // for each schedule location
|
||||
|
||||
$endProfile = microtime(true);
|
||||
Logging::debug('finished adding scheduled items.');
|
||||
|
|
|
@ -339,7 +339,7 @@ SQL;
|
|||
|
||||
if ($overlapping) {
|
||||
return _("Cannot schedule overlapping shows.\nNote: Resizing a repeating show " .
|
||||
'affects all of its repeats.');
|
||||
'affects all of its repeats.');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -428,7 +428,8 @@ SQL;
|
|||
|
||||
$rows = Application_Common_Database::prepareAndExecute($sql, [
|
||||
':dayTimestamp' => $day_timestamp,
|
||||
':showId' => $this->getId(), ], 'all');
|
||||
':showId' => $this->getId(),
|
||||
], 'all');
|
||||
|
||||
foreach ($rows as $row) {
|
||||
try {
|
||||
|
@ -591,8 +592,10 @@ WHERE starts > :timestamp::TIMESTAMP
|
|||
SQL;
|
||||
Application_Common_Database::prepareAndExecute(
|
||||
$sql,
|
||||
[':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||
':showId' => $this->getId(), ],
|
||||
[
|
||||
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||
':showId' => $this->getId(),
|
||||
],
|
||||
'execute'
|
||||
);
|
||||
}
|
||||
|
@ -612,8 +615,10 @@ WHERE starts > :timestamp::TIMESTAMP
|
|||
SQL;
|
||||
Application_Common_Database::prepareAndExecute(
|
||||
$sql,
|
||||
[':showId' => $this->getId(),
|
||||
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ],
|
||||
[
|
||||
':showId' => $this->getId(),
|
||||
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||
],
|
||||
'execute'
|
||||
);
|
||||
}
|
||||
|
@ -632,9 +637,9 @@ SQL;
|
|||
$showId = $this->getId();
|
||||
$stmt = $con->prepare(
|
||||
'SELECT first_show, start_time, timezone FROM cc_show_days'
|
||||
. ' WHERE show_id = :showId'
|
||||
. ' ORDER BY first_show'
|
||||
. ' LIMIT 1'
|
||||
. ' WHERE show_id = :showId'
|
||||
. ' ORDER BY first_show'
|
||||
. ' LIMIT 1'
|
||||
);
|
||||
|
||||
$stmt->bindParam(':showId', $showId);
|
||||
|
@ -750,8 +755,10 @@ WHERE show_id = :showId
|
|||
SQL;
|
||||
$rows = Application_Common_Database::prepareAndExecute(
|
||||
$sql,
|
||||
[':showId' => $this->getId(),
|
||||
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ],
|
||||
[
|
||||
':showId' => $this->getId(),
|
||||
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||
],
|
||||
'all'
|
||||
);
|
||||
|
||||
|
@ -777,8 +784,8 @@ SQL;
|
|||
$timestamp = gmdate(DEFAULT_TIMESTAMP_FORMAT);
|
||||
|
||||
$stmt = $con->prepare('UPDATE cc_show_days '
|
||||
. 'SET duration = :add_show_duration '
|
||||
. 'WHERE show_id = :add_show_id');
|
||||
. 'SET duration = :add_show_duration '
|
||||
. 'WHERE show_id = :add_show_id');
|
||||
$stmt->execute([
|
||||
':add_show_duration' => $p_data['add_show_duration'],
|
||||
':add_show_id' => $p_data['add_show_id'],
|
||||
|
@ -794,7 +801,8 @@ SQL;
|
|||
Application_Common_Database::prepareAndExecute($sql, [
|
||||
':add_show_duration' => $p_data['add_show_duration'],
|
||||
':show_id' => $p_data['add_show_id'],
|
||||
':timestamp' => $timestamp, ], 'execute');
|
||||
':timestamp' => $timestamp,
|
||||
], 'execute');
|
||||
}
|
||||
|
||||
public function getDuration($format = false)
|
||||
|
@ -896,8 +904,10 @@ SQL;
|
|||
try {
|
||||
$row = Application_Common_Database::prepareAndExecute(
|
||||
$sql,
|
||||
[':showId' => $this->getId(),
|
||||
':timestamp' => $timestamp, ],
|
||||
[
|
||||
':showId' => $this->getId(),
|
||||
':timestamp' => $timestamp,
|
||||
],
|
||||
'column'
|
||||
);
|
||||
|
||||
|
@ -1092,8 +1102,10 @@ SQL;
|
|||
if ($p_editable) {
|
||||
if ($show['record'] && $now > $startsDT) {
|
||||
$options['editable'] = false;
|
||||
} elseif ($show['rebroadcast']
|
||||
&& $now > $parentStartsDT) {
|
||||
} elseif (
|
||||
$show['rebroadcast']
|
||||
&& $now > $parentStartsDT
|
||||
) {
|
||||
$options['editable'] = false;
|
||||
} elseif ($now < $endsDT) {
|
||||
$options['editable'] = true;
|
||||
|
@ -1460,7 +1472,8 @@ SQL;
|
|||
'ends' => $rows[$i - 1]['ends'],
|
||||
'record' => $rows[$i - 1]['record'],
|
||||
'image_path' => $rows[$i - 1]['image_path'],
|
||||
'type' => 'show', ];
|
||||
'type' => 'show',
|
||||
];
|
||||
}
|
||||
|
||||
$results['currentShow'][0] = $rows[$i];
|
||||
|
@ -1478,7 +1491,8 @@ SQL;
|
|||
'ends' => $rows[$i + 1]['ends'],
|
||||
'record' => $rows[$i + 1]['record'],
|
||||
'image_path' => $rows[$i + 1]['image_path'],
|
||||
'type' => 'show', ];
|
||||
'type' => 'show',
|
||||
];
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -1501,7 +1515,8 @@ SQL;
|
|||
'ends' => $rows[$i]['ends'],
|
||||
'record' => $rows[$i]['record'],
|
||||
'image_path' => $rows[$i]['image_path'],
|
||||
'type' => 'show', ];
|
||||
'type' => 'show',
|
||||
];
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -1519,7 +1534,8 @@ SQL;
|
|||
'starts' => $rows[$previousShowIndex]['starts'],
|
||||
'ends' => $rows[$previousShowIndex]['ends'],
|
||||
'record' => $rows[$previousShowIndex]['record'],
|
||||
'type' => 'show', ];
|
||||
'type' => 'show',
|
||||
];
|
||||
}
|
||||
|
||||
return $results;
|
||||
|
@ -1578,11 +1594,13 @@ SQL;
|
|||
$params = [
|
||||
':timeStart' => $timeStart,
|
||||
':timeEnd' => $timeEnd,
|
||||
':lim' => $limit, ];
|
||||
':lim' => $limit,
|
||||
];
|
||||
} else {
|
||||
$params = [
|
||||
':timeStart' => $timeStart,
|
||||
':timeEnd' => $timeEnd, ];
|
||||
':timeEnd' => $timeEnd,
|
||||
];
|
||||
}
|
||||
|
||||
return Application_Common_Database::prepareAndExecute($sql, $params, 'all');
|
||||
|
|
|
@ -145,8 +145,10 @@ class Application_Model_ShowBuilder
|
|||
*/
|
||||
private function getScheduledStatus($p_epochItemStart, $p_epochItemEnd, &$row)
|
||||
{
|
||||
if ($row['footer'] === true && $this->epoch_now > $p_epochItemStart
|
||||
&& $this->epoch_now > $p_epochItemEnd) {
|
||||
if (
|
||||
$row['footer'] === true && $this->epoch_now > $p_epochItemStart
|
||||
&& $this->epoch_now > $p_epochItemEnd
|
||||
) {
|
||||
$row['scheduled'] = 0;
|
||||
} elseif ($row['footer'] === true && $this->epoch_now < $p_epochItemEnd) {
|
||||
$row['scheduled'] = 2;
|
||||
|
@ -177,7 +179,8 @@ class Application_Model_ShowBuilder
|
|||
$d = [
|
||||
'$p_epochItemStart' => $p_epochItemStart,
|
||||
'$p_epochItemEnd' => $p_epochItemEnd,
|
||||
'$row' => $row, ];
|
||||
'$row' => $row,
|
||||
];
|
||||
Logging::warn($d);
|
||||
}
|
||||
}
|
||||
|
@ -415,8 +418,10 @@ class Application_Model_ShowBuilder
|
|||
|
||||
// see if the displayed show instances have changed. (deleted,
|
||||
// empty schedule etc)
|
||||
if ($outdated === false && count($instances)
|
||||
!== count($currentInstances)) {
|
||||
if (
|
||||
$outdated === false && count($instances)
|
||||
!== count($currentInstances)
|
||||
) {
|
||||
Logging::debug('show instances have changed.');
|
||||
$outdated = true;
|
||||
}
|
||||
|
@ -450,8 +455,10 @@ class Application_Model_ShowBuilder
|
|||
$item = $scheduled_items[$i];
|
||||
|
||||
// don't send back data for filler rows.
|
||||
if (isset($item['playout_status'])
|
||||
&& $item['playout_status'] < 0) {
|
||||
if (
|
||||
isset($item['playout_status'])
|
||||
&& $item['playout_status'] < 0
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -480,20 +487,22 @@ class Application_Model_ShowBuilder
|
|||
$display_items[] = $row;
|
||||
}
|
||||
|
||||
if ($current_id !== -1
|
||||
&& !in_array($current_id, $this->showInstances)) {
|
||||
if (
|
||||
$current_id !== -1
|
||||
&& !in_array($current_id, $this->showInstances)
|
||||
) {
|
||||
$this->showInstances[] = $current_id;
|
||||
}
|
||||
}
|
||||
|
||||
// make the last footer if there were any scheduled items.
|
||||
if (count($scheduled_items) > 0) {
|
||||
$display_items[] = $this->makeFooterRow($scheduled_items[
|
||||
count($scheduled_items) - 1]);
|
||||
$display_items[] = $this->makeFooterRow($scheduled_items[count($scheduled_items) - 1]);
|
||||
}
|
||||
|
||||
return [
|
||||
'schedule' => $display_items,
|
||||
'showInstances' => $this->showInstances, ];
|
||||
'showInstances' => $this->showInstances,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,8 @@ AND rebroadcast = 1;
|
|||
SQL;
|
||||
Application_Common_Database::prepareAndExecute($sql, [
|
||||
':instanceId' => $instance_id,
|
||||
':timestamp' => $timestamp, ], 'execute');
|
||||
':timestamp' => $timestamp,
|
||||
], 'execute');
|
||||
}
|
||||
|
||||
/* This function is weird. It should return a boolean, but instead returns
|
||||
|
@ -553,7 +554,8 @@ SQL;
|
|||
|
||||
$counts = Application_Common_Database::prepareAndExecute($sql, [
|
||||
':p_start' => $p_start->format('Y-m-d G:i:s'),
|
||||
':p_end' => $p_end->format('Y-m-d G:i:s'), ], 'all');
|
||||
':p_end' => $p_end->format('Y-m-d G:i:s'),
|
||||
], 'all');
|
||||
|
||||
$real_counts = [];
|
||||
foreach ($counts as $c) {
|
||||
|
@ -574,7 +576,8 @@ SQL;
|
|||
|
||||
$res = Application_Common_Database::prepareAndExecute($sql, [
|
||||
':p_start' => $p_start->format('Y-m-d G:i:s'),
|
||||
':p_end' => $p_end->format('Y-m-d G:i:s'), ], 'all');
|
||||
':p_end' => $p_end->format('Y-m-d G:i:s'),
|
||||
], 'all');
|
||||
|
||||
$isFilled = [];
|
||||
foreach ($res as $r) {
|
||||
|
@ -755,7 +758,8 @@ WHERE si.ends < :timeNow::TIMESTAMP
|
|||
ORDER BY si.ends DESC LIMIT 1;
|
||||
SQL;
|
||||
$id = Application_Common_Database($sql, [
|
||||
':timeNow' => $p_timeNow, ], 'column');
|
||||
':timeNow' => $p_timeNow,
|
||||
], 'column');
|
||||
|
||||
return $id ? new Application_Model_ShowInstance($id) : null;
|
||||
}
|
||||
|
@ -779,7 +783,8 @@ SQL;
|
|||
|
||||
$id = Application_Common_Database($sql, [
|
||||
':timeNow1' => $p_timeNow,
|
||||
':timeNow2' => $p_timeNow, ], 'column');
|
||||
':timeNow2' => $p_timeNow,
|
||||
], 'column');
|
||||
|
||||
return $id ? new Application_Model_ShowInstance($id) : null;
|
||||
}
|
||||
|
@ -835,7 +840,8 @@ SQL;
|
|||
|
||||
return Application_Common_Database::prepareAndExecute($sql, [
|
||||
':startTime' => $p_startTime,
|
||||
':endTime' => $p_endTime, ], 'all');
|
||||
':endTime' => $p_endTime,
|
||||
], 'all');
|
||||
}
|
||||
|
||||
public function isRepeating()
|
||||
|
|
|
@ -25,11 +25,11 @@ class Application_Model_StreamSetting
|
|||
|
||||
if ($result == 1) {
|
||||
$sql = 'UPDATE cc_stream_setting'
|
||||
. ' SET value = :value, type = :type'
|
||||
. ' WHERE keyname = :key';
|
||||
. ' SET value = :value, type = :type'
|
||||
. ' WHERE keyname = :key';
|
||||
} else {
|
||||
$sql = 'INSERT INTO cc_stream_setting (keyname, value, type)'
|
||||
. ' VALUES (:key, :value, :type)';
|
||||
. ' VALUES (:key, :value, :type)';
|
||||
}
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
|
@ -52,7 +52,7 @@ class Application_Model_StreamSetting
|
|||
|
||||
// Check if key already exists
|
||||
$sql = 'SELECT value FROM cc_stream_setting'
|
||||
. ' WHERE keyname = :key';
|
||||
. ' WHERE keyname = :key';
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindParam(':key', $key);
|
||||
|
@ -100,9 +100,9 @@ class Application_Model_StreamSetting
|
|||
{
|
||||
$con = Propel::getConnection();
|
||||
$sql = 'SELECT * '
|
||||
. 'FROM cc_stream_setting '
|
||||
. "WHERE keyname LIKE '%_enable' "
|
||||
. "AND value='true'";
|
||||
. 'FROM cc_stream_setting '
|
||||
. "WHERE keyname LIKE '%_enable' "
|
||||
. "AND value='true'";
|
||||
|
||||
$ids = [];
|
||||
|
||||
|
@ -392,7 +392,7 @@ class Application_Model_StreamSetting
|
|||
|
||||
$keyname = 's' . $stream_id . '_enable';
|
||||
$sql = 'SELECT value FROM cc_stream_setting'
|
||||
. ' WHERE keyname = :keyname';
|
||||
. ' WHERE keyname = :keyname';
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindParam(':keyname', $keyname);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Subj class.
|
||||
*
|
||||
|
|
|
@ -168,6 +168,7 @@ WHERE id = :id
|
|||
SQL;
|
||||
|
||||
return Application_Common_Database::prepareAndExecute($sql, [
|
||||
':id' => $id, ], 'single');
|
||||
':id' => $id,
|
||||
], 'single');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,10 +61,12 @@ class Application_Model_User
|
|||
$type = $this->getType();
|
||||
$result = false;
|
||||
|
||||
if ($this->isAdmin()
|
||||
if (
|
||||
$this->isAdmin()
|
||||
|| $this->isSuperAdmin()
|
||||
|| $this->isPM()
|
||||
|| self::isHostOfShow($p_showId)) {
|
||||
|| self::isHostOfShow($p_showId)
|
||||
) {
|
||||
$result = true;
|
||||
}
|
||||
|
||||
|
@ -387,7 +389,8 @@ WHERE id = :id
|
|||
SQL;
|
||||
|
||||
return Application_Common_Database::prepareAndExecute($sql, [
|
||||
':id' => $id, ], 'single');
|
||||
':id' => $id,
|
||||
], 'single');
|
||||
}
|
||||
|
||||
public static function getCurrentUser()
|
||||
|
|
|
@ -121,9 +121,11 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
|||
|
||||
public static function analyzeFormData($parameters)
|
||||
{
|
||||
$valid = ['length' => [true, ''],
|
||||
$valid = [
|
||||
'length' => [true, ''],
|
||||
'url' => [true, ''],
|
||||
'name' => [true, ''], ];
|
||||
'name' => [true, ''],
|
||||
];
|
||||
|
||||
$di = null;
|
||||
$length = $parameters['length'];
|
||||
|
|
|
@ -21,10 +21,11 @@ class StoredFileTest extends PHPUnit_TestCase
|
|||
$metadata = Metadata::LoadFromFile($filePath);
|
||||
if (($metadata['dc:description'] != 'Tmu sem tam videla ...')
|
||||
|| ($metadata['audio']['dataformat'] != 'mp3')
|
||||
|| ($metadata['dc:type'] != 'Speech')) {
|
||||
|| ($metadata['dc:type'] != 'Speech')
|
||||
) {
|
||||
$str = ' [dc:description] = ' . $metadata['dc:description'] . "\n"
|
||||
. ' [audio][dataformat] = ' . $metadata['audio']['dataformat'] . "\n"
|
||||
. ' [dc:type] = ' . $metadata['dc:type'] . "\n";
|
||||
. ' [audio][dataformat] = ' . $metadata['audio']['dataformat'] . "\n"
|
||||
. ' [dc:type] = ' . $metadata['dc:type'] . "\n";
|
||||
$this->fail("Metadata has unexpected values:\n" . $str);
|
||||
}
|
||||
// var_dump($metadata);
|
||||
|
@ -44,8 +45,10 @@ class StoredFileTest extends PHPUnit_TestCase
|
|||
}
|
||||
|
||||
// Test inserting a file by linking
|
||||
$values = ['filepath' => $filePath,
|
||||
'dc:description' => 'Unit test ' . time(), ];
|
||||
$values = [
|
||||
'filepath' => $filePath,
|
||||
'dc:description' => 'Unit test ' . time(),
|
||||
];
|
||||
$storedFile = Application_Model_StoredFile::Insert($values, false);
|
||||
// var_dump($storedFile);
|
||||
$id = $storedFile->getId();
|
||||
|
|
|
@ -1,24 +1,12 @@
|
|||
<?xml version="1.0"?>
|
||||
<playlist id="0e22c20310212a51">
|
||||
<playlistElement id="0000000000000103" relativeOffset="00:00:00.000000" >
|
||||
<audioClip id="0000000000010003"
|
||||
playlength="00:00:11.500000"
|
||||
title = "three"
|
||||
uri="file:var/test10003.mp3"
|
||||
/>
|
||||
<playlistElement id="0000000000000103" relativeOffset="00:00:00.000000">
|
||||
<audioClip id="0000000000010003" playlength="00:00:11.500000" title="three" uri="file:var/test10003.mp3" />
|
||||
</playlistElement>
|
||||
<playlistElement id="0000000000000104" relativeOffset="00:00:11.500000">
|
||||
<playlist id="0000000000000001"
|
||||
playlength="01:30:00.000000"
|
||||
title="My First Playlist">
|
||||
</playlist>
|
||||
<playlist id="0000000000000001" playlength="01:30:00.000000" title="My First Playlist"></playlist>
|
||||
</playlistElement>
|
||||
<metadata
|
||||
xmlns="http://mdlf.org/campcaster/elements/1.0/"
|
||||
xmlns:ls="http://mdlf.org/campcaster/elements/1.0/"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:dcterms="http://purl.org/dc/terms/"
|
||||
>
|
||||
<metadata xmlns="http://mdlf.org/campcaster/elements/1.0/" xmlns:ls="http://mdlf.org/campcaster/elements/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/">
|
||||
<dc:title>embedded playlist</dc:title>
|
||||
<dcterms:extent>01:30:11.500000</dcterms:extent>
|
||||
</metadata>
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<audioClip>
|
||||
<metadata
|
||||
xmlns="http://mdlf.org/campcaster/elements/1.0/"
|
||||
xmlns:ls="http://mdlf.org/campcaster/elements/1.0/"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:dcterms="http://purl.org/dc/terms/"
|
||||
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
||||
>
|
||||
<metadata xmlns="http://mdlf.org/campcaster/elements/1.0/" xmlns:ls="http://mdlf.org/campcaster/elements/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xml="http://www.w3.org/XML/1998/namespace">
|
||||
<dc:title>Webstream test 1</dc:title>
|
||||
<dcterms:extent>01:30:00.000000</dcterms:extent>
|
||||
<ls:url>http://localhost/y</ls:url>
|
||||
|
|
|
@ -8,7 +8,8 @@ class Rest_Bootstrap extends Zend_Application_Module_Bootstrap
|
|||
$router = $front->getRouter();
|
||||
|
||||
$restRoute = new Zend_Rest_Route($front, [], [
|
||||
'rest' => ['media', 'show-image', 'podcast', 'podcast-episodes'], ]);
|
||||
'rest' => ['media', 'show-image', 'podcast', 'podcast-episodes'],
|
||||
]);
|
||||
$router->addRoute('rest', $restRoute);
|
||||
|
||||
$podcastBulkRoute = new Zend_Controller_Router_Route(
|
||||
|
|
|
@ -96,7 +96,7 @@ class Rest_PodcastEpisodesController extends Zend_Rest_Controller
|
|||
$resp = $this->getResponse();
|
||||
$resp->setHttpResponseCode(400);
|
||||
$resp->appendBody('ERROR: Episode ID should not be specified when using POST. POST is only used for '
|
||||
. 'importing podcast episodes, and an episode ID will be chosen by Airtime');
|
||||
. 'importing podcast episodes, and an episode ID will be chosen by Airtime');
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -256,8 +256,8 @@ class Rest_ShowImageController extends Zend_Rest_Controller
|
|||
unlink($image_file); // remove the file after failed rename
|
||||
|
||||
throw new Exception('The file was not uploaded, this error can occur if the computer '
|
||||
. 'hard drive does not have enough disk space or the stor '
|
||||
. 'directory does not have correct write permissions.');
|
||||
. 'hard drive does not have enough disk space or the stor '
|
||||
. 'directory does not have correct write permissions.');
|
||||
}
|
||||
|
||||
return $image_stor;
|
||||
|
|
|
@ -5,7 +5,8 @@ class RestAuth
|
|||
public static function verifyAuth($checkApiKey, $checkSession, $action)
|
||||
{
|
||||
// Session takes precedence over API key for now:
|
||||
if ($checkSession && self::verifySession()
|
||||
if (
|
||||
$checkSession && self::verifySession()
|
||||
|| $checkApiKey && self::verifyAPIKey($action)
|
||||
) {
|
||||
return true;
|
||||
|
|
|
@ -46,19 +46,22 @@ class Application_Service_CalendarService
|
|||
if (!isset($ccFile)) {
|
||||
$menu['error when recording'] = [
|
||||
'name' => _("Record file doesn't exist"),
|
||||
'icon' => 'error', ];
|
||||
'icon' => 'error',
|
||||
];
|
||||
} else {
|
||||
$menu['view_recorded'] = [
|
||||
'name' => _('View Recorded File Metadata'),
|
||||
'icon' => 'overview',
|
||||
'url' => $baseUrl . 'library/edit-file-md/id/' . $ccFile->getDbId(), ];
|
||||
'url' => $baseUrl . 'library/edit-file-md/id/' . $ccFile->getDbId(),
|
||||
];
|
||||
}
|
||||
} else {
|
||||
$menu['content'] = [
|
||||
// "name"=> _("Show Content"),
|
||||
'name' => _('View'),
|
||||
'icon' => 'overview',
|
||||
'url' => $baseUrl . 'schedule/show-content-dialog', ];
|
||||
'url' => $baseUrl . 'schedule/show-content-dialog',
|
||||
];
|
||||
}
|
||||
} else {
|
||||
// Show content can be modified from the calendar if:
|
||||
|
@ -77,7 +80,8 @@ class Application_Service_CalendarService
|
|||
// "name"=> _("Add / Remove Content"),
|
||||
'name' => _('Schedule Tracks'),
|
||||
'icon' => 'add-remove-content',
|
||||
'url' => $baseUrl . 'showbuilder/builder-dialog/', ];
|
||||
'url' => $baseUrl . 'showbuilder/builder-dialog/',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,7 +92,8 @@ class Application_Service_CalendarService
|
|||
// "name"=> _("Show Content"),
|
||||
'name' => _('View'),
|
||||
'icon' => 'overview',
|
||||
'url' => $baseUrl . 'schedule/show-content-dialog', ];
|
||||
'url' => $baseUrl . 'schedule/show-content-dialog',
|
||||
];
|
||||
}
|
||||
|
||||
// user can remove all content if the show has not started
|
||||
|
@ -100,7 +105,8 @@ class Application_Service_CalendarService
|
|||
// "name"=> _("Remove All Content"),
|
||||
'name' => _('Clear Show'),
|
||||
'icon' => 'remove-all-content',
|
||||
'url' => $baseUrl . 'schedule/clear-show', ];
|
||||
'url' => $baseUrl . 'schedule/clear-show',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -113,12 +119,14 @@ class Application_Service_CalendarService
|
|||
$menu['cancel_recorded'] = [
|
||||
// "name"=> _("Cancel Current Show"),
|
||||
'name' => _('Cancel Show'),
|
||||
'icon' => 'delete', ];
|
||||
'icon' => 'delete',
|
||||
];
|
||||
} else {
|
||||
$menu['cancel'] = [
|
||||
// "name"=> _("Cancel Current Show"),
|
||||
'name' => _('Cancel Show'),
|
||||
'icon' => 'delete', ];
|
||||
'icon' => 'delete',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,7 +175,8 @@ class Application_Service_CalendarService
|
|||
'name' => _('Edit Show'),
|
||||
'icon' => 'edit',
|
||||
'_type' => 'all',
|
||||
'url' => $baseUrl . 'Schedule/populate-show-form', ];
|
||||
'url' => $baseUrl . 'Schedule/populate-show-form',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -182,29 +191,34 @@ class Application_Service_CalendarService
|
|||
$menu['del'] = [
|
||||
'name' => _('Delete'),
|
||||
'icon' => 'delete',
|
||||
'items' => [], ];
|
||||
'items' => [],
|
||||
];
|
||||
|
||||
$menu['del']['items']['single'] = [
|
||||
// "name"=> _("Delete This Instance"),
|
||||
'name' => _('Delete Instance'),
|
||||
'icon' => 'delete',
|
||||
'url' => $baseUrl . 'schedule/delete-show-instance', ];
|
||||
'url' => $baseUrl . 'schedule/delete-show-instance',
|
||||
];
|
||||
|
||||
$menu['del']['items']['following'] = [
|
||||
// "name"=> _("Delete This Instance and All Following"),
|
||||
'name' => _('Delete Instance and All Following'),
|
||||
'icon' => 'delete',
|
||||
'url' => $baseUrl . 'schedule/delete-show', ];
|
||||
'url' => $baseUrl . 'schedule/delete-show',
|
||||
];
|
||||
} elseif ($populateInstance) {
|
||||
$menu['del'] = [
|
||||
'name' => _('Delete'),
|
||||
'icon' => 'delete',
|
||||
'url' => $baseUrl . 'schedule/delete-show-instance', ];
|
||||
'url' => $baseUrl . 'schedule/delete-show-instance',
|
||||
];
|
||||
} else {
|
||||
$menu['del'] = [
|
||||
'name' => _('Delete'),
|
||||
'icon' => 'delete',
|
||||
'url' => $baseUrl . 'schedule/delete-show', ];
|
||||
'url' => $baseUrl . 'schedule/delete-show',
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,8 +56,8 @@ class Application_Service_HistoryService
|
|||
// Using the instance_id to filter the data.
|
||||
|
||||
$historyRange = '(' .
|
||||
'SELECT history.starts, history.ends, history.id AS history_id, history.instance_id' .
|
||||
' FROM cc_playout_history as history';
|
||||
'SELECT history.starts, history.ends, history.id AS history_id, history.instance_id' .
|
||||
' FROM cc_playout_history as history';
|
||||
|
||||
if (isset($instanceId)) {
|
||||
$historyRange .= ' WHERE history.instance_id = :instance';
|
||||
|
@ -71,11 +71,11 @@ class Application_Service_HistoryService
|
|||
$historyRange .= ') AS history_range';
|
||||
|
||||
$manualMeta = '(' .
|
||||
'SELECT %KEY%.value AS %KEY%, %KEY%.history_id' .
|
||||
' FROM (' .
|
||||
' SELECT * from cc_playout_history_metadata AS phm WHERE phm.key = :meta_%KEY%' .
|
||||
' ) AS %KEY%' .
|
||||
' ) AS %KEY%_filter';
|
||||
'SELECT %KEY%.value AS %KEY%, %KEY%.history_id' .
|
||||
' FROM (' .
|
||||
' SELECT * from cc_playout_history_metadata AS phm WHERE phm.key = :meta_%KEY%' .
|
||||
' ) AS %KEY%' .
|
||||
' ) AS %KEY%_filter';
|
||||
|
||||
$mainSelect = [
|
||||
'history_range.starts',
|
||||
|
@ -112,39 +112,39 @@ class Application_Service_HistoryService
|
|||
|
||||
// the files associated with scheduled playback in Airtime.
|
||||
$historyFile = '(' .
|
||||
'SELECT history.id AS history_id, history.file_id' .
|
||||
' FROM cc_playout_history AS history' .
|
||||
' WHERE history.file_id IS NOT NULL' .
|
||||
') AS history_file';
|
||||
'SELECT history.id AS history_id, history.file_id' .
|
||||
' FROM cc_playout_history AS history' .
|
||||
' WHERE history.file_id IS NOT NULL' .
|
||||
') AS history_file';
|
||||
|
||||
$fileMd = '(' .
|
||||
'SELECT %NON_NULL_FILE_SELECT%' .
|
||||
' FROM cc_files AS file' .
|
||||
') AS file_md';
|
||||
'SELECT %NON_NULL_FILE_SELECT%' .
|
||||
' FROM cc_files AS file' .
|
||||
') AS file_md';
|
||||
|
||||
$fileMd = str_replace('%NON_NULL_FILE_SELECT%', implode(', ', $nonNullFileSelect), $fileMd);
|
||||
|
||||
// null files are from manually added data (filling in webstream info etc)
|
||||
$nullFile = '(' .
|
||||
'SELECT history.id AS history_id' .
|
||||
' FROM cc_playout_history AS history' .
|
||||
' WHERE history.file_id IS NULL' .
|
||||
') AS null_file';
|
||||
'SELECT history.id AS history_id' .
|
||||
' FROM cc_playout_history AS history' .
|
||||
' WHERE history.file_id IS NULL' .
|
||||
') AS null_file';
|
||||
|
||||
// ----------------------------------
|
||||
// building the file inner query
|
||||
|
||||
$fileSqlQuery =
|
||||
'SELECT ' . implode(', ', $fileSelect) .
|
||||
" FROM {$historyFile}" .
|
||||
" LEFT JOIN {$fileMd} USING (file_id)" .
|
||||
' UNION' .
|
||||
' SELECT ' . implode(', ', $nullFileSelect) .
|
||||
" FROM {$nullFile}";
|
||||
'SELECT ' . implode(', ', $fileSelect) .
|
||||
" FROM {$historyFile}" .
|
||||
" LEFT JOIN {$fileMd} USING (file_id)" .
|
||||
' UNION' .
|
||||
' SELECT ' . implode(', ', $nullFileSelect) .
|
||||
" FROM {$nullFile}";
|
||||
|
||||
foreach ($fileMdFilters as $filter) {
|
||||
$fileSqlQuery .=
|
||||
" LEFT JOIN {$filter} USING(history_id)";
|
||||
" LEFT JOIN {$filter} USING(history_id)";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -159,17 +159,17 @@ class Application_Service_HistoryService
|
|||
}
|
||||
|
||||
$mainSqlQuery .=
|
||||
'SELECT ' . implode(', ', $mainSelect) .
|
||||
" FROM {$historyRange}";
|
||||
'SELECT ' . implode(', ', $mainSelect) .
|
||||
" FROM {$historyRange}";
|
||||
|
||||
if (isset($fileSqlQuery)) {
|
||||
$mainSqlQuery .=
|
||||
" LEFT JOIN ( {$fileSqlQuery} ) as file_info USING(history_id)";
|
||||
" LEFT JOIN ( {$fileSqlQuery} ) as file_info USING(history_id)";
|
||||
}
|
||||
|
||||
foreach ($mdFilters as $filter) {
|
||||
$mainSqlQuery .=
|
||||
" LEFT JOIN {$filter} USING(history_id)";
|
||||
" LEFT JOIN {$filter} USING(history_id)";
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
@ -217,7 +217,7 @@ class Application_Service_HistoryService
|
|||
$orders = implode(', ', $orderBys);
|
||||
|
||||
$mainSqlQuery .=
|
||||
" ORDER BY {$orders}";
|
||||
" ORDER BY {$orders}";
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
|
@ -227,7 +227,7 @@ class Application_Service_HistoryService
|
|||
// limit the results returned.
|
||||
if ($displayLength !== -1) {
|
||||
$mainSqlQuery .=
|
||||
' OFFSET :offset LIMIT :limit';
|
||||
' OFFSET :offset LIMIT :limit';
|
||||
|
||||
$paramMap['offset'] = intval($opts['iDisplayStart']);
|
||||
$paramMap['limit'] = $displayLength;
|
||||
|
@ -340,8 +340,8 @@ class Application_Service_HistoryService
|
|||
LEFT JOIN cc_files AS file ON (file.id = playout.file_id)) AS summary';
|
||||
|
||||
$mainSqlQuery .=
|
||||
'SELECT ' . implode(', ', $select) .
|
||||
" FROM {$fileSummaryTable}";
|
||||
'SELECT ' . implode(', ', $select) .
|
||||
" FROM {$fileSummaryTable}";
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// need to count the total rows to tell Datatables.
|
||||
|
@ -376,7 +376,7 @@ class Application_Service_HistoryService
|
|||
$orders = implode(', ', $orderBys);
|
||||
|
||||
$mainSqlQuery .=
|
||||
" ORDER BY {$orders}";
|
||||
" ORDER BY {$orders}";
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
|
@ -384,7 +384,7 @@ class Application_Service_HistoryService
|
|||
$displayLength = intval($opts['iDisplayLength']);
|
||||
if ($displayLength !== -1) {
|
||||
$mainSqlQuery .=
|
||||
' OFFSET :offset LIMIT :limit';
|
||||
' OFFSET :offset LIMIT :limit';
|
||||
|
||||
$paramMap['offset'] = $opts['iDisplayStart'];
|
||||
$paramMap['limit'] = $displayLength;
|
||||
|
|
|
@ -189,7 +189,8 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir
|
|||
'api_key' => $CC_CONFIG['apiKey'][0],
|
||||
'podcast_name' => $title,
|
||||
'album_override' => $album_override,
|
||||
'track_title' => $track_title, ];
|
||||
'track_title' => $track_title,
|
||||
];
|
||||
$task = $this->_executeTask(static::$_CELERY_TASKS[self::DOWNLOAD], $data);
|
||||
// Get the created ThirdPartyTaskReference and set the episode ID so
|
||||
// we can remove the placeholder if the import ends up stuck in a pending state
|
||||
|
@ -378,7 +379,7 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir
|
|||
->find();
|
||||
|
||||
return $isStationPodcast ? $this->_getStationPodcastEpisodeArray($episodes)
|
||||
: $this->_getImportedPodcastEpisodeArray($podcast, $episodes);
|
||||
: $this->_getImportedPodcastEpisodeArray($podcast, $episodes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -190,7 +190,7 @@ class Application_Service_SchedulerService
|
|||
|
||||
$linkedShowSchedule_sql = $con->prepare(
|
||||
'select * from cc_schedule where instance_id = :instance_id ' .
|
||||
'order by starts'
|
||||
'order by starts'
|
||||
);
|
||||
$linkedShowSchedule_sql->bindParam(':instance_id', $instanceId);
|
||||
$linkedShowSchedule_sql->execute();
|
||||
|
@ -217,7 +217,7 @@ class Application_Service_SchedulerService
|
|||
// get time_filled so we can update cc_show_instances
|
||||
if (!empty($linkedShowSchedule)) {
|
||||
$timeFilled_sql = 'SELECT time_filled FROM cc_show_instances ' .
|
||||
"WHERE id = {$linkedShowSchedule[0]['instance_id']}";
|
||||
"WHERE id = {$linkedShowSchedule[0]['instance_id']}";
|
||||
$timeFilled = Application_Common_Database::prepareAndExecute(
|
||||
$timeFilled_sql,
|
||||
[],
|
||||
|
|
|
@ -67,16 +67,20 @@ class Application_Service_ShowFormService
|
|||
public function populateNewShowForms($formWhat, $formWhen, $formRepeats)
|
||||
{
|
||||
$formWhat->populate(
|
||||
['add_show_id' => '-1',
|
||||
'add_show_instance_id' => '-1', ]
|
||||
[
|
||||
'add_show_id' => '-1',
|
||||
'add_show_instance_id' => '-1',
|
||||
]
|
||||
);
|
||||
|
||||
$formWhen->populate(
|
||||
['add_show_start_date' => date('Y-m-d'),
|
||||
[
|
||||
'add_show_start_date' => date('Y-m-d'),
|
||||
'add_show_start_time' => '00:00',
|
||||
'add_show_end_date_no_repeate' => date('Y-m-d'),
|
||||
'add_show_end_time' => '01:00',
|
||||
'add_show_duration' => '01h 00m', ]
|
||||
'add_show_duration' => '01h 00m',
|
||||
]
|
||||
);
|
||||
|
||||
$formRepeats->populate(['add_show_end_date' => date('Y-m-d')]);
|
||||
|
@ -204,7 +208,8 @@ class Application_Service_ShowFormService
|
|||
'add_show_end_time' => $showEnd->format('H:i'),
|
||||
'add_show_duration' => $ccShowDay->formatDuration(true),
|
||||
'add_show_timezone' => $ccShowDay->getDbTimezone(),
|
||||
'add_show_repeats' => $ccShowDay->isRepeating() ? 1 : 0, ]
|
||||
'add_show_repeats' => $ccShowDay->isRepeating() ? 1 : 0,
|
||||
]
|
||||
);
|
||||
|
||||
return $showStart;
|
||||
|
@ -269,7 +274,8 @@ class Application_Service_ShowFormService
|
|||
$timezone
|
||||
),
|
||||
'add_show_timezone' => $timezone,
|
||||
'add_show_repeats' => 0, ]
|
||||
'add_show_repeats' => 0,
|
||||
]
|
||||
);
|
||||
|
||||
$form->getElement('add_show_repeats')->setOptions(['disabled' => true]);
|
||||
|
@ -321,7 +327,8 @@ class Application_Service_ShowFormService
|
|||
'add_show_day_check' => $days,
|
||||
'add_show_end_date' => (!is_null($repeatEndDate)) ? $repeatEndDate->format('Y-m-d') : null,
|
||||
'add_show_no_end' => (is_null($repeatEndDate)),
|
||||
'add_show_monthly_repeat_type' => $monthlyRepeatType, ]
|
||||
'add_show_monthly_repeat_type' => $monthlyRepeatType,
|
||||
]
|
||||
);
|
||||
|
||||
if (!$this->ccShow->isLinkable() || $this->ccShow->isRecorded()) {
|
||||
|
@ -362,7 +369,8 @@ class Application_Service_ShowFormService
|
|||
[
|
||||
'add_show_background_color' => $this->ccShow->getDbBackgroundColor(),
|
||||
'add_show_color' => $this->ccShow->getDbColor(),
|
||||
'add_show_logo_current' => $src, ]
|
||||
'add_show_logo_current' => $src,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -405,7 +413,8 @@ class Application_Service_ShowFormService
|
|||
'cb_airtime_auth' => $this->ccShow->getDbLiveStreamUsingAirtimeAuth(),
|
||||
'cb_custom_auth' => $this->ccShow->getDbLiveStreamUsingCustomAuth(),
|
||||
'custom_username' => $this->ccShow->getDbLiveStreamUser(),
|
||||
'custom_password' => $this->ccShow->getDbLiveStreamPass(), ]
|
||||
'custom_password' => $this->ccShow->getDbLiveStreamPass(),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -414,7 +423,8 @@ class Application_Service_ShowFormService
|
|||
$form->populate(
|
||||
[
|
||||
'add_show_record' => $this->ccShow->isRecorded(),
|
||||
'add_show_rebroadcast' => $this->ccShow->isRebroadcast(), ]
|
||||
'add_show_rebroadcast' => $this->ccShow->isRebroadcast(),
|
||||
]
|
||||
);
|
||||
|
||||
$form->getElement('add_show_record')->setOptions(['disabled' => true]);
|
||||
|
|
|
@ -78,7 +78,7 @@ class Application_Service_ShowService
|
|||
// DateTime in shows's local time
|
||||
$newStartDateTime = new DateTime(
|
||||
$showData['add_show_start_date'] . ' ' .
|
||||
$showData['add_show_start_time'],
|
||||
$showData['add_show_start_time'],
|
||||
new DateTimeZone($showData['add_show_timezone'])
|
||||
);
|
||||
|
||||
|
@ -261,8 +261,10 @@ class Application_Service_ShowService
|
|||
* to ignore that difference when re-calculating schedule start times.
|
||||
* Otherwise it might calculate a difference of a week, for example.
|
||||
*/
|
||||
if ($this->ccShow->isRepeating()
|
||||
&& $this->origCcShowDay->getLocalStartDateAndTime()->format('Y-m-d') != $showData['add_show_start_date']) {
|
||||
if (
|
||||
$this->ccShow->isRepeating()
|
||||
&& $this->origCcShowDay->getLocalStartDateAndTime()->format('Y-m-d') != $showData['add_show_start_date']
|
||||
) {
|
||||
$showData['add_show_start_date'] = $this->origCcShowDay->getLocalStartDateAndTime()->format('Y-m-d');
|
||||
}
|
||||
|
||||
|
@ -507,7 +509,8 @@ AND rebroadcast = 1;
|
|||
SQL;
|
||||
Application_Common_Database::prepareAndExecute($sql, [
|
||||
':showId' => $this->ccShow->getDbId(),
|
||||
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ], 'execute');
|
||||
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||
], 'execute');
|
||||
}
|
||||
|
||||
private function deleteAllShowDays($showId)
|
||||
|
@ -572,11 +575,15 @@ SQL;
|
|||
|
||||
// if the start date changes, these are the repeat types
|
||||
// that require show instance deletion
|
||||
$deleteRepeatTypes = [REPEAT_BI_WEEKLY, REPEAT_TRI_WEEKLY, REPEAT_QUAD_WEEKLY, REPEAT_MONTHLY_MONTHLY,
|
||||
REPEAT_MONTHLY_WEEKLY, ];
|
||||
$deleteRepeatTypes = [
|
||||
REPEAT_BI_WEEKLY, REPEAT_TRI_WEEKLY, REPEAT_QUAD_WEEKLY, REPEAT_MONTHLY_MONTHLY,
|
||||
REPEAT_MONTHLY_WEEKLY,
|
||||
];
|
||||
|
||||
if (in_array($this->repeatType, $deleteRepeatTypes)
|
||||
&& $showData['add_show_start_date'] != $localShowStart->format('Y-m-d')) {
|
||||
if (
|
||||
in_array($this->repeatType, $deleteRepeatTypes)
|
||||
&& $showData['add_show_start_date'] != $localShowStart->format('Y-m-d')
|
||||
) {
|
||||
// Start date has changed when repeat type is bi-weekly or monthly.
|
||||
// This screws up the repeating positions of show instances, so
|
||||
// we need to delete them (CC-2351)
|
||||
|
@ -631,8 +638,10 @@ SQL;
|
|||
}
|
||||
}
|
||||
|
||||
if ($showData['add_show_start_date'] != $localShowStart->format('Y-m-d')
|
||||
|| $showData['add_show_start_time'] != $localShowStart->format('H:i')) {
|
||||
if (
|
||||
$showData['add_show_start_date'] != $localShowStart->format('Y-m-d')
|
||||
|| $showData['add_show_start_time'] != $localShowStart->format('H:i')
|
||||
) {
|
||||
// start date has been pushed forward so we need to delete
|
||||
// any instances of this show scheduled before the new start date
|
||||
if ($showData['add_show_start_date'] > $localShowStart->format('Y-m-d')) {
|
||||
|
@ -723,7 +732,8 @@ WHERE date(starts) >= :endDate::DATE
|
|||
SQL;
|
||||
Application_Common_Database::prepareAndExecute($sql, [
|
||||
':endDate' => $endDate, ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||
':showId' => $showId, ], 'execute');
|
||||
':showId' => $showId,
|
||||
], 'execute');
|
||||
}
|
||||
|
||||
private function deleteInstancesBeforeDate($newStartDate, $showId)
|
||||
|
@ -738,7 +748,8 @@ SQL;
|
|||
|
||||
Application_Common_Database::prepareAndExecute($sql, [
|
||||
':newStartDate' => $newStartDate, ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||
':showId' => $showId, ], 'execute');
|
||||
':showId' => $showId,
|
||||
], 'execute');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -784,7 +795,8 @@ SQL;
|
|||
Application_Common_Database::prepareAndExecute(
|
||||
$sql,
|
||||
[
|
||||
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ':showId' => $showId, ],
|
||||
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ':showId' => $showId,
|
||||
],
|
||||
'execute'
|
||||
);
|
||||
}
|
||||
|
@ -977,8 +989,10 @@ WHERE starts > :timestamp::TIMESTAMP
|
|||
SQL;
|
||||
Application_Common_Database::prepareAndExecute(
|
||||
$sql,
|
||||
[':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||
':showId' => $showId, ],
|
||||
[
|
||||
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||
':showId' => $showId,
|
||||
],
|
||||
'execute'
|
||||
);
|
||||
}
|
||||
|
@ -996,9 +1010,11 @@ WHERE starts > :timestamp::TIMESTAMP
|
|||
SQL;
|
||||
Application_Common_Database::prepareAndExecute(
|
||||
$sql,
|
||||
[':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||
[
|
||||
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||
':showId' => $showId,
|
||||
':firstShow' => $firstShow->format(DEFAULT_TIMESTAMP_FORMAT), ],
|
||||
':firstShow' => $firstShow->format(DEFAULT_TIMESTAMP_FORMAT),
|
||||
],
|
||||
'execute'
|
||||
);
|
||||
}
|
||||
|
@ -1043,7 +1059,7 @@ SQL;
|
|||
// DateTime in show's local time
|
||||
$newStartDateTime = new DateTime(
|
||||
$showData['add_show_start_date'] . ' ' .
|
||||
$showData['add_show_start_time'],
|
||||
$showData['add_show_start_time'],
|
||||
new DateTimeZone($showData['add_show_timezone'])
|
||||
);
|
||||
|
||||
|
@ -1088,8 +1104,10 @@ SQL;
|
|||
|
||||
Application_Common_Database::prepareAndExecute(
|
||||
$sql,
|
||||
[':diff1' => $diff, ':diff2' => $diff,
|
||||
':showId' => $this->ccShow->getDbId(), ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ],
|
||||
[
|
||||
':diff1' => $diff, ':diff2' => $diff,
|
||||
':showId' => $this->ccShow->getDbId(), ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||
],
|
||||
'execute'
|
||||
);
|
||||
}
|
||||
|
@ -1241,8 +1259,10 @@ SQL;
|
|||
* Make sure start date is less than populate until date AND
|
||||
* last show date is null OR start date is less than last show date
|
||||
*/
|
||||
if ($utcStartDateTime <= $populateUntil
|
||||
&& (is_null($utcLastShowDateTime) || $utcStartDateTime < $utcLastShowDateTime)) {
|
||||
if (
|
||||
$utcStartDateTime <= $populateUntil
|
||||
&& (is_null($utcLastShowDateTime) || $utcStartDateTime < $utcLastShowDateTime)
|
||||
) {
|
||||
$lastCreatedShow = clone $utcStartDateTime;
|
||||
/* There may not always be an instance when editing a show
|
||||
* This will be the case when we are adding a new show day to
|
||||
|
@ -1341,9 +1361,11 @@ SQL;
|
|||
* Make sure start date is less than populate until date AND
|
||||
* last show date is null OR start date is less than last show date
|
||||
*/
|
||||
if ($utcStartDateTime->getTimestamp() <= $populateUntil->getTimestamp()
|
||||
&& (is_null($utcLastShowDateTime)
|
||||
|| $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp())) {
|
||||
if (
|
||||
$utcStartDateTime->getTimestamp() <= $populateUntil->getTimestamp()
|
||||
&& (is_null($utcLastShowDateTime)
|
||||
|| $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp())
|
||||
) {
|
||||
$lastCreatedShow = clone $utcStartDateTime;
|
||||
/* There may not always be an instance when editing a show
|
||||
* This will be the case when we are adding a new show day to
|
||||
|
@ -1742,8 +1764,10 @@ SQL;
|
|||
}
|
||||
if (is_null($endDate) || $startDateTimeClone->getTimestamp() <= $endDateTime->getTimestamp()) {
|
||||
if ($this->isUpdate) {
|
||||
if ($this->origCcShowDay->getDbRepeatType() == 2
|
||||
|| $this->origCcShowDay->getDbRepeatType() == 3) {
|
||||
if (
|
||||
$this->origCcShowDay->getDbRepeatType() == 2
|
||||
|| $this->origCcShowDay->getDbRepeatType() == 3
|
||||
) {
|
||||
$day = null;
|
||||
} elseif (!$this->origShowRepeatStatus) {
|
||||
// keep current show day to use for updating cc_show_day rule
|
||||
|
|
|
@ -102,7 +102,7 @@ abstract class Application_Service_ThirdPartyService
|
|||
->findOneByDbTrackReference($ref->getDbId());
|
||||
|
||||
return $task->getDbStatus() == CELERY_PENDING_STATUS ? -1
|
||||
: ($task->getDbStatus() == CELERY_FAILED_STATUS ? 0 : 1);
|
||||
: ($task->getDbStatus() == CELERY_FAILED_STATUS ? 0 : 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -4,8 +4,10 @@ class Airtime_View_Helper_SourceSwitchStatus extends Zend_View_Helper_Abstract
|
|||
{
|
||||
public function SourceSwitchStatus()
|
||||
{
|
||||
return ['live_dj' => Application_Model_Preference::GetSourceSwitchStatus('live_dj'),
|
||||
return [
|
||||
'live_dj' => Application_Model_Preference::GetSourceSwitchStatus('live_dj'),
|
||||
'master_dj' => Application_Model_Preference::GetSourceSwitchStatus('master_dj'),
|
||||
'scheduled_play' => Application_Model_Preference::GetSourceSwitchStatus('scheduled_play'), ];
|
||||
'scheduled_play' => Application_Model_Preference::GetSourceSwitchStatus('scheduled_play'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ class Airtime_View_Helper_VersionNotify extends Zend_View_Helper_Abstract
|
|||
];
|
||||
|
||||
return sprintf('<script>var versionNotifyInfo = %s;</script>', json_encode($data))
|
||||
. "<div id='version-icon' class='" . $class . "'></div>";
|
||||
. "<div id='version-icon' class='" . $class . "'></div>";
|
||||
}
|
||||
|
||||
private function normalizeVersion($version, $isGit)
|
||||
|
|
|
@ -53,9 +53,11 @@ class ScheduleUnitTest extends Zend_Test_PHPUnit_ControllerTestCase // PHPUnit_F
|
|||
$params['api_key'] = $CC_CONFIG['apiKey'][0];
|
||||
$request->setParams($params);
|
||||
|
||||
$metadata = ['MDATA_KEY_FILEPATH' => '/tmp/foobar.mp3',
|
||||
$metadata = [
|
||||
'MDATA_KEY_FILEPATH' => '/tmp/foobar.mp3',
|
||||
'MDATA_KEY_DURATION' => '00:01:00',
|
||||
'is_record' => false, ];
|
||||
'is_record' => false,
|
||||
];
|
||||
|
||||
// Create the file in the database via the HTTP API.
|
||||
$apiController = new ApiController($this->request, $this->getResponse());
|
||||
|
|
|
@ -86,15 +86,18 @@ class ShowServiceUnitTest extends PHPUnit_Framework_TestCase
|
|||
$method->setAccessible(true);
|
||||
|
||||
$next = $method->invokeArgs($this->_showService, [
|
||||
new DateTime('2044-02-01'), 'UTC', '00:00', 'first', 'Friday', ]);
|
||||
new DateTime('2044-02-01'), 'UTC', '00:00', 'first', 'Friday',
|
||||
]);
|
||||
$this->assertEquals(new DateTime('2044-02-05', new DateTimeZone('UTC')), $next);
|
||||
|
||||
$next = $method->invokeArgs($this->_showService, [
|
||||
new DateTime('2044-02-01'), 'UTC', '00:00', 'fifth', 'Saturday', ]);
|
||||
new DateTime('2044-02-01'), 'UTC', '00:00', 'fifth', 'Saturday',
|
||||
]);
|
||||
$this->assertEquals(new DateTime('2044-04-30', new DateTimeZone('UTC')), $next);
|
||||
|
||||
$next = $method->invokeArgs($this->_showService, [
|
||||
new DateTime('2044-02-01'), 'UTC', '00:00', 'fourth', 'Monday', ]);
|
||||
new DateTime('2044-02-01'), 'UTC', '00:00', 'fourth', 'Monday',
|
||||
]);
|
||||
$this->assertEquals(new DateTime('2044-02-22', new DateTimeZone('UTC')), $next);
|
||||
}
|
||||
|
||||
|
@ -111,7 +114,8 @@ class ShowServiceUnitTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
$dt = $method->invokeArgs($this->_showService, [$localStartDT, '01:00']);
|
||||
$this->assertEquals([
|
||||
$localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone), ], $dt);
|
||||
$localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone),
|
||||
], $dt);
|
||||
|
||||
// America/Toronto with offset for rebroadcast shows
|
||||
$localStartDT = new DateTime('2044-01-01 06:30', new DateTimeZone('America/Toronto'));
|
||||
|
@ -120,10 +124,13 @@ class ShowServiceUnitTest extends PHPUnit_Framework_TestCase
|
|||
$localRebroadcastStartDT = new DateTime('2044-01-02 06:30', new DateTimeZone('America/Toronto'));
|
||||
$localRebroadcastEndDT = new DateTime('2044-01-02 07:30', new DateTimeZone('America/Toronto'));
|
||||
|
||||
$dt = $method->invokeArgs($this->_showService, [$localStartDT, '01:00',
|
||||
['days' => '1', 'hours' => '06', 'mins' => '30'], ]);
|
||||
$dt = $method->invokeArgs($this->_showService, [
|
||||
$localStartDT, '01:00',
|
||||
['days' => '1', 'hours' => '06', 'mins' => '30'],
|
||||
]);
|
||||
$this->assertEquals([
|
||||
$localRebroadcastStartDT->setTimezone($utcTimezone), $localRebroadcastEndDT->setTimezone($utcTimezone), ], $dt);
|
||||
$localRebroadcastStartDT->setTimezone($utcTimezone), $localRebroadcastEndDT->setTimezone($utcTimezone),
|
||||
], $dt);
|
||||
|
||||
// Australia/Brisbane
|
||||
$localStartDT = new DateTime('2044-01-01 06:30', new DateTimeZone('Australia/Brisbane'));
|
||||
|
@ -131,7 +138,8 @@ class ShowServiceUnitTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
$dt = $method->invokeArgs($this->_showService, [$localStartDT, '01:00']);
|
||||
$this->assertEquals([
|
||||
$localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone), ], $dt);
|
||||
$localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone),
|
||||
], $dt);
|
||||
|
||||
// America/Vancouver
|
||||
$localStartDT = new DateTime('2044-01-01 06:30', new DateTimeZone('America/Vancouver'));
|
||||
|
@ -139,6 +147,7 @@ class ShowServiceUnitTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
$dt = $method->invokeArgs($this->_showService, [$localStartDT, '01:00']);
|
||||
$this->assertEquals([
|
||||
$localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone), ], $dt);
|
||||
$localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone),
|
||||
], $dt);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue