diff --git a/livesupport/modules/htmlUI/var/html/styles.css b/livesupport/modules/htmlUI/var/html/styles.css index e92466b5d..2f0b2cfa7 100755 --- a/livesupport/modules/htmlUI/var/html/styles.css +++ b/livesupport/modules/htmlUI/var/html/styles.css @@ -1,11 +1,11 @@ body { - background-color : ThreedLightShadow; + background-color : #d4d0c8; font-family : monospace; } #masterpanel { text-align: center; - background-color : ThreedLightShadow; + background-color : #d4d0c8; height: 800px; font-family : monospace; } diff --git a/livesupport/modules/htmlUI/var/html/ui_browser.php b/livesupport/modules/htmlUI/var/html/ui_browser.php index 7a9b174b6..4fe3dcb43 100644 --- a/livesupport/modules/htmlUI/var/html/ui_browser.php +++ b/livesupport/modules/htmlUI/var/html/ui_browser.php @@ -161,6 +161,7 @@ if ($uiBrowser->userid) { case "PL.editMetaData": $Smarty->assign('PL_editMetaData', TRUE); + $Smarty->assign('PL_id', $_REQUEST['id']); $Smarty->assign('PL_simpleManagement', TRUE); break; diff --git a/livesupport/modules/htmlUI/var/html/ui_handler.php b/livesupport/modules/htmlUI/var/html/ui_handler.php index 541ca7b8e..e9049365b 100644 --- a/livesupport/modules/htmlUI/var/html/ui_handler.php +++ b/livesupport/modules/htmlUI/var/html/ui_handler.php @@ -228,6 +228,7 @@ switch($_REQUEST['act']){ case "PL.editMetaData": $uiHandler->PLAYLIST->editMetaData($_REQUEST); + $uiHandler->SCRATCHPAD->addItem($_REQUEST['id']); break; case "SCHEDULER.set": @@ -240,6 +241,11 @@ switch($_REQUEST['act']){ $uiHandler->SCHEDULER->setReload(); break; + case "SCHEDULER.removeFromScheduleMethod": + $uiHandler->SCHEDULER->removeFromScheduleMethod($_REQUEST); + $uiHandler->SCHEDULER->setReload(); + break; + default: $uiHandler->_retMsg("Unknown method: $1", $_REQUEST["act"]); $uiHandler->redirUrl = UI_BROWSER; diff --git a/livesupport/modules/htmlUI/var/templates/playlist/metadata.tpl b/livesupport/modules/htmlUI/var/templates/playlist/metadata.tpl index 19f3c61dc..111d84a8e 100755 --- a/livesupport/modules/htmlUI/var/templates/playlist/metadata.tpl +++ b/livesupport/modules/htmlUI/var/templates/playlist/metadata.tpl @@ -1,4 +1,4 @@ -{assign var="_form" value=$PL->metaDataForm()} +{assign var="_form" value=$PL->metaDataForm($PL_id)} {assign var="dynform" value=$_form.main} {$_form.langswitch} diff --git a/livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl b/livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl index 8160e8d9e..02fc38171 100755 --- a/livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl +++ b/livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl @@ -4,13 +4,11 @@

Simple Playlist Management

-{if is_array($PL->get())} {* already activated Playlist *} - {if $PL_editMetaData} +{if $PL_editMetaData} {include file="playlist/metadata.tpl"} - {else} - {include file="playlist/editor.tpl"} - {/if} -{else} {* no active Playlist *} +{elseif is_array($PL->get())} {* already activated Playlist *} + {include file="playlist/editor.tpl"} +{else} {* no active Playlist *} {if $PL->reportLookedPL()} {else} diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl index 7821f9263..814c19136 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl @@ -1,26 +1,47 @@ {$SCHEDULER->buildDay()} {assign var="_usage" value=$SCHEDULER->getDayUsage($SCHEDULER->curr.year, $SCHEDULER->curr.month, $SCHEDULER->curr.day)} +{assign var="_divisor" value=70} - +
{foreach from=$SCHEDULER->Day item="_Hour"} {assign var="_hour" value=$_Hour.hour} - {assign var="_border" value=""} + - - + {if !$_one} + + {assign var="_one" value=TRUE} + {/if} + + {foreach from=$_usage item="_entry"} + {if $_entry.pos >= $_Hour.timestamp && $_entry.pos < $_Hour.timestamp+3600} + + {/if} + {/foreach} {/foreach} diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl index c300f9bf0..9b35f90fb 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl @@ -22,7 +22,7 @@ {foreach from=$_oneday item="i"} {if is_array($i.entry)} - {else} - {/if} diff --git a/livesupport/modules/htmlUI/var/templates/script/contextMenue.js.tpl b/livesupport/modules/htmlUI/var/templates/script/contextMenue.js.tpl index f05898b8e..498d8c587 100755 --- a/livesupport/modules/htmlUI/var/templates/script/contextMenue.js.tpl +++ b/livesupport/modules/htmlUI/var/templates/script/contextMenue.js.tpl @@ -60,6 +60,10 @@ function menu(param) { menuHtml = menuHtml + ""; break; + case "PL.editMetaData": + menuHtml = menuHtml + ""; + break; + case "SP.addItem": menuHtml = menuHtml + ""; break; diff --git a/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl b/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl index 5d7e68b58..570ada9b5 100755 --- a/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl +++ b/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl @@ -21,7 +21,7 @@ onContextmenu="return menu('{$i.id}' , 'PL.addItem', 'delete' {/if} {else} - , 'PL.activate', 'PL.create', 'edit', 'delete' + , 'PL.activate', 'PL.create', 'PL.editMetaData', 'delete' {/if} {/if} diff --git a/livesupport/modules/htmlUI/var/ui_playlist.class.php b/livesupport/modules/htmlUI/var/ui_playlist.class.php index a005a2143..6967bf54f 100755 --- a/livesupport/modules/htmlUI/var/ui_playlist.class.php +++ b/livesupport/modules/htmlUI/var/ui_playlist.class.php @@ -353,15 +353,18 @@ class uiPlaylist } - function metaDataForm($get=TRUE) + function metaDataForm($id, $get=TRUE, $data=FALSE) { include dirname(__FILE__).'/formmask/metadata.inc.php'; + + #$id = $this->activeId; + foreach ($mask['playlist'] as $k=>$v) { $mask['playlist'][$k]['element'] = $this->Base->_formElementEncode($v['element']); ## recive data from GreenBox if ($get) { - $mask['playlist'][$k]['default'] = $this->Base->_getMDataValue($this->activeId, $v['element']); + $mask['playlist'][$k]['default'] = $this->Base->_getMDataValue($id, $v['element']); } ## get data from parameter @@ -374,7 +377,7 @@ class uiPlaylist $this->Base->_parseArr2Form($form, $mask['playlist']); $this->Base->_parseArr2Form($form, $mask['buttons']); $form->setConstants(array('act' => 'PL.editMetaData', - 'id' => $this->activeId)); + 'id' => $id)); $renderer =& new HTML_QuickForm_Renderer_Array(true, true); $form->accept($renderer); $output['main'] = $renderer->toArray(); @@ -392,6 +395,9 @@ class uiPlaylist { include dirname(__FILE__).'/formmask/metadata.inc.php'; + #$id = $this->activeId; + $id = $formdata['id']; + ## first remove old entrys #$this->gb->replaceMetaData($id, $this->_analyzeFile($id, 'xml'), 'string', $this->sessid); @@ -402,13 +408,14 @@ class uiPlaylist $data = $this->Base->_dateArr2Str($mData); foreach ($data as $key=>$val) { - $r = $this->Base->gb->setMDataValue($this->activeId, $key, $this->Base->sessid, $val); + $r = $this->Base->gb->setMDataValue($id, $key, $this->Base->sessid, $val); if (PEAR::isError($r)) { $this->Base->_retMsg('Unable to set $1: $2', $key, $val); } } $this->Base->_retMsg('Metadata saved'); - $this->Base->redirUrl = UI_BROWSER."?act=PL.simpleManagement&id=".$this->activeId; + #$this->Base->redirUrl = UI_BROWSER."?act=PL.simpleManagement&id=$id"; + $this->Base->redirUrl = UI_BROWSER."?act=PL.editMetaData&id=$id"; } diff --git a/livesupport/modules/htmlUI/var/ui_scheduler.class.php b/livesupport/modules/htmlUI/var/ui_scheduler.class.php index 8b72377ef..9db9814e2 100755 --- a/livesupport/modules/htmlUI/var/ui_scheduler.class.php +++ b/livesupport/modules/htmlUI/var/ui_scheduler.class.php @@ -81,7 +81,8 @@ class uiScheduler extends uiCalendar foreach ($arr as $key=>$val) { $arr[$key]['title'] = $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE); $arr[$key]['creator'] = $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR); - $arr[$key]['timestamp'] = $this->_datetime2timestamp($val['start']); + $arr[$key]['pos'] = $this->_datetime2timestamp($val['start']); + $arr[$key]['span'] = date('H', $this->_datetime2timestamp($val['end'])) - date('H', $this->_datetime2timestamp($val['start'])) +1; } #print_r($arr); return $arr; @@ -261,7 +262,19 @@ class uiScheduler extends uiCalendar if ($this->_isError($r)) return FALSE; if (isset($r['scheduleEntryId'])) - $this->Base->_retMsg('ScheduleId: $1', $r['scheduleEntryId']); + $this->Base->_retMsg('Entry added at $1 with ScheduleId: $2', $datetime, $r['scheduleEntryId']); + } + + + function removeFromScheduleMethod(&$formdata) + { + $gunid = $formdata['gunid']; + #echo "Unschedule Gunid: $gunid"; + $r = $this->spc->removeFromScheduleMethod($this->Base->sessid, $gunid); + #print_r($r); + if ($this->_isError($r)) + return FALSE; + $this->Base->_retMsg('Entry with ScheduleId $1 removed', $gunid); }
- {$_Hour.hour} - - {foreach from=$_usage item="_entry"} - {if $_entry.timestamp >= $_Hour.timestamp && $_entry.timestamp < $_Hour.timestamp+3600} - {$_border} - {$_entry.title} - {$_entry.start|regex_replace:"/[0-9]+T/":""|truncate:5:""}-{$_entry.end|regex_replace:"/[0-9]+T/":""|truncate:5:""} - {$_entry.creator} - {assign var="_border" value="|"} - {/if} - {/foreach} + + {$_Hour.hour} + {assign var="_oneday" value=$SCHEDULER->getDayTiming($SCHEDULER->curr.year, $SCHEDULER->curr.month, $SCHEDULER->curr.day)} + + {foreach from=$_oneday item="i"} + + {if is_array($i.entry)} + + {else} + + {/if} + + {/foreach} +
+ +
+ {$_entry.title} + {$_entry.start|regex_replace:"/[0-9]+T/":""|truncate:5:""}-{$_entry.end|regex_replace:"/[0-9]+T/":""|truncate:5:""} +
+ {$_entry.creator} +
+ X +
+ {if $i.length/$_divisor > $_minwidth} {$i.entry.title} @@ -34,7 +34,7 @@ {/if} +
 Change Fadeout 
 Edit MData 
 Add to ScratchPad