style(legacy): force semicolon on same line (#1534)

This commit is contained in:
Jonas L 2022-01-23 19:15:55 +01:00 committed by GitHub
parent 522d989cab
commit 8569af9328
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
85 changed files with 396 additions and 789 deletions

View File

@ -9,6 +9,7 @@ $config = new PhpCsFixer\Config();
return $config->setRules([ return $config->setRules([
'@PhpCsFixer' => true, '@PhpCsFixer' => true,
'concat_space' => ['spacing' => 'one'], 'concat_space' => ['spacing' => 'one'],
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
'ordered_class_elements' => false, 'ordered_class_elements' => false,
'yoda_style' => false, 'yoda_style' => false,
]) ])

View File

@ -107,7 +107,6 @@ class AutoPlaylistManager
->filterByDbHasAutoPlaylist(true) ->filterByDbHasAutoPlaylist(true)
->endUse() ->endUse()
->filterByDbAutoPlaylistBuilt(false) ->filterByDbAutoPlaylistBuilt(false)
->find() ->find();
;
} }
} }

View File

@ -163,8 +163,7 @@ class CeleryManager
{ {
$query = CeleryTasksQuery::create() $query = CeleryTasksQuery::create()
->filterByDbStatus(CELERY_PENDING_STATUS) ->filterByDbStatus(CELERY_PENDING_STATUS)
->filterByDbTaskId('', Criteria::NOT_EQUAL) ->filterByDbTaskId('', Criteria::NOT_EQUAL);
;
if (!empty($taskName)) { if (!empty($taskName)) {
$query->filterByDbName($taskName); $query->filterByDbName($taskName);
} }

View File

@ -117,8 +117,7 @@ class ZendActionHttpException extends Exception
. " with status code {$statusCode}: {$message}"); . " with status code {$statusCode}: {$message}");
$action->getResponse() $action->getResponse()
->setHttpResponseCode($statusCode) ->setHttpResponseCode($statusCode)
->appendBody($message) ->appendBody($message);
;
parent::__construct($message, $code, $previous); parent::__construct($message, $code, $previous);
} }
} }

View File

@ -92,8 +92,7 @@ class PodcastManager
{ {
return ImportedPodcastQuery::create() return ImportedPodcastQuery::create()
->filterByDbAutoIngest(true) ->filterByDbAutoIngest(true)
->find() ->find();
;
} }
/** /**

View File

@ -125,8 +125,7 @@ class Application_Common_UsabilityHints
$fileCount = CcFilesQuery::create() $fileCount = CcFilesQuery::create()
->filterByDbFileExists(true) ->filterByDbFileExists(true)
->filterByDbHidden(false) ->filterByDbHidden(false)
->count() ->count();
;
if ($fileCount == 0) { if ($fileCount == 0) {
return true; return true;
@ -162,8 +161,7 @@ class Application_Common_UsabilityHints
$scheduledTracks = CcScheduleQuery::create() $scheduledTracks = CcScheduleQuery::create()
->filterByDbInstanceId($currentShow->getDbId()) ->filterByDbInstanceId($currentShow->getDbId())
->filterByDbEnds($now, Criteria::GREATER_EQUAL) ->filterByDbEnds($now, Criteria::GREATER_EQUAL)
->find() ->find();
;
if ($scheduledTracks->count() == 0) { if ($scheduledTracks->count() == 0) {
return true; return true;
} }
@ -182,8 +180,7 @@ class Application_Common_UsabilityHints
$scheduledTracks = CcScheduleQuery::create() $scheduledTracks = CcScheduleQuery::create()
->filterByDbInstanceId($futureShow->getDbId()) ->filterByDbInstanceId($futureShow->getDbId())
->filterByDbStarts($now, Criteria::GREATER_EQUAL) ->filterByDbStarts($now, Criteria::GREATER_EQUAL)
->find() ->find();
;
if ($scheduledTracks->count() == 0) { if ($scheduledTracks->count() == 0) {
return true; return true;
} }
@ -199,8 +196,7 @@ class Application_Common_UsabilityHints
->filterByDbStarts($now, Criteria::LESS_THAN) ->filterByDbStarts($now, Criteria::LESS_THAN)
->filterByDbEnds($now, Criteria::GREATER_THAN) ->filterByDbEnds($now, Criteria::GREATER_THAN)
->filterByDbModifiedInstance(false) ->filterByDbModifiedInstance(false)
->findOne() ->findOne();
;
} }
private static function getNextFutureShow() private static function getNextFutureShow()
@ -211,8 +207,7 @@ class Application_Common_UsabilityHints
->filterByDbStarts($now, Criteria::GREATER_THAN) ->filterByDbStarts($now, Criteria::GREATER_THAN)
->filterByDbModifiedInstance(false) ->filterByDbModifiedInstance(false)
->orderByDbStarts() ->orderByDbStarts()
->findOne() ->findOne();
;
} }
private static function isCurrentShowLinked() private static function isCurrentShowLinked()
@ -221,8 +216,7 @@ class Application_Common_UsabilityHints
if (!is_null($currentShow)) { if (!is_null($currentShow)) {
$show = CcShowQuery::create() $show = CcShowQuery::create()
->filterByDbId($currentShow->getDbShowId()) ->filterByDbId($currentShow->getDbShowId())
->findOne() ->findOne();
;
if ($show->isLinked()) { if ($show->isLinked()) {
return true; return true;
} }

View File

@ -6,8 +6,7 @@ $ccAcl->addRole(new Zend_Acl_Role('G'))
->addRole(new Zend_Acl_Role('H'), 'G') ->addRole(new Zend_Acl_Role('H'), 'G')
->addRole(new Zend_Acl_Role('P'), 'H') ->addRole(new Zend_Acl_Role('P'), 'H')
->addRole(new Zend_Acl_Role('A'), 'P') ->addRole(new Zend_Acl_Role('A'), 'P')
->addRole(new Zend_Acl_Role('S'), 'A') ->addRole(new Zend_Acl_Role('S'), 'A');
;
$ccAcl->add(new Zend_Acl_Resource('library')) $ccAcl->add(new Zend_Acl_Resource('library'))
->add(new Zend_Acl_Resource('index')) ->add(new Zend_Acl_Resource('index'))
@ -42,8 +41,7 @@ $ccAcl->add(new Zend_Acl_Resource('library'))
->add(new Zend_Acl_Resource('render')) ->add(new Zend_Acl_Resource('render'))
->add(new Zend_Acl_Resource('embeddablewidgets')) ->add(new Zend_Acl_Resource('embeddablewidgets'))
->add(new Zend_Acl_Resource('setup')) ->add(new Zend_Acl_Resource('setup'))
->add(new Zend_Acl_Resource('feeds')) ->add(new Zend_Acl_Resource('feeds'));
;
// Creating permissions // Creating permissions
$ccAcl->allow('G', 'index') $ccAcl->allow('G', 'index')
@ -84,8 +82,7 @@ $ccAcl->allow('G', 'index')
->allow('A', 'user') ->allow('A', 'user')
->allow('A', 'tracktype') ->allow('A', 'tracktype')
->allow('A', 'systemstatus') ->allow('A', 'systemstatus')
->allow('A', 'preference') ->allow('A', 'preference');
;
$aclPlugin = new Zend_Controller_Plugin_Acl($ccAcl); $aclPlugin = new Zend_Controller_Plugin_Acl($ccAcl);

View File

@ -76,8 +76,7 @@ class ApiController extends Zend_Controller_Action
->addActionContext('get-usability-hint', 'json') ->addActionContext('get-usability-hint', 'json')
->addActionContext('poll-celery', 'json') ->addActionContext('poll-celery', 'json')
->addActionContext('recalculate-schedule', 'json') //RKTN-260 ->addActionContext('recalculate-schedule', 'json') //RKTN-260
->initContext() ->initContext();
;
} }
public function checkAuth() public function checkAuth()
@ -1412,8 +1411,7 @@ class ApiController extends Zend_Controller_Action
$previous_metadata = CcWebstreamMetadataQuery::create() $previous_metadata = CcWebstreamMetadataQuery::create()
->orderByDbStartTime('desc') ->orderByDbStartTime('desc')
->filterByDbInstanceId($media_id) ->filterByDbInstanceId($media_id)
->findOne() ->findOne();
;
$do_insert = true; $do_insert = true;
if ($previous_metadata) { if ($previous_metadata) {
@ -1723,8 +1721,7 @@ class ApiController extends Zend_Controller_Action
->filterByDbStarts($now, Criteria::GREATER_THAN) ->filterByDbStarts($now, Criteria::GREATER_THAN)
//->filterByDbModifiedInstance(false) //->filterByDbModifiedInstance(false)
->orderByDbStarts() ->orderByDbStarts()
->find() ->find();
;
//->find($this->con); //->find($this->con);
$total = $showInstances->count(); $total = $showInstances->count();
$progress = 0; $progress = 0;
@ -1771,7 +1768,6 @@ class ApiController extends Zend_Controller_Action
$this->getResponse() $this->getResponse()
->setHttpResponseCode($status) ->setHttpResponseCode($status)
->setHeader('Content-Type', 'application/json') ->setHeader('Content-Type', 'application/json')
->setBody(json_encode(['error' => $message])) ->setBody(json_encode(['error' => $message]));
;
} }
} }

View File

@ -10,8 +10,7 @@ class AudiopreviewController extends Zend_Controller_Action
->addActionContext('get-show', 'json') ->addActionContext('get-show', 'json')
->addActionContext('playlist-preview', 'json') ->addActionContext('playlist-preview', 'json')
->addActionContext('get-playlist', 'json') ->addActionContext('get-playlist', 'json')
->initContext() ->initContext();
;
} }
/** /**

View File

@ -7,8 +7,7 @@ class DashboardController extends Zend_Controller_Action
$ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('switch-source', 'json') $ajaxContext->addActionContext('switch-source', 'json')
->addActionContext('disconnect-source', 'json') ->addActionContext('disconnect-source', 'json')
->initContext() ->initContext();
;
} }
public function indexAction() public function indexAction()

View File

@ -15,8 +15,7 @@ class LibraryController extends Zend_Controller_Action
->addActionContext('set-num-entries', 'json') ->addActionContext('set-num-entries', 'json')
->addActionContext('edit-file-md', 'json') ->addActionContext('edit-file-md', 'json')
->addActionContext('publish-dialog', 'html') ->addActionContext('publish-dialog', 'html')
->initContext() ->initContext();
;
} }
public function indexAction() public function indexAction()

View File

@ -7,8 +7,7 @@ class ListenerstatController extends Zend_Controller_Action
$ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext $ajaxContext
->addActionContext('get-data', 'json') ->addActionContext('get-data', 'json')
->initContext() ->initContext();
;
} }
public function indexAction() public function indexAction()

View File

@ -10,8 +10,7 @@ class LoginController extends Zend_Controller_Action
$this->view->headLink(['rel' => 'icon', 'href' => $baseUrl . 'favicon.ico?' . $CC_CONFIG['airtime_version'], 'type' => 'image/x-icon'], 'PREPEND') $this->view->headLink(['rel' => 'icon', 'href' => $baseUrl . 'favicon.ico?' . $CC_CONFIG['airtime_version'], 'type' => 'image/x-icon'], 'PREPEND')
->appendStylesheet($baseUrl . 'css/bootstrap.css?' . $CC_CONFIG['airtime_version']) ->appendStylesheet($baseUrl . 'css/bootstrap.css?' . $CC_CONFIG['airtime_version'])
->appendStylesheet($baseUrl . 'css/redmond/jquery-ui-1.8.8.custom.css?' . $CC_CONFIG['airtime_version']) ->appendStylesheet($baseUrl . 'css/redmond/jquery-ui-1.8.8.custom.css?' . $CC_CONFIG['airtime_version'])
->appendStylesheet($baseUrl . 'css/styles.css?' . $CC_CONFIG['airtime_version']) ->appendStylesheet($baseUrl . 'css/styles.css?' . $CC_CONFIG['airtime_version']);
;
} }
public function indexAction() public function indexAction()
@ -64,8 +63,7 @@ class LoginController extends Zend_Controller_Action
//pass to the adapter the submitted username and password //pass to the adapter the submitted username and password
$authAdapter->setIdentity($username) $authAdapter->setIdentity($username)
->setCredential($password) ->setCredential($password);
;
$result = $auth->authenticate($authAdapter); $result = $auth->authenticate($authAdapter);
if ($result->isValid()) { if ($result->isValid()) {
@ -142,8 +140,7 @@ class LoginController extends Zend_Controller_Action
$query->filterByDbLogin($username); $query->filterByDbLogin($username);
} else { } else {
$query->filterByDbEmail($email) $query->filterByDbEmail($email)
->filterByDbLogin($username) ->filterByDbLogin($username);
;
} }
$user = $query->findOne(); $user = $query->findOne();
@ -212,8 +209,7 @@ class LoginController extends Zend_Controller_Action
$authAdapter = Application_Model_Auth::getAuthAdapter(); $authAdapter = Application_Model_Auth::getAuthAdapter();
$authAdapter->setIdentity($user->getDbLogin()) $authAdapter->setIdentity($user->getDbLogin())
->setCredential($form->password->getValue()) ->setCredential($form->password->getValue());
;
$zend_auth->authenticate($authAdapter); $zend_auth->authenticate($authAdapter);

View File

@ -29,8 +29,7 @@ class PlaylistController extends Zend_Controller_Action
->addActionContext('shuffle', 'json') ->addActionContext('shuffle', 'json')
->addActionContext('empty-content', 'json') ->addActionContext('empty-content', 'json')
->addActionContext('change-playlist', 'json') ->addActionContext('change-playlist', 'json')
->initContext() ->initContext();
;
//This controller writes to the session all over the place, so we're going to reopen it for writing here. //This controller writes to the session all over the place, so we're going to reopen it for writing here.
SessionHelper::reopenSessionForWriting(); SessionHelper::reopenSessionForWriting();

View File

@ -16,8 +16,7 @@ class PlayouthistoryController extends Zend_Controller_Action
->addActionContext('delete-list-items', 'json') ->addActionContext('delete-list-items', 'json')
->addActionContext('update-list-item', 'json') ->addActionContext('update-list-item', 'json')
->addActionContext('update-file-item', 'json') ->addActionContext('update-file-item', 'json')
->initContext() ->initContext();
;
} }
public function indexAction() public function indexAction()

View File

@ -10,8 +10,7 @@ class PlayouthistorytemplateController extends Zend_Controller_Action
->addActionContext('update-template', 'json') ->addActionContext('update-template', 'json')
->addActionContext('delete-template', 'json') ->addActionContext('delete-template', 'json')
->addActionContext('set-template-default', 'json') ->addActionContext('set-template-default', 'json')
->initContext() ->initContext();
;
} }
public function indexAction() public function indexAction()

View File

@ -7,8 +7,7 @@ class PluploadController extends Zend_Controller_Action
$ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('upload', 'json') $ajaxContext->addActionContext('upload', 'json')
->addActionContext('recent-uploads', 'json') ->addActionContext('recent-uploads', 'json')
->initContext() ->initContext();
;
} }
public function indexAction() public function indexAction()
@ -103,8 +102,7 @@ class PluploadController extends Zend_Controller_Action
->orderByDbUtime(Criteria::DESC) ->orderByDbUtime(Criteria::DESC)
->offset($rowStart) ->offset($rowStart)
->limit($limit) ->limit($limit)
->find() ->find();
;
$uploadsArray = []; $uploadsArray = [];
$utcTimezone = new DateTimeZone('UTC'); $utcTimezone = new DateTimeZone('UTC');

View File

@ -15,8 +15,7 @@ class PreferenceController extends Zend_Controller_Action
->addActionContext('get-liquidsoap-status', 'json') ->addActionContext('get-liquidsoap-status', 'json')
->addActionContext('set-source-connection-url', 'json') ->addActionContext('set-source-connection-url', 'json')
->addActionContext('get-admin-password-status', 'json') ->addActionContext('get-admin-password-status', 'json')
->initContext() ->initContext();
;
} }
public function indexAction() public function indexAction()
@ -512,8 +511,7 @@ class PreferenceController extends Zend_Controller_Action
if (!($method == 'POST')) { if (!($method == 'POST')) {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(405) ->setHttpResponseCode(405)
->appendBody(_('Request method not accepted') . ": {$method}") ->appendBody(_('Request method not accepted') . ": {$method}");
;
return; return;
} }
@ -524,8 +522,7 @@ class PreferenceController extends Zend_Controller_Action
$this->getResponse() $this->getResponse()
->setHttpResponseCode(200) ->setHttpResponseCode(200)
->appendBody('OK') ->appendBody('OK');
;
} }
private function deleteFutureScheduleItems() private function deleteFutureScheduleItems()
@ -534,8 +531,7 @@ class PreferenceController extends Zend_Controller_Action
$nowDateTime = new DateTime('now', $utcTimezone); $nowDateTime = new DateTime('now', $utcTimezone);
$scheduleItems = CcScheduleQuery::create() $scheduleItems = CcScheduleQuery::create()
->filterByDbEnds($nowDateTime->format(DEFAULT_TIMESTAMP_FORMAT), Criteria::GREATER_THAN) ->filterByDbEnds($nowDateTime->format(DEFAULT_TIMESTAMP_FORMAT), Criteria::GREATER_THAN)
->find() ->find();
;
// Delete all the schedule items // Delete all the schedule items
foreach ($scheduleItems as $i) { foreach ($scheduleItems as $i) {

View File

@ -35,8 +35,7 @@ class ScheduleController extends Zend_Controller_Action
->addActionContext('get-current-show', 'json') ->addActionContext('get-current-show', 'json')
->addActionContext('update-future-is-scheduled', 'json') ->addActionContext('update-future-is-scheduled', 'json')
->addActionContext('localize-start-end-time', 'json') ->addActionContext('localize-start-end-time', 'json')
->initContext() ->initContext();
;
$this->sched_sess = new Zend_Session_Namespace('schedule'); $this->sched_sess = new Zend_Session_Namespace('schedule');
} }

View File

@ -12,8 +12,7 @@ class ShowbuilderController extends Zend_Controller_Action
->addActionContext('check-builder-feed', 'json') ->addActionContext('check-builder-feed', 'json')
->addActionContext('builder-feed', 'json') ->addActionContext('builder-feed', 'json')
->addActionContext('context-menu', 'json') ->addActionContext('context-menu', 'json')
->initContext() ->initContext();
;
} }
public function indexAction() public function indexAction()

View File

@ -8,8 +8,7 @@ class TracktypeController extends Zend_Controller_Action
$ajaxContext->addActionContext('get-tracktype-data-table-info', 'json') $ajaxContext->addActionContext('get-tracktype-data-table-info', 'json')
->addActionContext('get-tracktype-data', 'json') ->addActionContext('get-tracktype-data', 'json')
->addActionContext('remove-tracktype', 'json') ->addActionContext('remove-tracktype', 'json')
->initContext() ->initContext();
;
} }
public function addTracktypeAction() public function addTracktypeAction()

View File

@ -17,19 +17,16 @@ class UpgradeController extends Zend_Controller_Action
if (!$didWePerformAnUpgrade) { if (!$didWePerformAnUpgrade) {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(200) ->setHttpResponseCode(200)
->appendBody('No upgrade was performed. The current schema version is ' . Application_Model_Preference::GetSchemaVersion() . '.<br>') ->appendBody('No upgrade was performed. The current schema version is ' . Application_Model_Preference::GetSchemaVersion() . '.<br>');
;
} else { } else {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(200) ->setHttpResponseCode(200)
->appendBody('Upgrade to Airtime schema version ' . Application_Model_Preference::GetSchemaVersion() . ' OK<br>') ->appendBody('Upgrade to Airtime schema version ' . Application_Model_Preference::GetSchemaVersion() . ' OK<br>');
;
} }
} catch (Exception $e) { } catch (Exception $e) {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(400) ->setHttpResponseCode(400)
->appendBody($e->getMessage()) ->appendBody($e->getMessage());
;
} }
} }
@ -51,19 +48,16 @@ class UpgradeController extends Zend_Controller_Action
if (!$downgradePerformed) { if (!$downgradePerformed) {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(200) ->setHttpResponseCode(200)
->appendBody('No downgrade was performed. The current schema version is ' . Application_Model_Preference::GetSchemaVersion() . '.<br>') ->appendBody('No downgrade was performed. The current schema version is ' . Application_Model_Preference::GetSchemaVersion() . '.<br>');
;
} else { } else {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(200) ->setHttpResponseCode(200)
->appendBody('Downgrade to Airtime schema version ' . Application_Model_Preference::GetSchemaVersion() . ' OK<br>') ->appendBody('Downgrade to Airtime schema version ' . Application_Model_Preference::GetSchemaVersion() . ' OK<br>');
;
} }
} catch (Exception $e) { } catch (Exception $e) {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(400) ->setHttpResponseCode(400)
->appendBody($e->getMessage()) ->appendBody($e->getMessage());
;
} }
} }
} }

View File

@ -10,8 +10,7 @@ class UserController extends Zend_Controller_Action
->addActionContext('get-user-data', 'json') ->addActionContext('get-user-data', 'json')
->addActionContext('remove-user', 'json') ->addActionContext('remove-user', 'json')
->addActionContext('edit-user', 'json') ->addActionContext('edit-user', 'json')
->initContext() ->initContext();
;
} }
public function addUserAction() public function addUserAction()

View File

@ -16,8 +16,7 @@ class UsersettingsController extends Zend_Controller_Action
->addActionContext('remindme-never', 'json') ->addActionContext('remindme-never', 'json')
->addActionContext('donotshowregistrationpopup', 'json') ->addActionContext('donotshowregistrationpopup', 'json')
->addActionContext('set-library-screen-settings', 'json') ->addActionContext('set-library-screen-settings', 'json')
->initContext() ->initContext();
;
} }
public function setNowPlayingScreenSettingsAction() public function setNowPlayingScreenSettingsAction()

View File

@ -9,8 +9,7 @@ class WebstreamController extends Zend_Controller_Action
->addActionContext('save', 'json') ->addActionContext('save', 'json')
->addActionContext('edit', 'json') ->addActionContext('edit', 'json')
->addActionContext('delete', 'json') ->addActionContext('delete', 'json')
->initContext() ->initContext();
;
} }
public function newAction() public function newAction()

View File

@ -146,8 +146,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
$this->getResponse() $this->getResponse()
->setHttpResponseCode(401) ->setHttpResponseCode(401)
->setBody($json) ->setBody($json)
->sendResponse() ->sendResponse();
;
//redirectAndExit() cleans up, sends the headers and stops the script //redirectAndExit() cleans up, sends the headers and stops the script
Zend_Controller_Action_HelperBroker::getStaticHelper('redirector')->redirectAndExit(); Zend_Controller_Action_HelperBroker::getStaticHelper('redirector')->redirectAndExit();
@ -178,8 +177,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
$this->getResponse() $this->getResponse()
->setHttpResponseCode(401) ->setHttpResponseCode(401)
->appendBody('ERROR: CSRF token mismatch.') ->appendBody('ERROR: CSRF token mismatch.')
->sendResponse() ->sendResponse();
;
exit(); exit();
} }
@ -223,8 +221,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
$this->getResponse() $this->getResponse()
->setHttpResponseCode(401) ->setHttpResponseCode(401)
->appendBody('ERROR: Incorrect API key.') ->appendBody('ERROR: Incorrect API key.');
;
return false; return false;
} }
@ -247,8 +244,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
$controller = $request->getControllerName(); $controller = $request->getControllerName();
$action = $request->getActionName(); $action = $request->getActionName();
$stationPodcast = StationPodcastQuery::create() $stationPodcast = StationPodcastQuery::create()
->findOneByDbPodcastId(Application_Model_Preference::getStationPodcastId()) ->findOneByDbPodcastId(Application_Model_Preference::getStationPodcastId());
;
return $module == 'rest' && $controller == 'media' && $action == 'download' return $module == 'rest' && $controller == 'media' && $action == 'download'
&& $key === Application_Model_Preference::getStationPodcastDownloadKey() && $key === Application_Model_Preference::getStationPodcastDownloadKey()

View File

@ -10,8 +10,7 @@ class Zend_Controller_Plugin_Maintenance extends Zend_Controller_Plugin_Abstract
$request->setModuleName('default') $request->setModuleName('default')
->setControllerName('index') ->setControllerName('index')
->setActionName('maintenance') ->setActionName('maintenance')
->setDispatched(true) ->setDispatched(true);
;
} }
} }
} }

View File

@ -172,8 +172,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
->appendStylesheet($baseUrl . 'css/qtip/jquery.qtip.min.css?' . $CC_CONFIG['airtime_version']) ->appendStylesheet($baseUrl . 'css/qtip/jquery.qtip.min.css?' . $CC_CONFIG['airtime_version'])
->appendStylesheet($baseUrl . 'css/styles.css?' . $CC_CONFIG['airtime_version']) ->appendStylesheet($baseUrl . 'css/styles.css?' . $CC_CONFIG['airtime_version'])
->appendStylesheet($baseUrl . 'css/masterpanel.css?' . $CC_CONFIG['airtime_version']) ->appendStylesheet($baseUrl . 'css/masterpanel.css?' . $CC_CONFIG['airtime_version'])
->appendStylesheet($baseUrl . 'css/tipsy/jquery.tipsy.css?' . $CC_CONFIG['airtime_version']) ->appendStylesheet($baseUrl . 'css/tipsy/jquery.tipsy.css?' . $CC_CONFIG['airtime_version']);
;
} }
protected function _initHeadScript() protected function _initHeadScript()
@ -203,8 +202,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
->appendFile($baseUrl . 'locale/datatables-translation-table?' . $CC_CONFIG['airtime_version'], 'text/javascript') ->appendFile($baseUrl . 'locale/datatables-translation-table?' . $CC_CONFIG['airtime_version'], 'text/javascript')
->appendScript('$.i18n.setDictionary(general_dict)') ->appendScript('$.i18n.setDictionary(general_dict)')
->appendScript("var baseUrl='{$baseUrl}'") ->appendScript("var baseUrl='{$baseUrl}'");
;
//These timezones are needed to adjust javascript Date objects on the client to make sense to the user's set timezone //These timezones are needed to adjust javascript Date objects on the client to make sense to the user's set timezone
//or the server's set timezone. //or the server's set timezone.
@ -228,8 +226,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
->appendFile($baseUrl . 'js/tipsy/jquery.tipsy.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') ->appendFile($baseUrl . 'js/tipsy/jquery.tipsy.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
->appendFile($baseUrl . 'js/airtime/common/common.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') ->appendFile($baseUrl . 'js/airtime/common/common.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
->appendFile($baseUrl . 'js/airtime/common/audioplaytest.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') ->appendFile($baseUrl . 'js/airtime/common/audioplaytest.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
;
$user = Application_Model_User::getCurrentUser(); $user = Application_Model_User::getCurrentUser();
if (!is_null($user)) { if (!is_null($user)) {

View File

@ -9,14 +9,12 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
$cb_airtime_auth = new Zend_Form_Element_Checkbox('cb_airtime_auth'); $cb_airtime_auth = new Zend_Form_Element_Checkbox('cb_airtime_auth');
$cb_airtime_auth->setLabel(sprintf(_('Use %s Authentication:'), PRODUCT_NAME)) $cb_airtime_auth->setLabel(sprintf(_('Use %s Authentication:'), PRODUCT_NAME))
->setChecked(true) ->setChecked(true)
->setRequired(false) ->setRequired(false);
;
$this->addElement($cb_airtime_auth); $this->addElement($cb_airtime_auth);
$cb_custom_auth = new Zend_Form_Element_Checkbox('cb_custom_auth'); $cb_custom_auth = new Zend_Form_Element_Checkbox('cb_custom_auth');
$cb_custom_auth->setLabel(_('Use Custom Authentication:')) $cb_custom_auth->setLabel(_('Use Custom Authentication:'))
->setRequired(false) ->setRequired(false);
;
$this->addElement($cb_custom_auth); $this->addElement($cb_custom_auth);
//custom username //custom username
@ -27,8 +25,7 @@ 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
@ -40,8 +37,7 @@ 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());
@ -50,22 +46,19 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
$showSourceHost = new Zend_Form_Element_Text('show_source_host'); $showSourceHost = new Zend_Form_Element_Text('show_source_host');
$showSourceHost->setAttrib('readonly', true) $showSourceHost->setAttrib('readonly', true)
->setLabel(_('Host:')) ->setLabel(_('Host:'))
->setValue(isset($showSourceParams['host']) ? $showSourceParams['host'] : '') ->setValue(isset($showSourceParams['host']) ? $showSourceParams['host'] : '');
;
$this->addElement($showSourceHost); $this->addElement($showSourceHost);
$showSourcePort = new Zend_Form_Element_Text('show_source_port'); $showSourcePort = new Zend_Form_Element_Text('show_source_port');
$showSourcePort->setAttrib('readonly', true) $showSourcePort->setAttrib('readonly', true)
->setLabel(_('Port:')) ->setLabel(_('Port:'))
->setValue(isset($showSourceParams['port']) ? $showSourceParams['port'] : '') ->setValue(isset($showSourceParams['port']) ? $showSourceParams['port'] : '');
;
$this->addElement($showSourcePort); $this->addElement($showSourcePort);
$showSourceMount = new Zend_Form_Element_Text('show_source_mount'); $showSourceMount = new Zend_Form_Element_Text('show_source_mount');
$showSourceMount->setAttrib('readonly', true) $showSourceMount->setAttrib('readonly', true)
->setLabel(_('Mount:')) ->setLabel(_('Mount:'))
->setValue(isset($showSourceParams['path']) ? $showSourceParams['path'] : '') ->setValue(isset($showSourceParams['path']) ? $showSourceParams['path'] : '');
;
$this->addElement($showSourceMount); $this->addElement($showSourceMount);
$this->setDecorators( $this->setDecorators(

View File

@ -48,8 +48,7 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
->setMultiOptions( ->setMultiOptions(
[2 => _('day of the month'), 3 => _('day of the week')] [2 => _('day of the month'), 3 => _('day of the week')]
) )
->setValue(2) ->setValue(2);
;
$this->addElement($repeatMonthlyType); $this->addElement($repeatMonthlyType);
// Add end date element // Add end date element

View File

@ -77,8 +77,7 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
]]]) ]]])
->addValidator('Count', false, 1) ->addValidator('Count', false, 1)
->addValidator('Extension', false, 'jpg,jpeg,png,gif') ->addValidator('Extension', false, 'jpg,jpeg,png,gif')
->addFilter('ImageSize') ->addFilter('ImageSize');
;
$this->addElement($upload); $this->addElement($upload);
@ -99,8 +98,7 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
$csrf_element->setValue($csrf_namespace->authtoken) $csrf_element->setValue($csrf_namespace->authtoken)
->setRequired('true') ->setRequired('true')
->removeDecorator('HtmlTag') ->removeDecorator('HtmlTag')
->removeDecorator('Label') ->removeDecorator('Label');
;
$this->addElement($csrf_element); $this->addElement($csrf_element);
} }

View File

@ -24,8 +24,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
'future' => _('In the Future:'), 'future' => _('In the Future:'),
]) ])
->setValue('future') ->setValue('future')
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
//$startDate->setAttrib('alt', 'date'); //$startDate->setAttrib('alt', 'date');
$this->addElement($startNow); $this->addElement($startNow);
@ -39,8 +38,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
->setValidators([ ->setValidators([
$notEmptyValidator, $notEmptyValidator,
$dateValidator, ]) $dateValidator, ])
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$startDate->setAttrib('alt', 'date'); $startDate->setAttrib('alt', 'date');
$this->addElement($startDate); $this->addElement($startDate);
@ -67,8 +65,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
->setValidators([ ->setValidators([
$notEmptyValidator, $notEmptyValidator,
$dateValidator, ]) $dateValidator, ])
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$endDate->setAttrib('alt', 'date'); $endDate->setAttrib('alt', 'date');
$this->addElement($endDate); $this->addElement($endDate);
@ -81,8 +78,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
->setValidators([ ->setValidators([
$notEmptyValidator, $notEmptyValidator,
$regexValidator, ]) $regexValidator, ])
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$endTime->setAttrib('alt', 'time'); $endTime->setAttrib('alt', 'time');
$this->addElement($endTime); $this->addElement($endTime);
@ -101,8 +97,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
->setMultiOptions(Application_Common_Timezone::getTimezones()) ->setMultiOptions(Application_Common_Timezone::getTimezones())
->setValue(Application_Model_Preference::GetUserTimezone()) ->setValue(Application_Model_Preference::GetUserTimezone())
->setAttrib('class', 'input_select add_show_input_select') ->setAttrib('class', 'input_select add_show_input_select')
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$this->addElement($timezone); $this->addElement($timezone);
// Add repeats element // Add repeats element

View File

@ -21,8 +21,7 @@ class Application_Form_AddShowWho extends Zend_Form_SubForm
//Add hosts selection //Add hosts selection
$hosts = new Zend_Form_Element_MultiCheckbox('add_show_hosts'); $hosts = new Zend_Form_Element_MultiCheckbox('add_show_hosts');
$hosts->setLabel(_('DJs:')) $hosts->setLabel(_('DJs:'))
->setMultiOptions($options) ->setMultiOptions($options);
;
$this->addElement($hosts); $this->addElement($hosts);
} }

View File

@ -36,8 +36,7 @@ class Application_Form_AddTracktype extends Zend_Form
->setFilters(['StringTrim']) ->setFilters(['StringTrim'])
->setValidators([ ->setValidators([
new Zend_Validate_StringLength(['max' => 200]), new Zend_Validate_StringLength(['max' => 200]),
]) ]);
;
$description->setAttrib('class', 'input_text'); $description->setAttrib('class', 'input_text');
$description->addFilter('StringTrim'); $description->addFilter('StringTrim');
$this->addElement($description); $this->addElement($description);

View File

@ -18,8 +18,7 @@ class Application_Form_DateRange extends Zend_Form_SubForm
->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,8 +32,7 @@ class Application_Form_DateRange extends Zend_Form_SubForm
'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);
@ -48,8 +46,7 @@ class Application_Form_DateRange extends Zend_Form_SubForm
->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);
@ -63,8 +60,7 @@ class Application_Form_DateRange extends Zend_Form_SubForm
'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);
} }

View File

@ -25,8 +25,7 @@ class Application_Form_EditAudioMD extends Zend_Form
$artwork->setFilters(['StringTrim']) $artwork->setFilters(['StringTrim'])
->setValidators([ ->setValidators([
new Zend_Validate_StringLength(['max' => 2048]), new Zend_Validate_StringLength(['max' => 2048]),
]) ]);
;
$file_id->addDecorator('HtmlTag', ['tag' => 'div', 'style' => 'display:none']); $file_id->addDecorator('HtmlTag', ['tag' => 'div', 'style' => 'display:none']);
$file_id->removeDecorator('Label'); $file_id->removeDecorator('Label');
$file_id->setAttrib('class', 'artwork'); $file_id->setAttrib('class', 'artwork');
@ -55,8 +54,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim']) ->setFilters(['StringTrim'])
->setValidators([ ->setValidators([
new Zend_Validate_StringLength(['max' => 512]), new Zend_Validate_StringLength(['max' => 512]),
]) ]);
;
$this->addElement($track_title); $this->addElement($track_title);
// Add artist field // Add artist field
@ -66,8 +64,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim']) ->setFilters(['StringTrim'])
->setValidators([ ->setValidators([
new Zend_Validate_StringLength(['max' => 512]), new Zend_Validate_StringLength(['max' => 512]),
]) ]);
;
$this->addElement($artist_name); $this->addElement($artist_name);
// Add album field // Add album field
@ -77,8 +74,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim']) ->setFilters(['StringTrim'])
->setValidators([ ->setValidators([
new Zend_Validate_StringLength(['max' => 512]), new Zend_Validate_StringLength(['max' => 512]),
]) ]);
;
$this->addElement($album_title); $this->addElement($album_title);
// Add album field // Add album field
@ -121,8 +117,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim']) ->setFilters(['StringTrim'])
->setValidators([ ->setValidators([
new Zend_Validate_StringLength(['max' => 512]), new Zend_Validate_StringLength(['max' => 512]),
]) ]);
;
$this->addElement($description); $this->addElement($description);
// Add track number field // Add track number field
@ -130,8 +125,7 @@ class Application_Form_EditAudioMD extends Zend_Form
$track_number->class = 'input_text'; $track_number->class = 'input_text';
$track_number->setLabel('Track Number:') $track_number->setLabel('Track Number:')
->setFilters(['StringTrim']) ->setFilters(['StringTrim'])
->setValidators([new Zend_Validate_Int()]) ->setValidators([new Zend_Validate_Int()]);
;
$this->addElement($track_number); $this->addElement($track_number);
// Add genre field // Add genre field
@ -141,8 +135,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim']) ->setFilters(['StringTrim'])
->setValidators([ ->setValidators([
new Zend_Validate_StringLength(['max' => 64]), new Zend_Validate_StringLength(['max' => 64]),
]) ]);
;
$this->addElement($genre); $this->addElement($genre);
// Add year field // Add year field
@ -155,8 +148,7 @@ class Application_Form_EditAudioMD extends Zend_Form
Application_Form_Helper_ValidationTypes::overrrideDateValidator('YYYY-MM-DD'), Application_Form_Helper_ValidationTypes::overrrideDateValidator('YYYY-MM-DD'),
Application_Form_Helper_ValidationTypes::overrrideDateValidator('YYYY-MM'), Application_Form_Helper_ValidationTypes::overrrideDateValidator('YYYY-MM'),
Application_Form_Helper_ValidationTypes::overrrideDateValidator('YYYY'), Application_Form_Helper_ValidationTypes::overrrideDateValidator('YYYY'),
]) ]);
;
$this->addElement($year); $this->addElement($year);
// Add label field // Add label field
@ -166,8 +158,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim']) ->setFilters(['StringTrim'])
->setValidators([ ->setValidators([
new Zend_Validate_StringLength(['max' => 512]), new Zend_Validate_StringLength(['max' => 512]),
]) ]);
;
$this->addElement($label); $this->addElement($label);
// Add composer field // Add composer field
@ -177,8 +168,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim']) ->setFilters(['StringTrim'])
->setValidators([ ->setValidators([
new Zend_Validate_StringLength(['max' => 512]), new Zend_Validate_StringLength(['max' => 512]),
]) ]);
;
$this->addElement($composer); $this->addElement($composer);
// Add conductor field // Add conductor field
@ -188,8 +178,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim']) ->setFilters(['StringTrim'])
->setValidators([ ->setValidators([
new Zend_Validate_StringLength(['max' => 512]), new Zend_Validate_StringLength(['max' => 512]),
]) ]);
;
$this->addElement($conductor); $this->addElement($conductor);
// Add mood field // Add mood field
@ -199,8 +188,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim']) ->setFilters(['StringTrim'])
->setValidators([ ->setValidators([
new Zend_Validate_StringLength(['max' => 64]), new Zend_Validate_StringLength(['max' => 64]),
]) ]);
;
$this->addElement($mood); $this->addElement($mood);
// Add bmp field // Add bmp field
@ -210,8 +198,7 @@ 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
@ -221,8 +208,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim']) ->setFilters(['StringTrim'])
->setValidators([ ->setValidators([
new Zend_Validate_StringLength(['max' => 512]), new Zend_Validate_StringLength(['max' => 512]),
]) ]);
;
$this->addElement($copyright); $this->addElement($copyright);
// Add isrc number field // Add isrc number field
@ -232,8 +218,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim']) ->setFilters(['StringTrim'])
->setValidators([ ->setValidators([
new Zend_Validate_StringLength(['max' => 512]), new Zend_Validate_StringLength(['max' => 512]),
]) ]);
;
$this->addElement($isrc_number); $this->addElement($isrc_number);
// Add website field // Add website field
@ -243,8 +228,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim']) ->setFilters(['StringTrim'])
->setValidators([ ->setValidators([
new Zend_Validate_StringLength(['max' => 512]), new Zend_Validate_StringLength(['max' => 512]),
]) ]);
;
$this->addElement($info_url); $this->addElement($info_url);
// Add language field // Add language field
@ -254,8 +238,7 @@ class Application_Form_EditAudioMD extends Zend_Form
->setFilters(['StringTrim']) ->setFilters(['StringTrim'])
->setValidators([ ->setValidators([
new Zend_Validate_StringLength(['max' => 512]), new Zend_Validate_StringLength(['max' => 512]),
]) ]);
;
$this->addElement($language); $this->addElement($language);
$validCuePattern = '/^(?:[0-9]{1,2}:)?(?:[0-9]{1,2}:)?[0-9]{1,6}(\.\d{1,6})?$/'; $validCuePattern = '/^(?:[0-9]{1,2}:)?(?:[0-9]{1,2}:)?[0-9]{1,6}(\.\d{1,6})?$/';

View File

@ -136,8 +136,7 @@ class Application_Form_EditUser extends Zend_Form
$count = CcSubjsQuery::create() $count = CcSubjsQuery::create()
->filterByDbLogin($p_login) ->filterByDbLogin($p_login)
->filterByDbId($p_userId, Criteria::NOT_EQUAL) ->filterByDbId($p_userId, Criteria::NOT_EQUAL)
->count() ->count();
;
if ($count != 0) { if ($count != 0) {
$this->getElement('cu_login')->setErrors([_('Login name is not unique.')]); $this->getElement('cu_login')->setErrors([_('Login name is not unique.')]);

View File

@ -46,8 +46,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
->addValidator('Count', false, 1) ->addValidator('Count', false, 1)
->addValidator('Extension', false, 'jpg,jpeg,png,gif') ->addValidator('Extension', false, 'jpg,jpeg,png,gif')
->setMaxFileSize(1000000) ->setMaxFileSize(1000000)
->addFilter('ImageSize') ->addFilter('ImageSize');
;
$stationLogoUpload->setAttrib('accept', 'image/*'); $stationLogoUpload->setAttrib('accept', 'image/*');
$this->addElement($stationLogoUpload); $this->addElement($stationLogoUpload);

View File

@ -16,15 +16,13 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
// automatic trasition on source disconnection // automatic trasition on source disconnection
$auto_transition = new Zend_Form_Element_Checkbox('auto_transition'); $auto_transition = new Zend_Form_Element_Checkbox('auto_transition');
$auto_transition->setLabel(_('Auto Switch Off:')) $auto_transition->setLabel(_('Auto Switch Off:'))
->setValue(Application_Model_Preference::GetAutoTransition()) ->setValue(Application_Model_Preference::GetAutoTransition());
;
$this->addElement($auto_transition); $this->addElement($auto_transition);
// automatic switch on upon source connection // automatic switch on upon source connection
$auto_switch = new Zend_Form_Element_Checkbox('auto_switch'); $auto_switch = new Zend_Form_Element_Checkbox('auto_switch');
$auto_switch->setLabel(_('Auto Switch On:')) $auto_switch->setLabel(_('Auto Switch On:'))
->setValue(Application_Model_Preference::GetAutoSwitch()) ->setValue(Application_Model_Preference::GetAutoSwitch());
;
$this->addElement($auto_switch); $this->addElement($auto_switch);
// Default transition fade // Default transition fade
@ -33,8 +31,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
->setFilters(['StringTrim']) ->setFilters(['StringTrim'])
->addValidator('regex', false, ['/^\d*(\.\d+)?$/', ->addValidator('regex', false, ['/^\d*(\.\d+)?$/',
'messages' => _('Please enter a time in seconds (eg. 0.5)'), ]) 'messages' => _('Please enter a time in seconds (eg. 0.5)'), ])
->setValue($defaultFade) ->setValue($defaultFade);
;
$this->addElement($transition_fade); $this->addElement($transition_fade);
//Master username //Master username
@ -43,8 +40,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
->setAllowEmpty(true) ->setAllowEmpty(true)
->setLabel(_('Username:')) ->setLabel(_('Username:'))
->setFilters(['StringTrim']) ->setFilters(['StringTrim'])
->setValue(Application_Model_Preference::GetLiveStreamMasterUsername()) ->setValue(Application_Model_Preference::GetLiveStreamMasterUsername());
;
$this->addElement($master_username); $this->addElement($master_username);
//Master password //Master password
@ -59,8 +55,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
->setAllowEmpty(true) ->setAllowEmpty(true)
->setValue(Application_Model_Preference::GetLiveStreamMasterPassword()) ->setValue(Application_Model_Preference::GetLiveStreamMasterPassword())
->setLabel(_('Password:')) ->setLabel(_('Password:'))
->setFilters(['StringTrim']) ->setFilters(['StringTrim']);
;
$this->addElement($master_password); $this->addElement($master_password);
$masterSourceParams = parse_url(Application_Model_Preference::GetMasterDJSourceConnectionURL()); $masterSourceParams = parse_url(Application_Model_Preference::GetMasterDJSourceConnectionURL());
@ -69,8 +64,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$masterSourceHost = new Zend_Form_Element_Text('master_source_host'); $masterSourceHost = new Zend_Form_Element_Text('master_source_host');
$masterSourceHost->setLabel(_('Master Source Host:')) $masterSourceHost->setLabel(_('Master Source Host:'))
->setAttrib('readonly', true) ->setAttrib('readonly', true)
->setValue(Application_Model_Preference::GetMasterDJSourceConnectionURL()) ->setValue(Application_Model_Preference::GetMasterDJSourceConnectionURL());
;
$this->addElement($masterSourceHost); $this->addElement($masterSourceHost);
//liquidsoap harbor.input port //liquidsoap harbor.input port
@ -82,8 +76,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$masterSourcePort->setLabel(_('Master Source Port:')) $masterSourcePort->setLabel(_('Master Source Port:'))
->setValue($m_port) ->setValue($m_port)
->setValidators([$betweenValidator]) ->setValidators([$betweenValidator])
->addValidator('regex', false, ['pattern' => '/^[0-9]+$/', 'messages' => ['regexNotMatch' => _('Only numbers are allowed.')]]) ->addValidator('regex', false, ['pattern' => '/^[0-9]+$/', 'messages' => ['regexNotMatch' => _('Only numbers are allowed.')]]);
;
$this->addElement($masterSourcePort); $this->addElement($masterSourcePort);
@ -92,8 +85,7 @@ 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());
@ -102,8 +94,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$showSourceHost = new Zend_Form_Element_Text('show_source_host'); $showSourceHost = new Zend_Form_Element_Text('show_source_host');
$showSourceHost->setLabel(_('Show Source Host:')) $showSourceHost->setLabel(_('Show Source Host:'))
->setAttrib('readonly', true) ->setAttrib('readonly', true)
->setValue(Application_Model_Preference::GetLiveDJSourceConnectionURL()) ->setValue(Application_Model_Preference::GetLiveDJSourceConnectionURL());
;
$this->addElement($showSourceHost); $this->addElement($showSourceHost);
//liquidsoap harbor.input port //liquidsoap harbor.input port
@ -113,8 +104,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$showSourcePort->setLabel(_('Show Source Port:')) $showSourcePort->setLabel(_('Show Source Port:'))
->setValue($l_port) ->setValue($l_port)
->setValidators([$betweenValidator]) ->setValidators([$betweenValidator])
->addValidator('regex', false, ['pattern' => '/^[0-9]+$/', 'messages' => ['regexNotMatch' => _('Only numbers are allowed.')]]) ->addValidator('regex', false, ['pattern' => '/^[0-9]+$/', 'messages' => ['regexNotMatch' => _('Only numbers are allowed.')]]);
;
$this->addElement($showSourcePort); $this->addElement($showSourcePort);
$l_mount = Application_Model_StreamSetting::getDjLiveStreamMountPoint(); $l_mount = Application_Model_StreamSetting::getDjLiveStreamMountPoint();
@ -122,8 +112,7 @@ 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);
} }

View File

@ -44,8 +44,7 @@ class Application_Form_Login extends Zend_Form
->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'])
->setValidators(['NotEmpty']) ->setValidators(['NotEmpty']);
;
$this->addElement($username); $this->addElement($username);
// Add password element // Add password element

View File

@ -44,8 +44,7 @@ class Application_Form_PasswordRestore extends Zend_Form
$cancel->setLabel(_('Back')) $cancel->setLabel(_('Back'))
->setIgnore(true) ->setIgnore(true)
->setAttrib('onclick', 'window.location = ' . Zend_Controller_Front::getInstance()->getBaseUrl('login')) ->setAttrib('onclick', 'window.location = ' . Zend_Controller_Front::getInstance()->getBaseUrl('login'))
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$this->addElement($cancel); $this->addElement($cancel);
} }
} }

View File

@ -67,8 +67,7 @@ class Application_Form_Player extends Zend_Form_SubForm
$embedSrc->setAttrib('readonly', 'readonly'); $embedSrc->setAttrib('readonly', 'readonly');
$embedSrc->setAttrib('class', 'embed-player-text-box'); $embedSrc->setAttrib('class', 'embed-player-text-box');
$embedSrc->setAttrib('cols', '40') $embedSrc->setAttrib('cols', '40')
->setAttrib('rows', '4') ->setAttrib('rows', '4');
;
$embedSrc->setLabel(_('Embeddable code:')); $embedSrc->setLabel(_('Embeddable code:'));
$embedSrc->setDescription(_("Copy this code and paste it into your website's HTML to embed the player in your site.")); $embedSrc->setDescription(_("Copy this code and paste it into your website's HTML to embed the player in your site."));
$embedSrc->setValue('<iframe frameborder="0" width="280" height="216" src="' . Application_Common_HTTPHelper::getStationUrl() . 'embed/player?stream=auto&title=Now Playing"></iframe>'); $embedSrc->setValue('<iframe frameborder="0" width="280" height="216" src="' . Application_Common_HTTPHelper::getStationUrl() . 'embed/player?stream=auto&title=Now Playing"></iframe>');

View File

@ -20,8 +20,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
->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);
@ -35,8 +34,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
'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);
@ -50,8 +48,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
->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);
@ -65,8 +62,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
'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);
@ -81,8 +77,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
if ($user->getType() === 'H') { if ($user->getType() === 'H') {
$myShows = new Zend_Form_Element_Checkbox('sb_my_shows'); $myShows = new Zend_Form_Element_Checkbox('sb_my_shows');
$myShows->setLabel(_('All My Shows:')) $myShows->setLabel(_('All My Shows:'))
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$this->addElement($myShows); $this->addElement($myShows);
} }
} }
@ -98,8 +93,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
$shows = CcShowQuery::create() $shows = CcShowQuery::create()
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND) ->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
->orderByDbName() ->orderByDbName()
->find() ->find();
;
foreach ($shows as $show) { foreach ($shows as $show) {
$showNames[$show->getDbId()] = $show->getDbName(); $showNames[$show->getDbId()] = $show->getDbName();

View File

@ -18,8 +18,7 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
->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,8 +32,7 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
'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);
@ -48,8 +46,7 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
->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);
@ -63,8 +60,7 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
'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);
} }

View File

@ -271,8 +271,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
'dynamic' => _('Dynamic'), 'dynamic' => _('Dynamic'),
'static' => _('Static'), 'static' => _('Static'),
]) ])
->setValue($blockType) ->setValue($blockType);
;
$this->addElement($spType); $this->addElement($spType);
$bl = new Application_Model_Block($p_blockId); $bl = new Application_Model_Block($p_blockId);
@ -338,8 +337,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$criteria->setAttrib('class', 'input_select sp_input_select' . $invisible) $criteria->setAttrib('class', 'input_select sp_input_select' . $invisible)
->setValue('Select criteria') ->setValue('Select criteria')
->setDecorators(['viewHelper']) ->setDecorators(['viewHelper'])
->setMultiOptions($this->getCriteriaOptions()) ->setMultiOptions($this->getCriteriaOptions());
;
// if this isn't the first criteria and there isn't an entry for it already disable it // if this isn't the first criteria and there isn't an entry for it already disable it
if ($i != 0 && !isset($criteriaKeys[$i])) { if ($i != 0 && !isset($criteriaKeys[$i])) {
$criteria->setAttrib('disabled', 'disabled'); $criteria->setAttrib('disabled', 'disabled');
@ -359,8 +357,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$criteriaModifers = new Zend_Form_Element_Select('sp_criteria_modifier_' . $i . '_' . $j); $criteriaModifers = new Zend_Form_Element_Select('sp_criteria_modifier_' . $i . '_' . $j);
$criteriaModifers->setValue('Select modifier') $criteriaModifers->setValue('Select modifier')
->setAttrib('class', 'input_select sp_input_select') ->setAttrib('class', 'input_select sp_input_select')
->setDecorators(['viewHelper']) ->setDecorators(['viewHelper']);
;
if ($i != 0 && !isset($criteriaKeys[$i])) { if ($i != 0 && !isset($criteriaKeys[$i])) {
$criteriaModifers->setAttrib('disabled', 'disabled'); $criteriaModifers->setAttrib('disabled', 'disabled');
} }
@ -445,8 +442,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
// DATETIME SELECT // DATETIME SELECT
$criteriaDatetimeSelect = new Zend_Form_Element_Select('sp_criteria_datetime_select_' . $i . '_' . $j); $criteriaDatetimeSelect = new Zend_Form_Element_Select('sp_criteria_datetime_select_' . $i . '_' . $j);
$criteriaDatetimeSelect->setAttrib('class', 'input_select sp_input_select') $criteriaDatetimeSelect->setAttrib('class', 'input_select sp_input_select')
->setDecorators(['viewHelper']) ->setDecorators(['viewHelper']);
;
if (isset($criteriaKeys[$i]) && $relativeDateTime) { if (isset($criteriaKeys[$i]) && $relativeDateTime) {
$criteriaDatetimeSelect->setAttrib('enabled', 'enabled'); $criteriaDatetimeSelect->setAttrib('enabled', 'enabled');
} else { } else {
@ -473,8 +469,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
// EXTRA // EXTRA
$criteriaExtra = new Zend_Form_Element_Text('sp_criteria_extra_' . $i . '_' . $j); $criteriaExtra = new Zend_Form_Element_Text('sp_criteria_extra_' . $i . '_' . $j);
$criteriaExtra->setAttrib('class', 'input_text sp_extra_input_text') $criteriaExtra->setAttrib('class', 'input_text sp_extra_input_text')
->setDecorators(['viewHelper']) ->setDecorators(['viewHelper']);
;
if (isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['extra'])) { if (isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['extra'])) {
// need to check if this is a relative date time value // need to check if this is a relative date time value
if (isset($criteriaType) && $criteriaType == 'd' && $modifierTest == 'between') { if (isset($criteriaType) && $criteriaType == 'd' && $modifierTest == 'between') {
@ -492,8 +487,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$criteriaExtraDatetimeSelect = new Zend_Form_Element_Select('sp_criteria_extra_datetime_select_' . $i . '_' . $j); $criteriaExtraDatetimeSelect = new Zend_Form_Element_Select('sp_criteria_extra_datetime_select_' . $i . '_' . $j);
$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 (isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['extra'])
&& $modifierTest == 'between') { && $modifierTest == 'between') {
@ -516,8 +510,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$repeatTracks = new Zend_Form_Element_Checkbox('sp_repeat_tracks'); $repeatTracks = new Zend_Form_Element_Checkbox('sp_repeat_tracks');
$repeatTracks->setDecorators(['viewHelper']) $repeatTracks->setDecorators(['viewHelper'])
->setLabel(_('Allow Repeated Tracks:')) ->setLabel(_('Allow Repeated Tracks:'));
;
if (isset($storedCrit['repeat_tracks'])) { if (isset($storedCrit['repeat_tracks'])) {
$repeatTracks->setChecked($storedCrit['repeat_tracks']['value'] == 1 ? true : false); $repeatTracks->setChecked($storedCrit['repeat_tracks']['value'] == 1 ? true : false);
} }
@ -525,8 +518,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$overflowTracks = new Zend_Form_Element_Checkbox('sp_overflow_tracks'); $overflowTracks = new Zend_Form_Element_Checkbox('sp_overflow_tracks');
$overflowTracks->setDecorators(['viewHelper']) $overflowTracks->setDecorators(['viewHelper'])
->setLabel(_('Allow last track to exceed time limit:')) ->setLabel(_('Allow last track to exceed time limit:'));
;
if (isset($storedCrit['overflow_tracks'])) { if (isset($storedCrit['overflow_tracks'])) {
$overflowTracks->setChecked($storedCrit['overflow_tracks']['value'] == 1); $overflowTracks->setChecked($storedCrit['overflow_tracks']['value'] == 1);
} }
@ -536,8 +528,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$sort->setAttrib('class', 'sp_input_select') $sort->setAttrib('class', 'sp_input_select')
->setDecorators(['viewHelper']) ->setDecorators(['viewHelper'])
->setLabel(_('Sort Tracks:')) ->setLabel(_('Sort Tracks:'))
->setMultiOptions($this->getSortOptions()) ->setMultiOptions($this->getSortOptions());
;
if (isset($storedCrit['sort'])) { if (isset($storedCrit['sort'])) {
$sort->setValue($storedCrit['sort']['value']); $sort->setValue($storedCrit['sort']['value']);
} }
@ -546,8 +537,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$limit = new Zend_Form_Element_Select('sp_limit_options'); $limit = new Zend_Form_Element_Select('sp_limit_options');
$limit->setAttrib('class', 'sp_input_select') $limit->setAttrib('class', 'sp_input_select')
->setDecorators(['viewHelper']) ->setDecorators(['viewHelper'])
->setMultiOptions($this->getLimitOptions()) ->setMultiOptions($this->getLimitOptions());
;
if (isset($storedCrit['limit'])) { if (isset($storedCrit['limit'])) {
$limit->setValue($storedCrit['limit']['modifier']); $limit->setValue($storedCrit['limit']['modifier']);
} }
@ -556,8 +546,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$limitValue = new Zend_Form_Element_Text('sp_limit_value'); $limitValue = new Zend_Form_Element_Text('sp_limit_value');
$limitValue->setAttrib('class', 'sp_input_text_limit') $limitValue->setAttrib('class', 'sp_input_text_limit')
->setLabel(_('Limit to:')) ->setLabel(_('Limit to:'))
->setDecorators(['viewHelper']) ->setDecorators(['viewHelper']);
;
$this->addElement($limitValue); $this->addElement($limitValue);
if (isset($storedCrit['limit'])) { if (isset($storedCrit['limit'])) {
$limitValue->setValue($storedCrit['limit']['value']); $limitValue->setValue($storedCrit['limit']['value']);
@ -663,8 +652,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$criteria->setAttrib('class', 'input_select sp_input_select sp-invisible') $criteria->setAttrib('class', 'input_select sp_input_select sp-invisible')
->setValue('Select criteria') ->setValue('Select criteria')
->setDecorators(['viewHelper']) ->setDecorators(['viewHelper'])
->setMultiOptions($this->getCriteriaOptions()) ->setMultiOptions($this->getCriteriaOptions());
;
$criteriaType = $this->criteriaTypes[$modInfo['sp_criteria_field']]; $criteriaType = $this->criteriaTypes[$modInfo['sp_criteria_field']];
$criteria->setValue($this->getCriteriaOptions($modInfo['sp_criteria_field'])); $criteria->setValue($this->getCriteriaOptions($modInfo['sp_criteria_field']));
@ -674,8 +662,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$criteriaModifers = new Zend_Form_Element_Select('sp_criteria_modifier_' . $critKey . '_' . $modKey); $criteriaModifers = new Zend_Form_Element_Select('sp_criteria_modifier_' . $critKey . '_' . $modKey);
$criteriaModifers->setValue('Select modifier') $criteriaModifers->setValue('Select modifier')
->setAttrib('class', 'input_select sp_input_select') ->setAttrib('class', 'input_select sp_input_select')
->setDecorators(['viewHelper']) ->setDecorators(['viewHelper']);
;
if ($criteriaType == 's') { if ($criteriaType == 's') {
$criteriaModifers->setMultiOptions($this->getStringCriteriaOptions()); $criteriaModifers->setMultiOptions($this->getStringCriteriaOptions());
@ -694,16 +681,14 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
// VALUE // VALUE
$criteriaValue = new Zend_Form_Element_Text('sp_criteria_value_' . $critKey . '_' . $modKey); $criteriaValue = new Zend_Form_Element_Text('sp_criteria_value_' . $critKey . '_' . $modKey);
$criteriaValue->setAttrib('class', 'input_text sp_input_text') $criteriaValue->setAttrib('class', 'input_text sp_input_text')
->setDecorators(['viewHelper']) ->setDecorators(['viewHelper']);
;
$criteriaValue->setValue($modInfo['sp_criteria_value']); $criteriaValue->setValue($modInfo['sp_criteria_value']);
$this->addElement($criteriaValue); $this->addElement($criteriaValue);
// DATETIME UNIT SELECT // DATETIME UNIT SELECT
$criteriaDatetimeSelect = new Zend_Form_Element_Select('sp_criteria_datetime_select_' . $critKey . '_' . $modKey); $criteriaDatetimeSelect = new Zend_Form_Element_Select('sp_criteria_datetime_select_' . $critKey . '_' . $modKey);
$criteriaDatetimeSelect->setAttrib('class', 'input_select sp_input_select') $criteriaDatetimeSelect->setAttrib('class', 'input_select sp_input_select')
->setDecorators(['viewHelper']) ->setDecorators(['viewHelper']);
;
if ($this->enableDateTimeUnit($criteriaValue->getValue())) { if ($this->enableDateTimeUnit($criteriaValue->getValue())) {
$criteriaDatetimeSelect->setAttrib('enabled', 'enabled'); $criteriaDatetimeSelect->setAttrib('enabled', 'enabled');
$criteriaDatetimeSelect->setAttrib('disabled', null); $criteriaDatetimeSelect->setAttrib('disabled', null);
@ -715,8 +700,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
// EXTRA // EXTRA
$criteriaExtra = new Zend_Form_Element_Text('sp_criteria_extra_' . $critKey . '_' . $modKey); $criteriaExtra = new Zend_Form_Element_Text('sp_criteria_extra_' . $critKey . '_' . $modKey);
$criteriaExtra->setAttrib('class', 'input_text sp_extra_input_text') $criteriaExtra->setAttrib('class', 'input_text sp_extra_input_text')
->setDecorators(['viewHelper']) ->setDecorators(['viewHelper']);
;
if (isset($modInfo['sp_criteria_extra'])) { if (isset($modInfo['sp_criteria_extra'])) {
$criteriaExtra->setValue($modInfo['sp_criteria_extra']); $criteriaExtra->setValue($modInfo['sp_criteria_extra']);
$criteriaValue->setAttrib('class', 'input_text sp_extra_input_text'); $criteriaValue->setAttrib('class', 'input_text sp_extra_input_text');
@ -729,8 +713,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$criteriaExtraDatetimeSelect = new Zend_Form_Element_Select('sp_criteria_extra_datetime_select_' . $critKey . '_' . $modKey); $criteriaExtraDatetimeSelect = new Zend_Form_Element_Select('sp_criteria_extra_datetime_select_' . $critKey . '_' . $modKey);
$criteriaExtraDatetimeSelect->setAttrib('class', 'input_select sp_input_select') $criteriaExtraDatetimeSelect->setAttrib('class', 'input_select sp_input_select')
->setDecorators(['viewHelper']) ->setDecorators(['viewHelper']);
;
if ($criteriaValue->getValue() == 'between') { if ($criteriaValue->getValue() == 'between') {
$criteriaExtraDatetimeSelect->setAttrib('enabled', 'enabled'); $criteriaExtraDatetimeSelect->setAttrib('enabled', 'enabled');
$criteriaExtraDatetimeSelect->setAttrib('disabled', null); $criteriaExtraDatetimeSelect->setAttrib('disabled', null);

View File

@ -13,8 +13,7 @@ class Application_Form_StationPodcast extends Zend_Form
$csrf_element->setValue($csrf_namespace->authtoken) $csrf_element->setValue($csrf_namespace->authtoken)
->setRequired('true') ->setRequired('true')
->removeDecorator('HtmlTag') ->removeDecorator('HtmlTag')
->removeDecorator('Label') ->removeDecorator('Label');
;
$this->addElement($csrf_element); $this->addElement($csrf_element);
} }
} }

View File

@ -25,8 +25,7 @@ class Application_Form_StreamSetting extends Zend_Form
$output_sound_device->setLabel(_('Hardware Audio Output:')) $output_sound_device->setLabel(_('Hardware Audio Output:'))
->setRequired(false) ->setRequired(false)
->setValue(($setting['output_sound_device'] == 'true') ? 1 : 0) ->setValue(($setting['output_sound_device'] == 'true') ? 1 : 0)
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$this->addElement($output_sound_device); $this->addElement($output_sound_device);
$output_sound_device_type = new Zend_Form_Element_Select('output_sound_device_type'); $output_sound_device_type = new Zend_Form_Element_Select('output_sound_device_type');
@ -39,16 +38,14 @@ class Application_Form_StreamSetting extends Zend_Form
'Pulseaudio' => _('Pulseaudio'), 'Pulseaudio' => _('Pulseaudio'),
'Jack' => _('Jack'), ]) 'Jack' => _('Jack'), ])
->setValue(isset($setting['output_sound_device_type']) ? $setting['output_sound_device_type'] : 0) ->setValue(isset($setting['output_sound_device_type']) ? $setting['output_sound_device_type'] : 0)
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$this->addElement($output_sound_device_type); $this->addElement($output_sound_device_type);
$icecast_vorbis_metadata = new Zend_Form_Element_Checkbox('icecast_vorbis_metadata'); $icecast_vorbis_metadata = new Zend_Form_Element_Checkbox('icecast_vorbis_metadata');
$icecast_vorbis_metadata->setLabel(_('Icecast Vorbis Metadata')) $icecast_vorbis_metadata->setLabel(_('Icecast Vorbis Metadata'))
->setRequired(false) ->setRequired(false)
->setValue(($setting['icecast_vorbis_metadata'] == 'true') ? 1 : 0) ->setValue(($setting['icecast_vorbis_metadata'] == 'true') ? 1 : 0)
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
if (Application_Model_Preference::GetEnableStreamConf() == 'false') { if (Application_Model_Preference::GetEnableStreamConf() == 'false') {
$icecast_vorbis_metadata->setAttrib('readonly', true); $icecast_vorbis_metadata->setAttrib('readonly', true);
} }
@ -66,23 +63,20 @@ class Application_Form_StreamSetting extends Zend_Form
$offAirMeta = new Zend_Form_Element_Text('offAirMeta'); $offAirMeta = new Zend_Form_Element_Text('offAirMeta');
$offAirMeta->setLabel(_('Off Air Metadata')) $offAirMeta->setLabel(_('Off Air Metadata'))
->setValue(Application_Model_StreamSetting::getOffAirMeta()) ->setValue(Application_Model_StreamSetting::getOffAirMeta())
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$this->addElement($offAirMeta); $this->addElement($offAirMeta);
$enable_replay_gain = new Zend_Form_Element_Checkbox('enableReplayGain'); $enable_replay_gain = new Zend_Form_Element_Checkbox('enableReplayGain');
$enable_replay_gain->setLabel(_('Enable Replay Gain')) $enable_replay_gain->setLabel(_('Enable Replay Gain'))
->setValue(Application_Model_Preference::GetEnableReplayGain()) ->setValue(Application_Model_Preference::GetEnableReplayGain())
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$this->addElement($enable_replay_gain); $this->addElement($enable_replay_gain);
$replay_gain = new Zend_Form_Element_Hidden('replayGainModifier'); $replay_gain = new Zend_Form_Element_Hidden('replayGainModifier');
$replay_gain->setLabel(_('Replay Gain Modifier')) $replay_gain->setLabel(_('Replay Gain Modifier'))
->setValue(Application_Model_Preference::getReplayGainModifier()) ->setValue(Application_Model_Preference::getReplayGainModifier())
->setAttribs(['style' => 'border: 0; color: #f6931f; font-weight: bold;']) ->setAttribs(['style' => 'border: 0; color: #f6931f; font-weight: bold;'])
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$this->addElement($replay_gain); $this->addElement($replay_gain);
$custom = Application_Model_Preference::getUsingCustomStreamSettings(); $custom = Application_Model_Preference::getUsingCustomStreamSettings();

View File

@ -51,8 +51,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
$enable = new Zend_Form_Element_Checkbox('enable'); $enable = new Zend_Form_Element_Checkbox('enable');
$enable->setLabel(_('Enabled:')) $enable->setLabel(_('Enabled:'))
->setValue($setting[$prefix . '_enable'] == 'true' ? 1 : 0) ->setValue($setting[$prefix . '_enable'] == 'true' ? 1 : 0)
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$this->addElement($enable); $this->addElement($enable);
static::$customizable[] = $enable->getName(); static::$customizable[] = $enable->getName();
@ -67,8 +66,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
$type->setLabel(_('Stream Type:')) $type->setLabel(_('Stream Type:'))
->setMultiOptions($stream_types) ->setMultiOptions($stream_types)
->setValue(isset($setting[$prefix . '_type']) ? $setting[$prefix . '_type'] : 0) ->setValue(isset($setting[$prefix . '_type']) ? $setting[$prefix . '_type'] : 0)
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$this->addElement($type); $this->addElement($type);
static::$customizable[] = $type->getName(); static::$customizable[] = $type->getName();
@ -76,8 +74,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
$bitrate->setLabel(_('Bit Rate:')) $bitrate->setLabel(_('Bit Rate:'))
->setMultiOptions($stream_bitrates) ->setMultiOptions($stream_bitrates)
->setValue(isset($setting[$prefix . '_bitrate']) ? $setting[$prefix . '_bitrate'] : 0) ->setValue(isset($setting[$prefix . '_bitrate']) ? $setting[$prefix . '_bitrate'] : 0)
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$this->addElement($bitrate); $this->addElement($bitrate);
static::$customizable[] = $bitrate->getName(); static::$customizable[] = $bitrate->getName();
@ -86,16 +83,14 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
->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);
$channels = new Zend_Form_Element_Select('channels'); $channels = new Zend_Form_Element_Select('channels');
$channels->setLabel(_('Channels:')) $channels->setLabel(_('Channels:'))
->setMultiOptions(['mono' => _('1 - Mono'), 'stereo' => _('2 - Stereo')]) ->setMultiOptions(['mono' => _('1 - Mono'), 'stereo' => _('2 - Stereo')])
->setValue(isset($setting[$prefix . '_channels']) ? $setting[$prefix . '_channels'] : 'stereo') ->setValue(isset($setting[$prefix . '_channels']) ? $setting[$prefix . '_channels'] : 'stereo')
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$this->addElement($channels); $this->addElement($channels);
static::$customizable[] = $channels->getName(); static::$customizable[] = $channels->getName();
@ -105,8 +100,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
(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);
@ -116,8 +110,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
(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']);
;
$this->addElement($port); $this->addElement($port);
$pass = new Zend_Form_Element_Text('pass'); $pass = new Zend_Form_Element_Text('pass');
@ -126,16 +119,14 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
(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);
$genre = new Zend_Form_Element_Text('genre'); $genre = new Zend_Form_Element_Text('genre');
$genre->setLabel(_('Genre')) $genre->setLabel(_('Genre'))
->setValue(isset($setting[$prefix . '_genre']) ? $setting[$prefix . '_genre'] : '') ->setValue(isset($setting[$prefix . '_genre']) ? $setting[$prefix . '_genre'] : '')
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$this->addElement($genre); $this->addElement($genre);
$url = new Zend_Form_Element_Text('url'); $url = new Zend_Form_Element_Text('url');
@ -143,23 +134,20 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
->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);
$name = new Zend_Form_Element_Text('name'); $name = new Zend_Form_Element_Text('name');
$name->setLabel(_('Name')) $name->setLabel(_('Name'))
->setValue(isset($setting[$prefix . '_name']) ? $setting[$prefix . '_name'] : '') ->setValue(isset($setting[$prefix . '_name']) ? $setting[$prefix . '_name'] : '')
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$this->addElement($name); $this->addElement($name);
$description = new Zend_Form_Element_Text('description'); $description = new Zend_Form_Element_Text('description');
$description->setLabel(_('Description')) $description->setLabel(_('Description'))
->setValue(isset($setting[$prefix . '_description']) ? $setting[$prefix . '_description'] : '') ->setValue(isset($setting[$prefix . '_description']) ? $setting[$prefix . '_description'] : '')
->setDecorators(['ViewHelper']) ->setDecorators(['ViewHelper']);
;
$this->addElement($description); $this->addElement($description);
$mount = new Zend_Form_Element_Text('mount'); $mount = new Zend_Form_Element_Text('mount');
@ -168,8 +156,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
(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);
@ -179,8 +166,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
(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);
@ -189,8 +175,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
->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);
@ -199,8 +184,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
->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);

View File

@ -45,8 +45,7 @@ class Application_Model_Auth
CcSubjsTokenQuery::create() CcSubjsTokenQuery::create()
->filterByDbAction($action) ->filterByDbAction($action)
->filterByDbUserId($user->getDbId()) ->filterByDbUserId($user->getDbId())
->delete() ->delete();
;
} }
public function checkToken($user_id, $token, $action) public function checkToken($user_id, $token, $action)
@ -57,8 +56,7 @@ class Application_Model_Auth
->filterByDbAction($action) ->filterByDbAction($action)
->filterByDbUserId($user_id) ->filterByDbUserId($user_id)
->filterByDbToken(sha1($token . $salt)) ->filterByDbToken(sha1($token . $salt))
->findOne() ->findOne();
;
if (empty($token_info)) { if (empty($token_info)) {
return false; return false;
@ -96,8 +94,7 @@ class Application_Model_Auth
$authAdapter->setTableName('cc_subjs') $authAdapter->setTableName('cc_subjs')
->setIdentityColumn('login') ->setIdentityColumn('login')
->setCredentialColumn('pass') ->setCredentialColumn('pass')
->setCredentialTreatment('MD5(?)') ->setCredentialTreatment('MD5(?)');
;
return $authAdapter; return $authAdapter;
} }

View File

@ -458,8 +458,7 @@ SQL;
->filterByDbBlockId($this->id) ->filterByDbBlockId($this->id)
->filterByDbPosition($pos, Criteria::GREATER_EQUAL) ->filterByDbPosition($pos, Criteria::GREATER_EQUAL)
->orderByDbPosition() ->orderByDbPosition()
->find($this->con) ->find($this->con);
;
Logging::info('Adding to block'); Logging::info('Adding to block');
Logging::info("at position {$pos}"); Logging::info("at position {$pos}");
@ -475,16 +474,14 @@ SQL;
$contentsToUpdate = CcBlockcontentsQuery::create() $contentsToUpdate = CcBlockcontentsQuery::create()
->filterByDbBlockId($this->id) ->filterByDbBlockId($this->id)
->orderByDbPosition() ->orderByDbPosition()
->find($this->con) ->find($this->con);
;
} }
$contentsToUpdate = CcBlockcontentsQuery::create() $contentsToUpdate = CcBlockcontentsQuery::create()
->filterByDbBlockId($this->id) ->filterByDbBlockId($this->id)
->filterByDbPosition($pos, Criteria::GREATER_EQUAL) ->filterByDbPosition($pos, Criteria::GREATER_EQUAL)
->orderByDbPosition() ->orderByDbPosition()
->find($this->con) ->find($this->con);
;
Logging::info('Adding to block'); Logging::info('Adding to block');
Logging::info("at position {$pos}"); Logging::info("at position {$pos}");
@ -550,15 +547,13 @@ SQL;
$contentsToMove = CcBlockcontentsQuery::create() $contentsToMove = CcBlockcontentsQuery::create()
->filterByDbId($p_items, Criteria::IN) ->filterByDbId($p_items, Criteria::IN)
->orderByDbPosition() ->orderByDbPosition()
->find($this->con) ->find($this->con);
;
$otherContent = CcBlockcontentsQuery::create() $otherContent = CcBlockcontentsQuery::create()
->filterByDbId($p_items, Criteria::NOT_IN) ->filterByDbId($p_items, Criteria::NOT_IN)
->filterByDbBlockId($this->id) ->filterByDbBlockId($this->id)
->orderByDbPosition() ->orderByDbPosition()
->find($this->con) ->find($this->con);
;
$pos = 0; $pos = 0;
//moving items to beginning of the block. //moving items to beginning of the block.
@ -625,13 +620,11 @@ SQL;
$itemsToDelete = CcBlockcontentsQuery::create() $itemsToDelete = CcBlockcontentsQuery::create()
->filterByPrimaryKeys($p_items) ->filterByPrimaryKeys($p_items)
->filterByDbFileId(null, Criteria::NOT_EQUAL) ->filterByDbFileId(null, Criteria::NOT_EQUAL)
->find($this->con) ->find($this->con);
;
CcBlockcontentsQuery::create() CcBlockcontentsQuery::create()
->findPKs($p_items) ->findPKs($p_items)
->delete($this->con) ->delete($this->con);
;
// now that the items have been deleted we can update the // now that the items have been deleted we can update the
// is_playlist flag in cc_files // is_playlist flag in cc_files
@ -640,8 +633,7 @@ SQL;
$contents = CcBlockcontentsQuery::create() $contents = CcBlockcontentsQuery::create()
->filterByDbBlockId($this->id) ->filterByDbBlockId($this->id)
->orderByDbPosition() ->orderByDbPosition()
->find($this->con) ->find($this->con);
;
//reset the positions of the remaining items. //reset the positions of the remaining items.
for ($i = 0; $i < count($contents); ++$i) { for ($i = 0; $i < count($contents); ++$i) {
@ -670,8 +662,7 @@ SQL;
->joinWith(CcFilesPeer::OM_CLASS) ->joinWith(CcFilesPeer::OM_CLASS)
->filterByDbBlockId($this->id) ->filterByDbBlockId($this->id)
->filterByDbPosition($pos) ->filterByDbPosition($pos)
->findOne() ->findOne();
;
//Propel returns values in form 00.000000 format which is for only seconds. //Propel returns values in form 00.000000 format which is for only seconds.
//We only want to display 1 decimal //We only want to display 1 decimal
@ -801,8 +792,7 @@ SQL;
$row = CcBlockcontentsQuery::create() $row = CcBlockcontentsQuery::create()
->filterByDbBlockId($this->id) ->filterByDbBlockId($this->id)
->filterByDbPosition(0) ->filterByDbPosition(0)
->findOne($this->con) ->findOne($this->con);
;
$this->changeFadeInfo($row->getDbId(), $fadein, null); $this->changeFadeInfo($row->getDbId(), $fadein, null);
} }
@ -812,8 +802,7 @@ SQL;
$row = CcBlockcontentsQuery::create() $row = CcBlockcontentsQuery::create()
->filterByDbBlockId($this->id) ->filterByDbBlockId($this->id)
->filterByDbPosition($this->getSize() - 1) ->filterByDbPosition($this->getSize() - 1)
->findOne($this->con) ->findOne($this->con);
;
$this->changeFadeInfo($row->getDbId(), null, $fadeout); $this->changeFadeInfo($row->getDbId(), null, $fadeout);
} }
@ -848,8 +837,7 @@ SQL;
$row = CcBlockcontentsQuery::create() $row = CcBlockcontentsQuery::create()
->joinWith(CcFilesPeer::OM_CLASS) ->joinWith(CcFilesPeer::OM_CLASS)
->filterByPrimaryKey($id) ->filterByPrimaryKey($id)
->findOne($this->con) ->findOne($this->con);
;
if (is_null($row)) { if (is_null($row)) {
throw new Exception('Block item does not exist.'); throw new Exception('Block item does not exist.');
@ -1061,8 +1049,7 @@ SQL;
$itemsToDelete = CcBlockcontentsQuery::create() $itemsToDelete = CcBlockcontentsQuery::create()
->filterByDbBlockId($p_ids) ->filterByDbBlockId($p_ids)
->filterByDbFileId(null, Criteria::NOT_EQUAL) ->filterByDbFileId(null, Criteria::NOT_EQUAL)
->find() ->find();
;
$updateIsPlaylistFlag = false; $updateIsPlaylistFlag = false;
@ -1115,8 +1102,7 @@ SQL;
$itemsToDelete = CcBlockcontentsQuery::create() $itemsToDelete = CcBlockcontentsQuery::create()
->filterByDbBlockId($this->id) ->filterByDbBlockId($this->id)
->filterByDbFileId(null, Criteria::NOT_EQUAL) ->filterByDbFileId(null, Criteria::NOT_EQUAL)
->find() ->find();
;
CcBlockcontentsQuery::create()->findByDbBlockId($this->id)->delete(); CcBlockcontentsQuery::create()->findByDbBlockId($this->id)->delete();
@ -1141,8 +1127,7 @@ SQL;
$contents = CcBlockcontentsQuery::create() $contents = CcBlockcontentsQuery::create()
->filterByDbBlockId($this->id) ->filterByDbBlockId($this->id)
->orderByDbPosition() ->orderByDbPosition()
->find() ->find();
;
$shuffledPos = range(0, count($contents) - 1); $shuffledPos = range(0, count($contents) - 1);
shuffle($shuffledPos); shuffle($shuffledPos);
foreach ($contents as $item) { foreach ($contents as $item) {
@ -1245,8 +1230,7 @@ SQL;
$qry->setDbCriteria($field) $qry->setDbCriteria($field)
->setDbModifier($d['sp_criteria_modifier']) ->setDbModifier($d['sp_criteria_modifier'])
->setDbValue($value) ->setDbValue($value)
->setDbBlockId($this->id) ->setDbBlockId($this->id);
;
if (isset($d['sp_criteria_extra'])) { if (isset($d['sp_criteria_extra'])) {
if ($field == 'utime' || $field == 'mtime' || $field == 'lptime') { if ($field == 'utime' || $field == 'mtime' || $field == 'lptime') {
@ -1276,8 +1260,7 @@ SQL;
->setDbModifier('N/A') ->setDbModifier('N/A')
->setDbValue($p_criteriaData['etc']['sp_sort_options']) ->setDbValue($p_criteriaData['etc']['sp_sort_options'])
->setDbBlockId($this->id) ->setDbBlockId($this->id)
->save() ->save();
;
// insert limit info // insert limit info
$qry = new CcBlockcriteria(); $qry = new CcBlockcriteria();
@ -1285,8 +1268,7 @@ SQL;
->setDbModifier($p_criteriaData['etc']['sp_limit_options']) ->setDbModifier($p_criteriaData['etc']['sp_limit_options'])
->setDbValue($p_criteriaData['etc']['sp_limit_value']) ->setDbValue($p_criteriaData['etc']['sp_limit_value'])
->setDbBlockId($this->id) ->setDbBlockId($this->id)
->save() ->save();
;
// insert repeat track option // insert repeat track option
$qry = new CcBlockcriteria(); $qry = new CcBlockcriteria();
@ -1294,8 +1276,7 @@ SQL;
->setDbModifier('N/A') ->setDbModifier('N/A')
->setDbValue($p_criteriaData['etc']['sp_repeat_tracks']) ->setDbValue($p_criteriaData['etc']['sp_repeat_tracks'])
->setDbBlockId($this->id) ->setDbBlockId($this->id)
->save() ->save();
;
// insert overflow track option // insert overflow track option
$qry = new CcBlockcriteria(); $qry = new CcBlockcriteria();
@ -1303,8 +1284,7 @@ SQL;
->setDbModifier('N/A') ->setDbModifier('N/A')
->setDbValue($p_criteriaData['etc']['sp_overflow_tracks']) ->setDbValue($p_criteriaData['etc']['sp_overflow_tracks'])
->setDbBlockId($this->id) ->setDbBlockId($this->id)
->save() ->save();
;
} }
/** /**

View File

@ -39,13 +39,11 @@ class Application_Model_Library
$playlists = CcPlaylistQuery::create() $playlists = CcPlaylistQuery::create()
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND) ->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
->orderByname() ->orderByname()
->find() ->find();
;
} else { } else {
$playlists = CcPlaylistQuery::create() $playlists = CcPlaylistQuery::create()
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND) ->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
->find() ->find();
;
} }
foreach ($playlists as $playlist) { foreach ($playlists as $playlist) {
$playlistNames[$playlist->getDbId()] = $playlist->getDbName(); $playlistNames[$playlist->getDbId()] = $playlist->getDbName();

View File

@ -274,23 +274,20 @@ SQL;
//convert "linked" files (Airtime <= 1.8.2) to watched files. //convert "linked" files (Airtime <= 1.8.2) to watched files.
$propel_link_dir = CcMusicDirsQuery::create() $propel_link_dir = CcMusicDirsQuery::create()
->filterByType('link') ->filterByType('link')
->findOne() ->findOne();
;
//see if any linked files exist. //see if any linked files exist.
if (isset($propel_link_dir)) { if (isset($propel_link_dir)) {
//newly added watched directory object //newly added watched directory object
$propel_new_watch = CcMusicDirsQuery::create() $propel_new_watch = CcMusicDirsQuery::create()
->filterByDirectory(Application_Common_OsPath::normpath($p_path) . '/') ->filterByDirectory(Application_Common_OsPath::normpath($p_path) . '/')
->findOne() ->findOne();
;
//any files of the deprecated "link" type. //any files of the deprecated "link" type.
$link_files = CcFilesQuery::create() $link_files = CcFilesQuery::create()
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND) ->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
->filterByDbDirectory($propel_link_dir->getId()) ->filterByDbDirectory($propel_link_dir->getId())
->find() ->find();
;
$newly_watched_dir = $propel_new_watch->getDirectory(); $newly_watched_dir = $propel_new_watch->getDirectory();
@ -330,8 +327,7 @@ SQL;
{ {
$dir = CcMusicDirsQuery::create() $dir = CcMusicDirsQuery::create()
->filterByDirectory($p_path) ->filterByDirectory($p_path)
->findOne() ->findOne();
;
if ($dir == null) { if ($dir == null) {
return null; return null;
} }
@ -350,8 +346,7 @@ SQL;
$result = []; $result = [];
$dirs = CcMusicDirsQuery::create() $dirs = CcMusicDirsQuery::create()
->filterByType('watched') ->filterByType('watched');
;
if ($exists !== null) { if ($exists !== null) {
$dirs = $dirs->filterByExists($exists); $dirs = $dirs->filterByExists($exists);
} }
@ -371,8 +366,7 @@ SQL;
{ {
$dir = CcMusicDirsQuery::create() $dir = CcMusicDirsQuery::create()
->filterByType('stor') ->filterByType('stor')
->findOne() ->findOne();
;
return new Application_Model_MusicDir($dir); return new Application_Model_MusicDir($dir);
} }
@ -412,8 +406,7 @@ SQL;
->filterByType(['watched', 'stor']) ->filterByType(['watched', 'stor'])
->filterByExists(true) ->filterByExists(true)
->filterByWatched(true) ->filterByWatched(true)
->find() ->find();
;
foreach ($dirs as $dir) { foreach ($dirs as $dir) {
$directory = $dir->getDirectory(); $directory = $dir->getDirectory();

View File

@ -465,8 +465,7 @@ SQL;
->filterByDbPlaylistId($this->id) ->filterByDbPlaylistId($this->id)
->filterByDbPosition($pos, Criteria::GREATER_EQUAL) ->filterByDbPosition($pos, Criteria::GREATER_EQUAL)
->orderByDbPosition() ->orderByDbPosition()
->find($this->con) ->find($this->con);
;
} else { } else {
//add to the end of the playlist //add to the end of the playlist
if ($addType == 'after') { if ($addType == 'after') {
@ -479,16 +478,14 @@ SQL;
$contentsToUpdate = CcPlaylistcontentsQuery::create() $contentsToUpdate = CcPlaylistcontentsQuery::create()
->filterByDbPlaylistId($this->id) ->filterByDbPlaylistId($this->id)
->orderByDbPosition() ->orderByDbPosition()
->find($this->con) ->find($this->con);
;
} }
$contentsToUpdate = CcPlaylistcontentsQuery::create() $contentsToUpdate = CcPlaylistcontentsQuery::create()
->filterByDbPlaylistId($this->id) ->filterByDbPlaylistId($this->id)
->filterByDbPosition($pos, Criteria::GREATER_EQUAL) ->filterByDbPosition($pos, Criteria::GREATER_EQUAL)
->orderByDbPosition() ->orderByDbPosition()
->find($this->con) ->find($this->con);
;
} }
foreach ($p_items as $ac) { foreach ($p_items as $ac) {
@ -537,15 +534,13 @@ SQL;
$contentsToMove = CcPlaylistcontentsQuery::create() $contentsToMove = CcPlaylistcontentsQuery::create()
->filterByDbId($p_items, Criteria::IN) ->filterByDbId($p_items, Criteria::IN)
->orderByDbPosition() ->orderByDbPosition()
->find($this->con) ->find($this->con);
;
$otherContent = CcPlaylistcontentsQuery::create() $otherContent = CcPlaylistcontentsQuery::create()
->filterByDbId($p_items, Criteria::NOT_IN) ->filterByDbId($p_items, Criteria::NOT_IN)
->filterByDbPlaylistId($this->id) ->filterByDbPlaylistId($this->id)
->orderByDbPosition() ->orderByDbPosition()
->find($this->con) ->find($this->con);
;
$pos = 0; $pos = 0;
//moving items to beginning of the playlist. //moving items to beginning of the playlist.
@ -612,13 +607,11 @@ SQL;
$itemsToDelete = CcPlaylistcontentsQuery::create() $itemsToDelete = CcPlaylistcontentsQuery::create()
->filterByPrimaryKeys($p_items) ->filterByPrimaryKeys($p_items)
->filterByDbFileId(null, Criteria::NOT_EQUAL) ->filterByDbFileId(null, Criteria::NOT_EQUAL)
->find($this->con) ->find($this->con);
;
CcPlaylistcontentsQuery::create() CcPlaylistcontentsQuery::create()
->findPKs($p_items) ->findPKs($p_items)
->delete($this->con) ->delete($this->con);
;
// now that the items have been deleted we can update the // now that the items have been deleted we can update the
// is_playlist flag in cc_files // is_playlist flag in cc_files
@ -627,8 +620,7 @@ SQL;
$contents = CcPlaylistcontentsQuery::create() $contents = CcPlaylistcontentsQuery::create()
->filterByDbPlaylistId($this->id) ->filterByDbPlaylistId($this->id)
->orderByDbPosition() ->orderByDbPosition()
->find($this->con) ->find($this->con);
;
//reset the positions of the remaining items. //reset the positions of the remaining items.
for ($i = 0; $i < count($contents); ++$i) { for ($i = 0; $i < count($contents); ++$i) {
@ -653,8 +645,7 @@ SQL;
->joinWith(CcFilesPeer::OM_CLASS) ->joinWith(CcFilesPeer::OM_CLASS)
->filterByDbPlaylistId($this->id) ->filterByDbPlaylistId($this->id)
->filterByDbPosition($pos) ->filterByDbPosition($pos)
->findOne() ->findOne();
;
if (!$row) { if (!$row) {
return null; return null;
@ -770,8 +761,7 @@ SQL;
$row = CcPlaylistcontentsQuery::create() $row = CcPlaylistcontentsQuery::create()
->filterByDbPlaylistId($this->id) ->filterByDbPlaylistId($this->id)
->filterByDbPosition(0) ->filterByDbPosition(0)
->findOne($this->con) ->findOne($this->con);
;
$this->changeFadeInfo($row->getDbId(), $fadein, null); $this->changeFadeInfo($row->getDbId(), $fadein, null);
} }
@ -780,8 +770,7 @@ SQL;
$row = CcPlaylistcontentsQuery::create() $row = CcPlaylistcontentsQuery::create()
->filterByDbPlaylistId($this->id) ->filterByDbPlaylistId($this->id)
->filterByDbPosition($this->getSize() - 1) ->filterByDbPosition($this->getSize() - 1)
->findOne($this->con) ->findOne($this->con);
;
$this->changeFadeInfo($row->getDbId(), null, $fadeout); $this->changeFadeInfo($row->getDbId(), null, $fadeout);
} }
@ -817,8 +806,7 @@ SQL;
$row = CcPlaylistcontentsQuery::create() $row = CcPlaylistcontentsQuery::create()
->joinWith(CcFilesPeer::OM_CLASS) ->joinWith(CcFilesPeer::OM_CLASS)
->filterByPrimaryKey($id) ->filterByPrimaryKey($id)
->findOne($this->con) ->findOne($this->con);
;
if (is_null($row)) { if (is_null($row)) {
throw new Exception('Playlist item does not exist.'); throw new Exception('Playlist item does not exist.');
@ -997,8 +985,7 @@ SQL;
$itemsToDelete = CcPlaylistcontentsQuery::create() $itemsToDelete = CcPlaylistcontentsQuery::create()
->filterByDbPlaylistId($p_ids) ->filterByDbPlaylistId($p_ids)
->filterByDbFileId(null, Criteria::NOT_EQUAL) ->filterByDbFileId(null, Criteria::NOT_EQUAL)
->find() ->find();
;
$updateIsPlaylistFlag = false; $updateIsPlaylistFlag = false;
@ -1052,8 +1039,7 @@ SQL;
$itemsToDelete = CcPlaylistcontentsQuery::create() $itemsToDelete = CcPlaylistcontentsQuery::create()
->filterByDbPlaylistId($this->id) ->filterByDbPlaylistId($this->id)
->filterByDbFileId(null, Criteria::NOT_EQUAL) ->filterByDbFileId(null, Criteria::NOT_EQUAL)
->find() ->find();
;
CcPlaylistcontentsQuery::create()->findByDbPlaylistId($this->id)->delete(); CcPlaylistcontentsQuery::create()->findByDbPlaylistId($this->id)->delete();
@ -1139,8 +1125,7 @@ SQL;
->join('CcFiles.CcPlaylistcontents') ->join('CcFiles.CcPlaylistcontents')
->where('CcPlaylistcontents.DbPlaylistId = ?', $this->pl->getDbId()) ->where('CcPlaylistcontents.DbPlaylistId = ?', $this->pl->getDbId())
->where('CcFiles.DbFileExists = ?', 'false') ->where('CcFiles.DbFileExists = ?', 'false')
->find() ->find();
;
//Nicer Propel version but slightly slower because it generates a LEFT JOIN: //Nicer Propel version but slightly slower because it generates a LEFT JOIN:
/* /*

View File

@ -861,15 +861,13 @@ class Application_Model_Preference
//New versions use schema_version //New versions use schema_version
$pref = CcPrefQuery::create() $pref = CcPrefQuery::create()
->filterByKeystr('schema_version') ->filterByKeystr('schema_version')
->findOne() ->findOne();
;
if (empty($pref)) { if (empty($pref)) {
//Pre-2.5.2 releases all used this ambiguous "system_version" key to represent both the code and schema versions... //Pre-2.5.2 releases all used this ambiguous "system_version" key to represent both the code and schema versions...
$pref = CcPrefQuery::create() $pref = CcPrefQuery::create()
->filterByKeystr('system_version') ->filterByKeystr('system_version')
->findOne() ->findOne();
;
} }
return $pref->getValStr(); return $pref->getValStr();

View File

@ -227,21 +227,18 @@ SQL;
$currentMediaType = 'track'; $currentMediaType = 'track';
$currentFile = CcFilesQuery::create() $currentFile = CcFilesQuery::create()
->filterByDbId($currentMediaFileId) ->filterByDbId($currentMediaFileId)
->findOne() ->findOne();
;
$currentMediaName = $currentFile->getDbArtistName() . ' - ' . $currentFile->getDbTrackTitle(); $currentMediaName = $currentFile->getDbArtistName() . ' - ' . $currentFile->getDbTrackTitle();
$currentMetadata = CcFiles::sanitizeResponse($currentFile); $currentMetadata = CcFiles::sanitizeResponse($currentFile);
} elseif (isset($currentMediaStreamId)) { } elseif (isset($currentMediaStreamId)) {
$currentMediaType = 'webstream'; $currentMediaType = 'webstream';
$currentWebstream = CcWebstreamQuery::create() $currentWebstream = CcWebstreamQuery::create()
->filterByDbId($currentMediaStreamId) ->filterByDbId($currentMediaStreamId)
->findOne() ->findOne();
;
$currentWebstreamMetadata = CcWebstreamMetadataQuery::create() $currentWebstreamMetadata = CcWebstreamMetadataQuery::create()
->filterByDbInstanceId($currentMedia['id']) ->filterByDbInstanceId($currentMedia['id'])
->orderByDbStartTime(Criteria::DESC) ->orderByDbStartTime(Criteria::DESC)
->findOne() ->findOne();
;
$currentMediaName = $currentWebstream->getDbName(); $currentMediaName = $currentWebstream->getDbName();
if (isset($currentWebstreamMetadata)) { if (isset($currentWebstreamMetadata)) {
$currentMediaName .= ' - ' . $currentWebstreamMetadata->getDbLiquidsoapData(); $currentMediaName .= ' - ' . $currentWebstreamMetadata->getDbLiquidsoapData();
@ -265,8 +262,7 @@ SQL;
->filterByDbEnds($utcNow, Criteria::LESS_THAN) ->filterByDbEnds($utcNow, Criteria::LESS_THAN)
->filterByDbPlayoutStatus(0, Criteria::GREATER_THAN) ->filterByDbPlayoutStatus(0, Criteria::GREATER_THAN)
->orderByDbStarts(Criteria::DESC) ->orderByDbStarts(Criteria::DESC)
->findOne() ->findOne();
;
if (isset($previousMedia)) { if (isset($previousMedia)) {
$previousMetadata = null; $previousMetadata = null;
$previousMediaName = ''; $previousMediaName = '';
@ -276,8 +272,7 @@ SQL;
$previousMediaType = 'track'; $previousMediaType = 'track';
$previousFile = CcFilesQuery::create() $previousFile = CcFilesQuery::create()
->filterByDbId($previousMediaFileId) ->filterByDbId($previousMediaFileId)
->findOne() ->findOne();
;
if (isset($previousFile)) { if (isset($previousFile)) {
$previousMediaName = $previousFile->getDbArtistName() . ' - ' . $previousFile->getDbTrackTitle(); $previousMediaName = $previousFile->getDbArtistName() . ' - ' . $previousFile->getDbTrackTitle();
$previousMetadata = CcFiles::sanitizeResponse($previousFile); $previousMetadata = CcFiles::sanitizeResponse($previousFile);
@ -287,8 +282,7 @@ SQL;
$previousMediaType = 'webstream'; $previousMediaType = 'webstream';
$previousWebstream = CcWebstreamQuery::create() $previousWebstream = CcWebstreamQuery::create()
->filterByDbId($previousMediaStreamId) ->filterByDbId($previousMediaStreamId)
->findOne() ->findOne();
;
$previousMediaName = $previousWebstream->getDbName(); $previousMediaName = $previousWebstream->getDbName();
} else { } else {
$previousMediaType = null; $previousMediaType = null;
@ -306,8 +300,7 @@ SQL;
->filterByDbStarts($utcNow, Criteria::GREATER_THAN) ->filterByDbStarts($utcNow, Criteria::GREATER_THAN)
->filterByDbPlayoutStatus(0, Criteria::GREATER_THAN) ->filterByDbPlayoutStatus(0, Criteria::GREATER_THAN)
->orderByDbStarts(Criteria::ASC) ->orderByDbStarts(Criteria::ASC)
->findOne() ->findOne();
;
if (isset($nextMedia)) { if (isset($nextMedia)) {
$nextMetadata = null; $nextMetadata = null;
$nextMediaName = ''; $nextMediaName = '';
@ -317,16 +310,14 @@ SQL;
$nextMediaType = 'track'; $nextMediaType = 'track';
$nextFile = CcFilesQuery::create() $nextFile = CcFilesQuery::create()
->filterByDbId($nextMediaFileId) ->filterByDbId($nextMediaFileId)
->findOne() ->findOne();
;
$nextMetadata = CcFiles::sanitizeResponse($nextFile); $nextMetadata = CcFiles::sanitizeResponse($nextFile);
$nextMediaName = $nextFile->getDbArtistName() . ' - ' . $nextFile->getDbTrackTitle(); $nextMediaName = $nextFile->getDbArtistName() . ' - ' . $nextFile->getDbTrackTitle();
} elseif (isset($nextMediaStreamId)) { } elseif (isset($nextMediaStreamId)) {
$nextMediaType = 'webstream'; $nextMediaType = 'webstream';
$nextWebstream = CcWebstreamQuery::create() $nextWebstream = CcWebstreamQuery::create()
->filterByDbId($nextMediaStreamId) ->filterByDbId($nextMediaStreamId)
->findOne() ->findOne();
;
$nextMediaName = $nextWebstream->getDbName(); $nextMediaName = $nextWebstream->getDbName();
} else { } else {
$nextMediaType = null; $nextMediaType = null;
@ -1181,13 +1172,11 @@ SQL;
$ccShowInstance = CcShowInstancesQuery::create() $ccShowInstance = CcShowInstancesQuery::create()
->filterByDbShowId($showId) ->filterByDbShowId($showId)
->filterByDbStarts($show_start->format(DEFAULT_TIMESTAMP_FORMAT)) ->filterByDbStarts($show_start->format(DEFAULT_TIMESTAMP_FORMAT))
->findOne() ->findOne();
;
} elseif (!is_null($instanceId)) { } elseif (!is_null($instanceId)) {
$ccShowInstance = CcShowInstancesQuery::create() $ccShowInstance = CcShowInstancesQuery::create()
->filterByDbId($instanceId) ->filterByDbId($instanceId)
->findOne() ->findOne();
;
} }
if ($update && ($ccShowInstance && $ccShowInstance->getDbModifiedInstance() == true)) { if ($update && ($ccShowInstance && $ccShowInstance->getDbModifiedInstance() == true)) {
return false; return false;

View File

@ -58,15 +58,13 @@ final class Application_Model_Scheduler
{ {
$destinationInstanceId = $destination['instance']; $destinationInstanceId = $destination['instance'];
$destinationCcShowInstance = CcShowInstancesQuery::create() $destinationCcShowInstance = CcShowInstancesQuery::create()
->findPk($destinationInstanceId) ->findPk($destinationInstanceId);
;
$isDestinationLinked = $destinationCcShowInstance->getCcShow()->isLinked(); $isDestinationLinked = $destinationCcShowInstance->getCcShow()->isLinked();
foreach ($itemsToMove as $itemToMove) { foreach ($itemsToMove as $itemToMove) {
$sourceInstanceId = $itemToMove['instance']; $sourceInstanceId = $itemToMove['instance'];
$ccShowInstance = CcShowInstancesQuery::create() $ccShowInstance = CcShowInstancesQuery::create()
->findPk($sourceInstanceId) ->findPk($sourceInstanceId);
;
//does the item being moved belong to a linked show //does the item being moved belong to a linked show
$isSourceLinked = $ccShowInstance->getCcShow()->isLinked(); $isSourceLinked = $ccShowInstance->getCcShow()->isLinked();
@ -469,8 +467,7 @@ final class Application_Model_Scheduler
->setDbCueOut('00:00:00') ->setDbCueOut('00:00:00')
->setDbPlayoutStatus(-1) ->setDbPlayoutStatus(-1)
->setDbInstanceId($instanceId) ->setDbInstanceId($instanceId)
->save($this->con) ->save($this->con);
;
} else { } else {
$nextDT = $DT; $nextDT = $DT;
} }
@ -495,8 +492,7 @@ final class Application_Model_Scheduler
$schedule = CcScheduleQuery::create() $schedule = CcScheduleQuery::create()
->filterByDbInstanceId($instanceId) ->filterByDbInstanceId($instanceId)
->orderByDbStarts() ->orderByDbStarts()
->find($this->con) ->find($this->con);
;
$now = new DateTime('now', new DateTimeZone('UTC')); $now = new DateTime('now', new DateTimeZone('UTC'));
$itemStartDT = $instance->getDbStarts(null); $itemStartDT = $instance->getDbStarts(null);
@ -510,8 +506,7 @@ final class Application_Model_Scheduler
} }
$item->setDbStarts($itemStartDT) $item->setDbStarts($itemStartDT)
->setDbEnds($itemEndDT) ->setDbEnds($itemEndDT)
->save($this->con) ->save($this->con);
;
$itemStartDT = $this->findTimeDifference($itemEndDT, $this->crossfadeDuration); $itemStartDT = $this->findTimeDifference($itemEndDT, $this->crossfadeDuration);
} }
} }
@ -536,8 +531,7 @@ final class Application_Model_Scheduler
->filterByDbInstanceId($showInstance) ->filterByDbInstanceId($showInstance)
->filterByDbId($exclude, Criteria::NOT_IN) ->filterByDbId($exclude, Criteria::NOT_IN)
->orderByDbStarts() ->orderByDbStarts()
->find($this->con) ->find($this->con);
;
$now = new DateTime('now', new DateTimeZone('UTC')); $now = new DateTime('now', new DateTimeZone('UTC'));
$itemStartDT = $instance->getDbStarts(null); $itemStartDT = $instance->getDbStarts(null);
@ -551,8 +545,7 @@ final class Application_Model_Scheduler
} }
$item->setDbStarts($itemStartDT) $item->setDbStarts($itemStartDT)
->setDbEnds($itemEndDT) ->setDbEnds($itemEndDT);
;
$itemStartDT = $itemEndDT; $itemStartDT = $itemEndDT;
} }
@ -579,8 +572,7 @@ final class Application_Model_Scheduler
->filterByDbInstanceId($showInstance) ->filterByDbInstanceId($showInstance)
->filterByDbId($exclude, Criteria::NOT_IN) ->filterByDbId($exclude, Criteria::NOT_IN)
->orderByDbStarts() ->orderByDbStarts()
->find($this->con) ->find($this->con);
;
foreach ($schedule as $item) { foreach ($schedule as $item) {
//START OF TIME RECALC HACK //START OF TIME RECALC HACK
@ -608,8 +600,7 @@ final class Application_Model_Scheduler
$itemEndDT = $this->findEndTime($itemStartDT, $item->getDbClipLength()); $itemEndDT = $this->findEndTime($itemStartDT, $item->getDbClipLength());
$item->setDbStarts($itemStartDT) $item->setDbStarts($itemStartDT)
->setDbEnds($itemEndDT) ->setDbEnds($itemEndDT)
->save($this->con) ->save($this->con);
;
$itemStartDT = $this->findTimeDifference($itemEndDT, $this->crossfadeDuration); $itemStartDT = $this->findTimeDifference($itemEndDT, $this->crossfadeDuration);
} }
@ -719,13 +710,11 @@ final class Application_Model_Scheduler
$instances = CcShowInstancesQuery::create() $instances = CcShowInstancesQuery::create()
->filterByDbShowId($ccShow['id']) ->filterByDbShowId($ccShow['id'])
->filterByDbStarts(gmdate(DEFAULT_TIMESTAMP_FORMAT), Criteria::GREATER_THAN) ->filterByDbStarts(gmdate(DEFAULT_TIMESTAMP_FORMAT), Criteria::GREATER_THAN)
->find() ->find();
;
} else { } else {
$instances = CcShowInstancesQuery::create() $instances = CcShowInstancesQuery::create()
->filterByDbId($schedule['instance']) ->filterByDbId($schedule['instance'])
->find() ->find();
;
} }
$excludePositions = []; $excludePositions = [];
@ -1065,8 +1054,7 @@ final class Application_Model_Scheduler
//update the status flag in cc_schedule. //update the status flag in cc_schedule.
$instances = CcShowInstancesQuery::create() $instances = CcShowInstancesQuery::create()
->filterByPrimaryKeys($affectedShowInstances) ->filterByPrimaryKeys($affectedShowInstances)
->find($this->con) ->find($this->con);
;
$startProfile = microtime(true); $startProfile = microtime(true);
@ -1083,8 +1071,7 @@ final class Application_Model_Scheduler
//update the last scheduled timestamp. //update the last scheduled timestamp.
CcShowInstancesQuery::create() CcShowInstancesQuery::create()
->filterByPrimaryKeys($affectedShowInstances) ->filterByPrimaryKeys($affectedShowInstances)
->update(['DbLastScheduled' => new DateTime('now', new DateTimeZone('UTC'))], $this->con) ->update(['DbLastScheduled' => new DateTime('now', new DateTimeZone('UTC'))], $this->con);
;
$endProfile = microtime(true); $endProfile = microtime(true);
Logging::debug('updating last scheduled timestamp.'); Logging::debug('updating last scheduled timestamp.');
@ -1298,8 +1285,7 @@ final class Application_Model_Scheduler
->filterByDbPosition($removedItem->getDbPosition()) ->filterByDbPosition($removedItem->getDbPosition())
->filterByDbInstanceId($instanceIds, Criteria::IN) ->filterByDbInstanceId($instanceIds, Criteria::IN)
->filterByDbId($removedItem->getDbId(), Criteria::NOT_EQUAL) ->filterByDbId($removedItem->getDbId(), Criteria::NOT_EQUAL)
->delete($this->con) ->delete($this->con);
;
} }
//check to truncate the currently playing item instead of deleting it. //check to truncate the currently playing item instead of deleting it.
@ -1320,8 +1306,7 @@ final class Application_Model_Scheduler
$removedItem->setDbCueOut($cueout) $removedItem->setDbCueOut($cueout)
->setDbClipLength($cliplength) ->setDbClipLength($cliplength)
->setDbEnds($this->nowDT) ->setDbEnds($this->nowDT)
->save($this->con) ->save($this->con);
;
} else { } else {
$removedItem->delete($this->con); $removedItem->delete($this->con);
} }
@ -1338,8 +1323,7 @@ final class Application_Model_Scheduler
//update the status flag in cc_schedule. //update the status flag in cc_schedule.
$instances = CcShowInstancesQuery::create() $instances = CcShowInstancesQuery::create()
->filterByPrimaryKeys($effectedInstanceIds) ->filterByPrimaryKeys($effectedInstanceIds)
->find($this->con) ->find($this->con);
;
foreach ($instances as $instance) { foreach ($instances as $instance) {
$instance->updateScheduleStatus($this->con); $instance->updateScheduleStatus($this->con);
@ -1349,8 +1333,7 @@ final class Application_Model_Scheduler
//update the last scheduled timestamp. //update the last scheduled timestamp.
CcShowInstancesQuery::create() CcShowInstancesQuery::create()
->filterByPrimaryKeys($showInstances) ->filterByPrimaryKeys($showInstances)
->update(['DbLastScheduled' => new DateTime('now', new DateTimeZone('UTC'))], $this->con) ->update(['DbLastScheduled' => new DateTime('now', new DateTimeZone('UTC'))], $this->con);
;
$this->con->commit(); $this->con->commit();
@ -1391,8 +1374,7 @@ final class Application_Model_Scheduler
$items = CcScheduleQuery::create() $items = CcScheduleQuery::create()
->filterByDbInstanceId($p_id) ->filterByDbInstanceId($p_id)
->filterByDbEnds($this->nowDT, Criteria::GREATER_THAN) ->filterByDbEnds($this->nowDT, Criteria::GREATER_THAN)
->find($this->con) ->find($this->con);
;
if (count($items) > 0) { if (count($items) > 0) {
$remove = []; $remove = [];

View File

@ -258,8 +258,7 @@ SQL;
->filterByDbFirstShow($startsDT->format('Y-m-d')) ->filterByDbFirstShow($startsDT->format('Y-m-d'))
->filterByDbStartTime($startsDT->format('H:i:s')) ->filterByDbStartTime($startsDT->format('H:i:s'))
->filterByDbShowId($this->_showId) ->filterByDbShowId($this->_showId)
->findOne() ->findOne();
;
/* Check if this cc_show_day rule is non-repeating. If it is, then /* Check if this cc_show_day rule is non-repeating. If it is, then
* we know this instance was edited out of the repeating sequence * we know this instance was edited out of the repeating sequence
@ -277,16 +276,14 @@ SQL;
->filterByDbShowId($this->_showId) ->filterByDbShowId($this->_showId)
->filterByDbModifiedInstance(false) ->filterByDbModifiedInstance(false)
->filterByDbId($excludeIds, criteria::NOT_IN) ->filterByDbId($excludeIds, criteria::NOT_IN)
->find() ->find();
;
} elseif ($ccShowDay->getDbRepeatType() == -1) { } elseif ($ccShowDay->getDbRepeatType() == -1) {
array_push($showDayIds, $ccShowDay->getDbId()); array_push($showDayIds, $ccShowDay->getDbId());
//treat edited instance as separate show for resize //treat edited instance as separate show for resize
$showInstances = CcShowInstancesQuery::create() $showInstances = CcShowInstancesQuery::create()
->filterByDbId($instanceId) ->filterByDbId($instanceId)
->find() ->find();
;
} }
} else { } else {
$ccShowDays = $ccShow->getCcShowDayss(); $ccShowDays = $ccShow->getCcShowDayss();
@ -296,8 +293,7 @@ SQL;
$showInstances = CcShowInstancesQuery::create() $showInstances = CcShowInstancesQuery::create()
->filterByDbShowId($this->_showId) ->filterByDbShowId($this->_showId)
->find($con) ->find($con);
;
} }
/* Check two things: /* Check two things:
@ -400,8 +396,7 @@ SQL;
$instances = CcShowInstancesQuery::create() $instances = CcShowInstancesQuery::create()
->filterByDbEnds($nowDateTime->format(DEFAULT_TIMESTAMP_FORMAT), Criteria::GREATER_THAN) ->filterByDbEnds($nowDateTime->format(DEFAULT_TIMESTAMP_FORMAT), Criteria::GREATER_THAN)
->filterByDbId($instanceIds, Criteria::IN) ->filterByDbId($instanceIds, Criteria::IN)
->find($con) ->find($con);
;
foreach ($instances as $instance) { foreach ($instances as $instance) {
$instance->updateScheduleStatus($con); $instance->updateScheduleStatus($con);
@ -423,8 +418,7 @@ SQL;
CcShowDaysQuery::create() CcShowDaysQuery::create()
->filterByDbShowId($this->_showId) ->filterByDbShowId($this->_showId)
->update(['DbLastShow' => $timeinfo[0]]) ->update(['DbLastShow' => $timeinfo[0]]);
;
$sql = <<<'SQL' $sql = <<<'SQL'
SELECT id from cc_show_instances SELECT id from cc_show_instances
@ -461,8 +455,7 @@ SQL;
->filterByDbShowId($this->getId()) ->filterByDbShowId($this->getId())
->filterByDbRecord(1) ->filterByDbRecord(1)
->filterByDbModifiedInstance(false) ->filterByDbModifiedInstance(false)
->findOne() ->findOne();
;
return !is_null($showInstancesRow); return !is_null($showInstancesRow);
} }
@ -480,8 +473,7 @@ SQL;
->filterByDbShowId($this->_showId) ->filterByDbShowId($this->_showId)
->filterByDbRebroadcast(1) ->filterByDbRebroadcast(1)
->filterByDbModifiedInstance(false) ->filterByDbModifiedInstance(false)
->findOne() ->findOne();
;
return !is_null($showInstancesRow); return !is_null($showInstancesRow);
} }
@ -522,8 +514,7 @@ SQL;
{ {
$showDaysRow = CcShowDaysQuery::create() $showDaysRow = CcShowDaysQuery::create()
->filterByDbShowId($this->_showId) ->filterByDbShowId($this->_showId)
->findOne() ->findOne();
;
if (!is_null($showDaysRow)) { if (!is_null($showDaysRow)) {
return $showDaysRow->getDbRepeatType() != -1; return $showDaysRow->getDbRepeatType() != -1;
@ -545,8 +536,7 @@ SQL;
{ {
$showDaysRow = CcShowDaysQuery::create() $showDaysRow = CcShowDaysQuery::create()
->filterByDbShowId($this->_showId) ->filterByDbShowId($this->_showId)
->findOne() ->findOne();
;
if (!is_null($showDaysRow)) { if (!is_null($showDaysRow)) {
return $showDaysRow->getDbRepeatType(); return $showDaysRow->getDbRepeatType();
@ -847,8 +837,7 @@ SQL;
{ {
return CcShowInstancesQuery::create() return CcShowInstancesQuery::create()
->filterByDbShowId($this->getId()) ->filterByDbShowId($this->getId())
->findOne() ->findOne();
;
} }
/** /**
@ -913,8 +902,7 @@ SQL;
); );
return CcShowInstancesQuery::create() return CcShowInstancesQuery::create()
->findPk($row) ->findPk($row);
;
} catch (Exception $e) { } catch (Exception $e) {
return null; return null;
} }
@ -1049,12 +1037,10 @@ SQL;
$repeatInfo = CcShowDaysQuery::create() $repeatInfo = CcShowDaysQuery::create()
->filterByDbShowId($show_id) ->filterByDbShowId($show_id)
->filterByDbDay($day) ->filterByDbDay($day)
->findOne() ->findOne();
;
$repeatInfo->setDbNextPopDate($nextInfo[0]) $repeatInfo->setDbNextPopDate($nextInfo[0])
->save() ->save();
;
} }
/** /**

View File

@ -67,8 +67,7 @@ class Application_Model_ShowBuilder
$host_shows = CcShowHostsQuery::create() $host_shows = CcShowHostsQuery::create()
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND) ->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
->filterByDbHost($this->user->getId()) ->filterByDbHost($this->user->getId())
->find() ->find();
;
foreach ($host_shows as $host_show) { foreach ($host_shows as $host_show) {
$shows[] = $host_show->getDbShow(); $shows[] = $host_show->getDbShow();

View File

@ -164,24 +164,21 @@ SQL;
public function setShowStart($start) public function setShowStart($start)
{ {
$this->_showInstance->setDbStarts($start) $this->_showInstance->setDbStarts($start)
->save() ->save();
;
Application_Model_RabbitMq::PushSchedule(); Application_Model_RabbitMq::PushSchedule();
} }
public function setShowEnd($end) public function setShowEnd($end)
{ {
$this->_showInstance->setDbEnds($end) $this->_showInstance->setDbEnds($end)
->save() ->save();
;
Application_Model_RabbitMq::PushSchedule(); Application_Model_RabbitMq::PushSchedule();
} }
public function setAutoPlaylistBuilt($bool) public function setAutoPlaylistBuilt($bool)
{ {
$this->_showInstance->setDbAutoPlaylistBuilt($bool) $this->_showInstance->setDbAutoPlaylistBuilt($bool)
->save() ->save();
;
} }
public function updateScheduledTime() public function updateScheduledTime()
@ -314,8 +311,7 @@ SQL;
{ {
CcScheduleQuery::create() CcScheduleQuery::create()
->filterByDbInstanceId($this->_instanceId) ->filterByDbInstanceId($this->_instanceId)
->delete() ->delete();
;
Application_Model_RabbitMq::PushSchedule(); Application_Model_RabbitMq::PushSchedule();
$this->updateScheduledTime(); $this->updateScheduledTime();
} }
@ -327,8 +323,7 @@ SQL;
$showDays = CcShowDaysQuery::create() $showDays = CcShowDaysQuery::create()
->filterByDbShowId($showId) ->filterByDbShowId($showId)
->findOne() ->findOne();
;
$showEnd = $showDays->getDbLastShow(); $showEnd = $showDays->getDbLastShow();
@ -351,8 +346,7 @@ SQL;
->filterByDbShowId($showId) ->filterByDbShowId($showId)
->filterByDbModifiedInstance(false) ->filterByDbModifiedInstance(false)
->filterByDbRebroadcast(0) ->filterByDbRebroadcast(0)
->find() ->find();
;
if (is_null($showInstances)) { if (is_null($showInstances)) {
return true; return true;
@ -363,8 +357,7 @@ SQL;
$showDaysOld = CcShowDaysQuery::create() $showDaysOld = CcShowDaysQuery::create()
->filterByDbShowId($showId) ->filterByDbShowId($showId)
->find() ->find();
;
$tz = $showDaysOld[0]->getDbTimezone(); $tz = $showDaysOld[0]->getDbTimezone();
@ -392,8 +385,7 @@ SQL;
$showInstances = CcShowInstancesQuery::create() $showInstances = CcShowInstancesQuery::create()
->filterByDbShowId($showId) ->filterByDbShowId($showId)
->filterByDbModifiedInstance(true) ->filterByDbModifiedInstance(true)
->delete() ->delete();
;
} }
return false; return false;
@ -415,8 +407,7 @@ SQL;
CcShowInstancesQuery::create() CcShowInstancesQuery::create()
->findPK($this->_instanceId) ->findPK($this->_instanceId)
->setDbModifiedInstance(true) ->setDbModifiedInstance(true)
->save() ->save();
;
if ($this->isRebroadcast()) { if ($this->isRebroadcast()) {
return; return;
@ -426,21 +417,18 @@ SQL;
if ($recording) { if ($recording) {
CcShowInstancesQuery::create() CcShowInstancesQuery::create()
->filterByDbOriginalShow($this->_instanceId) ->filterByDbOriginalShow($this->_instanceId)
->delete() ->delete();
;
} }
// Automatically delete all files scheduled in cc_schedules table. // Automatically delete all files scheduled in cc_schedules table.
CcScheduleQuery::create() CcScheduleQuery::create()
->filterByDbInstanceId($this->_instanceId) ->filterByDbInstanceId($this->_instanceId)
->delete() ->delete();
;
if ($this->checkToDeleteShow($showId)) { if ($this->checkToDeleteShow($showId)) {
CcShowQuery::create() CcShowQuery::create()
->filterByDbId($showId) ->filterByDbId($showId)
->delete() ->delete();
;
} }
} else { } else {
if ($this->isRebroadcast()) { if ($this->isRebroadcast()) {
@ -459,16 +447,13 @@ SQL;
public function setRecordedFile($file_id) public function setRecordedFile($file_id)
{ {
$showInstance = CcShowInstancesQuery::create() $showInstance = CcShowInstancesQuery::create()
->findPK($this->_instanceId) ->findPK($this->_instanceId);
;
$showInstance->setDbRecordedFile($file_id) $showInstance->setDbRecordedFile($file_id)
->save() ->save();
;
$rebroadcasts = CcShowInstancesQuery::create() $rebroadcasts = CcShowInstancesQuery::create()
->filterByDbOriginalShow($this->_instanceId) ->filterByDbOriginalShow($this->_instanceId)
->find() ->find();
;
foreach ($rebroadcasts as $rebroadcast) { foreach ($rebroadcasts as $rebroadcast) {
try { try {
@ -611,8 +596,7 @@ SQL;
->filterByDbStarts($p_start->format(DEFAULT_TIMESTAMP_FORMAT), Criteria::GREATER_THAN) ->filterByDbStarts($p_start->format(DEFAULT_TIMESTAMP_FORMAT), Criteria::GREATER_THAN)
->leftJoinCcShow() ->leftJoinCcShow()
->where('CcShow.has_autoplaylist = ?', 'true') ->where('CcShow.has_autoplaylist = ?', 'true')
->find($con) ->find($con);
;
$hasAutoplaylist = []; $hasAutoplaylist = [];
foreach ($showInstances->toArray() as $ap) { foreach ($showInstances->toArray() as $ap) {
$hasAutoplaylist[$ap['DbId']] = true; $hasAutoplaylist[$ap['DbId']] = true;

View File

@ -194,8 +194,7 @@ class Application_Model_StoredFile
} // get the user by id and set it like that } // get the user by id and set it like that
else { else {
$user = CcSubjsQuery::create() $user = CcSubjsQuery::create()
->findPk($p_md['owner_id']) ->findPk($p_md['owner_id']);
;
if ($user) { if ($user) {
$owner = $user; $owner = $user;
} }
@ -661,8 +660,7 @@ SQL;
$file = CcFilesQuery::create() $file = CcFilesQuery::create()
->filterByDbDirectory($music_dir->getId()) ->filterByDbDirectory($music_dir->getId())
->filterByDbFilepath($path_info[1]) ->filterByDbFilepath($path_info[1])
->findOne($con) ->findOne($con);
;
return is_null($file) ? null : self::createWithFile($file, $con); return is_null($file) ? null : self::createWithFile($file, $con);
} }
@ -679,8 +677,7 @@ SQL;
$files = CcFilesQuery::create() $files = CcFilesQuery::create()
->filterByDbDirectory($music_dir->getId()) ->filterByDbDirectory($music_dir->getId())
->filterByDbFilepath("{$path_info[1]}%") ->filterByDbFilepath("{$path_info[1]}%")
->find($con) ->find($con);
;
$res = []; $res = [];
foreach ($files as $file) { foreach ($files as $file) {
$storedFile = new Application_Model_StoredFile($file, $con); $storedFile = new Application_Model_StoredFile($file, $con);
@ -1142,15 +1139,13 @@ SQL;
public function setFileExistsFlag($flag) public function setFileExistsFlag($flag)
{ {
$this->_file->setDbFileExists($flag) $this->_file->setDbFileExists($flag)
->save() ->save();
;
} }
public function setFileHiddenFlag($flag) public function setFileHiddenFlag($flag)
{ {
$this->_file->setDbHidden($flag) $this->_file->setDbHidden($flag)
->save() ->save();
;
} }
// This method seems to be unsued everywhere so I've commented it out // This method seems to be unsued everywhere so I've commented it out

View File

@ -121,8 +121,7 @@ class Application_Model_StreamSetting
{ {
$rows = CcStreamSettingQuery::create() $rows = CcStreamSettingQuery::create()
->filterByDbKeyName("{$p_streamId}_%") ->filterByDbKeyName("{$p_streamId}_%")
->find() ->find();
;
//This is way too much code because someone made only stupid decisions about how //This is way too much code because someone made only stupid decisions about how
//the layout of this table worked. The git history doesn't lie. //the layout of this table worked. The git history doesn't lie.

View File

@ -460,8 +460,7 @@ class CcFiles extends BaseCcFiles
$defaultOwner = CcSubjsQuery::create() $defaultOwner = CcSubjsQuery::create()
->filterByDbType('A') ->filterByDbType('A')
->orderByDbId() ->orderByDbId()
->findOne() ->findOne();
;
if (!$defaultOwner) { if (!$defaultOwner) {
// what to do if there is no admin user? // what to do if there is no admin user?
// should we handle this case? // should we handle this case?

View File

@ -23,8 +23,7 @@ class CcShow extends BaseCcShow
return CcShowDaysQuery::create() return CcShowDaysQuery::create()
->filterByDbShowId($this->id) ->filterByDbShowId($this->id)
->filterByDbRepeatType(-1, Criteria::NOT_EQUAL) ->filterByDbRepeatType(-1, Criteria::NOT_EQUAL)
->find() ->find();
;
} }
/** /**
@ -57,8 +56,7 @@ class CcShow extends BaseCcShow
->filterByCcShow($this) ->filterByCcShow($this)
->orderByDbFirstShow() ->orderByDbFirstShow()
->limit(1) ->limit(1)
->find($con) ->find($con);
;
if (null !== $criteria) { if (null !== $criteria) {
return $collCcShowDayss; return $collCcShowDayss;
} }
@ -84,8 +82,7 @@ class CcShow extends BaseCcShow
->filterByDbShowId($this->id) ->filterByDbShowId($this->id)
->filterByDbRepeatType(-1, Criteria::NOT_EQUAL) ->filterByDbRepeatType(-1, Criteria::NOT_EQUAL)
->orderByDbFirstShow() ->orderByDbFirstShow()
->findOne() ->findOne();
;
} }
/** /**
@ -101,8 +98,7 @@ class CcShow extends BaseCcShow
$ccShowDays = CcShowDaysQuery::create() $ccShowDays = CcShowDaysQuery::create()
->filterByDbShowId($this->id) ->filterByDbShowId($this->id)
->filterByDbRepeatType(0, Criteria::GREATER_EQUAL) ->filterByDbRepeatType(0, Criteria::GREATER_EQUAL)
->find() ->find();
;
if (!$ccShowDays->isEmpty()) { if (!$ccShowDays->isEmpty()) {
return true; return true;
@ -121,8 +117,7 @@ class CcShow extends BaseCcShow
$ccShowDays = CcShowDaysQuery::create() $ccShowDays = CcShowDaysQuery::create()
->filterByDbShowId($this->id) ->filterByDbShowId($this->id)
->filterByDbRepeatType(-1) ->filterByDbRepeatType(-1)
->find() ->find();
;
$startsUTC = []; $startsUTC = [];
@ -140,8 +135,7 @@ class CcShow extends BaseCcShow
$excludeInstances = CcShowInstancesQuery::create() $excludeInstances = CcShowInstancesQuery::create()
->filterByDbShowId($this->id) ->filterByDbShowId($this->id)
->filterByDbStarts($startsUTC, criteria::IN) ->filterByDbStarts($startsUTC, criteria::IN)
->find() ->find();
;
$excludeIds = []; $excludeIds = [];
foreach ($excludeInstances as $instance) { foreach ($excludeInstances as $instance) {
@ -178,8 +172,7 @@ class CcShow extends BaseCcShow
->filterByCcShow($this) ->filterByCcShow($this)
->filterByDbStarts(gmdate('Y-m-d H:i:s'), Criteria::GREATER_THAN) ->filterByDbStarts(gmdate('Y-m-d H:i:s'), Criteria::GREATER_THAN)
->filterByDbModifiedInstance(false) ->filterByDbModifiedInstance(false)
->find($con) ->find($con);
;
if (null !== $criteria) { if (null !== $criteria) {
return $collCcShowInstancess; return $collCcShowInstancess;
} }
@ -195,8 +188,7 @@ class CcShow extends BaseCcShow
$ccShowDay = CcShowDaysQuery::create() $ccShowDay = CcShowDaysQuery::create()
->filterByDbShowId($this->getDbId()) ->filterByDbShowId($this->getDbId())
->filterByDbRecord(1) ->filterByDbRecord(1)
->findOne() ->findOne();
;
return !is_null($ccShowDay); return !is_null($ccShowDay);
} }
@ -205,8 +197,7 @@ class CcShow extends BaseCcShow
{ {
$ccShowRebroadcast = CcShowRebroadcastQuery::create() $ccShowRebroadcast = CcShowRebroadcastQuery::create()
->filterByDbShowId($this->getDbId()) ->filterByDbShowId($this->getDbId())
->findOne() ->findOne();
;
return !is_null($ccShowRebroadcast); return !is_null($ccShowRebroadcast);
} }
@ -216,8 +207,7 @@ class CcShow extends BaseCcShow
return CcShowRebroadcastQuery::create() return CcShowRebroadcastQuery::create()
->filterByDbShowId($this->getDbId()) ->filterByDbShowId($this->getDbId())
->orderByDbDayOffset() ->orderByDbDayOffset()
->find() ->find();
;
} }
public function getRebroadcastsAbsolute() public function getRebroadcastsAbsolute()
@ -227,8 +217,7 @@ class CcShow extends BaseCcShow
->filterByDbRebroadcast(1) ->filterByDbRebroadcast(1)
->filterByDbModifiedInstance(false) ->filterByDbModifiedInstance(false)
->orderByDbStarts() ->orderByDbStarts()
->find() ->find();
;
} }
public function isLinked() public function isLinked()
@ -263,8 +252,7 @@ class CcShow extends BaseCcShow
->filterByCcShow($this) ->filterByCcShow($this)
->filterByDbModifiedInstance(false) ->filterByDbModifiedInstance(false)
->orderByDbId() ->orderByDbId()
->find($con) ->find($con);
;
/*if(null === $this->collCcShowInstancess || null !== $criteria) { /*if(null === $this->collCcShowInstancess || null !== $criteria) {
if ($this->isNew() && null === $this->collCcShowInstancess) { if ($this->isNew() && null === $this->collCcShowInstancess) {
@ -319,8 +307,7 @@ class CcShow extends BaseCcShow
return CcShowInstancesQuery::create() return CcShowInstancesQuery::create()
->filterByCcShow($this) ->filterByCcShow($this)
->filterByDbId($instanceId, Criteria::NOT_EQUAL) ->filterByDbId($instanceId, Criteria::NOT_EQUAL)
->find() ->find();
;
} }
public function getShowInfo() public function getShowInfo()

View File

@ -118,8 +118,7 @@ class CcShowInstances extends BaseCcShowInstances
->filterByDbInstanceId($this->id) ->filterByDbInstanceId($this->id)
->filterByDbPlayoutStatus(0, Criteria::GREATER_EQUAL) ->filterByDbPlayoutStatus(0, Criteria::GREATER_EQUAL)
->filterByDbEnds($this->ends, Criteria::LESS_EQUAL) ->filterByDbEnds($this->ends, Criteria::LESS_EQUAL)
->update(['DbPlayoutStatus' => 1], $con) ->update(['DbPlayoutStatus' => 1], $con);
;
//scheduled track is a boundary track //scheduled track is a boundary track
CcScheduleQuery::create() CcScheduleQuery::create()
@ -127,16 +126,14 @@ class CcShowInstances extends BaseCcShowInstances
->filterByDbPlayoutStatus(0, Criteria::GREATER_EQUAL) ->filterByDbPlayoutStatus(0, Criteria::GREATER_EQUAL)
->filterByDbStarts($this->ends, Criteria::LESS_THAN) ->filterByDbStarts($this->ends, Criteria::LESS_THAN)
->filterByDbEnds($this->ends, Criteria::GREATER_THAN) ->filterByDbEnds($this->ends, Criteria::GREATER_THAN)
->update(['DbPlayoutStatus' => 2], $con) ->update(['DbPlayoutStatus' => 2], $con);
;
//scheduled track is overbooked. //scheduled track is overbooked.
CcScheduleQuery::create() CcScheduleQuery::create()
->filterByDbInstanceId($this->id) ->filterByDbInstanceId($this->id)
->filterByDbPlayoutStatus(0, Criteria::GREATER_EQUAL) ->filterByDbPlayoutStatus(0, Criteria::GREATER_EQUAL)
->filterByDbStarts($this->ends, Criteria::GREATER_THAN) ->filterByDbStarts($this->ends, Criteria::GREATER_THAN)
->update(['DbPlayoutStatus' => 0], $con) ->update(['DbPlayoutStatus' => 0], $con);
;
$this->setDbLastScheduled(gmdate('Y-m-d H:i:s')); $this->setDbLastScheduled(gmdate('Y-m-d H:i:s'));
$this->save($con); $this->save($con);
@ -155,8 +152,7 @@ class CcShowInstances extends BaseCcShowInstances
$schedule = CcScheduleQuery::create() $schedule = CcScheduleQuery::create()
->filterByDbInstanceId($this->id) ->filterByDbInstanceId($this->id)
->orderByDbStarts() ->orderByDbStarts()
->find() ->find();
;
$pos = 0; $pos = 0;
foreach ($schedule as $item) { foreach ($schedule as $item) {

View File

@ -30,8 +30,7 @@ class CcSubjs extends BaseCcSubjs
public function isHostOfShowInstance($instanceId) public function isHostOfShowInstance($instanceId)
{ {
$showInstance = CcShowInstancesQuery::create() $showInstance = CcShowInstancesQuery::create()
->findPk($instanceId) ->findPk($instanceId);
;
return CcShowHostsQuery::create() return CcShowHostsQuery::create()
->filterByDbShow($showInstance->getDbShowId()) ->filterByDbShow($showInstance->getDbShowId())

View File

@ -22,8 +22,7 @@ class StationPodcast extends BaseStationPodcast
{ {
$episodes = PodcastEpisodesQuery::create() $episodes = PodcastEpisodesQuery::create()
->filterByDbPodcastId($this->getDbPodcastId()) ->filterByDbPodcastId($this->getDbPodcastId())
->find() ->find();
;
foreach ($episodes as $e) { foreach ($episodes as $e) {
if ($e->getDbFileId() == $fileId) { if ($e->getDbFileId() == $fileId) {
return true; return true;

View File

@ -37,8 +37,7 @@ class Rest_MediaController extends Zend_Rest_Controller
->filterByDbImportStatus(0) ->filterByDbImportStatus(0)
->setLimit($limit) ->setLimit($limit)
->setOffset($offset) ->setOffset($offset)
->orderBy($sortColumn, $sortDir) ->orderBy($sortColumn, $sortDir);
;
//->orderByDbId(); //->orderByDbId();
$queryCount = $query->count(); $queryCount = $query->count();
@ -52,8 +51,7 @@ class Rest_MediaController extends Zend_Rest_Controller
$this->getResponse() $this->getResponse()
->setHttpResponseCode(200) ->setHttpResponseCode(200)
->setHeader('X-TOTAL-COUNT', $totalFileCount) ->setHeader('X-TOTAL-COUNT', $totalFileCount)
->appendBody(json_encode($files_array)) ->appendBody(json_encode($files_array));
;
/* TODO: Use this simpler code instead after we upgrade to Propel 1.7 (Airtime 2.6.x branch): /* TODO: Use this simpler code instead after we upgrade to Propel 1.7 (Airtime 2.6.x branch):
* $this->getResponse() * $this->getResponse()
@ -74,8 +72,7 @@ class Rest_MediaController extends Zend_Rest_Controller
try { try {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(200) ->setHttpResponseCode(200);
;
$inline = false; $inline = false;
// SAAS-1081 - download counter for station podcast downloads // SAAS-1081 - download counter for station podcast downloads
if ($key = $this->getRequest()->getParam('download_key', false)) { if ($key = $this->getRequest()->getParam('download_key', false)) {
@ -105,8 +102,7 @@ class Rest_MediaController extends Zend_Rest_Controller
try { try {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(200) ->setHttpResponseCode(200)
->appendBody(json_encode(CcFiles::getSanitizedFileById($id))) ->appendBody(json_encode(CcFiles::getSanitizedFileById($id)));
;
} catch (LibreTimeFileNotFoundException $e) { } catch (LibreTimeFileNotFoundException $e) {
$this->fileNotFoundResponse(); $this->fileNotFoundResponse();
Logging::error($e->getMessage()); Logging::error($e->getMessage());
@ -145,16 +141,14 @@ class Rest_MediaController extends Zend_Rest_Controller
$sanitizedFile = CcFiles::createFromUpload($fileInfo); $sanitizedFile = CcFiles::createFromUpload($fileInfo);
$this->getResponse() $this->getResponse()
->setHttpResponseCode(201) ->setHttpResponseCode(201)
->appendBody(json_encode($sanitizedFile)) ->appendBody(json_encode($sanitizedFile));
;
} catch (InvalidMetadataException $e) { } catch (InvalidMetadataException $e) {
$this->invalidDataResponse(); $this->invalidDataResponse();
Logging::error($e->getMessage()); Logging::error($e->getMessage());
} catch (OverDiskQuotaException $e) { } catch (OverDiskQuotaException $e) {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(400) ->setHttpResponseCode(400)
->appendBody('ERROR: Disk Quota reached.') ->appendBody('ERROR: Disk Quota reached.');
;
} catch (Exception $e) { } catch (Exception $e) {
$this->serviceUnavailableResponse(); $this->serviceUnavailableResponse();
Logging::error($e->getMessage() . "\n" . $e->getTraceAsString()); Logging::error($e->getMessage() . "\n" . $e->getTraceAsString());
@ -174,8 +168,7 @@ class Rest_MediaController extends Zend_Rest_Controller
$this->getResponse() $this->getResponse()
->setHttpResponseCode(201) ->setHttpResponseCode(201)
->appendBody(json_encode($sanitizedFile)) ->appendBody(json_encode($sanitizedFile));
;
} catch (InvalidMetadataException $e) { } catch (InvalidMetadataException $e) {
$this->invalidDataResponse(); $this->invalidDataResponse();
Logging::error($e->getMessage()); Logging::error($e->getMessage());
@ -198,8 +191,7 @@ class Rest_MediaController extends Zend_Rest_Controller
try { try {
CcFiles::deleteById($id); CcFiles::deleteById($id);
$this->getResponse() $this->getResponse()
->setHttpResponseCode(204) ->setHttpResponseCode(204);
;
} catch (LibreTimeFileNotFoundException $e) { } catch (LibreTimeFileNotFoundException $e) {
$this->fileNotFoundResponse(); $this->fileNotFoundResponse();
Logging::error($e->getMessage()); Logging::error($e->getMessage());
@ -221,8 +213,7 @@ class Rest_MediaController extends Zend_Rest_Controller
$data = json_decode($this->getRequest()->getRawBody(), true)['sources']; $data = json_decode($this->getRequest()->getRawBody(), true)['sources'];
Application_Service_PublishService::publish($id, $data); Application_Service_PublishService::publish($id, $data);
$this->getResponse() $this->getResponse()
->setHttpResponseCode(200) ->setHttpResponseCode(200);
;
} catch (Exception $e) { } catch (Exception $e) {
$this->unknownErrorResponse(); $this->unknownErrorResponse();
Logging::error($e->getMessage()); Logging::error($e->getMessage());
@ -235,8 +226,7 @@ class Rest_MediaController extends Zend_Rest_Controller
$sources = Application_Service_PublishService::getSourceLists($id); $sources = Application_Service_PublishService::getSourceLists($id);
$this->getResponse() $this->getResponse()
->setHttpResponseCode(200) ->setHttpResponseCode(200)
->appendBody(json_encode($sources)) ->appendBody(json_encode($sources));
;
} }
private function getId() private function getId()

View File

@ -35,15 +35,13 @@ class Rest_PodcastController extends Zend_Rest_Controller
// Don't return the Station podcast - we fetch it separately // Don't return the Station podcast - we fetch it separately
->filterByDbId($stationPodcastId, Criteria::NOT_EQUAL) ->filterByDbId($stationPodcastId, Criteria::NOT_EQUAL)
->leftJoinImportedPodcast() ->leftJoinImportedPodcast()
->withColumn('auto_ingest_timestamp') ->withColumn('auto_ingest_timestamp');
;
$total = $result->count(); $total = $result->count();
if ($limit > 0) { if ($limit > 0) {
$result->setLimit($limit); $result->setLimit($limit);
} }
$result->setOffset($offset) $result->setOffset($offset)
->orderBy($sortColumn, $sortDir) ->orderBy($sortColumn, $sortDir);
;
$result = $result->find(); $result = $result->find();
$podcastArray = $result->toArray(null, false, BasePeer::TYPE_FIELDNAME); $podcastArray = $result->toArray(null, false, BasePeer::TYPE_FIELDNAME);
@ -51,8 +49,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
$this->getResponse() $this->getResponse()
->setHttpResponseCode(200) ->setHttpResponseCode(200)
->setHeader('X-TOTAL-COUNT', $total) ->setHeader('X-TOTAL-COUNT', $total)
->appendBody(json_encode($podcastArray)) ->appendBody(json_encode($podcastArray));
;
} }
public function getAction() public function getAction()
@ -65,8 +62,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
try { try {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(200) ->setHttpResponseCode(200)
->appendBody(json_encode(Application_Service_PodcastService::getPodcastById($id))) ->appendBody(json_encode(Application_Service_PodcastService::getPodcastById($id)));
;
} catch (PodcastNotFoundException $e) { } catch (PodcastNotFoundException $e) {
$this->podcastNotFoundResponse(); $this->podcastNotFoundResponse();
Logging::error($e->getMessage()); Logging::error($e->getMessage());
@ -100,8 +96,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
} catch (InvalidPodcastException $e) { } catch (InvalidPodcastException $e) {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(400) ->setHttpResponseCode(400)
->appendBody('Invalid podcast!') ->appendBody('Invalid podcast!');
;
} catch (Exception $e) { } catch (Exception $e) {
Logging::error($e->getMessage()); Logging::error($e->getMessage());
$this->unknownErrorResponse(); $this->unknownErrorResponse();
@ -121,8 +116,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
$this->getResponse() $this->getResponse()
->setHttpResponseCode(201) ->setHttpResponseCode(201)
->appendBody(json_encode($podcast)) ->appendBody(json_encode($podcast));
;
} catch (PodcastNotFoundException $e) { } catch (PodcastNotFoundException $e) {
$this->podcastNotFoundResponse(); $this->podcastNotFoundResponse();
Logging::error($e->getMessage()); Logging::error($e->getMessage());
@ -142,8 +136,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
try { try {
Application_Service_PodcastService::deletePodcastById($id); Application_Service_PodcastService::deletePodcastById($id);
$this->getResponse() $this->getResponse()
->setHttpResponseCode(204) ->setHttpResponseCode(204);
;
} catch (PodcastNotFoundException $e) { } catch (PodcastNotFoundException $e) {
$this->podcastNotFoundResponse(); $this->podcastNotFoundResponse();
Logging::error($e->getMessage()); Logging::error($e->getMessage());
@ -161,8 +154,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
if ($this->_request->getMethod() != HttpRequestType::POST) { if ($this->_request->getMethod() != HttpRequestType::POST) {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(405) ->setHttpResponseCode(405)
->appendBody('ERROR: Method not accepted') ->appendBody('ERROR: Method not accepted');
;
return; return;
} }

View File

@ -35,8 +35,7 @@ class Rest_PodcastEpisodesController extends Zend_Rest_Controller
try { try {
$totalPodcastEpisodesCount = PodcastEpisodesQuery::create() $totalPodcastEpisodesCount = PodcastEpisodesQuery::create()
->filterByDbPodcastId($id) ->filterByDbPodcastId($id)
->count() ->count();
;
// Check if offset and limit were sent with request. // Check if offset and limit were sent with request.
// Default limit to zero and offset to $totalFileCount // Default limit to zero and offset to $totalFileCount
@ -50,8 +49,7 @@ class Rest_PodcastEpisodesController extends Zend_Rest_Controller
$this->getResponse() $this->getResponse()
->setHttpResponseCode(201) ->setHttpResponseCode(201)
->setHeader('X-TOTAL-COUNT', $totalPodcastEpisodesCount) ->setHeader('X-TOTAL-COUNT', $totalPodcastEpisodesCount)
->appendBody(json_encode($this->_service->getPodcastEpisodes($id, $offset, $limit, $sortColumn, $sortDir))) ->appendBody(json_encode($this->_service->getPodcastEpisodes($id, $offset, $limit, $sortColumn, $sortDir)));
;
} catch (PodcastNotFoundException $e) { } catch (PodcastNotFoundException $e) {
$this->podcastNotFoundResponse(); $this->podcastNotFoundResponse();
Logging::error($e->getMessage()); Logging::error($e->getMessage());
@ -77,8 +75,7 @@ class Rest_PodcastEpisodesController extends Zend_Rest_Controller
try { try {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(201) ->setHttpResponseCode(201)
->appendBody(json_encode($this->_service->getPodcastEpisodeById($episodeId))) ->appendBody(json_encode($this->_service->getPodcastEpisodeById($episodeId)));
;
} catch (PodcastNotFoundException $e) { } catch (PodcastNotFoundException $e) {
$this->podcastNotFoundResponse(); $this->podcastNotFoundResponse();
Logging::error($e->getMessage()); Logging::error($e->getMessage());
@ -115,8 +112,7 @@ class Rest_PodcastEpisodesController extends Zend_Rest_Controller
$episode = $this->_service->importEpisode($id, $requestData['episode']); $episode = $this->_service->importEpisode($id, $requestData['episode']);
$this->getResponse() $this->getResponse()
->setHttpResponseCode(201) ->setHttpResponseCode(201)
->appendBody(json_encode($episode)) ->appendBody(json_encode($episode));
;
} catch (Exception $e) { } catch (Exception $e) {
$this->unknownErrorResponse(); $this->unknownErrorResponse();
Logging::error($e->getMessage()); Logging::error($e->getMessage());
@ -138,8 +134,7 @@ class Rest_PodcastEpisodesController extends Zend_Rest_Controller
try { try {
$this->_service->deletePodcastEpisodeById($episodeId); $this->_service->deletePodcastEpisodeById($episodeId);
$this->getResponse() $this->getResponse()
->setHttpResponseCode(204) ->setHttpResponseCode(204);
;
} catch (PodcastEpisodeNotFoundException $e) { } catch (PodcastEpisodeNotFoundException $e) {
$this->podcastEpisodeNotFoundResponse(); $this->podcastEpisodeNotFoundResponse();
Logging::error($e->getMessage()); Logging::error($e->getMessage());

View File

@ -56,8 +56,7 @@ class Rest_ShowImageController extends Zend_Rest_Controller
if (!$showId) { if (!$showId) {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(400) ->setHttpResponseCode(400)
->appendBody('No show ID provided') ->appendBody('No show ID provided');
;
return; return;
} }
@ -67,8 +66,7 @@ class Rest_ShowImageController extends Zend_Rest_Controller
} catch (Exception $e) { } catch (Exception $e) {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(500) ->setHttpResponseCode(500)
->appendBody('Error processing image: ' . $e->getMessage()) ->appendBody('Error processing image: ' . $e->getMessage());
;
return; return;
} }
@ -88,13 +86,11 @@ class Rest_ShowImageController extends Zend_Rest_Controller
$con->rollBack(); $con->rollBack();
$this->getResponse() $this->getResponse()
->setHttpResponseCode(500) ->setHttpResponseCode(500)
->appendBody("Couldn't add show image: " . $e->getMessage()) ->appendBody("Couldn't add show image: " . $e->getMessage());
;
} }
$this->getResponse() $this->getResponse()
->setHttpResponseCode(201) ->setHttpResponseCode(201);
;
} }
/** /**
@ -107,8 +103,7 @@ class Rest_ShowImageController extends Zend_Rest_Controller
if (!$showId) { if (!$showId) {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(400) ->setHttpResponseCode(400)
->appendBody('No show ID provided') ->appendBody('No show ID provided');
;
return; return;
} }
@ -118,8 +113,7 @@ class Rest_ShowImageController extends Zend_Rest_Controller
} catch (Exception $e) { } catch (Exception $e) {
$this->getResponse() $this->getResponse()
->setHttpResponseCode(500) ->setHttpResponseCode(500)
->appendBody('Error processing image: ' . $e->getMessage()) ->appendBody('Error processing image: ' . $e->getMessage());
;
} }
$show = CcShowQuery::create()->findPk($showId); $show = CcShowQuery::create()->findPk($showId);
@ -137,13 +131,11 @@ class Rest_ShowImageController extends Zend_Rest_Controller
$con->rollBack(); $con->rollBack();
$this->getResponse() $this->getResponse()
->setHttpResponseCode(500) ->setHttpResponseCode(500)
->appendBody("Couldn't remove show image: " . $e->getMessage()) ->appendBody("Couldn't remove show image: " . $e->getMessage());
;
} }
$this->getResponse() $this->getResponse()
->setHttpResponseCode(201) ->setHttpResponseCode(201);
;
} }
/** /**

View File

@ -13,8 +13,7 @@ class RestAuth
$action->getResponse() $action->getResponse()
->setHttpResponseCode(401) ->setHttpResponseCode(401)
->appendBody(json_encode(['message' => 'ERROR: Incorrect API key.'])) ->appendBody(json_encode(['message' => 'ERROR: Incorrect API key.']));
;
return false; return false;
} }
@ -30,8 +29,7 @@ class RestAuth
$defaultOwner = CcSubjsQuery::create() $defaultOwner = CcSubjsQuery::create()
->filterByDbType(['A', 'S'], Criteria::IN) ->filterByDbType(['A', 'S'], Criteria::IN)
->orderByDbId() ->orderByDbId()
->findOne() ->findOne();
;
if (!$defaultOwner) { if (!$defaultOwner) {
// what to do if there is no admin user? // what to do if there is no admin user?
// should we handle this case? // should we handle this case?

View File

@ -316,8 +316,7 @@ class Application_Service_CalendarService
$rebroadcasts = CcShowInstancesQuery::create() $rebroadcasts = CcShowInstancesQuery::create()
->filterByDbOriginalShow($this->ccShow->getDbId()) ->filterByDbOriginalShow($this->ccShow->getDbId())
->filterByDbStarts($minRebroadcastStart->format(DEFAULT_TIMESTAMP_FORMAT), Criteria::LESS_THAN) ->filterByDbStarts($minRebroadcastStart->format(DEFAULT_TIMESTAMP_FORMAT), Criteria::LESS_THAN)
->find() ->find();
;
if (count($rebroadcasts) > 0) { if (count($rebroadcasts) > 0) {
throw new Exception(_("Can't move a recorded show less than 1 hour before its rebroadcasts.")); throw new Exception(_("Can't move a recorded show less than 1 hour before its rebroadcasts."));
@ -327,8 +326,7 @@ class Application_Service_CalendarService
if ($this->ccShow->isRebroadcast()) { if ($this->ccShow->isRebroadcast()) {
$recordedShow = CcShowInstancesQuery::create() $recordedShow = CcShowInstancesQuery::create()
->filterByCcShow($this->ccShowInstance->getDbOriginalShow()) ->filterByCcShow($this->ccShowInstance->getDbOriginalShow())
->findOne() ->findOne();
;
if (is_null($recordedShow)) { if (is_null($recordedShow)) {
$this->ccShowInstance->delete(); $this->ccShowInstance->delete();
@ -363,8 +361,7 @@ class Application_Service_CalendarService
$this->ccShowInstance $this->ccShowInstance
->setDbStarts($newStartsDateTime) ->setDbStarts($newStartsDateTime)
->setDbEnds($newEndsDateTime) ->setDbEnds($newEndsDateTime)
->save($con) ->save($con);
;
if (!$this->ccShowInstance->getCcShow()->isRebroadcast()) { if (!$this->ccShowInstance->getCcShow()->isRebroadcast()) {
//we can get the first show day because we know the show is //we can get the first show day because we know the show is
@ -374,8 +371,7 @@ class Application_Service_CalendarService
$ccShowDay $ccShowDay
->setDbFirstShow($newStartsDateTime->setTimezone($showTimezone)->format('Y-m-d')) ->setDbFirstShow($newStartsDateTime->setTimezone($showTimezone)->format('Y-m-d'))
->setDbStartTime($newStartsDateTime->format('H:i')) ->setDbStartTime($newStartsDateTime->format('H:i'))
->save($con) ->save($con);
;
} }
$diff = $newStartsDateTime->getTimestamp() - $oldStartDateTime->getTimestamp(); $diff = $newStartsDateTime->getTimestamp() - $oldStartDateTime->getTimestamp();

View File

@ -450,8 +450,7 @@ class Application_Service_HistoryService
$hostRecords = CcShowHostsQuery::create() $hostRecords = CcShowHostsQuery::create()
->filterByDbHost($user->getId()) ->filterByDbHost($user->getId())
->filterByDbShow($showIds) ->filterByDbShow($showIds)
->find($this->con) ->find($this->con);
;
$filteredShowIds = []; $filteredShowIds = [];
@ -563,8 +562,7 @@ class Application_Service_HistoryService
->filterByDbStarts($recordStart) ->filterByDbStarts($recordStart)
->filterByDbEnds($recordEnd) ->filterByDbEnds($recordEnd)
->filterByDbFileId($fileId) ->filterByDbFileId($fileId)
->findOne($this->con) ->findOne($this->con);
;
if (empty($prevRecord)) { if (empty($prevRecord)) {
$history = new CcPlayoutHistory(); $history = new CcPlayoutHistory();
@ -1172,8 +1170,7 @@ class Application_Service_HistoryService
try { try {
$query = CcPlayoutHistoryTemplateQuery::create() $query = CcPlayoutHistoryTemplateQuery::create()
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND) ->setFormatter(ModelCriteria::FORMAT_ON_DEMAND);
;
if (isset($type)) { if (isset($type)) {
$templates = $query->findByDbType($type); $templates = $query->findByDbType($type);

View File

@ -137,8 +137,7 @@ class Application_Service_MediaService
self::$_pendingFiles = CcFilesQuery::create() self::$_pendingFiles = CcFilesQuery::create()
->filterByDbImportStatus(CcFiles::IMPORT_STATUS_PENDING) ->filterByDbImportStatus(CcFiles::IMPORT_STATUS_PENDING)
->filterByDbUtime($oneHourAgo, Criteria::LESS_EQUAL) ->filterByDbUtime($oneHourAgo, Criteria::LESS_EQUAL)
->find() ->find();
;
$pendingEpisodes = Application_Service_PodcastEpisodeService::getStuckPendingImports(); $pendingEpisodes = Application_Service_PodcastEpisodeService::getStuckPendingImports();
return !self::$_pendingFiles->isEmpty() || !empty($pendingEpisodes); return !self::$_pendingFiles->isEmpty() || !empty($pendingEpisodes);

View File

@ -269,8 +269,7 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir
PodcastEpisodesQuery::create() PodcastEpisodesQuery::create()
->filterByDbPodcastId($id) ->filterByDbPodcastId($id)
->findOneByDbFileId($fileId) ->findOneByDbFileId($fileId)
->delete() ->delete();
;
} }
/** /**
@ -286,8 +285,7 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir
public function getPublishStatus($fileId) public function getPublishStatus($fileId)
{ {
$stationPodcast = StationPodcastQuery::create() $stationPodcast = StationPodcastQuery::create()
->findOneByDbPodcastId(Application_Model_Preference::getStationPodcastId()) ->findOneByDbPodcastId(Application_Model_Preference::getStationPodcastId());
;
return (int) $stationPodcast->hasEpisodeForFile($fileId); return (int) $stationPodcast->hasEpisodeForFile($fileId);
} }
@ -305,18 +303,15 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir
$timeout = gmdate(DEFAULT_TIMESTAMP_FORMAT, (microtime(true) - self::PENDING_EPISODE_TIMEOUT_SECONDS)); $timeout = gmdate(DEFAULT_TIMESTAMP_FORMAT, (microtime(true) - self::PENDING_EPISODE_TIMEOUT_SECONDS));
$episodes = PodcastEpisodesQuery::create() $episodes = PodcastEpisodesQuery::create()
->filterByDbFileId() ->filterByDbFileId()
->find() ->find();
;
$stuckImports = []; $stuckImports = [];
foreach ($episodes as $episode) { foreach ($episodes as $episode) {
$ref = ThirdPartyTrackReferencesQuery::create() $ref = ThirdPartyTrackReferencesQuery::create()
->findOneByDbForeignId(strval($episode->getDbId())) ->findOneByDbForeignId(strval($episode->getDbId()));
;
if (!empty($ref)) { if (!empty($ref)) {
$task = CeleryTasksQuery::create() $task = CeleryTasksQuery::create()
->filterByDbDispatchTime($timeout, Criteria::LESS_EQUAL) ->filterByDbDispatchTime($timeout, Criteria::LESS_EQUAL)
->findOneByDbTrackReference($ref->getDbId()) ->findOneByDbTrackReference($ref->getDbId());
;
if (!empty($task)) { if (!empty($task)) {
array_push($stuckImports, $episode); array_push($stuckImports, $episode);
} }
@ -372,8 +367,7 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir
$isStationPodcast = $podcastId == Application_Model_Preference::getStationPodcastId(); $isStationPodcast = $podcastId == Application_Model_Preference::getStationPodcastId();
$episodes = PodcastEpisodesQuery::create() $episodes = PodcastEpisodesQuery::create()
->filterByDbPodcastId($podcastId) ->filterByDbPodcastId($podcastId);
;
if ($isStationPodcast && $limit != 0) { if ($isStationPodcast && $limit != 0) {
$episodes = $episodes->setLimit($limit); $episodes = $episodes->setLimit($limit);
} }
@ -382,8 +376,7 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir
$episodes = $episodes->joinWith('PodcastEpisodes.CcFiles', Criteria::LEFT_JOIN) $episodes = $episodes->joinWith('PodcastEpisodes.CcFiles', Criteria::LEFT_JOIN)
->setOffset($offset) ->setOffset($offset)
->orderBy($sortColumn, $sortDir) ->orderBy($sortColumn, $sortDir)
->find() ->find();
;
return $isStationPodcast ? $this->_getStationPodcastEpisodeArray($episodes) return $isStationPodcast ? $this->_getStationPodcastEpisodeArray($episodes)
: $this->_getImportedPodcastEpisodeArray($podcast, $episodes); : $this->_getImportedPodcastEpisodeArray($podcast, $episodes);

View File

@ -236,8 +236,7 @@ class Application_Service_PodcastService
$defaultOwner = CcSubjsQuery::create() $defaultOwner = CcSubjsQuery::create()
->filterByDbType('A') ->filterByDbType('A')
->orderByDbId() ->orderByDbId()
->findOne() ->findOne();
;
if (!$defaultOwner) { if (!$defaultOwner) {
// what to do if there is no admin user? // what to do if there is no admin user?
// should we handle this case? // should we handle this case?

View File

@ -54,8 +54,7 @@ class Application_Service_SchedulerService
$ccSchedules = CcScheduleQuery::create() $ccSchedules = CcScheduleQuery::create()
->filterByDbInstanceId($instanceIds, Criteria::IN) ->filterByDbInstanceId($instanceIds, Criteria::IN)
->find($con) ->find($con);
;
$interval = new DateInterval('PT' . abs($diff) . 'S'); $interval = new DateInterval('PT' . abs($diff) . 'S');
if ($diff < 0) { if ($diff < 0) {
@ -69,8 +68,7 @@ class Application_Service_SchedulerService
$ccSchedule $ccSchedule
->setDbStarts($newStart) ->setDbStarts($newStart)
->setDbEnds($newEnd) ->setDbEnds($newEnd)
->save($con) ->save($con);
;
} }
} }
} }
@ -94,16 +92,14 @@ class Application_Service_SchedulerService
->filterByDbInstanceId($instance->getDbId()) ->filterByDbInstanceId($instance->getDbId())
->filterByDbId($schedIds, Criteria::NOT_IN) ->filterByDbId($schedIds, Criteria::NOT_IN)
->orderByDbStarts() ->orderByDbStarts()
->find() ->find();
;
foreach ($ccScheduleItems as $ccSchedule) { foreach ($ccScheduleItems as $ccSchedule) {
//DateTime object //DateTime object
$itemEnd = $this->findEndTime($itemStart, $ccSchedule->getDbClipLength()); $itemEnd = $this->findEndTime($itemStart, $ccSchedule->getDbClipLength());
$ccSchedule->setDbStarts($itemStart) $ccSchedule->setDbStarts($itemStart)
->setDbEnds($itemEnd) ->setDbEnds($itemEnd);
;
$itemStart = $itemEnd; $itemStart = $itemEnd;
} }
@ -184,8 +180,7 @@ class Application_Service_SchedulerService
->filterByDbId($instancsIdsToFill, Criteria::NOT_IN) ->filterByDbId($instancsIdsToFill, Criteria::NOT_IN)
->orderByDbStarts(Criteria::DESC) ->orderByDbStarts(Criteria::DESC)
->limit(1) ->limit(1)
->findOne() ->findOne();
;
if (is_null($showInstanceWithMostRecentSchedule)) { if (is_null($showInstanceWithMostRecentSchedule)) {
return null; return null;
@ -341,8 +336,7 @@ class Application_Service_SchedulerService
foreach ($ccShow->getCcShowInstancess() as $ccShowInstance) { foreach ($ccShow->getCcShowInstancess() as $ccShowInstance) {
$ccSchedules = CcScheduleQuery::create() $ccSchedules = CcScheduleQuery::create()
->filterByDbInstanceId($ccShowInstance->getDbId()) ->filterByDbInstanceId($ccShowInstance->getDbId())
->find() ->find();
;
if ($ccSchedules->isEmpty()) { if ($ccSchedules->isEmpty()) {
$nextStartDT = $ccShowInstance->getDbStarts(null); $nextStartDT = $ccShowInstance->getDbStarts(null);
@ -363,8 +357,7 @@ class Application_Service_SchedulerService
->setDbCueOut($item->getDbCueOut()) ->setDbCueOut($item->getDbCueOut())
->setDbInstanceId($ccShowInstance->getDbId()) ->setDbInstanceId($ccShowInstance->getDbId())
->setDbPosition($item->getDbPosition()) ->setDbPosition($item->getDbPosition())
->save() ->save();
;
$nextStartDT = self::findTimeDifference( $nextStartDT = self::findTimeDifference(
$endTimeDT, $endTimeDT,
@ -375,8 +368,7 @@ class Application_Service_SchedulerService
$ccShowInstance $ccShowInstance
->setDbTimeFilled($timeFilled) ->setDbTimeFilled($timeFilled)
->setDbLastScheduled(gmdate(DEFAULT_TIMESTAMP_FORMAT)) ->setDbLastScheduled(gmdate(DEFAULT_TIMESTAMP_FORMAT))
->save() ->save();
;
} }
} }
} }
@ -450,8 +442,7 @@ class Application_Service_SchedulerService
$ccSchedules = CcScheduleQuery::create() $ccSchedules = CcScheduleQuery::create()
->filterByDbInstanceId($instanceIds, Criteria::IN) ->filterByDbInstanceId($instanceIds, Criteria::IN)
->setDistinct(CcSchedulePeer::FILE_ID) ->setDistinct(CcSchedulePeer::FILE_ID)
->find() ->find();
;
$fileIds = []; $fileIds = [];
foreach ($ccSchedules as $ccSchedule) { foreach ($ccSchedules as $ccSchedule) {
$fileIds[] = $ccSchedule->getDbFileId(); $fileIds[] = $ccSchedule->getDbFileId();
@ -460,8 +451,7 @@ class Application_Service_SchedulerService
// Clear out the schedule // Clear out the schedule
CcScheduleQuery::create() CcScheduleQuery::create()
->filterByDbInstanceId($instanceIds, Criteria::IN) ->filterByDbInstanceId($instanceIds, Criteria::IN)
->delete() ->delete();
;
/* Now that the schedule has been cleared we need to make /* Now that the schedule has been cleared we need to make
* sure we do not update the is_scheduled flag for tracks * sure we do not update the is_scheduled flag for tracks

View File

@ -217,8 +217,7 @@ class Application_Service_ShowFormService
->filterByDbModifiedInstance(false) ->filterByDbModifiedInstance(false)
->filterByDbStarts(gmdate('Y-m-d H:i:s'), Criteria::GREATER_THAN) ->filterByDbStarts(gmdate('Y-m-d H:i:s'), Criteria::GREATER_THAN)
->orderByDbStarts() ->orderByDbStarts()
->findOne() ->findOne();
;
if (!$ccShowInstance) { if (!$ccShowInstance) {
return null; return null;
@ -517,8 +516,7 @@ class Application_Service_ShowFormService
->filterByDbModifiedInstance(false) ->filterByDbModifiedInstance(false)
->filterByDbStarts(gmdate('Y-m-d H:i:s'), Criteria::GREATER_EQUAL) ->filterByDbStarts(gmdate('Y-m-d H:i:s'), Criteria::GREATER_EQUAL)
->orderByDbStarts() ->orderByDbStarts()
->findOne() ->findOne();
;
if (!$ccShowInstance) { if (!$ccShowInstance) {
return null; return null;

View File

@ -73,8 +73,7 @@ class Application_Service_ShowService
//get the ccShow object to which this instance belongs //get the ccShow object to which this instance belongs
//so we can get the original start date and time //so we can get the original start date and time
$this->ccShow = CcShowQuery::create() $this->ccShow = CcShowQuery::create()
->findPk($showId) ->findPk($showId);
;
//DateTime in shows's local time //DateTime in shows's local time
$newStartDateTime = new DateTime( $newStartDateTime = new DateTime(
@ -84,8 +83,7 @@ class Application_Service_ShowService
); );
$ccShowInstanceOrig = CcShowInstancesQuery::create() $ccShowInstanceOrig = CcShowInstancesQuery::create()
->findPk($showData['add_show_instance_id']) ->findPk($showData['add_show_instance_id']);
;
//convert original start time into the show's local timezone //convert original start time into the show's local timezone
$origLocalStartDateTime = $ccShowInstanceOrig->getLocalStartDateTime(); $origLocalStartDateTime = $ccShowInstanceOrig->getLocalStartDateTime();
@ -120,8 +118,7 @@ class Application_Service_ShowService
->filterByDbRepeatType(-1) ->filterByDbRepeatType(-1)
->filterByDbFirstShow($origLocalStartDateTime->format('Y-m-d')) ->filterByDbFirstShow($origLocalStartDateTime->format('Y-m-d'))
->filterByDbStartTime($origLocalStartDateTime->format('H:i:s')) ->filterByDbStartTime($origLocalStartDateTime->format('H:i:s'))
->delete() ->delete();
;
/* /*
* Set the new cc_show_day record * Set the new cc_show_day record
@ -139,8 +136,7 @@ class Application_Service_ShowService
->filterByDbRepeatType(-1) ->filterByDbRepeatType(-1)
->filterByDbFirstShow($showData['add_show_start_date']) ->filterByDbFirstShow($showData['add_show_start_date'])
->filterByDbStartTime($showData['add_show_start_time'] . ':00') ->filterByDbStartTime($showData['add_show_start_time'] . ':00')
->findOne() ->findOne();
;
$ccShowInstance = $this->createNonRepeatingInstance( $ccShowInstance = $this->createNonRepeatingInstance(
$showDay, $showDay,
@ -159,15 +155,13 @@ class Application_Service_ShowService
$ccShowInstance->updateScheduleStatus($con); $ccShowInstance->updateScheduleStatus($con);
$ccShowInstance $ccShowInstance
->setDbDescription($showData['add_show_instance_description']) ->setDbDescription($showData['add_show_instance_description'])
->save() ->save();
;
//delete the edited instance from the repeating sequence //delete the edited instance from the repeating sequence
$ccShowInstanceOrig $ccShowInstanceOrig
->setDbModifiedInstance(true) ->setDbModifiedInstance(true)
->setDbDescription($showData['add_show_instance_description']) ->setDbDescription($showData['add_show_instance_description'])
->save() ->save();
;
$con->commit(); $con->commit();
Application_Model_RabbitMq::PushSchedule(); Application_Model_RabbitMq::PushSchedule();
@ -346,8 +340,7 @@ class Application_Service_ShowService
*/ */
$ccShowDays = CcShowDaysQuery::create() $ccShowDays = CcShowDaysQuery::create()
->filterByDbShowId($this->ccShow->getDbId()) ->filterByDbShowId($this->ccShow->getDbId())
->find() ->find();
;
} }
} }
@ -521,8 +514,7 @@ SQL;
{ {
CcShowDaysQuery::create() CcShowDaysQuery::create()
->filterByDbShowId($showId) ->filterByDbShowId($showId)
->delete() ->delete();
;
} }
/** /**
@ -776,8 +768,7 @@ SQL;
CcShowDaysQuery::create() CcShowDaysQuery::create()
->filterByDbShowId($showId) ->filterByDbShowId($showId)
->filterByDbDay($day) ->filterByDbDay($day)
->delete() ->delete();
;
} }
$uncheckedDays = pg_escape_string(implode(',', $daysRemovedUTC)); $uncheckedDays = pg_escape_string(implode(',', $daysRemovedUTC));
@ -812,8 +803,7 @@ SQL;
} }
$ccShowInstance = CcShowInstancesQuery::create() $ccShowInstance = CcShowInstancesQuery::create()
->findPk($instanceId) ->findPk($instanceId);
;
if (!$ccShowInstance) { if (!$ccShowInstance) {
throw new Exception('Could not find show instance'); throw new Exception('Could not find show instance');
} }
@ -830,8 +820,7 @@ SQL;
$ccShowInstances = CcShowInstancesQuery::create() $ccShowInstances = CcShowInstancesQuery::create()
->filterByDbShowId($showId) ->filterByDbShowId($showId)
->filterByDbStarts($ccShowInstance->getDbStarts(), Criteria::GREATER_EQUAL) ->filterByDbStarts($ccShowInstance->getDbStarts(), Criteria::GREATER_EQUAL)
->find() ->find();
;
} }
if (gmdate(DEFAULT_TIMESTAMP_FORMAT) <= $ccShowInstance->getDbEnds()) { if (gmdate(DEFAULT_TIMESTAMP_FORMAT) <= $ccShowInstance->getDbEnds()) {
@ -863,29 +852,25 @@ SQL;
$ccShowInstance $ccShowInstance
->setDbModifiedInstance(true) ->setDbModifiedInstance(true)
->save() ->save();
;
//delete the rebroadcasts of the removed recorded show //delete the rebroadcasts of the removed recorded show
if ($ccShowInstance->isRecorded()) { if ($ccShowInstance->isRecorded()) {
CcShowInstancesQuery::create() CcShowInstancesQuery::create()
->filterByDbOriginalShow($instanceId) ->filterByDbOriginalShow($instanceId)
->delete() ->delete();
;
} }
//delete all files scheduled in cc_schedules table //delete all files scheduled in cc_schedules table
CcScheduleQuery::create() CcScheduleQuery::create()
->filterByDbInstanceId($instanceId) ->filterByDbInstanceId($instanceId)
->delete() ->delete();
;
} }
if ($this->checkToDeleteCcShow($showId)) { if ($this->checkToDeleteCcShow($showId)) {
CcShowQuery::create() CcShowQuery::create()
->filterByDbId($showId) ->filterByDbId($showId)
->delete() ->delete();
;
/* There is only one cc_show_instance if the user selects 'Delete This Instance' /* There is only one cc_show_instance if the user selects 'Delete This Instance'
* There is more than one cc_show_instance if the user selects 'Delete This * There is more than one cc_show_instance if the user selects 'Delete This
* Instance and All Following'. We only need to set the last_show value * Instance and All Following'. We only need to set the last_show value
@ -903,8 +888,7 @@ SQL;
->filterByDbModifiedInstance(false) ->filterByDbModifiedInstance(false)
->filterByDbRebroadcast(0) ->filterByDbRebroadcast(0)
->orderByDbStarts() ->orderByDbStarts()
->find() ->find();
;
/* We need to update the last_show in cc_show_days so the instances /* We need to update the last_show in cc_show_days so the instances
* don't get recreated as the user moves forward in the calendar * don't get recreated as the user moves forward in the calendar
@ -935,8 +919,7 @@ SQL;
->filterByDbShowId($showId) ->filterByDbShowId($showId)
->filterByDbDay($dayOfWeek) ->filterByDbDay($dayOfWeek)
->filterByDbRepeatType(-1, Criteria::NOT_EQUAL) ->filterByDbRepeatType(-1, Criteria::NOT_EQUAL)
->findOne() ->findOne();
;
if (isset($ccShowDay)) { if (isset($ccShowDay)) {
$lastShowStartDT->setTimeZone(new DateTimeZone( $lastShowStartDT->setTimeZone(new DateTimeZone(
@ -950,8 +933,7 @@ SQL;
$ccShowDay $ccShowDay
->setDbLastShow($lastShowEndDT->format('Y-m-d')) ->setDbLastShow($lastShowEndDT->format('Y-m-d'))
->save() ->save();
;
} }
} }
@ -962,8 +944,7 @@ SQL;
->filterByDbShowId($showId) ->filterByDbShowId($showId)
->filterByDbRepeatType(0, Criteria::GREATER_EQUAL) ->filterByDbRepeatType(0, Criteria::GREATER_EQUAL)
->filterByDbLastShow(null) ->filterByDbLastShow(null)
->find() ->find();
;
foreach ($showDays as $showDay) { foreach ($showDays as $showDay) {
$showDay->setDbLastShow($showDay->getDbFirstShow())->save(); $showDay->setDbLastShow($showDay->getDbFirstShow())->save();
} }
@ -977,8 +958,7 @@ SQL;
->filterByDbModifiedInstance(false) ->filterByDbModifiedInstance(false)
->filterByDbRebroadcast(0) ->filterByDbRebroadcast(0)
->orderByDbStarts() ->orderByDbStarts()
->find() ->find();
;
if ($ccShowInstances->isEmpty()) { if ($ccShowInstances->isEmpty()) {
return true; return true;
@ -1612,8 +1592,7 @@ SQL;
//->filterByDbModifiedInstance(false, Criteria::EQUAL) //->filterByDbModifiedInstance(false, Criteria::EQUAL)
->filterByDbRebroadcast(0, Criteria::EQUAL) ->filterByDbRebroadcast(0, Criteria::EQUAL)
->limit(1) ->limit(1)
->find() ->find();
;
if ($ccShowInstance->isEmpty()) { if ($ccShowInstance->isEmpty()) {
return false; return false;
@ -1634,8 +1613,7 @@ SQL;
->filterByDbDay($day) ->filterByDbDay($day)
->filterByDbRepeatType($repeatType) ->filterByDbRepeatType($repeatType)
->limit(1) ->limit(1)
->find() ->find();
;
if ($ccShowDay->isEmpty()) { if ($ccShowDay->isEmpty()) {
return false; return false;
@ -1728,8 +1706,7 @@ SQL;
$showDay = CcShowDaysQuery::create() $showDay = CcShowDaysQuery::create()
->filterByDbShowId($showId) ->filterByDbShowId($showId)
->filterByDbRepeatType($this->origCcShowDay->getDbRepeatType()) ->filterByDbRepeatType($this->origCcShowDay->getDbRepeatType())
->findOne() ->findOne();
;
if (!$showDay) { if (!$showDay) {
//repeat type changed so we have to create a new show_day rule //repeat type changed so we have to create a new show_day rule
$showDay = new CcShowDays(); $showDay = new CcShowDays();
@ -1778,8 +1755,7 @@ SQL;
->filterByDbShowId($showId) ->filterByDbShowId($showId)
->filterByDbRepeatType($this->origCcShowDay->getDbRepeatType()) ->filterByDbRepeatType($this->origCcShowDay->getDbRepeatType())
->filterByDbDay($day) ->filterByDbDay($day)
->findOne() ->findOne();
;
if (!$showDay) { if (!$showDay) {
//if no show day object was found it is because a new //if no show day object was found it is because a new
//repeating day of the week was added OR the repeat //repeating day of the week was added OR the repeat
@ -1959,11 +1935,9 @@ SQL;
->filterByDbShowId($showId) ->filterByDbShowId($showId)
->filterByDbDay($day) ->filterByDbDay($day)
->filterByDbRepeatType(-1, Criteria::NOT_EQUAL) ->filterByDbRepeatType(-1, Criteria::NOT_EQUAL)
->findOne() ->findOne();
;
$repeatInfo->setDbNextPopDate($nextInfo[0]) $repeatInfo->setDbNextPopDate($nextInfo[0])
->save() ->save();
;
} }
} }

View File

@ -104,8 +104,7 @@ abstract class Application_Service_ThirdPartyCeleryService extends Application_S
{ {
static::updateTask($task, $status); static::updateTask($task, $status);
$ref = ThirdPartyTrackReferencesQuery::create() $ref = ThirdPartyTrackReferencesQuery::create()
->findOneByDbId($trackId) ->findOneByDbId($trackId);
;
if (is_null($ref)) { if (is_null($ref)) {
$ref = new ThirdPartyTrackReferences(); $ref = new ThirdPartyTrackReferences();
} }

View File

@ -35,8 +35,7 @@ abstract class Application_Service_ThirdPartyService
// If the file ID given is null, create a new reference // If the file ID given is null, create a new reference
$ref = is_null($fileId) ? null : ThirdPartyTrackReferencesQuery::create() $ref = is_null($fileId) ? null : ThirdPartyTrackReferencesQuery::create()
->filterByDbService(static::$_SERVICE_NAME) ->filterByDbService(static::$_SERVICE_NAME)
->findOneByDbFileId($fileId) ->findOneByDbFileId($fileId);
;
if (is_null($ref)) { if (is_null($ref)) {
$ref = new ThirdPartyTrackReferences(); $ref = new ThirdPartyTrackReferences();
} }
@ -61,8 +60,7 @@ abstract class Application_Service_ThirdPartyService
{ {
$ref = ThirdPartyTrackReferencesQuery::create() $ref = ThirdPartyTrackReferencesQuery::create()
->filterByDbService(static::$_SERVICE_NAME) ->filterByDbService(static::$_SERVICE_NAME)
->findOneByDbFileId($fileId) ->findOneByDbFileId($fileId);
;
$ref->delete(); $ref->delete();
} }
@ -79,7 +77,7 @@ abstract class Application_Service_ThirdPartyService
$ref = ThirdPartyTrackReferencesQuery::create() $ref = ThirdPartyTrackReferencesQuery::create()
->filterByDbService(static::$_SERVICE_NAME) ->filterByDbService(static::$_SERVICE_NAME)
->findOneByDbFileId($fileId) // There shouldn't be duplicates! ->findOneByDbFileId($fileId) // There shouldn't be duplicates!
; ;
return empty($ref) ? '' : $ref->getDbForeignId(); return empty($ref) ? '' : $ref->getDbForeignId();
} }
@ -97,13 +95,11 @@ abstract class Application_Service_ThirdPartyService
{ {
$ref = ThirdPartyTrackReferencesQuery::create() $ref = ThirdPartyTrackReferencesQuery::create()
->filterByDbService(static::$_SERVICE_NAME) ->filterByDbService(static::$_SERVICE_NAME)
->findOneByDbFileId($fileId) ->findOneByDbFileId($fileId);
;
if (!empty($ref)) { if (!empty($ref)) {
$task = CeleryTasksQuery::create() $task = CeleryTasksQuery::create()
->orderByDbDispatchTime(Criteria::DESC) ->orderByDbDispatchTime(Criteria::DESC)
->findOneByDbTrackReference($ref->getDbId()) ->findOneByDbTrackReference($ref->getDbId());
;
return $task->getDbStatus() == CELERY_PENDING_STATUS ? -1 return $task->getDbStatus() == CELERY_PENDING_STATUS ? -1
: ($task->getDbStatus() == CELERY_FAILED_STATUS ? 0 : 1); : ($task->getDbStatus() == CELERY_FAILED_STATUS ? 0 : 1);

View File

@ -302,23 +302,20 @@ class AirtimeUpgrader254 extends AirtimeUpgrader
$numberOfSuperAdmins = CcSubjsQuery::create() $numberOfSuperAdmins = CcSubjsQuery::create()
->filterByDbType(UTYPE_SUPERADMIN) ->filterByDbType(UTYPE_SUPERADMIN)
->filterByDbLogin('sourcefabric_admin', Criteria::NOT_EQUAL) //Ignore sourcefabric_admin users ->filterByDbLogin('sourcefabric_admin', Criteria::NOT_EQUAL) //Ignore sourcefabric_admin users
->count() ->count();
;
//Only create a super admin if there isn't one already. //Only create a super admin if there isn't one already.
if ($numberOfSuperAdmins == 0) { if ($numberOfSuperAdmins == 0) {
//Find the "admin" user and promote them to superadmin. //Find the "admin" user and promote them to superadmin.
$adminUser = CcSubjsQuery::create() $adminUser = CcSubjsQuery::create()
->filterByDbLogin('admin') ->filterByDbLogin('admin')
->findOne() ->findOne();
;
if (!$adminUser) { if (!$adminUser) {
// Otherwise get the user with the lowest ID that is of type administrator: // Otherwise get the user with the lowest ID that is of type administrator:
$adminUser = CcSubjsQuery::create() $adminUser = CcSubjsQuery::create()
->filterByDbType(UTYPE_ADMIN) ->filterByDbType(UTYPE_ADMIN)
->orderByDbId(Criteria::ASC) ->orderByDbId(Criteria::ASC)
->findOne() ->findOne();
;
if (!$adminUser) { if (!$adminUser) {
throw new Exception("Failed to find any users of type 'admin' ('A')."); throw new Exception("Failed to find any users of type 'admin' ('A').");
@ -333,8 +330,7 @@ class AirtimeUpgrader254 extends AirtimeUpgrader
//Also try to promote the sourcefabric_admin user //Also try to promote the sourcefabric_admin user
$sofabAdminUser = CcSubjsQuery::create() $sofabAdminUser = CcSubjsQuery::create()
->filterByDbLogin('sourcefabric_admin') ->filterByDbLogin('sourcefabric_admin')
->findOne() ->findOne();
;
if ($sofabAdminUser) { if ($sofabAdminUser) {
$sofabAdminUser = new Application_Model_User($sofabAdminUser->getDbId()); $sofabAdminUser = new Application_Model_User($sofabAdminUser->getDbId());
$sofabAdminUser->setType(UTYPE_SUPERADMIN); $sofabAdminUser->setType(UTYPE_SUPERADMIN);
@ -409,8 +405,7 @@ class AirtimeUpgrader2511 extends AirtimeUpgrader
$queryResult = CcFilesQuery::create() $queryResult = CcFilesQuery::create()
->select(['disk_usage']) ->select(['disk_usage'])
->withColumn('SUM(CcFiles.filesize)', 'disk_usage') ->withColumn('SUM(CcFiles.filesize)', 'disk_usage')
->find() ->find();
;
$disk_usage = $queryResult[0]; $disk_usage = $queryResult[0];
Application_Model_Preference::setDiskUsage($disk_usage); Application_Model_Preference::setDiskUsage($disk_usage);
} }

View File

@ -139,8 +139,7 @@ class MediaSetup extends Setup
$dir->setDirectory(self::$path) $dir->setDirectory(self::$path)
->setType('stor') ->setType('stor')
->save() ->save();
;
self::$message = 'Successfully set up media folder!'; self::$message = 'Successfully set up media folder!';
Propel::close(); Propel::close();
unset($_SERVER['AIRTIME_CONF']); unset($_SERVER['AIRTIME_CONF']);

View File

@ -8,8 +8,7 @@ class TestHelper
//pass to the adapter the submitted username and password //pass to the adapter the submitted username and password
$authAdapter->setIdentity('admin') $authAdapter->setIdentity('admin')
->setCredential('admin') ->setCredential('admin');
;
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
$result = $auth->authenticate($authAdapter); $result = $auth->authenticate($authAdapter);

View File

@ -520,8 +520,7 @@ class ShowServiceDbTest extends Zend_Test_PHPUnit_DatabaseTestCase
$ccFiles $ccFiles
->setDbCueIn('00:00:00') ->setDbCueIn('00:00:00')
->setDbCueOut('00:04:32') ->setDbCueOut('00:04:32')
->save() ->save();
;
$scheduleItems = [ $scheduleItems = [
0 => [ 0 => [
@ -578,8 +577,7 @@ class ShowServiceDbTest extends Zend_Test_PHPUnit_DatabaseTestCase
$ccFiles $ccFiles
->setDbCueIn('00:00:00') ->setDbCueIn('00:00:00')
->setDbCueOut('00:04:32') ->setDbCueOut('00:04:32')
->save() ->save();
;
$scheduleItems = [ $scheduleItems = [
0 => [ 0 => [