CC-5766 : Fix Show Contents action on calendar

removed a lot of old useless view files.
fixed a conversion for boolean fields in history.
This commit is contained in:
Naomi 2014-04-02 12:02:35 -04:00
parent 0b01f598ae
commit f6e3cae17e
22 changed files with 12 additions and 131 deletions

View File

@ -20,7 +20,6 @@ class ScheduleController extends Zend_Controller_Action
->addActionContext('show-content-dialog', 'json')
->addActionContext('clear-show', 'json')
->addActionContext('get-current-playlist', 'json')
->addActionContext('remove-group', 'json')
->addActionContext('populate-show-form', 'json')
->addActionContext('populate-repeating-show-instance-form', 'json')
->addActionContext('delete-show', 'json')
@ -351,13 +350,13 @@ class ScheduleController extends Zend_Controller_Action
$originalDateTime->format("l, F jS"),
$originalDateTime->format("G:i"));
}
$this->view->showLength = $show->getShowLength();
$this->view->timeFilled = $show->getTimeScheduled();
$this->view->percentFilled = $show->getPercentScheduled();
$this->view->showContent = $show->getShowListContent();
//$this->view->showLength = $show->getShowLength();
//$this->view->timeFilled = $show->getTimeScheduled();
//$this->view->percentFilled = $show->getPercentScheduled();
//$this->view->showContent = $show->getShowListContent();
$this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml');
$this->view->showTitle = htmlspecialchars($show->getName());
unset($this->view->showContent);
//unset($this->view->showContent);
}
public function populateRepeatingShowInstanceFormAction()

View File

@ -538,71 +538,6 @@ SQL;
{
$con = Propel::getConnection();
$sql = <<<SQL
SELECT *
FROM (
(SELECT s.starts,
0::INTEGER as type ,
f.id AS item_id,
f.track_title,
f.album_title AS album,
f.genre AS genre,
f.length AS length,
f.artist_name AS creator,
f.file_exists AS EXISTS,
f.filepath AS filepath,
f.mime AS mime
FROM cc_schedule AS s
LEFT JOIN cc_files AS f ON f.id = s.file_id
WHERE s.instance_id = :instance_id1
AND s.playout_status >= 0
AND s.file_id IS NOT NULL
AND f.hidden = 'false')
UNION
(SELECT s.starts,
1::INTEGER as type,
ws.id AS item_id,
(ws.name || ': ' || ws.url) AS title,
null AS album,
null AS genre,
ws.length AS length,
sub.login AS creator,
't'::boolean AS EXISTS,
ws.url AS filepath,
ws.mime as mime
FROM cc_schedule AS s
LEFT JOIN cc_webstream AS ws ON ws.id = s.stream_id
LEFT JOIN cc_subjs AS sub ON ws.creator_id = sub.id
WHERE s.instance_id = :instance_id2
AND s.playout_status >= 0
AND s.stream_id IS NOT NULL)) AS temp
ORDER BY starts;
SQL;
$stmt = $con->prepare($sql);
$stmt->execute(array(
':instance_id1' => $this->_instanceId,
':instance_id2' => $this->_instanceId
));
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
$userTimezone = Application_Model_Preference::GetUserTimezone();
$displayTimezone = new DateTimeZone($userTimezone);
$utcTimezone = new DateTimeZone("UTC");
foreach ($results as &$row) {
$dt = new DateTime($row["starts"], $utcTimezone);
$dt->setTimezone($displayTimezone);
$row["starts"] = $dt->format("Y-m-d H:i:s");
if (isset($row['length'])) {
$formatter = new LengthFormatter($row["length"]);
$row["length"] = $formatter->format();
}
}
return $results;
}

View File

@ -1 +0,0 @@
//left empty on purpose

View File

@ -1,3 +0,0 @@
<?php
echo $this->entries;
?>

View File

@ -1 +0,0 @@
//left empty on purpose

View File

@ -1,3 +0,0 @@
<?php
echo $this->data;
?>

View File

