show will open dialog properly showing scheduled content if there is any

This commit is contained in:
naomiaro 2011-01-13 18:27:44 -05:00
parent a8f24952bd
commit f312ea0d60
6 changed files with 34 additions and 16 deletions

View file

@ -146,6 +146,11 @@ class ScheduleController extends Zend_Controller_Action
$end = $this->_getParam('end');
$showId = $this->_getParam('showId');
$day = $this->_getParam('day');
$search = $this->_getParam('search', null);
if($search == "") {
$search = null;
}
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
@ -159,7 +164,7 @@ class ScheduleController extends Zend_Controller_Action
$show->scheduleShow($start, array($plId));
}
$this->view->playlists = $show->searchPlaylistsForShow($day);
$this->view->playlists = $show->searchPlaylistsForShow($day, $search);
$this->view->showContent = $show->getShowContent($start);
$this->view->choice = $this->view->render('schedule/find-playlists.phtml');

View file

@ -2,4 +2,7 @@
if(count($this->playlists) > 0) {
echo $this->partialLoop('schedule/find-playlists-partial.phtml', $this->playlists);
}
else {
echo "No Playlists Fit Duration";
}
?>

View file

@ -2,4 +2,7 @@
if(count($this->playlists) > 0) {
echo $this->partialLoop('schedule/find-playlists-partial.phtml', $this->playlists);
}
else {
echo "No Playlists Fit Duration";
}
?>

View file

@ -1,9 +1,5 @@
<div id="schedule_playlist_dialog">
<input id="schedule_playlist_search" type="text"></input>
<ul id="schedule_playlist_choice">
<?php
echo $this->partialLoop('schedule/find-playlists-partial.phtml', $this->playlists);
?>
</ul>
<ul id="schedule_playlist_chosen">No Playlists</ul>
<ul id="schedule_playlist_choice"></ul>
<ul id="schedule_playlist_chosen"></ul>
</div>

View file

@ -20,5 +20,7 @@
</div>
</li>
<?php endforeach; ?>
<?php else : ?>
<li>No Playlists</li>
<?php endif; ?>

View file

@ -159,7 +159,7 @@ function openShowDialog() {
});
}
function makeScheduleDialog(dialog, show) {
function makeScheduleDialog(dialog, json, show) {
dialog.find("#schedule_playlist_search").keyup(function(){
var url, string, day;
@ -172,20 +172,29 @@ function makeScheduleDialog(dialog, show) {
$("#schedule_playlist_choice")
.empty()
.append(html);
.append(html)
.find('li')
.draggable({
helper: 'clone'
});
});
});
dialog.find('#schedule_playlist_choice li')
.draggable({
helper: 'clone'
});
dialog.find('#schedule_playlist_choice')
.append(json.choice)
.find('li')
.draggable({
helper: 'clone'
});
dialog.find("#schedule_playlist_chosen")
.append(json.chosen)
.droppable({
drop: function(event, ui) {
var li, pl_id, url, start_date, end_date, day;
var li, pl_id, url, start_date, end_date, day, search;
search = $("#schedule_playlist_search").val();
pl_id = $(ui.helper).attr("id").split("_").pop();
day = show.start.getDay();
@ -196,7 +205,7 @@ function makeScheduleDialog(dialog, show) {
url = '/Schedule/schedule-show/format/json';
$.post(url,
{plId: pl_id, start: start_date, end: end_date, showId: show.id, day: day},
{plId: pl_id, start: start_date, end: end_date, showId: show.id, day: day, search: search},
function(json){
var x;
@ -231,7 +240,7 @@ function openScheduleDialog(show) {
function(json){
var dialog = $(json.dialog);
makeScheduleDialog(dialog, show);
makeScheduleDialog(dialog, json, show);
dialog.dialog({
autoOpen: false,