From 5fd75d9eb768e893459fc928e77de4486bf46cf4 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 1 Oct 2012 15:30:02 +0100 Subject: [PATCH 01/71] CC-4507: Tweak CSS to make more room for metadata in Master Panel --- airtime_mvc/public/css/masterpanel.css | 4 ++-- airtime_mvc/public/css/styles.css | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/airtime_mvc/public/css/masterpanel.css b/airtime_mvc/public/css/masterpanel.css index f11bb3f4c..58aa8326f 100644 --- a/airtime_mvc/public/css/masterpanel.css +++ b/airtime_mvc/public/css/masterpanel.css @@ -312,7 +312,7 @@ margin-right:0; text-align:right !important; background-position:0 0; - padding: 0 14px 0 10px; + padding: 0 10px 0 10px; } .time-info-block li, .time-info-block li.time { text-align: right; @@ -351,4 +351,4 @@ background:#D40000 } -*/ \ No newline at end of file +*/ diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index 1fd84ac09..c8f04f897 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -180,11 +180,11 @@ select { color:#ff5d1a; } .now-playing-block { - width:30%; - padding-left:20px; + width:35%; + padding-left:10px; } .show-block { - width:18%; + width:30%; } .text-row { height:30px; @@ -259,7 +259,6 @@ select { } .time-info-block { padding:0 14px 0 2px; - background:url(images/masterpanel_spacer.png) no-repeat right 0; min-width:105px; } .time-info-block ul { From a1d650b3dcd6141c119302199444324d0e13a6e0 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 3 Oct 2012 18:26:22 +0200 Subject: [PATCH 02/71] CC-4486: Library -> Advanced Search: Alignment is off sometimes small CSS fix --- airtime_mvc/public/css/bootstrap.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/public/css/bootstrap.css b/airtime_mvc/public/css/bootstrap.css index 792fc9d72..bf5466865 100644 --- a/airtime_mvc/public/css/bootstrap.css +++ b/airtime_mvc/public/css/bootstrap.css @@ -2688,7 +2688,7 @@ fieldset .btn-toolbar { box-sizing: border-box; } .form-horizontal .controls input[type="text"]:only-child { - width:90%; + width:85%; } From c5942f109adb9cb50bcbc044c75bdfed34a3f89b Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 8 Oct 2012 12:47:18 +0100 Subject: [PATCH 03/71] Reformat debian/control dependencies into alphabetical order --- debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 6e9ae3dee..853ebc6d2 100644 --- a/debian/control +++ b/debian/control @@ -10,6 +10,7 @@ Package: airtime Architecture: all Pre-Depends: postgresql, python-virtualenv (>= 1.4.9) Depends: apache2, + coreutils (>= 7.5) | timeout, curl, ecasound, gzip (>= 1.3.12), @@ -36,13 +37,12 @@ Depends: apache2, php5-gd, php-pear, php5-pgsql, - python, pwgen, + python, rabbitmq-server, sudo, sysv-rc, tar (>= 1.22), - coreutils (>= 7.5) | timeout, unzip, vorbis-tools, zendframework | libzend-framework-php, From d32495d100ad3fda91de3f39abef6b54b9dac362 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 19 Oct 2012 11:09:34 -0400 Subject: [PATCH 04/71] CC-2184: Hardcoded CSS path should be relative path instead --- airtime_mvc/application/Bootstrap.php | 48 ++++- airtime_mvc/application/common/OsPath.php | 7 + .../controllers/AudiopreviewController.php | 16 +- .../controllers/DashboardController.php | 5 +- .../controllers/LibraryController.php | 23 +- .../controllers/LoginController.php | 14 +- .../controllers/PlayouthistoryController.php | 6 +- .../controllers/PluploadController.php | 3 +- .../controllers/PreferenceController.php | 24 ++- .../controllers/ScheduleController.php | 5 +- .../controllers/ShowbuilderController.php | 19 +- .../controllers/SystemstatusController.php | 3 +- .../controllers/UserController.php | 2 +- airtime_mvc/application/forms/EditAudioMD.php | 3 +- airtime_mvc/application/forms/Preferences.php | 4 +- .../application/layouts/scripts/layout.phtml | 3 +- airtime_mvc/application/models/Preference.php | 3 +- airtime_mvc/application/models/StoredFile.php | 12 +- .../views/scripts/dashboard/help.phtml | 2 +- .../views/scripts/form/add-show-when.phtml | 2 +- .../views/scripts/library/library.phtml | 5 +- .../views/scripts/preference/index.phtml | 3 +- .../scripts/preference/stream-setting.phtml | 3 +- .../scripts/preference/support-setting.phtml | 3 +- airtime_mvc/build/airtime.conf | 1 + airtime_mvc/public/.htaccess | 3 +- airtime_mvc/public/css/styles.css | 12 +- .../airtime/audiopreview/preview_jplayer.js | 11 +- .../public/js/airtime/common/common.js | 10 +- .../public/js/airtime/dashboard/dashboard.js | 8 +- .../public/js/airtime/library/library.js | 22 +- .../public/js/airtime/library/plupload.js | 9 +- airtime_mvc/public/js/airtime/library/spl.js | 198 +++++++++--------- .../public/js/airtime/nowplaying/register.js | 6 +- .../js/airtime/playouthistory/historytable.js | 6 +- .../js/airtime/preferences/musicdirs.js | 16 +- .../js/airtime/preferences/streamsetting.js | 10 +- .../public/js/airtime/schedule/add-show.js | 10 +- .../schedule/full-calendar-functions.js | 22 +- .../public/js/airtime/schedule/schedule.js | 13 +- .../public/js/airtime/showbuilder/builder.js | 16 +- .../js/airtime/showbuilder/main_builder.js | 6 +- .../public/js/airtime/status/status.js | 2 +- airtime_mvc/public/js/airtime/user/user.js | 6 +- python_apps/api_clients/api_client.cfg | 3 +- python_apps/api_clients/api_client.py | 89 +++----- utils/airtime-check-system.php | 9 +- 47 files changed, 366 insertions(+), 340 deletions(-) diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php index c4c53ffa5..db868cff6 100644 --- a/airtime_mvc/application/Bootstrap.php +++ b/airtime_mvc/application/Bootstrap.php @@ -42,14 +42,34 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap $view = $this->getResource('view'); $view->doctype('XHTML1_STRICT'); } + + protected function _initGlobals() + { + $view = $this->getResource('view'); + $baseUrl = Application_Common_OsPath::getBaseDir(); + + $view->headScript()->appendScript("var baseUrl = '$baseUrl'"); + + $user = Application_Model_User::GetCurrentUser(); + if (!is_null($user)){ + $userType = $user->getType(); + } else { + $userType = ""; + } + $view->headScript()->appendScript("var userType = '$userType';"); + + } protected function _initHeadLink() { global $CC_CONFIG; $view = $this->getResource('view'); - $baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl(); + $baseUrl = Application_Common_OsPath::getBaseDir(); + + $CC_CONFIG['base_dir'] = $baseUrl; + $view->headLink()->appendStylesheet($baseUrl.'/css/redmond/jquery-ui-1.8.8.custom.css?'.$CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl.'/css/pro_dropdown_3.css?'.$CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl.'/css/qtip/jquery.qtip.min.css?'.$CC_CONFIG['airtime_version']); @@ -63,17 +83,18 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap global $CC_CONFIG; $view = $this->getResource('view'); - $baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl(); - - $view->headScript()->appendFile($baseUrl.'/js/libs/jquery-1.7.2.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); - $view->headScript()->appendFile($baseUrl.'/js/libs/jquery-ui-1.8.18.custom.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); - $view->headScript()->appendFile($baseUrl.'/js/libs/jquery.stickyPanel.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); - $view->headScript()->appendFile($baseUrl.'/js/qtip/jquery.qtip.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); + + $baseUrl = Application_Common_OsPath::getBaseDir(); + + $view->headScript()->appendFile($baseUrl.'/js/libs/jquery-1.7.2.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $view->headScript()->appendFile($baseUrl.'/js/libs/jquery-ui-1.8.18.custom.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $view->headScript()->appendFile($baseUrl.'/js/libs/jquery.stickyPanel.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $view->headScript()->appendFile($baseUrl.'/js/qtip/jquery.qtip.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'/js/jplayer/jquery.jplayer.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); $view->headScript()->appendFile($baseUrl.'/js/sprintf/sprintf-0.7-beta1.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'/js/bootstrap/bootstrap.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); - $view->headScript()->appendScript("var baseUrl='$baseUrl/'"); - + $view->headScript()->appendScript("var baseUrl='$baseUrl'"); + //scripts for now playing bar $view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/helperfunctions.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/dashboard.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); @@ -96,6 +117,15 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) { $view->headScript()->appendFile($baseUrl.'/js/libs/google-analytics.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); } + + if (Application_Model_Preference::GetPlanLevel() != "disabled" + && !($_SERVER['REQUEST_URI'] == $baseUrl.'/Dashboard/stream-player' || + strncmp($_SERVER['REQUEST_URI'], $baseUrl.'/audiopreview/audio-preview', strlen($baseUrl.'/audiopreview/audio-preview'))==0)) { + $client_id = Application_Model_Preference::GetClientId(); + $view->headScript()->appendScript("var livechat_client_id = '$client_id';"); + $view->headScript()->appendFile($baseUrl . '/js/airtime/common/livechat.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); + } + } protected function _initViewHelpers() diff --git a/airtime_mvc/application/common/OsPath.php b/airtime_mvc/application/common/OsPath.php index d9d9b6eff..029d96f03 100644 --- a/airtime_mvc/application/common/OsPath.php +++ b/airtime_mvc/application/common/OsPath.php @@ -63,4 +63,11 @@ class Application_Common_OsPath{ return join(DIRECTORY_SEPARATOR, $paths); } + + public static function getBaseDir() { + $baseUrl = dirname($_SERVER['SCRIPT_NAME']); + if (strcmp($baseUrl, '/') ==0) $baseUrl = ""; + + return $baseUrl; + } } diff --git a/airtime_mvc/application/controllers/AudiopreviewController.php b/airtime_mvc/application/controllers/AudiopreviewController.php index bd7505595..d5103335c 100644 --- a/airtime_mvc/application/controllers/AudiopreviewController.php +++ b/airtime_mvc/application/controllers/AudiopreviewController.php @@ -26,8 +26,7 @@ class AudiopreviewController extends Zend_Controller_Action $audioFileTitle = $this->_getParam('audioFileTitle'); $type = $this->_getParam('type'); - $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); + $baseUrl = Application_Common_OsPath::getBaseDir(); $this->view->headScript()->appendFile( $baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'], @@ -79,8 +78,7 @@ class AudiopreviewController extends Zend_Controller_Action $playlistIndex = $this->_getParam('playlistIndex'); $playlistID = $this->_getParam('playlistID'); - $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); + $baseUrl = Application_Common_OsPath::getBaseDir(); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); @@ -106,8 +104,7 @@ class AudiopreviewController extends Zend_Controller_Action $blockIndex = $this->_getParam('blockIndex'); $blockId = $this->_getParam('blockId'); - $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); + $baseUrl = Application_Common_OsPath::getBaseDir(); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); @@ -232,8 +229,8 @@ class AudiopreviewController extends Zend_Controller_Action $showID = $this->_getParam('showID'); $showIndex = $this->_getParam('showIndex'); - $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); + $baseUrl = dirname($_SERVER['SCRIPT_NAME']); + if (strcmp($baseUrl, '/') ==0) $baseUrl = ""; $this->view->headScript()->appendFile($baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); @@ -258,6 +255,7 @@ class AudiopreviewController extends Zend_Controller_Action */ public function getShowAction() { + global $CC_CONFIG; // disable the view and the layout $this->view->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); @@ -297,7 +295,7 @@ class AudiopreviewController extends Zend_Controller_Action throw new Exception("Unknown file type: $mime"); } - $elementMap['uri'] = "/api/get-media/file/".$track['item_id']; + $elementMap['uri'] = $CC_CONFIG["base_dir"]."/api/get-media/file/".$track['item_id']; } else { $elementMap['uri'] = $track['filepath']; } diff --git a/airtime_mvc/application/controllers/DashboardController.php b/airtime_mvc/application/controllers/DashboardController.php index 9609a1ef8..1e693b08f 100644 --- a/airtime_mvc/application/controllers/DashboardController.php +++ b/airtime_mvc/application/controllers/DashboardController.php @@ -98,8 +98,7 @@ class DashboardController extends Zend_Controller_Action { global $CC_CONFIG; - $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); + $baseUrl = Application_Common_OsPath::getBaseDir(); $this->view->headLink()->appendStylesheet($baseUrl.'/js/jplayer/skin/jplayer.blue.monday.css?'.$CC_CONFIG['airtime_version']); $this->_helper->layout->setLayout('bare'); @@ -108,7 +107,7 @@ class DashboardController extends Zend_Controller_Action if ($logo) { $this->view->logo = "data:image/png;base64,$logo"; } else { - $this->view->logo = "$baseUrl/css/images/airtime_logo_jp.png"; + $this->view->logo = $baseUrl."/css/images/airtime_logo_jp.png"; } } diff --git a/airtime_mvc/application/controllers/LibraryController.php b/airtime_mvc/application/controllers/LibraryController.php index a1d0d245e..07c995f2f 100644 --- a/airtime_mvc/application/controllers/LibraryController.php +++ b/airtime_mvc/application/controllers/LibraryController.php @@ -26,7 +26,7 @@ class LibraryController extends Zend_Controller_Action global $CC_CONFIG; $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); + $baseUrl = Application_Common_OsPath::getBaseDir(); $this->view->headScript()->appendFile($baseUrl.'/js/blockui/jquery.blockUI.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); @@ -142,12 +142,14 @@ class LibraryController extends Zend_Controller_Action public function contextMenuAction() { + global $CC_CONFIG; $id = $this->_getParam('id'); $type = $this->_getParam('type'); //playlist||timeline $screen = $this->_getParam('screen'); - $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); + + $baseUrl = Application_Common_OsPath::getBaseDir(); + $menu = array(); $userInfo = Zend_Auth::getInstance()->getStorage()->read(); @@ -182,8 +184,8 @@ class LibraryController extends Zend_Controller_Action } } if ($isAdminOrPM) { - $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/library/delete"); - $menu["edit"] = array("name"=> "Edit Metadata", "icon" => "edit", "url" => "/library/edit-file-md/id/{$id}"); + $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $CC_CONFIG['base_dir']."/library/delete"); + $menu["edit"] = array("name"=> "Edit Metadata", "icon" => "edit", "url" => $CC_CONFIG['base_dir']."/library/edit-file-md/id/{$id}"); } $url = $file->getRelativeFileUrl($baseUrl).'/download/true'; @@ -208,8 +210,9 @@ class LibraryController extends Zend_Controller_Action $menu["edit"] = array("name"=> "Edit", "icon" => "edit"); } } + if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) { - $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/library/delete"); + $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $CC_CONFIG['base_dir']."/library/delete"); } } elseif ($type == "stream") { @@ -224,9 +227,9 @@ class LibraryController extends Zend_Controller_Action } if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) { if ($screen == "playlist") { - $menu["edit"] = array("name"=> "Edit", "icon" => "edit", "url" => "/library/edit-file-md/id/{$id}"); - } - $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/library/delete"); + $menu["edit"] = array("name"=> "Edit", "icon" => "edit", "url" => $CC_CONFIG['base_dir']."/library/edit-file-md/id/{$id}"); + } + $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $CC_CONFIG['base_dir']."/library/delete"); } } @@ -252,7 +255,7 @@ class LibraryController extends Zend_Controller_Action $text = "Upload to SoundCloud"; } - $menu["soundcloud"]["items"]["upload"] = array("name" => $text, "icon" => "soundcloud", "url" => "/library/upload-file-soundcloud/id/{$id}"); + $menu["soundcloud"]["items"]["upload"] = array("name" => $text, "icon" => "soundcloud", "url" => $CC_CONFIG['base_dir']."/library/upload-file-soundcloud/id/{$id}"); } if (empty($menu)) { diff --git a/airtime_mvc/application/controllers/LoginController.php b/airtime_mvc/application/controllers/LoginController.php index e3eeccca4..d4d66bf50 100644 --- a/airtime_mvc/application/controllers/LoginController.php +++ b/airtime_mvc/application/controllers/LoginController.php @@ -11,8 +11,12 @@ class LoginController extends Zend_Controller_Action public function indexAction() { global $CC_CONFIG; + + $request = $this->getRequest(); + + if (Zend_Auth::getInstance()->hasIdentity()) + { - if (Zend_Auth::getInstance()->hasIdentity()) { $this->_redirect('Showbuilder'); } @@ -20,8 +24,8 @@ class LoginController extends Zend_Controller_Action $this->_helper->layout->setLayout('login'); $error = false; - $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); + + $baseUrl = Application_Common_OsPath::getBaseDir(); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/login/login.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); @@ -96,8 +100,8 @@ class LoginController extends Zend_Controller_Action { global $CC_CONFIG; - $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); + $baseUrl = Application_Common_OsPath::getBaseDir(); + $this->view->headScript()->appendFile($baseUrl.'/js/airtime/login/password-restore.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); if (!Application_Model_Preference::GetEnableSystemEmail()) { diff --git a/airtime_mvc/application/controllers/PlayouthistoryController.php b/airtime_mvc/application/controllers/PlayouthistoryController.php index 7a046da9b..39a518922 100644 --- a/airtime_mvc/application/controllers/PlayouthistoryController.php +++ b/airtime_mvc/application/controllers/PlayouthistoryController.php @@ -8,14 +8,15 @@ class PlayouthistoryController extends Zend_Controller_Action $ajaxContext ->addActionContext('playout-history-feed', 'json') ->initContext(); - } + } public function indexAction() { global $CC_CONFIG; $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); + + $baseUrl = Application_Common_OsPath::getBaseDir(); //default time is the last 24 hours. $now = time(); @@ -81,4 +82,5 @@ class PlayouthistoryController extends Zend_Controller_Action $this->view->iTotalRecords = $r["iTotalRecords"]; $this->view->history = $r["history"]; } + } diff --git a/airtime_mvc/application/controllers/PluploadController.php b/airtime_mvc/application/controllers/PluploadController.php index 271cda4e9..64de111d2 100644 --- a/airtime_mvc/application/controllers/PluploadController.php +++ b/airtime_mvc/application/controllers/PluploadController.php @@ -15,8 +15,7 @@ class PluploadController extends Zend_Controller_Action { global $CC_CONFIG; - $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); + $baseUrl = Application_Common_OsPath::getBaseDir(); $this->view->headScript()->appendFile($baseUrl.'/js/plupload/plupload.full.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/plupload/jquery.plupload.queue.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php index 49ce2a4a1..91a0021f4 100644 --- a/airtime_mvc/application/controllers/PreferenceController.php +++ b/airtime_mvc/application/controllers/PreferenceController.php @@ -21,11 +21,12 @@ class PreferenceController extends Zend_Controller_Action public function indexAction() { global $CC_CONFIG; - - $isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true; - + $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); + + $isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true; + + $baseUrl = Application_Common_OsPath::getBaseDir(); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/preferences.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->statusMsg = ""; @@ -72,9 +73,11 @@ class PreferenceController extends Zend_Controller_Action public function supportSettingAction() { global $CC_CONFIG; - + $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); + + $baseUrl = Application_Common_OsPath::getBaseDir(); + Logging::info($baseUrl); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/support-setting.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->statusMsg = ""; @@ -133,9 +136,9 @@ class PreferenceController extends Zend_Controller_Action { global $CC_CONFIG; - if (Application_Model_Preference::GetPlanLevel() == 'disabled') { - $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); + if(Application_Model_Preference::GetPlanLevel() == 'disabled'){ + + $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'); @@ -151,7 +154,8 @@ class PreferenceController extends Zend_Controller_Action global $CC_CONFIG; $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); + + $baseUrl = Application_Common_OsPath::getBaseDir(); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/streamsetting.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index adf84380e..a8b5b557c 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -784,7 +784,10 @@ class ScheduleController extends Zend_Controller_Action if ($success) { $scheduler = new Application_Model_Scheduler(); - $scheduler->removeGaps($data['add_show_instance_id']); + $showInstances = CcShowInstancesQuery::create()->filterByDbShowId($data['add_show_id'])->find(); + foreach ($showInstances as $si) { + $scheduler->removeGaps($si->getDbId()); + } $this->view->addNewShow = true; $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); } else { diff --git a/airtime_mvc/application/controllers/ShowbuilderController.php b/airtime_mvc/application/controllers/ShowbuilderController.php index 23c3fd55b..9c4b8e750 100644 --- a/airtime_mvc/application/controllers/ShowbuilderController.php +++ b/airtime_mvc/application/controllers/ShowbuilderController.php @@ -18,12 +18,14 @@ class ShowbuilderController extends Zend_Controller_Action public function indexAction() { + global $CC_CONFIG; - + $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); - $user = Application_Model_User::getCurrentUser(); - + + $baseUrl = Application_Common_OsPath::getBaseDir(); + + $user = Application_Model_User::GetCurrentUser(); $userType = $user->getType(); $this->view->headScript()->appendScript("localStorage.setItem( 'user-type', '$userType' );"); @@ -42,7 +44,7 @@ class ShowbuilderController extends Zend_Controller_Action } else { $this->view->headScript()->appendScript("localStorage.setItem( 'datatables-timeline', '' );"); } - + $this->view->headScript()->appendFile($baseUrl.'/js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.pluginAPI.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); @@ -62,8 +64,7 @@ class ShowbuilderController extends Zend_Controller_Action $this->view->headLink()->appendStylesheet($baseUrl.'/css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']); $this->view->headLink()->appendStylesheet($baseUrl.'/css/datatables/css/ColReorder.css?'.$CC_CONFIG['airtime_version']); - $this->view->headScript()->appendFile($this->view->baseUrl('/js/airtime/library/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version']),'text/javascript'); - + $this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $refer_sses = new Zend_Session_Namespace('referrer'); if ($request->isPost()) { @@ -173,6 +174,8 @@ class ShowbuilderController extends Zend_Controller_Action public function contextMenuAction() { + global $CC_CONFIG; + $id = $this->_getParam('id'); $now = floatval(microtime(true)); @@ -192,7 +195,7 @@ class ShowbuilderController extends Zend_Controller_Action if ($now < floatval($item->getDbEnds("U.u")) && $user->canSchedule($instance->getDbShowId())) { //remove/truncate the item from the schedule - $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/showbuilder/schedule-remove"); + $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $CC_CONFIG['base_dir']."/showbuilder/schedule-remove"); } $this->view->items = $menu; diff --git a/airtime_mvc/application/controllers/SystemstatusController.php b/airtime_mvc/application/controllers/SystemstatusController.php index aa2400f41..6032128f9 100644 --- a/airtime_mvc/application/controllers/SystemstatusController.php +++ b/airtime_mvc/application/controllers/SystemstatusController.php @@ -6,8 +6,7 @@ class SystemstatusController extends Zend_Controller_Action { global $CC_CONFIG; - $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); + $baseUrl = Application_Common_OsPath::getBaseDir(); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/status/status.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); } diff --git a/airtime_mvc/application/controllers/UserController.php b/airtime_mvc/application/controllers/UserController.php index 9c09ceecb..4447f0acc 100644 --- a/airtime_mvc/application/controllers/UserController.php +++ b/airtime_mvc/application/controllers/UserController.php @@ -18,7 +18,7 @@ class UserController extends Zend_Controller_Action global $CC_CONFIG; $request = $this->getRequest(); - $baseUrl = $request->getBaseUrl(); + $baseUrl = Application_Common_OsPath::getBaseDir(); $js_files = array( '/js/datatables/js/jquery.dataTables.js?', diff --git a/airtime_mvc/application/forms/EditAudioMD.php b/airtime_mvc/application/forms/EditAudioMD.php index ba7b1c4ef..e067b00a0 100644 --- a/airtime_mvc/application/forms/EditAudioMD.php +++ b/airtime_mvc/application/forms/EditAudioMD.php @@ -4,6 +4,7 @@ class Application_Form_EditAudioMD extends Zend_Form { public function init() { + global $CC_CONFIG; // Set the method for the display form to POST $this->setMethod('post'); @@ -137,7 +138,7 @@ class Application_Form_EditAudioMD extends Zend_Form 'ignore' => true, 'class' => 'btn md-cancel', 'label' => 'Cancel', - 'onclick' => 'javascript:document.location.href = "/Library"', + 'onclick' => 'javascript:document.location.href="'.$CC_CONFIG['base_dir'].'/Library"', 'decorators' => array( 'ViewHelper' ) diff --git a/airtime_mvc/application/forms/Preferences.php b/airtime_mvc/application/forms/Preferences.php index 878abe7f9..125cca392 100644 --- a/airtime_mvc/application/forms/Preferences.php +++ b/airtime_mvc/application/forms/Preferences.php @@ -6,7 +6,9 @@ class Application_Form_Preferences extends Zend_Form public function init() { - $this->setAction('/Preference'); + global $CC_CONFIG; + + $this->setAction($CC_CONFIG['base_dir'] . '/Preference'); $this->setMethod('post'); $isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true; diff --git a/airtime_mvc/application/layouts/scripts/layout.phtml b/airtime_mvc/application/layouts/scripts/layout.phtml index de43830b4..90e13246c 100644 --- a/airtime_mvc/application/layouts/scripts/layout.phtml +++ b/airtime_mvc/application/layouts/scripts/layout.phtml @@ -6,6 +6,7 @@ headScript() ?> headLink() ?> google_analytics)?$this->google_analytics:"" ?> + @@ -22,7 +23,7 @@ $this->navigation()->menu()->setPartial($partial); ?>
diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 8f08e385e..0cd058d41 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -500,6 +500,7 @@ class Application_Model_Preference } else { $outputArray['NUM_SOUNDCLOUD_TRACKS_UPLOADED'] = NULL; } + $outputArray['STATION_NAME'] = self::GetStationName(); $outputArray['PHONE'] = self::GetPhone(); $outputArray['EMAIL'] = self::GetEmail(); @@ -513,7 +514,7 @@ class Application_Model_Preference $url = $systemInfoArray["AIRTIME_VERSION_URL"]; $index = strpos($url,'/api/'); $url = substr($url, 0, $index); - + $headerInfo = get_headers(trim($url),1); $outputArray['WEB_SERVER'] = $headerInfo['Server'][0]; } diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index cd75da2d1..2529bd34e 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -599,6 +599,7 @@ SQL; return $res; } + public static function getLibraryColumns() { return array("id", "track_title", "artist_name", "album_title", @@ -609,9 +610,10 @@ SQL; "conductor", "replay_gain", "lptime" ); } - public static function searchLibraryFiles($datatables) { + global $CC_CONFIG; + $con = Propel::getConnection(CcFilesPeer::DATABASE_NAME); $displayColumns = self::getLibraryColumns(); @@ -766,14 +768,14 @@ SQL; // ugly if ($type == "au") { $row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION); - $row['image'] = ''; + $row['image'] = ''; } elseif ($type == "pl") { - $row['image'] = ''; + $row['image'] = ''; } elseif ($type == "st") { $row['audioFile'] = $row['id']; - $row['image'] = ''; + $row['image'] = ''; } elseif ($type == "bl") { - $row['image'] = ''; + $row['image'] = ''; } } diff --git a/airtime_mvc/application/views/scripts/dashboard/help.phtml b/airtime_mvc/application/views/scripts/dashboard/help.phtml index 0ac5f80dc..3e5d68553 100644 --- a/airtime_mvc/application/views/scripts/dashboard/help.phtml +++ b/airtime_mvc/application/views/scripts/dashboard/help.phtml @@ -1,4 +1,4 @@ - +

Welcome to Airtime!

Here's how you can get started using Airtime to automate your broadcasts:

diff --git a/airtime_mvc/application/views/scripts/form/add-show-when.phtml b/airtime_mvc/application/views/scripts/form/add-show-when.phtml index 48a420758..3a4d3f99d 100644 --- a/airtime_mvc/application/views/scripts/form/add-show-when.phtml +++ b/airtime_mvc/application/views/scripts/form/add-show-when.phtml @@ -46,7 +46,7 @@
element->getElement('add_show_duration') ?> - +
element->getElement('add_show_duration')->hasErrors()){ ?>