From 67ac4340c4e7963253ba1dc7199b35ddc53d32bd Mon Sep 17 00:00:00 2001 From: denise Date: Thu, 18 Oct 2012 14:47:19 -0400 Subject: [PATCH 01/14] CC-4596: Too many ajax calls in Calendar page -fixed --- .../public/js/airtime/schedule/full-calendar-functions.js | 1 - 1 file changed, 1 deletion(-) diff --git a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js index f583f4df7..a9cd82be3 100644 --- a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js +++ b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js @@ -206,7 +206,6 @@ function viewDisplay( view ) { } function eventRender(event, element, view) { - getCurrentShow(); $(element).data("event", event); From 6727bce3281ec0e3e11d5f0f47466105f413144f Mon Sep 17 00:00:00 2001 From: denise Date: Thu, 18 Oct 2012 15:03:59 -0400 Subject: [PATCH 02/14] CC-4598: Smart block: cannot save dynamic block with 0.5 hours -fixed --- airtime_mvc/application/models/Block.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/models/Block.php b/airtime_mvc/application/models/Block.php index 4d62b8329..eb1aab691 100644 --- a/airtime_mvc/application/models/Block.php +++ b/airtime_mvc/application/models/Block.php @@ -319,12 +319,12 @@ SQL; if ($mins >59) { $hour = intval($mins/60); $hour = str_pad($hour, 2, "0", STR_PAD_LEFT); - $value = $mins%60; + $mins = $mins%60; } } $hour = str_pad($hour, 2, "0", STR_PAD_LEFT); - $value = str_pad($value, 2, "0", STR_PAD_LEFT); - $length = $hour.":".$value.":00"; + $mins = str_pad($mins, 2, "0", STR_PAD_LEFT); + $length = $hour.":".$mins.":00"; } return $length; From e9815b617b66aa657e929d3b8f5f89382cc60b54 Mon Sep 17 00:00:00 2001 From: denise Date: Thu, 18 Oct 2012 15:21:38 -0400 Subject: [PATCH 03/14] - added comment --- .../public/js/airtime/schedule/full-calendar-functions.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js index a9cd82be3..ac57d6afb 100644 --- a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js +++ b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js @@ -370,7 +370,9 @@ function checkSCUploadStatus(){ }); }); } - +/** This function adds and removes the current + * show icon + */ function getCurrentShow(){ var url = '/Schedule/get-current-show/format/json', id, From d838d8ae30b77704e51b167e28de32aade57bc21 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Thu, 18 Oct 2012 17:34:37 -0400 Subject: [PATCH 04/14] update version number in VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 682777c6f..c7aac0e6d 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ PRODUCT_ID=Airtime -PRODUCT_RELEASE=2.1.3 +PRODUCT_RELEASE=2.2.0 From 58d00cb9b90aacbbde00d0b89e9f58df0dcde3ca Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Fri, 19 Oct 2012 11:05:12 -0400 Subject: [PATCH 05/14] Formatting sql --- .../application/models/ShowInstance.php | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/airtime_mvc/application/models/ShowInstance.php b/airtime_mvc/application/models/ShowInstance.php index 6a513aac4..3dfd8756f 100644 --- a/airtime_mvc/application/models/ShowInstance.php +++ b/airtime_mvc/application/models/ShowInstance.php @@ -670,15 +670,15 @@ SELECT * FROM ( (SELECT s.starts, 0::INTEGER as type , - f.id AS item_id, + f.id AS item_id, f.track_title, - f.album_title AS album, - f.genre AS genre, - f.length AS length, - f.artist_name AS creator, - f.file_exists AS EXISTS, - f.filepath AS filepath, - f.mime AS mime + f.album_title AS album, + f.genre AS genre, + f.length AS length, + f.artist_name AS creator, + f.file_exists AS EXISTS, + f.filepath AS filepath, + f.mime AS mime FROM cc_schedule AS s LEFT JOIN cc_files AS f ON f.id = s.file_id WHERE s.instance_id = :instance_id1 @@ -689,12 +689,12 @@ FROM ( 1::INTEGER as type, ws.id AS item_id, (ws.name || ': ' || ws.url) AS title, - null AS album, - null AS genre, - ws.length AS length, - sub.login AS creator, - 't'::boolean AS EXISTS, - ws.url AS filepath, + null AS album, + null AS genre, + ws.length AS length, + sub.login AS creator, + 't'::boolean AS EXISTS, + ws.url AS filepath, ws.mime as mime FROM cc_schedule AS s LEFT JOIN cc_webstream AS ws ON ws.id = s.stream_id From ffca5b42a89e7ffbf4725cdf0494c2847feffe2b Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 19 Oct 2012 11:07:37 -0400 Subject: [PATCH 06/14] CC-4605: Some AJAX calls are cached --- airtime_mvc/public/js/airtime/dashboard/dashboard.js | 2 +- airtime_mvc/public/js/airtime/library/library.js | 3 +++ airtime_mvc/public/js/airtime/nowplaying/register.js | 2 ++ .../public/js/airtime/playouthistory/historytable.js | 3 ++- airtime_mvc/public/js/airtime/schedule/schedule.js | 5 ++++- airtime_mvc/public/js/airtime/showbuilder/builder.js | 4 ++++ .../public/js/airtime/showbuilder/main_builder.js | 3 +++ airtime_mvc/public/js/airtime/user/user.js | 11 +++++++++-- 8 files changed, 28 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/public/js/airtime/dashboard/dashboard.js b/airtime_mvc/public/js/airtime/dashboard/dashboard.js index 98a167238..741c5b4fa 100644 --- a/airtime_mvc/public/js/airtime/dashboard/dashboard.js +++ b/airtime_mvc/public/js/airtime/dashboard/dashboard.js @@ -360,7 +360,7 @@ function controlSwitchLight(){ } function getScheduleFromServer(){ - $.ajax({ url: "/Schedule/get-current-playlist/format/json", dataType:"json", success:function(data){ + $.ajax({ cache: false, url: "/Schedule/get-current-playlist/format/json", dataType:"json", success:function(data){ parseItems(data.entries); parseSourceStatus(data.source_status); parseSwitchStatus(data.switch_status); diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index a832134c1..cfab12c6b 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -479,6 +479,7 @@ var AIRTIME = (function(AIRTIME) { "fnStateSave": function (oSettings, oData) { localStorage.setItem('datatables-library', JSON.stringify(oData)); $.ajax({ + cache: false, url: "/usersettings/set-library-datatable", type: "POST", data: {settings : oData, format: "json"}, @@ -542,6 +543,7 @@ var AIRTIME = (function(AIRTIME) { aoData.push( { name: "type", value: type} ); $.ajax( { + "cache": false, "dataType": 'json', "type": "POST", "url": sSource, @@ -883,6 +885,7 @@ var AIRTIME = (function(AIRTIME) { } request = $.ajax({ + cache: false, url: "/library/context-menu", type: "GET", data: {id : data.id, type: data.ftype, format: "json", "screen": screen}, diff --git a/airtime_mvc/public/js/airtime/nowplaying/register.js b/airtime_mvc/public/js/airtime/nowplaying/register.js index 0b5b04249..068f0d11a 100644 --- a/airtime_mvc/public/js/airtime/nowplaying/register.js +++ b/airtime_mvc/public/js/airtime/nowplaying/register.js @@ -21,6 +21,7 @@ $(document).ready(function(){ click: function() { var url = '/Usersettings/remindme'; $.ajax({ + cache: false, url: url, data: {format:"json"} }); @@ -34,6 +35,7 @@ $(document).ready(function(){ click: function() { var url ='/Usersettings/remindme-never'; $.ajax({ + cache: false, url: url, data: {format:"json"} }); diff --git a/airtime_mvc/public/js/airtime/playouthistory/historytable.js b/airtime_mvc/public/js/airtime/playouthistory/historytable.js index 9a0db2680..0371fada5 100644 --- a/airtime_mvc/public/js/airtime/playouthistory/historytable.js +++ b/airtime_mvc/public/js/airtime/playouthistory/historytable.js @@ -54,6 +54,7 @@ var AIRTIME = (function(AIRTIME) { aoData.push( { name: "format", value: "json"} ); $.ajax( { + "cache": false, "dataType": 'json', "type": "GET", "url": sSource, @@ -183,4 +184,4 @@ $(document).ready(function(){ oTable.fnDraw(); }); -}); \ No newline at end of file +}); diff --git a/airtime_mvc/public/js/airtime/schedule/schedule.js b/airtime_mvc/public/js/airtime/schedule/schedule.js index 5a43f1eb2..3bddc60f5 100644 --- a/airtime_mvc/public/js/airtime/schedule/schedule.js +++ b/airtime_mvc/public/js/airtime/schedule/schedule.js @@ -36,6 +36,7 @@ function confirmCancelShow(show_instance_id){ if (confirm('Cancel Current Show?')) { var url = "/Schedule/cancel-current-show"; $.ajax({ + cache: false, url: url, data: {format: "json", id: show_instance_id}, success: function(data){ @@ -50,6 +51,7 @@ function confirmCancelRecordedShow(show_instance_id){ var url = "/Schedule/cancel-current-show"; $.ajax({ url: url, + cache: false, data: {format: "json", id: show_instance_id}, success: function(data){ scheduleRefetchEvents(data); @@ -289,7 +291,7 @@ function alertShowErrorAndReload(){ } $(document).ready(function() { - $.ajax({ url: "/Api/calendar-init/format/json", dataType:"json", success:createFullCalendar + $.ajax({ cache: false, url: "/Api/calendar-init/format/json", dataType:"json", success:createFullCalendar , error:function(jqXHR, textStatus, errorThrown){}}); setInterval(checkCalendarSCUploadStatus, 5000); @@ -459,6 +461,7 @@ $(document).ready(function() { } $.ajax({ + cache: false, url: "/schedule/make-context-menu", type: "GET", data: {id : data.id, format: "json"}, diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js index 9839df06c..8bcfbdc4a 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js @@ -326,6 +326,7 @@ var AIRTIME = (function(AIRTIME){ } $.ajax({ + "cache": false, "dataType": "json", "type": "POST", "url": sSource, @@ -379,6 +380,7 @@ var AIRTIME = (function(AIRTIME){ localStorage.setItem('datatables-timeline', JSON.stringify(oData)); $.ajax({ + cache: false, url: "/usersettings/set-timeline-datatable", type: "POST", data: {settings : oData, format: "json"}, @@ -1003,6 +1005,7 @@ var AIRTIME = (function(AIRTIME){ if (confirm(msg)) { var url = "/Schedule/cancel-current-show"; $.ajax({ + cache: false, url: url, data: {format: "json", id: data.instance}, success: function(data){ @@ -1181,6 +1184,7 @@ var AIRTIME = (function(AIRTIME){ } request = $.ajax({ + cache: false, url: "/showbuilder/context-menu", type: "GET", data: {id : data.id, format: "json"}, diff --git a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js index b640a2882..60a224838 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js @@ -168,6 +168,7 @@ AIRTIME = (function(AIRTIME) { schedTable.fnDraw(); $.ajax({ + cache: false, url: "/usersettings/set-now-playing-screen-settings", type: "POST", data: {settings : {library : true}, format: "json"}, @@ -192,6 +193,7 @@ AIRTIME = (function(AIRTIME) { schedTable.fnDraw(); $.ajax({ + cache: false, url: "/usersettings/set-now-playing-screen-settings", type: "POST", data: {settings : {library : false}, format: "json"}, @@ -257,6 +259,7 @@ AIRTIME = (function(AIRTIME) { } $.ajax( { + "cache": false, "dataType": "json", "type": "GET", "url": "/showbuilder/check-builder-feed", diff --git a/airtime_mvc/public/js/airtime/user/user.js b/airtime_mvc/public/js/airtime/user/user.js index 5c8278914..a6ae9b3f8 100644 --- a/airtime_mvc/public/js/airtime/user/user.js +++ b/airtime_mvc/public/js/airtime/user/user.js @@ -24,13 +24,19 @@ function populateForm(entries){ } function rowClickCallback(row_id){ - $.ajax({ url: '/User/get-user-data/id/'+ row_id +'/format/json', dataType:"json", success:function(data){ + $.ajax({ cache: false, + url: '/User/get-user-data/id/'+ row_id +'/format/json', + dataType:"json", + success:function(data){ populateForm(data.entries); }}); } function removeUserCallback(row_id, nRow){ - $.ajax({ url: '/User/remove-user/id/'+ row_id +'/format/json', dataType:"text", success:function(data){ + $.ajax({ cache: false, + url: '/User/remove-user/id/'+ row_id +'/format/json', + dataType:"text", + success:function(data){ var o = $('#users_datatable').dataTable().fnDeleteRow(nRow); }}); } @@ -67,6 +73,7 @@ $(document).ready(function() { "sAjaxSource": "/User/get-user-data-table-info/format/json", "fnServerData": function ( sSource, aoData, fnCallback ) { $.ajax( { + "cache": false, "dataType": 'json', "type": "POST", "url": sSource, From d5c2c37a3eb26be60852833a1150122df1c0b6be Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 19 Oct 2012 11:16:42 -0400 Subject: [PATCH 07/14] Revert "CC-4605: Some AJAX calls are cached" This reverts commit ffca5b42a89e7ffbf4725cdf0494c2847feffe2b. --- airtime_mvc/public/js/airtime/dashboard/dashboard.js | 2 +- airtime_mvc/public/js/airtime/library/library.js | 3 --- airtime_mvc/public/js/airtime/nowplaying/register.js | 2 -- .../public/js/airtime/playouthistory/historytable.js | 3 +-- airtime_mvc/public/js/airtime/schedule/schedule.js | 5 +---- airtime_mvc/public/js/airtime/showbuilder/builder.js | 4 ---- .../public/js/airtime/showbuilder/main_builder.js | 3 --- airtime_mvc/public/js/airtime/user/user.js | 11 ++--------- 8 files changed, 5 insertions(+), 28 deletions(-) diff --git a/airtime_mvc/public/js/airtime/dashboard/dashboard.js b/airtime_mvc/public/js/airtime/dashboard/dashboard.js index 741c5b4fa..98a167238 100644 --- a/airtime_mvc/public/js/airtime/dashboard/dashboard.js +++ b/airtime_mvc/public/js/airtime/dashboard/dashboard.js @@ -360,7 +360,7 @@ function controlSwitchLight(){ } function getScheduleFromServer(){ - $.ajax({ cache: false, url: "/Schedule/get-current-playlist/format/json", dataType:"json", success:function(data){ + $.ajax({ url: "/Schedule/get-current-playlist/format/json", dataType:"json", success:function(data){ parseItems(data.entries); parseSourceStatus(data.source_status); parseSwitchStatus(data.switch_status); diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index cfab12c6b..a832134c1 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -479,7 +479,6 @@ var AIRTIME = (function(AIRTIME) { "fnStateSave": function (oSettings, oData) { localStorage.setItem('datatables-library', JSON.stringify(oData)); $.ajax({ - cache: false, url: "/usersettings/set-library-datatable", type: "POST", data: {settings : oData, format: "json"}, @@ -543,7 +542,6 @@ var AIRTIME = (function(AIRTIME) { aoData.push( { name: "type", value: type} ); $.ajax( { - "cache": false, "dataType": 'json', "type": "POST", "url": sSource, @@ -885,7 +883,6 @@ var AIRTIME = (function(AIRTIME) { } request = $.ajax({ - cache: false, url: "/library/context-menu", type: "GET", data: {id : data.id, type: data.ftype, format: "json", "screen": screen}, diff --git a/airtime_mvc/public/js/airtime/nowplaying/register.js b/airtime_mvc/public/js/airtime/nowplaying/register.js index 068f0d11a..0b5b04249 100644 --- a/airtime_mvc/public/js/airtime/nowplaying/register.js +++ b/airtime_mvc/public/js/airtime/nowplaying/register.js @@ -21,7 +21,6 @@ $(document).ready(function(){ click: function() { var url = '/Usersettings/remindme'; $.ajax({ - cache: false, url: url, data: {format:"json"} }); @@ -35,7 +34,6 @@ $(document).ready(function(){ click: function() { var url ='/Usersettings/remindme-never'; $.ajax({ - cache: false, url: url, data: {format:"json"} }); diff --git a/airtime_mvc/public/js/airtime/playouthistory/historytable.js b/airtime_mvc/public/js/airtime/playouthistory/historytable.js index 0371fada5..9a0db2680 100644 --- a/airtime_mvc/public/js/airtime/playouthistory/historytable.js +++ b/airtime_mvc/public/js/airtime/playouthistory/historytable.js @@ -54,7 +54,6 @@ var AIRTIME = (function(AIRTIME) { aoData.push( { name: "format", value: "json"} ); $.ajax( { - "cache": false, "dataType": 'json', "type": "GET", "url": sSource, @@ -184,4 +183,4 @@ $(document).ready(function(){ oTable.fnDraw(); }); -}); +}); \ No newline at end of file diff --git a/airtime_mvc/public/js/airtime/schedule/schedule.js b/airtime_mvc/public/js/airtime/schedule/schedule.js index 3bddc60f5..5a43f1eb2 100644 --- a/airtime_mvc/public/js/airtime/schedule/schedule.js +++ b/airtime_mvc/public/js/airtime/schedule/schedule.js @@ -36,7 +36,6 @@ function confirmCancelShow(show_instance_id){ if (confirm('Cancel Current Show?')) { var url = "/Schedule/cancel-current-show"; $.ajax({ - cache: false, url: url, data: {format: "json", id: show_instance_id}, success: function(data){ @@ -51,7 +50,6 @@ function confirmCancelRecordedShow(show_instance_id){ var url = "/Schedule/cancel-current-show"; $.ajax({ url: url, - cache: false, data: {format: "json", id: show_instance_id}, success: function(data){ scheduleRefetchEvents(data); @@ -291,7 +289,7 @@ function alertShowErrorAndReload(){ } $(document).ready(function() { - $.ajax({ cache: false, url: "/Api/calendar-init/format/json", dataType:"json", success:createFullCalendar + $.ajax({ url: "/Api/calendar-init/format/json", dataType:"json", success:createFullCalendar , error:function(jqXHR, textStatus, errorThrown){}}); setInterval(checkCalendarSCUploadStatus, 5000); @@ -461,7 +459,6 @@ $(document).ready(function() { } $.ajax({ - cache: false, url: "/schedule/make-context-menu", type: "GET", data: {id : data.id, format: "json"}, diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js index 8bcfbdc4a..9839df06c 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js @@ -326,7 +326,6 @@ var AIRTIME = (function(AIRTIME){ } $.ajax({ - "cache": false, "dataType": "json", "type": "POST", "url": sSource, @@ -380,7 +379,6 @@ var AIRTIME = (function(AIRTIME){ localStorage.setItem('datatables-timeline', JSON.stringify(oData)); $.ajax({ - cache: false, url: "/usersettings/set-timeline-datatable", type: "POST", data: {settings : oData, format: "json"}, @@ -1005,7 +1003,6 @@ var AIRTIME = (function(AIRTIME){ if (confirm(msg)) { var url = "/Schedule/cancel-current-show"; $.ajax({ - cache: false, url: url, data: {format: "json", id: data.instance}, success: function(data){ @@ -1184,7 +1181,6 @@ var AIRTIME = (function(AIRTIME){ } request = $.ajax({ - cache: false, url: "/showbuilder/context-menu", type: "GET", data: {id : data.id, format: "json"}, diff --git a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js index 60a224838..b640a2882 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js @@ -168,7 +168,6 @@ AIRTIME = (function(AIRTIME) { schedTable.fnDraw(); $.ajax({ - cache: false, url: "/usersettings/set-now-playing-screen-settings", type: "POST", data: {settings : {library : true}, format: "json"}, @@ -193,7 +192,6 @@ AIRTIME = (function(AIRTIME) { schedTable.fnDraw(); $.ajax({ - cache: false, url: "/usersettings/set-now-playing-screen-settings", type: "POST", data: {settings : {library : false}, format: "json"}, @@ -259,7 +257,6 @@ AIRTIME = (function(AIRTIME) { } $.ajax( { - "cache": false, "dataType": "json", "type": "GET", "url": "/showbuilder/check-builder-feed", diff --git a/airtime_mvc/public/js/airtime/user/user.js b/airtime_mvc/public/js/airtime/user/user.js index a6ae9b3f8..5c8278914 100644 --- a/airtime_mvc/public/js/airtime/user/user.js +++ b/airtime_mvc/public/js/airtime/user/user.js @@ -24,19 +24,13 @@ function populateForm(entries){ } function rowClickCallback(row_id){ - $.ajax({ cache: false, - url: '/User/get-user-data/id/'+ row_id +'/format/json', - dataType:"json", - success:function(data){ + $.ajax({ url: '/User/get-user-data/id/'+ row_id +'/format/json', dataType:"json", success:function(data){ populateForm(data.entries); }}); } function removeUserCallback(row_id, nRow){ - $.ajax({ cache: false, - url: '/User/remove-user/id/'+ row_id +'/format/json', - dataType:"text", - success:function(data){ + $.ajax({ url: '/User/remove-user/id/'+ row_id +'/format/json', dataType:"text", success:function(data){ var o = $('#users_datatable').dataTable().fnDeleteRow(nRow); }}); } @@ -73,7 +67,6 @@ $(document).ready(function() { "sAjaxSource": "/User/get-user-data-table-info/format/json", "fnServerData": function ( sSource, aoData, fnCallback ) { $.ajax( { - "cache": false, "dataType": 'json', "type": "POST", "url": sSource, From f5051cff3a31540f6e28aa9c33890505738ff73b Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 19 Oct 2012 11:22:44 -0400 Subject: [PATCH 08/14] CC-4605: Some AJAX calls are cached -fixed --- airtime_mvc/application/Bootstrap.php | 3 +-- airtime_mvc/public/js/airtime/airtime_bootstrap.js | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 airtime_mvc/public/js/airtime/airtime_bootstrap.js diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php index c4c53ffa5..cb35a8a9c 100644 --- a/airtime_mvc/application/Bootstrap.php +++ b/airtime_mvc/application/Bootstrap.php @@ -75,6 +75,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap $view->headScript()->appendScript("var baseUrl='$baseUrl/'"); //scripts for now playing bar + $view->headScript()->appendFile($baseUrl.'/js/airtime/airtime_bootstrap.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $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'); $view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/versiontooltip.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); @@ -91,8 +92,6 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap } $view->headScript()->appendScript("var userType = '$userType';"); - - if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) { $view->headScript()->appendFile($baseUrl.'/js/libs/google-analytics.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); } diff --git a/airtime_mvc/public/js/airtime/airtime_bootstrap.js b/airtime_mvc/public/js/airtime/airtime_bootstrap.js new file mode 100644 index 000000000..632d61627 --- /dev/null +++ b/airtime_mvc/public/js/airtime/airtime_bootstrap.js @@ -0,0 +1,5 @@ +$(document).ready(function() { + $.ajaxSetup({ + cache: false + }); +}); From 8d56c03fe3e198f944513069c80bd7a399675156 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Fri, 19 Oct 2012 11:32:35 -0400 Subject: [PATCH 09/14] deep voodoo magic to optimize schedule --- airtime_mvc/application/models/Show.php | 4 ++-- .../application/models/ShowInstance.php | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index bb58409fd..5da348b52 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1789,9 +1789,9 @@ SQL; $showInstance = new Application_Model_ShowInstance( $show["instance_id"]); - $showContent = $showInstance->getShowListContent(); + //$showContent = $showInstance->getShowListContent(); - $options["show_empty"] = empty($showContent) ? 1 : 0; + $options["show_empty"] = ($showInstance->showEmpty()) ? 1 : 0; $events[] = &self::makeFullCalendarEvent($show, $options, $startsDT, $endsDT, $startsEpochStr, $endsEpochStr); diff --git a/airtime_mvc/application/models/ShowInstance.php b/airtime_mvc/application/models/ShowInstance.php index 3dfd8756f..e657494f9 100644 --- a/airtime_mvc/application/models/ShowInstance.php +++ b/airtime_mvc/application/models/ShowInstance.php @@ -661,6 +661,28 @@ SQL; return $returnStr; } + + public function showEmpty() + { + $sql = <<= 0 + AND ((s.stream_id IS NOT NULL) + OR (s.file_id IS NOT NULL)) LIMIT 1 +SQL; + # TODO : use prepareAndExecute properly + $res = Application_Common_Database::prepareAndExecute($sql, + array( ':instance_id' => $this->_instanceId ), 'all' ); + # TODO : A bit retarded. fix this later + foreach ($res as $r) { + return false; + } + return true; + + } + public function getShowListContent() { $con = Propel::getConnection(); From ee89ac660375481bfca7ba99b49406d6e822e591 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 19 Oct 2012 12:16:04 -0400 Subject: [PATCH 10/14] CC-4589: Small inconsistency in config files after upgrade --- .../upgrades/airtime-2.2.0/common/UpgradeCommon.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install_minimal/upgrades/airtime-2.2.0/common/UpgradeCommon.php b/install_minimal/upgrades/airtime-2.2.0/common/UpgradeCommon.php index 77c297a65..496a576a2 100644 --- a/install_minimal/upgrades/airtime-2.2.0/common/UpgradeCommon.php +++ b/install_minimal/upgrades/airtime-2.2.0/common/UpgradeCommon.php @@ -111,6 +111,10 @@ class UpgradeCommon{ $old = "list_all_db_files = 'list-all-files/format/json/api_key/%%api_key%%/dir_id/%%dir_id%%'"; $new = "list_all_db_files = 'list-all-files/format/json/api_key/%%api_key%%/dir_id/%%dir_id%%/all/%%all%%'"; exec("sed -i \"s#$old#$new#g\" /etc/airtime/api_client.cfg"); + + $old = "update_start_playing_url = 'notify-media-item-start-play/api_key/%%api_key%%/media_id/%%media_id%%/schedule_id/%%schedule_id%%'"; + $new = "update_start_playing_url = 'notify-media-item-start-play/api_key/%%api_key%%/media_id/%%media_id%%/'"; + exec("sed -i \"s#$old#$new#g\" /etc/airtime/api_client.cfg"); } /** From a51c3174e0f18f844b312d4c1ea401f2098d74d8 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 19 Oct 2012 12:33:12 -0400 Subject: [PATCH 11/14] SAAS-282: Overlap detection prevents creation of a repeating show -fixed --- airtime_mvc/application/forms/AddShowWhen.php | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index 1ed9d2619..e6d164022 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -143,10 +143,12 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm * upto this point */ if ($valid) { + $utc = new DateTimeZone('UTC'); + $localTimezone = new DateTimeZone(Application_Model_Preference::GetTimezone()); $show_start = new DateTime($start_time); - $show_start->setTimezone(new DateTimeZone('UTC')); + $show_start->setTimezone($utc); $show_end = new DateTime($end_time); - $show_end->setTimezone(new DateTimeZone('UTC')); + $show_end->setTimezone($utc); if ($formData["add_show_repeats"]) { @@ -155,7 +157,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm $date = Application_Model_Preference::GetShowsPopulatedUntil(); if (is_null($date)) { - $populateUntilDateTime = new DateTime("now", new DateTimeZone('UTC')); + $populateUntilDateTime = new DateTime("now", $utc); Application_Model_Preference::SetShowsPopulatedUntil($populateUntilDateTime); } else { $populateUntilDateTime = clone $date; @@ -164,7 +166,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm } elseif (!$formData["add_show_no_end"]) { $popUntil = $formData["add_show_end_date"]." ".$formData["add_show_end_time"]; $populateUntilDateTime = new DateTime($popUntil); - $populateUntilDateTime->setTimezone(new DateTimeZone('UTC')); + $populateUntilDateTime->setTimezone($utc); } //get repeat interval @@ -203,8 +205,18 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm else $daysAdd = $day - $startDow; + /* In case we are crossing daylights saving time we need + * to convert show start and show end to local time before + * adding the interval for the next repeating show + */ + + $repeatShowStart->setTimezone($localTimezone); + $repeatShowEnd->setTimezone($localTimezone); $repeatShowStart->add(new DateInterval("P".$daysAdd."D")); $repeatShowEnd->add(new DateInterval("P".$daysAdd."D")); + //set back to UTC + $repeatShowStart->setTimezone($utc); + $repeatShowEnd->setTimezone($utc); } /* Here we are checking each repeating show by * the show day. @@ -238,8 +250,12 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm $this->getElement('add_show_duration')->setErrors(array('Cannot schedule overlapping shows')); break 1; } else { + $repeatShowStart->setTimezone($localTimezone); + $repeatShowEnd->setTimezone($localTimezone); $repeatShowStart->add(new DateInterval($interval)); $repeatShowEnd->add(new DateInterval($interval)); + $repeatShowStart->setTimezone($utc); + $repeatShowEnd->setTimezone($utc); } } } From a1e653b41f0657ca8d366897e0c824cd993fe7a5 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Fri, 19 Oct 2012 13:22:00 -0400 Subject: [PATCH 12/14] Deep optimization --- airtime_mvc/application/models/Show.php | 7 ++++--- .../application/models/ShowInstance.php | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 5da348b52..0006057f7 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1743,7 +1743,8 @@ SQL; $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); $timezone = date_default_timezone_get(); foreach ($shows as $show) { @@ -1789,9 +1790,9 @@ SQL; $showInstance = new Application_Model_ShowInstance( $show["instance_id"]); - //$showContent = $showInstance->getShowListContent(); - $options["show_empty"] = ($showInstance->showEmpty()) ? 1 : 0; + $options["show_empty"] = (array_key_exists($show['instance_id'], + $content_count)) ? 1 : 0; $events[] = &self::makeFullCalendarEvent($show, $options, $startsDT, $endsDT, $startsEpochStr, $endsEpochStr); diff --git a/airtime_mvc/application/models/ShowInstance.php b/airtime_mvc/application/models/ShowInstance.php index e657494f9..8854f3896 100644 --- a/airtime_mvc/application/models/ShowInstance.php +++ b/airtime_mvc/application/models/ShowInstance.php @@ -662,6 +662,27 @@ SQL; } + + public static function getContentCount($p_start, $p_end) + { + $sql = << :p_start::TIMESTAMP + AND starts < :p_end::TIMESTAMP +GROUP BY instance_id; +SQL; + + $counts = 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 $counts; + + } + public function showEmpty() { $sql = << Date: Fri, 19 Oct 2012 13:24:06 -0400 Subject: [PATCH 13/14] Removed trailing whitespace --- airtime_mvc/application/models/ShowInstance.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/airtime_mvc/application/models/ShowInstance.php b/airtime_mvc/application/models/ShowInstance.php index 8854f3896..5b60e1f70 100644 --- a/airtime_mvc/application/models/ShowInstance.php +++ b/airtime_mvc/application/models/ShowInstance.php @@ -671,16 +671,16 @@ SELECT instance_id, FROM cc_schedule WHERE ends > :p_start::TIMESTAMP AND starts < :p_end::TIMESTAMP -GROUP BY instance_id; -SQL; +GROUP BY instance_id +SQL; - $counts = Application_Common_Database::prepareAndExecute( $sql, array( - ':p_start' => $p_start->format("Y-m-d G:i:s"), + $counts = 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 $counts; - + , 'all'); + + return $counts; + } public function showEmpty() From 8f998fd2c89edc5334f3ae1d138f04aaee0bc0e2 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 19 Oct 2012 13:42:24 -0400 Subject: [PATCH 14/14] CC-4595: Fade in/out setting doesn't work -fixed --- airtime_mvc/application/models/airtime/CcSchedule.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/models/airtime/CcSchedule.php b/airtime_mvc/application/models/airtime/CcSchedule.php index e051df6c3..db7fb19a7 100644 --- a/airtime_mvc/application/models/airtime/CcSchedule.php +++ b/airtime_mvc/application/models/airtime/CcSchedule.php @@ -127,9 +127,9 @@ class CcSchedule extends BaseCcSchedule { } if ($microsecond == 0) { - $this->fadein = $dt->format('H:i:s.u'); + $this->fade_in = $dt->format('H:i:s.u'); } else { - $this->fadein = $dt->format('H:i:s').".".$microsecond; + $this->fade_in = $dt->format('H:i:s').".".$microsecond; } $this->modifiedColumns[] = CcSchedulePeer::FADE_IN; @@ -164,9 +164,9 @@ class CcSchedule extends BaseCcSchedule { } if ($microsecond == 0) { - $this->fadeout = $dt->format('H:i:s.u'); + $this->fade_out = $dt->format('H:i:s.u'); } else { - $this->fadeout = $dt->format('H:i:s').".".$microsecond; + $this->fade_out = $dt->format('H:i:s').".".$microsecond; } $this->modifiedColumns[] = CcSchedulePeer::FADE_OUT;