Merge branch 'master' of dev.sourcefabric.org:airtime
Conflicts: public/css/styles.css
This commit is contained in:
commit
718a039bcc
|
@ -56,7 +56,6 @@
|
|||
<controllerFile controllerName="Schedule">
|
||||
<actionMethod actionName="index"/>
|
||||
<actionMethod actionName="eventFeed"/>
|
||||
<actionMethod actionName="addShowDialog"/>
|
||||
<actionMethod actionName="moveShow"/>
|
||||
<actionMethod actionName="resizeShow"/>
|
||||
<actionMethod actionName="deleteShow"/>
|
||||
|
@ -215,9 +214,6 @@
|
|||
<viewControllerScriptsDirectory forControllerName="Error">
|
||||
<viewScriptFile forActionName="denied"/>
|
||||
</viewControllerScriptsDirectory>
|
||||
<viewControllerScriptsDirectory forControllerName="Schedule">
|
||||
<viewScriptFile forActionName="addShowDialog"/>
|
||||
</viewControllerScriptsDirectory>
|
||||
<viewControllerScriptsDirectory forControllerName="Schedule">
|
||||
<viewScriptFile forActionName="moveShow"/>
|
||||
</viewControllerScriptsDirectory>
|
||||
|
|
|
@ -17,23 +17,10 @@ $pages = array(
|
|||
),
|
||||
array(
|
||||
'label' => 'Schedule',
|
||||
'uri' => 'javascript:void(null)',
|
||||
'pages' => array(
|
||||
array(
|
||||
'label' => 'View',
|
||||
'module' => 'default',
|
||||
'controller' => 'Schedule',
|
||||
'action' => 'index',
|
||||
'resource' => 'schedule'
|
||||
),
|
||||
array(
|
||||
'label' => 'Add Show',
|
||||
'module' => 'default',
|
||||
'controller' => 'Schedule',
|
||||
'action' => 'add-show-dialog',
|
||||
'resource' => 'schedule'
|
||||
)
|
||||
)
|
||||
'module' => 'default',
|
||||
'controller' => 'Schedule',
|
||||
'action' => 'index',
|
||||
'resource' => 'schedule'
|
||||
),
|
||||
array(
|
||||
'label' => 'Playlist Builder',
|
||||
|
|
|
@ -4,14 +4,10 @@ class LibraryController extends Zend_Controller_Action
|
|||
{
|
||||
|
||||
protected $pl_sess = null;
|
||||
protected $search_sess = null;
|
||||
|
||||
public function init()
|
||||
{
|
||||
if(!Zend_Auth::getInstance()->hasIdentity())
|
||||
{
|
||||
$this->_redirect('login/index');
|
||||
}
|
||||
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('contents', 'json')
|
||||
->addActionContext('delete', 'json')
|
||||
|
@ -30,12 +26,21 @@ class LibraryController extends Zend_Controller_Action
|
|||
$this->view->headScript()->appendFile('/js/datatables/js/jquery.dataTables.js','text/javascript');
|
||||
$this->view->headScript()->appendFile('/js/qtip/jquery.qtip-1.0.0.min.js','text/javascript');
|
||||
$this->view->headScript()->appendFile('/js/airtime/library/library.js','text/javascript');
|
||||
$this->view->headScript()->appendFile('/js/airtime/library/advancedsearch.js','text/javascript');
|
||||
|
||||
$this->view->headLink()->appendStylesheet('/css/media_library.css');
|
||||
$this->view->headLink()->appendStylesheet('/css/contextmenu.css');
|
||||
|
||||
$this->_helper->layout->setLayout('library');
|
||||
$this->_helper->viewRenderer->setResponseSegment('library');
|
||||
|
||||
$form = new Application_Form_AdvancedSearch();
|
||||
$form->addGroup(1, 1);
|
||||
|
||||
$this->search_sess->next_group = 2;
|
||||
$this->search_sess->next_row[1] = 2;
|
||||
$this->view->form = $form;
|
||||
$this->view->md = $this->search_sess->md;
|
||||
|
||||
$this->_helper->actionStack('index', 'playlist');
|
||||
}
|
||||
|
|
|
@ -30,44 +30,20 @@ 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/qtip/jquery.qtip-1.0.0.min.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/contextmenu.css');
|
||||
$this->view->headLink()->appendStylesheet('/css/fullcalendar.css');
|
||||
}
|
||||
|
||||
public function eventFeedAction()
|
||||
{
|
||||
$start = $this->_getParam('start', null);
|
||||
$end = $this->_getParam('end', null);
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$user = new User($userInfo->id);
|
||||
if($user->isAdmin())
|
||||
$editable = true;
|
||||
else
|
||||
$editable = false;
|
||||
|
||||
$this->view->events = Show::getFullCalendarEvents($start, $end, $editable);
|
||||
}
|
||||
|
||||
public function addShowDialogAction()
|
||||
{
|
||||
$this->view->headScript()->appendFile('/js/fullcalendar/fullcalendar.min.js','text/javascript');
|
||||
$this->view->headScript()->appendFile('/js/timepicker/jquery.ui.timepicker-0.0.6.js','text/javascript');
|
||||
$this->view->headScript()->appendFile('/js/colorpicker/js/colorpicker.js','text/javascript');
|
||||
$this->view->headScript()->appendFile('/js/airtime/schedule/full-calendar-functions.js','text/javascript');
|
||||
$this->view->headScript()->appendFile('/js/airtime/schedule/add-show.js','text/javascript');
|
||||
$this->view->headScript()->appendFile('/js/airtime/schedule/schedule.js','text/javascript');
|
||||
|
||||
$this->view->headLink()->appendStylesheet('/css/jquery-ui-timepicker.css');
|
||||
$this->view->headLink()->appendStylesheet('/css/fullcalendar.css');
|
||||
$this->view->headLink()->appendStylesheet('/css/colorpicker/css/colorpicker.css');
|
||||
$this->view->headLink()->appendStylesheet('/css/add-show.css');
|
||||
$this->view->headLink()->appendStylesheet('/css/contextmenu.css');
|
||||
|
||||
$request = $this->getRequest();
|
||||
$formWhat = new Application_Form_AddShowWhat();
|
||||
|
@ -121,6 +97,21 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$this->view->style = $formStyle;
|
||||
}
|
||||
|
||||
public function eventFeedAction()
|
||||
{
|
||||
$start = $this->_getParam('start', null);
|
||||
$end = $this->_getParam('end', null);
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$user = new User($userInfo->id);
|
||||
if($user->isAdmin())
|
||||
$editable = true;
|
||||
else
|
||||
$editable = false;
|
||||
|
||||
$this->view->events = Show::getFullCalendarEvents($start, $end, $editable);
|
||||
}
|
||||
|
||||
public function moveShowAction()
|
||||
{
|
||||
$deltaDay = $this->_getParam('day');
|
||||
|
|
|
@ -28,14 +28,11 @@ class SearchController extends Zend_Controller_Action
|
|||
|
||||
public function init()
|
||||
{
|
||||
if(!Zend_Auth::getInstance()->hasIdentity())
|
||||
{
|
||||
$this->_redirect('login/index');
|
||||
}
|
||||
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('newfield', 'json')
|
||||
->addActionContext('newgroup', 'json')
|
||||
->addActionContext('index', 'json')
|
||||
->addActionContext('display', 'json')
|
||||
->initContext();
|
||||
|
||||
$this->search_sess = new Zend_Session_Namespace("search");
|
||||
|
@ -43,54 +40,24 @@ class SearchController extends Zend_Controller_Action
|
|||
|
||||
public function indexAction()
|
||||
{
|
||||
$this->_helper->layout->setLayout('search');
|
||||
$data = $this->_getParam('data');
|
||||
$form = new Application_Form_AdvancedSearch();
|
||||
|
||||
// Form has been submitted
|
||||
$form->preValidation($data);
|
||||
|
||||
//if (!$form->isValid($data)) {
|
||||
//$this->view->form = $form->__toString();
|
||||
//return;
|
||||
//}
|
||||
|
||||
$this->view->headScript()->appendFile('/js/contextmenu/jjmenu.js','text/javascript');
|
||||
$this->view->headLink()->appendStylesheet('/css/contextmenu.css');
|
||||
|
||||
$this->_helper->actionStack('contents', 'library');
|
||||
$this->_helper->actionStack('display', 'search');
|
||||
$this->_helper->actionStack('index', 'playlist');
|
||||
// valid form was submitted set as search criteria.
|
||||
$this->search_sess->md = $data;
|
||||
}
|
||||
|
||||
public function displayAction()
|
||||
{
|
||||
$this->view->headScript()->appendFile('/js/airtime/library/advancedsearch.js','text/javascript');
|
||||
$this->view->headLink()->appendStylesheet('/css/library_search.css');
|
||||
|
||||
$this->_helper->viewRenderer->setResponseSegment('search');
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
$form = new Application_Form_AdvancedSearch();
|
||||
$this->view->form = $form;
|
||||
|
||||
// Form has not been submitted - displayed using layouts
|
||||
if (!$request->isPost()) {
|
||||
|
||||
$form->addGroup(1, 1);
|
||||
|
||||
$this->search_sess->next_group = 2;
|
||||
$this->search_sess->next_row[1] = 2;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->view->md = $request->getPost();
|
||||
|
||||
// Form has been submitted
|
||||
$form->preValidation($request->getPost());
|
||||
|
||||
if (!$form->isValid($request->getPost())) {
|
||||
return;
|
||||
}
|
||||
|
||||
// valid form was submitted set as search criteria.
|
||||
$this->view->md = $form->getValues();
|
||||
$this->search_sess->md = $form->getValues();
|
||||
|
||||
//make sure to start on first page of new results.
|
||||
unset($this->search_sess->page);
|
||||
}
|
||||
|
||||
public function newfieldAction()
|
||||
|
@ -113,8 +80,6 @@ class SearchController extends Zend_Controller_Action
|
|||
$this->search_sess->next_group = $group_id + 1;
|
||||
$this->search_sess->next_row[$group_id] = 2;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ class Application_Form_AdvancedSearch extends Zend_Form
|
|||
$this->getElement('search_add_group')->removeDecorator('DtDdWrapper');
|
||||
|
||||
// Add the submit button
|
||||
$this->addElement('submit', 'search_submit', array(
|
||||
$this->addElement('button', 'search_submit', array(
|
||||
'ignore' => true,
|
||||
'label' => 'Submit',
|
||||
'order' => '-1'
|
||||
|
|
|
@ -11,6 +11,14 @@ class Application_Form_AdvancedSearchGroup extends Zend_Form_SubForm
|
|||
'order' => '-2'
|
||||
));
|
||||
$this->getElement('search_add_row')->removeDecorator('DtDdWrapper');
|
||||
|
||||
// Add the add button
|
||||
$this->addElement('button', 'search_remove_group', array(
|
||||
'ignore' => true,
|
||||
'label' => 'Remove',
|
||||
'order' => '-1'
|
||||
));
|
||||
$this->getElement('search_remove_group')->removeDecorator('DtDdWrapper');
|
||||
}
|
||||
|
||||
public function addRow($row_id, $data=null) {
|
||||
|
|
|
@ -19,5 +19,8 @@
|
|||
</table>
|
||||
</div>
|
||||
<div id="advancedSearch">
|
||||
Some Text
|
||||
<div id="search">
|
||||
<?php //echo $this->form; ?>
|
||||
</div>
|
||||
<div><?php //echo var_dump($this->md); ?></div>
|
||||
</div>
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
<form id="add-show-form" method="post" action="">
|
||||
<div id="schedule-add-show" class="tabs ui-widget ui-widget-content block-shadow alpha-block padded">
|
||||
<div class="button-bar">
|
||||
<button id="add-show-submit" class="right-floated">Add this show</button>
|
||||
<button id="add-show-close" class="right-floated">Close</button>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div id="schedule-show-what">
|
||||
<?php echo $this->what ?>
|
||||
</div>
|
||||
<h3 class="collapsible-header"><span class="arrow-icon"></span>When</h3>
|
||||
<div id="schedule-show-when" class="collapsible-content">
|
||||
<?php echo $this->when ?>
|
||||
<?php echo $this->repeats ?>
|
||||
</div>
|
||||
<h3 class="collapsible-header"><span class="arrow-icon"></span>Who</h3>
|
||||
<div id="schedule-show-who" class="collapsible-content">
|
||||
<?php echo $this->who ?>
|
||||
</div>
|
||||
<h3 class="collapsible-header"><span class="arrow-icon"></span>Style</h3>
|
||||
<div id="schedule-show-style" class="collapsible-content">
|
||||
<?php echo $this->style ?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div id="fullcalendar_show_display" class="ui-widget-content block-shadow omega-block padded"></div>
|
||||
|
|
@ -1 +1,27 @@
|
|||
<div id='schedule_calendar' class="ui-widget-content block-shadow padded"></div>
|
||||
<form id="add-show-form" method="post" action="" style="display:none;">
|
||||
<div id="schedule-add-show" class="tabs ui-widget ui-widget-content block-shadow alpha-block padded">
|
||||
<div class="button-bar">
|
||||
<button id="add-show-submit" class="right-floated">Add this show</button>
|
||||
<button id="add-show-close" class="right-floated">Close</button>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div id="schedule-show-what">
|
||||
<?php echo $this->what ?>
|
||||
</div>
|
||||
<h3 class="collapsible-header"><span class="arrow-icon"></span>When</h3>
|
||||
<div id="schedule-show-when" class="collapsible-content">
|
||||
<?php echo $this->when ?>
|
||||
<?php echo $this->repeats ?>
|
||||
</div>
|
||||
<h3 class="collapsible-header"><span class="arrow-icon"></span>Who</h3>
|
||||
<div id="schedule-show-who" class="collapsible-content">
|
||||
<?php echo $this->who ?>
|
||||
</div>
|
||||
<h3 class="collapsible-header"><span class="arrow-icon"></span>Style</h3>
|
||||
<div id="schedule-show-style" class="collapsible-content">
|
||||
<?php echo $this->style ?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div id='schedule_calendar' class="ui-widget-content block-shadow padded omega-block"></div>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?php
|
||||
|
||||
$this->form->setAction($this->url());
|
||||
echo $this->form;
|
||||
echo var_dump($this->md);
|
||||
?>
|
||||
|
|
|
@ -777,8 +777,8 @@ dt.block-display, dd.block-display {
|
|||
font-size:16px;
|
||||
font-weight:normal;
|
||||
}
|
||||
#schedule_calendar {
|
||||
width:98.5%
|
||||
#schedule_calendar {
|
||||
width:98.5%;
|
||||
}
|
||||
div.ui-datepicker {
|
||||
/*font-size: 75%;*/
|
||||
|
|
|
@ -3,7 +3,7 @@ function addRemove(el) {
|
|||
|
||||
id = $(el).attr("id").split("_").pop();
|
||||
|
||||
span = $('<span id="search_remove_'+id+'">Remove</span>').click(function(){
|
||||
span = $('<a href="#" id="search_remove_'+id+'" class="ui-button ui-button-icon-only ui-widget ui-state-default"><span class="ui-icon ui-icon-closethick"></span><span class="ui-button-text">Remove</span></a>').click(function(){
|
||||
$(this).parent().parent().remove();
|
||||
});
|
||||
|
||||
|
@ -20,27 +20,45 @@ function ajaxAddRow() {
|
|||
$.post(url, {group: group_id}, function(json) {
|
||||
|
||||
var newRow = $(json.html).find("#fieldset-row_"+json.row);
|
||||
addRemove(newRow);
|
||||
|
||||
$("#fieldset-group_"+group_id+" dl:first").append(newRow);
|
||||
});
|
||||
}
|
||||
|
||||
function removeGroup() {
|
||||
$(this).parent().parent().remove();
|
||||
}
|
||||
|
||||
function ajaxAddGroup() {
|
||||
|
||||
var url = '/Search/newgroup/format/json';
|
||||
|
||||
$.post(url, function(json) {
|
||||
|
||||
$(".zend_form").append(json.html);
|
||||
$('[id$="search_add_row"]').click(ajaxAddRow);
|
||||
|
||||
var group = $(json.html);
|
||||
addRemove(group);
|
||||
group.find('[id$="search_add_row"]').click(ajaxAddRow);
|
||||
group.find('[id$="search_remove_group"]').click(removeGroup);
|
||||
$(".zend_form").append(group);
|
||||
});
|
||||
}
|
||||
|
||||
function advancedSearchSubmit() {
|
||||
var data = $("#advancedSearch form").serializeArray();
|
||||
|
||||
$.post("/Search/index", {format: "json", data: data}, function(json){
|
||||
var x;
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#search_add_group").click(ajaxAddGroup);
|
||||
$("#search_submit").click(advancedSearchSubmit);
|
||||
|
||||
$('[id$="search_add_row"]').click(ajaxAddRow);
|
||||
$('[id$="search_remove_group"]').click(removeGroup);
|
||||
|
||||
$('[id^="fieldset-row_"]').each(function(i, el){
|
||||
addRemove(el);
|
||||
|
|
|
@ -58,8 +58,7 @@ function findHosts(request, callback) {
|
|||
}
|
||||
|
||||
function setAddShowEvents() {
|
||||
var start, end;
|
||||
|
||||
|
||||
$("h3").click(function(){
|
||||
$(this).next().toggle();
|
||||
});
|
||||
|
@ -73,7 +72,6 @@ function setAddShowEvents() {
|
|||
});
|
||||
|
||||
$("#add_show_repeat_type").change(function(){
|
||||
var x = $(this).val();
|
||||
if($(this).val() == 2) {
|
||||
$("#add_show_day_check-label, #add_show_day_check-element").hide();
|
||||
}
|
||||
|
@ -86,11 +84,8 @@ function setAddShowEvents() {
|
|||
$("#add_show_end_date").toggle();
|
||||
});
|
||||
|
||||
start = $("#add_show_start_date");
|
||||
end = $("#add_show_end_date");
|
||||
|
||||
createDateInput(start, startDpSelect);
|
||||
createDateInput(end, endDpSelect);
|
||||
createDateInput($("#add_show_start_date"), startDpSelect);
|
||||
createDateInput($("#add_show_end_date"), endDpSelect);
|
||||
|
||||
$("#add_show_start_time").timepicker();
|
||||
$("#add_show_duration").timepicker({
|
||||
|
@ -122,6 +117,11 @@ function setAddShowEvents() {
|
|||
.click(function(event){
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
var y = $("#schedule_calendar").width();
|
||||
var z = $("#schedule-add-show").width();
|
||||
$("#schedule_calendar").width(y+z+50);
|
||||
$("#schedule_calendar").fullCalendar('render');
|
||||
$("#add-show-form").hide();
|
||||
});
|
||||
|
||||
|
@ -135,33 +135,4 @@ function setAddShowEvents() {
|
|||
$(document).ready(function() {
|
||||
|
||||
setAddShowEvents();
|
||||
|
||||
$("#fullcalendar_show_display").fullCalendar({
|
||||
header: {
|
||||
left: 'prev, next, today',
|
||||
center: 'title',
|
||||
right: 'agendaDay, agendaWeek, month'
|
||||
},
|
||||
defaultView: 'month',
|
||||
editable: false,
|
||||
allDaySlot: false,
|
||||
axisFormat: 'H:mm',
|
||||
timeFormat: {
|
||||
agenda: 'H:mm{ - H:mm}',
|
||||
month: 'H:mm{ - H:mm}'
|
||||
},
|
||||
|
||||
events: getFullCalendarEvents,
|
||||
|
||||
//callbacks
|
||||
eventRender: eventRender
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(window).load(function() {
|
||||
var mainHeight = document.documentElement.clientHeight - 200 - 50;
|
||||
|
||||
$('#fullcalendar_show_display').fullCalendar('option', 'contentHeight', mainHeight);
|
||||
$('#fullcalendar_show_display').fullCalendar('render');
|
||||
});
|
||||
|
|
|
@ -23,20 +23,16 @@ function dayClick(date, allDay, jsEvent, view) {
|
|||
|
||||
function viewDisplay( view ) {
|
||||
|
||||
var td = $('.schedule_change_slots').parent();
|
||||
td.prev().remove();
|
||||
td.remove();
|
||||
|
||||
if(view.name === 'agendaDay' || view.name === 'agendaWeek') {
|
||||
|
||||
var calendarEl = this;
|
||||
|
||||
var select = $('<select class="schedule_change_slots input_select"/>')
|
||||
.append('<option value="5">5 min</option>')
|
||||
.append('<option value="10">10 min</option>')
|
||||
.append('<option value="15">15 min</option>')
|
||||
.append('<option value="30">30 min</option>')
|
||||
.append('<option value="60">60 min</option>')
|
||||
.append('<option value="5">5m</option>')
|
||||
.append('<option value="10">10m</option>')
|
||||
.append('<option value="15">15m</option>')
|
||||
.append('<option value="30">30m</option>')
|
||||
.append('<option value="60">60m</option>')
|
||||
.change(function(){
|
||||
var x = $(this).val();
|
||||
var opt = view.calendar.options;
|
||||
|
@ -47,14 +43,28 @@ function viewDisplay( view ) {
|
|||
$(calendarEl).fullCalendar(opt);
|
||||
});
|
||||
|
||||
$('.fc-header-left tbody tr:first')
|
||||
.append('<td><span class="fc-header-space"></span></td>')
|
||||
.append('<td></td>')
|
||||
.find('td:last')
|
||||
.append(select);
|
||||
var x = $(view.element).find(".fc-agenda-head th:first");
|
||||
select.width(x.width());
|
||||
x.empty();
|
||||
x.append(select);
|
||||
|
||||
var slotMin = view.calendar.options.slotMinutes;
|
||||
$('.schedule_change_slots option[value="'+slotMin+'"]').attr('selected', 'selected');
|
||||
|
||||
}
|
||||
|
||||
if($('.fc-header-left tbody td').length === 5) {
|
||||
$('.fc-header-left tbody tr:first')
|
||||
.append('<td><span class="fc-header-space"></span></td>')
|
||||
.append('<td><a href="#" class="add-button"><span class="add-icon"></span>Show</a></td>')
|
||||
.find('td:last > a')
|
||||
.click(function(){
|
||||
$("#add-show-form").show();
|
||||
var y = $("#schedule_calendar").width();
|
||||
var z = $("#schedule-add-show").width();
|
||||
$("#schedule_calendar").width(y-z-50);
|
||||
$("#schedule_calendar").fullCalendar('render');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue