style(legacy): format files (#1946)
This commit is contained in:
parent
eb19283d96
commit
4d393fa14e
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Auth adaptor for FreeIPA.
|
* Auth adaptor for FreeIPA.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -9,9 +9,11 @@ class WidgetHelper
|
||||||
// weekStart is in station time.
|
// weekStart is in station time.
|
||||||
$weekStartDateTime = Application_Common_DateHelper::getWeekStartDateTime();
|
$weekStartDateTime = Application_Common_DateHelper::getWeekStartDateTime();
|
||||||
|
|
||||||
$dow = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday',
|
$dow = [
|
||||||
|
'monday', 'tuesday', 'wednesday', 'thursday', 'friday',
|
||||||
'saturday', 'sunday', 'nextmonday', 'nexttuesday', 'nextwednesday',
|
'saturday', 'sunday', 'nextmonday', 'nexttuesday', 'nextwednesday',
|
||||||
'nextthursday', 'nextfriday', 'nextsaturday', 'nextsunday', ];
|
'nextthursday', 'nextfriday', 'nextsaturday', 'nextsunday',
|
||||||
|
];
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by PhpStorm.
|
* Created by PhpStorm.
|
||||||
* User: asantoni
|
* User: asantoni
|
||||||
|
@ -9,7 +10,8 @@ class AirtimeTableView
|
||||||
{
|
{
|
||||||
private static function _getTableJavaScriptDependencies()
|
private static function _getTableJavaScriptDependencies()
|
||||||
{
|
{
|
||||||
return ['js/airtime/widgets/table.js',
|
return [
|
||||||
|
'js/airtime/widgets/table.js',
|
||||||
'js/datatables/js/jquery.dataTables.js',
|
'js/datatables/js/jquery.dataTables.js',
|
||||||
'js/datatables/plugin/dataTables.pluginAPI.js',
|
'js/datatables/plugin/dataTables.pluginAPI.js',
|
||||||
'js/datatables/plugin/dataTables.fnSetFilteringDelay.js',
|
'js/datatables/plugin/dataTables.fnSetFilteringDelay.js',
|
||||||
|
@ -17,7 +19,8 @@ class AirtimeTableView
|
||||||
'js/datatables/plugin/dataTables.colReorder.min.js?',
|
'js/datatables/plugin/dataTables.colReorder.min.js?',
|
||||||
'js/datatables/plugin/dataTables.FixedColumns.js',
|
'js/datatables/plugin/dataTables.FixedColumns.js',
|
||||||
'js/datatables/plugin/dataTables.FixedHeader.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)
|
public static function injectTableJavaScriptDependencies(&$headScript, $baseUrl, $airtimeVersion)
|
||||||
|
|
|
@ -25,6 +25,7 @@ $r2 = array_reduce($externalServices, 'booleanReduce', true);
|
||||||
$result = $r1 && $r2;
|
$result = $r1 && $r2;
|
||||||
?>
|
?>
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" type="text/css" href="css/bootstrap-3.3.1.min.css">
|
<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">
|
<link rel="stylesheet" type="text/css" href="css/setup/config-check.css">
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Navigation container (config/array).
|
* Navigation container (config/array).
|
||||||
*
|
*
|
||||||
|
|
|
@ -184,7 +184,8 @@ class AudiopreviewController extends Zend_Controller_Action
|
||||||
{
|
{
|
||||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
$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_artist' => isset($track['artist_name']) ? $track['artist_name'] : '',
|
||||||
'element_id' => isset($track['id']) ? $track['id'] : '',
|
'element_id' => isset($track['id']) ? $track['id'] : '',
|
||||||
'element_position' => isset($track['position']) ? $track['position'] : '',
|
'element_position' => isset($track['position']) ? $track['position'] : '',
|
||||||
|
|
|
@ -12,7 +12,8 @@ class FeedsController extends Zend_Controller_Action
|
||||||
|
|
||||||
if ((Application_Model_Preference::getStationPodcastPrivacy()
|
if ((Application_Model_Preference::getStationPodcastPrivacy()
|
||||||
&& $request->getParam('sharing_token') != Application_Model_Preference::getStationPodcastDownloadKey())
|
&& $request->getParam('sharing_token') != Application_Model_Preference::getStationPodcastDownloadKey())
|
||||||
&& !RestAuth::verifyAuth(true, false, $this)) {
|
&& !RestAuth::verifyAuth(true, false, $this)
|
||||||
|
) {
|
||||||
$response->setHttpResponseCode(401);
|
$response->setHttpResponseCode(401);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -731,8 +731,10 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$baseUrl = $this->getRequest()->getBaseUrl();
|
$baseUrl = $this->getRequest()->getBaseUrl();
|
||||||
$url = $file->getRelativeFileUrl($baseUrl) . 'download/true';
|
$url = $file->getRelativeFileUrl($baseUrl) . 'download/true';
|
||||||
$menu = [];
|
$menu = [];
|
||||||
$menu[] = ['action' => ['type' => 'gourl', 'url' => $url],
|
$menu[] = [
|
||||||
'title' => _('Download'), ];
|
'action' => ['type' => 'gourl', 'url' => $url],
|
||||||
|
'title' => _('Download'),
|
||||||
|
];
|
||||||
|
|
||||||
// returns format jjmenu is looking for.
|
// returns format jjmenu is looking for.
|
||||||
$this->_helper->json->sendJson($menu);
|
$this->_helper->json->sendJson($menu);
|
||||||
|
|
|
@ -218,9 +218,11 @@ class ShowbuilderController extends Zend_Controller_Action
|
||||||
|
|
||||||
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($request);
|
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($request);
|
||||||
|
|
||||||
$opts = ['myShows' => $my_shows,
|
$opts = [
|
||||||
|
'myShows' => $my_shows,
|
||||||
'showFilter' => $show_filter,
|
'showFilter' => $show_filter,
|
||||||
'showInstanceFilter' => $show_instance_filter, ];
|
'showInstanceFilter' => $show_instance_filter,
|
||||||
|
];
|
||||||
$showBuilder = new Application_Model_ShowBuilder($startsDT, $endsDT, $opts);
|
$showBuilder = new Application_Model_ShowBuilder($startsDT, $endsDT, $opts);
|
||||||
|
|
||||||
$data = $showBuilder->getItems();
|
$data = $showBuilder->getItems();
|
||||||
|
|
|
@ -133,8 +133,10 @@ class UserController extends Zend_Controller_Action
|
||||||
if ($request->isPost()) {
|
if ($request->isPost()) {
|
||||||
$formData = $request->getPost();
|
$formData = $request->getPost();
|
||||||
|
|
||||||
if ($form->isValid($formData)
|
if (
|
||||||
&& $form->validateLogin($formData['cu_login'], $formData['cu_user_id'])) {
|
$form->isValid($formData)
|
||||||
|
&& $form->validateLogin($formData['cu_login'], $formData['cu_user_id'])
|
||||||
|
) {
|
||||||
$user = new Application_Model_User($formData['cu_user_id']);
|
$user = new Application_Model_User($formData['cu_user_id']);
|
||||||
// Stupid hack because our schema enforces non-null first_name
|
// Stupid hack because our schema enforces non-null first_name
|
||||||
// even though by default the admin user has no 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.
|
// We don't allow 6 x's as a password.
|
||||||
// The reason is because we use that as a password placeholder
|
// The reason is because we use that as a password placeholder
|
||||||
// on the client side.
|
// on the client side.
|
||||||
if (array_key_exists('cu_password', $formData) && ($formData['cu_password'] != 'xxxxxx')
|
if (
|
||||||
&& (!empty($formData['cu_password']))) {
|
array_key_exists('cu_password', $formData) && ($formData['cu_password'] != 'xxxxxx')
|
||||||
|
&& (!empty($formData['cu_password']))
|
||||||
|
) {
|
||||||
$user->setPassword($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')
|
public function __construct(Zend_Acl $aclData, $roleName = 'G')
|
||||||
{
|
{
|
||||||
$this->_errorPage = ['module' => 'default',
|
$this->_errorPage = [
|
||||||
|
'module' => 'default',
|
||||||
'controller' => 'error',
|
'controller' => 'error',
|
||||||
'action' => 'error', ];
|
'action' => 'error',
|
||||||
|
];
|
||||||
|
|
||||||
$this->_roleName = $roleName;
|
$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')
|
public function setErrorPage($action, $controller = 'error', $module = 'default')
|
||||||
{
|
{
|
||||||
$this->_errorPage = ['module' => $module,
|
$this->_errorPage = [
|
||||||
|
'module' => $module,
|
||||||
'controller' => $controller,
|
'controller' => $controller,
|
||||||
'action' => $action, ];
|
'action' => $action,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -36,8 +36,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
|
||||||
'upgrade',
|
'upgrade',
|
||||||
'embed',
|
'embed',
|
||||||
'feeds',
|
'feeds',
|
||||||
])
|
])) {
|
||||||
) {
|
|
||||||
// Start the session
|
// Start the session
|
||||||
Zend_Session::start();
|
Zend_Session::start();
|
||||||
Application_Model_Auth::pinSessionToClient(Zend_Auth::getInstance());
|
Application_Model_Auth::pinSessionToClient(Zend_Auth::getInstance());
|
||||||
|
|
|
@ -25,7 +25,8 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
||||||
->setLabel(_('Custom Username'))
|
->setLabel(_('Custom Username'))
|
||||||
->setFilters(['StringTrim'])
|
->setFilters(['StringTrim'])
|
||||||
->setValidators([
|
->setValidators([
|
||||||
new ConditionalNotEmpty(['cb_custom_auth' => '1']), ]);
|
new ConditionalNotEmpty(['cb_custom_auth' => '1']),
|
||||||
|
]);
|
||||||
$this->addElement($custom_username);
|
$this->addElement($custom_username);
|
||||||
|
|
||||||
// custom password
|
// custom password
|
||||||
|
@ -37,7 +38,8 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
||||||
->setLabel(_('Custom Password'))
|
->setLabel(_('Custom Password'))
|
||||||
->setFilters(['StringTrim'])
|
->setFilters(['StringTrim'])
|
||||||
->setValidators([
|
->setValidators([
|
||||||
new ConditionalNotEmpty(['cb_custom_auth' => '1']), ]);
|
new ConditionalNotEmpty(['cb_custom_auth' => '1']),
|
||||||
|
]);
|
||||||
$this->addElement($custom_password);
|
$this->addElement($custom_password);
|
||||||
|
|
||||||
$showSourceParams = parse_url(Application_Model_Preference::GetLiveDJSourceConnectionURL());
|
$showSourceParams = parse_url(Application_Model_Preference::GetLiveDJSourceConnectionURL());
|
||||||
|
|
|
@ -106,9 +106,11 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
|
||||||
{
|
{
|
||||||
$elements = $this->getElements();
|
$elements = $this->getElements();
|
||||||
foreach ($elements as $element) {
|
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
|
// 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');
|
$element->setAttrib('disabled', 'disabled');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
->setFilters(['StringTrim'])
|
->setFilters(['StringTrim'])
|
||||||
->setValidators([
|
->setValidators([
|
||||||
$notEmptyValidator,
|
$notEmptyValidator,
|
||||||
$dateValidator, ])
|
$dateValidator,
|
||||||
|
])
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
$startDate->setAttrib('alt', 'date');
|
$startDate->setAttrib('alt', 'date');
|
||||||
$this->addElement($startDate);
|
$this->addElement($startDate);
|
||||||
|
@ -64,7 +65,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
->setFilters(['StringTrim'])
|
->setFilters(['StringTrim'])
|
||||||
->setValidators([
|
->setValidators([
|
||||||
$notEmptyValidator,
|
$notEmptyValidator,
|
||||||
$dateValidator, ])
|
$dateValidator,
|
||||||
|
])
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
$endDate->setAttrib('alt', 'date');
|
$endDate->setAttrib('alt', 'date');
|
||||||
$this->addElement($endDate);
|
$this->addElement($endDate);
|
||||||
|
@ -77,7 +79,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
->setFilters(['StringTrim'])
|
->setFilters(['StringTrim'])
|
||||||
->setValidators([
|
->setValidators([
|
||||||
$notEmptyValidator,
|
$notEmptyValidator,
|
||||||
$regexValidator, ])
|
$regexValidator,
|
||||||
|
])
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
$endTime->setAttrib('alt', 'time');
|
$endTime->setAttrib('alt', 'time');
|
||||||
$this->addElement($endTime);
|
$this->addElement($endTime);
|
||||||
|
@ -173,10 +176,12 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
} elseif ($showStartDateTime == $showEndDateTime) {
|
} elseif ($showStartDateTime == $showEndDateTime) {
|
||||||
$this->getElement('add_show_duration')->setErrors([_('Cannot have duration 00h 00m')]);
|
$this->getElement('add_show_duration')->setErrors([_('Cannot have duration 00h 00m')]);
|
||||||
$valid = false;
|
$valid = false;
|
||||||
} elseif (intval($duration->format('%d')) > 0
|
} elseif (
|
||||||
|
intval($duration->format('%d')) > 0
|
||||||
&& (intval($duration->format('%h')) > 0
|
&& (intval($duration->format('%h')) > 0
|
||||||
|| intval($duration->format('%i')) > 0
|
|| intval($duration->format('%i')) > 0
|
||||||
|| intval($duration->format('%s')) > 0)) {
|
|| intval($duration->format('%s')) > 0)
|
||||||
|
) {
|
||||||
$this->getElement('add_show_duration')->setErrors([_('Cannot have duration greater than 24h')]);
|
$this->getElement('add_show_duration')->setErrors([_('Cannot have duration greater than 24h')]);
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,8 @@ class Application_Form_DateRange extends Zend_Form_SubForm
|
||||||
->setFilters(['StringTrim'])
|
->setFilters(['StringTrim'])
|
||||||
->setValidators([
|
->setValidators([
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
['date', false, ['YYYY-MM-DD']], ])
|
['date', false, ['YYYY-MM-DD']],
|
||||||
|
])
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
$startDate->setAttrib('alt', 'date');
|
$startDate->setAttrib('alt', 'date');
|
||||||
$this->addElement($startDate);
|
$this->addElement($startDate);
|
||||||
|
@ -31,7 +32,8 @@ class Application_Form_DateRange extends Zend_Form_SubForm
|
||||||
->setValidators([
|
->setValidators([
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
['date', false, ['HH:mm']],
|
['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']);
|
->setDecorators(['ViewHelper']);
|
||||||
$startTime->setAttrib('alt', 'time');
|
$startTime->setAttrib('alt', 'time');
|
||||||
$this->addElement($startTime);
|
$this->addElement($startTime);
|
||||||
|
@ -45,7 +47,8 @@ class Application_Form_DateRange extends Zend_Form_SubForm
|
||||||
->setFilters(['StringTrim'])
|
->setFilters(['StringTrim'])
|
||||||
->setValidators([
|
->setValidators([
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
['date', false, ['YYYY-MM-DD']], ])
|
['date', false, ['YYYY-MM-DD']],
|
||||||
|
])
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
$endDate->setAttrib('alt', 'date');
|
$endDate->setAttrib('alt', 'date');
|
||||||
$this->addElement($endDate);
|
$this->addElement($endDate);
|
||||||
|
@ -59,7 +62,8 @@ class Application_Form_DateRange extends Zend_Form_SubForm
|
||||||
->setValidators([
|
->setValidators([
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
['date', false, ['HH:mm']],
|
['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']);
|
->setDecorators(['ViewHelper']);
|
||||||
$endTime->setAttrib('alt', 'time');
|
$endTime->setAttrib('alt', 'time');
|
||||||
$this->addElement($endTime);
|
$this->addElement($endTime);
|
||||||
|
|
|
@ -198,7 +198,8 @@ class Application_Form_EditAudioMD extends Zend_Form
|
||||||
->setFilters(['StringTrim'])
|
->setFilters(['StringTrim'])
|
||||||
->setValidators([
|
->setValidators([
|
||||||
new Zend_Validate_StringLength(['min' => 0, 'max' => 8]),
|
new Zend_Validate_StringLength(['min' => 0, 'max' => 8]),
|
||||||
new Zend_Validate_Digits(), ]);
|
new Zend_Validate_Digits(),
|
||||||
|
]);
|
||||||
$this->addElement($bpm);
|
$this->addElement($bpm);
|
||||||
|
|
||||||
// Add copyright field
|
// Add copyright field
|
||||||
|
|
|
@ -18,7 +18,8 @@ class Application_Form_EditUser extends Zend_Form
|
||||||
$notDemoValidator = new Application_Validate_NotDemoValidate();
|
$notDemoValidator = new Application_Validate_NotDemoValidate();
|
||||||
|
|
||||||
$this->setDecorators([
|
$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');
|
$this->setAttrib('id', 'current-user-form');
|
||||||
|
|
||||||
$csrf_namespace = new Zend_Session_Namespace('csrf_namespace');
|
$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->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->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->setSeparator(' '); // No <br> between radio buttons
|
||||||
$podcast_album_override->addDecorator('HtmlTag', ['tag' => 'dd',
|
$podcast_album_override->addDecorator('HtmlTag', [
|
||||||
|
'tag' => 'dd',
|
||||||
'id' => 'podcastAlbumOverride-element',
|
'id' => 'podcastAlbumOverride-element',
|
||||||
'class' => 'radio-inline-list',
|
'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->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->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->setSeparator(' '); // No <br> between radio buttons
|
||||||
$podcast_auto_smartblock->addDecorator('HtmlTag', ['tag' => 'dd',
|
$podcast_auto_smartblock->addDecorator('HtmlTag', [
|
||||||
|
'tag' => 'dd',
|
||||||
'id' => 'podcastAutoSmartblock-element',
|
'id' => 'podcastAutoSmartblock-element',
|
||||||
'class' => 'radio-inline-list',
|
'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.'));
|
to external widgets that can be embedded in your website.'));
|
||||||
$third_party_api->setSeparator(' '); // No <br> between radio buttons
|
$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(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',
|
'id' => 'thirdPartyApi-element',
|
||||||
'class' => 'radio-inline-list',
|
'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->setValue(Application_Model_Preference::GetFeaturePreviewMode());
|
||||||
$feature_preview_mode->setDescription(_('Enable this to opt-in to test new features.'));
|
$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->setSeparator(' '); // No <br> between radio buttons
|
||||||
$feature_preview_mode->addDecorator('HtmlTag', ['tag' => 'dd',
|
$feature_preview_mode->addDecorator('HtmlTag', [
|
||||||
|
'tag' => 'dd',
|
||||||
'id' => 'featurePreviewMode-element',
|
'id' => 'featurePreviewMode-element',
|
||||||
'class' => 'radio-inline-list',
|
'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 = new Zend_Form_Element_Text('transition_fade');
|
||||||
$transition_fade->setLabel(_('Switch Transition Fade (s):'))
|
$transition_fade->setLabel(_('Switch Transition Fade (s):'))
|
||||||
->setFilters(['StringTrim'])
|
->setFilters(['StringTrim'])
|
||||||
->addValidator('regex', false, ['/^\d*(\.\d+)?$/',
|
->addValidator('regex', false, [
|
||||||
'messages' => _('Please enter a time in seconds (eg. 0.5)'), ])
|
'/^\d*(\.\d+)?$/',
|
||||||
|
'messages' => _('Please enter a time in seconds (eg. 0.5)'),
|
||||||
|
])
|
||||||
->setValue($defaultFade);
|
->setValue($defaultFade);
|
||||||
$this->addElement($transition_fade);
|
$this->addElement($transition_fade);
|
||||||
|
|
||||||
|
@ -85,7 +87,8 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
||||||
$masterSourceMount->setLabel(_('Master Source Mount:'))
|
$masterSourceMount->setLabel(_('Master Source Mount:'))
|
||||||
->setValue($m_mount)
|
->setValue($m_mount)
|
||||||
->setValidators([
|
->setValidators([
|
||||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ]);
|
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]],
|
||||||
|
]);
|
||||||
$this->addElement($masterSourceMount);
|
$this->addElement($masterSourceMount);
|
||||||
|
|
||||||
$showSourceParams = parse_url(Application_Model_Preference::GetLiveDJSourceConnectionURL());
|
$showSourceParams = parse_url(Application_Model_Preference::GetLiveDJSourceConnectionURL());
|
||||||
|
@ -112,7 +115,8 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
||||||
$showSourceMount->setLabel(_('Show Source Mount:'))
|
$showSourceMount->setLabel(_('Show Source Mount:'))
|
||||||
->setValue($l_mount)
|
->setValue($l_mount)
|
||||||
->setValidators([
|
->setValidators([
|
||||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ]);
|
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]],
|
||||||
|
]);
|
||||||
$this->addElement($showSourceMount);
|
$this->addElement($showSourceMount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +130,8 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
||||||
|
|
||||||
$this->setDecorators(
|
$this->setDecorators(
|
||||||
[
|
[
|
||||||
['ViewScript',
|
[
|
||||||
|
'ViewScript',
|
||||||
[
|
[
|
||||||
'viewScript' => 'form/preferences_livestream.phtml',
|
'viewScript' => 'form/preferences_livestream.phtml',
|
||||||
'master_source_host' => isset($masterSourceHost) ? Application_Model_Preference::GetMasterDJSourceConnectionURL() : '',
|
'master_source_host' => isset($masterSourceHost) ? Application_Model_Preference::GetMasterDJSourceConnectionURL() : '',
|
||||||
|
|
|
@ -40,7 +40,8 @@ class Application_Form_Login extends Zend_Form
|
||||||
->setAttribs([
|
->setAttribs([
|
||||||
'autofocus' => 'true',
|
'autofocus' => 'true',
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'required' => 'true', ])
|
'required' => 'true',
|
||||||
|
])
|
||||||
->setValue((isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) ? 'admin' : '')
|
->setValue((isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) ? 'admin' : '')
|
||||||
->addFilter('StringTrim')
|
->addFilter('StringTrim')
|
||||||
->setDecorators(['ViewHelper'])
|
->setDecorators(['ViewHelper'])
|
||||||
|
|
|
@ -15,8 +15,10 @@ class Application_Form_PasswordChange extends Zend_Form
|
||||||
'label' => _('Password'),
|
'label' => _('Password'),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'filters' => ['stringTrim'],
|
'filters' => ['stringTrim'],
|
||||||
'validators' => [$notEmptyValidator,
|
'validators' => [
|
||||||
$stringLengthValidator, ],
|
$notEmptyValidator,
|
||||||
|
$stringLengthValidator,
|
||||||
|
],
|
||||||
'decorators' => [
|
'decorators' => [
|
||||||
'ViewHelper',
|
'ViewHelper',
|
||||||
],
|
],
|
||||||
|
|
|
@ -12,7 +12,8 @@ class Application_Form_PodcastPreferences extends Zend_Form_SubForm
|
||||||
_('Private'),
|
_('Private'),
|
||||||
]);
|
]);
|
||||||
$stationPodcastPrivacy->setSeparator(' ');
|
$stationPodcastPrivacy->setSeparator(' ');
|
||||||
$stationPodcastPrivacy->addDecorator('HtmlTag', ['tag' => 'dd',
|
$stationPodcastPrivacy->addDecorator('HtmlTag', [
|
||||||
|
'tag' => 'dd',
|
||||||
'id' => 'stationPodcastPrivacy-element',
|
'id' => 'stationPodcastPrivacy-element',
|
||||||
'class' => 'radio-inline-list',
|
'class' => 'radio-inline-list',
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -5,7 +5,8 @@ class Application_Form_SetupLanguageTimezone extends Zend_Form_SubForm
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$this->setDecorators([
|
$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_namespace = new Zend_Session_Namespace('csrf_namespace');
|
||||||
$csrf_element = new Zend_Form_Element_Hidden('csrf');
|
$csrf_element = new Zend_Form_Element_Hidden('csrf');
|
||||||
|
|
|
@ -19,7 +19,8 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
||||||
->setFilters(['StringTrim'])
|
->setFilters(['StringTrim'])
|
||||||
->setValidators([
|
->setValidators([
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
['date', false, ['YYYY-MM-DD']], ])
|
['date', false, ['YYYY-MM-DD']],
|
||||||
|
])
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
$startDate->setAttrib('alt', 'date');
|
$startDate->setAttrib('alt', 'date');
|
||||||
$this->addElement($startDate);
|
$this->addElement($startDate);
|
||||||
|
@ -33,7 +34,8 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
||||||
->setValidators([
|
->setValidators([
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
['date', false, ['HH:mm']],
|
['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']);
|
->setDecorators(['ViewHelper']);
|
||||||
$startTime->setAttrib('alt', 'time');
|
$startTime->setAttrib('alt', 'time');
|
||||||
$this->addElement($startTime);
|
$this->addElement($startTime);
|
||||||
|
@ -47,7 +49,8 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
||||||
->setFilters(['StringTrim'])
|
->setFilters(['StringTrim'])
|
||||||
->setValidators([
|
->setValidators([
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
['date', false, ['YYYY-MM-DD']], ])
|
['date', false, ['YYYY-MM-DD']],
|
||||||
|
])
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
$endDate->setAttrib('alt', 'date');
|
$endDate->setAttrib('alt', 'date');
|
||||||
$this->addElement($endDate);
|
$this->addElement($endDate);
|
||||||
|
@ -61,7 +64,8 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
||||||
->setValidators([
|
->setValidators([
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
['date', false, ['HH:mm']],
|
['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']);
|
->setDecorators(['ViewHelper']);
|
||||||
$endTime->setAttrib('alt', 'time');
|
$endTime->setAttrib('alt', 'time');
|
||||||
$this->addElement($endTime);
|
$this->addElement($endTime);
|
||||||
|
|
|
@ -17,7 +17,8 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
|
||||||
->setFilters(['StringTrim'])
|
->setFilters(['StringTrim'])
|
||||||
->setValidators([
|
->setValidators([
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
['date', false, ['YYYY-MM-DD']], ])
|
['date', false, ['YYYY-MM-DD']],
|
||||||
|
])
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
$startDate->setAttrib('alt', 'date');
|
$startDate->setAttrib('alt', 'date');
|
||||||
$this->addElement($startDate);
|
$this->addElement($startDate);
|
||||||
|
@ -31,7 +32,8 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
|
||||||
->setValidators([
|
->setValidators([
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
['date', false, ['HH:mm']],
|
['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']);
|
->setDecorators(['ViewHelper']);
|
||||||
$startTime->setAttrib('alt', 'time');
|
$startTime->setAttrib('alt', 'time');
|
||||||
$this->addElement($startTime);
|
$this->addElement($startTime);
|
||||||
|
@ -45,7 +47,8 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
|
||||||
->setFilters(['StringTrim'])
|
->setFilters(['StringTrim'])
|
||||||
->setValidators([
|
->setValidators([
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
['date', false, ['YYYY-MM-DD']], ])
|
['date', false, ['YYYY-MM-DD']],
|
||||||
|
])
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
$endDate->setAttrib('alt', 'date');
|
$endDate->setAttrib('alt', 'date');
|
||||||
$this->addElement($endDate);
|
$this->addElement($endDate);
|
||||||
|
@ -59,7 +62,8 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
|
||||||
->setValidators([
|
->setValidators([
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
['date', false, ['HH:mm']],
|
['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']);
|
->setDecorators(['ViewHelper']);
|
||||||
$endTime->setAttrib('alt', 'time');
|
$endTime->setAttrib('alt', 'time');
|
||||||
$this->addElement($endTime);
|
$this->addElement($endTime);
|
||||||
|
|
|
@ -382,8 +382,10 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
// The challenge here is that datetime
|
// The challenge here is that datetime
|
||||||
if (isset($criteriaKeys[$i])) {
|
if (isset($criteriaKeys[$i])) {
|
||||||
$modifierTest = (string) $storedCrit['crit'][$criteriaKeys[$i]][$j]['modifier'];
|
$modifierTest = (string) $storedCrit['crit'][$criteriaKeys[$i]][$j]['modifier'];
|
||||||
if (isset($criteriaType) && $criteriaType == 'tt'
|
if (
|
||||||
&& preg_match('/is|is not/', $modifierTest) == 1) {
|
isset($criteriaType) && $criteriaType == 'tt'
|
||||||
|
&& preg_match('/is|is not/', $modifierTest) == 1
|
||||||
|
) {
|
||||||
$criteriaValue = new Zend_Form_Element_Select('sp_criteria_value_' . $i . '_' . $j);
|
$criteriaValue = new Zend_Form_Element_Select('sp_criteria_value_' . $i . '_' . $j);
|
||||||
$criteriaValue->setAttrib('class', 'input_select sp_input_select')->setDecorators(['viewHelper']);
|
$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
|
// this is used below to test whether the datetime select should be shown or hidden
|
||||||
$relativeDateTime = false;
|
$relativeDateTime = false;
|
||||||
$modifierTest = (string) $storedCrit['crit'][$criteriaKeys[$i]][$j]['modifier'];
|
$modifierTest = (string) $storedCrit['crit'][$criteriaKeys[$i]][$j]['modifier'];
|
||||||
if (isset($criteriaType) && $criteriaType == 'd'
|
if (
|
||||||
&& preg_match('/before|after|between/', $modifierTest) == 1) {
|
isset($criteriaType) && $criteriaType == 'd'
|
||||||
|
&& preg_match('/before|after|between/', $modifierTest) == 1
|
||||||
|
) {
|
||||||
// set relativeDatetime boolean to true so that the datetime select is displayed below
|
// set relativeDatetime boolean to true so that the datetime select is displayed below
|
||||||
$relativeDateTime = true;
|
$relativeDateTime = true;
|
||||||
$criteriaValue->setValue(filter_var($storedCrit['crit'][$criteriaKeys[$i]][$j]['value'], FILTER_SANITIZE_NUMBER_INT));
|
$criteriaValue->setValue(filter_var($storedCrit['crit'][$criteriaKeys[$i]][$j]['value'], FILTER_SANITIZE_NUMBER_INT));
|
||||||
} elseif (isset($criteriaType) && $criteriaType == 'tt'
|
} elseif (
|
||||||
&& preg_match('/is|is not/', $modifierTest) == 1) {
|
isset($criteriaType) && $criteriaType == 'tt'
|
||||||
|
&& preg_match('/is|is not/', $modifierTest) == 1
|
||||||
|
) {
|
||||||
// set relativeDatetime boolean to true so that the datetime select is displayed below
|
// set relativeDatetime boolean to true so that the datetime select is displayed below
|
||||||
$relativeDateTime = false;
|
$relativeDateTime = false;
|
||||||
|
|
||||||
|
@ -449,9 +455,11 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
$criteriaDatetimeSelect->setAttrib('disabled', 'disabled');
|
$criteriaDatetimeSelect->setAttrib('disabled', 'disabled');
|
||||||
}
|
}
|
||||||
// check if the value is stored and it is a relative datetime field
|
// check if the value is stored and it is a relative datetime field
|
||||||
if (isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['value'], $criteriaType)
|
if (
|
||||||
|
isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['value'], $criteriaType)
|
||||||
&& $criteriaType == 'd'
|
&& $criteriaType == 'd'
|
||||||
&& preg_match('/before|after|between/', $modifierTest) == 1) {
|
&& preg_match('/before|after|between/', $modifierTest) == 1
|
||||||
|
) {
|
||||||
// need to remove any leading numbers stored in the database
|
// need to remove any leading numbers stored in the database
|
||||||
$dateTimeSelectValue = preg_replace('/[0-9]+/', '', $storedCrit['crit'][$criteriaKeys[$i]][$j]['value']);
|
$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
|
// 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')
|
$criteriaExtraDatetimeSelect->setAttrib('class', 'input_select sp_input_select')
|
||||||
->setDecorators(['viewHelper']);
|
->setDecorators(['viewHelper']);
|
||||||
|
|
||||||
if (isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['extra'])
|
if (
|
||||||
&& $modifierTest == 'between') {
|
isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['extra'])
|
||||||
|
&& $modifierTest == 'between'
|
||||||
|
) {
|
||||||
// need to remove the leading numbers stored in the database
|
// need to remove the leading numbers stored in the database
|
||||||
$extraDateTimeSelectValue = preg_replace('/[0-9]+/', '', $storedCrit['crit'][$criteriaKeys[$i]][$j]['extra']);
|
$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
|
// need to strip white from front and ago from the end to match with the value of the time unit select dropdown
|
||||||
|
@ -576,8 +586,10 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
$this->addElement($shuffle);
|
$this->addElement($shuffle);
|
||||||
|
|
||||||
$this->setDecorators([
|
$this->setDecorators([
|
||||||
['ViewScript', ['viewScript' => 'form/smart-block-criteria.phtml', 'openOption' => $openSmartBlockOption,
|
['ViewScript', [
|
||||||
'criteriasLength' => $numElements, 'modRowMap' => $modRowMap, ]],
|
'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
|
} elseif (
|
||||||
&& $d['sp_criteria_field'] != 'owner_id') {
|
$column->getType() == PropelColumnTypes::INTEGER
|
||||||
|
&& $d['sp_criteria_field'] != 'owner_id'
|
||||||
|
) {
|
||||||
if (!is_numeric($d['sp_criteria_value'])) {
|
if (!is_numeric($d['sp_criteria_value'])) {
|
||||||
$element->addError(_('The value has to be numeric'));
|
$element->addError(_('The value has to be numeric'));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
|
|
|
@ -81,8 +81,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$output = new Zend_Form_Element_Select('output');
|
$output = new Zend_Form_Element_Select('output');
|
||||||
$output->setLabel(_('Service Type:'))
|
$output->setLabel(_('Service Type:'))
|
||||||
->setMultiOptions(['icecast' => 'Icecast', 'shoutcast' => 'SHOUTcast'])
|
->setMultiOptions(['icecast' => 'Icecast', 'shoutcast' => 'SHOUTcast'])
|
||||||
->setValue($useDefaults ? $streamDefaults['output'] :
|
->setValue($useDefaults ? $streamDefaults['output'] : (isset($setting[$prefix . '_output']) ? $setting[$prefix . '_output'] : 'icecast'))
|
||||||
(isset($setting[$prefix . '_output']) ? $setting[$prefix . '_output'] : 'icecast'))
|
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
$this->addElement($output);
|
$this->addElement($output);
|
||||||
|
|
||||||
|
@ -96,18 +95,17 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
|
|
||||||
$host = new Zend_Form_Element_Text('host');
|
$host = new Zend_Form_Element_Text('host');
|
||||||
$host->setLabel(_('Server'))
|
$host->setLabel(_('Server'))
|
||||||
->setValue($useDefaults ? $streamDefaults['host'] :
|
->setValue($useDefaults ? $streamDefaults['host'] : (isset($setting[$prefix . '_host']) ? $setting[$prefix . '_host'] : ''))
|
||||||
(isset($setting[$prefix . '_host']) ? $setting[$prefix . '_host'] : ''))
|
|
||||||
->setValidators([
|
->setValidators([
|
||||||
['regex', false, ['/^[0-9a-zA-Z-_.]+$/', 'messages' => _('Invalid character entered')]], ])
|
['regex', false, ['/^[0-9a-zA-Z-_.]+$/', 'messages' => _('Invalid character entered')]],
|
||||||
|
])
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
$host->setAttrib('alt', 'domain');
|
$host->setAttrib('alt', 'domain');
|
||||||
$this->addElement($host);
|
$this->addElement($host);
|
||||||
|
|
||||||
$port = new Zend_Form_Element_Text('port');
|
$port = new Zend_Form_Element_Text('port');
|
||||||
$port->setLabel(_('Port'))
|
$port->setLabel(_('Port'))
|
||||||
->setValue($useDefaults ? $streamDefaults['port'] :
|
->setValue($useDefaults ? $streamDefaults['port'] : (isset($setting[$prefix . '_port']) ? $setting[$prefix . '_port'] : ''))
|
||||||
(isset($setting[$prefix . '_port']) ? $setting[$prefix . '_port'] : ''))
|
|
||||||
->setValidators([new Zend_Validate_Between(['min' => 0, 'max' => 99999])])
|
->setValidators([new Zend_Validate_Between(['min' => 0, 'max' => 99999])])
|
||||||
->addValidator('regex', false, ['pattern' => '/^[0-9]+$/', 'messages' => ['regexNotMatch' => _('Only numbers are allowed.')]])
|
->addValidator('regex', false, ['pattern' => '/^[0-9]+$/', 'messages' => ['regexNotMatch' => _('Only numbers are allowed.')]])
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
|
@ -115,10 +113,10 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
|
|
||||||
$pass = new Zend_Form_Element_Text('pass');
|
$pass = new Zend_Form_Element_Text('pass');
|
||||||
$pass->setLabel(_('Password'))
|
$pass->setLabel(_('Password'))
|
||||||
->setValue($useDefaults ? $streamDefaults['pass'] :
|
->setValue($useDefaults ? $streamDefaults['pass'] : (isset($setting[$prefix . '_pass']) ? $setting[$prefix . '_pass'] : ''))
|
||||||
(isset($setting[$prefix . '_pass']) ? $setting[$prefix . '_pass'] : ''))
|
|
||||||
->setValidators([
|
->setValidators([
|
||||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
|
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]],
|
||||||
|
])
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
$pass->setAttrib('alt', 'regular_text');
|
$pass->setAttrib('alt', 'regular_text');
|
||||||
$this->addElement($pass);
|
$this->addElement($pass);
|
||||||
|
@ -133,7 +131,8 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$url->setLabel(_('URL'))
|
$url->setLabel(_('URL'))
|
||||||
->setValue(isset($setting[$prefix . '_url']) ? $setting[$prefix . '_url'] : '')
|
->setValue(isset($setting[$prefix . '_url']) ? $setting[$prefix . '_url'] : '')
|
||||||
->setValidators([
|
->setValidators([
|
||||||
['regex', false, ['/^[0-9a-zA-Z\-_.:\/]+$/', 'messages' => _('Invalid character entered')]], ])
|
['regex', false, ['/^[0-9a-zA-Z\-_.:\/]+$/', 'messages' => _('Invalid character entered')]],
|
||||||
|
])
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
$url->setAttrib('alt', 'url');
|
$url->setAttrib('alt', 'url');
|
||||||
$this->addElement($url);
|
$this->addElement($url);
|
||||||
|
@ -152,20 +151,20 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
|
|
||||||
$mount = new Zend_Form_Element_Text('mount');
|
$mount = new Zend_Form_Element_Text('mount');
|
||||||
$mount->setLabel(_('Mount Point'))
|
$mount->setLabel(_('Mount Point'))
|
||||||
->setValue($useDefaults ? $streamDefaults['mount'] :
|
->setValue($useDefaults ? $streamDefaults['mount'] : (isset($setting[$prefix . '_mount']) ? $setting[$prefix . '_mount'] : ''))
|
||||||
(isset($setting[$prefix . '_mount']) ? $setting[$prefix . '_mount'] : ''))
|
|
||||||
->setValidators([
|
->setValidators([
|
||||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
|
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]],
|
||||||
|
])
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
$mount->setAttrib('alt', 'regular_text');
|
$mount->setAttrib('alt', 'regular_text');
|
||||||
$this->addElement($mount);
|
$this->addElement($mount);
|
||||||
|
|
||||||
$user = new Zend_Form_Element_Text('user');
|
$user = new Zend_Form_Element_Text('user');
|
||||||
$user->setLabel(_('Username'))
|
$user->setLabel(_('Username'))
|
||||||
->setValue($useDefaults ? $streamDefaults['user'] :
|
->setValue($useDefaults ? $streamDefaults['user'] : (isset($setting[$prefix . '_user']) ? $setting[$prefix . '_user'] : ''))
|
||||||
(isset($setting[$prefix . '_user']) ? $setting[$prefix . '_user'] : ''))
|
|
||||||
->setValidators([
|
->setValidators([
|
||||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
|
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]],
|
||||||
|
])
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
$user->setAttrib('alt', 'regular_text');
|
$user->setAttrib('alt', 'regular_text');
|
||||||
$this->addElement($user);
|
$this->addElement($user);
|
||||||
|
@ -174,7 +173,8 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$adminUser->setLabel(_('Admin User'))
|
$adminUser->setLabel(_('Admin User'))
|
||||||
->setValue(Application_Model_StreamSetting::getAdminUser($prefix))
|
->setValue(Application_Model_StreamSetting::getAdminUser($prefix))
|
||||||
->setValidators([
|
->setValidators([
|
||||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
|
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]],
|
||||||
|
])
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
$adminUser->setAttrib('alt', 'regular_text');
|
$adminUser->setAttrib('alt', 'regular_text');
|
||||||
$this->addElement($adminUser);
|
$this->addElement($adminUser);
|
||||||
|
@ -183,7 +183,8 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$adminPass->setLabel(_('Admin Password'))
|
$adminPass->setLabel(_('Admin Password'))
|
||||||
->setValue(Application_Model_StreamSetting::getAdminPass($prefix))
|
->setValue(Application_Model_StreamSetting::getAdminPass($prefix))
|
||||||
->setValidators([
|
->setValidators([
|
||||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
|
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]],
|
||||||
|
])
|
||||||
->setDecorators(['ViewHelper']);
|
->setDecorators(['ViewHelper']);
|
||||||
$adminPass->setAttrib('alt', 'regular_text');
|
$adminPass->setAttrib('alt', 'regular_text');
|
||||||
$this->addElement($adminPass);
|
$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>';
|
$liquidsoap_error_msg = '<div class="stream-status status-info"><p>' . _('Getting information from the server...') . '</p></div>';
|
||||||
|
|
||||||
$this->setDecorators([
|
$this->setDecorators([
|
||||||
['ViewScript', ['viewScript' => 'form/stream-setting-form.phtml',
|
['ViewScript', [
|
||||||
|
'viewScript' => 'form/stream-setting-form.phtml',
|
||||||
'stream_number' => $stream_number,
|
'stream_number' => $stream_number,
|
||||||
'enabled' => $enable->getValue(),
|
'enabled' => $enable->getValue(),
|
||||||
'liquidsoap_error_msg' => $liquidsoap_error_msg, ]],
|
'liquidsoap_error_msg' => $liquidsoap_error_msg,
|
||||||
|
]],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* custom filter for image uploads.
|
* custom filter for image uploads.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a field is empty but only when specific fields have specific values.
|
* 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,
|
'is in the range' => Criteria::CUSTOM,
|
||||||
'before' => Criteria::CUSTOM,
|
'before' => Criteria::CUSTOM,
|
||||||
'after' => Criteria::CUSTOM,
|
'after' => Criteria::CUSTOM,
|
||||||
'between' => Criteria::CUSTOM, ];
|
'between' => Criteria::CUSTOM,
|
||||||
|
];
|
||||||
|
|
||||||
private static $criteria2PeerMap = [
|
private static $criteria2PeerMap = [
|
||||||
0 => 'Select criteria',
|
0 => 'Select criteria',
|
||||||
|
@ -978,8 +979,10 @@ SQL;
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ['cliplength' => $cliplength, 'cueIn' => $cueIn, 'cueOut' => $cueOut, 'length' => $this->getUnformatedLength(),
|
return [
|
||||||
'fadeIn' => $fadeIn, 'fadeOut' => $fadeOut, ];
|
'cliplength' => $cliplength, 'cueIn' => $cueIn, 'cueOut' => $cueOut, 'length' => $this->getUnformatedLength(),
|
||||||
|
'fadeIn' => $fadeIn, 'fadeOut' => $fadeOut,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAllPLMetaData()
|
public function getAllPLMetaData()
|
||||||
|
@ -1487,7 +1490,8 @@ SQL;
|
||||||
$storedCrit['limit'] = [
|
$storedCrit['limit'] = [
|
||||||
'value' => $value,
|
'value' => $value,
|
||||||
'modifier' => $modifier,
|
'modifier' => $modifier,
|
||||||
'display_modifier' => _($modifier), ];
|
'display_modifier' => _($modifier),
|
||||||
|
];
|
||||||
} elseif ($criteria == 'repeat_tracks') {
|
} elseif ($criteria == 'repeat_tracks') {
|
||||||
$storedCrit['repeat_tracks'] = ['value' => $value];
|
$storedCrit['repeat_tracks'] = ['value' => $value];
|
||||||
} elseif ($criteria == 'overflow_tracks') {
|
} elseif ($criteria == 'overflow_tracks') {
|
||||||
|
@ -1502,7 +1506,8 @@ SQL;
|
||||||
'extra' => $extra,
|
'extra' => $extra,
|
||||||
'criteria_group' => $criteriagroup,
|
'criteria_group' => $criteriagroup,
|
||||||
'display_name' => $criteriaOptions[$criteria],
|
'display_name' => $criteriaOptions[$criteria],
|
||||||
'display_modifier' => $modifierOptions[$modifier], ];
|
'display_modifier' => $modifierOptions[$modifier],
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1583,7 +1588,8 @@ SQL;
|
||||||
$storedCrit['limit'] = [
|
$storedCrit['limit'] = [
|
||||||
'value' => $value,
|
'value' => $value,
|
||||||
'modifier' => $modifier,
|
'modifier' => $modifier,
|
||||||
'display_modifier' => _($modifier), ];
|
'display_modifier' => _($modifier),
|
||||||
|
];
|
||||||
} elseif ($criteria == 'repeat_tracks') {
|
} elseif ($criteria == 'repeat_tracks') {
|
||||||
$storedCrit['repeat_tracks'] = ['value' => $value];
|
$storedCrit['repeat_tracks'] = ['value' => $value];
|
||||||
} elseif ($criteria == 'overflow_tracks') {
|
} elseif ($criteria == 'overflow_tracks') {
|
||||||
|
@ -1597,7 +1603,8 @@ SQL;
|
||||||
'modifier' => $modifier,
|
'modifier' => $modifier,
|
||||||
'extra' => $extra,
|
'extra' => $extra,
|
||||||
'display_name' => $criteriaOptions[$criteria],
|
'display_name' => $criteriaOptions[$criteria],
|
||||||
'display_modifier' => $modifierOptions[$modifier], ];
|
'display_modifier' => $modifierOptions[$modifier],
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,30 +17,38 @@ class Application_Model_Dashboard
|
||||||
return null;
|
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'],
|
'starts' => $row[0]['starts'],
|
||||||
'ends' => $row[0]['ends'], ];
|
'ends' => $row[0]['ends'],
|
||||||
|
];
|
||||||
}
|
}
|
||||||
if (count($row) == 0) {
|
if (count($row) == 0) {
|
||||||
if ($showInstance->isRecorded()) {
|
if ($showInstance->isRecorded()) {
|
||||||
// last item is a show instance
|
// last item is a show instance
|
||||||
return ['name' => $showInstance->getName(),
|
return [
|
||||||
|
'name' => $showInstance->getName(),
|
||||||
'starts' => $showInstance->getShowInstanceStart(),
|
'starts' => $showInstance->getShowInstanceStart(),
|
||||||
'ends' => $showInstance->getShowInstanceEnd(), ];
|
'ends' => $showInstance->getShowInstanceEnd(),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// return the one that started later.
|
// return the one that started later.
|
||||||
if ($row[0]['starts'] >= $showInstance->getShowInstanceStart()) {
|
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'],
|
'starts' => $row[0]['starts'],
|
||||||
'ends' => $row[0]['ends'], ];
|
'ends' => $row[0]['ends'],
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return ['name' => $showInstance->getName(),
|
return [
|
||||||
|
'name' => $showInstance->getName(),
|
||||||
'starts' => $showInstance->getShowInstanceStart(),
|
'starts' => $showInstance->getShowInstanceStart(),
|
||||||
'ends' => $showInstance->getShowInstanceEnd(), ];
|
'ends' => $showInstance->getShowInstanceEnd(),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function GetCurrentItem($p_timeNow)
|
public static function GetCurrentItem($p_timeNow)
|
||||||
|
@ -65,30 +73,36 @@ class Application_Model_Dashboard
|
||||||
* in the future.
|
* 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'],
|
'artwork_data' => $row[0]['artwork_data'],
|
||||||
'starts' => $row[0]['starts'],
|
'starts' => $row[0]['starts'],
|
||||||
'ends' => $row[0]['ends'], ];
|
'ends' => $row[0]['ends'],
|
||||||
|
];
|
||||||
}
|
}
|
||||||
if (count($row) == 0) {
|
if (count($row) == 0) {
|
||||||
// last item is a show instance
|
// last item is a show instance
|
||||||
if ($showInstance->isRecorded()) {
|
if ($showInstance->isRecorded()) {
|
||||||
return ['name' => $showInstance->getName(),
|
return [
|
||||||
|
'name' => $showInstance->getName(),
|
||||||
'starts' => $showInstance->getShowInstanceStart(),
|
'starts' => $showInstance->getShowInstanceStart(),
|
||||||
'ends' => $showInstance->getShowInstanceEnd(),
|
'ends' => $showInstance->getShowInstanceEnd(),
|
||||||
'media_item_played' => false,
|
'media_item_played' => false,
|
||||||
'record' => true, ];
|
'record' => true,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
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'],
|
'artwork_data' => $row[0]['artwork_data'],
|
||||||
'starts' => $row[0]['starts'],
|
'starts' => $row[0]['starts'],
|
||||||
'ends' => $row[0]['ends'],
|
'ends' => $row[0]['ends'],
|
||||||
'media_item_played' => $row[0]['media_item_played'],
|
'media_item_played' => $row[0]['media_item_played'],
|
||||||
'record' => 0, ];
|
'record' => 0,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function GetNextItem($p_timeNow)
|
public static function GetNextItem($p_timeNow)
|
||||||
|
@ -106,17 +120,21 @@ class Application_Model_Dashboard
|
||||||
return null;
|
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'],
|
'artwork_data' => $row[0]['artwork_data'],
|
||||||
'starts' => $row[0]['starts'],
|
'starts' => $row[0]['starts'],
|
||||||
'ends' => $row[0]['ends'], ];
|
'ends' => $row[0]['ends'],
|
||||||
|
];
|
||||||
}
|
}
|
||||||
if (count($row) == 0) {
|
if (count($row) == 0) {
|
||||||
if ($showInstance->isRecorded()) {
|
if ($showInstance->isRecorded()) {
|
||||||
// last item is a show instance
|
// last item is a show instance
|
||||||
return ['name' => $showInstance->getName(),
|
return [
|
||||||
|
'name' => $showInstance->getName(),
|
||||||
'starts' => $showInstance->getShowInstanceStart(),
|
'starts' => $showInstance->getShowInstanceStart(),
|
||||||
'ends' => $showInstance->getShowInstanceEnd(), ];
|
'ends' => $showInstance->getShowInstanceEnd(),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -124,14 +142,18 @@ class Application_Model_Dashboard
|
||||||
// return the one that starts sooner.
|
// return the one that starts sooner.
|
||||||
|
|
||||||
if ($row[0]['starts'] <= $showInstance->getShowInstanceStart()) {
|
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'],
|
'artwork_data' => $row[0]['artwork_data'],
|
||||||
'starts' => $row[0]['starts'],
|
'starts' => $row[0]['starts'],
|
||||||
'ends' => $row[0]['ends'], ];
|
'ends' => $row[0]['ends'],
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return ['name' => $showInstance->getName(),
|
return [
|
||||||
|
'name' => $showInstance->getName(),
|
||||||
'starts' => $showInstance->getShowInstanceStart(),
|
'starts' => $showInstance->getShowInstanceStart(),
|
||||||
'ends' => $showInstance->getShowInstanceEnd(), ];
|
'ends' => $showInstance->getShowInstanceEnd(),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,8 @@ class Application_Model_Datatables
|
||||||
$debug = [
|
$debug = [
|
||||||
'$new_index' => $new_index,
|
'$new_index' => $new_index,
|
||||||
'$currentPos' => $currentPos,
|
'$currentPos' => $currentPos,
|
||||||
'$orig2searchTerm' => $orig2searchTerm, ];
|
'$orig2searchTerm' => $orig2searchTerm,
|
||||||
|
];
|
||||||
Logging::warn($debug);
|
Logging::warn($debug);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,8 +120,10 @@ SQL;
|
||||||
// tricking javascript so it thinks the server timezone is in UTC
|
// tricking javascript so it thinks the server timezone is in UTC
|
||||||
$average_listeners = array_sum(array_column($data, 'listeners')) / count($data);
|
$average_listeners = array_sum(array_column($data, 'listeners')) / count($data);
|
||||||
$max_num_listeners = max(array_column($data, 'listeners'));
|
$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,
|
$entry = [
|
||||||
'maximum_number_of_listeners' => $max_num_listeners, ];
|
'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);
|
array_push($showData, $entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -195,7 +197,8 @@ SQL;
|
||||||
|
|
||||||
Application_Common_Database::prepareAndExecute(
|
Application_Common_Database::prepareAndExecute(
|
||||||
$stats_sql,
|
$stats_sql,
|
||||||
['timestamp_id' => $timestamp_id,
|
[
|
||||||
|
'timestamp_id' => $timestamp_id,
|
||||||
'listener_count' => $dp['num_listeners'],
|
'listener_count' => $dp['num_listeners'],
|
||||||
'mount_name_id' => $mount_name_id,
|
'mount_name_id' => $mount_name_id,
|
||||||
]
|
]
|
||||||
|
|
|
@ -230,7 +230,8 @@ SQL;
|
||||||
// Logging::info($sql);
|
// Logging::info($sql);
|
||||||
|
|
||||||
$params = [
|
$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) {
|
if ($filterFiles) {
|
||||||
$params[':file_exists'] = $filterFiles;
|
$params[':file_exists'] = $filterFiles;
|
||||||
}
|
}
|
||||||
|
@ -401,7 +402,8 @@ SQL;
|
||||||
if (isset($obj)) {
|
if (isset($obj)) {
|
||||||
if (($obj instanceof CcFiles && $obj->visible())
|
if (($obj instanceof CcFiles && $obj->visible())
|
||||||
|| $obj instanceof CcWebstream
|
|| $obj instanceof CcWebstream
|
||||||
|| $obj instanceof CcBlock) {
|
|| $obj instanceof CcBlock
|
||||||
|
) {
|
||||||
$entry = $this->plItem;
|
$entry = $this->plItem;
|
||||||
$entry['id'] = $obj->getDbId();
|
$entry['id'] = $obj->getDbId();
|
||||||
$entry['pos'] = $pos;
|
$entry['pos'] = $pos;
|
||||||
|
@ -914,8 +916,10 @@ SQL;
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ['cliplength' => $cliplength, 'cueIn' => $cueIn, 'cueOut' => $cueOut, 'length' => $this->getLength(),
|
return [
|
||||||
'fadeIn' => $fadeIn, 'fadeOut' => $fadeOut, ];
|
'cliplength' => $cliplength, 'cueIn' => $cueIn, 'cueOut' => $cueOut, 'length' => $this->getLength(),
|
||||||
|
'fadeIn' => $fadeIn, 'fadeOut' => $fadeOut,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAllPLMetaData()
|
public function getAllPLMetaData()
|
||||||
|
|
|
@ -667,10 +667,12 @@ class Application_Model_Preference
|
||||||
if (isset($info[1])) {
|
if (isset($info[1])) {
|
||||||
$key = str_replace(' ', '_', trim($info[0]));
|
$key = str_replace(' ', '_', trim($info[0]));
|
||||||
$key = strtoupper($key);
|
$key = strtoupper($key);
|
||||||
if ($key == 'WEB_SERVER' || $key == 'CPU' || $key == 'OS' || $key == 'TOTAL_RAM'
|
if (
|
||||||
|
$key == 'WEB_SERVER' || $key == 'CPU' || $key == 'OS' || $key == 'TOTAL_RAM'
|
||||||
|| $key == 'FREE_RAM' || $key == 'AIRTIME_VERSION' || $key == 'KERNAL_VERSION'
|
|| $key == 'FREE_RAM' || $key == 'AIRTIME_VERSION' || $key == 'KERNAL_VERSION'
|
||||||
|| $key == 'MACHINE_ARCHITECTURE' || $key == 'TOTAL_MEMORY_MBYTES' || $key == 'TOTAL_SWAP_MBYTES'
|
|| $key == 'MACHINE_ARCHITECTURE' || $key == 'TOTAL_MEMORY_MBYTES' || $key == 'TOTAL_SWAP_MBYTES'
|
||||||
|| $key == 'PLAYOUT_ENGINE_CPU_PERC') {
|
|| $key == 'PLAYOUT_ENGINE_CPU_PERC'
|
||||||
|
) {
|
||||||
if ($key == 'AIRTIME_VERSION') {
|
if ($key == 'AIRTIME_VERSION') {
|
||||||
// remove hash tag on the version string
|
// remove hash tag on the version string
|
||||||
$version = explode('+', $info[1]);
|
$version = explode('+', $info[1]);
|
||||||
|
@ -1206,7 +1208,9 @@ class Application_Model_Preference
|
||||||
{
|
{
|
||||||
$v = self::getValue($pref_param, true);
|
$v = self::getValue($pref_param, true);
|
||||||
|
|
||||||
$id = function ($x) { return $x; };
|
$id = function ($x) {
|
||||||
|
return $x;
|
||||||
|
};
|
||||||
|
|
||||||
if ($v === '') {
|
if ($v === '') {
|
||||||
return $id;
|
return $id;
|
||||||
|
|
|
@ -180,8 +180,10 @@ final class Application_Model_Scheduler
|
||||||
$ccShowInstances = $ccShow->getCcShowInstancess();
|
$ccShowInstances = $ccShow->getCcShowInstancess();
|
||||||
$timeNowUTC = gmdate(DEFAULT_TIMESTAMP_FORMAT);
|
$timeNowUTC = gmdate(DEFAULT_TIMESTAMP_FORMAT);
|
||||||
foreach ($ccShowInstances as $ccShowInstance) {
|
foreach ($ccShowInstances as $ccShowInstance) {
|
||||||
if ($ccShowInstance->getDbStarts() <= $timeNowUTC
|
if (
|
||||||
&& $ccShowInstance->getDbEnds() > $timeNowUTC) {
|
$ccShowInstance->getDbStarts() <= $timeNowUTC
|
||||||
|
&& $ccShowInstance->getDbEnds() > $timeNowUTC
|
||||||
|
) {
|
||||||
throw new Exception(_('Content in linked shows cannot be changed while on air!'));
|
throw new Exception(_('Content in linked shows cannot be changed while on air!'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -923,7 +925,8 @@ final class Application_Model_Scheduler
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: break;
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->applyCrossfades) {
|
if ($this->applyCrossfades) {
|
||||||
|
|
|
@ -428,7 +428,8 @@ SQL;
|
||||||
|
|
||||||
$rows = Application_Common_Database::prepareAndExecute($sql, [
|
$rows = Application_Common_Database::prepareAndExecute($sql, [
|
||||||
':dayTimestamp' => $day_timestamp,
|
':dayTimestamp' => $day_timestamp,
|
||||||
':showId' => $this->getId(), ], 'all');
|
':showId' => $this->getId(),
|
||||||
|
], 'all');
|
||||||
|
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
try {
|
try {
|
||||||
|
@ -591,8 +592,10 @@ WHERE starts > :timestamp::TIMESTAMP
|
||||||
SQL;
|
SQL;
|
||||||
Application_Common_Database::prepareAndExecute(
|
Application_Common_Database::prepareAndExecute(
|
||||||
$sql,
|
$sql,
|
||||||
[':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
[
|
||||||
':showId' => $this->getId(), ],
|
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||||
|
':showId' => $this->getId(),
|
||||||
|
],
|
||||||
'execute'
|
'execute'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -612,8 +615,10 @@ WHERE starts > :timestamp::TIMESTAMP
|
||||||
SQL;
|
SQL;
|
||||||
Application_Common_Database::prepareAndExecute(
|
Application_Common_Database::prepareAndExecute(
|
||||||
$sql,
|
$sql,
|
||||||
[':showId' => $this->getId(),
|
[
|
||||||
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ],
|
':showId' => $this->getId(),
|
||||||
|
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||||
|
],
|
||||||
'execute'
|
'execute'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -750,8 +755,10 @@ WHERE show_id = :showId
|
||||||
SQL;
|
SQL;
|
||||||
$rows = Application_Common_Database::prepareAndExecute(
|
$rows = Application_Common_Database::prepareAndExecute(
|
||||||
$sql,
|
$sql,
|
||||||
[':showId' => $this->getId(),
|
[
|
||||||
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ],
|
':showId' => $this->getId(),
|
||||||
|
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||||
|
],
|
||||||
'all'
|
'all'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -794,7 +801,8 @@ SQL;
|
||||||
Application_Common_Database::prepareAndExecute($sql, [
|
Application_Common_Database::prepareAndExecute($sql, [
|
||||||
':add_show_duration' => $p_data['add_show_duration'],
|
':add_show_duration' => $p_data['add_show_duration'],
|
||||||
':show_id' => $p_data['add_show_id'],
|
':show_id' => $p_data['add_show_id'],
|
||||||
':timestamp' => $timestamp, ], 'execute');
|
':timestamp' => $timestamp,
|
||||||
|
], 'execute');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDuration($format = false)
|
public function getDuration($format = false)
|
||||||
|
@ -896,8 +904,10 @@ SQL;
|
||||||
try {
|
try {
|
||||||
$row = Application_Common_Database::prepareAndExecute(
|
$row = Application_Common_Database::prepareAndExecute(
|
||||||
$sql,
|
$sql,
|
||||||
[':showId' => $this->getId(),
|
[
|
||||||
':timestamp' => $timestamp, ],
|
':showId' => $this->getId(),
|
||||||
|
':timestamp' => $timestamp,
|
||||||
|
],
|
||||||
'column'
|
'column'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1092,8 +1102,10 @@ SQL;
|
||||||
if ($p_editable) {
|
if ($p_editable) {
|
||||||
if ($show['record'] && $now > $startsDT) {
|
if ($show['record'] && $now > $startsDT) {
|
||||||
$options['editable'] = false;
|
$options['editable'] = false;
|
||||||
} elseif ($show['rebroadcast']
|
} elseif (
|
||||||
&& $now > $parentStartsDT) {
|
$show['rebroadcast']
|
||||||
|
&& $now > $parentStartsDT
|
||||||
|
) {
|
||||||
$options['editable'] = false;
|
$options['editable'] = false;
|
||||||
} elseif ($now < $endsDT) {
|
} elseif ($now < $endsDT) {
|
||||||
$options['editable'] = true;
|
$options['editable'] = true;
|
||||||
|
@ -1460,7 +1472,8 @@ SQL;
|
||||||
'ends' => $rows[$i - 1]['ends'],
|
'ends' => $rows[$i - 1]['ends'],
|
||||||
'record' => $rows[$i - 1]['record'],
|
'record' => $rows[$i - 1]['record'],
|
||||||
'image_path' => $rows[$i - 1]['image_path'],
|
'image_path' => $rows[$i - 1]['image_path'],
|
||||||
'type' => 'show', ];
|
'type' => 'show',
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
$results['currentShow'][0] = $rows[$i];
|
$results['currentShow'][0] = $rows[$i];
|
||||||
|
@ -1478,7 +1491,8 @@ SQL;
|
||||||
'ends' => $rows[$i + 1]['ends'],
|
'ends' => $rows[$i + 1]['ends'],
|
||||||
'record' => $rows[$i + 1]['record'],
|
'record' => $rows[$i + 1]['record'],
|
||||||
'image_path' => $rows[$i + 1]['image_path'],
|
'image_path' => $rows[$i + 1]['image_path'],
|
||||||
'type' => 'show', ];
|
'type' => 'show',
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -1501,7 +1515,8 @@ SQL;
|
||||||
'ends' => $rows[$i]['ends'],
|
'ends' => $rows[$i]['ends'],
|
||||||
'record' => $rows[$i]['record'],
|
'record' => $rows[$i]['record'],
|
||||||
'image_path' => $rows[$i]['image_path'],
|
'image_path' => $rows[$i]['image_path'],
|
||||||
'type' => 'show', ];
|
'type' => 'show',
|
||||||
|
];
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1519,7 +1534,8 @@ SQL;
|
||||||
'starts' => $rows[$previousShowIndex]['starts'],
|
'starts' => $rows[$previousShowIndex]['starts'],
|
||||||
'ends' => $rows[$previousShowIndex]['ends'],
|
'ends' => $rows[$previousShowIndex]['ends'],
|
||||||
'record' => $rows[$previousShowIndex]['record'],
|
'record' => $rows[$previousShowIndex]['record'],
|
||||||
'type' => 'show', ];
|
'type' => 'show',
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
|
@ -1578,11 +1594,13 @@ SQL;
|
||||||
$params = [
|
$params = [
|
||||||
':timeStart' => $timeStart,
|
':timeStart' => $timeStart,
|
||||||
':timeEnd' => $timeEnd,
|
':timeEnd' => $timeEnd,
|
||||||
':lim' => $limit, ];
|
':lim' => $limit,
|
||||||
|
];
|
||||||
} else {
|
} else {
|
||||||
$params = [
|
$params = [
|
||||||
':timeStart' => $timeStart,
|
':timeStart' => $timeStart,
|
||||||
':timeEnd' => $timeEnd, ];
|
':timeEnd' => $timeEnd,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return Application_Common_Database::prepareAndExecute($sql, $params, 'all');
|
return Application_Common_Database::prepareAndExecute($sql, $params, 'all');
|
||||||
|
|
|
@ -145,8 +145,10 @@ class Application_Model_ShowBuilder
|
||||||
*/
|
*/
|
||||||
private function getScheduledStatus($p_epochItemStart, $p_epochItemEnd, &$row)
|
private function getScheduledStatus($p_epochItemStart, $p_epochItemEnd, &$row)
|
||||||
{
|
{
|
||||||
if ($row['footer'] === true && $this->epoch_now > $p_epochItemStart
|
if (
|
||||||
&& $this->epoch_now > $p_epochItemEnd) {
|
$row['footer'] === true && $this->epoch_now > $p_epochItemStart
|
||||||
|
&& $this->epoch_now > $p_epochItemEnd
|
||||||
|
) {
|
||||||
$row['scheduled'] = 0;
|
$row['scheduled'] = 0;
|
||||||
} elseif ($row['footer'] === true && $this->epoch_now < $p_epochItemEnd) {
|
} elseif ($row['footer'] === true && $this->epoch_now < $p_epochItemEnd) {
|
||||||
$row['scheduled'] = 2;
|
$row['scheduled'] = 2;
|
||||||
|
@ -177,7 +179,8 @@ class Application_Model_ShowBuilder
|
||||||
$d = [
|
$d = [
|
||||||
'$p_epochItemStart' => $p_epochItemStart,
|
'$p_epochItemStart' => $p_epochItemStart,
|
||||||
'$p_epochItemEnd' => $p_epochItemEnd,
|
'$p_epochItemEnd' => $p_epochItemEnd,
|
||||||
'$row' => $row, ];
|
'$row' => $row,
|
||||||
|
];
|
||||||
Logging::warn($d);
|
Logging::warn($d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -415,8 +418,10 @@ class Application_Model_ShowBuilder
|
||||||
|
|
||||||
// see if the displayed show instances have changed. (deleted,
|
// see if the displayed show instances have changed. (deleted,
|
||||||
// empty schedule etc)
|
// empty schedule etc)
|
||||||
if ($outdated === false && count($instances)
|
if (
|
||||||
!== count($currentInstances)) {
|
$outdated === false && count($instances)
|
||||||
|
!== count($currentInstances)
|
||||||
|
) {
|
||||||
Logging::debug('show instances have changed.');
|
Logging::debug('show instances have changed.');
|
||||||
$outdated = true;
|
$outdated = true;
|
||||||
}
|
}
|
||||||
|
@ -450,8 +455,10 @@ class Application_Model_ShowBuilder
|
||||||
$item = $scheduled_items[$i];
|
$item = $scheduled_items[$i];
|
||||||
|
|
||||||
// don't send back data for filler rows.
|
// don't send back data for filler rows.
|
||||||
if (isset($item['playout_status'])
|
if (
|
||||||
&& $item['playout_status'] < 0) {
|
isset($item['playout_status'])
|
||||||
|
&& $item['playout_status'] < 0
|
||||||
|
) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -480,20 +487,22 @@ class Application_Model_ShowBuilder
|
||||||
$display_items[] = $row;
|
$display_items[] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($current_id !== -1
|
if (
|
||||||
&& !in_array($current_id, $this->showInstances)) {
|
$current_id !== -1
|
||||||
|
&& !in_array($current_id, $this->showInstances)
|
||||||
|
) {
|
||||||
$this->showInstances[] = $current_id;
|
$this->showInstances[] = $current_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the last footer if there were any scheduled items.
|
// make the last footer if there were any scheduled items.
|
||||||
if (count($scheduled_items) > 0) {
|
if (count($scheduled_items) > 0) {
|
||||||
$display_items[] = $this->makeFooterRow($scheduled_items[
|
$display_items[] = $this->makeFooterRow($scheduled_items[count($scheduled_items) - 1]);
|
||||||
count($scheduled_items) - 1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'schedule' => $display_items,
|
'schedule' => $display_items,
|
||||||
'showInstances' => $this->showInstances, ];
|
'showInstances' => $this->showInstances,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,8 @@ AND rebroadcast = 1;
|
||||||
SQL;
|
SQL;
|
||||||
Application_Common_Database::prepareAndExecute($sql, [
|
Application_Common_Database::prepareAndExecute($sql, [
|
||||||
':instanceId' => $instance_id,
|
':instanceId' => $instance_id,
|
||||||
':timestamp' => $timestamp, ], 'execute');
|
':timestamp' => $timestamp,
|
||||||
|
], 'execute');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function is weird. It should return a boolean, but instead returns
|
/* This function is weird. It should return a boolean, but instead returns
|
||||||
|
@ -553,7 +554,8 @@ SQL;
|
||||||
|
|
||||||
$counts = Application_Common_Database::prepareAndExecute($sql, [
|
$counts = Application_Common_Database::prepareAndExecute($sql, [
|
||||||
':p_start' => $p_start->format('Y-m-d G:i:s'),
|
':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 = [];
|
$real_counts = [];
|
||||||
foreach ($counts as $c) {
|
foreach ($counts as $c) {
|
||||||
|
@ -574,7 +576,8 @@ SQL;
|
||||||
|
|
||||||
$res = Application_Common_Database::prepareAndExecute($sql, [
|
$res = Application_Common_Database::prepareAndExecute($sql, [
|
||||||
':p_start' => $p_start->format('Y-m-d G:i:s'),
|
':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 = [];
|
$isFilled = [];
|
||||||
foreach ($res as $r) {
|
foreach ($res as $r) {
|
||||||
|
@ -755,7 +758,8 @@ WHERE si.ends < :timeNow::TIMESTAMP
|
||||||
ORDER BY si.ends DESC LIMIT 1;
|
ORDER BY si.ends DESC LIMIT 1;
|
||||||
SQL;
|
SQL;
|
||||||
$id = Application_Common_Database($sql, [
|
$id = Application_Common_Database($sql, [
|
||||||
':timeNow' => $p_timeNow, ], 'column');
|
':timeNow' => $p_timeNow,
|
||||||
|
], 'column');
|
||||||
|
|
||||||
return $id ? new Application_Model_ShowInstance($id) : null;
|
return $id ? new Application_Model_ShowInstance($id) : null;
|
||||||
}
|
}
|
||||||
|
@ -779,7 +783,8 @@ SQL;
|
||||||
|
|
||||||
$id = Application_Common_Database($sql, [
|
$id = Application_Common_Database($sql, [
|
||||||
':timeNow1' => $p_timeNow,
|
':timeNow1' => $p_timeNow,
|
||||||
':timeNow2' => $p_timeNow, ], 'column');
|
':timeNow2' => $p_timeNow,
|
||||||
|
], 'column');
|
||||||
|
|
||||||
return $id ? new Application_Model_ShowInstance($id) : null;
|
return $id ? new Application_Model_ShowInstance($id) : null;
|
||||||
}
|
}
|
||||||
|
@ -835,7 +840,8 @@ SQL;
|
||||||
|
|
||||||
return Application_Common_Database::prepareAndExecute($sql, [
|
return Application_Common_Database::prepareAndExecute($sql, [
|
||||||
':startTime' => $p_startTime,
|
':startTime' => $p_startTime,
|
||||||
':endTime' => $p_endTime, ], 'all');
|
':endTime' => $p_endTime,
|
||||||
|
], 'all');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isRepeating()
|
public function isRepeating()
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subj class.
|
* Subj class.
|
||||||
*
|
*
|
||||||
|
|
|
@ -168,6 +168,7 @@ WHERE id = :id
|
||||||
SQL;
|
SQL;
|
||||||
|
|
||||||
return Application_Common_Database::prepareAndExecute($sql, [
|
return Application_Common_Database::prepareAndExecute($sql, [
|
||||||
':id' => $id, ], 'single');
|
':id' => $id,
|
||||||
|
], 'single');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,10 +61,12 @@ class Application_Model_User
|
||||||
$type = $this->getType();
|
$type = $this->getType();
|
||||||
$result = false;
|
$result = false;
|
||||||
|
|
||||||
if ($this->isAdmin()
|
if (
|
||||||
|
$this->isAdmin()
|
||||||
|| $this->isSuperAdmin()
|
|| $this->isSuperAdmin()
|
||||||
|| $this->isPM()
|
|| $this->isPM()
|
||||||
|| self::isHostOfShow($p_showId)) {
|
|| self::isHostOfShow($p_showId)
|
||||||
|
) {
|
||||||
$result = true;
|
$result = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -387,7 +389,8 @@ WHERE id = :id
|
||||||
SQL;
|
SQL;
|
||||||
|
|
||||||
return Application_Common_Database::prepareAndExecute($sql, [
|
return Application_Common_Database::prepareAndExecute($sql, [
|
||||||
':id' => $id, ], 'single');
|
':id' => $id,
|
||||||
|
], 'single');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getCurrentUser()
|
public static function getCurrentUser()
|
||||||
|
|
|
@ -121,9 +121,11 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
||||||
|
|
||||||
public static function analyzeFormData($parameters)
|
public static function analyzeFormData($parameters)
|
||||||
{
|
{
|
||||||
$valid = ['length' => [true, ''],
|
$valid = [
|
||||||
|
'length' => [true, ''],
|
||||||
'url' => [true, ''],
|
'url' => [true, ''],
|
||||||
'name' => [true, ''], ];
|
'name' => [true, ''],
|
||||||
|
];
|
||||||
|
|
||||||
$di = null;
|
$di = null;
|
||||||
$length = $parameters['length'];
|
$length = $parameters['length'];
|
||||||
|
|
|
@ -21,7 +21,8 @@ class StoredFileTest extends PHPUnit_TestCase
|
||||||
$metadata = Metadata::LoadFromFile($filePath);
|
$metadata = Metadata::LoadFromFile($filePath);
|
||||||
if (($metadata['dc:description'] != 'Tmu sem tam videla ...')
|
if (($metadata['dc:description'] != 'Tmu sem tam videla ...')
|
||||||
|| ($metadata['audio']['dataformat'] != 'mp3')
|
|| ($metadata['audio']['dataformat'] != 'mp3')
|
||||||
|| ($metadata['dc:type'] != 'Speech')) {
|
|| ($metadata['dc:type'] != 'Speech')
|
||||||
|
) {
|
||||||
$str = ' [dc:description] = ' . $metadata['dc:description'] . "\n"
|
$str = ' [dc:description] = ' . $metadata['dc:description'] . "\n"
|
||||||
. ' [audio][dataformat] = ' . $metadata['audio']['dataformat'] . "\n"
|
. ' [audio][dataformat] = ' . $metadata['audio']['dataformat'] . "\n"
|
||||||
. ' [dc:type] = ' . $metadata['dc:type'] . "\n";
|
. ' [dc:type] = ' . $metadata['dc:type'] . "\n";
|
||||||
|
@ -44,8 +45,10 @@ class StoredFileTest extends PHPUnit_TestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test inserting a file by linking
|
// Test inserting a file by linking
|
||||||
$values = ['filepath' => $filePath,
|
$values = [
|
||||||
'dc:description' => 'Unit test ' . time(), ];
|
'filepath' => $filePath,
|
||||||
|
'dc:description' => 'Unit test ' . time(),
|
||||||
|
];
|
||||||
$storedFile = Application_Model_StoredFile::Insert($values, false);
|
$storedFile = Application_Model_StoredFile::Insert($values, false);
|
||||||
// var_dump($storedFile);
|
// var_dump($storedFile);
|
||||||
$id = $storedFile->getId();
|
$id = $storedFile->getId();
|
||||||
|
|
|
@ -1,24 +1,12 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<playlist id="0e22c20310212a51">
|
<playlist id="0e22c20310212a51">
|
||||||
<playlistElement id="0000000000000103" relativeOffset="00:00:00.000000">
|
<playlistElement id="0000000000000103" relativeOffset="00:00:00.000000">
|
||||||
<audioClip id="0000000000010003"
|
<audioClip id="0000000000010003" playlength="00:00:11.500000" title="three" uri="file:var/test10003.mp3" />
|
||||||
playlength="00:00:11.500000"
|
|
||||||
title = "three"
|
|
||||||
uri="file:var/test10003.mp3"
|
|
||||||
/>
|
|
||||||
</playlistElement>
|
</playlistElement>
|
||||||
<playlistElement id="0000000000000104" relativeOffset="00:00:11.500000">
|
<playlistElement id="0000000000000104" relativeOffset="00:00:11.500000">
|
||||||
<playlist id="0000000000000001"
|
<playlist id="0000000000000001" playlength="01:30:00.000000" title="My First Playlist"></playlist>
|
||||||
playlength="01:30:00.000000"
|
|
||||||
title="My First Playlist">
|
|
||||||
</playlist>
|
|
||||||
</playlistElement>
|
</playlistElement>
|
||||||
<metadata
|
<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="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>
|
<dc:title>embedded playlist</dc:title>
|
||||||
<dcterms:extent>01:30:11.500000</dcterms:extent>
|
<dcterms:extent>01:30:11.500000</dcterms:extent>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<audioClip>
|
<audioClip>
|
||||||
<metadata
|
<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">
|
||||||
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>
|
<dc:title>Webstream test 1</dc:title>
|
||||||
<dcterms:extent>01:30:00.000000</dcterms:extent>
|
<dcterms:extent>01:30:00.000000</dcterms:extent>
|
||||||
<ls:url>http://localhost/y</ls:url>
|
<ls:url>http://localhost/y</ls:url>
|
||||||
|
|
|
@ -8,7 +8,8 @@ class Rest_Bootstrap extends Zend_Application_Module_Bootstrap
|
||||||
$router = $front->getRouter();
|
$router = $front->getRouter();
|
||||||
|
|
||||||
$restRoute = new Zend_Rest_Route($front, [], [
|
$restRoute = new Zend_Rest_Route($front, [], [
|
||||||
'rest' => ['media', 'show-image', 'podcast', 'podcast-episodes'], ]);
|
'rest' => ['media', 'show-image', 'podcast', 'podcast-episodes'],
|
||||||
|
]);
|
||||||
$router->addRoute('rest', $restRoute);
|
$router->addRoute('rest', $restRoute);
|
||||||
|
|
||||||
$podcastBulkRoute = new Zend_Controller_Router_Route(
|
$podcastBulkRoute = new Zend_Controller_Router_Route(
|
||||||
|
|
|
@ -5,7 +5,8 @@ class RestAuth
|
||||||
public static function verifyAuth($checkApiKey, $checkSession, $action)
|
public static function verifyAuth($checkApiKey, $checkSession, $action)
|
||||||
{
|
{
|
||||||
// Session takes precedence over API key for now:
|
// Session takes precedence over API key for now:
|
||||||
if ($checkSession && self::verifySession()
|
if (
|
||||||
|
$checkSession && self::verifySession()
|
||||||
|| $checkApiKey && self::verifyAPIKey($action)
|
|| $checkApiKey && self::verifyAPIKey($action)
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -46,19 +46,22 @@ class Application_Service_CalendarService
|
||||||
if (!isset($ccFile)) {
|
if (!isset($ccFile)) {
|
||||||
$menu['error when recording'] = [
|
$menu['error when recording'] = [
|
||||||
'name' => _("Record file doesn't exist"),
|
'name' => _("Record file doesn't exist"),
|
||||||
'icon' => 'error', ];
|
'icon' => 'error',
|
||||||
|
];
|
||||||
} else {
|
} else {
|
||||||
$menu['view_recorded'] = [
|
$menu['view_recorded'] = [
|
||||||
'name' => _('View Recorded File Metadata'),
|
'name' => _('View Recorded File Metadata'),
|
||||||
'icon' => 'overview',
|
'icon' => 'overview',
|
||||||
'url' => $baseUrl . 'library/edit-file-md/id/' . $ccFile->getDbId(), ];
|
'url' => $baseUrl . 'library/edit-file-md/id/' . $ccFile->getDbId(),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$menu['content'] = [
|
$menu['content'] = [
|
||||||
// "name"=> _("Show Content"),
|
// "name"=> _("Show Content"),
|
||||||
'name' => _('View'),
|
'name' => _('View'),
|
||||||
'icon' => 'overview',
|
'icon' => 'overview',
|
||||||
'url' => $baseUrl . 'schedule/show-content-dialog', ];
|
'url' => $baseUrl . 'schedule/show-content-dialog',
|
||||||
|
];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Show content can be modified from the calendar if:
|
// Show content can be modified from the calendar if:
|
||||||
|
@ -77,7 +80,8 @@ class Application_Service_CalendarService
|
||||||
// "name"=> _("Add / Remove Content"),
|
// "name"=> _("Add / Remove Content"),
|
||||||
'name' => _('Schedule Tracks'),
|
'name' => _('Schedule Tracks'),
|
||||||
'icon' => 'add-remove-content',
|
'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"=> _("Show Content"),
|
||||||
'name' => _('View'),
|
'name' => _('View'),
|
||||||
'icon' => 'overview',
|
'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
|
// user can remove all content if the show has not started
|
||||||
|
@ -100,7 +105,8 @@ class Application_Service_CalendarService
|
||||||
// "name"=> _("Remove All Content"),
|
// "name"=> _("Remove All Content"),
|
||||||
'name' => _('Clear Show'),
|
'name' => _('Clear Show'),
|
||||||
'icon' => 'remove-all-content',
|
'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'] = [
|
$menu['cancel_recorded'] = [
|
||||||
// "name"=> _("Cancel Current Show"),
|
// "name"=> _("Cancel Current Show"),
|
||||||
'name' => _('Cancel Show'),
|
'name' => _('Cancel Show'),
|
||||||
'icon' => 'delete', ];
|
'icon' => 'delete',
|
||||||
|
];
|
||||||
} else {
|
} else {
|
||||||
$menu['cancel'] = [
|
$menu['cancel'] = [
|
||||||
// "name"=> _("Cancel Current Show"),
|
// "name"=> _("Cancel Current Show"),
|
||||||
'name' => _('Cancel Show'),
|
'name' => _('Cancel Show'),
|
||||||
'icon' => 'delete', ];
|
'icon' => 'delete',
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,7 +175,8 @@ class Application_Service_CalendarService
|
||||||
'name' => _('Edit Show'),
|
'name' => _('Edit Show'),
|
||||||
'icon' => 'edit',
|
'icon' => 'edit',
|
||||||
'_type' => 'all',
|
'_type' => 'all',
|
||||||
'url' => $baseUrl . 'Schedule/populate-show-form', ];
|
'url' => $baseUrl . 'Schedule/populate-show-form',
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,29 +191,34 @@ class Application_Service_CalendarService
|
||||||
$menu['del'] = [
|
$menu['del'] = [
|
||||||
'name' => _('Delete'),
|
'name' => _('Delete'),
|
||||||
'icon' => 'delete',
|
'icon' => 'delete',
|
||||||
'items' => [], ];
|
'items' => [],
|
||||||
|
];
|
||||||
|
|
||||||
$menu['del']['items']['single'] = [
|
$menu['del']['items']['single'] = [
|
||||||
// "name"=> _("Delete This Instance"),
|
// "name"=> _("Delete This Instance"),
|
||||||
'name' => _('Delete Instance'),
|
'name' => _('Delete Instance'),
|
||||||
'icon' => 'delete',
|
'icon' => 'delete',
|
||||||
'url' => $baseUrl . 'schedule/delete-show-instance', ];
|
'url' => $baseUrl . 'schedule/delete-show-instance',
|
||||||
|
];
|
||||||
|
|
||||||
$menu['del']['items']['following'] = [
|
$menu['del']['items']['following'] = [
|
||||||
// "name"=> _("Delete This Instance and All Following"),
|
// "name"=> _("Delete This Instance and All Following"),
|
||||||
'name' => _('Delete Instance and All Following'),
|
'name' => _('Delete Instance and All Following'),
|
||||||
'icon' => 'delete',
|
'icon' => 'delete',
|
||||||
'url' => $baseUrl . 'schedule/delete-show', ];
|
'url' => $baseUrl . 'schedule/delete-show',
|
||||||
|
];
|
||||||
} elseif ($populateInstance) {
|
} elseif ($populateInstance) {
|
||||||
$menu['del'] = [
|
$menu['del'] = [
|
||||||
'name' => _('Delete'),
|
'name' => _('Delete'),
|
||||||
'icon' => 'delete',
|
'icon' => 'delete',
|
||||||
'url' => $baseUrl . 'schedule/delete-show-instance', ];
|
'url' => $baseUrl . 'schedule/delete-show-instance',
|
||||||
|
];
|
||||||
} else {
|
} else {
|
||||||
$menu['del'] = [
|
$menu['del'] = [
|
||||||
'name' => _('Delete'),
|
'name' => _('Delete'),
|
||||||
'icon' => 'delete',
|
'icon' => 'delete',
|
||||||
'url' => $baseUrl . 'schedule/delete-show', ];
|
'url' => $baseUrl . 'schedule/delete-show',
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,7 +189,8 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir
|
||||||
'api_key' => $CC_CONFIG['apiKey'][0],
|
'api_key' => $CC_CONFIG['apiKey'][0],
|
||||||
'podcast_name' => $title,
|
'podcast_name' => $title,
|
||||||
'album_override' => $album_override,
|
'album_override' => $album_override,
|
||||||
'track_title' => $track_title, ];
|
'track_title' => $track_title,
|
||||||
|
];
|
||||||
$task = $this->_executeTask(static::$_CELERY_TASKS[self::DOWNLOAD], $data);
|
$task = $this->_executeTask(static::$_CELERY_TASKS[self::DOWNLOAD], $data);
|
||||||
// Get the created ThirdPartyTaskReference and set the episode ID so
|
// 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
|
// we can remove the placeholder if the import ends up stuck in a pending state
|
||||||
|
|
|
@ -67,16 +67,20 @@ class Application_Service_ShowFormService
|
||||||
public function populateNewShowForms($formWhat, $formWhen, $formRepeats)
|
public function populateNewShowForms($formWhat, $formWhen, $formRepeats)
|
||||||
{
|
{
|
||||||
$formWhat->populate(
|
$formWhat->populate(
|
||||||
['add_show_id' => '-1',
|
[
|
||||||
'add_show_instance_id' => '-1', ]
|
'add_show_id' => '-1',
|
||||||
|
'add_show_instance_id' => '-1',
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$formWhen->populate(
|
$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_start_time' => '00:00',
|
||||||
'add_show_end_date_no_repeate' => date('Y-m-d'),
|
'add_show_end_date_no_repeate' => date('Y-m-d'),
|
||||||
'add_show_end_time' => '01:00',
|
'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')]);
|
$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_end_time' => $showEnd->format('H:i'),
|
||||||
'add_show_duration' => $ccShowDay->formatDuration(true),
|
'add_show_duration' => $ccShowDay->formatDuration(true),
|
||||||
'add_show_timezone' => $ccShowDay->getDbTimezone(),
|
'add_show_timezone' => $ccShowDay->getDbTimezone(),
|
||||||
'add_show_repeats' => $ccShowDay->isRepeating() ? 1 : 0, ]
|
'add_show_repeats' => $ccShowDay->isRepeating() ? 1 : 0,
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
return $showStart;
|
return $showStart;
|
||||||
|
@ -269,7 +274,8 @@ class Application_Service_ShowFormService
|
||||||
$timezone
|
$timezone
|
||||||
),
|
),
|
||||||
'add_show_timezone' => $timezone,
|
'add_show_timezone' => $timezone,
|
||||||
'add_show_repeats' => 0, ]
|
'add_show_repeats' => 0,
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$form->getElement('add_show_repeats')->setOptions(['disabled' => true]);
|
$form->getElement('add_show_repeats')->setOptions(['disabled' => true]);
|
||||||
|
@ -321,7 +327,8 @@ class Application_Service_ShowFormService
|
||||||
'add_show_day_check' => $days,
|
'add_show_day_check' => $days,
|
||||||
'add_show_end_date' => (!is_null($repeatEndDate)) ? $repeatEndDate->format('Y-m-d') : null,
|
'add_show_end_date' => (!is_null($repeatEndDate)) ? $repeatEndDate->format('Y-m-d') : null,
|
||||||
'add_show_no_end' => (is_null($repeatEndDate)),
|
'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()) {
|
if (!$this->ccShow->isLinkable() || $this->ccShow->isRecorded()) {
|
||||||
|
@ -362,7 +369,8 @@ class Application_Service_ShowFormService
|
||||||
[
|
[
|
||||||
'add_show_background_color' => $this->ccShow->getDbBackgroundColor(),
|
'add_show_background_color' => $this->ccShow->getDbBackgroundColor(),
|
||||||
'add_show_color' => $this->ccShow->getDbColor(),
|
'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_airtime_auth' => $this->ccShow->getDbLiveStreamUsingAirtimeAuth(),
|
||||||
'cb_custom_auth' => $this->ccShow->getDbLiveStreamUsingCustomAuth(),
|
'cb_custom_auth' => $this->ccShow->getDbLiveStreamUsingCustomAuth(),
|
||||||
'custom_username' => $this->ccShow->getDbLiveStreamUser(),
|
'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(
|
$form->populate(
|
||||||
[
|
[
|
||||||
'add_show_record' => $this->ccShow->isRecorded(),
|
'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]);
|
$form->getElement('add_show_record')->setOptions(['disabled' => true]);
|
||||||
|
|
|
@ -261,8 +261,10 @@ class Application_Service_ShowService
|
||||||
* to ignore that difference when re-calculating schedule start times.
|
* to ignore that difference when re-calculating schedule start times.
|
||||||
* Otherwise it might calculate a difference of a week, for example.
|
* Otherwise it might calculate a difference of a week, for example.
|
||||||
*/
|
*/
|
||||||
if ($this->ccShow->isRepeating()
|
if (
|
||||||
&& $this->origCcShowDay->getLocalStartDateAndTime()->format('Y-m-d') != $showData['add_show_start_date']) {
|
$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');
|
$showData['add_show_start_date'] = $this->origCcShowDay->getLocalStartDateAndTime()->format('Y-m-d');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -507,7 +509,8 @@ AND rebroadcast = 1;
|
||||||
SQL;
|
SQL;
|
||||||
Application_Common_Database::prepareAndExecute($sql, [
|
Application_Common_Database::prepareAndExecute($sql, [
|
||||||
':showId' => $this->ccShow->getDbId(),
|
':showId' => $this->ccShow->getDbId(),
|
||||||
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ], 'execute');
|
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||||
|
], 'execute');
|
||||||
}
|
}
|
||||||
|
|
||||||
private function deleteAllShowDays($showId)
|
private function deleteAllShowDays($showId)
|
||||||
|
@ -572,11 +575,15 @@ SQL;
|
||||||
|
|
||||||
// if the start date changes, these are the repeat types
|
// if the start date changes, these are the repeat types
|
||||||
// that require show instance deletion
|
// that require show instance deletion
|
||||||
$deleteRepeatTypes = [REPEAT_BI_WEEKLY, REPEAT_TRI_WEEKLY, REPEAT_QUAD_WEEKLY, REPEAT_MONTHLY_MONTHLY,
|
$deleteRepeatTypes = [
|
||||||
REPEAT_MONTHLY_WEEKLY, ];
|
REPEAT_BI_WEEKLY, REPEAT_TRI_WEEKLY, REPEAT_QUAD_WEEKLY, REPEAT_MONTHLY_MONTHLY,
|
||||||
|
REPEAT_MONTHLY_WEEKLY,
|
||||||
|
];
|
||||||
|
|
||||||
if (in_array($this->repeatType, $deleteRepeatTypes)
|
if (
|
||||||
&& $showData['add_show_start_date'] != $localShowStart->format('Y-m-d')) {
|
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.
|
// Start date has changed when repeat type is bi-weekly or monthly.
|
||||||
// This screws up the repeating positions of show instances, so
|
// This screws up the repeating positions of show instances, so
|
||||||
// we need to delete them (CC-2351)
|
// we need to delete them (CC-2351)
|
||||||
|
@ -631,8 +638,10 @@ SQL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($showData['add_show_start_date'] != $localShowStart->format('Y-m-d')
|
if (
|
||||||
|| $showData['add_show_start_time'] != $localShowStart->format('H:i')) {
|
$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
|
// start date has been pushed forward so we need to delete
|
||||||
// any instances of this show scheduled before the new start date
|
// any instances of this show scheduled before the new start date
|
||||||
if ($showData['add_show_start_date'] > $localShowStart->format('Y-m-d')) {
|
if ($showData['add_show_start_date'] > $localShowStart->format('Y-m-d')) {
|
||||||
|
@ -723,7 +732,8 @@ WHERE date(starts) >= :endDate::DATE
|
||||||
SQL;
|
SQL;
|
||||||
Application_Common_Database::prepareAndExecute($sql, [
|
Application_Common_Database::prepareAndExecute($sql, [
|
||||||
':endDate' => $endDate, ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
':endDate' => $endDate, ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||||
':showId' => $showId, ], 'execute');
|
':showId' => $showId,
|
||||||
|
], 'execute');
|
||||||
}
|
}
|
||||||
|
|
||||||
private function deleteInstancesBeforeDate($newStartDate, $showId)
|
private function deleteInstancesBeforeDate($newStartDate, $showId)
|
||||||
|
@ -738,7 +748,8 @@ SQL;
|
||||||
|
|
||||||
Application_Common_Database::prepareAndExecute($sql, [
|
Application_Common_Database::prepareAndExecute($sql, [
|
||||||
':newStartDate' => $newStartDate, ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
':newStartDate' => $newStartDate, ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||||
':showId' => $showId, ], 'execute');
|
':showId' => $showId,
|
||||||
|
], 'execute');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -784,7 +795,8 @@ SQL;
|
||||||
Application_Common_Database::prepareAndExecute(
|
Application_Common_Database::prepareAndExecute(
|
||||||
$sql,
|
$sql,
|
||||||
[
|
[
|
||||||
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ':showId' => $showId, ],
|
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ':showId' => $showId,
|
||||||
|
],
|
||||||
'execute'
|
'execute'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -977,8 +989,10 @@ WHERE starts > :timestamp::TIMESTAMP
|
||||||
SQL;
|
SQL;
|
||||||
Application_Common_Database::prepareAndExecute(
|
Application_Common_Database::prepareAndExecute(
|
||||||
$sql,
|
$sql,
|
||||||
[':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
[
|
||||||
':showId' => $showId, ],
|
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||||
|
':showId' => $showId,
|
||||||
|
],
|
||||||
'execute'
|
'execute'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -996,9 +1010,11 @@ WHERE starts > :timestamp::TIMESTAMP
|
||||||
SQL;
|
SQL;
|
||||||
Application_Common_Database::prepareAndExecute(
|
Application_Common_Database::prepareAndExecute(
|
||||||
$sql,
|
$sql,
|
||||||
[':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
[
|
||||||
|
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
|
||||||
':showId' => $showId,
|
':showId' => $showId,
|
||||||
':firstShow' => $firstShow->format(DEFAULT_TIMESTAMP_FORMAT), ],
|
':firstShow' => $firstShow->format(DEFAULT_TIMESTAMP_FORMAT),
|
||||||
|
],
|
||||||
'execute'
|
'execute'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1088,8 +1104,10 @@ SQL;
|
||||||
|
|
||||||
Application_Common_Database::prepareAndExecute(
|
Application_Common_Database::prepareAndExecute(
|
||||||
$sql,
|
$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'
|
'execute'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1241,8 +1259,10 @@ SQL;
|
||||||
* Make sure start date is less than populate until date AND
|
* 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
|
* last show date is null OR start date is less than last show date
|
||||||
*/
|
*/
|
||||||
if ($utcStartDateTime <= $populateUntil
|
if (
|
||||||
&& (is_null($utcLastShowDateTime) || $utcStartDateTime < $utcLastShowDateTime)) {
|
$utcStartDateTime <= $populateUntil
|
||||||
|
&& (is_null($utcLastShowDateTime) || $utcStartDateTime < $utcLastShowDateTime)
|
||||||
|
) {
|
||||||
$lastCreatedShow = clone $utcStartDateTime;
|
$lastCreatedShow = clone $utcStartDateTime;
|
||||||
/* There may not always be an instance when editing a show
|
/* 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
|
* 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
|
* 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
|
* last show date is null OR start date is less than last show date
|
||||||
*/
|
*/
|
||||||
if ($utcStartDateTime->getTimestamp() <= $populateUntil->getTimestamp()
|
if (
|
||||||
|
$utcStartDateTime->getTimestamp() <= $populateUntil->getTimestamp()
|
||||||
&& (is_null($utcLastShowDateTime)
|
&& (is_null($utcLastShowDateTime)
|
||||||
|| $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp())) {
|
|| $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp())
|
||||||
|
) {
|
||||||
$lastCreatedShow = clone $utcStartDateTime;
|
$lastCreatedShow = clone $utcStartDateTime;
|
||||||
/* There may not always be an instance when editing a show
|
/* 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
|
* 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 (is_null($endDate) || $startDateTimeClone->getTimestamp() <= $endDateTime->getTimestamp()) {
|
||||||
if ($this->isUpdate) {
|
if ($this->isUpdate) {
|
||||||
if ($this->origCcShowDay->getDbRepeatType() == 2
|
if (
|
||||||
|| $this->origCcShowDay->getDbRepeatType() == 3) {
|
$this->origCcShowDay->getDbRepeatType() == 2
|
||||||
|
|| $this->origCcShowDay->getDbRepeatType() == 3
|
||||||
|
) {
|
||||||
$day = null;
|
$day = null;
|
||||||
} elseif (!$this->origShowRepeatStatus) {
|
} elseif (!$this->origShowRepeatStatus) {
|
||||||
// keep current show day to use for updating cc_show_day rule
|
// keep current show day to use for updating cc_show_day rule
|
||||||
|
|
|
@ -4,8 +4,10 @@ class Airtime_View_Helper_SourceSwitchStatus extends Zend_View_Helper_Abstract
|
||||||
{
|
{
|
||||||
public function SourceSwitchStatus()
|
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'),
|
'master_dj' => Application_Model_Preference::GetSourceSwitchStatus('master_dj'),
|
||||||
'scheduled_play' => Application_Model_Preference::GetSourceSwitchStatus('scheduled_play'), ];
|
'scheduled_play' => Application_Model_Preference::GetSourceSwitchStatus('scheduled_play'),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,9 +53,11 @@ class ScheduleUnitTest extends Zend_Test_PHPUnit_ControllerTestCase // PHPUnit_F
|
||||||
$params['api_key'] = $CC_CONFIG['apiKey'][0];
|
$params['api_key'] = $CC_CONFIG['apiKey'][0];
|
||||||
$request->setParams($params);
|
$request->setParams($params);
|
||||||
|
|
||||||
$metadata = ['MDATA_KEY_FILEPATH' => '/tmp/foobar.mp3',
|
$metadata = [
|
||||||
|
'MDATA_KEY_FILEPATH' => '/tmp/foobar.mp3',
|
||||||
'MDATA_KEY_DURATION' => '00:01:00',
|
'MDATA_KEY_DURATION' => '00:01:00',
|
||||||
'is_record' => false, ];
|
'is_record' => false,
|
||||||
|
];
|
||||||
|
|
||||||
// Create the file in the database via the HTTP API.
|
// Create the file in the database via the HTTP API.
|
||||||
$apiController = new ApiController($this->request, $this->getResponse());
|
$apiController = new ApiController($this->request, $this->getResponse());
|
||||||
|
|
|
@ -86,15 +86,18 @@ class ShowServiceUnitTest extends PHPUnit_Framework_TestCase
|
||||||
$method->setAccessible(true);
|
$method->setAccessible(true);
|
||||||
|
|
||||||
$next = $method->invokeArgs($this->_showService, [
|
$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);
|
$this->assertEquals(new DateTime('2044-02-05', new DateTimeZone('UTC')), $next);
|
||||||
|
|
||||||
$next = $method->invokeArgs($this->_showService, [
|
$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);
|
$this->assertEquals(new DateTime('2044-04-30', new DateTimeZone('UTC')), $next);
|
||||||
|
|
||||||
$next = $method->invokeArgs($this->_showService, [
|
$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);
|
$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']);
|
$dt = $method->invokeArgs($this->_showService, [$localStartDT, '01:00']);
|
||||||
$this->assertEquals([
|
$this->assertEquals([
|
||||||
$localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone), ], $dt);
|
$localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone),
|
||||||
|
], $dt);
|
||||||
|
|
||||||
// America/Toronto with offset for rebroadcast shows
|
// America/Toronto with offset for rebroadcast shows
|
||||||
$localStartDT = new DateTime('2044-01-01 06:30', new DateTimeZone('America/Toronto'));
|
$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'));
|
$localRebroadcastStartDT = new DateTime('2044-01-02 06:30', new DateTimeZone('America/Toronto'));
|
||||||
$localRebroadcastEndDT = new DateTime('2044-01-02 07: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',
|
$dt = $method->invokeArgs($this->_showService, [
|
||||||
['days' => '1', 'hours' => '06', 'mins' => '30'], ]);
|
$localStartDT, '01:00',
|
||||||
|
['days' => '1', 'hours' => '06', 'mins' => '30'],
|
||||||
|
]);
|
||||||
$this->assertEquals([
|
$this->assertEquals([
|
||||||
$localRebroadcastStartDT->setTimezone($utcTimezone), $localRebroadcastEndDT->setTimezone($utcTimezone), ], $dt);
|
$localRebroadcastStartDT->setTimezone($utcTimezone), $localRebroadcastEndDT->setTimezone($utcTimezone),
|
||||||
|
], $dt);
|
||||||
|
|
||||||
// Australia/Brisbane
|
// Australia/Brisbane
|
||||||
$localStartDT = new DateTime('2044-01-01 06:30', new DateTimeZone('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']);
|
$dt = $method->invokeArgs($this->_showService, [$localStartDT, '01:00']);
|
||||||
$this->assertEquals([
|
$this->assertEquals([
|
||||||
$localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone), ], $dt);
|
$localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone),
|
||||||
|
], $dt);
|
||||||
|
|
||||||
// America/Vancouver
|
// America/Vancouver
|
||||||
$localStartDT = new DateTime('2044-01-01 06:30', new DateTimeZone('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']);
|
$dt = $method->invokeArgs($this->_showService, [$localStartDT, '01:00']);
|
||||||
$this->assertEquals([
|
$this->assertEquals([
|
||||||
$localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone), ], $dt);
|
$localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone),
|
||||||
|
], $dt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue