fixing gui so playlists can again be scheduled, removed.

This commit is contained in:
naomiaro 2010-10-19 04:58:48 -04:00
parent c8df3578ca
commit 5750f38343
9 changed files with 19 additions and 22 deletions

View File

@ -127,7 +127,7 @@ class ScheduleGroup {
." clip_length, cue_in, cue_out, fade_in, fade_out)" ." clip_length, cue_in, cue_out, fade_in, fade_out)"
." VALUES ($id, $p_playlistId, TIMESTAMP '$itemStartTime', " ." VALUES ($id, $p_playlistId, TIMESTAMP '$itemStartTime', "
." (TIMESTAMP '$itemStartTime' + INTERVAL '$trackLength')," ." (TIMESTAMP '$itemStartTime' + INTERVAL '$trackLength'),"
." {$this->groupId}, {$row['file_id']}, '$trackLength', '{$row['cuein']}'," ." '{$this->groupId}', '{$row['file_id']}', '$trackLength', '{$row['cuein']}',"
." '{$row['cueout']}', '{$row['fadein']}','{$row['fadeout']}')"; ." '{$row['cueout']}', '{$row['fadein']}','{$row['fadeout']}')";
$result = $CC_DBC->query($sql); $result = $CC_DBC->query($sql);
if (PEAR::isError($result)) { if (PEAR::isError($result)) {
@ -168,6 +168,7 @@ class ScheduleGroup {
} }
$sql = "DELETE FROM ".$CC_CONFIG["scheduleTable"] $sql = "DELETE FROM ".$CC_CONFIG["scheduleTable"]
." WHERE group_id = ".$this->groupId; ." WHERE group_id = ".$this->groupId;
return $CC_DBC->query($sql); return $CC_DBC->query($sql);
} }

View File

@ -88,9 +88,9 @@ function SCHEDULE_snap2Next()
var duration = SCHEDULE_timeToMilliseconds(SCHEDULE_selectedDuration()); var duration = SCHEDULE_timeToMilliseconds(SCHEDULE_selectedDuration());
// Get the date of the "next item" (time is set to midnight). // Get the date of the "next item" (time is set to midnight).
var beginDate = new Date({$SCHEDULER->scheduleNext.year}, var beginDate = new Date("{$SCHEDULER->scheduleNext.year}",
{$SCHEDULER->scheduleNext.month}, "{$SCHEDULER->scheduleNext.month}",
{$SCHEDULER->scheduleNext.day}); "{$SCHEDULER->scheduleNext.day}");
//debugBeginDate = ""+beginDate; //debugBeginDate = ""+beginDate;
// Calculate the final time by starting with the "next item" date at midnight, // Calculate the final time by starting with the "next item" date at midnight,

View File

@ -1,7 +1,7 @@
{include file="popup/header.tpl"} {include file="popup/header.tpl"}
<center> <center>
{tra str='Are you sure to remove playlist "$1"?' 1=$playlistName} {tra str='Are you sure you want to remove "$1"?' 1=$playlistName}
<br><br> <br><br>
<input type="button" class="button" onClick="window.close()" value="Cancel"> <input type="button" class="button" onClick="window.close()" value="Cancel">
<input type="button" class="button" onClick="location.href='{$UI_HANDLER}?act=SCHEDULER.removeItem&scheduleId={$_REQUEST.scheduleId}'" value="OK"> <input type="button" class="button" onClick="location.href='{$UI_HANDLER}?act=SCHEDULER.removeItem&scheduleId={$_REQUEST.scheduleId}'" value="OK">

View File

@ -36,7 +36,7 @@
{foreach from=$_entrys[$_hour].end item="i"} {foreach from=$_entrys[$_hour].end item="i"}
{if $i.startsyesterday} {if $i.startsyesterday}
<div {include file="scheduler/removeitem.tpl"}> <div {include file="scheduler/removeitem.tpl"}>
<img src="img/playlist.png" border="0" {* include file="sub/alttext.tpl"*}> <img src="html/img/playlist.png" border="0" {* include file="sub/alttext.tpl"*}>
&nbsp; &nbsp;
<b>{$i.title}</b> <b>{$i.title}</b>
##yesterday## {$i.start} - {$i.end} ##yesterday## {$i.start} - {$i.end}
@ -50,7 +50,7 @@
{if $_entrys[$_hour].start} {if $_entrys[$_hour].start}
{foreach from=$_entrys[$_hour].start item="i"} {foreach from=$_entrys[$_hour].start item="i"}
<div {include file="scheduler/removeitem.tpl"}> <div {include file="scheduler/removeitem.tpl"}>
<img src="img/playlist.png" border="0" {*include file="sub/alttext.tpl"*}> <img src="html/img/playlist.png" border="0" {*include file="sub/alttext.tpl"*}>
&nbsp; &nbsp;
<b>{$i.title}</b> <b>{$i.title}</b>

View File

@ -1,8 +1,8 @@
style="cursor: pointer" style="cursor: pointer"
{if $_endH == $_hour} {if $_endH == $_hour}
onClick="return contextmenu('year={$SCHEDULER->curr.year}&month={$SCHEDULER->curr.month}&day={$SCHEDULER->curr.day}&hour={getHour time=$i.end}&minute={getMinute time=$i.end}&second={getSecond time=$i.end plus=1}', 'SCHEDULER.addItem')" onClick="return contextmenu('&year={$SCHEDULER->curr.year}&month={$SCHEDULER->curr.month}&day={$SCHEDULER->curr.day}&hour={getHour time=$i.end}&minute={getMinute time=$i.end}&second={getSecond time=$i.end plus=1}', null, 'SCHEDULER.addItem')"
{else} {else}
onClick="return contextmenu('year={$SCHEDULER->curr.year}&month={$SCHEDULER->curr.month}&day={$SCHEDULER->curr.day}&hour={$_hour}&minute=0&second=0', 'SCHEDULER.addItem')" onClick="return contextmenu('&year={$SCHEDULER->curr.year}&month={$SCHEDULER->curr.month}&day={$SCHEDULER->curr.day}&hour={$_hour}&minute=0&second=0', null, 'SCHEDULER.addItem')"
{/if} {/if}

View File

@ -1,2 +1,2 @@
style="cursor: pointer" style="cursor: pointer"
onClick="return contextmenu('scheduleId={$i.scheduleid}&playlistId={$i.id}', 'SCHEDULER.removeItem')" onClick="return contextmenu('&scheduleId={$i.scheduleid}&playlistId={$i.id}', null, 'SCHEDULER.removeItem')"

View File

@ -95,11 +95,11 @@ function contextmenu(param, type) {
case "SCHEDULER.addItem": case "SCHEDULER.addItem":
//contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: hpopup('{$UI_HANDLER}?act=SCHEDULER.setScheduleAtTime&"+param+"'); popup('{$UI_BROWSER}?popup[]=SCHEDULER.addItem', 'Schedule', 420, 200)\" "+oF+">&nbsp;##Insert playlist here##&nbsp;</a></li>"; //contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: hpopup('{$UI_HANDLER}?act=SCHEDULER.setScheduleAtTime&"+param+"'); popup('{$UI_BROWSER}?popup[]=SCHEDULER.addItem', 'Schedule', 420, 200)\" "+oF+">&nbsp;##Insert playlist here##&nbsp;</a></li>";
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: popup('{$UI_BROWSER}?popup[]=SCHEDULER.addItem&"+param+"', 'Schedule', 420, 200)\" "+oF+">&nbsp;##Insert playlist here##&nbsp;</a></li>"; contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: popup('{$UI_BROWSER}?popup[]=SCHEDULER.addItem&id="+param+"', 'Schedule', 420, 200)\" "+oF+">&nbsp;##Insert playlist here##&nbsp;</a></li>";
break; break;
case "SCHEDULER.removeItem": case "SCHEDULER.removeItem":
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: popup('{$UI_BROWSER}?popup[]=SCHEDULER.removeItem&"+param+"', 'Schedule', 400, 50)\" "+oF+">&nbsp;##Remove playlist##&nbsp;</a></li>"; contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: popup('{$UI_BROWSER}?popup[]=SCHEDULER.removeItem&id="+param+"', 'Schedule', 400, 50)\" "+oF+">&nbsp;##Remove playlist##&nbsp;</a></li>";
break; break;
case "SCHEDULER.addPL": case "SCHEDULER.addPL":

View File

@ -154,12 +154,13 @@ if (isset($_REQUEST['popup']) && is_array($_REQUEST['popup'])){
break; break;
case "SCHEDULER.addItem": case "SCHEDULER.addItem":
$uiHandler->SCHEDULER->setScheduleAtTime($_REQUEST); $uiHandler->SCHEDULER->setScheduleAtTime($_REQUEST);
$Smarty->display('popup/SCHEDULER.addItem.tpl'); $Smarty->display('popup/SCHEDULER.addItem.tpl');
break; break;
case "SCHEDULER.removeItem": case "SCHEDULER.removeItem":
$Smarty->assign('playlistName', $uiBrowser->getMetadataValue($_REQUEST['playlistId'], UI_MDATA_KEY_TITLE)); $info = $uiBrowser->getPLMetaInfo($_REQUEST['playlistId']);
$Smarty->assign('playlistName', $info['title']);
$Smarty->display('popup/SCHEDULER.removeItem.tpl'); $Smarty->display('popup/SCHEDULER.removeItem.tpl');
break; break;

View File

@ -209,6 +209,7 @@ class uiScheduler extends uiCalendar {
// $hour = $arr['hour']; // $hour = $arr['hour'];
// $minute = $arr['minute']; // $minute = $arr['minute'];
// $second = $arr['second']; // $second = $arr['second'];
extract($arr); extract($arr);
if (isset($today)) { if (isset($today)) {
@ -565,13 +566,8 @@ class uiScheduler extends uiCalendar {
public function getPlaylistToSchedule($id) public function getPlaylistToSchedule($id)
{ {
if ($id) { if ($id) {
$this->Base->SCRATCHPAD->addItem($id); $this->Base->SCRATCHPAD->addItem($id, 'playlist');
$this->availablePlaylists[] = array( $this->availablePlaylists[] = $this->Base->getPLMetaInfo($id);
'gunid' => BasicStor::GunidFromId($id),
'id' => $id,
'title' => $this->Base->getMetadataValue($id, UI_MDATA_KEY_TITLE),
'duration' => $this->Base->getMetadataValue($id, UI_MDATA_KEY_DURATION),
);
return TRUE; return TRUE;
} else { } else {
return $this->copyPlaylistFromScratchpad(); return $this->copyPlaylistFromScratchpad();
@ -1063,7 +1059,6 @@ class uiScheduler extends uiCalendar {
$item = new ScheduleGroup(); $item = new ScheduleGroup();
$groupId = $item->add($datetime, null, $playlistId); $groupId = $item->add($datetime, null, $playlistId);
//$_SESSION["debug"] = $groupId;
return $groupId; return $groupId;
} }