@ -1,7 +0,0 @@
<div id="schedule_playlist_dialog">
<input id="schedule_playlist_search" type="text"></input>
<div>
<ul id="schedule_playlist_choice"></ul>
<ul id="schedule_playlist_chosen"></ul>
</div>
</div>

View File

@ -1,31 +1,3 @@
<div id="show_content_dialog">
<div><?php echo $this->additionalShowInfo; ?></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="datatable">
<tr>
<th><?php echo _("Start") ?></th>
<th><?php echo _("Title") ?></th>
<th><?php echo _("Creator") ?></th>
<th><?php echo _("Album") ?></th>
<th><?php echo _("Length") ?></th>
<th><?php echo _("Genre") ?></th>
</tr>
<?php $i=0; ?>
<?php foreach($this->showContent as $row): ?>
<tr id="au_<?php echo $row["item_id"] ?>" class="<?php if($i&1){echo "even";}else{echo "odd";}?>">
<td><?php echo $row["starts"] ?></td>
<td><?php echo $this->escape($row["track_title"]) ?></td>
<td><?php echo $this->escape($row["creator"]) ?></td>
<td><?php echo $this->escape($row["album"]) ?></td>
<td class="library_length"><?php echo $row["length"] ?></td>
<td><?php echo $row["genre"] ?></td>
</tr>
<?php $i=$i+1; ?>
<?php endforeach; ?>
</table>
<br/>
<div id="show_time_info">
<span id="show_time_filled" class="time"><?php echo $this->timeFilled; ?></span>
<div id="show_progressbar"></div>
<span id="show_length" class="time"><?php echo $this->showLength; ?></span>
</div>
<div><?php echo $this->additionalShowInfo; ?></div>
</div>

View File

@ -1,2 +0,0 @@
<div id='json-string'></div>
<div id='demo'></div>

View File

@ -302,7 +302,7 @@ var AIRTIME = (function(AIRTIME) {
"bJQueryUI": true,
"bAutoWidth": true,
"sDom": 'Rlf<"btn-table-search"><"dt-process-rel"r><"H"<"library_toolbar"C>><"dataTables_scrolling"t><"F"ip>',
"sDom": 'Rlf<"dt-process-rel"r><"H"<"library_toolbar"C>><"dataTables_scrolling"t><"F"ip>',
"oColVis": {
"sAlign": "right",
@ -346,7 +346,7 @@ var AIRTIME = (function(AIRTIME) {
});
//append a search button
$panel.find(".dataTables_filter").append('<button class="btn btn-search" type="button">Search</button>');
$panel.find(".dataTables_filter").append('<button class="btn btn-small btn-search" type="button">Search</button>');
//only search on enter.
$panel.on("keypress", ".advanced_search input", function(e) {

View File

@ -393,7 +393,7 @@ var AIRTIME = (function(AIRTIME) {
for (b in booleans) {
text = aData[b] ? checkedCheckBox : emptyCheckBox;
text = aData[b] === "1" ? checkedCheckBox : emptyCheckBox;
text = text + " " + booleans[b];
$nRow.find(".his_"+b).html(text);

View File

@ -171,9 +171,7 @@ function buildScheduleDialog (json, instance_id) {
{
text: $.i18n._("Ok"),
"class": "btn",
click: function() {
$(this).dialog("close");
}
click: closeDialogCalendar
}
]
});
@ -211,10 +209,6 @@ function buildContentDialog (json){
alertShowErrorAndReload();
}
dialog.find("#show_progressbar").progressbar({
value: json.percentFilled
});
dialog.dialog({
autoOpen: false,
title: $.i18n._("Contents of Show") +" '" + json.showTitle + "'",
@ -226,9 +220,7 @@ function buildContentDialog (json){
{
text: $.i18n._("Ok"),
"class": "btn",
click: function() {
dialog.remove();
}
click: closeDialogCalendar
}
]
});
@ -416,7 +408,7 @@ $(document).ready(function() {
callback = function() {
$.get(oItems.content.url, {format: "json", id: data.id}, function(json){
buildContentDialog(json);
buildContentDialog(json, data.id);
});
};
oItems.content.callback = callback;