Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
5ac51e289d
165 changed files with 11281 additions and 14803 deletions
|
@ -17,15 +17,12 @@ require_once "Timezone.php";
|
|||
require_once __DIR__.'/forms/helpers/ValidationTypes.php';
|
||||
require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';
|
||||
|
||||
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
require_once (APPLICATION_PATH."/logging/Logging.php");
|
||||
Logging::setLogPath('/var/log/airtime/zendphp.log');
|
||||
date_default_timezone_set(Application_Model_Preference::GetTimezone());
|
||||
|
||||
Config::setAirtimeVersion();
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
require_once __DIR__."/configs/navigation.php";
|
||||
|
||||
Zend_Validate::setDefaultNamespaces("Zend");
|
||||
|
|
|
@ -229,7 +229,7 @@ class Application_Common_DateHelper
|
|||
public static function calculateLengthInSeconds($p_time){
|
||||
|
||||
if (2 !== substr_count($p_time, ":")){
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (1 === substr_count($p_time, ".")){
|
||||
|
@ -241,12 +241,8 @@ class Application_Common_DateHelper
|
|||
|
||||
list($hours, $minutes, $seconds) = explode(":", $hhmmss);
|
||||
|
||||
// keep ms in 3 digits
|
||||
$ms = substr($ms, 0, 3);
|
||||
|
||||
$totalSeconds = $hours*3600 + $minutes*60 + $seconds + $ms/1000;
|
||||
|
||||
return $totalSeconds;
|
||||
$totalSeconds = ($hours*3600 + $minutes*60 + $seconds).".$ms";
|
||||
return round($totalSeconds, 3);
|
||||
}
|
||||
|
||||
public static function ConvertToUtcDateTime($p_dateString, $timezone=null){
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
// This file generated by Propel 1.5.2 convert-conf target
|
||||
// from XML runtime conf file /home/rudi/reps/Airtime/airtime_mvc/build/runtime-conf.xml
|
||||
// from XML runtime conf file /home/denise/airtime/airtime_mvc/build/runtime-conf.xml
|
||||
$conf = array (
|
||||
'datasources' =>
|
||||
array (
|
||||
|
|
|
@ -42,8 +42,10 @@ class ApiController extends Zend_Controller_Action
|
|||
->addActionContext('reload-metadata-group' , 'json')
|
||||
->addActionContext('notify-webstream-data' , 'json')
|
||||
->addActionContext('get-stream-parameters' , 'json')
|
||||
->addActionContext('push-stream-stats' , 'json')
|
||||
->addActionContext('update-stream-setting-table' , 'json')
|
||||
->addActionContext('push-stream-stats' , 'json')
|
||||
->addActionContext('update-stream-setting-table' , 'json')
|
||||
->addActionContext('update-replay-gain-value' , 'json')
|
||||
->addActionContext('update-cue-values-by-silan' , 'json')
|
||||
->initContext();
|
||||
}
|
||||
|
||||
|
@ -261,7 +263,14 @@ class ApiController extends Zend_Controller_Action
|
|||
"currentShow"=>Application_Model_Show::getCurrentShow($utcTimeNow),
|
||||
"nextShow"=>Application_Model_Show::getNextShows($utcTimeNow, $limit, $utcTimeEnd)
|
||||
);
|
||||
|
||||
// XSS exploit prevention
|
||||
foreach ($result["currentShow"] as &$current) {
|
||||
$current["name"] = htmlspecialchars($current["name"]);
|
||||
}
|
||||
foreach ($result["nextShow"] as &$next) {
|
||||
$next["name"] = htmlspecialchars($next["name"]);
|
||||
}
|
||||
|
||||
Application_Model_Show::convertToLocalTimeZone($result["currentShow"],
|
||||
array("starts", "ends", "start_timestamp", "end_timestamp"));
|
||||
Application_Model_Show::convertToLocalTimeZone($result["nextShow"],
|
||||
|
@ -269,6 +278,17 @@ class ApiController extends Zend_Controller_Action
|
|||
} else {
|
||||
$result = Application_Model_Schedule::GetPlayOrderRange();
|
||||
|
||||
// XSS exploit prevention
|
||||
$result["previous"]["name"] = htmlspecialchars($result["previous"]["name"]);
|
||||
$result["current"]["name"] = htmlspecialchars($result["current"]["name"]);
|
||||
$result["next"]["name"] = htmlspecialchars($result["next"]["name"]);
|
||||
foreach ($result["currentShow"] as &$current) {
|
||||
$current["name"] = htmlspecialchars($current["name"]);
|
||||
}
|
||||
foreach ($result["nextShow"] as &$next) {
|
||||
$next["name"] = htmlspecialchars($next["name"]);
|
||||
}
|
||||
|
||||
//Convert from UTC to localtime for Web Browser.
|
||||
Application_Model_Show::ConvertToLocalTimeZone($result["currentShow"],
|
||||
array("starts", "ends", "start_timestamp", "end_timestamp"));
|
||||
|
@ -315,7 +335,15 @@ class ApiController extends Zend_Controller_Action
|
|||
|
||||
$result[$dow[$i]] = $shows;
|
||||
}
|
||||
|
||||
|
||||
// XSS exploit prevention
|
||||
foreach ($dow as $d) {
|
||||
foreach ($result[$d] as &$show) {
|
||||
$show["name"] = htmlspecialchars($show["name"]);
|
||||
$show["url"] = htmlspecialchars($show["url"]);
|
||||
}
|
||||
}
|
||||
|
||||
//used by caller to determine if the airtime they are running or widgets in use is out of date.
|
||||
$result['AIRTIME_API_VERSION'] = AIRTIME_API_VERSION;
|
||||
header("Content-type: text/javascript");
|
||||
|
@ -411,7 +439,9 @@ class ApiController extends Zend_Controller_Action
|
|||
$result = Application_Model_StoredFile::copyFileToStor($upload_dir, $fileName, $tempFileName);
|
||||
|
||||
if (!is_null($result)) {
|
||||
die('{"jsonrpc" : "2.0", "error" : {"code": '.$result['code'].', "message" : "'.$result['message'].'"}}');
|
||||
$this->_helper->json->sendJson(
|
||||
array("jsonrpc" => "2.0", "error" => array("code" => $result['code'], "message" => $result['message']))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -600,7 +630,7 @@ class ApiController extends Zend_Controller_Action
|
|||
$response['key'] = $k;
|
||||
array_push($responses, $response);
|
||||
}
|
||||
die( json_encode($responses) );
|
||||
$this->_helper->json->sendJson($responses);
|
||||
}
|
||||
|
||||
public function listAllFilesAction()
|
||||
|
@ -668,7 +698,6 @@ class ApiController extends Zend_Controller_Action
|
|||
"platform"=>Application_Model_Systemstatus::GetPlatformInfo(),
|
||||
"airtime_version"=>Application_Model_Preference::GetAirtimeVersion(),
|
||||
"services"=>array(
|
||||
"rabbitmq"=>Application_Model_Systemstatus::GetRabbitMqStatus(),
|
||||
"pypo"=>Application_Model_Systemstatus::GetPypoStatus(),
|
||||
"liquidsoap"=>Application_Model_Systemstatus::GetLiquidsoapStatus(),
|
||||
"media_monitor"=>Application_Model_Systemstatus::GetMediaMonitorStatus()
|
||||
|
@ -919,7 +948,7 @@ class ApiController extends Zend_Controller_Action
|
|||
|
||||
public function updateReplayGainValueAction()
|
||||
{
|
||||
// disable layout
|
||||
// disable the view and the layout
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
|
@ -933,17 +962,19 @@ class ApiController extends Zend_Controller_Action
|
|||
$file->setDbReplayGain($gain);
|
||||
$file->save();
|
||||
}
|
||||
|
||||
$this->view->msg = "OK";
|
||||
}
|
||||
|
||||
public function updateCueValuesBySilanAction()
|
||||
{
|
||||
// disable layout
|
||||
// disable the view and the layout
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
|
||||
$request = $this->getRequest();
|
||||
$data = json_decode($request->getParam('data'));
|
||||
Logging::info($data);
|
||||
|
||||
foreach ($data as $pair) {
|
||||
list($id, $info) = $pair;
|
||||
// TODO : move this code into model -- RG
|
||||
|
@ -955,6 +986,8 @@ class ApiController extends Zend_Controller_Action
|
|||
$file->setDbSilanCheck(true);
|
||||
$file->save();
|
||||
}
|
||||
|
||||
echo json_encode(array());
|
||||
}
|
||||
|
||||
public function notifyWebstreamDataAction()
|
||||
|
@ -962,7 +995,6 @@ class ApiController extends Zend_Controller_Action
|
|||
$request = $this->getRequest();
|
||||
$data = $request->getParam("data");
|
||||
$media_id = $request->getParam("media_id");
|
||||
|
||||
$data_arr = json_decode($data);
|
||||
|
||||
if (!is_null($media_id)) {
|
||||
|
|
|
@ -60,8 +60,10 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
$this->view->uri = $uri;
|
||||
$this->view->mime = $mime;
|
||||
$this->view->audioFileID = $audioFileID;
|
||||
$this->view->audioFileArtist = $audioFileArtist;
|
||||
$this->view->audioFileTitle = $audioFileTitle;
|
||||
// We need to decode artist and title because it gets
|
||||
// encoded twice in js
|
||||
$this->view->audioFileArtist = htmlspecialchars(urldecode($audioFileArtist));
|
||||
$this->view->audioFileTitle = htmlspecialchars(urldecode($audioFileTitle));
|
||||
$this->view->type = $type;
|
||||
|
||||
$this->_helper->viewRenderer->setRender('audio-preview');
|
||||
|
|
|
@ -81,6 +81,17 @@ class LibraryController extends Zend_Controller_Action
|
|||
$this->view->length = $formatter->format();
|
||||
$this->view->type = $obj_sess->type;
|
||||
}
|
||||
|
||||
//get user settings and determine if we need to hide
|
||||
// or show the playlist editor
|
||||
$showPlaylist = false;
|
||||
$data = Application_Model_Preference::getLibraryScreenSettings();
|
||||
if (!is_null($data)) {
|
||||
if ($data["playlist"] == "true") {
|
||||
$showPlaylist = true;
|
||||
}
|
||||
}
|
||||
$this->view->showPlaylist = $showPlaylist;
|
||||
} catch (PlaylistNotFoundException $e) {
|
||||
$this->playlistNotFound($obj_sess->type);
|
||||
} catch (Exception $e) {
|
||||
|
@ -382,23 +393,6 @@ class LibraryController extends Zend_Controller_Action
|
|||
# terrible name for the method below. it does not only search files.
|
||||
$r = Application_Model_StoredFile::searchLibraryFiles($params);
|
||||
|
||||
//TODO move this to the datatables row callback.
|
||||
foreach ($r["aaData"] as &$data) {
|
||||
|
||||
if ($data['ftype'] == 'audioclip') {
|
||||
$file = Application_Model_StoredFile::Recall($data['id']);
|
||||
$scid = $file->getSoundCloudId();
|
||||
|
||||
if ($scid == "-2") {
|
||||
$data['track_title'] .= '<span class="small-icon progress"/>';
|
||||
} elseif ($scid == "-3") {
|
||||
$data['track_title'] .= '<span class="small-icon sc-error"/>';
|
||||
} elseif (!is_null($scid)) {
|
||||
$data['track_title'] .= '<span class="small-icon soundcloud"/>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->sEcho = $r["sEcho"];
|
||||
$this->view->iTotalDisplayRecords = $r["iTotalDisplayRecords"];
|
||||
$this->view->iTotalRecords = $r["iTotalRecords"];
|
||||
|
@ -524,7 +518,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
$id = $this->_getParam('id');
|
||||
Application_Model_Soundcloud::uploadSoundcloud($id);
|
||||
// we should die with ui info
|
||||
die();
|
||||
$this->_helper->json->sendJson(null);
|
||||
}
|
||||
|
||||
public function getUploadToSoundcloudStatusAction()
|
||||
|
|
|
@ -76,6 +76,6 @@ class ListenerstatController extends Zend_Controller_Action
|
|||
$endsDT = DateTime::createFromFormat("U", $ends_epoch, new DateTimeZone("UTC"));
|
||||
|
||||
$data = Application_Model_ListenerStat::getDataPointsWithinRange($startsDT->format("Y-m-d H:i:s"), $endsDT->format("Y-m-d H:i:s"), $mountName);
|
||||
die(json_encode($data));
|
||||
$this->_helper->json->sendJson($data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,10 +4,6 @@ class LocaleController extends Zend_Controller_Action
|
|||
{
|
||||
public function init()
|
||||
{
|
||||
$ajaxContext = $this->_helper->getHelper("AjaxContext");
|
||||
$ajaxContext->addActionContext("general-translation-table", "json")
|
||||
->addActionContext("datatables-translation-table", "json")
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function datatablesTranslationTableAction()
|
||||
|
@ -26,7 +22,7 @@ class LocaleController extends Zend_Controller_Action
|
|||
$locale.".txt")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function generalTranslationTableAction()
|
||||
{
|
||||
$translations = array (
|
||||
|
|
|
@ -14,6 +14,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
->addActionContext('new', 'json')
|
||||
->addActionContext('edit', 'json')
|
||||
->addActionContext('delete', 'json')
|
||||
->addActionContext('close-playlist', 'json')
|
||||
->addActionContext('play', 'json')
|
||||
->addActionContext('set-playlist-fades', 'json')
|
||||
->addActionContext('get-playlist-fades', 'json')
|
||||
|
@ -26,6 +27,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
->addActionContext('smart-block-shuffle', 'json')
|
||||
->addActionContext('get-block-info', 'json')
|
||||
->addActionContext('shuffle', 'json')
|
||||
->addActionContext('empty-content', 'json')
|
||||
->initContext();
|
||||
|
||||
}
|
||||
|
@ -132,7 +134,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
if (!$p_isJson) {
|
||||
$this->createFullResponse(null);
|
||||
} else {
|
||||
die(json_encode(array("error"=>$this->view->error, "result"=>1, "html"=>$this->createFullResponse(null, $p_isJson))));
|
||||
$this->_helper->json->sendJson(array("error"=>$this->view->error, "result"=>1, "html"=>$this->createFullResponse(null, $p_isJson)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -245,6 +247,13 @@ class PlaylistController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
|
||||
public function closePlaylistAction() {
|
||||
$type = $this->_getParam('type');
|
||||
$obj = null;
|
||||
Application_Model_Library::changePlaylist($obj, $type);
|
||||
$this->createFullResponse($obj);
|
||||
}
|
||||
|
||||
public function addItemsAction()
|
||||
{
|
||||
$ids = $this->_getParam('aItems', array());
|
||||
|
@ -336,6 +345,26 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$this->playlistUnknownError($e);
|
||||
}
|
||||
}
|
||||
|
||||
public function emptyContentAction()
|
||||
{
|
||||
$type = $this->_getParam('obj_type');
|
||||
try {
|
||||
$obj = $this->getPlaylist($type);
|
||||
if ($type == 'playlist') {
|
||||
$obj->deleteAllFilesFromPlaylist();
|
||||
} else {
|
||||
$obj->deleteAllFilesFromBlock();
|
||||
}
|
||||
$this->createUpdateResponse($obj);
|
||||
} catch (PlaylistOutDatedException $e) {
|
||||
$this->playlistOutdated($e);
|
||||
} catch (PlaylistNotFoundException $e) {
|
||||
$this->playlistNotFound($type);
|
||||
} catch (Exception $e) {
|
||||
$this->playlistUnknownError($e);
|
||||
}
|
||||
}
|
||||
|
||||
public function setCueAction()
|
||||
{
|
||||
|
@ -488,7 +517,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
$result["modified"] = $this->view->modified;
|
||||
die(json_encode($result));
|
||||
$this->_helper->json->sendJson($result);
|
||||
}
|
||||
|
||||
public function smartBlockGenerateAction()
|
||||
|
@ -504,7 +533,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$form->startForm($params['obj_id']);
|
||||
if ($form->isValid($params)) {
|
||||
$result = $bl->generateSmartBlock($params['data']);
|
||||
die(json_encode(array("result"=>0, "html"=>$this->createFullResponse($bl, true, true))));
|
||||
$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($bl, true, true)));
|
||||
} else {
|
||||
$this->view->obj = $bl;
|
||||
$this->view->id = $bl->getId();
|
||||
|
@ -512,7 +541,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$viewPath = 'playlist/smart-block.phtml';
|
||||
$result['html'] = $this->view->render($viewPath);
|
||||
$result['result'] = 1;
|
||||
die(json_encode($result));
|
||||
$this->_helper->json->sendJson($result);
|
||||
}
|
||||
} catch (BlockNotFoundException $e) {
|
||||
$this->playlistNotFound('block', true);
|
||||
|
@ -531,9 +560,9 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$result = $bl->shuffleSmartBlock();
|
||||
|
||||
if ($result['result'] == 0) {
|
||||
die(json_encode(array("result"=>0, "html"=>$this->createFullResponse($bl, true))));
|
||||
$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($bl, true)));
|
||||
} else {
|
||||
die(json_encode($result));
|
||||
$this->_helper->json->sendJson($result);
|
||||
}
|
||||
} catch (BlockNotFoundException $e) {
|
||||
$this->playlistNotFound('block', true);
|
||||
|
@ -551,9 +580,9 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$result = $pl->shuffle();
|
||||
|
||||
if ($result['result'] == 0) {
|
||||
die(json_encode(array("result"=>0, "html"=>$this->createFullResponse($pl, true))));
|
||||
$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($pl, true)));
|
||||
} else {
|
||||
die(json_encode($result));
|
||||
$this->_helper->json->sendJson($result);
|
||||
}
|
||||
} catch (PlaylistNotFoundException $e) {
|
||||
$this->playlistNotFound('block', true);
|
||||
|
@ -574,7 +603,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$out = $bl->getCriteria();
|
||||
$out['isStatic'] = false;
|
||||
}
|
||||
die(json_encode($out));
|
||||
$this->_helper->json->sendJson($out);
|
||||
}
|
||||
}
|
||||
class WrongTypeToBlockException extends Exception {}
|
||||
|
|
|
@ -32,7 +32,7 @@ class PluploadController extends Zend_Controller_Action
|
|||
$tempFilePath = Application_Model_StoredFile::uploadFile($upload_dir);
|
||||
$tempFileName = basename($tempFilePath);
|
||||
|
||||
die('{"jsonrpc" : "2.0", "tempfilepath" : "'.$tempFileName.'" }');
|
||||
$this->_helper->json->sendJson(array("jsonrpc" => "2.0", "tempfilepath" => $tempFileName));
|
||||
}
|
||||
|
||||
public function copyfileAction()
|
||||
|
@ -43,8 +43,8 @@ class PluploadController extends Zend_Controller_Action
|
|||
$result = Application_Model_StoredFile::copyFileToStor($upload_dir,
|
||||
$filename, $tempname);
|
||||
if (!is_null($result))
|
||||
die('{"jsonrpc" : "2.0", "error" : '.json_encode($result).'}');
|
||||
$this->_helper->json->sendJson(array("jsonrpc" => "2.0", "error" => $result));
|
||||
|
||||
die('{"jsonrpc" : "2.0"}');
|
||||
$this->_helper->json->sendJson(array("jsonrpc" => "2.0"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,10 +70,10 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
$this->view->statusMsg = "<div class='success'>". _("Preferences updated.")."</div>";
|
||||
$this->view->form = $form;
|
||||
die(json_encode(array("valid"=>"true", "html"=>$this->view->render('preference/index.phtml'))));
|
||||
$this->_helper->json->sendJson(array("valid"=>"true", "html"=>$this->view->render('preference/index.phtml')));
|
||||
} else {
|
||||
$this->view->form = $form;
|
||||
die(json_encode(array("valid"=>"false", "html"=>$this->view->render('preference/index.phtml'))));
|
||||
$this->_helper->json->sendJson(array("valid"=>"false", "html"=>$this->view->render('preference/index.phtml')));
|
||||
}
|
||||
}
|
||||
$this->view->form = $form;
|
||||
|
@ -139,17 +139,13 @@ class PreferenceController extends Zend_Controller_Action
|
|||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
if(Application_Model_Preference::GetPlanLevel() == 'disabled'){
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/serverbrowse/serverbrowser.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/musicdirs.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/serverbrowse/serverbrowser.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/musicdirs.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
||||
$watched_dirs_pref = new Application_Form_WatchedDirPreferences();
|
||||
|
||||
$this->view->form = $watched_dirs_pref;
|
||||
}
|
||||
$watched_dirs_pref = new Application_Form_WatchedDirPreferences();
|
||||
$this->view->form = $watched_dirs_pref;
|
||||
}
|
||||
|
||||
public function streamSettingAction()
|
||||
|
@ -251,12 +247,9 @@ class PreferenceController extends Zend_Controller_Action
|
|||
/* If the admin password values are empty then we should not
|
||||
* set the pseudo password ('xxxxxx') on the front-end
|
||||
*/
|
||||
$s1_set_admin_pass = true;
|
||||
$s2_set_admin_pass = true;
|
||||
$s3_set_admin_pass = true;
|
||||
if (empty($values["s1_data"]["admin_pass"])) $s1_set_admin_pass = false;
|
||||
if (empty($values["s2_data"]["admin_pass"])) $s2_set_admin_pass = false;
|
||||
if (empty($values["s3_data"]["admin_pass"])) $s3_set_admin_pass = false;
|
||||
$s1_set_admin_pass = !empty($values["s1_data"]["admin_pass"]);
|
||||
$s2_set_admin_pass = !empty($values["s2_data"]["admin_pass"]);
|
||||
$s3_set_admin_pass = !empty($values["s3_data"]["admin_pass"]);
|
||||
|
||||
// this goes into cc_pref table
|
||||
Application_Model_Preference::SetStreamLabelFormat($values['streamFormat']);
|
||||
|
@ -274,6 +267,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
Application_Model_Preference::setReplayGainModifier($values["replayGainModifier"]);
|
||||
$md = array('schedule' => Application_Model_Schedule::getSchedule());
|
||||
Application_Model_RabbitMq::SendMessageToPypo("update_schedule", $md);
|
||||
//Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
if (!Application_Model_Preference::GetMasterDjConnectionUrlOverride()) {
|
||||
|
@ -322,19 +316,19 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$this->view->form = $form;
|
||||
$this->view->num_stream = $num_of_stream;
|
||||
$this->view->statusMsg = "<div class='success'>"._("Stream Setting Updated.")."</div>";
|
||||
die(json_encode(array(
|
||||
$this->_helper->json->sendJson(array(
|
||||
"valid"=>"true",
|
||||
"html"=>$this->view->render('preference/stream-setting.phtml'),
|
||||
"s1_set_admin_pass"=>$s1_set_admin_pass,
|
||||
"s2_set_admin_pass"=>$s2_set_admin_pass,
|
||||
"s3_set_admin_pass"=>$s3_set_admin_pass,
|
||||
)));
|
||||
));
|
||||
} else {
|
||||
$live_stream_subform->updateVariables();
|
||||
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
|
||||
$this->view->form = $form;
|
||||
$this->view->num_stream = $num_of_stream;
|
||||
die(json_encode(array("valid"=>"false", "html"=>$this->view->render('preference/stream-setting.phtml'))));
|
||||
$this->_helper->json->sendJson(array("valid"=>"false", "html"=>$this->view->render('preference/stream-setting.phtml')));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -378,7 +372,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
}
|
||||
ksort($result);
|
||||
//returns format serverBrowse is looking for.
|
||||
die(json_encode($result));
|
||||
$this->_helper->json->sendJson($result);
|
||||
}
|
||||
|
||||
public function changeStorDirectoryAction()
|
||||
|
@ -420,7 +414,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
Application_Model_RabbitMq::SendMessageToMediaMonitor('rescan_watch', $data);
|
||||
Logging::info("Unhiding all files belonging to:: $dir_path");
|
||||
$dir->unhideFiles();
|
||||
die(); # Get rid of this ugliness later
|
||||
$this->_helper->json->sendJson(null);
|
||||
}
|
||||
|
||||
public function removeWatchDirectoryAction()
|
||||
|
@ -440,7 +434,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
if (Application_Model_Preference::GetImportTimestamp()+10 > $now) {
|
||||
$res = true;
|
||||
}
|
||||
die(json_encode($res));
|
||||
$this->_helper->json->sendJson($res);
|
||||
}
|
||||
|
||||
public function getLiquidsoapStatusAction()
|
||||
|
@ -455,7 +449,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
}
|
||||
$out[] = array("id"=>$i, "status"=>$status);
|
||||
}
|
||||
die(json_encode($out));
|
||||
$this->_helper->json->sendJson($out);
|
||||
}
|
||||
|
||||
public function setSourceConnectionUrlAction()
|
||||
|
@ -473,7 +467,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
Application_Model_Preference::SetLiveDjConnectionUrlOverride($override);
|
||||
}
|
||||
|
||||
die();
|
||||
$this->_helper->json->sendJson(null);
|
||||
}
|
||||
|
||||
public function getAdminPasswordStatusAction()
|
||||
|
@ -486,6 +480,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$out["s".$i] = true;
|
||||
}
|
||||
}
|
||||
die(json_encode($out));
|
||||
$this->_helper->json->sendJson($out);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('event-feed', 'json')
|
||||
->addActionContext('event-feed-preload', 'json')
|
||||
->addActionContext('make-context-menu', 'json')
|
||||
->addActionContext('add-show-dialog', 'json')
|
||||
->addActionContext('add-show', 'json')
|
||||
|
@ -33,6 +34,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
->addActionContext('dj-edit-show', 'json')
|
||||
->addActionContext('calculate-duration', 'json')
|
||||
->addActionContext('get-current-show', 'json')
|
||||
->addActionContext('update-future-is-scheduled', 'json')
|
||||
->initContext();
|
||||
|
||||
$this->sched_sess = new Zend_Session_Namespace("schedule");
|
||||
|
@ -88,15 +90,23 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']);
|
||||
//End Show builder JS/CSS requirements
|
||||
|
||||
|
||||
Application_Model_Schedule::createNewFormSections($this->view);
|
||||
|
||||
$user = Application_Model_User::getCurrentUser();
|
||||
|
||||
if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
|
||||
$this->view->preloadShowForm = true;
|
||||
}
|
||||
|
||||
$this->view->headScript()->appendScript("var weekStart = ".Application_Model_Preference::GetWeekStartDay().";");
|
||||
$this->view->headScript()->appendScript(
|
||||
"var calendarPref = {};\n".
|
||||
"calendarPref.weekStart = ".Application_Model_Preference::GetWeekStartDay().";\n".
|
||||
"calendarPref.timestamp = ".time().";\n".
|
||||
"calendarPref.timezoneOffset = ".date("Z").";\n".
|
||||
"calendarPref.timeScale = '".Application_Model_Preference::GetCalendarTimeScale()."';\n".
|
||||
"calendarPref.timeInterval = ".Application_Model_Preference::GetCalendarTimeInterval().";\n".
|
||||
"calendarPref.weekStartDay = ".Application_Model_Preference::GetWeekStartDay().";\n".
|
||||
"var calendarEvents = null;"
|
||||
);
|
||||
}
|
||||
|
||||
public function eventFeedAction()
|
||||
|
@ -108,10 +118,28 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$user = new Application_Model_User($userInfo->id);
|
||||
if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
|
||||
$editable = true;
|
||||
$editable = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
||||
|
||||
$events = &Application_Model_Show::getFullCalendarEvents($start, $end, $editable);
|
||||
$this->view->events = $events;
|
||||
}
|
||||
|
||||
public function eventFeedPreloadAction()
|
||||
{
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$user = new Application_Model_User($userInfo->id);
|
||||
$editable = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
||||
|
||||
$calendar_interval = Application_Model_Preference::GetCalendarTimeScale();
|
||||
Logging::info($calendar_interval);
|
||||
if ($calendar_interval == "agendaDay") {
|
||||
list($start, $end) = Application_Model_Show::getStartEndCurrentDayView();
|
||||
} else if ($calendar_interval == "agendaWeek") {
|
||||
list($start, $end) = Application_Model_Show::getStartEndCurrentWeekView();
|
||||
} else if ($calendar_interval == "month") {
|
||||
list($start, $end) = Application_Model_Show::getStartEndCurrentMonthView();
|
||||
} else {
|
||||
$editable = false;
|
||||
Logging::error("Invalid Calendar Interval '$calendar_interval'");
|
||||
}
|
||||
|
||||
$events = &Application_Model_Show::getFullCalendarEvents($start, $end, $editable);
|
||||
|
@ -218,7 +246,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$id = $file->getId();
|
||||
Application_Model_Soundcloud::uploadSoundcloud($id);
|
||||
// we should die with ui info
|
||||
die();
|
||||
$this->_helper->json->sendJson(null);
|
||||
}
|
||||
|
||||
public function makeContextMenuAction()
|
||||
|
@ -452,7 +480,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$this->view->percentFilled = $show->getPercentScheduled();
|
||||
$this->view->showContent = $show->getShowListContent();
|
||||
$this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml');
|
||||
$this->view->showTitle = $show->getName();
|
||||
$this->view->showTitle = htmlspecialchars($show->getName());
|
||||
unset($this->view->showContent);
|
||||
}
|
||||
|
||||
|
@ -546,7 +574,10 @@ class ScheduleController extends Zend_Controller_Action
|
|||
return;
|
||||
}
|
||||
|
||||
if ($isDJ) {
|
||||
// in case a user was once a dj and had been assigned to a show
|
||||
// but was then changed to an admin user we need to allow
|
||||
// the user to edit the show as an admin (CC-4925)
|
||||
if ($isDJ && !$isAdminOrPM) {
|
||||
$this->view->action = "dj-edit-show";
|
||||
}
|
||||
|
||||
|
@ -599,7 +630,11 @@ class ScheduleController extends Zend_Controller_Action
|
|||
if (!$showInstance->getShow()->isRepeating()) {
|
||||
$formWhen->disableStartDateAndTime();
|
||||
} else {
|
||||
$formWhen->getElement('add_show_start_date')->setOptions(array('disabled' => true));
|
||||
$nextFutureRepeatShow = $show->getNextFutureRepeatShowTime();
|
||||
$formWhen->getElement('add_show_start_date')->setValue($nextFutureRepeatShow["starts"]->format("Y-m-d"));
|
||||
$formWhen->getElement('add_show_start_time')->setValue($nextFutureRepeatShow["starts"]->format("H:i"));
|
||||
$formWhen->getElement('add_show_end_date_no_repeat')->setValue($nextFutureRepeatShow["ends"]->format("Y-m-d"));
|
||||
$formWhen->getElement('add_show_end_time')->setValue($nextFutureRepeatShow["ends"]->format("H:i"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -774,10 +809,16 @@ class ScheduleController extends Zend_Controller_Action
|
|||
}
|
||||
$data['add_show_record'] = $show->isRecorded();
|
||||
|
||||
$origianlShowStartDateTime = Application_Common_DateHelper::ConvertToLocalDateTime($show->getStartDateAndTime());
|
||||
if ($show->isRepeating()) {
|
||||
$nextFutureRepeatShow = $show->getNextFutureRepeatShowTime();
|
||||
$originalShowStartDateTime = $nextFutureRepeatShow["starts"];
|
||||
} else {
|
||||
$originalShowStartDateTime = Application_Common_DateHelper::ConvertToLocalDateTime(
|
||||
$show->getStartDateAndTime());
|
||||
}
|
||||
|
||||
$success = Application_Model_Schedule::addUpdateShow($data, $this,
|
||||
$validateStartDate, $origianlShowStartDateTime, true,
|
||||
$validateStartDate, $originalShowStartDateTime, true,
|
||||
$data['add_show_instance_id']);
|
||||
|
||||
if ($success) {
|
||||
|
@ -867,6 +908,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
try {
|
||||
$scheduler = new Application_Model_Scheduler();
|
||||
$scheduler->cancelShow($id);
|
||||
Application_Model_StoredFile::updatePastFilesIsScheduled();
|
||||
// send kick out source stream signal to pypo
|
||||
$data = array("sourcename"=>"live_dj");
|
||||
Application_Model_RabbitMq::SendMessageToPypo("disconnect_source", $data);
|
||||
|
@ -897,7 +939,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
'title' => _('Download'));
|
||||
|
||||
//returns format jjmenu is looking for.
|
||||
die(json_encode($menu));
|
||||
$this->_helper->json->sendJson($menu);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -950,4 +992,11 @@ class ScheduleController extends Zend_Controller_Action
|
|||
echo Zend_Json::encode($result);
|
||||
exit();
|
||||
}
|
||||
|
||||
public function updateFutureIsScheduledAction()
|
||||
{
|
||||
$schedId = $this->_getParam('schedId');
|
||||
$redrawLibTable = Application_Model_StoredFile::setIsScheduled($schedId, false);
|
||||
$this->_helper->json->sendJson(array("redrawLibTable" => $redrawLibTable));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ class SystemstatusController extends Zend_Controller_Action
|
|||
"pypo"=>Application_Model_Systemstatus::GetPypoStatus(),
|
||||
"liquidsoap"=>Application_Model_Systemstatus::GetLiquidsoapStatus(),
|
||||
"media-monitor"=>Application_Model_Systemstatus::GetMediaMonitorStatus(),
|
||||
"rabbitmq-server"=>Application_Model_Systemstatus::GetRabbitMqStatus()
|
||||
);
|
||||
|
||||
$partitions = Application_Model_Systemstatus::GetDiskInfo();
|
||||
|
|
|
@ -48,13 +48,7 @@ class UserController extends Zend_Controller_Action
|
|||
|
||||
if ($form->isValid($formData)) {
|
||||
|
||||
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1
|
||||
&& $formData['login'] == 'admin'
|
||||
&& $formData['user_id'] != 0) {
|
||||
$this->view->form = $form;
|
||||
$this->view->successMessage = "<div class='errors'>"._("Specific action is not allowed in demo version!")."</div>";
|
||||
die(json_encode(array("valid"=>"false", "html"=>$this->view->render('user/add-user.phtml'))));
|
||||
} elseif ($form->validateLogin($formData)) {
|
||||
if ($form->validateLogin($formData)) {
|
||||
$user = new Application_Model_User($formData['user_id']);
|
||||
if (empty($formData['user_id'])) {
|
||||
$user->setLogin($formData['login']);
|
||||
|
@ -89,14 +83,14 @@ class UserController extends Zend_Controller_Action
|
|||
$this->view->successMessage = "<div class='success'>"._("User updated successfully!")."</div>";
|
||||
}
|
||||
|
||||
die(json_encode(array("valid"=>"true", "html"=>$this->view->render('user/add-user.phtml'))));
|
||||
$this->_helper->json->sendJson(array("valid"=>"true", "html"=>$this->view->render('user/add-user.phtml')));
|
||||
} else {
|
||||
$this->view->form = $form;
|
||||
die(json_encode(array("valid"=>"false", "html"=>$this->view->render('user/add-user.phtml'))));
|
||||
$this->_helper->json->sendJson(array("valid"=>"false", "html"=>$this->view->render('user/add-user.phtml')));
|
||||
}
|
||||
} else {
|
||||
$this->view->form = $form;
|
||||
die(json_encode(array("valid"=>"false", "html"=>$this->view->render('user/add-user.phtml'))));
|
||||
$this->_helper->json->sendJson(array("valid"=>"false", "html"=>$this->view->render('user/add-user.phtml')));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -115,7 +109,7 @@ class UserController extends Zend_Controller_Action
|
|||
$post = $this->getRequest()->getPost();
|
||||
$users = Application_Model_User::getUsersDataTablesInfo($post);
|
||||
|
||||
die(json_encode($users));
|
||||
$this->_helper->json->sendJson($users);
|
||||
}
|
||||
|
||||
public function getUserDataAction()
|
||||
|
@ -131,12 +125,7 @@ class UserController extends Zend_Controller_Action
|
|||
if ($request->isPost()) {
|
||||
$formData = $request->getPost();
|
||||
|
||||
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1
|
||||
&& $formData['cu_login'] == 'admin') {
|
||||
$this->view->form = $form;
|
||||
$this->view->successMessage = "<div class='errors'>"._("Specific action is not allowed in demo version!")."</div>";
|
||||
die(json_encode(array("html"=>$this->view->render('user/edit-user.phtml'))));
|
||||
} else if ($form->isValid($formData) &&
|
||||
if ($form->isValid($formData) &&
|
||||
$form->validateLogin($formData['cu_login'], $formData['cu_user_id'])) {
|
||||
$user = new Application_Model_User($formData['cu_user_id']);
|
||||
$user->setFirstName($formData['cu_first_name']);
|
||||
|
|
|
@ -15,6 +15,7 @@ class UsersettingsController extends Zend_Controller_Action
|
|||
->addActionContext('remindme', 'json')
|
||||
->addActionContext('remindme-never', 'json')
|
||||
->addActionContext('donotshowregistrationpopup', 'json')
|
||||
->addActionContext('set-library-screen-settings', 'json')
|
||||
->initContext();
|
||||
}
|
||||
|
||||
|
@ -54,6 +55,7 @@ class UsersettingsController extends Zend_Controller_Action
|
|||
{
|
||||
$request = $this->getRequest();
|
||||
$settings = $request->getParam("settings");
|
||||
|
||||
Application_Model_Preference::setTimelineDatatableSetting($settings);
|
||||
}
|
||||
|
||||
|
@ -91,4 +93,11 @@ class UsersettingsController extends Zend_Controller_Action
|
|||
// unset session
|
||||
Zend_Session::namespaceUnset('referrer');
|
||||
}
|
||||
|
||||
public function setLibraryScreenSettingsAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$settings = $request->getParam("settings");
|
||||
Application_Model_Preference::setLibraryScreenSettings($settings);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
{
|
||||
$controller = strtolower($request->getControllerName());
|
||||
|
||||
if (in_array($controller, array("api", "auth"))) {
|
||||
if (in_array($controller, array("api", "auth", "locale"))) {
|
||||
|
||||
$this->setRoleName("G");
|
||||
} elseif (!Zend_Auth::getInstance()->hasIdentity()) {
|
||||
|
|
|
@ -7,6 +7,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
|||
{
|
||||
|
||||
$notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator();
|
||||
$rangeValidator = Application_Form_Helper_ValidationTypes::overrideBetweenValidator(0, 59.9);
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/preferences_general.phtml'))
|
||||
));
|
||||
|
@ -34,9 +35,13 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
|||
'label' => _('Default Fade (s):'),
|
||||
'required' => true,
|
||||
'filters' => array('StringTrim'),
|
||||
'validators' => array(array($notEmptyValidator, 'regex', false,
|
||||
array('/^[0-9]{1,2}(\.\d{1})?$/',
|
||||
'messages' => _('enter a time in seconds 0{.0}')))),
|
||||
'validators' => array(
|
||||
array(
|
||||
$rangeValidator,
|
||||
$notEmptyValidator,
|
||||
'regex', false, array('/^[0-9]{1,2}(\.\d{1})?$/', 'messages' => _('enter a time in seconds 0{.0}'))
|
||||
)
|
||||
),
|
||||
'value' => $defaultFade,
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
|
|
|
@ -7,7 +7,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
|||
|
||||
public function init()
|
||||
{
|
||||
$this->setAction(Application_Common_OsPath::getBaseDir().'/Showbuilder');
|
||||
$this->setAction(Application_Common_OsPath::getBaseDir().'Showbuilder');
|
||||
$this->setMethod('post');
|
||||
|
||||
$country_list = Application_Model_Preference::GetCountryList();
|
||||
|
|
|
@ -5,6 +5,11 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
private $stringCriteriaOptions;
|
||||
private $numericCriteriaOptions;
|
||||
private $limitOptions;
|
||||
|
||||
/* We need to know if the criteria value will be a string
|
||||
* or numeric value in order to populate the modifier
|
||||
* select list
|
||||
*/
|
||||
private $criteriaTypes = array(
|
||||
0 => "",
|
||||
"album_title" => "s",
|
||||
|
@ -13,6 +18,8 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
"composer" => "s",
|
||||
"conductor" => "s",
|
||||
"copyright" => "s",
|
||||
"cuein" => "n",
|
||||
"cueout" => "n",
|
||||
"artist_name" => "s",
|
||||
"encoded_by" => "s",
|
||||
"utime" => "n",
|
||||
|
@ -45,6 +52,8 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
"composer" => _("Composer"),
|
||||
"conductor" => _("Conductor"),
|
||||
"copyright" => _("Copyright"),
|
||||
"cuein" => _("Cue In"),
|
||||
"cueout" => _("Cue Out"),
|
||||
"artist_name" => _("Creator"),
|
||||
"encoded_by" => _("Encoded By"),
|
||||
"genre" => _("Genre"),
|
||||
|
@ -416,32 +425,34 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
$isValid = true;
|
||||
$data = $this->preValidation($params);
|
||||
$criteria2PeerMap = array(
|
||||
0 => "Select criteria",
|
||||
"album_title" => "DbAlbumTitle",
|
||||
"artist_name" => "DbArtistName",
|
||||
"bit_rate" => "DbBitRate",
|
||||
"bpm" => "DbBpm",
|
||||
"composer" => "DbComposer",
|
||||
"conductor" => "DbConductor",
|
||||
"copyright" => "DbCopyright",
|
||||
"encoded_by" => "DbEncodedBy",
|
||||
"utime" => "DbUtime",
|
||||
"mtime" => "DbMtime",
|
||||
"lptime" => "DbLPtime",
|
||||
"genre" => "DbGenre",
|
||||
"info_url" => "DbInfoUrl",
|
||||
"isrc_number" => "DbIsrcNumber",
|
||||
"label" => "DbLabel",
|
||||
"language" => "DbLanguage",
|
||||
"length" => "DbLength",
|
||||
"mime" => "DbMime",
|
||||
"mood" => "DbMood",
|
||||
"owner_id" => "DbOwnerId",
|
||||
"replay_gain" => "DbReplayGain",
|
||||
"sample_rate" => "DbSampleRate",
|
||||
"track_title" => "DbTrackTitle",
|
||||
"track_number" => "DbTrackNumber",
|
||||
"year" => "DbYear"
|
||||
0 => "Select criteria",
|
||||
"album_title" => "DbAlbumTitle",
|
||||
"artist_name" => "DbArtistName",
|
||||
"bit_rate" => "DbBitRate",
|
||||
"bpm" => "DbBpm",
|
||||
"composer" => "DbComposer",
|
||||
"conductor" => "DbConductor",
|
||||
"copyright" => "DbCopyright",
|
||||
"cuein" => "DbCuein",
|
||||
"cueout" => "DbCueout",
|
||||
"encoded_by" => "DbEncodedBy",
|
||||
"utime" => "DbUtime",
|
||||
"mtime" => "DbMtime",
|
||||
"lptime" => "DbLPtime",
|
||||
"genre" => "DbGenre",
|
||||
"info_url" => "DbInfoUrl",
|
||||
"isrc_number" => "DbIsrcNumber",
|
||||
"label" => "DbLabel",
|
||||
"language" => "DbLanguage",
|
||||
"length" => "DbLength",
|
||||
"mime" => "DbMime",
|
||||
"mood" => "DbMood",
|
||||
"owner_id" => "DbOwnerId",
|
||||
"replay_gain" => "DbReplayGain",
|
||||
"sample_rate" => "DbSampleRate",
|
||||
"track_title" => "DbTrackTitle",
|
||||
"track_number" => "DbTrackNumber",
|
||||
"year" => "DbYear"
|
||||
);
|
||||
|
||||
// things we need to check
|
||||
|
@ -492,7 +503,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
} else {
|
||||
$column = CcFilesPeer::getTableMap()->getColumnByPhpName($criteria2PeerMap[$d['sp_criteria_field']]);
|
||||
// validation on type of column
|
||||
if ($d['sp_criteria_field'] == 'length') {
|
||||
if (in_array($d['sp_criteria_field'], array('length', 'cuein', 'cueout'))) {
|
||||
if (!preg_match("/^(\d{2}):(\d{2}):(\d{2})/", $d['sp_criteria_value'])) {
|
||||
$element->addError(_("'Length' should be in '00:00:00' format"));
|
||||
$isValid = false;
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<div class="personal-block solo">
|
||||
<ul>
|
||||
<li>
|
||||
<a id="current-user" href=<?php echo $baseUrl . "User/edit-user"?>><span class="name"><?php echo $this->loggedInAs()?></span></a> | <a href=<?php echo $baseUrl . "Login/logout"?>><?php echo _("Logout")?></a>
|
||||
<a id="current-user" href=<?php echo $baseUrl . "User/edit-user"?>><span class="name"><?php echo $this->escape($this->loggedInAs()); ?></span></a> | <a href=<?php echo $baseUrl . "Login/logout"?>><?php echo _("Logout")?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -32,6 +32,8 @@ class Logging {
|
|||
{
|
||||
if (is_array($p_msg) || is_object($p_msg)) {
|
||||
return print_r($p_msg, true);
|
||||
} else if (is_bool($p_msg)) {
|
||||
return $p_msg ? "true" : "false";
|
||||
} else {
|
||||
return $p_msg;
|
||||
}
|
||||
|
|
|
@ -63,6 +63,8 @@ class Application_Model_Block implements Application_Model_LibraryEditable
|
|||
"composer" => "DbComposer",
|
||||
"conductor" => "DbConductor",
|
||||
"copyright" => "DbCopyright",
|
||||
"cuein" => "DbCuein",
|
||||
"cueout" => "DbCueout",
|
||||
"encoded_by" => "DbEncodedBy",
|
||||
"utime" => "DbUtime",
|
||||
"mtime" => "DbMtime",
|
||||
|
@ -257,6 +259,10 @@ SQL;
|
|||
//format original length
|
||||
$formatter = new LengthFormatter($row['orig_length']);
|
||||
$row['orig_length'] = $formatter->format();
|
||||
|
||||
// XSS exploit prevention
|
||||
$row["track_title"] = htmlspecialchars($row["track_title"]);
|
||||
$row["creator"] = htmlspecialchars($row["creator"]);
|
||||
}
|
||||
|
||||
return $rows;
|
||||
|
@ -399,10 +405,13 @@ SQL;
|
|||
$entry = $this->blockItem;
|
||||
$entry["id"] = $file->getDbId();
|
||||
$entry["pos"] = $pos;
|
||||
$entry["cliplength"] = $file->getDbLength();
|
||||
$entry["cueout"] = $file->getDbCueout();
|
||||
$entry["cuein"] = $file->getDbCuein();
|
||||
|
||||
$cue_out = Application_Common_DateHelper::calculateLengthInSeconds($entry['cueout']);
|
||||
$cue_in = Application_Common_DateHelper::calculateLengthInSeconds($entry['cuein']);
|
||||
$entry["cliplength"] = Application_Common_DateHelper::secondsToPlaylistTime($cue_out-$cue_in);
|
||||
|
||||
return $entry;
|
||||
} else {
|
||||
throw new Exception("trying to add a file that does not exist.");
|
||||
|
@ -476,10 +485,19 @@ SQL;
|
|||
try {
|
||||
if (is_array($ac) && $ac[1] == 'audioclip') {
|
||||
$res = $this->insertBlockElement($this->buildEntry($ac[0], $pos));
|
||||
|
||||
// update is_playlist flag in cc_files to indicate the
|
||||
// file belongs to a playlist or block (in this case a block)
|
||||
$db_file = CcFilesQuery::create()->findPk($ac[0], $this->con);
|
||||
$db_file->setDbIsPlaylist(true)->save($this->con);
|
||||
|
||||
$pos = $pos + 1;
|
||||
} elseif (!is_array($ac)) {
|
||||
$res = $this->insertBlockElement($this->buildEntry($ac, $pos));
|
||||
$pos = $pos + 1;
|
||||
|
||||
$db_file = CcFilesQuery::create()->findPk($ac, $this->con);
|
||||
$db_file->setDbIsPlaylist(true)->save($this->con);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
Logging::info($e->getMessage());
|
||||
|
@ -592,10 +610,21 @@ SQL;
|
|||
|
||||
try {
|
||||
|
||||
// we need to get the file id of the item we are deleting
|
||||
// before the item gets deleted from the block
|
||||
$itemsToDelete = CcBlockcontentsQuery::create()
|
||||
->filterByPrimaryKeys($p_items)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find($this->con);
|
||||
|
||||
CcBlockcontentsQuery::create()
|
||||
->findPKs($p_items)
|
||||
->delete($this->con);
|
||||
|
||||
// now that the items have been deleted we can update the
|
||||
// is_playlist flag in cc_files
|
||||
Application_Model_StoredFile::setIsPlaylist($itemsToDelete, 'block', false);
|
||||
|
||||
$contents = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($this->id)
|
||||
->orderByDbPosition()
|
||||
|
@ -965,16 +994,36 @@ SQL;
|
|||
$user = new Application_Model_User($userInfo->id);
|
||||
$isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
||||
|
||||
// get only the files from the blocks
|
||||
// we are about to delete
|
||||
$itemsToDelete = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($p_ids)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find();
|
||||
|
||||
$updateIsPlaylistFlag = false;
|
||||
|
||||
if (!$isAdminOrPM) {
|
||||
$leftOver = self::blocksNotOwnedByUser($p_ids, $p_userId);
|
||||
|
||||
if (count($leftOver) == 0) {
|
||||
CcBlockQuery::create()->findPKs($p_ids)->delete();
|
||||
$updateIsPlaylistFlag = true;
|
||||
} else {
|
||||
throw new BlockNoPermissionException;
|
||||
}
|
||||
} else {
|
||||
CcBlockQuery::create()->findPKs($p_ids)->delete();
|
||||
$updateIsPlaylistFlag = true;
|
||||
}
|
||||
|
||||
if ($updateIsPlaylistFlag) {
|
||||
// update is_playlist flag in cc_files
|
||||
Application_Model_StoredFile::setIsPlaylist(
|
||||
$itemsToDelete,
|
||||
'block',
|
||||
false
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1000,8 +1049,26 @@ SQL;
|
|||
*/
|
||||
public function deleteAllFilesFromBlock()
|
||||
{
|
||||
// get only the files from the playlist
|
||||
// we are about to clear out
|
||||
$itemsToDelete = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($this->id)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find();
|
||||
|
||||
CcBlockcontentsQuery::create()->findByDbBlockId($this->id)->delete();
|
||||
$this->block->reload();
|
||||
|
||||
// update is_playlist flag in cc_files
|
||||
Application_Model_StoredFile::setIsPlaylist(
|
||||
$itemsToDelete,
|
||||
'block',
|
||||
false
|
||||
);
|
||||
|
||||
//$this->block->reload();
|
||||
$this->block->setDbMtime(new DateTime("now", new DateTimeZone("UTC")));
|
||||
$this->block->save($this->con);
|
||||
$this->con->commit();
|
||||
}
|
||||
|
||||
// smart block functions start
|
||||
|
@ -1213,6 +1280,8 @@ SQL;
|
|||
"composer" => _("Composer"),
|
||||
"conductor" => _("Conductor"),
|
||||
"copyright" => _("Copyright"),
|
||||
"cuein" => _("Cue In"),
|
||||
"cueout" => _("Cue Out"),
|
||||
"artist_name" => _("Creator"),
|
||||
"encoded_by" => _("Encoded By"),
|
||||
"genre" => _("Genre"),
|
||||
|
@ -1241,7 +1310,7 @@ SQL;
|
|||
foreach ($out as $crit) {
|
||||
$criteria = $crit->getDbCriteria();
|
||||
$modifier = $crit->getDbModifier();
|
||||
$value = $crit->getDbValue();
|
||||
$value = htmlspecialchars($crit->getDbValue());
|
||||
$extra = $crit->getDbExtra();
|
||||
|
||||
if ($criteria == "limit") {
|
||||
|
@ -1305,7 +1374,7 @@ SQL;
|
|||
* user only sees the rounded version (i.e. 4:02.7 is 4:02.761625
|
||||
* in the database)
|
||||
*/
|
||||
} elseif ($spCriteria == 'length' && $spCriteriaModifier == "is") {
|
||||
} elseif (in_array($spCriteria, array('length', 'cuein', 'cueout')) && $spCriteriaModifier == "is") {
|
||||
$spCriteriaModifier = "starts with";
|
||||
$spCriteria = $spCriteria.'::text';
|
||||
$spCriteriaValue = $criteria['value'];
|
||||
|
@ -1434,6 +1503,20 @@ SQL;
|
|||
|
||||
return $output;
|
||||
}
|
||||
public static function getAllBlockFiles()
|
||||
{
|
||||
$con = Propel::getConnection();
|
||||
$sql = <<<SQL
|
||||
SELECT distinct(file_id)
|
||||
FROM cc_blockcontents
|
||||
SQL;
|
||||
$files = $con->query($sql)->fetchAll();
|
||||
$real_files = array();
|
||||
foreach ($files as $f) {
|
||||
$real_files[] = $f['file_id'];
|
||||
}
|
||||
return $real_files;
|
||||
}
|
||||
// smart block functions end
|
||||
}
|
||||
|
||||
|
|
|
@ -269,6 +269,10 @@ SQL;
|
|||
//format original length
|
||||
$formatter = new LengthFormatter($row['orig_length']);
|
||||
$row['orig_length'] = $formatter->format();
|
||||
|
||||
// XSS exploit prevention
|
||||
$row["track_title"] = htmlspecialchars($row["track_title"]);
|
||||
$row["creator"] = htmlspecialchars($row["creator"]);
|
||||
}
|
||||
|
||||
return $rows;
|
||||
|
@ -398,6 +402,13 @@ SQL;
|
|||
if ($obj instanceof CcFiles && $obj) {
|
||||
$entry["cuein"] = $obj->getDbCuein();
|
||||
$entry["cueout"] = $obj->getDbCueout();
|
||||
|
||||
$cue_out = Application_Common_DateHelper::calculateLengthInSeconds($entry['cueout']);
|
||||
$cue_in = Application_Common_DateHelper::calculateLengthInSeconds($entry['cuein']);
|
||||
$entry["cliplength"] = Application_Common_DateHelper::secondsToPlaylistTime($cue_out-$cue_in);
|
||||
} elseif ($obj instanceof CcWebstream && $obj) {
|
||||
$entry["cuein"] = "00:00:00";
|
||||
$entry["cueout"] = $entry["cliplength"];
|
||||
}
|
||||
$entry["ftype"] = $objType;
|
||||
}
|
||||
|
@ -466,6 +477,12 @@ SQL;
|
|||
|
||||
foreach ($p_items as $ac) {
|
||||
$res = $this->insertPlaylistElement($this->buildEntry($ac, $pos));
|
||||
|
||||
// update is_playlist flag in cc_files to indicate the
|
||||
// file belongs to a playlist or block (in this case a playlist)
|
||||
$db_file = CcFilesQuery::create()->findPk($ac[0], $this->con);
|
||||
$db_file->setDbIsPlaylist(true)->save($this->con);
|
||||
|
||||
$pos = $pos + 1;
|
||||
Logging::info("Adding $ac[1] $ac[0]");
|
||||
|
||||
|
@ -574,10 +591,21 @@ SQL;
|
|||
|
||||
try {
|
||||
|
||||
// we need to get the file id of the item we are deleting
|
||||
// before the item gets deleted from the playlist
|
||||
$itemsToDelete = CcPlaylistcontentsQuery::create()
|
||||
->filterByPrimaryKeys($p_items)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find($this->con);
|
||||
|
||||
CcPlaylistcontentsQuery::create()
|
||||
->findPKs($p_items)
|
||||
->delete($this->con);
|
||||
|
||||
// now that the items have been deleted we can update the
|
||||
// is_playlist flag in cc_files
|
||||
Application_Model_StoredFile::setIsPlaylist($itemsToDelete, 'playlist', false);
|
||||
|
||||
$contents = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->orderByDbPosition()
|
||||
|
@ -892,15 +920,36 @@ SQL;
|
|||
$user = new Application_Model_User($userInfo->id);
|
||||
$isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
||||
|
||||
// get only the files from the playlists
|
||||
// we are about to delete
|
||||
$itemsToDelete = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($p_ids)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find();
|
||||
|
||||
$updateIsPlaylistFlag = false;
|
||||
|
||||
if (!$isAdminOrPM) {
|
||||
$leftOver = self::playlistsNotOwnedByUser($p_ids, $p_userId);
|
||||
if (count($leftOver) == 0) {
|
||||
CcPlaylistQuery::create()->findPKs($p_ids)->delete();
|
||||
$updateIsPlaylistFlag = true;
|
||||
|
||||
} else {
|
||||
throw new PlaylistNoPermissionException;
|
||||
}
|
||||
} else {
|
||||
CcPlaylistQuery::create()->findPKs($p_ids)->delete();
|
||||
$updateIsPlaylistFlag = true;
|
||||
}
|
||||
|
||||
if ($updateIsPlaylistFlag) {
|
||||
// update is_playlist flag in cc_files
|
||||
Application_Model_StoredFile::setIsPlaylist(
|
||||
$itemsToDelete,
|
||||
'playlist',
|
||||
false
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -927,7 +976,25 @@ SQL;
|
|||
*/
|
||||
public function deleteAllFilesFromPlaylist()
|
||||
{
|
||||
// get only the files from the playlist
|
||||
// we are about to clear out
|
||||
$itemsToDelete = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find();
|
||||
|
||||
CcPlaylistcontentsQuery::create()->findByDbPlaylistId($this->id)->delete();
|
||||
|
||||
// update is_playlist flag in cc_files
|
||||
Application_Model_StoredFile::setIsPlaylist(
|
||||
$itemsToDelete,
|
||||
'playlist',
|
||||
false
|
||||
);
|
||||
|
||||
$this->pl->setDbMtime(new DateTime("now", new DateTimeZone("UTC")));
|
||||
$this->pl->save($this->con);
|
||||
$this->con->commit();
|
||||
}
|
||||
|
||||
public function shuffle()
|
||||
|
@ -953,6 +1020,38 @@ SQL;
|
|||
return $result;
|
||||
}
|
||||
|
||||
public static function getAllPlaylistFiles()
|
||||
{
|
||||
$con = Propel::getConnection();
|
||||
$sql = <<<SQL
|
||||
SELECT distinct(file_id)
|
||||
FROM cc_playlistcontents
|
||||
WHERE file_id is not null
|
||||
SQL;
|
||||
$files = $con->query($sql)->fetchAll();
|
||||
$real_files = array();
|
||||
foreach ($files as $f) {
|
||||
$real_files[] = $f['file_id'];
|
||||
}
|
||||
return $real_files;
|
||||
}
|
||||
|
||||
public static function getAllPlaylistStreams()
|
||||
{
|
||||
$con = Propel::getConnection();
|
||||
$sql = <<<SQL
|
||||
SELECT distinct(stream_id)
|
||||
FROM cc_playlistcontents
|
||||
WHERE stream_id is not null
|
||||
SQL;
|
||||
$streams = $con->query($sql)->fetchAll();
|
||||
$real_streams = array();
|
||||
foreach ($streams as $s) {
|
||||
$real_streams[] = $s['stream_id'];
|
||||
}
|
||||
return $real_streams;
|
||||
}
|
||||
|
||||
} // class Playlist
|
||||
|
||||
class PlaylistNotFoundException extends Exception {}
|
||||
|
|
|
@ -1223,9 +1223,9 @@ class Application_Model_Preference
|
|||
$num_columns = count(Application_Model_StoredFile::getLibraryColumns());
|
||||
$new_columns_num = count($settings['abVisCols']);
|
||||
|
||||
if ($num_columns != $new_columns_num) {
|
||||
/*if ($num_columns != $new_columns_num) {
|
||||
throw new Exception("Trying to write a user column preference with incorrect number of columns!");
|
||||
}
|
||||
}*/
|
||||
|
||||
$data = serialize($settings);
|
||||
$v = self::setValue("library_datatable", $data, true);
|
||||
|
@ -1262,7 +1262,19 @@ class Application_Model_Preference
|
|||
$data = self::getValue("nowplaying_screen", true);
|
||||
return ($data != "") ? unserialize($data) : null;
|
||||
}
|
||||
|
||||
|
||||
public static function setLibraryScreenSettings($settings)
|
||||
{
|
||||
$data = serialize($settings);
|
||||
self::setValue("library_screen", $data, true);
|
||||
}
|
||||
|
||||
public static function getLibraryScreenSettings()
|
||||
{
|
||||
$data = self::getValue("library_screen", true);
|
||||
return ($data != "") ? unserialize($data) : null;
|
||||
}
|
||||
|
||||
public static function SetEnableReplayGain($value) {
|
||||
self::setValue("enable_replay_gain", $value, false);
|
||||
}
|
||||
|
|
|
@ -22,6 +22,11 @@ class Application_Model_RabbitMq
|
|||
$CC_CONFIG["rabbitmq"]["user"],
|
||||
$CC_CONFIG["rabbitmq"]["password"],
|
||||
$CC_CONFIG["rabbitmq"]["vhost"]);
|
||||
|
||||
if (!isset($conn)) {
|
||||
throw new Exception("Cannot connect to RabbitMQ server");
|
||||
}
|
||||
|
||||
$channel = $conn->channel();
|
||||
$channel->access_request($CC_CONFIG["rabbitmq"]["vhost"], false, false,
|
||||
true, true);
|
||||
|
|
|
@ -20,6 +20,41 @@ SQL;
|
|||
return (is_numeric($count) && ($count != '0'));
|
||||
}
|
||||
|
||||
public static function getAllFutureScheduledFiles()
|
||||
{
|
||||
$con = Propel::getConnection();
|
||||
$sql = <<<SQL
|
||||
SELECT distinct(file_id)
|
||||
FROM cc_schedule
|
||||
WHERE ends > now() AT TIME ZONE 'UTC'
|
||||
AND file_id is not null
|
||||
SQL;
|
||||
$files = $con->query($sql)->fetchAll();
|
||||
$real_files = array();
|
||||
foreach ($files as $f) {
|
||||
$real_files[] = $f['file_id'];
|
||||
}
|
||||
|
||||
return $real_files;
|
||||
}
|
||||
|
||||
public static function getAllFutureScheduledWebstreams()
|
||||
{
|
||||
$con = Propel::getConnection();
|
||||
$sql = <<<SQL
|
||||
SELECT distinct(stream_id)
|
||||
FROM cc_schedule
|
||||
WHERE ends > now() AT TIME ZONE 'UTC'
|
||||
AND stream_id is not null
|
||||
SQL;
|
||||
$streams = $con->query($sql)->fetchAll();
|
||||
$real_streams = array();
|
||||
foreach ($streams as $s) {
|
||||
$real_streams[] = $s['stream_id'];
|
||||
}
|
||||
|
||||
return $real_streams;
|
||||
}
|
||||
/**
|
||||
* Returns data related to the scheduled items.
|
||||
*
|
||||
|
@ -696,6 +731,10 @@ SQL;
|
|||
'replay_gain' => $replay_gain,
|
||||
'independent_event' => $independent_event,
|
||||
);
|
||||
|
||||
if ($schedule_item['cue_in'] > $schedule_item['cue_out']) {
|
||||
$schedule_item['cue_in'] = $schedule_item['cue_out'];
|
||||
}
|
||||
self::appendScheduleItem($data, $start, $schedule_item);
|
||||
}
|
||||
|
||||
|
@ -906,7 +945,6 @@ SQL;
|
|||
self::createScheduledEvents($data, $range_start, $range_end);
|
||||
|
||||
self::foldData($data["media"]);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
|
|
@ -136,13 +136,17 @@ class Application_Model_Scheduler
|
|||
|
||||
if ($type === "audioclip") {
|
||||
$file = CcFilesQuery::create()->findPK($id, $this->con);
|
||||
$storedFile = new Application_Model_StoredFile($file->getDbId());
|
||||
|
||||
if (is_null($file) || !$file->visible()) {
|
||||
throw new Exception(_("A selected File does not exist!"));
|
||||
} else {
|
||||
$data = $this->fileInfo;
|
||||
$data["id"] = $id;
|
||||
$data["cliplength"] = $file->getDbLength();
|
||||
$data["cliplength"] = $storedFile->getRealClipLength(
|
||||
$file->getDbCuein(),
|
||||
$file->getDbCueout());
|
||||
|
||||
$data["cuein"] = $file->getDbCuein();
|
||||
$data["cueout"] = $file->getDbCueout();
|
||||
|
||||
|
@ -199,9 +203,12 @@ class Application_Model_Scheduler
|
|||
$file = CcFilesQuery::create()->findPk($fileId);
|
||||
if (isset($file) && $file->visible()) {
|
||||
$data["id"] = $file->getDbId();
|
||||
$data["cliplength"] = $file->getDbLength();
|
||||
$data["cuein"] = "00:00:00";
|
||||
$data["cueout"] = $file->getDbLength();
|
||||
$data["cuein"] = $file->getDbCuein();
|
||||
$data["cueout"] = $file->getDbCueout();
|
||||
|
||||
$cuein = Application_Common_DateHelper::calculateLengthInSeconds($data["cuein"]);
|
||||
$cueout = Application_Common_DateHelper::calculateLengthInSeconds($data["cueout"]);
|
||||
$data["cliplength"] = Application_Common_DateHelper::secondsToPlaylistTime($cueout - $cuein);
|
||||
$defaultFade = Application_Model_Preference::GetDefaultFade();
|
||||
if (isset($defaultFade)) {
|
||||
//fade is in format SS.uuuuuu
|
||||
|
@ -257,9 +264,12 @@ class Application_Model_Scheduler
|
|||
$file = CcFilesQuery::create()->findPk($fileId);
|
||||
if (isset($file) && $file->visible()) {
|
||||
$data["id"] = $file->getDbId();
|
||||
$data["cliplength"] = $file->getDbLength();
|
||||
$data["cuein"] = "00:00:00";
|
||||
$data["cueout"] = $file->getDbLength();
|
||||
$data["cuein"] = $file->getDbCuein();
|
||||
$data["cueout"] = $file->getDbCueout();
|
||||
|
||||
$cuein = Application_Common_DateHelper::calculateLengthInSeconds($data["cuein"]);
|
||||
$cueout = Application_Common_DateHelper::calculateLengthInSeconds($data["cueout"]);
|
||||
$data["cliplength"] = Application_Common_DateHelper::secondsToPlaylistTime($cueout - $cuein);
|
||||
$defaultFade = Application_Model_Preference::GetDefaultFade();
|
||||
if (isset($defaultFade)) {
|
||||
//fade is in format SS.uuuuuu
|
||||
|
@ -321,6 +331,8 @@ class Application_Model_Scheduler
|
|||
$filler->setDbStarts($DT)
|
||||
->setDbEnds($this->nowDT)
|
||||
->setDbClipLength($cliplength)
|
||||
->setDbCueIn('00:00:00')
|
||||
->setDbCueOut('00:00:00')
|
||||
->setDbPlayoutStatus(-1)
|
||||
->setDbInstanceId($instance->getDbId())
|
||||
->save($this->con);
|
||||
|
@ -438,7 +450,6 @@ class Application_Model_Scheduler
|
|||
}
|
||||
|
||||
foreach ($schedFiles as $file) {
|
||||
|
||||
$endTimeDT = $this->findEndTime($nextStartDT, $file['cliplength']);
|
||||
|
||||
//item existed previously and is being moved.
|
||||
|
@ -514,6 +525,13 @@ class Application_Model_Scheduler
|
|||
$instance->updateScheduleStatus($this->con);
|
||||
}
|
||||
|
||||
// update is_scheduled flag for each cc_file
|
||||
foreach ($schedFiles as $file) {
|
||||
$db_file = CcFilesQuery::create()->findPk($file['id'], $this->con);
|
||||
$db_file->setDbIsScheduled(true);
|
||||
$db_file->save($this->con);
|
||||
}
|
||||
|
||||
$endProfile = microtime(true);
|
||||
Logging::debug("updating show instances status.");
|
||||
Logging::debug(floatval($endProfile) - floatval($startProfile));
|
||||
|
@ -718,6 +736,16 @@ class Application_Model_Scheduler
|
|||
} else {
|
||||
$removedItem->delete($this->con);
|
||||
}
|
||||
|
||||
// update is_scheduled in cc_files but only if
|
||||
// the file is not scheduled somewhere else
|
||||
$fileId = $removedItem->getDbFileId();
|
||||
// check if the removed item is scheduled somewhere else
|
||||
$futureScheduledFiles = Application_Model_Schedule::getAllFutureScheduledFiles();
|
||||
if (!is_null($fileId) && !in_array($fileId, $futureScheduledFiles)) {
|
||||
$db_file = CcFilesQuery::create()->findPk($fileId, $this->con);
|
||||
$db_file->setDbIsScheduled(false)->save($this->con);
|
||||
}
|
||||
}
|
||||
|
||||
if ($adjustSched === true) {
|
||||
|
|
|
@ -663,6 +663,30 @@ SQL;
|
|||
$con->exec($sql);
|
||||
}
|
||||
|
||||
public function getNextFutureRepeatShowTime()
|
||||
{
|
||||
$sql = <<<SQL
|
||||
SELECT starts, ends FROM cc_show_instances
|
||||
WHERE ends > now() at time zone 'UTC'
|
||||
AND show_id = :showId
|
||||
ORDER BY starts
|
||||
LIMIT 1
|
||||
SQL;
|
||||
$result = Application_Common_Database::prepareAndExecute( $sql,
|
||||
array( 'showId' => $this->getId() ), 'all' );
|
||||
|
||||
foreach ($result as $r) {
|
||||
$show["starts"] = new DateTime($r["starts"], new DateTimeZone('UTC'));
|
||||
$show["ends"] = new DateTime($r["ends"], new DateTimeZone('UTC'));
|
||||
}
|
||||
$currentUser = Application_Model_User::getCurrentUser();
|
||||
$currentUserId = $currentUser->getId();
|
||||
$userTimezone = Application_Model_Preference::GetUserTimezone($currentUserId);
|
||||
$show["starts"]->setTimezone(new DateTimeZone($userTimezone));
|
||||
$show["ends"]->setTimezone(new DateTimeZone($userTimezone));
|
||||
return $show;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the start date of the current show in UTC timezone.
|
||||
*
|
||||
|
@ -1750,12 +1774,15 @@ SQL;
|
|||
$interval = $p_start->diff($p_end);
|
||||
$days = $interval->format('%a');
|
||||
$shows = Application_Model_Show::getShows($p_start, $p_end);
|
||||
$nowEpoch = time();
|
||||
$content_count = Application_Model_ShowInstance::getContentCount(
|
||||
$p_start, $p_end);
|
||||
$isFull = Application_Model_ShowInstance::getIsFull($p_start, $p_end);
|
||||
$timezone = date_default_timezone_get();
|
||||
$current_timezone = new DateTimeZone($timezone);
|
||||
$utc = new DateTimeZone("UTC");
|
||||
$now = new DateTime("now", $utc);
|
||||
|
||||
foreach ($shows as $show) {
|
||||
foreach ($shows as &$show) {
|
||||
$options = array();
|
||||
|
||||
//only bother calculating percent for week or day view.
|
||||
|
@ -1763,11 +1790,8 @@ SQL;
|
|||
$options["percent"] = Application_Model_Show::getPercentScheduled($show["starts"], $show["ends"], $show["time_filled"]);
|
||||
}
|
||||
|
||||
$utc = new DateTimeZone("UTC");
|
||||
|
||||
if (isset($show["parent_starts"])) {
|
||||
$parentStartsDT = new DateTime($show["parent_starts"], $utc);
|
||||
$parentStartsEpoch = intval($parentStartsDT->format("U"));
|
||||
}
|
||||
|
||||
$startsDT = DateTime::createFromFormat("Y-m-d G:i:s",
|
||||
|
@ -1775,39 +1799,53 @@ SQL;
|
|||
$endsDT = DateTime::createFromFormat("Y-m-d G:i:s",
|
||||
$show["ends"], $utc);
|
||||
|
||||
$startsEpochStr = $startsDT->format("U");
|
||||
$endsEpochStr = $endsDT->format("U");
|
||||
|
||||
$startsEpoch = intval($startsEpochStr);
|
||||
$endsEpoch = intval($endsEpochStr);
|
||||
|
||||
$startsDT->setTimezone(new DateTimeZone($timezone));
|
||||
$endsDT->setTimezone(new DateTimeZone($timezone));
|
||||
|
||||
if( $p_editable ) {
|
||||
if ($show["record"] && $nowEpoch > $startsEpoch) {
|
||||
if ($show["record"] && $now > $startsDT) {
|
||||
$options["editable"] = false;
|
||||
} elseif ($show["rebroadcast"] &&
|
||||
$nowEpoch > $parentStartsEpoch) {
|
||||
$now > $parentStartsDT) {
|
||||
$options["editable"] = false;
|
||||
} elseif ($nowEpoch < $endsEpoch) {
|
||||
} elseif ($now < $endsDT) {
|
||||
$options["editable"] = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$showInstance = new Application_Model_ShowInstance(
|
||||
$show["instance_id"]);
|
||||
$startsDT->setTimezone($current_timezone);
|
||||
$endsDT->setTimezone($current_timezone);
|
||||
|
||||
$options["show_empty"] = (array_key_exists($show['instance_id'],
|
||||
$content_count)) ? 0 : 1;
|
||||
|
||||
$options["show_partial_filled"] = $showInstance->showPartialFilled();
|
||||
|
||||
$events[] = &self::makeFullCalendarEvent($show, $options,
|
||||
$startsDT, $endsDT, $startsEpochStr, $endsEpochStr);
|
||||
$options["show_partial_filled"] = !$isFull[$show['instance_id']];
|
||||
|
||||
$event = array();
|
||||
|
||||
$event["id"] = intval($show["instance_id"]);
|
||||
$event["title"] = $show["name"];
|
||||
$event["start"] = $startsDT->format("Y-m-d H:i:s");
|
||||
$event["end"] = $endsDT->format("Y-m-d H:i:s");
|
||||
$event["allDay"] = false;
|
||||
$event["showId"] = intval($show["show_id"]);
|
||||
$event["record"] = intval($show["record"]);
|
||||
$event["rebroadcast"] = intval($show["rebroadcast"]);
|
||||
$event["soundcloud_id"] = is_null($show["soundcloud_id"])
|
||||
? -1 : $show["soundcloud_id"];
|
||||
|
||||
//event colouring
|
||||
if ($show["color"] != "") {
|
||||
$event["textColor"] = "#".$show["color"];
|
||||
}
|
||||
|
||||
if ($show["background_color"] != "") {
|
||||
$event["color"] = "#".$show["background_color"];
|
||||
}
|
||||
|
||||
foreach ($options as $key => $value) {
|
||||
$event[$key] = $value;
|
||||
}
|
||||
|
||||
$events[] = $event;
|
||||
}
|
||||
|
||||
return $events;
|
||||
}
|
||||
|
||||
|
@ -1824,7 +1862,7 @@ SQL;
|
|||
return $percent;
|
||||
}
|
||||
|
||||
private static function &makeFullCalendarEvent(&$show, $options=array(), $startDateTime, $endDateTime, $startsEpoch, $endsEpoch)
|
||||
/* private static function &makeFullCalendarEvent(&$show, $options=array(), $startDateTime, $endDateTime, $startsEpoch, $endsEpoch)
|
||||
{
|
||||
$event = array();
|
||||
|
||||
|
@ -1855,7 +1893,7 @@ SQL;
|
|||
}
|
||||
|
||||
return $event;
|
||||
}
|
||||
}*/
|
||||
|
||||
/* Takes in a UTC DateTime object.
|
||||
* Converts this to local time, since cc_show days
|
||||
|
@ -2162,4 +2200,42 @@ SQL;
|
|||
}
|
||||
return $assocArray;
|
||||
}
|
||||
|
||||
public static function getStartEndCurrentMonthView() {
|
||||
$first_day_of_calendar_month_view = mktime(0, 0, 0, date("n"), 1);
|
||||
$weekStart = Application_Model_Preference::GetWeekStartDay();
|
||||
while (date('w', $first_day_of_calendar_month_view) != $weekStart) {
|
||||
$first_day_of_calendar_month_view -= 60*60*24;
|
||||
}
|
||||
$last_day_of_calendar_view = $first_day_of_calendar_month_view + 3600*24*42;
|
||||
|
||||
$start = new DateTime("@".$first_day_of_calendar_month_view);
|
||||
$end = new DateTime("@".$last_day_of_calendar_view);
|
||||
|
||||
return array($start, $end);
|
||||
}
|
||||
|
||||
public static function getStartEndCurrentWeekView() {
|
||||
$first_day_of_calendar_week_view = mktime(0, 0, 0, date("n"), date("j"));
|
||||
$weekStart = Application_Model_Preference::GetWeekStartDay();
|
||||
while (date('w', $first_day_of_calendar_week_view) != $weekStart) {
|
||||
$first_day_of_calendar_week_view -= 60*60*24;
|
||||
}
|
||||
$last_day_of_calendar_view = $first_day_of_calendar_week_view + 3600*24*7;
|
||||
|
||||
$start = new DateTime("@".$first_day_of_calendar_week_view);
|
||||
$end = new DateTime("@".$last_day_of_calendar_view);
|
||||
|
||||
return array($start, $end);
|
||||
}
|
||||
|
||||
public static function getStartEndCurrentDayView() {
|
||||
$today = mktime(0, 0, 0, date("n"), date("j"));
|
||||
$tomorrow = $today + 3600*24;
|
||||
|
||||
$start = new DateTime("@".$today);
|
||||
$end = new DateTime("@".$tomorrow);
|
||||
|
||||
return array($start, $end);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -227,7 +227,7 @@ class Application_Model_ShowBuilder
|
|||
$row["endDate"] = $showEndDT->format("Y-m-d");
|
||||
$row["endTime"] = $showEndDT->format("H:i");
|
||||
$row["duration"] = floatval($showEndDT->format("U.u")) - floatval($showStartDT->format("U.u"));
|
||||
$row["title"] = $p_item["show_name"];
|
||||
$row["title"] = htmlspecialchars($p_item["show_name"]);
|
||||
$row["instance"] = intval($p_item["si_id"]);
|
||||
$row["image"] = '';
|
||||
|
||||
|
@ -275,9 +275,9 @@ class Application_Model_ShowBuilder
|
|||
$formatter = new LengthFormatter(Application_Common_DateHelper::ConvertMSToHHMMSSmm($run_time*1000));
|
||||
$row['runtime'] = $formatter->format();
|
||||
|
||||
$row["title"] = $p_item["file_track_title"];
|
||||
$row["creator"] = $p_item["file_artist_name"];
|
||||
$row["album"] = $p_item["file_album_title"];
|
||||
$row["title"] = htmlspecialchars($p_item["file_track_title"]);
|
||||
$row["creator"] = htmlspecialchars($p_item["file_artist_name"]);
|
||||
$row["album"] = htmlspecialchars($p_item["file_album_title"]);
|
||||
|
||||
$row["cuein"] = $p_item["cue_in"];
|
||||
$row["cueout"] = $p_item["cue_out"];
|
||||
|
|
|
@ -661,10 +661,8 @@ SQL;
|
|||
return $returnStr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static function getContentCount($p_start, $p_end)
|
||||
{
|
||||
{
|
||||
$sql = <<<SQL
|
||||
SELECT instance_id,
|
||||
count(*) AS instance_count
|
||||
|
@ -687,20 +685,26 @@ SQL;
|
|||
|
||||
}
|
||||
|
||||
public function showPartialFilled()
|
||||
public static function getIsFull($p_start, $p_end)
|
||||
{
|
||||
$sql = <<<SQL
|
||||
SELECT time_filled > '00:00:00'
|
||||
AND time_filled < ends - starts
|
||||
AND file_id IS null AS partial_filled
|
||||
FROM cc_show_instances
|
||||
WHERE id = :instance_id
|
||||
SELECT id, ends-starts-'00:00:05' < time_filled as filled
|
||||
from cc_show_instances
|
||||
WHERE ends > :p_start::TIMESTAMP
|
||||
AND starts < :p_end::TIMESTAMP
|
||||
SQL;
|
||||
|
||||
$res = Application_Common_Database::prepareAndExecute($sql,
|
||||
array(':instance_id' => $this->_instanceId), 'all');
|
||||
$res = Application_Common_Database::prepareAndExecute($sql, array(
|
||||
':p_start' => $p_start->format("Y-m-d G:i:s"),
|
||||
':p_end' => $p_end->format("Y-m-d G:i:s"))
|
||||
, 'all');
|
||||
|
||||
return $res[0]["partial_filled"];
|
||||
$isFilled = array();
|
||||
foreach ($res as $r) {
|
||||
$isFilled[$r['id']] = $r['filled'];
|
||||
}
|
||||
|
||||
return $isFilled;
|
||||
}
|
||||
|
||||
public function showEmpty()
|
||||
|
|
|
@ -368,7 +368,12 @@ SQL;
|
|||
|
||||
if (file_exists($filepath) && $type == "stor") {
|
||||
$data = array("filepath" => $filepath, "delete" => 1);
|
||||
Application_Model_RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
|
||||
try {
|
||||
Application_Model_RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
|
||||
} catch (Exception $e) {
|
||||
Logging::error($e->getMessage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -645,7 +650,8 @@ SQL;
|
|||
"track_number", "mood", "bpm", "composer", "info_url",
|
||||
"bit_rate", "sample_rate", "isrc_number", "encoded_by", "label",
|
||||
"copyright", "mime", "language", "filepath", "owner_id",
|
||||
"conductor", "replay_gain", "lptime" );
|
||||
"conductor", "replay_gain", "lptime", "is_playlist", "is_scheduled",
|
||||
"cuein", "cueout" );
|
||||
}
|
||||
|
||||
public static function searchLibraryFiles($datatables)
|
||||
|
@ -697,6 +703,16 @@ SQL;
|
|||
$blSelect[] = "NULL::TIMESTAMP AS ".$key;
|
||||
$fileSelect[] = $key;
|
||||
$streamSelect[] = $key;
|
||||
} elseif ($key === "is_scheduled" || $key === "is_playlist") {
|
||||
$plSelect[] = "NULL::boolean AS ".$key;
|
||||
$blSelect[] = "NULL::boolean AS ".$key;
|
||||
$fileSelect[] = $key;
|
||||
$streamSelect[] = "NULL::boolean AS ".$key;
|
||||
} elseif ($key === "cuein" || $key === "cueout") {
|
||||
$plSelect[] = "NULL::INTERVAL AS ".$key;
|
||||
$blSelect[] = "NULL::INTERVAL AS ".$key;
|
||||
$fileSelect[] = $key;
|
||||
$streamSelect[] = "NULL::INTERVAL AS ".$key;
|
||||
}
|
||||
//same columns in each table.
|
||||
else if (in_array($key, array("length", "utime", "mtime"))) {
|
||||
|
@ -770,14 +786,22 @@ SQL;
|
|||
$fromTable = $unionTable;
|
||||
}
|
||||
|
||||
// update is_scheduled to false for tracks that
|
||||
// have already played out
|
||||
self::updatePastFilesIsScheduled();
|
||||
$results = Application_Model_Datatables::findEntries($con, $displayColumns, $fromTable, $datatables);
|
||||
|
||||
//Used by the audio preview functionality in the library.
|
||||
foreach ($results['aaData'] as &$row) {
|
||||
$row['id'] = intval($row['id']);
|
||||
|
||||
$formatter = new LengthFormatter($row['length']);
|
||||
$row['length'] = $formatter->format();
|
||||
$len_formatter = new LengthFormatter($row['length']);
|
||||
$row['length'] = $len_formatter->format();
|
||||
|
||||
$cuein_formatter = new LengthFormatter($row["cuein"]);
|
||||
$row["cuein"] = $cuein_formatter->format();
|
||||
|
||||
$cueout_formatter = new LengthFormatter($row["cueout"]);
|
||||
$row["cueout"] = $cueout_formatter->format();
|
||||
|
||||
if ($row['ftype'] === "audioclip") {
|
||||
$formatter = new SamplerateFormatter($row['sample_rate']);
|
||||
|
@ -785,6 +809,15 @@ SQL;
|
|||
|
||||
$formatter = new BitrateFormatter($row['bit_rate']);
|
||||
$row['bit_rate'] = $formatter->format();
|
||||
|
||||
//soundcloud status
|
||||
$file = Application_Model_StoredFile::Recall($row['id']);
|
||||
$row['soundcloud_status'] = $file->getSoundCloudId();
|
||||
|
||||
// for audio preview
|
||||
$row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION);
|
||||
} else {
|
||||
$row['audioFile'] = $row['id'];
|
||||
}
|
||||
|
||||
//convert mtime and utime to localtime
|
||||
|
@ -795,31 +828,13 @@ SQL;
|
|||
$row['utime']->setTimeZone(new DateTimeZone(date_default_timezone_get()));
|
||||
$row['utime'] = $row['utime']->format('Y-m-d H:i:s');
|
||||
|
||||
// add checkbox row
|
||||
$row['checkbox'] = "<input type='checkbox' name='cb_".$row['id']."'>";
|
||||
// we need to initalize the checkbox and image row because we do not retrieve
|
||||
// any data from the db for these and datatables will complain
|
||||
$row['checkbox'] = "";
|
||||
$row['image'] = "";
|
||||
|
||||
$type = substr($row['ftype'], 0, 2);
|
||||
|
||||
$row['tr_id'] = "{$type}_{$row['id']}";
|
||||
|
||||
//TODO url like this to work on both playlist/showbuilder
|
||||
//screens. datatable stuff really needs to be pulled out and
|
||||
//generalized within the project access to zend view methods
|
||||
//to access url helpers is needed.
|
||||
|
||||
// TODO : why is there inline html here? breaks abstraction and is
|
||||
// ugly
|
||||
if ($type == "au") {
|
||||
$row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION);
|
||||
$row['image'] = '<img title="'._("Track preview").'" src="'.$baseUrl.'css/images/icon_audioclip.png">';
|
||||
} elseif ($type == "pl") {
|
||||
$row['image'] = '<img title="'._("Playlist preview").'" src="'.$baseUrl.'css/images/icon_playlist.png">';
|
||||
} elseif ($type == "st") {
|
||||
$row['audioFile'] = $row['id'];
|
||||
$row['image'] = '<img title="'._("Webstream preview").'" src="'.$baseUrl.'css/images/icon_webstream.png">';
|
||||
} elseif ($type == "bl") {
|
||||
$row['image'] = '<img title="'._("Smart Block").'" src="'.$baseUrl.'css/images/icon_smart-block.png">';
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
|
@ -1026,8 +1041,10 @@ SQL;
|
|||
$LIQUIDSOAP_ERRORS = array('TagLib: MPEG::Properties::read() -- Could not find a valid last MPEG frame in the stream.');
|
||||
|
||||
// Ask Liquidsoap if file is playable
|
||||
$command = sprintf("/usr/bin/airtime-liquidsoap -c 'output.dummy(audio_to_stereo(single(\"%s\")))' 2>&1", $audio_file);
|
||||
$ls_command = sprintf('/usr/bin/airtime-liquidsoap -v -c "output.dummy(audio_to_stereo(single(%s)))" 2>&1',
|
||||
escapeshellarg($audio_file));
|
||||
|
||||
$command = "export PATH=/usr/local/bin:/usr/bin:/bin/usr/bin/ && $ls_command";
|
||||
exec($command, $output, $rv);
|
||||
|
||||
$isError = count($output) > 0 && in_array($output[0], $LIQUIDSOAP_ERRORS);
|
||||
|
@ -1285,6 +1302,65 @@ SQL;
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function setIsPlaylist($p_playlistItems, $p_type, $p_status) {
|
||||
foreach ($p_playlistItems as $item) {
|
||||
$file = self::Recall($item->getDbFileId());
|
||||
$fileId = $file->_file->getDbId();
|
||||
if ($p_type == 'playlist') {
|
||||
// we have to check if the file is in another playlist before
|
||||
// we can update
|
||||
if (!is_null($fileId) && !in_array($fileId, Application_Model_Playlist::getAllPlaylistFiles())) {
|
||||
$file->_file->setDbIsPlaylist($p_status)->save();
|
||||
}
|
||||
} elseif ($p_type == 'block') {
|
||||
if (!is_null($fileId) && !in_array($fileId, Application_Model_Block::getAllBlockFiles())) {
|
||||
$file->_file->setDbIsPlaylist($p_status)->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function setIsScheduled($p_scheduleItem, $p_status, $p_fileId=null) {
|
||||
if (is_null($p_fileId)) {
|
||||
$fileId = Application_Model_Schedule::GetFileId($p_scheduleItem);
|
||||
} else {
|
||||
$fileId = $p_fileId;
|
||||
}
|
||||
$file = self::Recall($fileId);
|
||||
$updateIsScheduled = false;
|
||||
|
||||
if (!is_null($fileId) && !in_array($fileId, Application_Model_Schedule::getAllFutureScheduledFiles())) {
|
||||
$file->_file->setDbIsScheduled($p_status)->save();
|
||||
$updateIsScheduled = true;
|
||||
}
|
||||
|
||||
return $updateIsScheduled;
|
||||
}
|
||||
|
||||
public static function updatePastFilesIsScheduled()
|
||||
{
|
||||
$con = Propel::getConnection();
|
||||
$sql = <<<SQL
|
||||
SELECT file_id FROM cc_schedule
|
||||
WHERE ends < now() at time zone 'UTC'
|
||||
SQL;
|
||||
$files = $con->query($sql)->fetchAll();
|
||||
foreach ($files as $file) {
|
||||
if (!is_null($file['file_id'])) {
|
||||
self::setIsScheduled(null, false, $file['file_id']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getRealClipLength($p_cuein, $p_cueout) {
|
||||
$sql = "SELECT :cueout::INTERVAL - :cuein::INTERVAL";
|
||||
|
||||
return Application_Common_Database::prepareAndExecute($sql, array(
|
||||
':cueout' => $p_cueout,
|
||||
':cuein' => $p_cuein), 'column');
|
||||
}
|
||||
}
|
||||
|
||||
class DeleteScheduledFileException extends Exception {}
|
||||
|
|
|
@ -214,35 +214,22 @@ class Application_Model_Systemstatus
|
|||
{
|
||||
$partions = array();
|
||||
|
||||
if (isset($_SERVER['AIRTIME_SRV'])) {
|
||||
//connect to DB and find how much total space user has allocated.
|
||||
$totalSpace = Application_Model_Preference::GetDiskQuota();
|
||||
/* First lets get all the watched directories. Then we can group them
|
||||
* into the same partitions by comparing the partition sizes. */
|
||||
$musicDirs = Application_Model_MusicDir::getWatchedDirs();
|
||||
$musicDirs[] = Application_Model_MusicDir::getStorDir();
|
||||
|
||||
$storPath = Application_Model_MusicDir::getStorDir()->getDirectory();
|
||||
foreach ($musicDirs as $md) {
|
||||
$totalSpace = disk_total_space($md->getDirectory());
|
||||
|
||||
list($usedSpace,) = preg_split("/[\s]+/", exec("du -bs $storPath"));
|
||||
if (!isset($partitions[$totalSpace])) {
|
||||
$partitions[$totalSpace] = new StdClass;
|
||||
$partitions[$totalSpace]->totalSpace = $totalSpace;
|
||||
$partitions[$totalSpace]->totalFreeSpace = disk_free_space($md->getDirectory());
|
||||
|
||||
$partitions[$totalSpace]->totalSpace = $totalSpace;
|
||||
$partitions[$totalSpace]->totalFreeSpace = $totalSpace - $usedSpace;
|
||||
Logging::info($partitions[$totalSpace]->totalFreeSpace);
|
||||
} else {
|
||||
/* First lets get all the watched directories. Then we can group them
|
||||
* into the same partitions by comparing the partition sizes. */
|
||||
$musicDirs = Application_Model_MusicDir::getWatchedDirs();
|
||||
$musicDirs[] = Application_Model_MusicDir::getStorDir();
|
||||
|
||||
foreach ($musicDirs as $md) {
|
||||
$totalSpace = disk_total_space($md->getDirectory());
|
||||
|
||||
if (!isset($partitions[$totalSpace])) {
|
||||
$partitions[$totalSpace] = new StdClass;
|
||||
$partitions[$totalSpace]->totalSpace = $totalSpace;
|
||||
$partitions[$totalSpace]->totalFreeSpace = disk_free_space($md->getDirectory());
|
||||
|
||||
}
|
||||
|
||||
$partitions[$totalSpace]->dirs[] = $md->getDirectory();
|
||||
}
|
||||
|
||||
$partitions[$totalSpace]->dirs[] = $md->getDirectory();
|
||||
}
|
||||
|
||||
return array_values($partitions);
|
||||
|
|
|
@ -335,6 +335,8 @@ class Application_Model_User
|
|||
} else {
|
||||
$record['delete'] = "";
|
||||
}
|
||||
|
||||
$record = array_map('htmlspecialchars', $record);
|
||||
}
|
||||
|
||||
return $res;
|
||||
|
|
|
@ -106,6 +106,8 @@ class CcFilesTableMap extends TableMap {
|
|||
$this->addColumn('CUEOUT', 'DbCueout', 'VARCHAR', false, null, '00:00:00');
|
||||
$this->addColumn('SILAN_CHECK', 'DbSilanCheck', 'BOOLEAN', false, null, false);
|
||||
$this->addColumn('HIDDEN', 'DbHidden', 'BOOLEAN', false, null, false);
|
||||
$this->addColumn('IS_SCHEDULED', 'DbIsScheduled', 'BOOLEAN', false, null, false);
|
||||
$this->addColumn('IS_PLAYLIST', 'DbIsPlaylist', 'BOOLEAN', false, null, false);
|
||||
// validators
|
||||
} // initialize()
|
||||
|
||||
|
|
|
@ -46,8 +46,8 @@ class CcScheduleTableMap extends TableMap {
|
|||
$this->addColumn('CLIP_LENGTH', 'DbClipLength', 'VARCHAR', false, null, '00:00:00');
|
||||
$this->addColumn('FADE_IN', 'DbFadeIn', 'TIME', false, null, '00:00:00');
|
||||
$this->addColumn('FADE_OUT', 'DbFadeOut', 'TIME', false, null, '00:00:00');
|
||||
$this->addColumn('CUE_IN', 'DbCueIn', 'VARCHAR', false, null, '00:00:00');
|
||||
$this->addColumn('CUE_OUT', 'DbCueOut', 'VARCHAR', false, null, '00:00:00');
|
||||
$this->addColumn('CUE_IN', 'DbCueIn', 'VARCHAR', true, null, null);
|
||||
$this->addColumn('CUE_OUT', 'DbCueOut', 'VARCHAR', true, null, null);
|
||||
$this->addColumn('MEDIA_ITEM_PLAYED', 'DbMediaItemPlayed', 'BOOLEAN', false, null, false);
|
||||
$this->addForeignKey('INSTANCE_ID', 'DbInstanceId', 'INTEGER', 'cc_show_instances', 'ID', true, null, null);
|
||||
$this->addColumn('PLAYOUT_STATUS', 'DbPlayoutStatus', 'SMALLINT', true, null, 1);
|
||||
|
|
|
@ -444,6 +444,20 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
*/
|
||||
protected $hidden;
|
||||
|
||||
/**
|
||||
* The value for the is_scheduled field.
|
||||
* Note: this column has a database default value of: false
|
||||
* @var boolean
|
||||
*/
|
||||
protected $is_scheduled;
|
||||
|
||||
/**
|
||||
* The value for the is_playlist field.
|
||||
* Note: this column has a database default value of: false
|
||||
* @var boolean
|
||||
*/
|
||||
protected $is_playlist;
|
||||
|
||||
/**
|
||||
* @var CcSubjs
|
||||
*/
|
||||
|
@ -513,6 +527,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$this->cueout = '00:00:00';
|
||||
$this->silan_check = false;
|
||||
$this->hidden = false;
|
||||
$this->is_scheduled = false;
|
||||
$this->is_playlist = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1297,6 +1313,26 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
return $this->hidden;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [is_scheduled] column value.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getDbIsScheduled()
|
||||
{
|
||||
return $this->is_scheduled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [is_playlist] column value.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getDbIsPlaylist()
|
||||
{
|
||||
return $this->is_playlist;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [id] column.
|
||||
*
|
||||
|
@ -2785,6 +2821,46 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
return $this;
|
||||
} // setDbHidden()
|
||||
|
||||
/**
|
||||
* Set the value of [is_scheduled] column.
|
||||
*
|
||||
* @param boolean $v new value
|
||||
* @return CcFiles The current object (for fluent API support)
|
||||
*/
|
||||
public function setDbIsScheduled($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (boolean) $v;
|
||||
}
|
||||
|
||||
if ($this->is_scheduled !== $v || $this->isNew()) {
|
||||
$this->is_scheduled = $v;
|
||||
$this->modifiedColumns[] = CcFilesPeer::IS_SCHEDULED;
|
||||
}
|
||||
|
||||
return $this;
|
||||
} // setDbIsScheduled()
|
||||
|
||||
/**
|
||||
* Set the value of [is_playlist] column.
|
||||
*
|
||||
* @param boolean $v new value
|
||||
* @return CcFiles The current object (for fluent API support)
|
||||
*/
|
||||
public function setDbIsPlaylist($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (boolean) $v;
|
||||
}
|
||||
|
||||
if ($this->is_playlist !== $v || $this->isNew()) {
|
||||
$this->is_playlist = $v;
|
||||
$this->modifiedColumns[] = CcFilesPeer::IS_PLAYLIST;
|
||||
}
|
||||
|
||||
return $this;
|
||||
} // setDbIsPlaylist()
|
||||
|
||||
/**
|
||||
* Indicates whether the columns in this object are only set to default values.
|
||||
*
|
||||
|
@ -2843,6 +2919,14 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
return false;
|
||||
}
|
||||
|
||||
if ($this->is_scheduled !== false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->is_playlist !== false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// otherwise, everything was equal, so return TRUE
|
||||
return true;
|
||||
} // hasOnlyDefaultValues()
|
||||
|
@ -2933,6 +3017,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$this->cueout = ($row[$startcol + 65] !== null) ? (string) $row[$startcol + 65] : null;
|
||||
$this->silan_check = ($row[$startcol + 66] !== null) ? (boolean) $row[$startcol + 66] : null;
|
||||
$this->hidden = ($row[$startcol + 67] !== null) ? (boolean) $row[$startcol + 67] : null;
|
||||
$this->is_scheduled = ($row[$startcol + 68] !== null) ? (boolean) $row[$startcol + 68] : null;
|
||||
$this->is_playlist = ($row[$startcol + 69] !== null) ? (boolean) $row[$startcol + 69] : null;
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
@ -2941,7 +3027,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 68; // 68 = CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
return $startcol + 70; // 70 = CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating CcFiles object", $e);
|
||||
|
@ -3578,6 +3664,12 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
case 67:
|
||||
return $this->getDbHidden();
|
||||
break;
|
||||
case 68:
|
||||
return $this->getDbIsScheduled();
|
||||
break;
|
||||
case 69:
|
||||
return $this->getDbIsPlaylist();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
|
@ -3670,6 +3762,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$keys[65] => $this->getDbCueout(),
|
||||
$keys[66] => $this->getDbSilanCheck(),
|
||||
$keys[67] => $this->getDbHidden(),
|
||||
$keys[68] => $this->getDbIsScheduled(),
|
||||
$keys[69] => $this->getDbIsPlaylist(),
|
||||
);
|
||||
if ($includeForeignObjects) {
|
||||
if (null !== $this->aFkOwner) {
|
||||
|
@ -3916,6 +4010,12 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
case 67:
|
||||
$this->setDbHidden($value);
|
||||
break;
|
||||
case 68:
|
||||
$this->setDbIsScheduled($value);
|
||||
break;
|
||||
case 69:
|
||||
$this->setDbIsPlaylist($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
|
@ -4008,6 +4108,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
if (array_key_exists($keys[65], $arr)) $this->setDbCueout($arr[$keys[65]]);
|
||||
if (array_key_exists($keys[66], $arr)) $this->setDbSilanCheck($arr[$keys[66]]);
|
||||
if (array_key_exists($keys[67], $arr)) $this->setDbHidden($arr[$keys[67]]);
|
||||
if (array_key_exists($keys[68], $arr)) $this->setDbIsScheduled($arr[$keys[68]]);
|
||||
if (array_key_exists($keys[69], $arr)) $this->setDbIsPlaylist($arr[$keys[69]]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4087,6 +4189,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
if ($this->isColumnModified(CcFilesPeer::CUEOUT)) $criteria->add(CcFilesPeer::CUEOUT, $this->cueout);
|
||||
if ($this->isColumnModified(CcFilesPeer::SILAN_CHECK)) $criteria->add(CcFilesPeer::SILAN_CHECK, $this->silan_check);
|
||||
if ($this->isColumnModified(CcFilesPeer::HIDDEN)) $criteria->add(CcFilesPeer::HIDDEN, $this->hidden);
|
||||
if ($this->isColumnModified(CcFilesPeer::IS_SCHEDULED)) $criteria->add(CcFilesPeer::IS_SCHEDULED, $this->is_scheduled);
|
||||
if ($this->isColumnModified(CcFilesPeer::IS_PLAYLIST)) $criteria->add(CcFilesPeer::IS_PLAYLIST, $this->is_playlist);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
|
@ -4215,6 +4319,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$copyObj->setDbCueout($this->cueout);
|
||||
$copyObj->setDbSilanCheck($this->silan_check);
|
||||
$copyObj->setDbHidden($this->hidden);
|
||||
$copyObj->setDbIsScheduled($this->is_scheduled);
|
||||
$copyObj->setDbIsPlaylist($this->is_playlist);
|
||||
|
||||
if ($deepCopy) {
|
||||
// important: temporarily setNew(false) because this affects the behavior of
|
||||
|
@ -5121,6 +5227,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$this->cueout = null;
|
||||
$this->silan_check = null;
|
||||
$this->hidden = null;
|
||||
$this->is_scheduled = null;
|
||||
$this->is_playlist = null;
|
||||
$this->alreadyInSave = false;
|
||||
$this->alreadyInValidation = false;
|
||||
$this->clearAllReferences();
|
||||
|
|
|
@ -26,7 +26,7 @@ abstract class BaseCcFilesPeer {
|
|||
const TM_CLASS = 'CcFilesTableMap';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 68;
|
||||
const NUM_COLUMNS = 70;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
@ -235,6 +235,12 @@ abstract class BaseCcFilesPeer {
|
|||
/** the column name for the HIDDEN field */
|
||||
const HIDDEN = 'cc_files.HIDDEN';
|
||||
|
||||
/** the column name for the IS_SCHEDULED field */
|
||||
const IS_SCHEDULED = 'cc_files.IS_SCHEDULED';
|
||||
|
||||
/** the column name for the IS_PLAYLIST field */
|
||||
const IS_PLAYLIST = 'cc_files.IS_PLAYLIST';
|
||||
|
||||
/**
|
||||
* An identiy map to hold any loaded instances of CcFiles objects.
|
||||
* This must be public so that other peer classes can access this when hydrating from JOIN
|
||||
|
@ -251,12 +257,12 @@ abstract class BaseCcFilesPeer {
|
|||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbUtime', 'DbLPtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', 'DbFileExists', 'DbSoundcloudId', 'DbSoundcloudErrorCode', 'DbSoundcloudErrorMsg', 'DbSoundcloudLinkToFile', 'DbSoundCloundUploadTime', 'DbReplayGain', 'DbOwnerId', 'DbCuein', 'DbCueout', 'DbSilanCheck', 'DbHidden', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbUtime', 'dbLPtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', 'dbFileExists', 'dbSoundcloudId', 'dbSoundcloudErrorCode', 'dbSoundcloudErrorMsg', 'dbSoundcloudLinkToFile', 'dbSoundCloundUploadTime', 'dbReplayGain', 'dbOwnerId', 'dbCuein', 'dbCueout', 'dbSilanCheck', 'dbHidden', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::MIME, self::FTYPE, self::DIRECTORY, self::FILEPATH, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::UTIME, self::LPTIME, self::MD5, self::TRACK_TITLE, self::ARTIST_NAME, self::BIT_RATE, self::SAMPLE_RATE, self::FORMAT, self::LENGTH, self::ALBUM_TITLE, self::GENRE, self::COMMENTS, self::YEAR, self::TRACK_NUMBER, self::CHANNELS, self::URL, self::BPM, self::RATING, self::ENCODED_BY, self::DISC_NUMBER, self::MOOD, self::LABEL, self::COMPOSER, self::ENCODER, self::CHECKSUM, self::LYRICS, self::ORCHESTRA, self::CONDUCTOR, self::LYRICIST, self::ORIGINAL_LYRICIST, self::RADIO_STATION_NAME, self::INFO_URL, self::ARTIST_URL, self::AUDIO_SOURCE_URL, self::RADIO_STATION_URL, self::BUY_THIS_URL, self::ISRC_NUMBER, self::CATALOG_NUMBER, self::ORIGINAL_ARTIST, self::COPYRIGHT, self::REPORT_DATETIME, self::REPORT_LOCATION, self::REPORT_ORGANIZATION, self::SUBJECT, self::CONTRIBUTOR, self::LANGUAGE, self::FILE_EXISTS, self::SOUNDCLOUD_ID, self::SOUNDCLOUD_ERROR_CODE, self::SOUNDCLOUD_ERROR_MSG, self::SOUNDCLOUD_LINK_TO_FILE, self::SOUNDCLOUD_UPLOAD_TIME, self::REPLAY_GAIN, self::OWNER_ID, self::CUEIN, self::CUEOUT, self::SILAN_CHECK, self::HIDDEN, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'UTIME', 'LPTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', 'FILE_EXISTS', 'SOUNDCLOUD_ID', 'SOUNDCLOUD_ERROR_CODE', 'SOUNDCLOUD_ERROR_MSG', 'SOUNDCLOUD_LINK_TO_FILE', 'SOUNDCLOUD_UPLOAD_TIME', 'REPLAY_GAIN', 'OWNER_ID', 'CUEIN', 'CUEOUT', 'SILAN_CHECK', 'HIDDEN', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'mime', 'ftype', 'directory', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'utime', 'lptime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', 'file_exists', 'soundcloud_id', 'soundcloud_error_code', 'soundcloud_error_msg', 'soundcloud_link_to_file', 'soundcloud_upload_time', 'replay_gain', 'owner_id', 'cuein', 'cueout', 'silan_check', 'hidden', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbUtime', 'DbLPtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', 'DbFileExists', 'DbSoundcloudId', 'DbSoundcloudErrorCode', 'DbSoundcloudErrorMsg', 'DbSoundcloudLinkToFile', 'DbSoundCloundUploadTime', 'DbReplayGain', 'DbOwnerId', 'DbCuein', 'DbCueout', 'DbSilanCheck', 'DbHidden', 'DbIsScheduled', 'DbIsPlaylist', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbUtime', 'dbLPtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', 'dbFileExists', 'dbSoundcloudId', 'dbSoundcloudErrorCode', 'dbSoundcloudErrorMsg', 'dbSoundcloudLinkToFile', 'dbSoundCloundUploadTime', 'dbReplayGain', 'dbOwnerId', 'dbCuein', 'dbCueout', 'dbSilanCheck', 'dbHidden', 'dbIsScheduled', 'dbIsPlaylist', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::MIME, self::FTYPE, self::DIRECTORY, self::FILEPATH, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::UTIME, self::LPTIME, self::MD5, self::TRACK_TITLE, self::ARTIST_NAME, self::BIT_RATE, self::SAMPLE_RATE, self::FORMAT, self::LENGTH, self::ALBUM_TITLE, self::GENRE, self::COMMENTS, self::YEAR, self::TRACK_NUMBER, self::CHANNELS, self::URL, self::BPM, self::RATING, self::ENCODED_BY, self::DISC_NUMBER, self::MOOD, self::LABEL, self::COMPOSER, self::ENCODER, self::CHECKSUM, self::LYRICS, self::ORCHESTRA, self::CONDUCTOR, self::LYRICIST, self::ORIGINAL_LYRICIST, self::RADIO_STATION_NAME, self::INFO_URL, self::ARTIST_URL, self::AUDIO_SOURCE_URL, self::RADIO_STATION_URL, self::BUY_THIS_URL, self::ISRC_NUMBER, self::CATALOG_NUMBER, self::ORIGINAL_ARTIST, self::COPYRIGHT, self::REPORT_DATETIME, self::REPORT_LOCATION, self::REPORT_ORGANIZATION, self::SUBJECT, self::CONTRIBUTOR, self::LANGUAGE, self::FILE_EXISTS, self::SOUNDCLOUD_ID, self::SOUNDCLOUD_ERROR_CODE, self::SOUNDCLOUD_ERROR_MSG, self::SOUNDCLOUD_LINK_TO_FILE, self::SOUNDCLOUD_UPLOAD_TIME, self::REPLAY_GAIN, self::OWNER_ID, self::CUEIN, self::CUEOUT, self::SILAN_CHECK, self::HIDDEN, self::IS_SCHEDULED, self::IS_PLAYLIST, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'UTIME', 'LPTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', 'FILE_EXISTS', 'SOUNDCLOUD_ID', 'SOUNDCLOUD_ERROR_CODE', 'SOUNDCLOUD_ERROR_MSG', 'SOUNDCLOUD_LINK_TO_FILE', 'SOUNDCLOUD_UPLOAD_TIME', 'REPLAY_GAIN', 'OWNER_ID', 'CUEIN', 'CUEOUT', 'SILAN_CHECK', 'HIDDEN', 'IS_SCHEDULED', 'IS_PLAYLIST', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'mime', 'ftype', 'directory', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'utime', 'lptime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', 'file_exists', 'soundcloud_id', 'soundcloud_error_code', 'soundcloud_error_msg', 'soundcloud_link_to_file', 'soundcloud_upload_time', 'replay_gain', 'owner_id', 'cuein', 'cueout', 'silan_check', 'hidden', 'is_scheduled', 'is_playlist', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, )
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -266,12 +272,12 @@ abstract class BaseCcFilesPeer {
|
|||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbMime' => 2, 'DbFtype' => 3, 'DbDirectory' => 4, 'DbFilepath' => 5, 'DbState' => 6, 'DbCurrentlyaccessing' => 7, 'DbEditedby' => 8, 'DbMtime' => 9, 'DbUtime' => 10, 'DbLPtime' => 11, 'DbMd5' => 12, 'DbTrackTitle' => 13, 'DbArtistName' => 14, 'DbBitRate' => 15, 'DbSampleRate' => 16, 'DbFormat' => 17, 'DbLength' => 18, 'DbAlbumTitle' => 19, 'DbGenre' => 20, 'DbComments' => 21, 'DbYear' => 22, 'DbTrackNumber' => 23, 'DbChannels' => 24, 'DbUrl' => 25, 'DbBpm' => 26, 'DbRating' => 27, 'DbEncodedBy' => 28, 'DbDiscNumber' => 29, 'DbMood' => 30, 'DbLabel' => 31, 'DbComposer' => 32, 'DbEncoder' => 33, 'DbChecksum' => 34, 'DbLyrics' => 35, 'DbOrchestra' => 36, 'DbConductor' => 37, 'DbLyricist' => 38, 'DbOriginalLyricist' => 39, 'DbRadioStationName' => 40, 'DbInfoUrl' => 41, 'DbArtistUrl' => 42, 'DbAudioSourceUrl' => 43, 'DbRadioStationUrl' => 44, 'DbBuyThisUrl' => 45, 'DbIsrcNumber' => 46, 'DbCatalogNumber' => 47, 'DbOriginalArtist' => 48, 'DbCopyright' => 49, 'DbReportDatetime' => 50, 'DbReportLocation' => 51, 'DbReportOrganization' => 52, 'DbSubject' => 53, 'DbContributor' => 54, 'DbLanguage' => 55, 'DbFileExists' => 56, 'DbSoundcloudId' => 57, 'DbSoundcloudErrorCode' => 58, 'DbSoundcloudErrorMsg' => 59, 'DbSoundcloudLinkToFile' => 60, 'DbSoundCloundUploadTime' => 61, 'DbReplayGain' => 62, 'DbOwnerId' => 63, 'DbCuein' => 64, 'DbCueout' => 65, 'DbSilanCheck' => 66, 'DbHidden' => 67, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbMime' => 2, 'dbFtype' => 3, 'dbDirectory' => 4, 'dbFilepath' => 5, 'dbState' => 6, 'dbCurrentlyaccessing' => 7, 'dbEditedby' => 8, 'dbMtime' => 9, 'dbUtime' => 10, 'dbLPtime' => 11, 'dbMd5' => 12, 'dbTrackTitle' => 13, 'dbArtistName' => 14, 'dbBitRate' => 15, 'dbSampleRate' => 16, 'dbFormat' => 17, 'dbLength' => 18, 'dbAlbumTitle' => 19, 'dbGenre' => 20, 'dbComments' => 21, 'dbYear' => 22, 'dbTrackNumber' => 23, 'dbChannels' => 24, 'dbUrl' => 25, 'dbBpm' => 26, 'dbRating' => 27, 'dbEncodedBy' => 28, 'dbDiscNumber' => 29, 'dbMood' => 30, 'dbLabel' => 31, 'dbComposer' => 32, 'dbEncoder' => 33, 'dbChecksum' => 34, 'dbLyrics' => 35, 'dbOrchestra' => 36, 'dbConductor' => 37, 'dbLyricist' => 38, 'dbOriginalLyricist' => 39, 'dbRadioStationName' => 40, 'dbInfoUrl' => 41, 'dbArtistUrl' => 42, 'dbAudioSourceUrl' => 43, 'dbRadioStationUrl' => 44, 'dbBuyThisUrl' => 45, 'dbIsrcNumber' => 46, 'dbCatalogNumber' => 47, 'dbOriginalArtist' => 48, 'dbCopyright' => 49, 'dbReportDatetime' => 50, 'dbReportLocation' => 51, 'dbReportOrganization' => 52, 'dbSubject' => 53, 'dbContributor' => 54, 'dbLanguage' => 55, 'dbFileExists' => 56, 'dbSoundcloudId' => 57, 'dbSoundcloudErrorCode' => 58, 'dbSoundcloudErrorMsg' => 59, 'dbSoundcloudLinkToFile' => 60, 'dbSoundCloundUploadTime' => 61, 'dbReplayGain' => 62, 'dbOwnerId' => 63, 'dbCuein' => 64, 'dbCueout' => 65, 'dbSilanCheck' => 66, 'dbHidden' => 67, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::MIME => 2, self::FTYPE => 3, self::DIRECTORY => 4, self::FILEPATH => 5, self::STATE => 6, self::CURRENTLYACCESSING => 7, self::EDITEDBY => 8, self::MTIME => 9, self::UTIME => 10, self::LPTIME => 11, self::MD5 => 12, self::TRACK_TITLE => 13, self::ARTIST_NAME => 14, self::BIT_RATE => 15, self::SAMPLE_RATE => 16, self::FORMAT => 17, self::LENGTH => 18, self::ALBUM_TITLE => 19, self::GENRE => 20, self::COMMENTS => 21, self::YEAR => 22, self::TRACK_NUMBER => 23, self::CHANNELS => 24, self::URL => 25, self::BPM => 26, self::RATING => 27, self::ENCODED_BY => 28, self::DISC_NUMBER => 29, self::MOOD => 30, self::LABEL => 31, self::COMPOSER => 32, self::ENCODER => 33, self::CHECKSUM => 34, self::LYRICS => 35, self::ORCHESTRA => 36, self::CONDUCTOR => 37, self::LYRICIST => 38, self::ORIGINAL_LYRICIST => 39, self::RADIO_STATION_NAME => 40, self::INFO_URL => 41, self::ARTIST_URL => 42, self::AUDIO_SOURCE_URL => 43, self::RADIO_STATION_URL => 44, self::BUY_THIS_URL => 45, self::ISRC_NUMBER => 46, self::CATALOG_NUMBER => 47, self::ORIGINAL_ARTIST => 48, self::COPYRIGHT => 49, self::REPORT_DATETIME => 50, self::REPORT_LOCATION => 51, self::REPORT_ORGANIZATION => 52, self::SUBJECT => 53, self::CONTRIBUTOR => 54, self::LANGUAGE => 55, self::FILE_EXISTS => 56, self::SOUNDCLOUD_ID => 57, self::SOUNDCLOUD_ERROR_CODE => 58, self::SOUNDCLOUD_ERROR_MSG => 59, self::SOUNDCLOUD_LINK_TO_FILE => 60, self::SOUNDCLOUD_UPLOAD_TIME => 61, self::REPLAY_GAIN => 62, self::OWNER_ID => 63, self::CUEIN => 64, self::CUEOUT => 65, self::SILAN_CHECK => 66, self::HIDDEN => 67, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'MIME' => 2, 'FTYPE' => 3, 'DIRECTORY' => 4, 'FILEPATH' => 5, 'STATE' => 6, 'CURRENTLYACCESSING' => 7, 'EDITEDBY' => 8, 'MTIME' => 9, 'UTIME' => 10, 'LPTIME' => 11, 'MD5' => 12, 'TRACK_TITLE' => 13, 'ARTIST_NAME' => 14, 'BIT_RATE' => 15, 'SAMPLE_RATE' => 16, 'FORMAT' => 17, 'LENGTH' => 18, 'ALBUM_TITLE' => 19, 'GENRE' => 20, 'COMMENTS' => 21, 'YEAR' => 22, 'TRACK_NUMBER' => 23, 'CHANNELS' => 24, 'URL' => 25, 'BPM' => 26, 'RATING' => 27, 'ENCODED_BY' => 28, 'DISC_NUMBER' => 29, 'MOOD' => 30, 'LABEL' => 31, 'COMPOSER' => 32, 'ENCODER' => 33, 'CHECKSUM' => 34, 'LYRICS' => 35, 'ORCHESTRA' => 36, 'CONDUCTOR' => 37, 'LYRICIST' => 38, 'ORIGINAL_LYRICIST' => 39, 'RADIO_STATION_NAME' => 40, 'INFO_URL' => 41, 'ARTIST_URL' => 42, 'AUDIO_SOURCE_URL' => 43, 'RADIO_STATION_URL' => 44, 'BUY_THIS_URL' => 45, 'ISRC_NUMBER' => 46, 'CATALOG_NUMBER' => 47, 'ORIGINAL_ARTIST' => 48, 'COPYRIGHT' => 49, 'REPORT_DATETIME' => 50, 'REPORT_LOCATION' => 51, 'REPORT_ORGANIZATION' => 52, 'SUBJECT' => 53, 'CONTRIBUTOR' => 54, 'LANGUAGE' => 55, 'FILE_EXISTS' => 56, 'SOUNDCLOUD_ID' => 57, 'SOUNDCLOUD_ERROR_CODE' => 58, 'SOUNDCLOUD_ERROR_MSG' => 59, 'SOUNDCLOUD_LINK_TO_FILE' => 60, 'SOUNDCLOUD_UPLOAD_TIME' => 61, 'REPLAY_GAIN' => 62, 'OWNER_ID' => 63, 'CUEIN' => 64, 'CUEOUT' => 65, 'SILAN_CHECK' => 66, 'HIDDEN' => 67, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'mime' => 2, 'ftype' => 3, 'directory' => 4, 'filepath' => 5, 'state' => 6, 'currentlyaccessing' => 7, 'editedby' => 8, 'mtime' => 9, 'utime' => 10, 'lptime' => 11, 'md5' => 12, 'track_title' => 13, 'artist_name' => 14, 'bit_rate' => 15, 'sample_rate' => 16, 'format' => 17, 'length' => 18, 'album_title' => 19, 'genre' => 20, 'comments' => 21, 'year' => 22, 'track_number' => 23, 'channels' => 24, 'url' => 25, 'bpm' => 26, 'rating' => 27, 'encoded_by' => 28, 'disc_number' => 29, 'mood' => 30, 'label' => 31, 'composer' => 32, 'encoder' => 33, 'checksum' => 34, 'lyrics' => 35, 'orchestra' => 36, 'conductor' => 37, 'lyricist' => 38, 'original_lyricist' => 39, 'radio_station_name' => 40, 'info_url' => 41, 'artist_url' => 42, 'audio_source_url' => 43, 'radio_station_url' => 44, 'buy_this_url' => 45, 'isrc_number' => 46, 'catalog_number' => 47, 'original_artist' => 48, 'copyright' => 49, 'report_datetime' => 50, 'report_location' => 51, 'report_organization' => 52, 'subject' => 53, 'contributor' => 54, 'language' => 55, 'file_exists' => 56, 'soundcloud_id' => 57, 'soundcloud_error_code' => 58, 'soundcloud_error_msg' => 59, 'soundcloud_link_to_file' => 60, 'soundcloud_upload_time' => 61, 'replay_gain' => 62, 'owner_id' => 63, 'cuein' => 64, 'cueout' => 65, 'silan_check' => 66, 'hidden' => 67, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbMime' => 2, 'DbFtype' => 3, 'DbDirectory' => 4, 'DbFilepath' => 5, 'DbState' => 6, 'DbCurrentlyaccessing' => 7, 'DbEditedby' => 8, 'DbMtime' => 9, 'DbUtime' => 10, 'DbLPtime' => 11, 'DbMd5' => 12, 'DbTrackTitle' => 13, 'DbArtistName' => 14, 'DbBitRate' => 15, 'DbSampleRate' => 16, 'DbFormat' => 17, 'DbLength' => 18, 'DbAlbumTitle' => 19, 'DbGenre' => 20, 'DbComments' => 21, 'DbYear' => 22, 'DbTrackNumber' => 23, 'DbChannels' => 24, 'DbUrl' => 25, 'DbBpm' => 26, 'DbRating' => 27, 'DbEncodedBy' => 28, 'DbDiscNumber' => 29, 'DbMood' => 30, 'DbLabel' => 31, 'DbComposer' => 32, 'DbEncoder' => 33, 'DbChecksum' => 34, 'DbLyrics' => 35, 'DbOrchestra' => 36, 'DbConductor' => 37, 'DbLyricist' => 38, 'DbOriginalLyricist' => 39, 'DbRadioStationName' => 40, 'DbInfoUrl' => 41, 'DbArtistUrl' => 42, 'DbAudioSourceUrl' => 43, 'DbRadioStationUrl' => 44, 'DbBuyThisUrl' => 45, 'DbIsrcNumber' => 46, 'DbCatalogNumber' => 47, 'DbOriginalArtist' => 48, 'DbCopyright' => 49, 'DbReportDatetime' => 50, 'DbReportLocation' => 51, 'DbReportOrganization' => 52, 'DbSubject' => 53, 'DbContributor' => 54, 'DbLanguage' => 55, 'DbFileExists' => 56, 'DbSoundcloudId' => 57, 'DbSoundcloudErrorCode' => 58, 'DbSoundcloudErrorMsg' => 59, 'DbSoundcloudLinkToFile' => 60, 'DbSoundCloundUploadTime' => 61, 'DbReplayGain' => 62, 'DbOwnerId' => 63, 'DbCuein' => 64, 'DbCueout' => 65, 'DbSilanCheck' => 66, 'DbHidden' => 67, 'DbIsScheduled' => 68, 'DbIsPlaylist' => 69, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbMime' => 2, 'dbFtype' => 3, 'dbDirectory' => 4, 'dbFilepath' => 5, 'dbState' => 6, 'dbCurrentlyaccessing' => 7, 'dbEditedby' => 8, 'dbMtime' => 9, 'dbUtime' => 10, 'dbLPtime' => 11, 'dbMd5' => 12, 'dbTrackTitle' => 13, 'dbArtistName' => 14, 'dbBitRate' => 15, 'dbSampleRate' => 16, 'dbFormat' => 17, 'dbLength' => 18, 'dbAlbumTitle' => 19, 'dbGenre' => 20, 'dbComments' => 21, 'dbYear' => 22, 'dbTrackNumber' => 23, 'dbChannels' => 24, 'dbUrl' => 25, 'dbBpm' => 26, 'dbRating' => 27, 'dbEncodedBy' => 28, 'dbDiscNumber' => 29, 'dbMood' => 30, 'dbLabel' => 31, 'dbComposer' => 32, 'dbEncoder' => 33, 'dbChecksum' => 34, 'dbLyrics' => 35, 'dbOrchestra' => 36, 'dbConductor' => 37, 'dbLyricist' => 38, 'dbOriginalLyricist' => 39, 'dbRadioStationName' => 40, 'dbInfoUrl' => 41, 'dbArtistUrl' => 42, 'dbAudioSourceUrl' => 43, 'dbRadioStationUrl' => 44, 'dbBuyThisUrl' => 45, 'dbIsrcNumber' => 46, 'dbCatalogNumber' => 47, 'dbOriginalArtist' => 48, 'dbCopyright' => 49, 'dbReportDatetime' => 50, 'dbReportLocation' => 51, 'dbReportOrganization' => 52, 'dbSubject' => 53, 'dbContributor' => 54, 'dbLanguage' => 55, 'dbFileExists' => 56, 'dbSoundcloudId' => 57, 'dbSoundcloudErrorCode' => 58, 'dbSoundcloudErrorMsg' => 59, 'dbSoundcloudLinkToFile' => 60, 'dbSoundCloundUploadTime' => 61, 'dbReplayGain' => 62, 'dbOwnerId' => 63, 'dbCuein' => 64, 'dbCueout' => 65, 'dbSilanCheck' => 66, 'dbHidden' => 67, 'dbIsScheduled' => 68, 'dbIsPlaylist' => 69, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::MIME => 2, self::FTYPE => 3, self::DIRECTORY => 4, self::FILEPATH => 5, self::STATE => 6, self::CURRENTLYACCESSING => 7, self::EDITEDBY => 8, self::MTIME => 9, self::UTIME => 10, self::LPTIME => 11, self::MD5 => 12, self::TRACK_TITLE => 13, self::ARTIST_NAME => 14, self::BIT_RATE => 15, self::SAMPLE_RATE => 16, self::FORMAT => 17, self::LENGTH => 18, self::ALBUM_TITLE => 19, self::GENRE => 20, self::COMMENTS => 21, self::YEAR => 22, self::TRACK_NUMBER => 23, self::CHANNELS => 24, self::URL => 25, self::BPM => 26, self::RATING => 27, self::ENCODED_BY => 28, self::DISC_NUMBER => 29, self::MOOD => 30, self::LABEL => 31, self::COMPOSER => 32, self::ENCODER => 33, self::CHECKSUM => 34, self::LYRICS => 35, self::ORCHESTRA => 36, self::CONDUCTOR => 37, self::LYRICIST => 38, self::ORIGINAL_LYRICIST => 39, self::RADIO_STATION_NAME => 40, self::INFO_URL => 41, self::ARTIST_URL => 42, self::AUDIO_SOURCE_URL => 43, self::RADIO_STATION_URL => 44, self::BUY_THIS_URL => 45, self::ISRC_NUMBER => 46, self::CATALOG_NUMBER => 47, self::ORIGINAL_ARTIST => 48, self::COPYRIGHT => 49, self::REPORT_DATETIME => 50, self::REPORT_LOCATION => 51, self::REPORT_ORGANIZATION => 52, self::SUBJECT => 53, self::CONTRIBUTOR => 54, self::LANGUAGE => 55, self::FILE_EXISTS => 56, self::SOUNDCLOUD_ID => 57, self::SOUNDCLOUD_ERROR_CODE => 58, self::SOUNDCLOUD_ERROR_MSG => 59, self::SOUNDCLOUD_LINK_TO_FILE => 60, self::SOUNDCLOUD_UPLOAD_TIME => 61, self::REPLAY_GAIN => 62, self::OWNER_ID => 63, self::CUEIN => 64, self::CUEOUT => 65, self::SILAN_CHECK => 66, self::HIDDEN => 67, self::IS_SCHEDULED => 68, self::IS_PLAYLIST => 69, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'MIME' => 2, 'FTYPE' => 3, 'DIRECTORY' => 4, 'FILEPATH' => 5, 'STATE' => 6, 'CURRENTLYACCESSING' => 7, 'EDITEDBY' => 8, 'MTIME' => 9, 'UTIME' => 10, 'LPTIME' => 11, 'MD5' => 12, 'TRACK_TITLE' => 13, 'ARTIST_NAME' => 14, 'BIT_RATE' => 15, 'SAMPLE_RATE' => 16, 'FORMAT' => 17, 'LENGTH' => 18, 'ALBUM_TITLE' => 19, 'GENRE' => 20, 'COMMENTS' => 21, 'YEAR' => 22, 'TRACK_NUMBER' => 23, 'CHANNELS' => 24, 'URL' => 25, 'BPM' => 26, 'RATING' => 27, 'ENCODED_BY' => 28, 'DISC_NUMBER' => 29, 'MOOD' => 30, 'LABEL' => 31, 'COMPOSER' => 32, 'ENCODER' => 33, 'CHECKSUM' => 34, 'LYRICS' => 35, 'ORCHESTRA' => 36, 'CONDUCTOR' => 37, 'LYRICIST' => 38, 'ORIGINAL_LYRICIST' => 39, 'RADIO_STATION_NAME' => 40, 'INFO_URL' => 41, 'ARTIST_URL' => 42, 'AUDIO_SOURCE_URL' => 43, 'RADIO_STATION_URL' => 44, 'BUY_THIS_URL' => 45, 'ISRC_NUMBER' => 46, 'CATALOG_NUMBER' => 47, 'ORIGINAL_ARTIST' => 48, 'COPYRIGHT' => 49, 'REPORT_DATETIME' => 50, 'REPORT_LOCATION' => 51, 'REPORT_ORGANIZATION' => 52, 'SUBJECT' => 53, 'CONTRIBUTOR' => 54, 'LANGUAGE' => 55, 'FILE_EXISTS' => 56, 'SOUNDCLOUD_ID' => 57, 'SOUNDCLOUD_ERROR_CODE' => 58, 'SOUNDCLOUD_ERROR_MSG' => 59, 'SOUNDCLOUD_LINK_TO_FILE' => 60, 'SOUNDCLOUD_UPLOAD_TIME' => 61, 'REPLAY_GAIN' => 62, 'OWNER_ID' => 63, 'CUEIN' => 64, 'CUEOUT' => 65, 'SILAN_CHECK' => 66, 'HIDDEN' => 67, 'IS_SCHEDULED' => 68, 'IS_PLAYLIST' => 69, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'mime' => 2, 'ftype' => 3, 'directory' => 4, 'filepath' => 5, 'state' => 6, 'currentlyaccessing' => 7, 'editedby' => 8, 'mtime' => 9, 'utime' => 10, 'lptime' => 11, 'md5' => 12, 'track_title' => 13, 'artist_name' => 14, 'bit_rate' => 15, 'sample_rate' => 16, 'format' => 17, 'length' => 18, 'album_title' => 19, 'genre' => 20, 'comments' => 21, 'year' => 22, 'track_number' => 23, 'channels' => 24, 'url' => 25, 'bpm' => 26, 'rating' => 27, 'encoded_by' => 28, 'disc_number' => 29, 'mood' => 30, 'label' => 31, 'composer' => 32, 'encoder' => 33, 'checksum' => 34, 'lyrics' => 35, 'orchestra' => 36, 'conductor' => 37, 'lyricist' => 38, 'original_lyricist' => 39, 'radio_station_name' => 40, 'info_url' => 41, 'artist_url' => 42, 'audio_source_url' => 43, 'radio_station_url' => 44, 'buy_this_url' => 45, 'isrc_number' => 46, 'catalog_number' => 47, 'original_artist' => 48, 'copyright' => 49, 'report_datetime' => 50, 'report_location' => 51, 'report_organization' => 52, 'subject' => 53, 'contributor' => 54, 'language' => 55, 'file_exists' => 56, 'soundcloud_id' => 57, 'soundcloud_error_code' => 58, 'soundcloud_error_msg' => 59, 'soundcloud_link_to_file' => 60, 'soundcloud_upload_time' => 61, 'replay_gain' => 62, 'owner_id' => 63, 'cuein' => 64, 'cueout' => 65, 'silan_check' => 66, 'hidden' => 67, 'is_scheduled' => 68, 'is_playlist' => 69, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, )
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -411,6 +417,8 @@ abstract class BaseCcFilesPeer {
|
|||
$criteria->addSelectColumn(CcFilesPeer::CUEOUT);
|
||||
$criteria->addSelectColumn(CcFilesPeer::SILAN_CHECK);
|
||||
$criteria->addSelectColumn(CcFilesPeer::HIDDEN);
|
||||
$criteria->addSelectColumn(CcFilesPeer::IS_SCHEDULED);
|
||||
$criteria->addSelectColumn(CcFilesPeer::IS_PLAYLIST);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.NAME');
|
||||
|
@ -480,6 +488,8 @@ abstract class BaseCcFilesPeer {
|
|||
$criteria->addSelectColumn($alias . '.CUEOUT');
|
||||
$criteria->addSelectColumn($alias . '.SILAN_CHECK');
|
||||
$criteria->addSelectColumn($alias . '.HIDDEN');
|
||||
$criteria->addSelectColumn($alias . '.IS_SCHEDULED');
|
||||
$criteria->addSelectColumn($alias . '.IS_PLAYLIST');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -74,6 +74,8 @@
|
|||
* @method CcFilesQuery orderByDbCueout($order = Criteria::ASC) Order by the cueout column
|
||||
* @method CcFilesQuery orderByDbSilanCheck($order = Criteria::ASC) Order by the silan_check column
|
||||
* @method CcFilesQuery orderByDbHidden($order = Criteria::ASC) Order by the hidden column
|
||||
* @method CcFilesQuery orderByDbIsScheduled($order = Criteria::ASC) Order by the is_scheduled column
|
||||
* @method CcFilesQuery orderByDbIsPlaylist($order = Criteria::ASC) Order by the is_playlist column
|
||||
*
|
||||
* @method CcFilesQuery groupByDbId() Group by the id column
|
||||
* @method CcFilesQuery groupByDbName() Group by the name column
|
||||
|
@ -143,6 +145,8 @@
|
|||
* @method CcFilesQuery groupByDbCueout() Group by the cueout column
|
||||
* @method CcFilesQuery groupByDbSilanCheck() Group by the silan_check column
|
||||
* @method CcFilesQuery groupByDbHidden() Group by the hidden column
|
||||
* @method CcFilesQuery groupByDbIsScheduled() Group by the is_scheduled column
|
||||
* @method CcFilesQuery groupByDbIsPlaylist() Group by the is_playlist column
|
||||
*
|
||||
* @method CcFilesQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method CcFilesQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
|
@ -247,6 +251,8 @@
|
|||
* @method CcFiles findOneByDbCueout(string $cueout) Return the first CcFiles filtered by the cueout column
|
||||
* @method CcFiles findOneByDbSilanCheck(boolean $silan_check) Return the first CcFiles filtered by the silan_check column
|
||||
* @method CcFiles findOneByDbHidden(boolean $hidden) Return the first CcFiles filtered by the hidden column
|
||||
* @method CcFiles findOneByDbIsScheduled(boolean $is_scheduled) Return the first CcFiles filtered by the is_scheduled column
|
||||
* @method CcFiles findOneByDbIsPlaylist(boolean $is_playlist) Return the first CcFiles filtered by the is_playlist column
|
||||
*
|
||||
* @method array findByDbId(int $id) Return CcFiles objects filtered by the id column
|
||||
* @method array findByDbName(string $name) Return CcFiles objects filtered by the name column
|
||||
|
@ -316,6 +322,8 @@
|
|||
* @method array findByDbCueout(string $cueout) Return CcFiles objects filtered by the cueout column
|
||||
* @method array findByDbSilanCheck(boolean $silan_check) Return CcFiles objects filtered by the silan_check column
|
||||
* @method array findByDbHidden(boolean $hidden) Return CcFiles objects filtered by the hidden column
|
||||
* @method array findByDbIsScheduled(boolean $is_scheduled) Return CcFiles objects filtered by the is_scheduled column
|
||||
* @method array findByDbIsPlaylist(boolean $is_playlist) Return CcFiles objects filtered by the is_playlist column
|
||||
*
|
||||
* @package propel.generator.airtime.om
|
||||
*/
|
||||
|
@ -2045,6 +2053,40 @@ abstract class BaseCcFilesQuery extends ModelCriteria
|
|||
return $this->addUsingAlias(CcFilesPeer::HIDDEN, $dbHidden, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the is_scheduled column
|
||||
*
|
||||
* @param boolean|string $dbIsScheduled The value to use as filter.
|
||||
* Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcFilesQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbIsScheduled($dbIsScheduled = null, $comparison = null)
|
||||
{
|
||||
if (is_string($dbIsScheduled)) {
|
||||
$is_scheduled = in_array(strtolower($dbIsScheduled), array('false', 'off', '-', 'no', 'n', '0')) ? false : true;
|
||||
}
|
||||
return $this->addUsingAlias(CcFilesPeer::IS_SCHEDULED, $dbIsScheduled, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the is_playlist column
|
||||
*
|
||||
* @param boolean|string $dbIsPlaylist The value to use as filter.
|
||||
* Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcFilesQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbIsPlaylist($dbIsPlaylist = null, $comparison = null)
|
||||
{
|
||||
if (is_string($dbIsPlaylist)) {
|
||||
$is_playlist = in_array(strtolower($dbIsPlaylist), array('false', 'off', '-', 'no', 'n', '0')) ? false : true;
|
||||
}
|
||||
return $this->addUsingAlias(CcFilesPeer::IS_PLAYLIST, $dbIsPlaylist, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcSubjs object
|
||||
*
|
||||
|
|
|
@ -77,14 +77,12 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
|
||||
/**
|
||||
* The value for the cue_in field.
|
||||
* Note: this column has a database default value of: '00:00:00'
|
||||
* @var string
|
||||
*/
|
||||
protected $cue_in;
|
||||
|
||||
/**
|
||||
* The value for the cue_out field.
|
||||
* Note: this column has a database default value of: '00:00:00'
|
||||
* @var string
|
||||
*/
|
||||
protected $cue_out;
|
||||
|
@ -161,8 +159,6 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
$this->clip_length = '00:00:00';
|
||||
$this->fade_in = '00:00:00';
|
||||
$this->fade_out = '00:00:00';
|
||||
$this->cue_in = '00:00:00';
|
||||
$this->cue_out = '00:00:00';
|
||||
$this->media_item_played = false;
|
||||
$this->playout_status = 1;
|
||||
$this->broadcasted = 0;
|
||||
|
@ -708,7 +704,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->cue_in !== $v || $this->isNew()) {
|
||||
if ($this->cue_in !== $v) {
|
||||
$this->cue_in = $v;
|
||||
$this->modifiedColumns[] = CcSchedulePeer::CUE_IN;
|
||||
}
|
||||
|
@ -728,7 +724,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->cue_out !== $v || $this->isNew()) {
|
||||
if ($this->cue_out !== $v) {
|
||||
$this->cue_out = $v;
|
||||
$this->modifiedColumns[] = CcSchedulePeer::CUE_OUT;
|
||||
}
|
||||
|
@ -842,14 +838,6 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
return false;
|
||||
}
|
||||
|
||||
if ($this->cue_in !== '00:00:00') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->cue_out !== '00:00:00') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->media_item_played !== false) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<h2><? echo sprintf(_("%s's Settings"), $this->currentUser) ?></h2>
|
||||
<h2><? echo sprintf(_("%s's Settings"), $this->escape($this->currentUser)) ?></h2>
|
||||
<div id="current-user-container">
|
||||
<form id="current-user-form" class="edit-user-global" method="post" enctype="application/x-www-form-urlencoded">
|
||||
<dl class="zend_form">
|
||||
|
@ -160,4 +160,4 @@
|
|||
<button type="submit" id="cu_save_user" class="btn btn-small right-floated"><?php echo _("Save")?></button>
|
||||
</dl>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<?php if($this->element->getElement('storageFolder')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('storageFolder')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<li><?php echo $this->escape($error); ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
@ -29,7 +29,7 @@
|
|||
<?php if($this->element->getElement('watchedFolder')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('watchedFolder')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<li><?php echo $this->escape($error); ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
@ -39,7 +39,7 @@
|
|||
<?php if (count($watched_dirs) > 0): ?>
|
||||
<?php foreach($watched_dirs as $watched_dir): ?>
|
||||
<dd class="block-display selected-item">
|
||||
<?php echo ($watched_dir->getExistsFlag())?"":"<span class='ui-icon-alert'><img src='/css/images/warning-icon.png'></span>"?><span id="folderPath" style="display:block; width:350px"><?php echo $watched_dir->getDirectory();?></span></span>
|
||||
<?php echo ($watched_dir->getExistsFlag())?"":"<span class='ui-icon-alert'><img src='/css/images/warning-icon.png'></span>"?><span id="folderPath" style="display:block; width:350px"><?php echo htmlspecialchars($watched_dir->getDirectory());?></span></span>
|
||||
<span title="<?php echo _("Rescan watched directory (This is useful if it is network mount and may be out of sync with Airtime)")?>" class="ui-icon ui-icon-refresh"></span>
|
||||
<span title="<?php echo _("Remove watched directory")?>" class="ui-icon ui-icon-close"></span>
|
||||
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
<?php
|
||||
//XSS exploit prevention
|
||||
foreach ($this->md as $key => &$value) {
|
||||
$value = $this->escape($value);
|
||||
}
|
||||
?>
|
||||
<?php if($this->type == "audioclip") : ?>
|
||||
<table class='library-track-md'>
|
||||
<tr><td><? echo _("Title:"); ?></td><td><?php echo ($this->md["MDATA_KEY_TITLE"]);?></td></tr>
|
||||
|
@ -41,9 +47,18 @@
|
|||
<span class='static'>o</span> <span><? echo _("Static Smart Block"); ?></span><br />
|
||||
<span>o</span> <span><? echo _("Audio Track"); ?></span>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($this->type == "playlist" || ($this->type == "block" && $this->blType == "Static")) {?>
|
||||
<?php
|
||||
//XSS exploit prevention
|
||||
/*foreach ($this->contents as &$item) {
|
||||
foreach ($item as $key => &$value) {
|
||||
$value = $this->escape($value);
|
||||
}
|
||||
}*/
|
||||
?>
|
||||
<?php if ($this->type == "playlist") { ?>
|
||||
<div class='file-md-qtip-left'><span><? echo _("Playlist Contents: "); ?></span></div>
|
||||
<?php } else { ?>
|
||||
|
@ -88,9 +103,13 @@
|
|||
<?php } elseif ($this->blType == "Dynamic") { ?>
|
||||
<div class='file-md-qtip-left'><span><? echo _("Dynamic Smart Block Criteria: "); ?></span></div>
|
||||
<table class='library-get-file-md table-small'>
|
||||
<?php foreach ($this->contents["crit"] as $criterias) : ?>
|
||||
<?php foreach ($criterias as $crit ) : ?>
|
||||
<?php foreach ($this->contents["crit"] as &$criterias) : ?>
|
||||
<?php foreach ($criterias as &$crit ) : ?>
|
||||
<?php
|
||||
// XSS exploit prevention
|
||||
//$crit["value"] = htmlspecialchars($crit["value"]);
|
||||
//$crit["extra"] = htmlspecialchars($crit["extra"]);
|
||||
|
||||
$valMaxStrLen = 25;
|
||||
if (strlen($crit["value"]) > $valMaxStrLen) {
|
||||
$crit["value"] = substr($crit["value"], 0, 24)."...";
|
||||
|
|
|
@ -2,7 +2,14 @@
|
|||
<?php echo $this->render('library/library.phtml') ?>
|
||||
</div>
|
||||
|
||||
<div id="side_playlist" class="pl-content ui-widget ui-widget-content block-shadow omega-block padded" style="height:697px; width:720px;">
|
||||
<?php
|
||||
if ($this->showPlaylist) {
|
||||
$display = "";
|
||||
} else {
|
||||
$display = "display:none";
|
||||
}
|
||||
?>
|
||||
<div id="side_playlist" class="pl-content ui-widget ui-widget-content block-shadow omega-block padded" style="height:697px; width:720px;<?php echo $display?>">
|
||||
<?php if ($this->type == 'block') {
|
||||
echo $this->render('playlist/smart-block.phtml');
|
||||
} else if ($this->type == 'playlist') {
|
||||
|
|
|
@ -4,6 +4,7 @@ if (isset($this->obj)) {
|
|||
$count = count($contents);
|
||||
}
|
||||
?>
|
||||
<a href="#" class="close-round" id="lib_pl_close"></a>
|
||||
<div class="btn-toolbar spl-no-top-margin clearfix">
|
||||
<div class="btn-group pull-left">
|
||||
<button id="spl_new" class="btn dropdown-toggle" data-toggle="dropdown" aria-disabled="false">
|
||||
|
@ -16,6 +17,9 @@ if (isset($this->obj)) {
|
|||
</ul>
|
||||
</div>
|
||||
<?php if (isset($this->obj)) : ?>
|
||||
<div class='btn-group pull-right'>
|
||||
<button class="btn btn-inverse" title='<?php echo _("Empty playlist content") ?>' type="button" id="pl-bl-clear-content"><? echo _("Clear") ?></button>
|
||||
</div>
|
||||
<div class='btn-group pull-right'>
|
||||
<button class="btn btn-inverse" title='<?php echo _("Shuffle playlist") ?>' type="button" id="playlist_shuffle_button"><? echo _("Shuffle") ?></button>
|
||||
</div>
|
||||
|
@ -39,7 +43,7 @@ if (isset($this->obj)) {
|
|||
<input id='obj_type' type='hidden' value='playlist'></input>
|
||||
<div class="playlist_title">
|
||||
<h3 id="obj_name">
|
||||
<a id="playlist_name_display" contenteditable="true"><?php echo $this->obj->getName(); ?></a>
|
||||
<a id="playlist_name_display" contenteditable="true"><?php echo $this->escape($this->obj->getName()); ?></a>
|
||||
</h3>
|
||||
<h4 id="obj_length"><?php echo $this->length; ?></h4>
|
||||
</div>
|
||||
|
|
|
@ -4,6 +4,7 @@ if (isset($this->obj)) {
|
|||
$count = count($contents);
|
||||
}
|
||||
?>
|
||||
<a href="#" class="close-round" id="lib_pl_close"></a>
|
||||
<div class="btn-toolbar spl-no-top-margin clearfix">
|
||||
<div class="btn-group pull-left">
|
||||
<button id="spl_new" class="btn dropdown-toggle" data-toggle='dropdown' aria-disabled="false">
|
||||
|
@ -16,6 +17,9 @@ if (isset($this->obj)) {
|
|||
</ul>
|
||||
</div>
|
||||
<?php if (isset($this->obj)) : ?>
|
||||
<div class='btn-group pull-right'>
|
||||
<button class="btn btn-inverse" title='<?php echo _("Empty smart block content") ?>' type="button" id="pl-bl-clear-content"><? echo _("Clear") ?></button>
|
||||
</div>
|
||||
<div class='btn-group pull-right'>
|
||||
<button class="btn btn-inverse" title='Save smart block's title, description, and criteria' type="button" id="save_button"><? echo _("Save") ?></button>
|
||||
</div>
|
||||
|
@ -39,7 +43,7 @@ if (isset($this->obj)) {
|
|||
<a id="playlist_name_display" contenteditable="true">
|
||||
<?php
|
||||
if (isset($this->unsavedName)) echo $this->unsavedName;
|
||||
else echo $this->obj->getName();
|
||||
else echo $this->escape($this->obj->getName());
|
||||
?>
|
||||
</a>
|
||||
</h3>
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
<?php foreach($this->showContent as $row): ?>
|
||||
<tr id="au_<?php echo $row["item_id"] ?>" class="<?php if($i&1){echo "even";}else{echo "odd";}?>">
|
||||
<td><?php echo $row["starts"] ?></td>
|
||||
<td><?php echo $row["track_title"] ?></td>
|
||||
<td><?php echo $row["creator"] ?></td>
|
||||
<td><?php echo $row["album"] ?></td>
|
||||
<td><?php echo $this->escape($row["track_title"]) ?></td>
|
||||
<td><?php echo $this->escape($row["creator"]) ?></td>
|
||||
<td><?php echo $this->escape($row["album"]) ?></td>
|
||||
<td class="library_length"><?php echo $row["length"] ?></td>
|
||||
<td><?php echo $row["genre"] ?></td>
|
||||
</tr>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<a href="#" class="close-round" id="lib_pl_close"></a>
|
||||
<div class="btn-toolbar spl-no-top-margin clearfix">
|
||||
<div class="btn-group pull-left">
|
||||
<button id="ws_new" class="btn dropdown-toggle" data-toggle="dropdown" aria-disabled="false">
|
||||
|
@ -29,7 +30,7 @@
|
|||
<div class="playlist_title">
|
||||
<div id="name-error" class="errors" style="display:none;"></div>
|
||||
<h3 id="ws_name">
|
||||
<a id="playlist_name_display" contenteditable="true"><?php echo $this->obj->getName(); ?></a>
|
||||
<a id="playlist_name_display" contenteditable="true"><?php echo $this->escape($this->obj->getName()); ?></a>
|
||||
</h3>
|
||||
<h4 id="ws_length"><?php echo $this->obj->getDefaultLength(); ?></h4>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue