Merge branch 'master' of dev.sourcefabric.org:airtime

Conflicts:
	public/css/styles.css
This commit is contained in:
martin 2011-02-10 00:37:07 -05:00
commit 718a039bcc
15 changed files with 141 additions and 190 deletions

View file

@ -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',

View file

@ -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');
}

View file

@ -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');

View file

@ -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;
}
}

View file

@ -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'

View file

@ -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) {

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -1,6 +1,5 @@
<?php
$this->form->setAction($this->url());
echo $this->form;
echo var_dump($this->md);
?>