diff --git a/livesupport/modules/htmlUI/var/SmartyExtensions.inc.php b/livesupport/modules/htmlUI/var/SmartyExtensions.inc.php index 2a4a44c45..f92855cbc 100644 --- a/livesupport/modules/htmlUI/var/SmartyExtensions.inc.php +++ b/livesupport/modules/htmlUI/var/SmartyExtensions.inc.php @@ -1,8 +1,8 @@ register_object('UIBROWSER', $uiBrowser); -$Smarty->register_object('PL', $uiBrowser->PLAYLIST); $Smarty->register_object('BROWSE', $uiBrowser->BROWSE); $Smarty->register_object('SEARCH', $uiBrowser->SEARCH); +$Smarty->assign_by_ref ('PL', $uiBrowser->PLAYLIST); $Smarty->assign_by_ref ('SCHEDULER', $uiBrowser->SCHEDULER); $Smarty->register_function('str_repeat', 'S_str_repeat'); diff --git a/livesupport/modules/htmlUI/var/formmask/metadata.inc.php b/livesupport/modules/htmlUI/var/formmask/metadata.inc.php index 8be049bc8..49ca1659d 100755 --- a/livesupport/modules/htmlUI/var/formmask/metadata.inc.php +++ b/livesupport/modules/htmlUI/var/formmask/metadata.inc.php @@ -4,7 +4,6 @@ $mask = array( array( 'element' => 'act', 'type' => 'hidden', - 'constant'=> 'editMetaData' ), array( 'element' => 'id', @@ -502,6 +501,35 @@ $mask = array( 'label' => 'Copyright', ), ) + ), + 'playlist' => array( + array( + 'element' => 'dc:title', + 'type' => 'text', + 'label' => 'Title', + 'required' => TRUE, + 'id3' => 'Title' + ), + array( + 'element' => 'dc:creator', + 'type' => 'text', + 'label' => 'Creator', + 'required' => TRUE, + 'id3' => 'Artist' + ), + array( + 'element' => 'dcterms:extent', + 'type' => 'text', + 'label' => 'Length', + 'attributes'=> array('readonly' => 'on'), + 'id3' => FALSE + ), + array( + 'element' => 'dc:description', + 'type' => 'textarea', + 'label' => 'Description', + 'id3' => 'Comment' + ), ) ); ?> \ No newline at end of file diff --git a/livesupport/modules/htmlUI/var/html/img/1x1.png b/livesupport/modules/htmlUI/var/html/img/1x1.png new file mode 100755 index 000000000..69617e24c Binary files /dev/null and b/livesupport/modules/htmlUI/var/html/img/1x1.png differ diff --git a/livesupport/modules/htmlUI/var/html/img/1x1blue.png b/livesupport/modules/htmlUI/var/html/img/1x1blue.png new file mode 100755 index 000000000..35627bdf4 Binary files /dev/null and b/livesupport/modules/htmlUI/var/html/img/1x1blue.png differ diff --git a/livesupport/modules/htmlUI/var/html/img/1x1red.png b/livesupport/modules/htmlUI/var/html/img/1x1red.png new file mode 100755 index 000000000..9fc07c5d6 Binary files /dev/null and b/livesupport/modules/htmlUI/var/html/img/1x1red.png differ diff --git a/livesupport/modules/htmlUI/var/html/ui_browser.php b/livesupport/modules/htmlUI/var/html/ui_browser.php index ea3a61f73..7a9b174b6 100644 --- a/livesupport/modules/htmlUI/var/html/ui_browser.php +++ b/livesupport/modules/htmlUI/var/html/ui_browser.php @@ -159,6 +159,11 @@ if ($uiBrowser->userid) { $Smarty->assign('PL_simpleManagement', TRUE); break; + case "PL.editMetaData": + $Smarty->assign('PL_editMetaData', TRUE); + $Smarty->assign('PL_simpleManagement', TRUE); + break; + case "SCHEDULER": $Smarty->assign('showScheduler', TRUE); break; diff --git a/livesupport/modules/htmlUI/var/html/ui_handler.php b/livesupport/modules/htmlUI/var/html/ui_handler.php index daf1305ac..541ca7b8e 100644 --- a/livesupport/modules/htmlUI/var/html/ui_handler.php +++ b/livesupport/modules/htmlUI/var/html/ui_handler.php @@ -226,6 +226,10 @@ switch($_REQUEST['act']){ $uiHandler->PLAYLIST->setReload(); break; + case "PL.editMetaData": + $uiHandler->PLAYLIST->editMetaData($_REQUEST); + break; + case "SCHEDULER.set": $uiHandler->SCHEDULER->set($_REQUEST); $uiHandler->SCHEDULER->setReload(); @@ -233,7 +237,7 @@ switch($_REQUEST['act']){ case "SCHEDULER.uploadPlaylistMethod": $uiHandler->SCHEDULER->uploadPlaylistMethod($_REQUEST); - $uiHandler->SCHEDULER->setReload(); + $uiHandler->SCHEDULER->setReload(); break; default: diff --git a/livesupport/modules/htmlUI/var/templates/file/edit.tpl b/livesupport/modules/htmlUI/var/templates/file/edit.tpl index fca801a99..c0c3e1b2b 100755 --- a/livesupport/modules/htmlUI/var/templates/file/edit.tpl +++ b/livesupport/modules/htmlUI/var/templates/file/edit.tpl @@ -10,7 +10,7 @@ {$editItem.type|capitalize} -{if $editItem.type == 'audioclip'} +{if $editItem.type == 'audioclip' || $editItem.type == 'file'}
diff --git a/livesupport/modules/htmlUI/var/templates/file/objects.tpl b/livesupport/modules/htmlUI/var/templates/file/objects.tpl index 44c60fd52..b7c7f93a8 100755 --- a/livesupport/modules/htmlUI/var/templates/file/objects.tpl +++ b/livesupport/modules/htmlUI/var/templates/file/objects.tpl @@ -1,4 +1,4 @@ -{PL->getActiveId assign=_PL_activeId} +{assign var="_PL_activeId" value=$PL->getActiveId()}
{include file="sub/x.tpl"} @@ -8,7 +8,7 @@ Title Type -   +   {if $START.pid}[go up]{/if} diff --git a/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl b/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl index fea9c540a..90007f882 100755 --- a/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl +++ b/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl @@ -1,8 +1,9 @@ +
+ -{PL->getFlat assign='FLAT'} -{foreach from=$FLAT key='pos' item='i'} +{foreach from=$PL->getFlat() key='pos' item='i'} - + +
active Playlist: {$PL.children.0.children.0.content}
TitleDurationType
+
diff --git a/livesupport/modules/htmlUI/var/templates/playlist/metadata.tpl b/livesupport/modules/htmlUI/var/templates/playlist/metadata.tpl new file mode 100755 index 000000000..19f3c61dc --- /dev/null +++ b/livesupport/modules/htmlUI/var/templates/playlist/metadata.tpl @@ -0,0 +1,18 @@ +{assign var="_form" value=$PL->metaDataForm()} +{assign var="dynform" value=$_form.main} + +{$_form.langswitch} +{include file="sub/dynForm_plain.tpl"} + + diff --git a/livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl b/livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl index 94a4551a1..8160e8d9e 100755 --- a/livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl +++ b/livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl @@ -1,32 +1,22 @@ -{*Smarty template*} -
{include file="sub/x.tpl"}
-
- - +

Simple Playlist Management

-{PL->get assign='PL'} -{PL->reportLookedPL assign="_looked"} - -{if is_array($PL)} {* already activated Playlist *} - {include file="playlist/editor.tpl"} -{else} {* no active Playlist *} - - - - +{if is_array($PL->get())} {* already activated Playlist *} + {if $PL_editMetaData} + {include file="playlist/metadata.tpl"} + {else} + {include file="playlist/editor.tpl"} + {/if} +{else} {* no active Playlist *} + {if $PL->reportLookedPL()} + + {else} + + {/if} {/if} -
Simple Playlist Management
- {if $_looked} - - {else} - - {/if} -
-
-
+
diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/contextmenu.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/contextmenu.tpl new file mode 100755 index 000000000..d9e10bda1 --- /dev/null +++ b/livesupport/modules/htmlUI/var/templates/scheduler/contextmenu.tpl @@ -0,0 +1,7 @@ +onMouseOver="highlight()" +onMouseOut="darklight()" +onContextmenu="return menu('{$_hour}', {$moreContextBefore} 'SCHEDULER.schedule' {$moreContextAfter})" + + +{assign var="moreContextBefore" value=""} +{assign var="moreContextAfter" value=""} diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl index 9b8feb385..7821f9263 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl @@ -1,16 +1,74 @@ {$SCHEDULER->buildDay()} +{assign var="_usage" value=$SCHEDULER->getDayUsage($SCHEDULER->curr.year, $SCHEDULER->curr.month, $SCHEDULER->curr.day)} - {foreach from=$SCHEDULER->Day item="_Hour"} {assign var="_hour" value=$_Hour.hour} + {assign var="_border" value=""} + {/foreach} -
{$_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} +
+ + + + + + + + + + +{* timing-ansich + +{assign var="_divisor" value=180} +{assign var="_minwidth" value=10} + + + + + + +
+ {$SCHEDULER->curr.year}-{$SCHEDULER->curr.month}-{$SCHEDULER->curr.day} + + {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} +
+ {if $i.length/$_divisor > $_minwidth} + + {$i.entry.title} + {$i.entry.start|regex_replace:"/[0-9]+T/":""}-{$i.entry.end|regex_replace:"/[0-9]+T/":""} + {$i.entry.creator} + + {/if} + +
+ +
+*} diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/month.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/month.tpl index 3f50505c1..3a361aa4f 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/month.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/month.tpl @@ -24,7 +24,7 @@   {else} - {$_Day.day} + {$_Day.day}
{/if} diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl index 6ca113044..c300f9bf0 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl @@ -7,7 +7,7 @@
<< {foreach from=$SCHEDULER->Week item="_Weekday"} - {$_Weekday.label.full} + {$_Weekday.label.full} {/foreach} >> @@ -17,29 +17,29 @@ {$_Day.day} - {assign var="_oneday" value=$SCHEDULER->getDayTiming($_Day.year, $_Day.month, $_Day.day)} - - - {foreach from=$_oneday item="i"} - - {if is_array($i.entry)} - - {else} - + {assign var="_oneday" value=$SCHEDULER->getDayTiming($_Day.year, $_Day.month, $_Day.day)} +
- {if $i.length/$_divisor > $_minwidth} - - Start:{$i.entry.start|regex_replace:"/[0-9]+T/":""} -
- End:  {$i.entry.end|regex_replace:"/[0-9]+T/":""} -
- {/if} -
-
+ {foreach from=$_oneday item="i"} + + {if is_array($i.entry)} + - {/foreach} - -
+ {if $i.length/$_divisor > $_minwidth} + + {$i.entry.title} +
+ {$i.entry.start|regex_replace:"/[0-9]+T/":""|truncate:5:""}-{$i.entry.end|regex_replace:"/[0-9]+T/":""|truncate:5:""} +
+ {$i.entry.creator} +
{/if} -
+ + {else} + + + {/if} + + {/foreach} + {/foreach} diff --git a/livesupport/modules/htmlUI/var/templates/scratchPad.tpl b/livesupport/modules/htmlUI/var/templates/scratchPad.tpl index 0875ed826..de4962710 100755 --- a/livesupport/modules/htmlUI/var/templates/scratchPad.tpl +++ b/livesupport/modules/htmlUI/var/templates/scratchPad.tpl @@ -1,4 +1,4 @@ -{PL->getActiveId assign=_PL_activeId} +{assign var="_PL_activeId" value=$PL->getActiveId()}
%%ScratchPad%% diff --git a/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl b/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl index aff8bd567..5d7e68b58 100755 --- a/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl +++ b/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl @@ -1,4 +1,4 @@ -{PL->getActiveId assign=_PL_activeId} +{assign var="_PL_activeId" value=$PL->getActiveId()} onMouseOver="highlight()" onMouseOut="darklight()" diff --git a/livesupport/modules/htmlUI/var/ui_base.inc.php b/livesupport/modules/htmlUI/var/ui_base.inc.php index 027c208f4..9a18bcb0c 100644 --- a/livesupport/modules/htmlUI/var/ui_base.inc.php +++ b/livesupport/modules/htmlUI/var/ui_base.inc.php @@ -307,7 +307,7 @@ class uiBase $data = array('id' => $id, 'gunid' => $this->gb->_gunidFromId($id), 'title' => $this->_getMDataValue($id, UI_MDATA_KEY_TITLE), - 'creator' => $this->_getMDataValue($id, UI_MDATA_KEY_ARTIST), + 'creator' => $this->_getMDataValue($id, UI_MDATA_KEY_CREATOR), 'duration' => $this->_niceTime($this->_getMDataValue($id, UI_MDATA_KEY_DURATION)), 'type' => $this->gb->getFileType($id), ); @@ -336,7 +336,7 @@ class uiBase function _getMDataValue($id, $key) - { + { if (is_array($arr = $this->gb->getMDataValue($id, $key, $this->sessid))) { $value = current($arr); return $value['value']; diff --git a/livesupport/modules/htmlUI/var/ui_browse.class.php b/livesupport/modules/htmlUI/var/ui_browse.class.php index e6997e0f3..f82c4de66 100755 --- a/livesupport/modules/htmlUI/var/ui_browse.class.php +++ b/livesupport/modules/htmlUI/var/ui_browse.class.php @@ -63,12 +63,10 @@ class uiBrowse } ## just to change limit and file-type - $form = new HTML_QuickForm('shitcher', UI_STANDARD_FORM_METHOD, UI_HANDLER); - #$mask2['browse_global']['limit']['default'] = $this->criteria['limit']; - #$mask2['browse_global']['filetype']['default'] = $this->criteria['filetype']; + $form = new HTML_QuickForm('switch', UI_STANDARD_FORM_METHOD, UI_HANDLER); $this->Base->_parseArr2Form($form, $mask2['browse_global']); $form->setDefaults(array('limit' => $this->criteria['limit'], - 'filetype' => $this->criteria['filetype'])); + 'filetype' => $this->criteria['filetype'])); $renderer =& new HTML_QuickForm_Renderer_Array(true, true); $form->accept($renderer); $output['global']['dynform'] = $renderer->toArray(); diff --git a/livesupport/modules/htmlUI/var/ui_browser.class.php b/livesupport/modules/htmlUI/var/ui_browser.class.php index 6d7b41eb5..8f0440778 100644 --- a/livesupport/modules/htmlUI/var/ui_browser.class.php +++ b/livesupport/modules/htmlUI/var/ui_browser.class.php @@ -289,7 +289,7 @@ class uiBrowser extends uiBase { function addGroupMember($id) { $g = $this->groupMembers($id); - foreach($g['subj'] as $s) { + foreach($g['subj'] as $s) { $this->logins[($s['login'])]=$s['login']; } $form = new HTML_QuickForm('addGroupMember', UI_STANDARD_FORM_METHOD, UI_HANDLER); @@ -379,11 +379,10 @@ class uiBrowser extends uiBase { $form = new HTML_QuickForm('editMetaData', UI_STANDARD_FORM_METHOD, UI_HANDLER); $this->_parseArr2Form($form, $mask['basics']); - $form->setConstants( array('id' => $id, - #!!!!!'langid' => array_pop($this->gb->getMDataValue($id, 'langid', $this->sessid)) - 'langid' => 'en' - ) - ); + $form->setConstants(array('act' => 'editMetaData', + 'id' => $id, + #!!!!!'langid' => array_pop($this->gb->getMDataValue($id, 'langid', $this->sessid)) + 'langid' => 'en')); ## convert element names to be unique over different forms-parts, add javascript to spread values over parts, add existing values from database foreach ($mask['pages'] as $key=>$val) { diff --git a/livesupport/modules/htmlUI/var/ui_calendar.class.php b/livesupport/modules/htmlUI/var/ui_calendar.class.php index e03d9dcd0..4ad24a800 100755 --- a/livesupport/modules/htmlUI/var/ui_calendar.class.php +++ b/livesupport/modules/htmlUI/var/ui_calendar.class.php @@ -99,7 +99,8 @@ class uiCalendar $Day = new Calendar_Day ($this->curr['year'], $this->curr['month'], $this->curr['day']); $Day->build(); while ($Hour = $Day->fetch()) { - $this->Day[] = array('hour' => $Hour->thisHour()); + $this->Day[] = array('hour' => $Hour->thisHour(), + 'timestamp' => $Hour->thisHour(TRUE)); } } diff --git a/livesupport/modules/htmlUI/var/ui_conf.php b/livesupport/modules/htmlUI/var/ui_conf.php index c0206a1e9..f1c7b1dee 100755 --- a/livesupport/modules/htmlUI/var/ui_conf.php +++ b/livesupport/modules/htmlUI/var/ui_conf.php @@ -32,7 +32,7 @@ define('UI_BROWSE_SESSNAME', 'L_BROWSE'); ## Metadata Keys define('UI_MDATA_KEY_TITLE', 'dc:title'); -define('UI_MDATA_KEY_ARTIST', 'dc:creator'); +define('UI_MDATA_KEY_CREATOR', 'dc:creator'); define('UI_MDATA_KEY_DURATION', 'dcterms:extent'); define('UI_MDATA_KEY_URL', 'ls:url'); diff --git a/livesupport/modules/htmlUI/var/ui_playlist.class.php b/livesupport/modules/htmlUI/var/ui_playlist.class.php index f0df8d2c9..a005a2143 100755 --- a/livesupport/modules/htmlUI/var/ui_playlist.class.php +++ b/livesupport/modules/htmlUI/var/ui_playlist.class.php @@ -110,10 +110,10 @@ class uiPlaylist return $this->activeId; } - function reportLookedPL($setMsg) + function reportLookedPL($setMsg=FALSE) { if(is_string($saved = $this->Base->gb->loadPref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY))) { - if ($setMsg === TRUE) $this->Base->_retMsg('Found looked Playlist'); + if ($setMsg == TRUE) $this->Base->_retMsg('Found looked Playlist'); return TRUE; } return FALSE; @@ -352,6 +352,66 @@ class uiPlaylist return $renderer->toArray(); } + + function metaDataForm($get=TRUE) + { + include dirname(__FILE__).'/formmask/metadata.inc.php'; + 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']); + } + + ## get data from parameter + if (is_array($data)) { + $mask['playlist'][$k]['default'] = $data[strtr($v['element'], '_', '.')]; + } + } + $form = new HTML_QuickForm('editMetaData', UI_STANDARD_FORM_METHOD, UI_HANDLER); + $this->Base->_parseArr2Form($form, $mask['basics']); + $this->Base->_parseArr2Form($form, $mask['playlist']); + $this->Base->_parseArr2Form($form, $mask['buttons']); + $form->setConstants(array('act' => 'PL.editMetaData', + 'id' => $this->activeId)); + $renderer =& new HTML_QuickForm_Renderer_Array(true, true); + $form->accept($renderer); + $output['main'] = $renderer->toArray(); + + $form = new HTML_QuickForm('langswitch', UI_STANDARD_FORM_METHOD, UI_BROWSER); + $this->Base->_parseArr2Form($form, $mask['langswitch']); + $output['langswitch'] = $form->toHTML(); + + #print_r($output); + return $output; + } + + + function editMetaData(&$formdata) + { + include dirname(__FILE__).'/formmask/metadata.inc.php'; + + ## first remove old entrys + #$this->gb->replaceMetaData($id, $this->_analyzeFile($id, 'xml'), 'string', $this->sessid); + + + foreach ($mask['playlist'] as $k=>$v) { + $formdata[$this->Base->_formElementEncode($v['element'])] ? $mData[$this->Base->_formElementDecode($v['element'])] = $formdata[$this->Base->_formElementEncode($v['element'])] : NULL; + } + + $data = $this->Base->_dateArr2Str($mData); + foreach ($data as $key=>$val) { + $r = $this->Base->gb->setMDataValue($this->activeId, $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; + } + + function _plTimeToSecs($plt, $length=4) { $arr = split(':', $plt); diff --git a/livesupport/modules/htmlUI/var/ui_scheduler.class.php b/livesupport/modules/htmlUI/var/ui_scheduler.class.php index 92b442105..8b72377ef 100755 --- a/livesupport/modules/htmlUI/var/ui_scheduler.class.php +++ b/livesupport/modules/htmlUI/var/ui_scheduler.class.php @@ -55,17 +55,34 @@ class uiScheduler extends uiCalendar function _datetime2timestamp($i) { $formatted = $i[0].$i[1].$i[2].$i[3].'-'.$i[4].$i[5].'-'.$i[6].$i[7].strrchr($i, 'T'); - #echo "iiiii: $i ffff:".$formatted; - return strtotime($formatted); + #echo "input: $i formatted:".$formatted; + return $this->_strtotime($formatted); + } + + + function _strtotime($input) + { + ## !! bug in strtotime. zeigt 8h später an als reines datum, wenn Txx:xx:xx verwendet wird !! + if (strpos($input, 'T')) + return strtotime($input)-8*3600; + return strtotime($input); } function getDayUsage($year, $month, $day) { + $day_start = $this->_datetime2timestamp($year.$month.$day.'T00:00:00'); + $day_end = $this->_datetime2timestamp($year.$month.$day.'T23:59:59'); + $date = $year.$month.$day; $arr = $this->displayScheduleMethod($date.'T00:00:00', $date.'T23:59:59.999999'); if (!count($arr)) return FALSE; + 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']); + } #print_r($arr); return $arr; } @@ -84,46 +101,46 @@ class uiScheduler extends uiCalendar function getDayTiming($year, $month, $day) { - ## !! bug in strtotime. zeigt 8h später an als reines datum, wenn Txx:xx:xx verwendet wird !! + #echo $year.$month.$day; $day_start = $this->_datetime2timestamp($year.$month.$day.'T00:00:00'); $day_end = $this->_datetime2timestamp($year.$month.$day.'T23:59:59'); if (!$arr = $this->getDayUsage($year, $month, $day)) - return array(array( ## empty day + return array(array( ## empty day 'type' => 'gap', 'length' => $day_end - $day_start )); $curr = current($arr); - if (strtotime($curr['start']) > $day_start) ## insert gap if first entry start after 00:00:00 + if ($this->_strtotime($curr['start']) > $day_start) ## insert gap if first entry start after 00:00:00 $list[] = array( 'type' => 'gap', #'pos' => 0, - 'length' => strtotime($curr['start']) - $day_start + 'length' => $this->_strtotime($curr['start']) - $day_start ); while ($curr = current($arr)) { $list[] = array( 'type' => 'entry', - #'pos' => strtotime($curr['start']) - $day_start, - 'length' => strtotime($curr['end']) - strtotime($curr['start']), + #'pos' => $this->_strtotime($curr['start']) - $day_start, + 'length' => $this->_strtotime($curr['end']) - $this->_strtotime($curr['start']), 'entry' => $curr ); if ($next = next($arr)) { - if (strtotime($next['start']) > strtotime($curr['end'])+1) ## insert gap between entrys + if ($this->_strtotime($next['start']) > $this->_strtotime($curr['end'])+1) ## insert gap between entrys $list[] = array( 'type' => 'gap', - #'pos' => strtotime($curr['start'])-$day_start, - 'length' => strtotime($next['start']) - strtotime($curr['end']), + #'pos' => $this->_strtotime($curr['start'])-$day_start, + 'length' => $this->_strtotime($next['start']) - $this->_strtotime($curr['end']), ); } else { - if (strtotime($curr['end']) < $day_end) ## insert gap if prev entry was not until midnight + if ($this->_strtotime($curr['end']) < $day_end) ## insert gap if prev entry was not until midnight $list[] = array( 'type' => 'gap', - #'pos' => strtotime($curr['end']) - $day_start, - 'length' => $day_end - strtotime($curr['end']), + #'pos' => $this->_strtotime($curr['end']) - $day_start, + 'length' => $day_end - $this->_strtotime($curr['end']), ); } @@ -138,6 +155,7 @@ class uiScheduler extends uiCalendar return $id < 1 ? ceil($in) : round($in); } + function _scheduledDays($period) { if ($period=='month') {