From ad869e0f7fd21f2e3e48c8fcffaed16b1bfa5bad Mon Sep 17 00:00:00 2001 From: naomiaro <naomiaro@gmail.com> Date: Wed, 12 Jan 2011 19:40:05 -0500 Subject: [PATCH] will display in the UI what is scheduled in a show when you add things. --- .../controllers/ScheduleController.php | 3 +++ application/models/Shows.php | 11 +++++---- .../schedule/scheduled-content-partial.phtml | 2 -- .../scripts/schedule/scheduled-content.phtml | 24 +++++++++++++++++++ public/js/airtime/schedule/schedule.js | 8 +++---- 5 files changed, 37 insertions(+), 11 deletions(-) delete mode 100644 application/views/scripts/schedule/scheduled-content-partial.phtml create mode 100644 application/views/scripts/schedule/scheduled-content.phtml diff --git a/application/controllers/ScheduleController.php b/application/controllers/ScheduleController.php index 8500453f3..827351760 100644 --- a/application/controllers/ScheduleController.php +++ b/application/controllers/ScheduleController.php @@ -156,6 +156,9 @@ class ScheduleController extends Zend_Controller_Action $show->scheduleShow($start, array($plId)); $this->view->showContent = $show->getShowContent($start); + $this->view->chosen = $this->view->render('schedule/scheduled-content.phtml'); + + unset($this->view->showContent); } else { diff --git a/application/models/Shows.php b/application/models/Shows.php index c1fe42c1d..24a93ebff 100644 --- a/application/models/Shows.php +++ b/application/models/Shows.php @@ -305,18 +305,19 @@ class Show { $items[$pl_counter]["pl_name"] = $row["name"]; $items[$pl_counter]["pl_creator"] = $row["creator"]; - $items[$pl_counter]["pl_description"] = $row["description"]; + $items[$pl_counter]["pl_description"] = $row["description"]; + $items[$pl_counter]["pl_group"] = $row["group_id"]; - $sql = "SELECT SUM(clip_length) FROM cc_schedule WHERE group_id = '{$currGroupId}'"; + $sql = "SELECT SUM(clip_length) FROM cc_schedule WHERE group_id = '{$currGroupId}'"; $length = $CC_DBC->GetOne($sql); $items[$pl_counter]["pl_length"] = $length; } $f_counter = $f_counter + 1; - $items[$pl_counter][$f_counter]["f_name"] = $row["track_title"]; - $items[$pl_counter][$f_counter]["f_artist"] = $row["artist_name"]; - $items[$pl_counter][$f_counter]["f_length"] = $row["length"]; + $items[$pl_counter]["pl_content"][$f_counter]["f_name"] = $row["track_title"]; + $items[$pl_counter]["pl_content"][$f_counter]["f_artist"] = $row["artist_name"]; + $items[$pl_counter]["pl_content"][$f_counter]["f_length"] = $row["length"]; } return $items; diff --git a/application/views/scripts/schedule/scheduled-content-partial.phtml b/application/views/scripts/schedule/scheduled-content-partial.phtml deleted file mode 100644 index 6e2d847d7..000000000 --- a/application/views/scripts/schedule/scheduled-content-partial.phtml +++ /dev/null @@ -1,2 +0,0 @@ -<h3>First header</h3> -<div>First content</div> diff --git a/application/views/scripts/schedule/scheduled-content.phtml b/application/views/scripts/schedule/scheduled-content.phtml new file mode 100644 index 000000000..7e82b36ea --- /dev/null +++ b/application/views/scripts/schedule/scheduled-content.phtml @@ -0,0 +1,24 @@ +<?php if(count($this->showContent) > 0) : ?> + <?php foreach($this->showContent as $pl) : ?> + <li id="g_<?php echo $pl["pl_group"] ?>" class="ui-widget-content"> + <h3> + <div> + <span><?php echo $pl["pl_name"] ?></span> + <span><?php echo $pl["pl_length"] ?></span> + </div> + <div><?php echo $pl["pl_creator"] ?></div> + <div><?php echo $pl["pl_description"] ?></div> + </h3> + <div> + <?php foreach($pl["pl_content"] as $file) : ?> + <div> + <span><?php echo $file["f_name"] ?></span> + <span><?php echo $file["f_length"] ?></span> + </div> + <div><?php echo $file["f_artist"] ?></div> + <?php endforeach; ?> + </div> + </li> + <?php endforeach; ?> +<?php endif; ?> + diff --git a/public/js/airtime/schedule/schedule.js b/public/js/airtime/schedule/schedule.js index 5a1d327d2..eb47d9169 100644 --- a/public/js/airtime/schedule/schedule.js +++ b/public/js/airtime/schedule/schedule.js @@ -194,14 +194,14 @@ function makeScheduleDialog(dialog, show) { url = '/Schedule/schedule-show/format/json'; - //$("#schedule_playlist_chosen") - // .append(ui.helper); - - $.post(url, {plId: pl_id, start: start_date, end: end_date, showId: show.id}, function(json){ var x; + + $("#schedule_playlist_chosen") + .empty() + .append(json.chosen); }); }