style(legacy): force semicolon on same line (#1534)
This commit is contained in:
parent
522d989cab
commit
8569af9328
|
@ -9,6 +9,7 @@ $config = new PhpCsFixer\Config();
|
|||
return $config->setRules([
|
||||
'@PhpCsFixer' => true,
|
||||
'concat_space' => ['spacing' => 'one'],
|
||||
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
|
||||
'ordered_class_elements' => false,
|
||||
'yoda_style' => false,
|
||||
])
|
||||
|
|
|
@ -107,7 +107,6 @@ class AutoPlaylistManager
|
|||
->filterByDbHasAutoPlaylist(true)
|
||||
->endUse()
|
||||
->filterByDbAutoPlaylistBuilt(false)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -163,8 +163,7 @@ class CeleryManager
|
|||
{
|
||||
$query = CeleryTasksQuery::create()
|
||||
->filterByDbStatus(CELERY_PENDING_STATUS)
|
||||
->filterByDbTaskId('', Criteria::NOT_EQUAL)
|
||||
;
|
||||
->filterByDbTaskId('', Criteria::NOT_EQUAL);
|
||||
if (!empty($taskName)) {
|
||||
$query->filterByDbName($taskName);
|
||||
}
|
||||
|
|
|
@ -117,8 +117,7 @@ class ZendActionHttpException extends Exception
|
|||
. " with status code {$statusCode}: {$message}");
|
||||
$action->getResponse()
|
||||
->setHttpResponseCode($statusCode)
|
||||
->appendBody($message)
|
||||
;
|
||||
->appendBody($message);
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,8 +92,7 @@ class PodcastManager
|
|||
{
|
||||
return ImportedPodcastQuery::create()
|
||||
->filterByDbAutoIngest(true)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -125,8 +125,7 @@ class Application_Common_UsabilityHints
|
|||
$fileCount = CcFilesQuery::create()
|
||||
->filterByDbFileExists(true)
|
||||
->filterByDbHidden(false)
|
||||
->count()
|
||||
;
|
||||
->count();
|
||||
|
||||
if ($fileCount == 0) {
|
||||
return true;
|
||||
|
@ -162,8 +161,7 @@ class Application_Common_UsabilityHints
|
|||
$scheduledTracks = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($currentShow->getDbId())
|
||||
->filterByDbEnds($now, Criteria::GREATER_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
if ($scheduledTracks->count() == 0) {
|
||||
return true;
|
||||
}
|
||||
|
@ -182,8 +180,7 @@ class Application_Common_UsabilityHints
|
|||
$scheduledTracks = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($futureShow->getDbId())
|
||||
->filterByDbStarts($now, Criteria::GREATER_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
if ($scheduledTracks->count() == 0) {
|
||||
return true;
|
||||
}
|
||||
|
@ -199,8 +196,7 @@ class Application_Common_UsabilityHints
|
|||
->filterByDbStarts($now, Criteria::LESS_THAN)
|
||||
->filterByDbEnds($now, Criteria::GREATER_THAN)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
}
|
||||
|
||||
private static function getNextFutureShow()
|
||||
|
@ -211,8 +207,7 @@ class Application_Common_UsabilityHints
|
|||
->filterByDbStarts($now, Criteria::GREATER_THAN)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->orderByDbStarts()
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
}
|
||||
|
||||
private static function isCurrentShowLinked()
|
||||
|
@ -221,8 +216,7 @@ class Application_Common_UsabilityHints
|
|||
if (!is_null($currentShow)) {
|
||||
$show = CcShowQuery::create()
|
||||
->filterByDbId($currentShow->getDbShowId())
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if ($show->isLinked()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -6,8 +6,7 @@ $ccAcl->addRole(new Zend_Acl_Role('G'))
|
|||
->addRole(new Zend_Acl_Role('H'), 'G')
|
||||
->addRole(new Zend_Acl_Role('P'), 'H')
|
||||
->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'))
|
||||
->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('embeddablewidgets'))
|
||||
->add(new Zend_Acl_Resource('setup'))
|
||||
->add(new Zend_Acl_Resource('feeds'))
|
||||
;
|
||||
->add(new Zend_Acl_Resource('feeds'));
|
||||
|
||||
// Creating permissions
|
||||
$ccAcl->allow('G', 'index')
|
||||
|
@ -84,8 +82,7 @@ $ccAcl->allow('G', 'index')
|
|||
->allow('A', 'user')
|
||||
->allow('A', 'tracktype')
|
||||
->allow('A', 'systemstatus')
|
||||
->allow('A', 'preference')
|
||||
;
|
||||
->allow('A', 'preference');
|
||||
|
||||
$aclPlugin = new Zend_Controller_Plugin_Acl($ccAcl);
|
||||
|
||||
|
|
|
@ -76,8 +76,7 @@ class ApiController extends Zend_Controller_Action
|
|||
->addActionContext('get-usability-hint', 'json')
|
||||
->addActionContext('poll-celery', 'json')
|
||||
->addActionContext('recalculate-schedule', 'json') //RKTN-260
|
||||
->initContext()
|
||||
;
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function checkAuth()
|
||||
|
@ -1412,8 +1411,7 @@ class ApiController extends Zend_Controller_Action
|
|||
$previous_metadata = CcWebstreamMetadataQuery::create()
|
||||
->orderByDbStartTime('desc')
|
||||
->filterByDbInstanceId($media_id)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
$do_insert = true;
|
||||
if ($previous_metadata) {
|
||||
|
@ -1723,8 +1721,7 @@ class ApiController extends Zend_Controller_Action
|
|||
->filterByDbStarts($now, Criteria::GREATER_THAN)
|
||||
//->filterByDbModifiedInstance(false)
|
||||
->orderByDbStarts()
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
//->find($this->con);
|
||||
$total = $showInstances->count();
|
||||
$progress = 0;
|
||||
|
@ -1771,7 +1768,6 @@ class ApiController extends Zend_Controller_Action
|
|||
$this->getResponse()
|
||||
->setHttpResponseCode($status)
|
||||
->setHeader('Content-Type', 'application/json')
|
||||
->setBody(json_encode(['error' => $message]))
|
||||
;
|
||||
->setBody(json_encode(['error' => $message]));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,8 +10,7 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
->addActionContext('get-show', 'json')
|
||||
->addActionContext('playlist-preview', 'json')
|
||||
->addActionContext('get-playlist', 'json')
|
||||
->initContext()
|
||||
;
|
||||
->initContext();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,8 +7,7 @@ class DashboardController extends Zend_Controller_Action
|
|||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('switch-source', 'json')
|
||||
->addActionContext('disconnect-source', 'json')
|
||||
->initContext()
|
||||
;
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
|
|
|
@ -15,8 +15,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
->addActionContext('set-num-entries', 'json')
|
||||
->addActionContext('edit-file-md', 'json')
|
||||
->addActionContext('publish-dialog', 'html')
|
||||
->initContext()
|
||||
;
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
|
|
|
@ -7,8 +7,7 @@ class ListenerstatController extends Zend_Controller_Action
|
|||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext
|
||||
->addActionContext('get-data', 'json')
|
||||
->initContext()
|
||||
;
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
|
|
|
@ -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')
|
||||
->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/styles.css?' . $CC_CONFIG['airtime_version'])
|
||||
;
|
||||
->appendStylesheet($baseUrl . 'css/styles.css?' . $CC_CONFIG['airtime_version']);
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
|
@ -64,8 +63,7 @@ class LoginController extends Zend_Controller_Action
|
|||
|
||||
//pass to the adapter the submitted username and password
|
||||
$authAdapter->setIdentity($username)
|
||||
->setCredential($password)
|
||||
;
|
||||
->setCredential($password);
|
||||
|
||||
$result = $auth->authenticate($authAdapter);
|
||||
if ($result->isValid()) {
|
||||
|
@ -142,8 +140,7 @@ class LoginController extends Zend_Controller_Action
|
|||
$query->filterByDbLogin($username);
|
||||
} else {
|
||||
$query->filterByDbEmail($email)
|
||||
->filterByDbLogin($username)
|
||||
;
|
||||
->filterByDbLogin($username);
|
||||
}
|
||||
$user = $query->findOne();
|
||||
|
||||
|
@ -212,8 +209,7 @@ class LoginController extends Zend_Controller_Action
|
|||
|
||||
$authAdapter = Application_Model_Auth::getAuthAdapter();
|
||||
$authAdapter->setIdentity($user->getDbLogin())
|
||||
->setCredential($form->password->getValue())
|
||||
;
|
||||
->setCredential($form->password->getValue());
|
||||
|
||||
$zend_auth->authenticate($authAdapter);
|
||||
|
||||
|
|
|
@ -29,8 +29,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
->addActionContext('shuffle', 'json')
|
||||
->addActionContext('empty-content', '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.
|
||||
SessionHelper::reopenSessionForWriting();
|
||||
|
|
|
@ -16,8 +16,7 @@ class PlayouthistoryController extends Zend_Controller_Action
|
|||
->addActionContext('delete-list-items', 'json')
|
||||
->addActionContext('update-list-item', 'json')
|
||||
->addActionContext('update-file-item', 'json')
|
||||
->initContext()
|
||||
;
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
|
|
|
@ -10,8 +10,7 @@ class PlayouthistorytemplateController extends Zend_Controller_Action
|
|||
->addActionContext('update-template', 'json')
|
||||
->addActionContext('delete-template', 'json')
|
||||
->addActionContext('set-template-default', 'json')
|
||||
->initContext()
|
||||
;
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
|
|
|
@ -7,8 +7,7 @@ class PluploadController extends Zend_Controller_Action
|
|||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('upload', 'json')
|
||||
->addActionContext('recent-uploads', 'json')
|
||||
->initContext()
|
||||
;
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
|
@ -103,8 +102,7 @@ class PluploadController extends Zend_Controller_Action
|
|||
->orderByDbUtime(Criteria::DESC)
|
||||
->offset($rowStart)
|
||||
->limit($limit)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
$uploadsArray = [];
|
||||
$utcTimezone = new DateTimeZone('UTC');
|
||||
|
|
|
@ -15,8 +15,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
->addActionContext('get-liquidsoap-status', 'json')
|
||||
->addActionContext('set-source-connection-url', 'json')
|
||||
->addActionContext('get-admin-password-status', 'json')
|
||||
->initContext()
|
||||
;
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
|
@ -512,8 +511,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
if (!($method == 'POST')) {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(405)
|
||||
->appendBody(_('Request method not accepted') . ": {$method}")
|
||||
;
|
||||
->appendBody(_('Request method not accepted') . ": {$method}");
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -524,8 +522,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(200)
|
||||
->appendBody('OK')
|
||||
;
|
||||
->appendBody('OK');
|
||||
}
|
||||
|
||||
private function deleteFutureScheduleItems()
|
||||
|
@ -534,8 +531,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$nowDateTime = new DateTime('now', $utcTimezone);
|
||||
$scheduleItems = CcScheduleQuery::create()
|
||||
->filterByDbEnds($nowDateTime->format(DEFAULT_TIMESTAMP_FORMAT), Criteria::GREATER_THAN)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
// Delete all the schedule items
|
||||
foreach ($scheduleItems as $i) {
|
||||
|
|
|
@ -35,8 +35,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
->addActionContext('get-current-show', 'json')
|
||||
->addActionContext('update-future-is-scheduled', 'json')
|
||||
->addActionContext('localize-start-end-time', 'json')
|
||||
->initContext()
|
||||
;
|
||||
->initContext();
|
||||
|
||||
$this->sched_sess = new Zend_Session_Namespace('schedule');
|
||||
}
|
||||
|
|
|
@ -12,8 +12,7 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
->addActionContext('check-builder-feed', 'json')
|
||||
->addActionContext('builder-feed', 'json')
|
||||
->addActionContext('context-menu', 'json')
|
||||
->initContext()
|
||||
;
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
|
|
|
@ -8,8 +8,7 @@ class TracktypeController extends Zend_Controller_Action
|
|||
$ajaxContext->addActionContext('get-tracktype-data-table-info', 'json')
|
||||
->addActionContext('get-tracktype-data', 'json')
|
||||
->addActionContext('remove-tracktype', 'json')
|
||||
->initContext()
|
||||
;
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function addTracktypeAction()
|
||||
|
|
|
@ -17,19 +17,16 @@ class UpgradeController extends Zend_Controller_Action
|
|||
if (!$didWePerformAnUpgrade) {
|
||||
$this->getResponse()
|
||||
->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 {
|
||||
$this->getResponse()
|
||||
->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) {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(400)
|
||||
->appendBody($e->getMessage())
|
||||
;
|
||||
->appendBody($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,19 +48,16 @@ class UpgradeController extends Zend_Controller_Action
|
|||
if (!$downgradePerformed) {
|
||||
$this->getResponse()
|
||||
->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 {
|
||||
$this->getResponse()
|
||||
->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) {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(400)
|
||||
->appendBody($e->getMessage())
|
||||
;
|
||||
->appendBody($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,8 +10,7 @@ class UserController extends Zend_Controller_Action
|
|||
->addActionContext('get-user-data', 'json')
|
||||
->addActionContext('remove-user', 'json')
|
||||
->addActionContext('edit-user', 'json')
|
||||
->initContext()
|
||||
;
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function addUserAction()
|
||||
|
|
|
@ -16,8 +16,7 @@ class UsersettingsController extends Zend_Controller_Action
|
|||
->addActionContext('remindme-never', 'json')
|
||||
->addActionContext('donotshowregistrationpopup', 'json')
|
||||
->addActionContext('set-library-screen-settings', 'json')
|
||||
->initContext()
|
||||
;
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function setNowPlayingScreenSettingsAction()
|
||||
|
|
|
@ -9,8 +9,7 @@ class WebstreamController extends Zend_Controller_Action
|
|||
->addActionContext('save', 'json')
|
||||
->addActionContext('edit', 'json')
|
||||
->addActionContext('delete', 'json')
|
||||
->initContext()
|
||||
;
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function newAction()
|
||||
|
|
|
@ -146,8 +146,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
$this->getResponse()
|
||||
->setHttpResponseCode(401)
|
||||
->setBody($json)
|
||||
->sendResponse()
|
||||
;
|
||||
->sendResponse();
|
||||
|
||||
//redirectAndExit() cleans up, sends the headers and stops the script
|
||||
Zend_Controller_Action_HelperBroker::getStaticHelper('redirector')->redirectAndExit();
|
||||
|
@ -178,8 +177,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
$this->getResponse()
|
||||
->setHttpResponseCode(401)
|
||||
->appendBody('ERROR: CSRF token mismatch.')
|
||||
->sendResponse()
|
||||
;
|
||||
->sendResponse();
|
||||
|
||||
exit();
|
||||
}
|
||||
|
@ -223,8 +221,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(401)
|
||||
->appendBody('ERROR: Incorrect API key.')
|
||||
;
|
||||
->appendBody('ERROR: Incorrect API key.');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -247,8 +244,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
$controller = $request->getControllerName();
|
||||
$action = $request->getActionName();
|
||||
$stationPodcast = StationPodcastQuery::create()
|
||||
->findOneByDbPodcastId(Application_Model_Preference::getStationPodcastId())
|
||||
;
|
||||
->findOneByDbPodcastId(Application_Model_Preference::getStationPodcastId());
|
||||
|
||||
return $module == 'rest' && $controller == 'media' && $action == 'download'
|
||||
&& $key === Application_Model_Preference::getStationPodcastDownloadKey()
|
||||
|
|
|
@ -10,8 +10,7 @@ class Zend_Controller_Plugin_Maintenance extends Zend_Controller_Plugin_Abstract
|
|||
$request->setModuleName('default')
|
||||
->setControllerName('index')
|
||||
->setActionName('maintenance')
|
||||
->setDispatched(true)
|
||||
;
|
||||
->setDispatched(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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/styles.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()
|
||||
|
@ -203,8 +202,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
|
|||
->appendFile($baseUrl . 'locale/datatables-translation-table?' . $CC_CONFIG['airtime_version'], 'text/javascript')
|
||||
|
||||
->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
|
||||
//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/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();
|
||||
if (!is_null($user)) {
|
||||
|
|
|
@ -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->setLabel(sprintf(_('Use %s Authentication:'), PRODUCT_NAME))
|
||||
->setChecked(true)
|
||||
->setRequired(false)
|
||||
;
|
||||
->setRequired(false);
|
||||
$this->addElement($cb_airtime_auth);
|
||||
|
||||
$cb_custom_auth = new Zend_Form_Element_Checkbox('cb_custom_auth');
|
||||
$cb_custom_auth->setLabel(_('Use Custom Authentication:'))
|
||||
->setRequired(false)
|
||||
;
|
||||
->setRequired(false);
|
||||
$this->addElement($cb_custom_auth);
|
||||
|
||||
//custom username
|
||||
|
@ -27,8 +25,7 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
|||
->setLabel(_('Custom Username'))
|
||||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new ConditionalNotEmpty(['cb_custom_auth' => '1']), ])
|
||||
;
|
||||
new ConditionalNotEmpty(['cb_custom_auth' => '1']), ]);
|
||||
$this->addElement($custom_username);
|
||||
|
||||
//custom password
|
||||
|
@ -40,8 +37,7 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
|||
->setLabel(_('Custom Password'))
|
||||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new ConditionalNotEmpty(['cb_custom_auth' => '1']), ])
|
||||
;
|
||||
new ConditionalNotEmpty(['cb_custom_auth' => '1']), ]);
|
||||
$this->addElement($custom_password);
|
||||
|
||||
$showSourceParams = parse_url(Application_Model_Preference::GetLiveDJSourceConnectionURL());
|
||||
|
@ -50,22 +46,19 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
|||
$showSourceHost = new Zend_Form_Element_Text('show_source_host');
|
||||
$showSourceHost->setAttrib('readonly', true)
|
||||
->setLabel(_('Host:'))
|
||||
->setValue(isset($showSourceParams['host']) ? $showSourceParams['host'] : '')
|
||||
;
|
||||
->setValue(isset($showSourceParams['host']) ? $showSourceParams['host'] : '');
|
||||
$this->addElement($showSourceHost);
|
||||
|
||||
$showSourcePort = new Zend_Form_Element_Text('show_source_port');
|
||||
$showSourcePort->setAttrib('readonly', true)
|
||||
->setLabel(_('Port:'))
|
||||
->setValue(isset($showSourceParams['port']) ? $showSourceParams['port'] : '')
|
||||
;
|
||||
->setValue(isset($showSourceParams['port']) ? $showSourceParams['port'] : '');
|
||||
$this->addElement($showSourcePort);
|
||||
|
||||
$showSourceMount = new Zend_Form_Element_Text('show_source_mount');
|
||||
$showSourceMount->setAttrib('readonly', true)
|
||||
->setLabel(_('Mount:'))
|
||||
->setValue(isset($showSourceParams['path']) ? $showSourceParams['path'] : '')
|
||||
;
|
||||
->setValue(isset($showSourceParams['path']) ? $showSourceParams['path'] : '');
|
||||
$this->addElement($showSourceMount);
|
||||
|
||||
$this->setDecorators(
|
||||
|
|
|
@ -48,8 +48,7 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
|
|||
->setMultiOptions(
|
||||
[2 => _('day of the month'), 3 => _('day of the week')]
|
||||
)
|
||||
->setValue(2)
|
||||
;
|
||||
->setValue(2);
|
||||
$this->addElement($repeatMonthlyType);
|
||||
|
||||
// Add end date element
|
||||
|
|
|
@ -77,8 +77,7 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
|
|||
]]])
|
||||
->addValidator('Count', false, 1)
|
||||
->addValidator('Extension', false, 'jpg,jpeg,png,gif')
|
||||
->addFilter('ImageSize')
|
||||
;
|
||||
->addFilter('ImageSize');
|
||||
|
||||
$this->addElement($upload);
|
||||
|
||||
|
@ -99,8 +98,7 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
|
|||
$csrf_element->setValue($csrf_namespace->authtoken)
|
||||
->setRequired('true')
|
||||
->removeDecorator('HtmlTag')
|
||||
->removeDecorator('Label')
|
||||
;
|
||||
->removeDecorator('Label');
|
||||
$this->addElement($csrf_element);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
'future' => _('In the Future:'),
|
||||
])
|
||||
->setValue('future')
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
//$startDate->setAttrib('alt', 'date');
|
||||
$this->addElement($startNow);
|
||||
|
||||
|
@ -39,8 +38,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
->setValidators([
|
||||
$notEmptyValidator,
|
||||
$dateValidator, ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$startDate->setAttrib('alt', 'date');
|
||||
$this->addElement($startDate);
|
||||
|
||||
|
@ -67,8 +65,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
->setValidators([
|
||||
$notEmptyValidator,
|
||||
$dateValidator, ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$endDate->setAttrib('alt', 'date');
|
||||
$this->addElement($endDate);
|
||||
|
||||
|
@ -81,8 +78,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
->setValidators([
|
||||
$notEmptyValidator,
|
||||
$regexValidator, ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$endTime->setAttrib('alt', 'time');
|
||||
$this->addElement($endTime);
|
||||
|
||||
|
@ -101,8 +97,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
->setMultiOptions(Application_Common_Timezone::getTimezones())
|
||||
->setValue(Application_Model_Preference::GetUserTimezone())
|
||||
->setAttrib('class', 'input_select add_show_input_select')
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($timezone);
|
||||
|
||||
// Add repeats element
|
||||
|
|
|
@ -21,8 +21,7 @@ class Application_Form_AddShowWho extends Zend_Form_SubForm
|
|||
//Add hosts selection
|
||||
$hosts = new Zend_Form_Element_MultiCheckbox('add_show_hosts');
|
||||
$hosts->setLabel(_('DJs:'))
|
||||
->setMultiOptions($options)
|
||||
;
|
||||
->setMultiOptions($options);
|
||||
|
||||
$this->addElement($hosts);
|
||||
}
|
||||
|
|
|
@ -36,8 +36,7 @@ class Application_Form_AddTracktype extends Zend_Form
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new Zend_Validate_StringLength(['max' => 200]),
|
||||
])
|
||||
;
|
||||
]);
|
||||
$description->setAttrib('class', 'input_text');
|
||||
$description->addFilter('StringTrim');
|
||||
$this->addElement($description);
|
||||
|
|
|
@ -18,8 +18,7 @@ class Application_Form_DateRange extends Zend_Form_SubForm
|
|||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['YYYY-MM-DD']], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$startDate->setAttrib('alt', 'date');
|
||||
$this->addElement($startDate);
|
||||
|
||||
|
@ -33,8 +32,7 @@ class Application_Form_DateRange extends Zend_Form_SubForm
|
|||
'NotEmpty',
|
||||
['date', false, ['HH:mm']],
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$startTime->setAttrib('alt', 'time');
|
||||
$this->addElement($startTime);
|
||||
|
||||
|
@ -48,8 +46,7 @@ class Application_Form_DateRange extends Zend_Form_SubForm
|
|||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['YYYY-MM-DD']], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$endDate->setAttrib('alt', 'date');
|
||||
$this->addElement($endDate);
|
||||
|
||||
|
@ -63,8 +60,7 @@ class Application_Form_DateRange extends Zend_Form_SubForm
|
|||
'NotEmpty',
|
||||
['date', false, ['HH:mm']],
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$endTime->setAttrib('alt', 'time');
|
||||
$this->addElement($endTime);
|
||||
}
|
||||
|
|
|
@ -25,8 +25,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
$artwork->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new Zend_Validate_StringLength(['max' => 2048]),
|
||||
])
|
||||
;
|
||||
]);
|
||||
$file_id->addDecorator('HtmlTag', ['tag' => 'div', 'style' => 'display:none']);
|
||||
$file_id->removeDecorator('Label');
|
||||
$file_id->setAttrib('class', 'artwork');
|
||||
|
@ -55,8 +54,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new Zend_Validate_StringLength(['max' => 512]),
|
||||
])
|
||||
;
|
||||
]);
|
||||
$this->addElement($track_title);
|
||||
|
||||
// Add artist field
|
||||
|
@ -66,8 +64,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new Zend_Validate_StringLength(['max' => 512]),
|
||||
])
|
||||
;
|
||||
]);
|
||||
$this->addElement($artist_name);
|
||||
|
||||
// Add album field
|
||||
|
@ -77,8 +74,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new Zend_Validate_StringLength(['max' => 512]),
|
||||
])
|
||||
;
|
||||
]);
|
||||
$this->addElement($album_title);
|
||||
|
||||
// Add album field
|
||||
|
@ -121,8 +117,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new Zend_Validate_StringLength(['max' => 512]),
|
||||
])
|
||||
;
|
||||
]);
|
||||
$this->addElement($description);
|
||||
|
||||
// Add track number field
|
||||
|
@ -130,8 +125,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
$track_number->class = 'input_text';
|
||||
$track_number->setLabel('Track Number:')
|
||||
->setFilters(['StringTrim'])
|
||||
->setValidators([new Zend_Validate_Int()])
|
||||
;
|
||||
->setValidators([new Zend_Validate_Int()]);
|
||||
$this->addElement($track_number);
|
||||
|
||||
// Add genre field
|
||||
|
@ -141,8 +135,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new Zend_Validate_StringLength(['max' => 64]),
|
||||
])
|
||||
;
|
||||
]);
|
||||
$this->addElement($genre);
|
||||
|
||||
// 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'),
|
||||
Application_Form_Helper_ValidationTypes::overrrideDateValidator('YYYY'),
|
||||
])
|
||||
;
|
||||
]);
|
||||
$this->addElement($year);
|
||||
|
||||
// Add label field
|
||||
|
@ -166,8 +158,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new Zend_Validate_StringLength(['max' => 512]),
|
||||
])
|
||||
;
|
||||
]);
|
||||
$this->addElement($label);
|
||||
|
||||
// Add composer field
|
||||
|
@ -177,8 +168,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new Zend_Validate_StringLength(['max' => 512]),
|
||||
])
|
||||
;
|
||||
]);
|
||||
$this->addElement($composer);
|
||||
|
||||
// Add conductor field
|
||||
|
@ -188,8 +178,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new Zend_Validate_StringLength(['max' => 512]),
|
||||
])
|
||||
;
|
||||
]);
|
||||
$this->addElement($conductor);
|
||||
|
||||
// Add mood field
|
||||
|
@ -199,8 +188,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new Zend_Validate_StringLength(['max' => 64]),
|
||||
])
|
||||
;
|
||||
]);
|
||||
$this->addElement($mood);
|
||||
|
||||
// Add bmp field
|
||||
|
@ -210,8 +198,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new Zend_Validate_StringLength(['min' => 0, 'max' => 8]),
|
||||
new Zend_Validate_Digits(), ])
|
||||
;
|
||||
new Zend_Validate_Digits(), ]);
|
||||
$this->addElement($bpm);
|
||||
|
||||
// Add copyright field
|
||||
|
@ -221,8 +208,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new Zend_Validate_StringLength(['max' => 512]),
|
||||
])
|
||||
;
|
||||
]);
|
||||
$this->addElement($copyright);
|
||||
|
||||
// Add isrc number field
|
||||
|
@ -232,8 +218,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new Zend_Validate_StringLength(['max' => 512]),
|
||||
])
|
||||
;
|
||||
]);
|
||||
$this->addElement($isrc_number);
|
||||
|
||||
// Add website field
|
||||
|
@ -243,8 +228,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new Zend_Validate_StringLength(['max' => 512]),
|
||||
])
|
||||
;
|
||||
]);
|
||||
$this->addElement($info_url);
|
||||
|
||||
// Add language field
|
||||
|
@ -254,8 +238,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new Zend_Validate_StringLength(['max' => 512]),
|
||||
])
|
||||
;
|
||||
]);
|
||||
$this->addElement($language);
|
||||
|
||||
$validCuePattern = '/^(?:[0-9]{1,2}:)?(?:[0-9]{1,2}:)?[0-9]{1,6}(\.\d{1,6})?$/';
|
||||
|
|
|
@ -136,8 +136,7 @@ class Application_Form_EditUser extends Zend_Form
|
|||
$count = CcSubjsQuery::create()
|
||||
->filterByDbLogin($p_login)
|
||||
->filterByDbId($p_userId, Criteria::NOT_EQUAL)
|
||||
->count()
|
||||
;
|
||||
->count();
|
||||
|
||||
if ($count != 0) {
|
||||
$this->getElement('cu_login')->setErrors([_('Login name is not unique.')]);
|
||||
|
|
|
@ -46,8 +46,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
|||
->addValidator('Count', false, 1)
|
||||
->addValidator('Extension', false, 'jpg,jpeg,png,gif')
|
||||
->setMaxFileSize(1000000)
|
||||
->addFilter('ImageSize')
|
||||
;
|
||||
->addFilter('ImageSize');
|
||||
$stationLogoUpload->setAttrib('accept', 'image/*');
|
||||
$this->addElement($stationLogoUpload);
|
||||
|
||||
|
|
|
@ -16,15 +16,13 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
// automatic trasition on source disconnection
|
||||
$auto_transition = new Zend_Form_Element_Checkbox('auto_transition');
|
||||
$auto_transition->setLabel(_('Auto Switch Off:'))
|
||||
->setValue(Application_Model_Preference::GetAutoTransition())
|
||||
;
|
||||
->setValue(Application_Model_Preference::GetAutoTransition());
|
||||
$this->addElement($auto_transition);
|
||||
|
||||
// automatic switch on upon source connection
|
||||
$auto_switch = new Zend_Form_Element_Checkbox('auto_switch');
|
||||
$auto_switch->setLabel(_('Auto Switch On:'))
|
||||
->setValue(Application_Model_Preference::GetAutoSwitch())
|
||||
;
|
||||
->setValue(Application_Model_Preference::GetAutoSwitch());
|
||||
$this->addElement($auto_switch);
|
||||
|
||||
// Default transition fade
|
||||
|
@ -33,8 +31,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
->setFilters(['StringTrim'])
|
||||
->addValidator('regex', false, ['/^\d*(\.\d+)?$/',
|
||||
'messages' => _('Please enter a time in seconds (eg. 0.5)'), ])
|
||||
->setValue($defaultFade)
|
||||
;
|
||||
->setValue($defaultFade);
|
||||
$this->addElement($transition_fade);
|
||||
|
||||
//Master username
|
||||
|
@ -43,8 +40,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
->setAllowEmpty(true)
|
||||
->setLabel(_('Username:'))
|
||||
->setFilters(['StringTrim'])
|
||||
->setValue(Application_Model_Preference::GetLiveStreamMasterUsername())
|
||||
;
|
||||
->setValue(Application_Model_Preference::GetLiveStreamMasterUsername());
|
||||
$this->addElement($master_username);
|
||||
|
||||
//Master password
|
||||
|
@ -59,8 +55,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
->setAllowEmpty(true)
|
||||
->setValue(Application_Model_Preference::GetLiveStreamMasterPassword())
|
||||
->setLabel(_('Password:'))
|
||||
->setFilters(['StringTrim'])
|
||||
;
|
||||
->setFilters(['StringTrim']);
|
||||
$this->addElement($master_password);
|
||||
|
||||
$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->setLabel(_('Master Source Host:'))
|
||||
->setAttrib('readonly', true)
|
||||
->setValue(Application_Model_Preference::GetMasterDJSourceConnectionURL())
|
||||
;
|
||||
->setValue(Application_Model_Preference::GetMasterDJSourceConnectionURL());
|
||||
$this->addElement($masterSourceHost);
|
||||
|
||||
//liquidsoap harbor.input port
|
||||
|
@ -82,8 +76,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
$masterSourcePort->setLabel(_('Master Source Port:'))
|
||||
->setValue($m_port)
|
||||
->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);
|
||||
|
||||
|
@ -92,8 +85,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
$masterSourceMount->setLabel(_('Master Source Mount:'))
|
||||
->setValue($m_mount)
|
||||
->setValidators([
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
|
||||
;
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ]);
|
||||
$this->addElement($masterSourceMount);
|
||||
|
||||
$showSourceParams = parse_url(Application_Model_Preference::GetLiveDJSourceConnectionURL());
|
||||
|
@ -102,8 +94,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
$showSourceHost = new Zend_Form_Element_Text('show_source_host');
|
||||
$showSourceHost->setLabel(_('Show Source Host:'))
|
||||
->setAttrib('readonly', true)
|
||||
->setValue(Application_Model_Preference::GetLiveDJSourceConnectionURL())
|
||||
;
|
||||
->setValue(Application_Model_Preference::GetLiveDJSourceConnectionURL());
|
||||
$this->addElement($showSourceHost);
|
||||
|
||||
//liquidsoap harbor.input port
|
||||
|
@ -113,8 +104,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
$showSourcePort->setLabel(_('Show Source Port:'))
|
||||
->setValue($l_port)
|
||||
->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);
|
||||
|
||||
$l_mount = Application_Model_StreamSetting::getDjLiveStreamMountPoint();
|
||||
|
@ -122,8 +112,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
$showSourceMount->setLabel(_('Show Source Mount:'))
|
||||
->setValue($l_mount)
|
||||
->setValidators([
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
|
||||
;
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ]);
|
||||
$this->addElement($showSourceMount);
|
||||
}
|
||||
|
||||
|
|
|
@ -44,8 +44,7 @@ class Application_Form_Login extends Zend_Form
|
|||
->setValue((isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) ? 'admin' : '')
|
||||
->addFilter('StringTrim')
|
||||
->setDecorators(['ViewHelper'])
|
||||
->setValidators(['NotEmpty'])
|
||||
;
|
||||
->setValidators(['NotEmpty']);
|
||||
$this->addElement($username);
|
||||
|
||||
// Add password element
|
||||
|
|
|
@ -44,8 +44,7 @@ class Application_Form_PasswordRestore extends Zend_Form
|
|||
$cancel->setLabel(_('Back'))
|
||||
->setIgnore(true)
|
||||
->setAttrib('onclick', 'window.location = ' . Zend_Controller_Front::getInstance()->getBaseUrl('login'))
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($cancel);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,8 +67,7 @@ class Application_Form_Player extends Zend_Form_SubForm
|
|||
$embedSrc->setAttrib('readonly', 'readonly');
|
||||
$embedSrc->setAttrib('class', 'embed-player-text-box');
|
||||
$embedSrc->setAttrib('cols', '40')
|
||||
->setAttrib('rows', '4')
|
||||
;
|
||||
->setAttrib('rows', '4');
|
||||
$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->setValue('<iframe frameborder="0" width="280" height="216" src="' . Application_Common_HTTPHelper::getStationUrl() . 'embed/player?stream=auto&title=Now Playing"></iframe>');
|
||||
|
|
|
@ -20,8 +20,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
|||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['YYYY-MM-DD']], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$startDate->setAttrib('alt', 'date');
|
||||
$this->addElement($startDate);
|
||||
|
||||
|
@ -35,8 +34,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
|||
'NotEmpty',
|
||||
['date', false, ['HH:mm']],
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$startTime->setAttrib('alt', 'time');
|
||||
$this->addElement($startTime);
|
||||
|
||||
|
@ -50,8 +48,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
|||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['YYYY-MM-DD']], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$endDate->setAttrib('alt', 'date');
|
||||
$this->addElement($endDate);
|
||||
|
||||
|
@ -65,8 +62,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
|||
'NotEmpty',
|
||||
['date', false, ['HH:mm']],
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$endTime->setAttrib('alt', 'time');
|
||||
$this->addElement($endTime);
|
||||
|
||||
|
@ -81,8 +77,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
|||
if ($user->getType() === 'H') {
|
||||
$myShows = new Zend_Form_Element_Checkbox('sb_my_shows');
|
||||
$myShows->setLabel(_('All My Shows:'))
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($myShows);
|
||||
}
|
||||
}
|
||||
|
@ -98,8 +93,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
|||
$shows = CcShowQuery::create()
|
||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||
->orderByDbName()
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
foreach ($shows as $show) {
|
||||
$showNames[$show->getDbId()] = $show->getDbName();
|
||||
|
|
|
@ -18,8 +18,7 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
|
|||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['YYYY-MM-DD']], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$startDate->setAttrib('alt', 'date');
|
||||
$this->addElement($startDate);
|
||||
|
||||
|
@ -33,8 +32,7 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
|
|||
'NotEmpty',
|
||||
['date', false, ['HH:mm']],
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$startTime->setAttrib('alt', 'time');
|
||||
$this->addElement($startTime);
|
||||
|
||||
|
@ -48,8 +46,7 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
|
|||
->setValidators([
|
||||
'NotEmpty',
|
||||
['date', false, ['YYYY-MM-DD']], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$endDate->setAttrib('alt', 'date');
|
||||
$this->addElement($endDate);
|
||||
|
||||
|
@ -63,8 +60,7 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm
|
|||
'NotEmpty',
|
||||
['date', false, ['HH:mm']],
|
||||
['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$endTime->setAttrib('alt', 'time');
|
||||
$this->addElement($endTime);
|
||||
}
|
||||
|
|
|
@ -271,8 +271,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
'dynamic' => _('Dynamic'),
|
||||
'static' => _('Static'),
|
||||
])
|
||||
->setValue($blockType)
|
||||
;
|
||||
->setValue($blockType);
|
||||
$this->addElement($spType);
|
||||
|
||||
$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)
|
||||
->setValue('Select criteria')
|
||||
->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 ($i != 0 && !isset($criteriaKeys[$i])) {
|
||||
$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->setValue('Select modifier')
|
||||
->setAttrib('class', 'input_select sp_input_select')
|
||||
->setDecorators(['viewHelper'])
|
||||
;
|
||||
->setDecorators(['viewHelper']);
|
||||
if ($i != 0 && !isset($criteriaKeys[$i])) {
|
||||
$criteriaModifers->setAttrib('disabled', 'disabled');
|
||||
}
|
||||
|
@ -445,8 +442,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
// DATETIME SELECT
|
||||
$criteriaDatetimeSelect = new Zend_Form_Element_Select('sp_criteria_datetime_select_' . $i . '_' . $j);
|
||||
$criteriaDatetimeSelect->setAttrib('class', 'input_select sp_input_select')
|
||||
->setDecorators(['viewHelper'])
|
||||
;
|
||||
->setDecorators(['viewHelper']);
|
||||
if (isset($criteriaKeys[$i]) && $relativeDateTime) {
|
||||
$criteriaDatetimeSelect->setAttrib('enabled', 'enabled');
|
||||
} else {
|
||||
|
@ -473,8 +469,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
// EXTRA
|
||||
$criteriaExtra = new Zend_Form_Element_Text('sp_criteria_extra_' . $i . '_' . $j);
|
||||
$criteriaExtra->setAttrib('class', 'input_text sp_extra_input_text')
|
||||
->setDecorators(['viewHelper'])
|
||||
;
|
||||
->setDecorators(['viewHelper']);
|
||||
if (isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['extra'])) {
|
||||
// need to check if this is a relative date time value
|
||||
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->setAttrib('class', 'input_select sp_input_select')
|
||||
->setDecorators(['viewHelper'])
|
||||
;
|
||||
->setDecorators(['viewHelper']);
|
||||
|
||||
if (isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['extra'])
|
||||
&& $modifierTest == 'between') {
|
||||
|
@ -516,8 +510,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
|
||||
$repeatTracks = new Zend_Form_Element_Checkbox('sp_repeat_tracks');
|
||||
$repeatTracks->setDecorators(['viewHelper'])
|
||||
->setLabel(_('Allow Repeated Tracks:'))
|
||||
;
|
||||
->setLabel(_('Allow Repeated Tracks:'));
|
||||
if (isset($storedCrit['repeat_tracks'])) {
|
||||
$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->setDecorators(['viewHelper'])
|
||||
->setLabel(_('Allow last track to exceed time limit:'))
|
||||
;
|
||||
->setLabel(_('Allow last track to exceed time limit:'));
|
||||
if (isset($storedCrit['overflow_tracks'])) {
|
||||
$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')
|
||||
->setDecorators(['viewHelper'])
|
||||
->setLabel(_('Sort Tracks:'))
|
||||
->setMultiOptions($this->getSortOptions())
|
||||
;
|
||||
->setMultiOptions($this->getSortOptions());
|
||||
if (isset($storedCrit['sort'])) {
|
||||
$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->setAttrib('class', 'sp_input_select')
|
||||
->setDecorators(['viewHelper'])
|
||||
->setMultiOptions($this->getLimitOptions())
|
||||
;
|
||||
->setMultiOptions($this->getLimitOptions());
|
||||
if (isset($storedCrit['limit'])) {
|
||||
$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->setAttrib('class', 'sp_input_text_limit')
|
||||
->setLabel(_('Limit to:'))
|
||||
->setDecorators(['viewHelper'])
|
||||
;
|
||||
->setDecorators(['viewHelper']);
|
||||
$this->addElement($limitValue);
|
||||
if (isset($storedCrit['limit'])) {
|
||||
$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')
|
||||
->setValue('Select criteria')
|
||||
->setDecorators(['viewHelper'])
|
||||
->setMultiOptions($this->getCriteriaOptions())
|
||||
;
|
||||
->setMultiOptions($this->getCriteriaOptions());
|
||||
|
||||
$criteriaType = $this->criteriaTypes[$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->setValue('Select modifier')
|
||||
->setAttrib('class', 'input_select sp_input_select')
|
||||
->setDecorators(['viewHelper'])
|
||||
;
|
||||
->setDecorators(['viewHelper']);
|
||||
|
||||
if ($criteriaType == 's') {
|
||||
$criteriaModifers->setMultiOptions($this->getStringCriteriaOptions());
|
||||
|
@ -694,16 +681,14 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
// VALUE
|
||||
$criteriaValue = new Zend_Form_Element_Text('sp_criteria_value_' . $critKey . '_' . $modKey);
|
||||
$criteriaValue->setAttrib('class', 'input_text sp_input_text')
|
||||
->setDecorators(['viewHelper'])
|
||||
;
|
||||
->setDecorators(['viewHelper']);
|
||||
$criteriaValue->setValue($modInfo['sp_criteria_value']);
|
||||
$this->addElement($criteriaValue);
|
||||
// DATETIME UNIT SELECT
|
||||
|
||||
$criteriaDatetimeSelect = new Zend_Form_Element_Select('sp_criteria_datetime_select_' . $critKey . '_' . $modKey);
|
||||
$criteriaDatetimeSelect->setAttrib('class', 'input_select sp_input_select')
|
||||
->setDecorators(['viewHelper'])
|
||||
;
|
||||
->setDecorators(['viewHelper']);
|
||||
if ($this->enableDateTimeUnit($criteriaValue->getValue())) {
|
||||
$criteriaDatetimeSelect->setAttrib('enabled', 'enabled');
|
||||
$criteriaDatetimeSelect->setAttrib('disabled', null);
|
||||
|
@ -715,8 +700,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
// EXTRA
|
||||
$criteriaExtra = new Zend_Form_Element_Text('sp_criteria_extra_' . $critKey . '_' . $modKey);
|
||||
$criteriaExtra->setAttrib('class', 'input_text sp_extra_input_text')
|
||||
->setDecorators(['viewHelper'])
|
||||
;
|
||||
->setDecorators(['viewHelper']);
|
||||
if (isset($modInfo['sp_criteria_extra'])) {
|
||||
$criteriaExtra->setValue($modInfo['sp_criteria_extra']);
|
||||
$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->setAttrib('class', 'input_select sp_input_select')
|
||||
->setDecorators(['viewHelper'])
|
||||
;
|
||||
->setDecorators(['viewHelper']);
|
||||
if ($criteriaValue->getValue() == 'between') {
|
||||
$criteriaExtraDatetimeSelect->setAttrib('enabled', 'enabled');
|
||||
$criteriaExtraDatetimeSelect->setAttrib('disabled', null);
|
||||
|
|
|
@ -13,8 +13,7 @@ class Application_Form_StationPodcast extends Zend_Form
|
|||
$csrf_element->setValue($csrf_namespace->authtoken)
|
||||
->setRequired('true')
|
||||
->removeDecorator('HtmlTag')
|
||||
->removeDecorator('Label')
|
||||
;
|
||||
->removeDecorator('Label');
|
||||
$this->addElement($csrf_element);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,8 +25,7 @@ class Application_Form_StreamSetting extends Zend_Form
|
|||
$output_sound_device->setLabel(_('Hardware Audio Output:'))
|
||||
->setRequired(false)
|
||||
->setValue(($setting['output_sound_device'] == 'true') ? 1 : 0)
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($output_sound_device);
|
||||
|
||||
$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'),
|
||||
'Jack' => _('Jack'), ])
|
||||
->setValue(isset($setting['output_sound_device_type']) ? $setting['output_sound_device_type'] : 0)
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($output_sound_device_type);
|
||||
|
||||
$icecast_vorbis_metadata = new Zend_Form_Element_Checkbox('icecast_vorbis_metadata');
|
||||
$icecast_vorbis_metadata->setLabel(_('Icecast Vorbis Metadata'))
|
||||
->setRequired(false)
|
||||
->setValue(($setting['icecast_vorbis_metadata'] == 'true') ? 1 : 0)
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
if (Application_Model_Preference::GetEnableStreamConf() == 'false') {
|
||||
$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->setLabel(_('Off Air Metadata'))
|
||||
->setValue(Application_Model_StreamSetting::getOffAirMeta())
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($offAirMeta);
|
||||
|
||||
$enable_replay_gain = new Zend_Form_Element_Checkbox('enableReplayGain');
|
||||
$enable_replay_gain->setLabel(_('Enable Replay Gain'))
|
||||
->setValue(Application_Model_Preference::GetEnableReplayGain())
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($enable_replay_gain);
|
||||
|
||||
$replay_gain = new Zend_Form_Element_Hidden('replayGainModifier');
|
||||
$replay_gain->setLabel(_('Replay Gain Modifier'))
|
||||
->setValue(Application_Model_Preference::getReplayGainModifier())
|
||||
->setAttribs(['style' => 'border: 0; color: #f6931f; font-weight: bold;'])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($replay_gain);
|
||||
|
||||
$custom = Application_Model_Preference::getUsingCustomStreamSettings();
|
||||
|
|
|
@ -51,8 +51,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
$enable = new Zend_Form_Element_Checkbox('enable');
|
||||
$enable->setLabel(_('Enabled:'))
|
||||
->setValue($setting[$prefix . '_enable'] == 'true' ? 1 : 0)
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($enable);
|
||||
static::$customizable[] = $enable->getName();
|
||||
|
||||
|
@ -67,8 +66,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
$type->setLabel(_('Stream Type:'))
|
||||
->setMultiOptions($stream_types)
|
||||
->setValue(isset($setting[$prefix . '_type']) ? $setting[$prefix . '_type'] : 0)
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($type);
|
||||
static::$customizable[] = $type->getName();
|
||||
|
||||
|
@ -76,8 +74,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
$bitrate->setLabel(_('Bit Rate:'))
|
||||
->setMultiOptions($stream_bitrates)
|
||||
->setValue(isset($setting[$prefix . '_bitrate']) ? $setting[$prefix . '_bitrate'] : 0)
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($bitrate);
|
||||
static::$customizable[] = $bitrate->getName();
|
||||
|
||||
|
@ -86,16 +83,14 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
->setMultiOptions(['icecast' => 'Icecast', 'shoutcast' => 'SHOUTcast'])
|
||||
->setValue($useDefaults ? $streamDefaults['output'] :
|
||||
(isset($setting[$prefix . '_output']) ? $setting[$prefix . '_output'] : 'icecast'))
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($output);
|
||||
|
||||
$channels = new Zend_Form_Element_Select('channels');
|
||||
$channels->setLabel(_('Channels:'))
|
||||
->setMultiOptions(['mono' => _('1 - Mono'), 'stereo' => _('2 - Stereo')])
|
||||
->setValue(isset($setting[$prefix . '_channels']) ? $setting[$prefix . '_channels'] : 'stereo')
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($channels);
|
||||
static::$customizable[] = $channels->getName();
|
||||
|
||||
|
@ -105,8 +100,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
(isset($setting[$prefix . '_host']) ? $setting[$prefix . '_host'] : ''))
|
||||
->setValidators([
|
||||
['regex', false, ['/^[0-9a-zA-Z-_.]+$/', 'messages' => _('Invalid character entered')]], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$host->setAttrib('alt', 'domain');
|
||||
$this->addElement($host);
|
||||
|
||||
|
@ -116,8 +110,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
(isset($setting[$prefix . '_port']) ? $setting[$prefix . '_port'] : ''))
|
||||
->setValidators([new Zend_Validate_Between(['min' => 0, 'max' => 99999])])
|
||||
->addValidator('regex', false, ['pattern' => '/^[0-9]+$/', 'messages' => ['regexNotMatch' => _('Only numbers are allowed.')]])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($port);
|
||||
|
||||
$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'] : ''))
|
||||
->setValidators([
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$pass->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($pass);
|
||||
|
||||
$genre = new Zend_Form_Element_Text('genre');
|
||||
$genre->setLabel(_('Genre'))
|
||||
->setValue(isset($setting[$prefix . '_genre']) ? $setting[$prefix . '_genre'] : '')
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($genre);
|
||||
|
||||
$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'] : '')
|
||||
->setValidators([
|
||||
['regex', false, ['/^[0-9a-zA-Z\-_.:\/]+$/', 'messages' => _('Invalid character entered')]], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$url->setAttrib('alt', 'url');
|
||||
$this->addElement($url);
|
||||
|
||||
$name = new Zend_Form_Element_Text('name');
|
||||
$name->setLabel(_('Name'))
|
||||
->setValue(isset($setting[$prefix . '_name']) ? $setting[$prefix . '_name'] : '')
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($name);
|
||||
|
||||
$description = new Zend_Form_Element_Text('description');
|
||||
$description->setLabel(_('Description'))
|
||||
->setValue(isset($setting[$prefix . '_description']) ? $setting[$prefix . '_description'] : '')
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$this->addElement($description);
|
||||
|
||||
$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'] : ''))
|
||||
->setValidators([
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$mount->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($mount);
|
||||
|
||||
|
@ -179,8 +166,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
(isset($setting[$prefix . '_user']) ? $setting[$prefix . '_user'] : ''))
|
||||
->setValidators([
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$user->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($user);
|
||||
|
||||
|
@ -189,8 +175,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
->setValue(Application_Model_StreamSetting::getAdminUser($prefix))
|
||||
->setValidators([
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$adminUser->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($adminUser);
|
||||
|
||||
|
@ -199,8 +184,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
->setValue(Application_Model_StreamSetting::getAdminPass($prefix))
|
||||
->setValidators([
|
||||
['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ])
|
||||
->setDecorators(['ViewHelper'])
|
||||
;
|
||||
->setDecorators(['ViewHelper']);
|
||||
$adminPass->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($adminPass);
|
||||
|
||||
|
|
|
@ -45,8 +45,7 @@ class Application_Model_Auth
|
|||
CcSubjsTokenQuery::create()
|
||||
->filterByDbAction($action)
|
||||
->filterByDbUserId($user->getDbId())
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
}
|
||||
|
||||
public function checkToken($user_id, $token, $action)
|
||||
|
@ -57,8 +56,7 @@ class Application_Model_Auth
|
|||
->filterByDbAction($action)
|
||||
->filterByDbUserId($user_id)
|
||||
->filterByDbToken(sha1($token . $salt))
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
if (empty($token_info)) {
|
||||
return false;
|
||||
|
@ -96,8 +94,7 @@ class Application_Model_Auth
|
|||
$authAdapter->setTableName('cc_subjs')
|
||||
->setIdentityColumn('login')
|
||||
->setCredentialColumn('pass')
|
||||
->setCredentialTreatment('MD5(?)')
|
||||
;
|
||||
->setCredentialTreatment('MD5(?)');
|
||||
|
||||
return $authAdapter;
|
||||
}
|
||||
|
|
|
@ -458,8 +458,7 @@ SQL;
|
|||
->filterByDbBlockId($this->id)
|
||||
->filterByDbPosition($pos, Criteria::GREATER_EQUAL)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
Logging::info('Adding to block');
|
||||
Logging::info("at position {$pos}");
|
||||
|
@ -475,16 +474,14 @@ SQL;
|
|||
$contentsToUpdate = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($this->id)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
}
|
||||
|
||||
$contentsToUpdate = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($this->id)
|
||||
->filterByDbPosition($pos, Criteria::GREATER_EQUAL)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
Logging::info('Adding to block');
|
||||
Logging::info("at position {$pos}");
|
||||
|
@ -550,15 +547,13 @@ SQL;
|
|||
$contentsToMove = CcBlockcontentsQuery::create()
|
||||
->filterByDbId($p_items, Criteria::IN)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
$otherContent = CcBlockcontentsQuery::create()
|
||||
->filterByDbId($p_items, Criteria::NOT_IN)
|
||||
->filterByDbBlockId($this->id)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
$pos = 0;
|
||||
//moving items to beginning of the block.
|
||||
|
@ -625,13 +620,11 @@ SQL;
|
|||
$itemsToDelete = CcBlockcontentsQuery::create()
|
||||
->filterByPrimaryKeys($p_items)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
CcBlockcontentsQuery::create()
|
||||
->findPKs($p_items)
|
||||
->delete($this->con)
|
||||
;
|
||||
->delete($this->con);
|
||||
|
||||
// now that the items have been deleted we can update the
|
||||
// is_playlist flag in cc_files
|
||||
|
@ -640,8 +633,7 @@ SQL;
|
|||
$contents = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($this->id)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
//reset the positions of the remaining items.
|
||||
for ($i = 0; $i < count($contents); ++$i) {
|
||||
|
@ -670,8 +662,7 @@ SQL;
|
|||
->joinWith(CcFilesPeer::OM_CLASS)
|
||||
->filterByDbBlockId($this->id)
|
||||
->filterByDbPosition($pos)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
//Propel returns values in form 00.000000 format which is for only seconds.
|
||||
//We only want to display 1 decimal
|
||||
|
@ -801,8 +792,7 @@ SQL;
|
|||
$row = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($this->id)
|
||||
->filterByDbPosition(0)
|
||||
->findOne($this->con)
|
||||
;
|
||||
->findOne($this->con);
|
||||
|
||||
$this->changeFadeInfo($row->getDbId(), $fadein, null);
|
||||
}
|
||||
|
@ -812,8 +802,7 @@ SQL;
|
|||
$row = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($this->id)
|
||||
->filterByDbPosition($this->getSize() - 1)
|
||||
->findOne($this->con)
|
||||
;
|
||||
->findOne($this->con);
|
||||
|
||||
$this->changeFadeInfo($row->getDbId(), null, $fadeout);
|
||||
}
|
||||
|
@ -848,8 +837,7 @@ SQL;
|
|||
$row = CcBlockcontentsQuery::create()
|
||||
->joinWith(CcFilesPeer::OM_CLASS)
|
||||
->filterByPrimaryKey($id)
|
||||
->findOne($this->con)
|
||||
;
|
||||
->findOne($this->con);
|
||||
|
||||
if (is_null($row)) {
|
||||
throw new Exception('Block item does not exist.');
|
||||
|
@ -1061,8 +1049,7 @@ SQL;
|
|||
$itemsToDelete = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($p_ids)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
$updateIsPlaylistFlag = false;
|
||||
|
||||
|
@ -1115,8 +1102,7 @@ SQL;
|
|||
$itemsToDelete = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($this->id)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
CcBlockcontentsQuery::create()->findByDbBlockId($this->id)->delete();
|
||||
|
||||
|
@ -1141,8 +1127,7 @@ SQL;
|
|||
$contents = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($this->id)
|
||||
->orderByDbPosition()
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
$shuffledPos = range(0, count($contents) - 1);
|
||||
shuffle($shuffledPos);
|
||||
foreach ($contents as $item) {
|
||||
|
@ -1245,8 +1230,7 @@ SQL;
|
|||
$qry->setDbCriteria($field)
|
||||
->setDbModifier($d['sp_criteria_modifier'])
|
||||
->setDbValue($value)
|
||||
->setDbBlockId($this->id)
|
||||
;
|
||||
->setDbBlockId($this->id);
|
||||
|
||||
if (isset($d['sp_criteria_extra'])) {
|
||||
if ($field == 'utime' || $field == 'mtime' || $field == 'lptime') {
|
||||
|
@ -1276,8 +1260,7 @@ SQL;
|
|||
->setDbModifier('N/A')
|
||||
->setDbValue($p_criteriaData['etc']['sp_sort_options'])
|
||||
->setDbBlockId($this->id)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
|
||||
// insert limit info
|
||||
$qry = new CcBlockcriteria();
|
||||
|
@ -1285,8 +1268,7 @@ SQL;
|
|||
->setDbModifier($p_criteriaData['etc']['sp_limit_options'])
|
||||
->setDbValue($p_criteriaData['etc']['sp_limit_value'])
|
||||
->setDbBlockId($this->id)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
|
||||
// insert repeat track option
|
||||
$qry = new CcBlockcriteria();
|
||||
|
@ -1294,8 +1276,7 @@ SQL;
|
|||
->setDbModifier('N/A')
|
||||
->setDbValue($p_criteriaData['etc']['sp_repeat_tracks'])
|
||||
->setDbBlockId($this->id)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
|
||||
// insert overflow track option
|
||||
$qry = new CcBlockcriteria();
|
||||
|
@ -1303,8 +1284,7 @@ SQL;
|
|||
->setDbModifier('N/A')
|
||||
->setDbValue($p_criteriaData['etc']['sp_overflow_tracks'])
|
||||
->setDbBlockId($this->id)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -39,13 +39,11 @@ class Application_Model_Library
|
|||
$playlists = CcPlaylistQuery::create()
|
||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||
->orderByname()
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
} else {
|
||||
$playlists = CcPlaylistQuery::create()
|
||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
foreach ($playlists as $playlist) {
|
||||
$playlistNames[$playlist->getDbId()] = $playlist->getDbName();
|
||||
|
|
|
@ -274,23 +274,20 @@ SQL;
|
|||
//convert "linked" files (Airtime <= 1.8.2) to watched files.
|
||||
$propel_link_dir = CcMusicDirsQuery::create()
|
||||
->filterByType('link')
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
//see if any linked files exist.
|
||||
if (isset($propel_link_dir)) {
|
||||
//newly added watched directory object
|
||||
$propel_new_watch = CcMusicDirsQuery::create()
|
||||
->filterByDirectory(Application_Common_OsPath::normpath($p_path) . '/')
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
//any files of the deprecated "link" type.
|
||||
$link_files = CcFilesQuery::create()
|
||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||
->filterByDbDirectory($propel_link_dir->getId())
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
$newly_watched_dir = $propel_new_watch->getDirectory();
|
||||
|
||||
|
@ -330,8 +327,7 @@ SQL;
|
|||
{
|
||||
$dir = CcMusicDirsQuery::create()
|
||||
->filterByDirectory($p_path)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if ($dir == null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -350,8 +346,7 @@ SQL;
|
|||
$result = [];
|
||||
|
||||
$dirs = CcMusicDirsQuery::create()
|
||||
->filterByType('watched')
|
||||
;
|
||||
->filterByType('watched');
|
||||
if ($exists !== null) {
|
||||
$dirs = $dirs->filterByExists($exists);
|
||||
}
|
||||
|
@ -371,8 +366,7 @@ SQL;
|
|||
{
|
||||
$dir = CcMusicDirsQuery::create()
|
||||
->filterByType('stor')
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
return new Application_Model_MusicDir($dir);
|
||||
}
|
||||
|
@ -412,8 +406,7 @@ SQL;
|
|||
->filterByType(['watched', 'stor'])
|
||||
->filterByExists(true)
|
||||
->filterByWatched(true)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
foreach ($dirs as $dir) {
|
||||
$directory = $dir->getDirectory();
|
||||
|
|
|
@ -465,8 +465,7 @@ SQL;
|
|||
->filterByDbPlaylistId($this->id)
|
||||
->filterByDbPosition($pos, Criteria::GREATER_EQUAL)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
} else {
|
||||
//add to the end of the playlist
|
||||
if ($addType == 'after') {
|
||||
|
@ -479,16 +478,14 @@ SQL;
|
|||
$contentsToUpdate = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
}
|
||||
|
||||
$contentsToUpdate = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->filterByDbPosition($pos, Criteria::GREATER_EQUAL)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
}
|
||||
|
||||
foreach ($p_items as $ac) {
|
||||
|
@ -537,15 +534,13 @@ SQL;
|
|||
$contentsToMove = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbId($p_items, Criteria::IN)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
$otherContent = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbId($p_items, Criteria::NOT_IN)
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
$pos = 0;
|
||||
//moving items to beginning of the playlist.
|
||||
|
@ -612,13 +607,11 @@ SQL;
|
|||
$itemsToDelete = CcPlaylistcontentsQuery::create()
|
||||
->filterByPrimaryKeys($p_items)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
CcPlaylistcontentsQuery::create()
|
||||
->findPKs($p_items)
|
||||
->delete($this->con)
|
||||
;
|
||||
->delete($this->con);
|
||||
|
||||
// now that the items have been deleted we can update the
|
||||
// is_playlist flag in cc_files
|
||||
|
@ -627,8 +620,7 @@ SQL;
|
|||
$contents = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
//reset the positions of the remaining items.
|
||||
for ($i = 0; $i < count($contents); ++$i) {
|
||||
|
@ -653,8 +645,7 @@ SQL;
|
|||
->joinWith(CcFilesPeer::OM_CLASS)
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->filterByDbPosition($pos)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
if (!$row) {
|
||||
return null;
|
||||
|
@ -770,8 +761,7 @@ SQL;
|
|||
$row = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->filterByDbPosition(0)
|
||||
->findOne($this->con)
|
||||
;
|
||||
->findOne($this->con);
|
||||
|
||||
$this->changeFadeInfo($row->getDbId(), $fadein, null);
|
||||
}
|
||||
|
@ -780,8 +770,7 @@ SQL;
|
|||
$row = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->filterByDbPosition($this->getSize() - 1)
|
||||
->findOne($this->con)
|
||||
;
|
||||
->findOne($this->con);
|
||||
|
||||
$this->changeFadeInfo($row->getDbId(), null, $fadeout);
|
||||
}
|
||||
|
@ -817,8 +806,7 @@ SQL;
|
|||
$row = CcPlaylistcontentsQuery::create()
|
||||
->joinWith(CcFilesPeer::OM_CLASS)
|
||||
->filterByPrimaryKey($id)
|
||||
->findOne($this->con)
|
||||
;
|
||||
->findOne($this->con);
|
||||
|
||||
if (is_null($row)) {
|
||||
throw new Exception('Playlist item does not exist.');
|
||||
|
@ -997,8 +985,7 @@ SQL;
|
|||
$itemsToDelete = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($p_ids)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
$updateIsPlaylistFlag = false;
|
||||
|
||||
|
@ -1052,8 +1039,7 @@ SQL;
|
|||
$itemsToDelete = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
CcPlaylistcontentsQuery::create()->findByDbPlaylistId($this->id)->delete();
|
||||
|
||||
|
@ -1139,8 +1125,7 @@ SQL;
|
|||
->join('CcFiles.CcPlaylistcontents')
|
||||
->where('CcPlaylistcontents.DbPlaylistId = ?', $this->pl->getDbId())
|
||||
->where('CcFiles.DbFileExists = ?', 'false')
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
//Nicer Propel version but slightly slower because it generates a LEFT JOIN:
|
||||
/*
|
||||
|
|
|
@ -861,15 +861,13 @@ class Application_Model_Preference
|
|||
//New versions use schema_version
|
||||
$pref = CcPrefQuery::create()
|
||||
->filterByKeystr('schema_version')
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
if (empty($pref)) {
|
||||
//Pre-2.5.2 releases all used this ambiguous "system_version" key to represent both the code and schema versions...
|
||||
$pref = CcPrefQuery::create()
|
||||
->filterByKeystr('system_version')
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
}
|
||||
|
||||
return $pref->getValStr();
|
||||
|
|
|
@ -227,21 +227,18 @@ SQL;
|
|||
$currentMediaType = 'track';
|
||||
$currentFile = CcFilesQuery::create()
|
||||
->filterByDbId($currentMediaFileId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
$currentMediaName = $currentFile->getDbArtistName() . ' - ' . $currentFile->getDbTrackTitle();
|
||||
$currentMetadata = CcFiles::sanitizeResponse($currentFile);
|
||||
} elseif (isset($currentMediaStreamId)) {
|
||||
$currentMediaType = 'webstream';
|
||||
$currentWebstream = CcWebstreamQuery::create()
|
||||
->filterByDbId($currentMediaStreamId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
$currentWebstreamMetadata = CcWebstreamMetadataQuery::create()
|
||||
->filterByDbInstanceId($currentMedia['id'])
|
||||
->orderByDbStartTime(Criteria::DESC)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
$currentMediaName = $currentWebstream->getDbName();
|
||||
if (isset($currentWebstreamMetadata)) {
|
||||
$currentMediaName .= ' - ' . $currentWebstreamMetadata->getDbLiquidsoapData();
|
||||
|
@ -265,8 +262,7 @@ SQL;
|
|||
->filterByDbEnds($utcNow, Criteria::LESS_THAN)
|
||||
->filterByDbPlayoutStatus(0, Criteria::GREATER_THAN)
|
||||
->orderByDbStarts(Criteria::DESC)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if (isset($previousMedia)) {
|
||||
$previousMetadata = null;
|
||||
$previousMediaName = '';
|
||||
|
@ -276,8 +272,7 @@ SQL;
|
|||
$previousMediaType = 'track';
|
||||
$previousFile = CcFilesQuery::create()
|
||||
->filterByDbId($previousMediaFileId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if (isset($previousFile)) {
|
||||
$previousMediaName = $previousFile->getDbArtistName() . ' - ' . $previousFile->getDbTrackTitle();
|
||||
$previousMetadata = CcFiles::sanitizeResponse($previousFile);
|
||||
|
@ -287,8 +282,7 @@ SQL;
|
|||
$previousMediaType = 'webstream';
|
||||
$previousWebstream = CcWebstreamQuery::create()
|
||||
->filterByDbId($previousMediaStreamId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
$previousMediaName = $previousWebstream->getDbName();
|
||||
} else {
|
||||
$previousMediaType = null;
|
||||
|
@ -306,8 +300,7 @@ SQL;
|
|||
->filterByDbStarts($utcNow, Criteria::GREATER_THAN)
|
||||
->filterByDbPlayoutStatus(0, Criteria::GREATER_THAN)
|
||||
->orderByDbStarts(Criteria::ASC)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if (isset($nextMedia)) {
|
||||
$nextMetadata = null;
|
||||
$nextMediaName = '';
|
||||
|
@ -317,16 +310,14 @@ SQL;
|
|||
$nextMediaType = 'track';
|
||||
$nextFile = CcFilesQuery::create()
|
||||
->filterByDbId($nextMediaFileId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
$nextMetadata = CcFiles::sanitizeResponse($nextFile);
|
||||
$nextMediaName = $nextFile->getDbArtistName() . ' - ' . $nextFile->getDbTrackTitle();
|
||||
} elseif (isset($nextMediaStreamId)) {
|
||||
$nextMediaType = 'webstream';
|
||||
$nextWebstream = CcWebstreamQuery::create()
|
||||
->filterByDbId($nextMediaStreamId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
$nextMediaName = $nextWebstream->getDbName();
|
||||
} else {
|
||||
$nextMediaType = null;
|
||||
|
@ -1181,13 +1172,11 @@ SQL;
|
|||
$ccShowInstance = CcShowInstancesQuery::create()
|
||||
->filterByDbShowId($showId)
|
||||
->filterByDbStarts($show_start->format(DEFAULT_TIMESTAMP_FORMAT))
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
} elseif (!is_null($instanceId)) {
|
||||
$ccShowInstance = CcShowInstancesQuery::create()
|
||||
->filterByDbId($instanceId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
}
|
||||
if ($update && ($ccShowInstance && $ccShowInstance->getDbModifiedInstance() == true)) {
|
||||
return false;
|
||||
|
|
|
@ -58,15 +58,13 @@ final class Application_Model_Scheduler
|
|||
{
|
||||
$destinationInstanceId = $destination['instance'];
|
||||
$destinationCcShowInstance = CcShowInstancesQuery::create()
|
||||
->findPk($destinationInstanceId)
|
||||
;
|
||||
->findPk($destinationInstanceId);
|
||||
$isDestinationLinked = $destinationCcShowInstance->getCcShow()->isLinked();
|
||||
|
||||
foreach ($itemsToMove as $itemToMove) {
|
||||
$sourceInstanceId = $itemToMove['instance'];
|
||||
$ccShowInstance = CcShowInstancesQuery::create()
|
||||
->findPk($sourceInstanceId)
|
||||
;
|
||||
->findPk($sourceInstanceId);
|
||||
|
||||
//does the item being moved belong to a linked show
|
||||
$isSourceLinked = $ccShowInstance->getCcShow()->isLinked();
|
||||
|
@ -469,8 +467,7 @@ final class Application_Model_Scheduler
|
|||
->setDbCueOut('00:00:00')
|
||||
->setDbPlayoutStatus(-1)
|
||||
->setDbInstanceId($instanceId)
|
||||
->save($this->con)
|
||||
;
|
||||
->save($this->con);
|
||||
} else {
|
||||
$nextDT = $DT;
|
||||
}
|
||||
|
@ -495,8 +492,7 @@ final class Application_Model_Scheduler
|
|||
$schedule = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($instanceId)
|
||||
->orderByDbStarts()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
$now = new DateTime('now', new DateTimeZone('UTC'));
|
||||
$itemStartDT = $instance->getDbStarts(null);
|
||||
|
@ -510,8 +506,7 @@ final class Application_Model_Scheduler
|
|||
}
|
||||
$item->setDbStarts($itemStartDT)
|
||||
->setDbEnds($itemEndDT)
|
||||
->save($this->con)
|
||||
;
|
||||
->save($this->con);
|
||||
$itemStartDT = $this->findTimeDifference($itemEndDT, $this->crossfadeDuration);
|
||||
}
|
||||
}
|
||||
|
@ -536,8 +531,7 @@ final class Application_Model_Scheduler
|
|||
->filterByDbInstanceId($showInstance)
|
||||
->filterByDbId($exclude, Criteria::NOT_IN)
|
||||
->orderByDbStarts()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
$now = new DateTime('now', new DateTimeZone('UTC'));
|
||||
$itemStartDT = $instance->getDbStarts(null);
|
||||
|
@ -551,8 +545,7 @@ final class Application_Model_Scheduler
|
|||
}
|
||||
|
||||
$item->setDbStarts($itemStartDT)
|
||||
->setDbEnds($itemEndDT)
|
||||
;
|
||||
->setDbEnds($itemEndDT);
|
||||
|
||||
$itemStartDT = $itemEndDT;
|
||||
}
|
||||
|
@ -579,8 +572,7 @@ final class Application_Model_Scheduler
|
|||
->filterByDbInstanceId($showInstance)
|
||||
->filterByDbId($exclude, Criteria::NOT_IN)
|
||||
->orderByDbStarts()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
foreach ($schedule as $item) {
|
||||
//START OF TIME RECALC HACK
|
||||
|
@ -608,8 +600,7 @@ final class Application_Model_Scheduler
|
|||
$itemEndDT = $this->findEndTime($itemStartDT, $item->getDbClipLength());
|
||||
$item->setDbStarts($itemStartDT)
|
||||
->setDbEnds($itemEndDT)
|
||||
->save($this->con)
|
||||
;
|
||||
->save($this->con);
|
||||
$itemStartDT = $this->findTimeDifference($itemEndDT, $this->crossfadeDuration);
|
||||
}
|
||||
|
||||
|
@ -719,13 +710,11 @@ final class Application_Model_Scheduler
|
|||
$instances = CcShowInstancesQuery::create()
|
||||
->filterByDbShowId($ccShow['id'])
|
||||
->filterByDbStarts(gmdate(DEFAULT_TIMESTAMP_FORMAT), Criteria::GREATER_THAN)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
} else {
|
||||
$instances = CcShowInstancesQuery::create()
|
||||
->filterByDbId($schedule['instance'])
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
|
||||
$excludePositions = [];
|
||||
|
@ -1065,8 +1054,7 @@ final class Application_Model_Scheduler
|
|||
//update the status flag in cc_schedule.
|
||||
$instances = CcShowInstancesQuery::create()
|
||||
->filterByPrimaryKeys($affectedShowInstances)
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
$startProfile = microtime(true);
|
||||
|
||||
|
@ -1083,8 +1071,7 @@ final class Application_Model_Scheduler
|
|||
//update the last scheduled timestamp.
|
||||
CcShowInstancesQuery::create()
|
||||
->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);
|
||||
Logging::debug('updating last scheduled timestamp.');
|
||||
|
@ -1298,8 +1285,7 @@ final class Application_Model_Scheduler
|
|||
->filterByDbPosition($removedItem->getDbPosition())
|
||||
->filterByDbInstanceId($instanceIds, Criteria::IN)
|
||||
->filterByDbId($removedItem->getDbId(), Criteria::NOT_EQUAL)
|
||||
->delete($this->con)
|
||||
;
|
||||
->delete($this->con);
|
||||
}
|
||||
|
||||
//check to truncate the currently playing item instead of deleting it.
|
||||
|
@ -1320,8 +1306,7 @@ final class Application_Model_Scheduler
|
|||
$removedItem->setDbCueOut($cueout)
|
||||
->setDbClipLength($cliplength)
|
||||
->setDbEnds($this->nowDT)
|
||||
->save($this->con)
|
||||
;
|
||||
->save($this->con);
|
||||
} else {
|
||||
$removedItem->delete($this->con);
|
||||
}
|
||||
|
@ -1338,8 +1323,7 @@ final class Application_Model_Scheduler
|
|||
//update the status flag in cc_schedule.
|
||||
$instances = CcShowInstancesQuery::create()
|
||||
->filterByPrimaryKeys($effectedInstanceIds)
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
foreach ($instances as $instance) {
|
||||
$instance->updateScheduleStatus($this->con);
|
||||
|
@ -1349,8 +1333,7 @@ final class Application_Model_Scheduler
|
|||
//update the last scheduled timestamp.
|
||||
CcShowInstancesQuery::create()
|
||||
->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();
|
||||
|
||||
|
@ -1391,8 +1374,7 @@ final class Application_Model_Scheduler
|
|||
$items = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($p_id)
|
||||
->filterByDbEnds($this->nowDT, Criteria::GREATER_THAN)
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
if (count($items) > 0) {
|
||||
$remove = [];
|
||||
|
|
|
@ -258,8 +258,7 @@ SQL;
|
|||
->filterByDbFirstShow($startsDT->format('Y-m-d'))
|
||||
->filterByDbStartTime($startsDT->format('H:i:s'))
|
||||
->filterByDbShowId($this->_showId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
/* 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
|
||||
|
@ -277,16 +276,14 @@ SQL;
|
|||
->filterByDbShowId($this->_showId)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->filterByDbId($excludeIds, criteria::NOT_IN)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
} elseif ($ccShowDay->getDbRepeatType() == -1) {
|
||||
array_push($showDayIds, $ccShowDay->getDbId());
|
||||
|
||||
//treat edited instance as separate show for resize
|
||||
$showInstances = CcShowInstancesQuery::create()
|
||||
->filterByDbId($instanceId)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
} else {
|
||||
$ccShowDays = $ccShow->getCcShowDayss();
|
||||
|
@ -296,8 +293,7 @@ SQL;
|
|||
|
||||
$showInstances = CcShowInstancesQuery::create()
|
||||
->filterByDbShowId($this->_showId)
|
||||
->find($con)
|
||||
;
|
||||
->find($con);
|
||||
}
|
||||
|
||||
/* Check two things:
|
||||
|
@ -400,8 +396,7 @@ SQL;
|
|||
$instances = CcShowInstancesQuery::create()
|
||||
->filterByDbEnds($nowDateTime->format(DEFAULT_TIMESTAMP_FORMAT), Criteria::GREATER_THAN)
|
||||
->filterByDbId($instanceIds, Criteria::IN)
|
||||
->find($con)
|
||||
;
|
||||
->find($con);
|
||||
|
||||
foreach ($instances as $instance) {
|
||||
$instance->updateScheduleStatus($con);
|
||||
|
@ -423,8 +418,7 @@ SQL;
|
|||
|
||||
CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->_showId)
|
||||
->update(['DbLastShow' => $timeinfo[0]])
|
||||
;
|
||||
->update(['DbLastShow' => $timeinfo[0]]);
|
||||
|
||||
$sql = <<<'SQL'
|
||||
SELECT id from cc_show_instances
|
||||
|
@ -461,8 +455,7 @@ SQL;
|
|||
->filterByDbShowId($this->getId())
|
||||
->filterByDbRecord(1)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
return !is_null($showInstancesRow);
|
||||
}
|
||||
|
@ -480,8 +473,7 @@ SQL;
|
|||
->filterByDbShowId($this->_showId)
|
||||
->filterByDbRebroadcast(1)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
return !is_null($showInstancesRow);
|
||||
}
|
||||
|
@ -522,8 +514,7 @@ SQL;
|
|||
{
|
||||
$showDaysRow = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->_showId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
if (!is_null($showDaysRow)) {
|
||||
return $showDaysRow->getDbRepeatType() != -1;
|
||||
|
@ -545,8 +536,7 @@ SQL;
|
|||
{
|
||||
$showDaysRow = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->_showId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
if (!is_null($showDaysRow)) {
|
||||
return $showDaysRow->getDbRepeatType();
|
||||
|
@ -847,8 +837,7 @@ SQL;
|
|||
{
|
||||
return CcShowInstancesQuery::create()
|
||||
->filterByDbShowId($this->getId())
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -913,8 +902,7 @@ SQL;
|
|||
);
|
||||
|
||||
return CcShowInstancesQuery::create()
|
||||
->findPk($row)
|
||||
;
|
||||
->findPk($row);
|
||||
} catch (Exception $e) {
|
||||
return null;
|
||||
}
|
||||
|
@ -1049,12 +1037,10 @@ SQL;
|
|||
$repeatInfo = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($show_id)
|
||||
->filterByDbDay($day)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
$repeatInfo->setDbNextPopDate($nextInfo[0])
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -67,8 +67,7 @@ class Application_Model_ShowBuilder
|
|||
$host_shows = CcShowHostsQuery::create()
|
||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||
->filterByDbHost($this->user->getId())
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
foreach ($host_shows as $host_show) {
|
||||
$shows[] = $host_show->getDbShow();
|
||||
|
|
|
@ -164,24 +164,21 @@ SQL;
|
|||
public function setShowStart($start)
|
||||
{
|
||||
$this->_showInstance->setDbStarts($start)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
public function setShowEnd($end)
|
||||
{
|
||||
$this->_showInstance->setDbEnds($end)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
public function setAutoPlaylistBuilt($bool)
|
||||
{
|
||||
$this->_showInstance->setDbAutoPlaylistBuilt($bool)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
}
|
||||
|
||||
public function updateScheduledTime()
|
||||
|
@ -314,8 +311,7 @@ SQL;
|
|||
{
|
||||
CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($this->_instanceId)
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
$this->updateScheduledTime();
|
||||
}
|
||||
|
@ -327,8 +323,7 @@ SQL;
|
|||
|
||||
$showDays = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($showId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
$showEnd = $showDays->getDbLastShow();
|
||||
|
||||
|
@ -351,8 +346,7 @@ SQL;
|
|||
->filterByDbShowId($showId)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->filterByDbRebroadcast(0)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
if (is_null($showInstances)) {
|
||||
return true;
|
||||
|
@ -363,8 +357,7 @@ SQL;
|
|||
|
||||
$showDaysOld = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($showId)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
$tz = $showDaysOld[0]->getDbTimezone();
|
||||
|
||||
|
@ -392,8 +385,7 @@ SQL;
|
|||
$showInstances = CcShowInstancesQuery::create()
|
||||
->filterByDbShowId($showId)
|
||||
->filterByDbModifiedInstance(true)
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -415,8 +407,7 @@ SQL;
|
|||
CcShowInstancesQuery::create()
|
||||
->findPK($this->_instanceId)
|
||||
->setDbModifiedInstance(true)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
|
||||
if ($this->isRebroadcast()) {
|
||||
return;
|
||||
|
@ -426,21 +417,18 @@ SQL;
|
|||
if ($recording) {
|
||||
CcShowInstancesQuery::create()
|
||||
->filterByDbOriginalShow($this->_instanceId)
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
}
|
||||
|
||||
// Automatically delete all files scheduled in cc_schedules table.
|
||||
CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($this->_instanceId)
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
|
||||
if ($this->checkToDeleteShow($showId)) {
|
||||
CcShowQuery::create()
|
||||
->filterByDbId($showId)
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
}
|
||||
} else {
|
||||
if ($this->isRebroadcast()) {
|
||||
|
@ -459,16 +447,13 @@ SQL;
|
|||
public function setRecordedFile($file_id)
|
||||
{
|
||||
$showInstance = CcShowInstancesQuery::create()
|
||||
->findPK($this->_instanceId)
|
||||
;
|
||||
->findPK($this->_instanceId);
|
||||
$showInstance->setDbRecordedFile($file_id)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
|
||||
$rebroadcasts = CcShowInstancesQuery::create()
|
||||
->filterByDbOriginalShow($this->_instanceId)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
foreach ($rebroadcasts as $rebroadcast) {
|
||||
try {
|
||||
|
@ -611,8 +596,7 @@ SQL;
|
|||
->filterByDbStarts($p_start->format(DEFAULT_TIMESTAMP_FORMAT), Criteria::GREATER_THAN)
|
||||
->leftJoinCcShow()
|
||||
->where('CcShow.has_autoplaylist = ?', 'true')
|
||||
->find($con)
|
||||
;
|
||||
->find($con);
|
||||
$hasAutoplaylist = [];
|
||||
foreach ($showInstances->toArray() as $ap) {
|
||||
$hasAutoplaylist[$ap['DbId']] = true;
|
||||
|
|
|
@ -194,8 +194,7 @@ class Application_Model_StoredFile
|
|||
} // get the user by id and set it like that
|
||||
else {
|
||||
$user = CcSubjsQuery::create()
|
||||
->findPk($p_md['owner_id'])
|
||||
;
|
||||
->findPk($p_md['owner_id']);
|
||||
if ($user) {
|
||||
$owner = $user;
|
||||
}
|
||||
|
@ -661,8 +660,7 @@ SQL;
|
|||
$file = CcFilesQuery::create()
|
||||
->filterByDbDirectory($music_dir->getId())
|
||||
->filterByDbFilepath($path_info[1])
|
||||
->findOne($con)
|
||||
;
|
||||
->findOne($con);
|
||||
|
||||
return is_null($file) ? null : self::createWithFile($file, $con);
|
||||
}
|
||||
|
@ -679,8 +677,7 @@ SQL;
|
|||
$files = CcFilesQuery::create()
|
||||
->filterByDbDirectory($music_dir->getId())
|
||||
->filterByDbFilepath("{$path_info[1]}%")
|
||||
->find($con)
|
||||
;
|
||||
->find($con);
|
||||
$res = [];
|
||||
foreach ($files as $file) {
|
||||
$storedFile = new Application_Model_StoredFile($file, $con);
|
||||
|
@ -1142,15 +1139,13 @@ SQL;
|
|||
public function setFileExistsFlag($flag)
|
||||
{
|
||||
$this->_file->setDbFileExists($flag)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
}
|
||||
|
||||
public function setFileHiddenFlag($flag)
|
||||
{
|
||||
$this->_file->setDbHidden($flag)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
}
|
||||
|
||||
// This method seems to be unsued everywhere so I've commented it out
|
||||
|
|
|
@ -121,8 +121,7 @@ class Application_Model_StreamSetting
|
|||
{
|
||||
$rows = CcStreamSettingQuery::create()
|
||||
->filterByDbKeyName("{$p_streamId}_%")
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
//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.
|
||||
|
|
|
@ -460,8 +460,7 @@ class CcFiles extends BaseCcFiles
|
|||
$defaultOwner = CcSubjsQuery::create()
|
||||
->filterByDbType('A')
|
||||
->orderByDbId()
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if (!$defaultOwner) {
|
||||
// what to do if there is no admin user?
|
||||
// should we handle this case?
|
||||
|
|
|
@ -23,8 +23,7 @@ class CcShow extends BaseCcShow
|
|||
return CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->id)
|
||||
->filterByDbRepeatType(-1, Criteria::NOT_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -57,8 +56,7 @@ class CcShow extends BaseCcShow
|
|||
->filterByCcShow($this)
|
||||
->orderByDbFirstShow()
|
||||
->limit(1)
|
||||
->find($con)
|
||||
;
|
||||
->find($con);
|
||||
if (null !== $criteria) {
|
||||
return $collCcShowDayss;
|
||||
}
|
||||
|
@ -84,8 +82,7 @@ class CcShow extends BaseCcShow
|
|||
->filterByDbShowId($this->id)
|
||||
->filterByDbRepeatType(-1, Criteria::NOT_EQUAL)
|
||||
->orderByDbFirstShow()
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -101,8 +98,7 @@ class CcShow extends BaseCcShow
|
|||
$ccShowDays = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->id)
|
||||
->filterByDbRepeatType(0, Criteria::GREATER_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
if (!$ccShowDays->isEmpty()) {
|
||||
return true;
|
||||
|
@ -121,8 +117,7 @@ class CcShow extends BaseCcShow
|
|||
$ccShowDays = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->id)
|
||||
->filterByDbRepeatType(-1)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
$startsUTC = [];
|
||||
|
||||
|
@ -140,8 +135,7 @@ class CcShow extends BaseCcShow
|
|||
$excludeInstances = CcShowInstancesQuery::create()
|
||||
->filterByDbShowId($this->id)
|
||||
->filterByDbStarts($startsUTC, criteria::IN)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
$excludeIds = [];
|
||||
foreach ($excludeInstances as $instance) {
|
||||
|
@ -178,8 +172,7 @@ class CcShow extends BaseCcShow
|
|||
->filterByCcShow($this)
|
||||
->filterByDbStarts(gmdate('Y-m-d H:i:s'), Criteria::GREATER_THAN)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->find($con)
|
||||
;
|
||||
->find($con);
|
||||
if (null !== $criteria) {
|
||||
return $collCcShowInstancess;
|
||||
}
|
||||
|
@ -195,8 +188,7 @@ class CcShow extends BaseCcShow
|
|||
$ccShowDay = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->getDbId())
|
||||
->filterByDbRecord(1)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
return !is_null($ccShowDay);
|
||||
}
|
||||
|
@ -205,8 +197,7 @@ class CcShow extends BaseCcShow
|
|||
{
|
||||
$ccShowRebroadcast = CcShowRebroadcastQuery::create()
|
||||
->filterByDbShowId($this->getDbId())
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
return !is_null($ccShowRebroadcast);
|
||||
}
|
||||
|
@ -216,8 +207,7 @@ class CcShow extends BaseCcShow
|
|||
return CcShowRebroadcastQuery::create()
|
||||
->filterByDbShowId($this->getDbId())
|
||||
->orderByDbDayOffset()
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
|
||||
public function getRebroadcastsAbsolute()
|
||||
|
@ -227,8 +217,7 @@ class CcShow extends BaseCcShow
|
|||
->filterByDbRebroadcast(1)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->orderByDbStarts()
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
|
||||
public function isLinked()
|
||||
|
@ -263,8 +252,7 @@ class CcShow extends BaseCcShow
|
|||
->filterByCcShow($this)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->orderByDbId()
|
||||
->find($con)
|
||||
;
|
||||
->find($con);
|
||||
|
||||
/*if(null === $this->collCcShowInstancess || null !== $criteria) {
|
||||
if ($this->isNew() && null === $this->collCcShowInstancess) {
|
||||
|
@ -319,8 +307,7 @@ class CcShow extends BaseCcShow
|
|||
return CcShowInstancesQuery::create()
|
||||
->filterByCcShow($this)
|
||||
->filterByDbId($instanceId, Criteria::NOT_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
|
||||
public function getShowInfo()
|
||||
|
|
|
@ -118,8 +118,7 @@ class CcShowInstances extends BaseCcShowInstances
|
|||
->filterByDbInstanceId($this->id)
|
||||
->filterByDbPlayoutStatus(0, Criteria::GREATER_EQUAL)
|
||||
->filterByDbEnds($this->ends, Criteria::LESS_EQUAL)
|
||||
->update(['DbPlayoutStatus' => 1], $con)
|
||||
;
|
||||
->update(['DbPlayoutStatus' => 1], $con);
|
||||
|
||||
//scheduled track is a boundary track
|
||||
CcScheduleQuery::create()
|
||||
|
@ -127,16 +126,14 @@ class CcShowInstances extends BaseCcShowInstances
|
|||
->filterByDbPlayoutStatus(0, Criteria::GREATER_EQUAL)
|
||||
->filterByDbStarts($this->ends, Criteria::LESS_THAN)
|
||||
->filterByDbEnds($this->ends, Criteria::GREATER_THAN)
|
||||
->update(['DbPlayoutStatus' => 2], $con)
|
||||
;
|
||||
->update(['DbPlayoutStatus' => 2], $con);
|
||||
|
||||
//scheduled track is overbooked.
|
||||
CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($this->id)
|
||||
->filterByDbPlayoutStatus(0, Criteria::GREATER_EQUAL)
|
||||
->filterByDbStarts($this->ends, Criteria::GREATER_THAN)
|
||||
->update(['DbPlayoutStatus' => 0], $con)
|
||||
;
|
||||
->update(['DbPlayoutStatus' => 0], $con);
|
||||
|
||||
$this->setDbLastScheduled(gmdate('Y-m-d H:i:s'));
|
||||
$this->save($con);
|
||||
|
@ -155,8 +152,7 @@ class CcShowInstances extends BaseCcShowInstances
|
|||
$schedule = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($this->id)
|
||||
->orderByDbStarts()
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
$pos = 0;
|
||||
foreach ($schedule as $item) {
|
||||
|
|
|
@ -30,8 +30,7 @@ class CcSubjs extends BaseCcSubjs
|
|||
public function isHostOfShowInstance($instanceId)
|
||||
{
|
||||
$showInstance = CcShowInstancesQuery::create()
|
||||
->findPk($instanceId)
|
||||
;
|
||||
->findPk($instanceId);
|
||||
|
||||
return CcShowHostsQuery::create()
|
||||
->filterByDbShow($showInstance->getDbShowId())
|
||||
|
|
|
@ -22,8 +22,7 @@ class StationPodcast extends BaseStationPodcast
|
|||
{
|
||||
$episodes = PodcastEpisodesQuery::create()
|
||||
->filterByDbPodcastId($this->getDbPodcastId())
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
foreach ($episodes as $e) {
|
||||
if ($e->getDbFileId() == $fileId) {
|
||||
return true;
|
||||
|
|
|
@ -37,8 +37,7 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
->filterByDbImportStatus(0)
|
||||
->setLimit($limit)
|
||||
->setOffset($offset)
|
||||
->orderBy($sortColumn, $sortDir)
|
||||
;
|
||||
->orderBy($sortColumn, $sortDir);
|
||||
//->orderByDbId();
|
||||
|
||||
$queryCount = $query->count();
|
||||
|
@ -52,8 +51,7 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
$this->getResponse()
|
||||
->setHttpResponseCode(200)
|
||||
->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):
|
||||
* $this->getResponse()
|
||||
|
@ -74,8 +72,7 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
|
||||
try {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(200)
|
||||
;
|
||||
->setHttpResponseCode(200);
|
||||
$inline = false;
|
||||
// SAAS-1081 - download counter for station podcast downloads
|
||||
if ($key = $this->getRequest()->getParam('download_key', false)) {
|
||||
|
@ -105,8 +102,7 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
try {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(200)
|
||||
->appendBody(json_encode(CcFiles::getSanitizedFileById($id)))
|
||||
;
|
||||
->appendBody(json_encode(CcFiles::getSanitizedFileById($id)));
|
||||
} catch (LibreTimeFileNotFoundException $e) {
|
||||
$this->fileNotFoundResponse();
|
||||
Logging::error($e->getMessage());
|
||||
|
@ -145,16 +141,14 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
$sanitizedFile = CcFiles::createFromUpload($fileInfo);
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(201)
|
||||
->appendBody(json_encode($sanitizedFile))
|
||||
;
|
||||
->appendBody(json_encode($sanitizedFile));
|
||||
} catch (InvalidMetadataException $e) {
|
||||
$this->invalidDataResponse();
|
||||
Logging::error($e->getMessage());
|
||||
} catch (OverDiskQuotaException $e) {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(400)
|
||||
->appendBody('ERROR: Disk Quota reached.')
|
||||
;
|
||||
->appendBody('ERROR: Disk Quota reached.');
|
||||
} catch (Exception $e) {
|
||||
$this->serviceUnavailableResponse();
|
||||
Logging::error($e->getMessage() . "\n" . $e->getTraceAsString());
|
||||
|
@ -174,8 +168,7 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(201)
|
||||
->appendBody(json_encode($sanitizedFile))
|
||||
;
|
||||
->appendBody(json_encode($sanitizedFile));
|
||||
} catch (InvalidMetadataException $e) {
|
||||
$this->invalidDataResponse();
|
||||
Logging::error($e->getMessage());
|
||||
|
@ -198,8 +191,7 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
try {
|
||||
CcFiles::deleteById($id);
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(204)
|
||||
;
|
||||
->setHttpResponseCode(204);
|
||||
} catch (LibreTimeFileNotFoundException $e) {
|
||||
$this->fileNotFoundResponse();
|
||||
Logging::error($e->getMessage());
|
||||
|
@ -221,8 +213,7 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
$data = json_decode($this->getRequest()->getRawBody(), true)['sources'];
|
||||
Application_Service_PublishService::publish($id, $data);
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(200)
|
||||
;
|
||||
->setHttpResponseCode(200);
|
||||
} catch (Exception $e) {
|
||||
$this->unknownErrorResponse();
|
||||
Logging::error($e->getMessage());
|
||||
|
@ -235,8 +226,7 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
$sources = Application_Service_PublishService::getSourceLists($id);
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(200)
|
||||
->appendBody(json_encode($sources))
|
||||
;
|
||||
->appendBody(json_encode($sources));
|
||||
}
|
||||
|
||||
private function getId()
|
||||
|
|
|
@ -35,15 +35,13 @@ class Rest_PodcastController extends Zend_Rest_Controller
|
|||
// Don't return the Station podcast - we fetch it separately
|
||||
->filterByDbId($stationPodcastId, Criteria::NOT_EQUAL)
|
||||
->leftJoinImportedPodcast()
|
||||
->withColumn('auto_ingest_timestamp')
|
||||
;
|
||||
->withColumn('auto_ingest_timestamp');
|
||||
$total = $result->count();
|
||||
if ($limit > 0) {
|
||||
$result->setLimit($limit);
|
||||
}
|
||||
$result->setOffset($offset)
|
||||
->orderBy($sortColumn, $sortDir)
|
||||
;
|
||||
->orderBy($sortColumn, $sortDir);
|
||||
$result = $result->find();
|
||||
|
||||
$podcastArray = $result->toArray(null, false, BasePeer::TYPE_FIELDNAME);
|
||||
|
@ -51,8 +49,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
|
|||
$this->getResponse()
|
||||
->setHttpResponseCode(200)
|
||||
->setHeader('X-TOTAL-COUNT', $total)
|
||||
->appendBody(json_encode($podcastArray))
|
||||
;
|
||||
->appendBody(json_encode($podcastArray));
|
||||
}
|
||||
|
||||
public function getAction()
|
||||
|
@ -65,8 +62,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
|
|||
try {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(200)
|
||||
->appendBody(json_encode(Application_Service_PodcastService::getPodcastById($id)))
|
||||
;
|
||||
->appendBody(json_encode(Application_Service_PodcastService::getPodcastById($id)));
|
||||
} catch (PodcastNotFoundException $e) {
|
||||
$this->podcastNotFoundResponse();
|
||||
Logging::error($e->getMessage());
|
||||
|
@ -100,8 +96,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
|
|||
} catch (InvalidPodcastException $e) {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(400)
|
||||
->appendBody('Invalid podcast!')
|
||||
;
|
||||
->appendBody('Invalid podcast!');
|
||||
} catch (Exception $e) {
|
||||
Logging::error($e->getMessage());
|
||||
$this->unknownErrorResponse();
|
||||
|
@ -121,8 +116,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
|
|||
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(201)
|
||||
->appendBody(json_encode($podcast))
|
||||
;
|
||||
->appendBody(json_encode($podcast));
|
||||
} catch (PodcastNotFoundException $e) {
|
||||
$this->podcastNotFoundResponse();
|
||||
Logging::error($e->getMessage());
|
||||
|
@ -142,8 +136,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
|
|||
try {
|
||||
Application_Service_PodcastService::deletePodcastById($id);
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(204)
|
||||
;
|
||||
->setHttpResponseCode(204);
|
||||
} catch (PodcastNotFoundException $e) {
|
||||
$this->podcastNotFoundResponse();
|
||||
Logging::error($e->getMessage());
|
||||
|
@ -161,8 +154,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
|
|||
if ($this->_request->getMethod() != HttpRequestType::POST) {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(405)
|
||||
->appendBody('ERROR: Method not accepted')
|
||||
;
|
||||
->appendBody('ERROR: Method not accepted');
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -35,8 +35,7 @@ class Rest_PodcastEpisodesController extends Zend_Rest_Controller
|
|||
try {
|
||||
$totalPodcastEpisodesCount = PodcastEpisodesQuery::create()
|
||||
->filterByDbPodcastId($id)
|
||||
->count()
|
||||
;
|
||||
->count();
|
||||
|
||||
// Check if offset and limit were sent with request.
|
||||
// Default limit to zero and offset to $totalFileCount
|
||||
|
@ -50,8 +49,7 @@ class Rest_PodcastEpisodesController extends Zend_Rest_Controller
|
|||
$this->getResponse()
|
||||
->setHttpResponseCode(201)
|
||||
->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) {
|
||||
$this->podcastNotFoundResponse();
|
||||
Logging::error($e->getMessage());
|
||||
|
@ -77,8 +75,7 @@ class Rest_PodcastEpisodesController extends Zend_Rest_Controller
|
|||
try {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(201)
|
||||
->appendBody(json_encode($this->_service->getPodcastEpisodeById($episodeId)))
|
||||
;
|
||||
->appendBody(json_encode($this->_service->getPodcastEpisodeById($episodeId)));
|
||||
} catch (PodcastNotFoundException $e) {
|
||||
$this->podcastNotFoundResponse();
|
||||
Logging::error($e->getMessage());
|
||||
|
@ -115,8 +112,7 @@ class Rest_PodcastEpisodesController extends Zend_Rest_Controller
|
|||
$episode = $this->_service->importEpisode($id, $requestData['episode']);
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(201)
|
||||
->appendBody(json_encode($episode))
|
||||
;
|
||||
->appendBody(json_encode($episode));
|
||||
} catch (Exception $e) {
|
||||
$this->unknownErrorResponse();
|
||||
Logging::error($e->getMessage());
|
||||
|
@ -138,8 +134,7 @@ class Rest_PodcastEpisodesController extends Zend_Rest_Controller
|
|||
try {
|
||||
$this->_service->deletePodcastEpisodeById($episodeId);
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(204)
|
||||
;
|
||||
->setHttpResponseCode(204);
|
||||
} catch (PodcastEpisodeNotFoundException $e) {
|
||||
$this->podcastEpisodeNotFoundResponse();
|
||||
Logging::error($e->getMessage());
|
||||
|
|
|
@ -56,8 +56,7 @@ class Rest_ShowImageController extends Zend_Rest_Controller
|
|||
if (!$showId) {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(400)
|
||||
->appendBody('No show ID provided')
|
||||
;
|
||||
->appendBody('No show ID provided');
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -67,8 +66,7 @@ class Rest_ShowImageController extends Zend_Rest_Controller
|
|||
} catch (Exception $e) {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(500)
|
||||
->appendBody('Error processing image: ' . $e->getMessage())
|
||||
;
|
||||
->appendBody('Error processing image: ' . $e->getMessage());
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -88,13 +86,11 @@ class Rest_ShowImageController extends Zend_Rest_Controller
|
|||
$con->rollBack();
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(500)
|
||||
->appendBody("Couldn't add show image: " . $e->getMessage())
|
||||
;
|
||||
->appendBody("Couldn't add show image: " . $e->getMessage());
|
||||
}
|
||||
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(201)
|
||||
;
|
||||
->setHttpResponseCode(201);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -107,8 +103,7 @@ class Rest_ShowImageController extends Zend_Rest_Controller
|
|||
if (!$showId) {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(400)
|
||||
->appendBody('No show ID provided')
|
||||
;
|
||||
->appendBody('No show ID provided');
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -118,8 +113,7 @@ class Rest_ShowImageController extends Zend_Rest_Controller
|
|||
} catch (Exception $e) {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(500)
|
||||
->appendBody('Error processing image: ' . $e->getMessage())
|
||||
;
|
||||
->appendBody('Error processing image: ' . $e->getMessage());
|
||||
}
|
||||
|
||||
$show = CcShowQuery::create()->findPk($showId);
|
||||
|
@ -137,13 +131,11 @@ class Rest_ShowImageController extends Zend_Rest_Controller
|
|||
$con->rollBack();
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(500)
|
||||
->appendBody("Couldn't remove show image: " . $e->getMessage())
|
||||
;
|
||||
->appendBody("Couldn't remove show image: " . $e->getMessage());
|
||||
}
|
||||
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(201)
|
||||
;
|
||||
->setHttpResponseCode(201);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,8 +13,7 @@ class RestAuth
|
|||
|
||||
$action->getResponse()
|
||||
->setHttpResponseCode(401)
|
||||
->appendBody(json_encode(['message' => 'ERROR: Incorrect API key.']))
|
||||
;
|
||||
->appendBody(json_encode(['message' => 'ERROR: Incorrect API key.']));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -30,8 +29,7 @@ class RestAuth
|
|||
$defaultOwner = CcSubjsQuery::create()
|
||||
->filterByDbType(['A', 'S'], Criteria::IN)
|
||||
->orderByDbId()
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if (!$defaultOwner) {
|
||||
// what to do if there is no admin user?
|
||||
// should we handle this case?
|
||||
|
|
|
@ -316,8 +316,7 @@ class Application_Service_CalendarService
|
|||
$rebroadcasts = CcShowInstancesQuery::create()
|
||||
->filterByDbOriginalShow($this->ccShow->getDbId())
|
||||
->filterByDbStarts($minRebroadcastStart->format(DEFAULT_TIMESTAMP_FORMAT), Criteria::LESS_THAN)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
if (count($rebroadcasts) > 0) {
|
||||
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()) {
|
||||
$recordedShow = CcShowInstancesQuery::create()
|
||||
->filterByCcShow($this->ccShowInstance->getDbOriginalShow())
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if (is_null($recordedShow)) {
|
||||
$this->ccShowInstance->delete();
|
||||
|
||||
|
@ -363,8 +361,7 @@ class Application_Service_CalendarService
|
|||
$this->ccShowInstance
|
||||
->setDbStarts($newStartsDateTime)
|
||||
->setDbEnds($newEndsDateTime)
|
||||
->save($con)
|
||||
;
|
||||
->save($con);
|
||||
|
||||
if (!$this->ccShowInstance->getCcShow()->isRebroadcast()) {
|
||||
//we can get the first show day because we know the show is
|
||||
|
@ -374,8 +371,7 @@ class Application_Service_CalendarService
|
|||
$ccShowDay
|
||||
->setDbFirstShow($newStartsDateTime->setTimezone($showTimezone)->format('Y-m-d'))
|
||||
->setDbStartTime($newStartsDateTime->format('H:i'))
|
||||
->save($con)
|
||||
;
|
||||
->save($con);
|
||||
}
|
||||
|
||||
$diff = $newStartsDateTime->getTimestamp() - $oldStartDateTime->getTimestamp();
|
||||
|
|
|
@ -450,8 +450,7 @@ class Application_Service_HistoryService
|
|||
$hostRecords = CcShowHostsQuery::create()
|
||||
->filterByDbHost($user->getId())
|
||||
->filterByDbShow($showIds)
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
$filteredShowIds = [];
|
||||
|
||||
|
@ -563,8 +562,7 @@ class Application_Service_HistoryService
|
|||
->filterByDbStarts($recordStart)
|
||||
->filterByDbEnds($recordEnd)
|
||||
->filterByDbFileId($fileId)
|
||||
->findOne($this->con)
|
||||
;
|
||||
->findOne($this->con);
|
||||
|
||||
if (empty($prevRecord)) {
|
||||
$history = new CcPlayoutHistory();
|
||||
|
@ -1172,8 +1170,7 @@ class Application_Service_HistoryService
|
|||
|
||||
try {
|
||||
$query = CcPlayoutHistoryTemplateQuery::create()
|
||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||
;
|
||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND);
|
||||
|
||||
if (isset($type)) {
|
||||
$templates = $query->findByDbType($type);
|
||||
|
|
|
@ -137,8 +137,7 @@ class Application_Service_MediaService
|
|||
self::$_pendingFiles = CcFilesQuery::create()
|
||||
->filterByDbImportStatus(CcFiles::IMPORT_STATUS_PENDING)
|
||||
->filterByDbUtime($oneHourAgo, Criteria::LESS_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
$pendingEpisodes = Application_Service_PodcastEpisodeService::getStuckPendingImports();
|
||||
|
||||
return !self::$_pendingFiles->isEmpty() || !empty($pendingEpisodes);
|
||||
|
|
|
@ -269,8 +269,7 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir
|
|||
PodcastEpisodesQuery::create()
|
||||
->filterByDbPodcastId($id)
|
||||
->findOneByDbFileId($fileId)
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -286,8 +285,7 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir
|
|||
public function getPublishStatus($fileId)
|
||||
{
|
||||
$stationPodcast = StationPodcastQuery::create()
|
||||
->findOneByDbPodcastId(Application_Model_Preference::getStationPodcastId())
|
||||
;
|
||||
->findOneByDbPodcastId(Application_Model_Preference::getStationPodcastId());
|
||||
|
||||
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));
|
||||
$episodes = PodcastEpisodesQuery::create()
|
||||
->filterByDbFileId()
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
$stuckImports = [];
|
||||
foreach ($episodes as $episode) {
|
||||
$ref = ThirdPartyTrackReferencesQuery::create()
|
||||
->findOneByDbForeignId(strval($episode->getDbId()))
|
||||
;
|
||||
->findOneByDbForeignId(strval($episode->getDbId()));
|
||||
if (!empty($ref)) {
|
||||
$task = CeleryTasksQuery::create()
|
||||
->filterByDbDispatchTime($timeout, Criteria::LESS_EQUAL)
|
||||
->findOneByDbTrackReference($ref->getDbId())
|
||||
;
|
||||
->findOneByDbTrackReference($ref->getDbId());
|
||||
if (!empty($task)) {
|
||||
array_push($stuckImports, $episode);
|
||||
}
|
||||
|
@ -372,8 +367,7 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir
|
|||
$isStationPodcast = $podcastId == Application_Model_Preference::getStationPodcastId();
|
||||
|
||||
$episodes = PodcastEpisodesQuery::create()
|
||||
->filterByDbPodcastId($podcastId)
|
||||
;
|
||||
->filterByDbPodcastId($podcastId);
|
||||
if ($isStationPodcast && $limit != 0) {
|
||||
$episodes = $episodes->setLimit($limit);
|
||||
}
|
||||
|
@ -382,8 +376,7 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir
|
|||
$episodes = $episodes->joinWith('PodcastEpisodes.CcFiles', Criteria::LEFT_JOIN)
|
||||
->setOffset($offset)
|
||||
->orderBy($sortColumn, $sortDir)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
return $isStationPodcast ? $this->_getStationPodcastEpisodeArray($episodes)
|
||||
: $this->_getImportedPodcastEpisodeArray($podcast, $episodes);
|
||||
|
|
|
@ -236,8 +236,7 @@ class Application_Service_PodcastService
|
|||
$defaultOwner = CcSubjsQuery::create()
|
||||
->filterByDbType('A')
|
||||
->orderByDbId()
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if (!$defaultOwner) {
|
||||
// what to do if there is no admin user?
|
||||
// should we handle this case?
|
||||
|
|
|
@ -54,8 +54,7 @@ class Application_Service_SchedulerService
|
|||
|
||||
$ccSchedules = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($instanceIds, Criteria::IN)
|
||||
->find($con)
|
||||
;
|
||||
->find($con);
|
||||
|
||||
$interval = new DateInterval('PT' . abs($diff) . 'S');
|
||||
if ($diff < 0) {
|
||||
|
@ -69,8 +68,7 @@ class Application_Service_SchedulerService
|
|||
$ccSchedule
|
||||
->setDbStarts($newStart)
|
||||
->setDbEnds($newEnd)
|
||||
->save($con)
|
||||
;
|
||||
->save($con);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -94,16 +92,14 @@ class Application_Service_SchedulerService
|
|||
->filterByDbInstanceId($instance->getDbId())
|
||||
->filterByDbId($schedIds, Criteria::NOT_IN)
|
||||
->orderByDbStarts()
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
foreach ($ccScheduleItems as $ccSchedule) {
|
||||
//DateTime object
|
||||
$itemEnd = $this->findEndTime($itemStart, $ccSchedule->getDbClipLength());
|
||||
|
||||
$ccSchedule->setDbStarts($itemStart)
|
||||
->setDbEnds($itemEnd)
|
||||
;
|
||||
->setDbEnds($itemEnd);
|
||||
|
||||
$itemStart = $itemEnd;
|
||||
}
|
||||
|
@ -184,8 +180,7 @@ class Application_Service_SchedulerService
|
|||
->filterByDbId($instancsIdsToFill, Criteria::NOT_IN)
|
||||
->orderByDbStarts(Criteria::DESC)
|
||||
->limit(1)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
if (is_null($showInstanceWithMostRecentSchedule)) {
|
||||
return null;
|
||||
|
@ -341,8 +336,7 @@ class Application_Service_SchedulerService
|
|||
foreach ($ccShow->getCcShowInstancess() as $ccShowInstance) {
|
||||
$ccSchedules = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($ccShowInstance->getDbId())
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
if ($ccSchedules->isEmpty()) {
|
||||
$nextStartDT = $ccShowInstance->getDbStarts(null);
|
||||
|
@ -363,8 +357,7 @@ class Application_Service_SchedulerService
|
|||
->setDbCueOut($item->getDbCueOut())
|
||||
->setDbInstanceId($ccShowInstance->getDbId())
|
||||
->setDbPosition($item->getDbPosition())
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
|
||||
$nextStartDT = self::findTimeDifference(
|
||||
$endTimeDT,
|
||||
|
@ -375,8 +368,7 @@ class Application_Service_SchedulerService
|
|||
$ccShowInstance
|
||||
->setDbTimeFilled($timeFilled)
|
||||
->setDbLastScheduled(gmdate(DEFAULT_TIMESTAMP_FORMAT))
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -450,8 +442,7 @@ class Application_Service_SchedulerService
|
|||
$ccSchedules = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($instanceIds, Criteria::IN)
|
||||
->setDistinct(CcSchedulePeer::FILE_ID)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
$fileIds = [];
|
||||
foreach ($ccSchedules as $ccSchedule) {
|
||||
$fileIds[] = $ccSchedule->getDbFileId();
|
||||
|
@ -460,8 +451,7 @@ class Application_Service_SchedulerService
|
|||
// Clear out the schedule
|
||||
CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($instanceIds, Criteria::IN)
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
|
||||
/* Now that the schedule has been cleared we need to make
|
||||
* sure we do not update the is_scheduled flag for tracks
|
||||
|
|
|
@ -217,8 +217,7 @@ class Application_Service_ShowFormService
|
|||
->filterByDbModifiedInstance(false)
|
||||
->filterByDbStarts(gmdate('Y-m-d H:i:s'), Criteria::GREATER_THAN)
|
||||
->orderByDbStarts()
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
if (!$ccShowInstance) {
|
||||
return null;
|
||||
|
@ -517,8 +516,7 @@ class Application_Service_ShowFormService
|
|||
->filterByDbModifiedInstance(false)
|
||||
->filterByDbStarts(gmdate('Y-m-d H:i:s'), Criteria::GREATER_EQUAL)
|
||||
->orderByDbStarts()
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
if (!$ccShowInstance) {
|
||||
return null;
|
||||
|
|
|
@ -73,8 +73,7 @@ class Application_Service_ShowService
|
|||
//get the ccShow object to which this instance belongs
|
||||
//so we can get the original start date and time
|
||||
$this->ccShow = CcShowQuery::create()
|
||||
->findPk($showId)
|
||||
;
|
||||
->findPk($showId);
|
||||
|
||||
//DateTime in shows's local time
|
||||
$newStartDateTime = new DateTime(
|
||||
|
@ -84,8 +83,7 @@ class Application_Service_ShowService
|
|||
);
|
||||
|
||||
$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
|
||||
$origLocalStartDateTime = $ccShowInstanceOrig->getLocalStartDateTime();
|
||||
|
@ -120,8 +118,7 @@ class Application_Service_ShowService
|
|||
->filterByDbRepeatType(-1)
|
||||
->filterByDbFirstShow($origLocalStartDateTime->format('Y-m-d'))
|
||||
->filterByDbStartTime($origLocalStartDateTime->format('H:i:s'))
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
|
||||
/*
|
||||
* Set the new cc_show_day record
|
||||
|
@ -139,8 +136,7 @@ class Application_Service_ShowService
|
|||
->filterByDbRepeatType(-1)
|
||||
->filterByDbFirstShow($showData['add_show_start_date'])
|
||||
->filterByDbStartTime($showData['add_show_start_time'] . ':00')
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
$ccShowInstance = $this->createNonRepeatingInstance(
|
||||
$showDay,
|
||||
|
@ -159,15 +155,13 @@ class Application_Service_ShowService
|
|||
$ccShowInstance->updateScheduleStatus($con);
|
||||
$ccShowInstance
|
||||
->setDbDescription($showData['add_show_instance_description'])
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
|
||||
//delete the edited instance from the repeating sequence
|
||||
$ccShowInstanceOrig
|
||||
->setDbModifiedInstance(true)
|
||||
->setDbDescription($showData['add_show_instance_description'])
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
|
||||
$con->commit();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
|
@ -346,8 +340,7 @@ class Application_Service_ShowService
|
|||
*/
|
||||
$ccShowDays = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->ccShow->getDbId())
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -521,8 +514,7 @@ SQL;
|
|||
{
|
||||
CcShowDaysQuery::create()
|
||||
->filterByDbShowId($showId)
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -776,8 +768,7 @@ SQL;
|
|||
CcShowDaysQuery::create()
|
||||
->filterByDbShowId($showId)
|
||||
->filterByDbDay($day)
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
}
|
||||
|
||||
$uncheckedDays = pg_escape_string(implode(',', $daysRemovedUTC));
|
||||
|
@ -812,8 +803,7 @@ SQL;
|
|||
}
|
||||
|
||||
$ccShowInstance = CcShowInstancesQuery::create()
|
||||
->findPk($instanceId)
|
||||
;
|
||||
->findPk($instanceId);
|
||||
if (!$ccShowInstance) {
|
||||
throw new Exception('Could not find show instance');
|
||||
}
|
||||
|
@ -830,8 +820,7 @@ SQL;
|
|||
$ccShowInstances = CcShowInstancesQuery::create()
|
||||
->filterByDbShowId($showId)
|
||||
->filterByDbStarts($ccShowInstance->getDbStarts(), Criteria::GREATER_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
|
||||
if (gmdate(DEFAULT_TIMESTAMP_FORMAT) <= $ccShowInstance->getDbEnds()) {
|
||||
|
@ -863,29 +852,25 @@ SQL;
|
|||
|
||||
$ccShowInstance
|
||||
->setDbModifiedInstance(true)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
|
||||
//delete the rebroadcasts of the removed recorded show
|
||||
if ($ccShowInstance->isRecorded()) {
|
||||
CcShowInstancesQuery::create()
|
||||
->filterByDbOriginalShow($instanceId)
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
}
|
||||
|
||||
//delete all files scheduled in cc_schedules table
|
||||
CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($instanceId)
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
}
|
||||
|
||||
if ($this->checkToDeleteCcShow($showId)) {
|
||||
CcShowQuery::create()
|
||||
->filterByDbId($showId)
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
/* 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
|
||||
* Instance and All Following'. We only need to set the last_show value
|
||||
|
@ -903,8 +888,7 @@ SQL;
|
|||
->filterByDbModifiedInstance(false)
|
||||
->filterByDbRebroadcast(0)
|
||||
->orderByDbStarts()
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
/* 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
|
||||
|
@ -935,8 +919,7 @@ SQL;
|
|||
->filterByDbShowId($showId)
|
||||
->filterByDbDay($dayOfWeek)
|
||||
->filterByDbRepeatType(-1, Criteria::NOT_EQUAL)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
if (isset($ccShowDay)) {
|
||||
$lastShowStartDT->setTimeZone(new DateTimeZone(
|
||||
|
@ -950,8 +933,7 @@ SQL;
|
|||
|
||||
$ccShowDay
|
||||
->setDbLastShow($lastShowEndDT->format('Y-m-d'))
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -962,8 +944,7 @@ SQL;
|
|||
->filterByDbShowId($showId)
|
||||
->filterByDbRepeatType(0, Criteria::GREATER_EQUAL)
|
||||
->filterByDbLastShow(null)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
foreach ($showDays as $showDay) {
|
||||
$showDay->setDbLastShow($showDay->getDbFirstShow())->save();
|
||||
}
|
||||
|
@ -977,8 +958,7 @@ SQL;
|
|||
->filterByDbModifiedInstance(false)
|
||||
->filterByDbRebroadcast(0)
|
||||
->orderByDbStarts()
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
if ($ccShowInstances->isEmpty()) {
|
||||
return true;
|
||||
|
@ -1612,8 +1592,7 @@ SQL;
|
|||
//->filterByDbModifiedInstance(false, Criteria::EQUAL)
|
||||
->filterByDbRebroadcast(0, Criteria::EQUAL)
|
||||
->limit(1)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
if ($ccShowInstance->isEmpty()) {
|
||||
return false;
|
||||
|
@ -1634,8 +1613,7 @@ SQL;
|
|||
->filterByDbDay($day)
|
||||
->filterByDbRepeatType($repeatType)
|
||||
->limit(1)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
if ($ccShowDay->isEmpty()) {
|
||||
return false;
|
||||
|
@ -1728,8 +1706,7 @@ SQL;
|
|||
$showDay = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($showId)
|
||||
->filterByDbRepeatType($this->origCcShowDay->getDbRepeatType())
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if (!$showDay) {
|
||||
//repeat type changed so we have to create a new show_day rule
|
||||
$showDay = new CcShowDays();
|
||||
|
@ -1778,8 +1755,7 @@ SQL;
|
|||
->filterByDbShowId($showId)
|
||||
->filterByDbRepeatType($this->origCcShowDay->getDbRepeatType())
|
||||
->filterByDbDay($day)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if (!$showDay) {
|
||||
//if no show day object was found it is because a new
|
||||
//repeating day of the week was added OR the repeat
|
||||
|
@ -1959,11 +1935,9 @@ SQL;
|
|||
->filterByDbShowId($showId)
|
||||
->filterByDbDay($day)
|
||||
->filterByDbRepeatType(-1, Criteria::NOT_EQUAL)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
$repeatInfo->setDbNextPopDate($nextInfo[0])
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,8 +104,7 @@ abstract class Application_Service_ThirdPartyCeleryService extends Application_S
|
|||
{
|
||||
static::updateTask($task, $status);
|
||||
$ref = ThirdPartyTrackReferencesQuery::create()
|
||||
->findOneByDbId($trackId)
|
||||
;
|
||||
->findOneByDbId($trackId);
|
||||
if (is_null($ref)) {
|
||||
$ref = new ThirdPartyTrackReferences();
|
||||
}
|
||||
|
|
|
@ -35,8 +35,7 @@ abstract class Application_Service_ThirdPartyService
|
|||
// If the file ID given is null, create a new reference
|
||||
$ref = is_null($fileId) ? null : ThirdPartyTrackReferencesQuery::create()
|
||||
->filterByDbService(static::$_SERVICE_NAME)
|
||||
->findOneByDbFileId($fileId)
|
||||
;
|
||||
->findOneByDbFileId($fileId);
|
||||
if (is_null($ref)) {
|
||||
$ref = new ThirdPartyTrackReferences();
|
||||
}
|
||||
|
@ -61,8 +60,7 @@ abstract class Application_Service_ThirdPartyService
|
|||
{
|
||||
$ref = ThirdPartyTrackReferencesQuery::create()
|
||||
->filterByDbService(static::$_SERVICE_NAME)
|
||||
->findOneByDbFileId($fileId)
|
||||
;
|
||||
->findOneByDbFileId($fileId);
|
||||
$ref->delete();
|
||||
}
|
||||
|
||||
|
@ -79,7 +77,7 @@ abstract class Application_Service_ThirdPartyService
|
|||
$ref = ThirdPartyTrackReferencesQuery::create()
|
||||
->filterByDbService(static::$_SERVICE_NAME)
|
||||
->findOneByDbFileId($fileId) // There shouldn't be duplicates!
|
||||
;
|
||||
;
|
||||
|
||||
return empty($ref) ? '' : $ref->getDbForeignId();
|
||||
}
|
||||
|
@ -97,13 +95,11 @@ abstract class Application_Service_ThirdPartyService
|
|||
{
|
||||
$ref = ThirdPartyTrackReferencesQuery::create()
|
||||
->filterByDbService(static::$_SERVICE_NAME)
|
||||
->findOneByDbFileId($fileId)
|
||||
;
|
||||
->findOneByDbFileId($fileId);
|
||||
if (!empty($ref)) {
|
||||
$task = CeleryTasksQuery::create()
|
||||
->orderByDbDispatchTime(Criteria::DESC)
|
||||
->findOneByDbTrackReference($ref->getDbId())
|
||||
;
|
||||
->findOneByDbTrackReference($ref->getDbId());
|
||||
|
||||
return $task->getDbStatus() == CELERY_PENDING_STATUS ? -1
|
||||
: ($task->getDbStatus() == CELERY_FAILED_STATUS ? 0 : 1);
|
||||
|
|
|
@ -302,23 +302,20 @@ class AirtimeUpgrader254 extends AirtimeUpgrader
|
|||
$numberOfSuperAdmins = CcSubjsQuery::create()
|
||||
->filterByDbType(UTYPE_SUPERADMIN)
|
||||
->filterByDbLogin('sourcefabric_admin', Criteria::NOT_EQUAL) //Ignore sourcefabric_admin users
|
||||
->count()
|
||||
;
|
||||
->count();
|
||||
|
||||
//Only create a super admin if there isn't one already.
|
||||
if ($numberOfSuperAdmins == 0) {
|
||||
//Find the "admin" user and promote them to superadmin.
|
||||
$adminUser = CcSubjsQuery::create()
|
||||
->filterByDbLogin('admin')
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if (!$adminUser) {
|
||||
// Otherwise get the user with the lowest ID that is of type administrator:
|
||||
$adminUser = CcSubjsQuery::create()
|
||||
->filterByDbType(UTYPE_ADMIN)
|
||||
->orderByDbId(Criteria::ASC)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
if (!$adminUser) {
|
||||
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
|
||||
$sofabAdminUser = CcSubjsQuery::create()
|
||||
->filterByDbLogin('sourcefabric_admin')
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if ($sofabAdminUser) {
|
||||
$sofabAdminUser = new Application_Model_User($sofabAdminUser->getDbId());
|
||||
$sofabAdminUser->setType(UTYPE_SUPERADMIN);
|
||||
|
@ -409,8 +405,7 @@ class AirtimeUpgrader2511 extends AirtimeUpgrader
|
|||
$queryResult = CcFilesQuery::create()
|
||||
->select(['disk_usage'])
|
||||
->withColumn('SUM(CcFiles.filesize)', 'disk_usage')
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
$disk_usage = $queryResult[0];
|
||||
Application_Model_Preference::setDiskUsage($disk_usage);
|
||||
}
|
||||
|
|
|
@ -139,8 +139,7 @@ class MediaSetup extends Setup
|
|||
|
||||
$dir->setDirectory(self::$path)
|
||||
->setType('stor')
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
self::$message = 'Successfully set up media folder!';
|
||||
Propel::close();
|
||||
unset($_SERVER['AIRTIME_CONF']);
|
||||
|
|
|
@ -8,8 +8,7 @@ class TestHelper
|
|||
|
||||
//pass to the adapter the submitted username and password
|
||||
$authAdapter->setIdentity('admin')
|
||||
->setCredential('admin')
|
||||
;
|
||||
->setCredential('admin');
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$result = $auth->authenticate($authAdapter);
|
||||
|
|
|
@ -520,8 +520,7 @@ class ShowServiceDbTest extends Zend_Test_PHPUnit_DatabaseTestCase
|
|||
$ccFiles
|
||||
->setDbCueIn('00:00:00')
|
||||
->setDbCueOut('00:04:32')
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
|
||||
$scheduleItems = [
|
||||
0 => [
|
||||
|
@ -578,8 +577,7 @@ class ShowServiceDbTest extends Zend_Test_PHPUnit_DatabaseTestCase
|
|||
$ccFiles
|
||||
->setDbCueIn('00:00:00')
|
||||
->setDbCueOut('00:04:32')
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
|
||||
$scheduleItems = [
|
||||
0 => [
|
||||
|
|
Loading…
Reference in New Issue