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)"
." VALUES ($id, $p_playlistId, TIMESTAMP '$itemStartTime', "
." (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']}')";
$result = $CC_DBC->query($sql);
if (PEAR::isError($result)) {
@ -168,6 +168,7 @@ class ScheduleGroup {
}
$sql = "DELETE FROM ".$CC_CONFIG["scheduleTable"]
." WHERE group_id = ".$this->groupId;
return $CC_DBC->query($sql);
}

View File

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

View File

@ -1,7 +1,7 @@
{include file="popup/header.tpl"}
<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>
<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">

View File

@ -36,7 +36,7 @@
{foreach from=$_entrys[$_hour].end item="i"}
{if $i.startsyesterday}
<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;
<b>{$i.title}</b>
##yesterday## {$i.start} - {$i.end}
@ -50,7 +50,7 @@
{if $_entrys[$_hour].start}
{foreach from=$_entrys[$_hour].start item="i"}
<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;
<b>{$i.title}</b>

View File

@ -1,8 +1,8 @@
style="cursor: pointer"
{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}
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}

View File

@ -1,2 +1,2 @@
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":
//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;
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;
case "SCHEDULER.addPL":

View File

@ -154,12 +154,13 @@ if (isset($_REQUEST['popup']) && is_array($_REQUEST['popup'])){
break;
case "SCHEDULER.addItem":
$uiHandler->SCHEDULER->setScheduleAtTime($_REQUEST);
$uiHandler->SCHEDULER->setScheduleAtTime($_REQUEST);
$Smarty->display('popup/SCHEDULER.addItem.tpl');
break;
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');
break;

View File

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