From 904a60418c1fb2f9872cac3466ba0b399ec76f30 Mon Sep 17 00:00:00 2001 From: Naomi Date: Tue, 1 Feb 2011 15:57:12 -0500 Subject: [PATCH 1/7] better organizing Library controller since datatables is now used. --- application/controllers/LibraryController.php | 32 ++++++------------- .../views/scripts/library/contents.phtml | 23 ------------- application/views/scripts/library/index.phtml | 23 +++++++++++++ 3 files changed, 32 insertions(+), 46 deletions(-) diff --git a/application/controllers/LibraryController.php b/application/controllers/LibraryController.php index 8372158cd..c58072fe3 100644 --- a/application/controllers/LibraryController.php +++ b/application/controllers/LibraryController.php @@ -13,8 +13,7 @@ class LibraryController extends Zend_Controller_Action } $ajaxContext = $this->_helper->getHelper('AjaxContext'); - $ajaxContext->addActionContext('contents', 'html') - ->addActionContext('contents', 'json') + $ajaxContext->addActionContext('contents', 'json') ->addActionContext('delete', 'json') ->addActionContext('context-menu', 'json') ->initContext(); @@ -28,16 +27,16 @@ class LibraryController extends Zend_Controller_Action $this->view->headScript()->appendFile('/js/airtime/onready/library.js','text/javascript'); $this->view->headScript()->appendFile('/js/contextmenu/jjmenu.js','text/javascript'); $this->view->headScript()->appendFile('/js/jplayer/jquery.jplayer.min.js'); - + $this->view->headScript()->appendFile('/js/datatables/js/jquery.dataTables.js','text/javascript'); + $this->view->headScript()->appendFile('/js/airtime/library/library.js','text/javascript'); + + $this->view->headLink()->appendStylesheet('/css/media_library.css'); $this->view->headLink()->appendStylesheet('/css/contextmenu.css'); $this->_helper->layout->setLayout('library'); - - unset($this->search_sess->page); - unset($this->search_sess->md); + $this->_helper->viewRenderer->setResponseSegment('library'); $this->_helper->actionStack('index', 'playlist'); - $this->_helper->actionStack('contents', 'library'); } public function contextMenuAction() @@ -118,23 +117,10 @@ class LibraryController extends Zend_Controller_Action public function contentsAction() { - $this->view->headScript()->appendFile('/js/datatables/js/jquery.dataTables.js','text/javascript'); - $this->view->headScript()->appendFile('/js/airtime/library/library.js','text/javascript'); + $post = $this->getRequest()->getPost(); + $datatables = StoredFile::searchFilesForPlaylistBuilder($post); - $this->view->headLink()->appendStylesheet('/css/media_library.css'); - - $this->_helper->viewRenderer->setResponseSegment('library'); - - $format = $this->_getParam('format'); - - $post = $this->getRequest()->getPost(); - - if($format == "json") { - - $datatables = StoredFile::searchFilesForPlaylistBuilder($post); - - die(json_encode($datatables)); - } + die(json_encode($datatables)); } public function editFileMdAction() diff --git a/application/views/scripts/library/contents.phtml b/application/views/scripts/library/contents.phtml index ddcdd9120..e69de29bb 100644 --- a/application/views/scripts/library/contents.phtml +++ b/application/views/scripts/library/contents.phtml @@ -1,23 +0,0 @@ - -
- - - - - - - - - - - - - -
IdTitleCreatorAlbumTrackLengthType
-
-
- Some Text -
diff --git a/application/views/scripts/library/index.phtml b/application/views/scripts/library/index.phtml index e69de29bb..ddcdd9120 100644 --- a/application/views/scripts/library/index.phtml +++ b/application/views/scripts/library/index.phtml @@ -0,0 +1,23 @@ + +
+ + + + + + + + + + + + + +
IdTitleCreatorAlbumTrackLengthType
+
+
+ Some Text +
From eaad41ef94f548291c773b70767b4d80470233e5 Mon Sep 17 00:00:00 2001 From: Naomi Date: Tue, 1 Feb 2011 17:41:19 -0500 Subject: [PATCH 2/7] changed schedule page to use better dynamic menu that the playlist builder page is using. --- .../controllers/ScheduleController.php | 51 +++++++----- .../views/scripts/schedule/index.phtml | 7 -- public/css/contextmenu.css | 1 + public/js/airtime/library/context-menu.js | 33 -------- public/js/airtime/library/quicksearch.js | 28 ------- .../schedule/full-calendar-functions.js | 26 +++--- public/js/airtime/schedule/schedule.js | 80 +++++-------------- 7 files changed, 66 insertions(+), 160 deletions(-) delete mode 100644 public/js/airtime/library/context-menu.js delete mode 100644 public/js/airtime/library/quicksearch.js diff --git a/application/controllers/ScheduleController.php b/application/controllers/ScheduleController.php index 3bc619212..a283ac959 100644 --- a/application/controllers/ScheduleController.php +++ b/application/controllers/ScheduleController.php @@ -14,6 +14,7 @@ class ScheduleController extends Zend_Controller_Action $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('event-feed', 'json') + ->addActionContext('make-context-menu', 'json') ->addActionContext('add-show-dialog', 'json') ->addActionContext('add-show', 'json') ->addActionContext('move-show', 'json') @@ -33,24 +34,13 @@ class ScheduleController extends Zend_Controller_Action public function indexAction() { $this->view->headScript()->appendFile('/js/fullcalendar/fullcalendar.min.js','text/javascript'); - $this->view->headScript()->appendFile('/js/contextmenu/jquery.contextMenu.js','text/javascript'); + $this->view->headScript()->appendFile('/js/contextmenu/jjmenu.js','text/javascript'); $this->view->headScript()->appendFile('/js/datatables/js/jquery.dataTables.js','text/javascript'); $this->view->headScript()->appendFile('/js/airtime/schedule/full-calendar-functions.js','text/javascript'); $this->view->headScript()->appendFile('/js/airtime/schedule/schedule.js','text/javascript'); - $this->view->headLink()->appendStylesheet('/css/jquery.contextMenu.css'); + $this->view->headLink()->appendStylesheet('/css/contextmenu.css'); $this->view->headLink()->appendStylesheet('/css/fullcalendar.css'); - - $eventDefaultMenu = array(); - //$eventDefaultMenu[] = array('action' => '/Schedule/delete-show', 'text' => 'Delete'); - - $this->view->eventDefaultMenu = $eventDefaultMenu; - - $eventHostMenu[] = array('action' => '/Schedule/delete-show', 'text' => 'Delete'); - $eventHostMenu[] = array('action' => '/Schedule/schedule-show', 'text' => 'Schedule'); - $eventHostMenu[] = array('action' => '/Schedule/clear-show', 'text' => 'Clear'); - - $this->view->eventHostMenu = $eventHostMenu; } public function eventFeedAction() @@ -175,19 +165,42 @@ class ScheduleController extends Zend_Controller_Action public function deleteShowAction() { - $showId = $this->_getParam('showId'); - $date = $this->_getParam('date'); + $showId = $this->_getParam('id'); + $start_timestamp = $this->_getParam('start'); $userInfo = Zend_Auth::getInstance()->getStorage()->read(); $user = new User($userInfo->id, $userInfo->type); $show = new Show($user, $showId); - $show->deleteShow($date); + $show->deleteShow($start_timestamp); } public function makeContextMenuAction() { - // action body + $id = $this->_getParam('id'); + $start_timestamp = $this->_getParam('start'); + + $today_timestamp = date("Y-m-d H:i:s"); + + $params = '/format/json/id/#id#/start/#start#/end/#end#'; + + if(strtotime($today_timestamp) < strtotime($start_timestamp)) { + + $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/delete-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), + 'title' => 'Delete'); + + $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/clear-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), + 'title' => 'Clear'); + + $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/schedule-show-dialog'.$params, 'callback' => 'window["buildScheduleDialog"]'), + 'title' => 'Schedule'); + } + else { + + } + + //returns format jjmenu is looking for. + die(json_encode($menu)); } public function scheduleShowAction() @@ -221,7 +234,7 @@ class ScheduleController extends Zend_Controller_Action public function clearShowAction() { $start = $this->_getParam('start'); - $showId = $this->_getParam('showId'); + $showId = $this->_getParam('id'); $userInfo = Zend_Auth::getInstance()->getStorage()->read(); $user = new User($userInfo->id, $userInfo->type); @@ -278,7 +291,7 @@ class ScheduleController extends Zend_Controller_Action { $start_timestamp = $this->_getParam('start'); $end_timestamp = $this->_getParam('end'); - $showId = $this->_getParam('showId'); + $showId = $this->_getParam('id'); $this->sched_sess->showId = $showId; $this->sched_sess->showStart = $start_timestamp; diff --git a/application/views/scripts/schedule/index.phtml b/application/views/scripts/schedule/index.phtml index 2c342ddc5..9f43c06f8 100644 --- a/application/views/scripts/schedule/index.phtml +++ b/application/views/scripts/schedule/index.phtml @@ -1,8 +1 @@
- - - diff --git a/public/css/contextmenu.css b/public/css/contextmenu.css index 1d5d4fe57..9a18e9dac 100644 --- a/public/css/contextmenu.css +++ b/public/css/contextmenu.css @@ -5,6 +5,7 @@ div.jjmenu { border-bottom:2px solid gray; border-right:1px solid gray; padding:0px; + z-index: 100; } div.jj_menu_item { diff --git a/public/js/airtime/library/context-menu.js b/public/js/airtime/library/context-menu.js deleted file mode 100644 index 23e0341dd..000000000 --- a/public/js/airtime/library/context-menu.js +++ /dev/null @@ -1,33 +0,0 @@ -/* -function contextMenu(action, el, pos) { - var method = action.split('/').pop(), - url, tr_id, id; - - tr_id = $(el).attr('id'); - id = tr_id.split("_").pop(); - url = '/'+action; - - if (method === 'delete') { - url = url + '/format/json'; - url = url + '/id/' + id; - $.post(url, function(json) { - - if(json.message) { - alert(json.message); - return; - } - - $("#library_display tr#" +tr_id).remove(); - }); - } - else if (method === 'add-item') { - url = url + '/format/json'; - url = url + '/id/' + id; - $.post(url, setSPLContent); - } -} -*/ - -function contextMenu() { - alert("callback"); -} diff --git a/public/js/airtime/library/quicksearch.js b/public/js/airtime/library/quicksearch.js deleted file mode 100644 index 2cb84d12c..000000000 --- a/public/js/airtime/library/quicksearch.js +++ /dev/null @@ -1,28 +0,0 @@ -function setUpQuickSearch() { - - $("#library_quick_search input").keyup(function(ev){ - var url, string; - //alert(x); - - url = "/Library/quick-search/format/json"; - string = $(this).val(); - - $.post(url, {search: string}, function(json){ - var html, data; - //hacky way until I can figure out paginator better. - html = json.html.replace(/quick-search\/format\/json/g, "index"); - - var el = $(html); - - data = el.find("tr:not(:first-child)"); - setLibraryContents(data); - - var lib = $("#library_content"); - - lib.find("div.paginationControl").remove(); - lib.append(el[2]); - - }); - }); - -} diff --git a/public/js/airtime/schedule/full-calendar-functions.js b/public/js/airtime/schedule/full-calendar-functions.js index 3a078dfdc..337be235d 100644 --- a/public/js/airtime/schedule/full-calendar-functions.js +++ b/public/js/airtime/schedule/full-calendar-functions.js @@ -59,20 +59,22 @@ function eventRender(event, element, view) { } function eventAfterRender( event, element, view ) { - var today = new Date(); - if(event.isHost === true && event.start > today) { - $(element).contextMenu( - {menu: 'schedule_event_host_menu'}, eventMenu - ); - } - else{ - $(element).contextMenu( - {menu: 'schedule_event_default_menu'}, eventMenu - ); - } + function getStartTS() { + var start = makeTimeStamp(event.start); + return start; + } - $(element).data({'event': event}); + function getEndTS() { + var start = makeTimeStamp(event.end); + return start; + } + + $(element) + .jjmenu("rightClick", + [{get:"/Schedule/make-context-menu/format/json/id/#id#/start/#start#/end/#end#"}], + {id: event.id, start: getStartTS, end: getEndTS}, + {xposition: "mouse", yposition: "mouse"}); } function eventClick(event, jsEvent, view) { diff --git a/public/js/airtime/schedule/schedule.js b/public/js/airtime/schedule/schedule.js index d10b23487..de32a389f 100644 --- a/public/js/airtime/schedule/schedule.js +++ b/public/js/airtime/schedule/schedule.js @@ -165,69 +165,29 @@ function makeScheduleDialog(dialog, json) { setScheduleDialogEvents(dialog); } -function openScheduleDialog(show) { - var url, start_date, end_date; +function buildScheduleDialog(json){ + var dialog = $(json.dialog); - url = '/Schedule/schedule-show-dialog/format/json'; - - start_date = makeTimeStamp(show.start); - end_date = makeTimeStamp(show.end); + makeScheduleDialog(dialog, json); - $.post(url, - {start: start_date, end: end_date, showId: show.id}, - function(json){ - var dialog = $(json.dialog); + dialog.dialog({ + autoOpen: false, + title: 'Schedule Playlist', + width: 1100, + height: 500, + modal: true, + close: closeDialog, + buttons: {"Ok": function() { + dialog.remove(); + $("#schedule_calendar").fullCalendar( 'refetchEvents' ); + }} + }); - makeScheduleDialog(dialog, json, show); - - dialog.dialog({ - autoOpen: false, - title: 'Schedule Playlist', - width: 1100, - height: 500, - modal: true, - close: closeDialog, - buttons: {"Ok": function() { - dialog.remove(); - $("#schedule_calendar").fullCalendar( 'refetchEvents' ); - }} - }); - - dialog.dialog('open'); - }); + dialog.dialog('open'); } -function eventMenu(action, el, pos) { - var method, event, start_timestamp, url; - - method = action.split('/').pop(); - event = $(el).data('event'); - start_timestamp = makeTimeStamp(event.start); - - if (method === 'delete-show') { - - url = '/Schedule/delete-show'; - - $.post(action, - {format: "json", showId: event.id, date: start_timestamp}, - function(json){ - $("#schedule_calendar").fullCalendar( 'refetchEvents' ); - }); - } - else if (method === 'schedule-show') { - - openScheduleDialog(event); - } - else if (method === 'clear-show') { - - url = '/Schedule/clear-show'; - - $.post(url, - {format: "json", start: start_timestamp, showId: event.id}, - function(json){ - $("#schedule_calendar").fullCalendar( 'refetchEvents' ); - }); - } +function scheduleRefetchEvents() { + $("#schedule_calendar").fullCalendar( 'refetchEvents' ); } $(document).ready(function() { @@ -244,7 +204,7 @@ $(document).ready(function() { events: getFullCalendarEvents, - //callbacks (from full-calendar-functions.js + //callbacks (in full-calendar-functions.js) dayClick: dayClick, eventRender: eventRender, eventAfterRender: eventAfterRender, @@ -253,9 +213,7 @@ $(document).ready(function() { eventMouseout: eventMouseout, eventDrop: eventDrop, eventResize: eventResize - }); - }); $(window).load(function() { From fab6881731b6f6f175e2f4d115911ba84bf2f927 Mon Sep 17 00:00:00 2001 From: Naomi Date: Tue, 1 Feb 2011 17:46:55 -0500 Subject: [PATCH 3/7] removing now unused old context menu plugin --- public/css/jquery.contextMenu.css | 62 ------ public/js/contextmenu/jquery.contextMenu.js | 211 -------------------- 2 files changed, 273 deletions(-) delete mode 100644 public/css/jquery.contextMenu.css delete mode 100644 public/js/contextmenu/jquery.contextMenu.js diff --git a/public/css/jquery.contextMenu.css b/public/css/jquery.contextMenu.css deleted file mode 100644 index 5b2dd9069..000000000 --- a/public/css/jquery.contextMenu.css +++ /dev/null @@ -1,62 +0,0 @@ -/* Generic context menu styles */ -.contextMenu { - position: absolute; - width: 120px; - z-index: 99999; - border: solid 1px #CCC; - background: #EEE; - padding: 0px; - margin: 0px; - display: none; -} - -.contextMenu LI { - list-style: none; - padding: 0px; - margin: 0px; -} - -.contextMenu A { - color: #333; - text-decoration: none; - display: block; - line-height: 20px; - height: 20px; - background-position: 6px center; - background-repeat: no-repeat; - outline: none; - padding: 1px 5px; - padding-left: 28px; -} - -.contextMenu LI.hover A { - color: #FFF; - background-color: #3399FF; -} - -.contextMenu LI.disabled A { - color: #AAA; - cursor: default; -} - -.contextMenu LI.hover.disabled A { - background-color: transparent; -} - -.contextMenu LI.separator { - border-top: solid 1px #CCC; -} - -/* - Adding Icons - - You can add icons to the context menu by adding - classes to the respective LI element(s) -*/ - -.contextMenu LI.edit A { background-image: url(images/page_white_edit.png); } -.contextMenu LI.cut A { background-image: url(images/cut.png); } -.contextMenu LI.copy A { background-image: url(images/page_white_copy.png); } -.contextMenu LI.paste A { background-image: url(images/page_white_paste.png); } -.contextMenu LI.delete A { background-image: url(images/page_white_delete.png); } -.contextMenu LI.quit A { background-image: url(images/door.png); } diff --git a/public/js/contextmenu/jquery.contextMenu.js b/public/js/contextmenu/jquery.contextMenu.js deleted file mode 100644 index a06f0bbdf..000000000 --- a/public/js/contextmenu/jquery.contextMenu.js +++ /dev/null @@ -1,211 +0,0 @@ -// jQuery Context Menu Plugin -// -// Version 1.01 -// -// Cory S.N. LaViska -// A Beautiful Site (http://abeautifulsite.net/) -// -// More info: http://abeautifulsite.net/2008/09/jquery-context-menu-plugin/ -// -// Terms of Use -// -// This plugin is dual-licensed under the GNU General Public License -// and the MIT License and is copyright A Beautiful Site, LLC. -// -if(jQuery)( function() { - $.extend($.fn, { - - contextMenu: function(o, callback) { - // Defaults - if( o.menu == undefined ) return false; - if( o.inSpeed == undefined ) o.inSpeed = 150; - if( o.outSpeed == undefined ) o.outSpeed = 75; - // 0 needs to be -1 for expected results (no fade) - if( o.inSpeed == 0 ) o.inSpeed = -1; - if( o.outSpeed == 0 ) o.outSpeed = -1; - // Loop each context menu - $(this).each( function() { - var el = $(this); - var offset = $(el).offset(); - // Add contextMenu class - $('#' + o.menu).addClass('contextMenu'); - // Simulate a true right click - $(this).mousedown( function(e) { - var evt = e; - evt.stopPropagation(); - $(this).mouseup( function(e) { - e.stopPropagation(); - var srcElement = $(this); - $(this).unbind('mouseup'); - if( evt.button == 2 ) { - // Hide context menus that may be showing - $(".contextMenu").hide(); - // Get this context menu - var menu = $('#' + o.menu); - - if( $(el).hasClass('disabled') ) return false; - - // Detect mouse position - var d = {}, x, y; - if( self.innerHeight ) { - d.pageYOffset = self.pageYOffset; - d.pageXOffset = self.pageXOffset; - d.innerHeight = self.innerHeight; - d.innerWidth = self.innerWidth; - } else if( document.documentElement && - document.documentElement.clientHeight ) { - d.pageYOffset = document.documentElement.scrollTop; - d.pageXOffset = document.documentElement.scrollLeft; - d.innerHeight = document.documentElement.clientHeight; - d.innerWidth = document.documentElement.clientWidth; - } else if( document.body ) { - d.pageYOffset = document.body.scrollTop; - d.pageXOffset = document.body.scrollLeft; - d.innerHeight = document.body.clientHeight; - d.innerWidth = document.body.clientWidth; - } - (e.pageX) ? x = e.pageX : x = e.clientX + d.scrollLeft; - (e.pageY) ? y = e.pageY : y = e.clientY + d.scrollTop; - - // Show the menu - $(document).unbind('click'); - $(menu).css({ top: y, left: x }).fadeIn(o.inSpeed); - // Hover events - $(menu).find('A').mouseover( function() { - $(menu).find('LI.hover').removeClass('hover'); - $(this).parent().addClass('hover'); - }).mouseout( function() { - $(menu).find('LI.hover').removeClass('hover'); - }); - - // Keyboard - $(document).keypress( function(e) { - switch( e.keyCode ) { - case 38: // up - if( $(menu).find('LI.hover').size() == 0 ) { - $(menu).find('LI:last').addClass('hover'); - } else { - $(menu).find('LI.hover').removeClass('hover').prevAll('LI:not(.disabled)').eq(0).addClass('hover'); - if( $(menu).find('LI.hover').size() == 0 ) $(menu).find('LI:last').addClass('hover'); - } - break; - case 40: // down - if( $(menu).find('LI.hover').size() == 0 ) { - $(menu).find('LI:first').addClass('hover'); - } else { - $(menu).find('LI.hover').removeClass('hover').nextAll('LI:not(.disabled)').eq(0).addClass('hover'); - if( $(menu).find('LI.hover').size() == 0 ) $(menu).find('LI:first').addClass('hover'); - } - break; - case 13: // enter - $(menu).find('LI.hover A').trigger('click'); - break; - case 27: // esc - $(document).trigger('click'); - break - } - }); - - // When items are selected - $('#' + o.menu).find('A').unbind('click'); - $('#' + o.menu).find('LI:not(.disabled) A').click( function() { - $(document).unbind('click').unbind('keypress'); - $(".contextMenu").hide(); - // Callback - if( callback ) callback( $(this).attr('href').substr(1), $(srcElement), {x: x - offset.left, y: y - offset.top, docX: x, docY: y} ); - return false; - }); - - // Hide bindings - setTimeout( function() { // Delay for Mozilla - $(document).click( function() { - $(document).unbind('click').unbind('keypress'); - $(menu).fadeOut(o.outSpeed); - return false; - }); - }, 0); - } - }); - }); - - // Disable text selection - if( $.browser.mozilla ) { - $('#' + o.menu).each( function() { $(this).css({ 'MozUserSelect' : 'none' }); }); - } else if( $.browser.msie ) { - $('#' + o.menu).each( function() { $(this).bind('selectstart.disableTextSelect', function() { return false; }); }); - } else { - $('#' + o.menu).each(function() { $(this).bind('mousedown.disableTextSelect', function() { return false; }); }); - } - // Disable browser context menu (requires both selectors to work in IE/Safari + FF/Chrome) - $(el).add($('UL.contextMenu')).bind('contextmenu', function() { return false; }); - - }); - return $(this); - }, - - // Disable context menu items on the fly - disableContextMenuItems: function(o) { - if( o == undefined ) { - // Disable all - $(this).find('LI').addClass('disabled'); - return( $(this) ); - } - $(this).each( function() { - if( o != undefined ) { - var d = o.split(','); - for( var i = 0; i < d.length; i++ ) { - $(this).find('A[href="' + d[i] + '"]').parent().addClass('disabled'); - - } - } - }); - return( $(this) ); - }, - - // Enable context menu items on the fly - enableContextMenuItems: function(o) { - if( o == undefined ) { - // Enable all - $(this).find('LI.disabled').removeClass('disabled'); - return( $(this) ); - } - $(this).each( function() { - if( o != undefined ) { - var d = o.split(','); - for( var i = 0; i < d.length; i++ ) { - $(this).find('A[href="' + d[i] + '"]').parent().removeClass('disabled'); - - } - } - }); - return( $(this) ); - }, - - // Disable context menu(s) - disableContextMenu: function() { - $(this).each( function() { - $(this).addClass('disabled'); - }); - return( $(this) ); - }, - - // Enable context menu(s) - enableContextMenu: function() { - $(this).each( function() { - $(this).removeClass('disabled'); - }); - return( $(this) ); - }, - - // Destroy context menu(s) - destroyContextMenu: function() { - // Destroy specified context menus - $(this).each( function() { - // Disable action - $(this).unbind('mousedown').unbind('mouseup'); - }); - return( $(this) ); - } - - }); -})(jQuery); From be6722af9f0f4edd5e0e815f4f51ccaf488331bb Mon Sep 17 00:00:00 2001 From: Naomi Date: Tue, 1 Feb 2011 18:02:35 -0500 Subject: [PATCH 4/7] fix for show with no end. --- application/models/Shows.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/models/Shows.php b/application/models/Shows.php index 6f854bfae..d5da2ac4b 100644 --- a/application/models/Shows.php +++ b/application/models/Shows.php @@ -88,7 +88,7 @@ class Show { $start = $data['add_show_start_date']; } - if(strtotime($start) < strtotime($endDate)) { + if(strtotime($start) < strtotime($endDate) || is_null($endDate)) { $showDay = new CcShowDays(); $showDay->setDbFirstShow($start); @@ -584,7 +584,7 @@ class Show { $shows[] = $this->makeFullCalendarEvent($row, $repeatDate); } //case for non-ending shows. - else if(is_null($show_end_epoch) && $repeat_epoch < $end_epoch) { + else if(!isset($show_end_epoch) && $repeat_epoch < $end_epoch) { $shows[] = $this->makeFullCalendarEvent($row, $repeatDate); } else { From d0102fa9229e9d227cf8d576c3a5edbcc068f3be Mon Sep 17 00:00:00 2001 From: Naomi Date: Tue, 1 Feb 2011 18:37:33 -0500 Subject: [PATCH 5/7] changed full calendar to display 24 hour time since shows are added in 24 hour time. --- public/js/airtime/schedule/schedule.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/js/airtime/schedule/schedule.js b/public/js/airtime/schedule/schedule.js index de32a389f..390848dba 100644 --- a/public/js/airtime/schedule/schedule.js +++ b/public/js/airtime/schedule/schedule.js @@ -201,7 +201,11 @@ $(document).ready(function() { defaultView: 'agendaDay', editable: false, allDaySlot: false, - + axisFormat: 'H:mm', + timeFormat: { + agenda: 'H:mm{ - H:mm}' + }, + events: getFullCalendarEvents, //callbacks (in full-calendar-functions.js) From 1795547e70fa6a24c8d3b3335323fcae3e939352 Mon Sep 17 00:00:00 2001 From: Naomi Date: Tue, 1 Feb 2011 18:41:32 -0500 Subject: [PATCH 6/7] 24 hour time --- public/js/airtime/schedule/add-show.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/js/airtime/schedule/add-show.js b/public/js/airtime/schedule/add-show.js index f78d5c016..1ee741392 100644 --- a/public/js/airtime/schedule/add-show.js +++ b/public/js/airtime/schedule/add-show.js @@ -120,7 +120,10 @@ $(document).ready(function() { defaultView: 'agendaDay', editable: false, allDaySlot: false, - lazyFetching: false, + axisFormat: 'H:mm', + timeFormat: { + agenda: 'H:mm{ - H:mm}' + }, events: getFullCalendarEvents, From b2f6affee1546613ba490d609f3d3cadcb96049a Mon Sep 17 00:00:00 2001 From: Naomi Date: Tue, 1 Feb 2011 18:57:59 -0500 Subject: [PATCH 7/7] needed to add month option for month view 24 hour time. --- public/js/airtime/schedule/add-show.js | 3 ++- public/js/airtime/schedule/schedule.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/js/airtime/schedule/add-show.js b/public/js/airtime/schedule/add-show.js index 1ee741392..b80eecb9f 100644 --- a/public/js/airtime/schedule/add-show.js +++ b/public/js/airtime/schedule/add-show.js @@ -122,7 +122,8 @@ $(document).ready(function() { allDaySlot: false, axisFormat: 'H:mm', timeFormat: { - agenda: 'H:mm{ - H:mm}' + agenda: 'H:mm{ - H:mm}', + month: 'H:mm{ - H:mm}' }, events: getFullCalendarEvents, diff --git a/public/js/airtime/schedule/schedule.js b/public/js/airtime/schedule/schedule.js index 390848dba..cc26e1647 100644 --- a/public/js/airtime/schedule/schedule.js +++ b/public/js/airtime/schedule/schedule.js @@ -203,7 +203,8 @@ $(document).ready(function() { allDaySlot: false, axisFormat: 'H:mm', timeFormat: { - agenda: 'H:mm{ - H:mm}' + agenda: 'H:mm{ - H:mm}', + month: 'H:mm{ - H:mm}' }, events: getFullCalendarEvents,