diff --git a/airtime_mvc/application/configs/ACL.php b/airtime_mvc/application/configs/ACL.php index b60f06a4d..6b44865ba 100644 --- a/airtime_mvc/application/configs/ACL.php +++ b/airtime_mvc/application/configs/ACL.php @@ -43,7 +43,7 @@ $ccAcl->allow('G', 'index') ->allow('A', 'playouthistory') ->allow('A', 'user') ->allow('A', 'systemstatus') - ->allow('A', 'preference', 'admin'); + ->allow('A', 'preference'); $aclPlugin = new Zend_Controller_Plugin_Acl($ccAcl); diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index c1a692c44..3b8ded301 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -136,9 +136,10 @@ class ApiController extends Zend_Controller_Action */ if (!$file_base_name) { $file_base_name = $full_path; - } - $file_base_name = substr($file_base_name, 1); - + } else { + $file_base_name = substr($file_base_name, 1); + } + // possibly use fileinfo module here in the future. // http://www.php.net/manual/en/book.fileinfo.php $ext = pathinfo($fileID, PATHINFO_EXTENSION); diff --git a/airtime_mvc/application/logging/Logging.php b/airtime_mvc/application/logging/Logging.php index 50e6b610e..bf9dbea92 100644 --- a/airtime_mvc/application/logging/Logging.php +++ b/airtime_mvc/application/logging/Logging.php @@ -35,14 +35,20 @@ class Logging { } public static function log($p_msg){ + $bt = debug_backtrace(); + $caller = array_shift($bt); + $logger = self::getLogger(); - $logger->info(self::toString($p_msg)); + $logger->info(self::toString($p_msg)." - file:".$caller['file'].":".$caller['line']); } public static function debug($p_msg){ + $bt = debug_backtrace(); + $caller = array_shift($bt); + if (defined('APPLICATION_ENV') && APPLICATION_ENV == "development"){ $logger = self::getLogger(); - $logger->debug(self::toString($p_msg)); + $logger->debug(self::toString($p_msg)." - file:".$caller['file'].":".$caller['line']); } } } diff --git a/airtime_mvc/application/models/ShowBuilder.php b/airtime_mvc/application/models/ShowBuilder.php index 07c6d4290..650734e2d 100644 --- a/airtime_mvc/application/models/ShowBuilder.php +++ b/airtime_mvc/application/models/ShowBuilder.php @@ -221,7 +221,6 @@ class Application_Model_ShowBuilder { $row["title"] = $p_item["show_name"]; $row["instance"] = intval($p_item["si_id"]); $row["image"] = ''; - $row["id"] = -1; $this->getScheduledStatus($startsEpoch, $endsEpoch, $row); @@ -311,7 +310,6 @@ class Application_Model_ShowBuilder { $row = $this->defaultRowArray; $row["footer"] = true; $row["instance"] = intval($p_item["si_id"]); - $row["id"] = -1; $this->getRowTimestamp($p_item, $row); $showEndDT = new DateTime($p_item["si_ends"], new DateTimeZone("UTC")); diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js index 434a34d02..c5fea6993 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js @@ -589,7 +589,7 @@ var AIRTIME = (function(AIRTIME){ $nRow.addClass("sb-future"); } - if (aData.allowed !== true || aData.header === true) { + if (aData.allowed !== true) { $nRow.addClass("sb-not-allowed"); } else { @@ -679,7 +679,15 @@ var AIRTIME = (function(AIRTIME){ //re-highlight selected cursors before draw took place for (i = 0; i < cursorIds.length; i++) { $tr = $table.find("tr[id="+cursorIds[i]+"][si_id="+showInstanceIds[i]+"]"); - mod.selectCursor($tr); + + /* If the currently playing track's cursor is selected, + * and that track is deleted, the cursor position becomes + * unavailble. We have to check the position is available + * before re-highlighting it. + */ + if ($tr.find(".sb-checkbox").children().hasClass("innerWrapper")) { + mod.selectCursor($tr); + } } //if there is only 1 cursor on the page highlight it by default. @@ -894,7 +902,7 @@ var AIRTIME = (function(AIRTIME){ return draggingContainer; }, - items: 'tr:not(:first, :last, .sb-header, .sb-not-allowed, .sb-past, .sb-now-playing)', + items: 'tr:not(:first, :last, .sb-header, .sb-not-allowed, .sb-past, .sb-now-playing, .sb-empty)', cancel: '.sb-footer', receive: fnReceive, update: fnUpdate, diff --git a/python_apps/pypo/pypofetch.py b/python_apps/pypo/pypofetch.py index c62c6ca57..4e2cfaf29 100644 --- a/python_apps/pypo/pypofetch.py +++ b/python_apps/pypo/pypofetch.py @@ -497,16 +497,15 @@ class PypoFetch(Thread): self.handle_message(message) except Empty, e: self.logger.info("Queue timeout. Fetching schedule manually") + success, self.schedule_data = self.api_client.get_schedule() + if success: + self.process_schedule(self.schedule_data) except Exception, e: import traceback top = traceback.format_exc() self.logger.error('Exception: %s', e) self.logger.error("traceback: %s", top) - success, self.schedule_data = self.api_client.get_schedule() - if success: - self.process_schedule(self.schedule_data) - loops += 1 def run(self):