diff --git a/livesupport/modules/htmlUI/var/formmask/general.inc.php b/livesupport/modules/htmlUI/var/formmask/general.inc.php index 5f010eef8..2a838ead6 100755 --- a/livesupport/modules/htmlUI/var/formmask/general.inc.php +++ b/livesupport/modules/htmlUI/var/formmask/general.inc.php @@ -214,17 +214,22 @@ $ui_fmask = array( 'label' => 'Password', 'required' => TRUE ), - array( - 'element' => 'Submit', - 'type' => 'submit', - 'label' => 'Submit' - ), array( 'element' => 'cancel', 'type' => 'button', 'label' => 'Cancel', - 'attributes'=> array('onClick' => 'window.close()') - ) + 'attributes'=> array('onClick' => 'window.close()'), + 'groupit' => TRUE + ), + array( + 'element' => 'Submit', + 'type' => 'submit', + 'label' => 'Submit', + 'groupit' => TRUE + ), + array( + 'group' => array('cancel', 'Submit') + ), ), 'uploadFileM' => array( diff --git a/livesupport/modules/htmlUI/var/html/styles_livesupport.css b/livesupport/modules/htmlUI/var/html/styles_livesupport.css index 4dcbdf3bc..1fe8d735c 100755 --- a/livesupport/modules/htmlUI/var/html/styles_livesupport.css +++ b/livesupport/modules/htmlUI/var/html/styles_livesupport.css @@ -651,14 +651,32 @@ table.scheduler_day td { font-size: 12px; padding-top: 2px; } + +/*############# SCHEDULER WEEK #######*/ + table.scheduler_week_time { + background: #ddd; + padding: 0; + border: 0; + margin: 0; +} + +table.scheduler_week_time tr { width: 20px; - border: 1px solid #7392A6; + border-bottom: 1px solid #7392A6; +} + +table.scheduler_week_time td { + height: 20px; + text-align: center; } table.scheduler_week { width: 790px; border: 1px solid #7392A6; + padding: 0; + border: 0; + margin: 0; } table.scheduler_week a { @@ -679,7 +697,8 @@ table.scheduler_week th.date { } table.scheduler_week th.day { - width: 186px; + width: 286px; + text-align: left; } table.scheduler_week td.firstrow_secondcol { @@ -695,9 +714,10 @@ table.scheduler_week td.date_secondcol { border: none; border-left: 1px solid #7392A6; border-bottom: 1px solid #757575; - padding: 0px; font-weight: bold; } +table.scheduler_week td.date_secondcol a {color: #000; +} table.scheduler_week td.day_secondcol { background-color: #CFDEE7; diff --git a/livesupport/modules/htmlUI/var/html/styles_popup.css b/livesupport/modules/htmlUI/var/html/styles_popup.css index 68127b984..ac30e9d47 100755 --- a/livesupport/modules/htmlUI/var/html/styles_popup.css +++ b/livesupport/modules/htmlUI/var/html/styles_popup.css @@ -1,10 +1,8 @@ -body { - font-size: 12px; - font-family: Arial, Verdana, Helvetica, sans-serif; - font-size: 12px; - color: #2C2C2C; - margin: 0px; - vertical-align : middle; +body { font-size: 12px; + font-family: Arial, Verdana, Helvetica, sans-serif; + font-size: 12px; + color: #2C2C2C; + margin: 10px; } img { font-size: 12px; @@ -74,10 +72,11 @@ input, select { font-size: 12px; } + /* #################################### CONTENTAREA ############################### */ -.content { font-size: 12px; +.content { margin: 19px; margin-top: 0; float: left; @@ -126,6 +125,115 @@ table { font-size: 12px; table td { font-size: 12px; padding: 0 6px 0 12px; + border-right: 1px solid #333; height: 19px; + vertical-align: top; } +table tr.blue_head td { font-size: 12px; + background-color: #8baed1; + color: #FFF; + font-weight: bold; + +} + +A#blue_head { font-size: 12px; + color:#fff; +} + +table tr.blue1 td { font-size: 12px; + color: #000; + background-color: #d5e2ee; +} + +table tr.blue2 td { font-size: 12px; + color: #000; + background-color: #f5f5f5; +} + +table tr.red td { font-size: 12px; + background-color: #FBAAAA; +} + +.footer { font-size: 12px; + padding: 4px 5px 5px 0; + background-color: #8baed1; + text-align: right; + margin-bottom: 8px; +} + +.container_button { font-size: 12px; + margin-top: 4px; +} + +.container_search { + margin-bottom: 4px; +} + +.comment { font-size: 12px; + float: left; + font-size: 10px; + margin: 5px 0 0 10px; +} + +.select_width_comment { font-size: 12px; + float:left; + margin-left: 3px; +} + +.select_width_comment[class] { font-size: 12px; + margin-left: 0; +} + + +.tablebottom { font-size: 12px; + float: left; + margin-left: 0px; + background-color: #8baed1; +} + +.counter { font-size: 12px; + float: left; + margin-left: 7px; + font-weight: bold; + background-color: #8baed1; +} + +.counter[class] { font-size: 12px; + margin-left: 15px; +} + +.container_browse { + width: 170px; + float: left; + margin: 0px 0px 10px 0px; +} + +.area_browse { + width: 174px; + height: 100px; +} + +.area_browse[class] { + width: 180px; +} + +.comment_browse { + font-size: 10px; +} + +.container_button_upload { font-size: 12px; + margin: 20px 0 0 204px; +} + +.container_button_upload[class] { font-size: 12px; + margin-left: 200px; +} + +label { font-size: 12px; + display: block; + float: left; + width: 200px; +} + + diff --git a/livesupport/modules/htmlUI/var/html/ui_browser.php b/livesupport/modules/htmlUI/var/html/ui_browser.php index bc0fbd0a6..d0e51fab3 100644 --- a/livesupport/modules/htmlUI/var/html/ui_browser.php +++ b/livesupport/modules/htmlUI/var/html/ui_browser.php @@ -16,8 +16,13 @@ if (is_array($_REQUEST['popup'])){ $Smarty->display('popup/_clear_parent.tpl'); break; + case "_2PL.simpleManagement": + $Smarty->assign('target', 'PL.simpleManagement'); + $Smarty->display('popup/_redirector.tpl'); + break; + case "login": - $Smarty->assign('login', $uiBrowser->login($Smarty, $ui_fmask)); + $Smarty->assign('dynform', $uiBrowser->login($ui_fmask)); $Smarty->display('popup/login.tpl'); break; @@ -41,11 +46,6 @@ if (is_array($_REQUEST['popup'])){ $Smarty->display('popup/deleteItem.tpl'); break; - case "_2PL.simpleManagement": - $Smarty->assign('target', 'PL.simpleManagement'); - $Smarty->display('popup/_redirector.tpl'); - break; - case "PL.changeTransition"; $Smarty->assign('dynform', $uiBrowser->PLAYLIST->changeTransitionForm($_REQUEST['id'], $_REQUEST['type'], $ui_fmask['PL.changeTransition'])); $Smarty->display('popup/PLAYLIST.changeTransition.tpl'); diff --git a/livesupport/modules/htmlUI/var/templates/popup/login.tpl b/livesupport/modules/htmlUI/var/templates/popup/login.tpl index 001c7bad8..6172345a6 100755 --- a/livesupport/modules/htmlUI/var/templates/popup/login.tpl +++ b/livesupport/modules/htmlUI/var/templates/popup/login.tpl @@ -1,23 +1,9 @@ {include file="popup/header.tpl"} -{$login.javascript} - - - - -
-
-
- {$login.hidden} - - - - - -
{$login.login.label}{$login.login.html}
{$login.pass.label}{$login.pass.html}
{$login.langid.label}{$login.langid.html}
{$login.requirednote}{$login.Submit.html} {$login.cancel.html}
-
-
-
+ +{include file="sub/dynForm_plain.tpl} + + diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/calendar.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/calendar.tpl index 557453d1c..b3e21b11c 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/calendar.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/calendar.tpl @@ -4,29 +4,25 @@ {$SCHEDULER->buildWeek()} -
- +

##Scheduler Navigation##

- -
-
- - - -
<< +
+
+ + + + - - - - + + + {foreach from=$SCHEDULER->Week item="_Weekday"} {/foreach} - - + + {foreach from=$SCHEDULER->Month item="_Day"} - + {if $_Day.isFirst} {/if} - + {if $_Day.isEmpty} {/if} {/foreach} -
<<
+
+
>>
##CW##
##CW##{$_Weekday.label.short|truncate:2:""}
{$_Day.week} {elseif $_Day.isToday} - + {elseif $_Day.isCurrent} {else} @@ -81,11 +81,14 @@
-
-
+
+
+
+ + + {* @@ -127,7 +130,7 @@ {if $_Day.isEmpty}
{elseif $_Day.isToday} -
+
{elseif $_Day.isCurrent}
{else} @@ -147,4 +150,4 @@ {/foreach}
{$SCHEDULER->curr.year}-{$SCHEDULER->curr.month}-{$SCHEDULER->curr.day}
-*} \ No newline at end of file +*} diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl index 3afb053df..72d3ef26a 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl @@ -1,57 +1,43 @@ {$SCHEDULER->buildDay()} -{assign var="_usage" value=$SCHEDULER->getDayUsage($SCHEDULER->curr.year, $SCHEDULER->curr.month, $SCHEDULER->curr.day)} -{assign var="_divisor" value=70} +{assign var="_scale" value=$SCHEDULER->getDayTimingScale()} - + +
-{foreach from=$SCHEDULER->Day item="_Hour"} - {assign var="_year" value=$_Hour.year} - {assign var="_month" value=$_Hour.month} - {assign var="_day" value=$_Hour.day} - {assign var="_hour" value=$_Hour.hour} + {assign var="_entrys" value=$SCHEDULER->getDayEntrys()} + {foreach from=$_scale item="_hour"} - - + {assign var="_year" value=$_Day.year} + {assign var="_month" value=$_Day.month} - {if !$_passed} - {* jede Reiehe entspr. einer Stunde *} + {* linke spalte mit Uhrzeit *} + + + - {assign var="_passed" value=TRUE} - {/if} - {foreach from=$_usage item="_entry"} - {if $_entry.pos >= $_Hour.timestamp && $_entry.pos < $_Hour.timestamp+3600} - - {/if} - {/foreach} - + -{/foreach} + {/foreach}
<< curr.isToday} bgcolor="grey"{/if}>{$SCHEDULER->curr.dayname}, {$SCHEDULER->curr.year}-{$SCHEDULER->curr.month}-{$SCHEDULER->curr.day} >>
- {$_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} -
+
{$_hour} + + {if is_array($_entrys[$_hour])} + {foreach from=$_entrys[$_hour] item="i"} {* hier werden die Einträge welche in der jeweil. h beginnen durchlaufen *} +
+ {$i.title} +
+ {$i.start}-{$i.end} +
+ {$i.creator} +
+ {/foreach} + {/if}
- {$_entry.title} - {$_entry.start|regex_replace:"/[0-9]+T/":""|truncate:5:""}-{$_entry.end|regex_replace:"/[0-9]+T/":""|truncate:5:""} -
- {$_entry.creator} -
diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl index 8db38e91c..0e9495061 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl @@ -1,182 +1,58 @@ {$SCHEDULER->buildWeek()} -{assign var="_divisor" value=180} -{assign var="_minwidth" value=20} {assign var="_scale" value=$SCHEDULER->getDayTimingScale()} - - -
-
-

##Weekly View##

-
- - -
-
 
- - - {foreach from=$SCHEDULER->Week item="_Day"} - -{/foreach} - - - - - - - - - - - - - - - - - - -{foreach from=$SCHEDULER->Week item="_Day"} - {assign var="_oneday" value=$SCHEDULER->getDayTiming($_Day.year, $_Day.month, $_Day.day)} - {assign var="_year" value=$_Day.year} - {assign var="_month" value=$_Day.month} - {assign var="_day" value=$_Day.day} - {assign var="_hour" value=$_Day.hour} - - - - - -{/foreach} - - - - - - - - - - - - - - - - - - -
{$_Day.label.full}
29303101020304
- - {foreach from=$_scale item="_hour"} - - - - {/foreach} -
-
{$_hour|string_format:'%02d'}
-
-
- - {foreach from=$_oneday item="i"} - {assign var = "_start" value = $i.entry.start|regex_replace:"/[0-9]+T/":""} - {assign var = "_end" value = $i.entry.end|regex_replace:"/[0-9]+T/":""} - {assign var = "_period" value = "$_start-$_end"} - {assign var = "_title" value = $i.entry.title} - {assign var = "_creator" value = $i.entry.creator} - - - {if is_array($i.entry)} - {if $i.length/$_divisor > $_minwidth} - - {else} - - {/if} - {else} - - {/if} - - {/foreach} -
{$_title}
{$_period}
{$_creator}
-
12p

Cat Fancy

12:00 - 14:00

Dave Simmons

locked

Talk of the Nation

21:00 - 24:00

Ira Flatow

- {* -
- - - -
- *} -
 
-
-
- - - - + + + + {foreach from=$SCHEDULER->Week item="_Day"} {* hier werden die Tagesnamen angezeigt *} + + {/foreach} + + -{foreach from=$SCHEDULER->Week item="_Day"} - -{/foreach} + + + {foreach from=$SCHEDULER->Week item="_Day"} {* hier werden die Tagesnummern angezeigt *} + + {/foreach} + - - - -{foreach from=$SCHEDULER->Week item="_Day"} - -{/foreach} - + {assign var="_entrys" value=$SCHEDULER->getWeekEntrys()} + {foreach from=$_scale item="_hour"} - -{foreach from=$SCHEDULER->Week item="_Day"} - {assign var="_oneday" value=$SCHEDULER->getDayTiming($_Day.year, $_Day.month, $_Day.day)} - {assign var="_year" value=$_Day.year} - {assign var="_month" value=$_Day.month} - {assign var="_day" value=$_Day.day} - {assign var="_hour" value=$_Day.hour} + {assign var="_year" value=$_Day.year} + {assign var="_month" value=$_Day.month} - + - - -{/foreach} -
<<
<< {$_Day.label.full}>>
{$_Day.label.full}
+ {$_Day.day} +
>>
- {$_Day.day} -
- - {foreach from=$_scale item="_hour"} - - - + {* jede Reiehe entspr. einer Stunde *} + {* linke spalte mit Uhrzeit *} + + {foreach from=$SCHEDULER->Week item="_day"} + {* jede Zelle entpr. einem Tag (natürlich nur einer h davon) *} + {/foreach} -
-
{$_hour|string_format:'%02d'}
-
{$_hour} + + {if is_array($_entrys[$_day.day][$_hour])} + {foreach from=$_entrys[$_day.day][$_hour] item="i"} {* hier werden die Einträge welche in der jeweil. h beginnen durchlaufen *} +
+ {$i.title} +
+ {$i.start}-{$i.end} +
+ {$i.creator} +
+ {/foreach} + {/if} + +
-
- - {foreach from=$_oneday item="i"} - {assign var = "_start" value = $i.entry.start|regex_replace:"/[0-9]+T/":""} - {assign var = "_end" value = $i.entry.end|regex_replace:"/[0-9]+T/":""} - {assign var = "_period" value = "$_start-$_end"} - {assign var = "_title" value = $i.entry.title} - {assign var = "_creator" value = $i.entry.creator} + {/foreach} - - {if is_array($i.entry)} - {if $i.length/$_divisor > $_minwidth} - - {else} - - {/if} - {else} - - {/if} - - {/foreach} -
{$_title}
{$_period}
{$_creator}
-
diff --git a/livesupport/modules/htmlUI/var/ui_browser.class.php b/livesupport/modules/htmlUI/var/ui_browser.class.php index 65b509d19..280e3ef4d 100644 --- a/livesupport/modules/htmlUI/var/ui_browser.class.php +++ b/livesupport/modules/htmlUI/var/ui_browser.class.php @@ -70,18 +70,14 @@ class uiBrowser extends uiBase { * @param string $faillogin login name of failed login process * @return string (html) */ - function login(&$Smarty, &$mask) + function login(&$mask) { $form = new HTML_QuickForm('login', UI_STANDARD_FORM_METHOD, UI_HANDLER); $form->setRequiredNote(file_get_contents(UI_QFORM_REQUIREDNOTE)); + $this->_parseArr2Form($form, $mask['languages']); $this->_parseArr2Form($form, $mask['login']); - $this->_parseArr2Form($form, $mask['languages']); - - ## using Static Smarty Renderer - $renderer =& new HTML_QuickForm_Renderer_ArraySmarty($Smarty, true); - $renderer->setRequiredTemplate(file_get_contents(UI_QFORM_REQUIRED)); - #$renderer->setErrorTemplate(file_get_contents(UI_QFORM_ERROR)); + $renderer =& new HTML_QuickForm_Renderer_Array(true, true); $form->accept($renderer); return $renderer->toArray(); diff --git a/livesupport/modules/htmlUI/var/ui_calendar.class.php b/livesupport/modules/htmlUI/var/ui_calendar.class.php index 61f047c11..334bafab8 100755 --- a/livesupport/modules/htmlUI/var/ui_calendar.class.php +++ b/livesupport/modules/htmlUI/var/ui_calendar.class.php @@ -9,6 +9,8 @@ class uiCalendar function buildDecade() { + if (is_array($this->Decade)) return TRUE; + for ($Year = $this->curr['year']-5; $Year<=$this->curr['year']+5; $Year++) { $this->Decade[] = array( 'year' => $Year, @@ -42,7 +44,7 @@ class uiCalendar function buildMonth() { - if (is_array($this->Month)) return FALSE; + if (is_array($this->Month)) return TRUE; require_once 'Calendar/Month/Weekdays.php'; require_once 'Calendar/Day.php'; @@ -50,7 +52,7 @@ class uiCalendar $Month = new Calendar_Month_Weekdays($this->curr['year'], $this->curr['month'], UI_SCHEDULER_FIRSTWEEKDAY); $Month->build($this->_scheduledDays('month')); ## scheduled days are selected while ($Day = $Month->fetch()) { - $corrMonth = $Day->thisMonth()<=12 ? sprintf('%02d', $Day->thisMonth()) : '01'; ## due to bug in + $corrMonth = $Day->thisMonth()<=12 ? sprintf('%02d', $Day->thisMonth()) : '01'; ## due to bug in $corrYear = $Day->thisMonth()<=12 ? $Day->thisYear() : $Day->thisYear()+1; ## Calendar_Month_Weekdays $this->Month[] = array( 'day' => sprintf('%02d', $Day->thisDay()), @@ -79,11 +81,13 @@ class uiCalendar $Week = new Calendar_Week ($this->curr['year'], $this->curr['month'], $this->curr['day'], UI_SCHEDULER_FIRSTWEEKDAY); $Week->build($this->_scheduledDays('week')); while ($Day = $Week->fetch()) { + $corrMonth = $Day->thisMonth()<=12 ? sprintf('%02d', $Day->thisMonth()) : '01'; ## due to bug in + $corrYear = $Day->thisMonth()<=12 ? $Day->thisYear() : $Day->thisYear()+1; ## Calendar_Month_Weekdays $this->Week[] = array( 'day' => sprintf('%02d', $Day->thisDay()), 'week' => $this->_getWeekNr($Day), - 'month' => sprintf('%02d', $Day->thisMonth()), - 'year' => $Day->thisYear(), + 'month' => $corrMonth, + 'year' => $corrYear, 'label' => $this->_getDayName($Day), 'isSelected' => $Day->isSelected(), 'isCurrent' => $Day->thisDay()==$this->curr['day'] ? TRUE : FALSE, @@ -103,11 +107,13 @@ class uiCalendar $Day = new Calendar_Day ($this->curr['year'], $this->curr['month'], $this->curr['day']); $Day->build(); while ($Hour = $Day->fetch()) { + $corrMonth = $Hour->thisMonth()<=12 ? sprintf('%02d', $Hour->thisMonth()) : '01'; ## due to bug in + $corrYear = $Hour->thisMonth()<=12 ? $Day->thisYear() : $Hour->thisYear()+1; ## Calendar_Month_Weekdays $this->Day[] = array( 'day' => sprintf('%02d', $Hour->thisDay()), 'week' => $this->_getWeekNr($Hour), - 'month' => sprintf('%02d', $Hour->thisMonth()), - 'year' => $Hour->thisYear(), + 'month' => $corrMonth, + 'year' => $corrYear, 'hour' => $Hour->thisHour(), 'isSelected' => $Hour->isSelected(), 'isCurrent' => $Hour->thisDay()==$this->curr['day'] ? TRUE : FALSE, @@ -120,6 +126,8 @@ class uiCalendar function buildHour() { + if (is_array($this->Hour)) return FALSE; + require_once 'Calendar/Hour.php'; $Hour = new Calendar_Hour ($this->curr['year'], $this->curr['month'], $this->curr['day'], $this->curr['hour']); diff --git a/livesupport/modules/htmlUI/var/ui_scheduler.class.php b/livesupport/modules/htmlUI/var/ui_scheduler.class.php index 5797827fa..7f3399408 100755 --- a/livesupport/modules/htmlUI/var/ui_scheduler.class.php +++ b/livesupport/modules/htmlUI/var/ui_scheduler.class.php @@ -71,28 +71,74 @@ class uiScheduler extends uiCalendar } - function _datetime2timestamp($i) + function getWeekEntrys() { - $formatted = $i[0].$i[1].$i[2].$i[3].'-'.$i[4].$i[5].'-'.$i[6].$i[7].strrchr($i, 'T'); - #echo "input: $i formatted:".$formatted; - return $this->_strtotime($formatted); + ## build array within all entrys of current week ## + + $this->buildWeek(); + + $weekStart = strftime("%Y%m%d", $this->Week[0]['timestamp']); + $weekEnd = strftime("%Y%m%d", $this->Week[6]['timestamp']); + + $arr = $this->displayScheduleMethod($weekStart.'T00:00:00', $weekEnd.'T23:59:59.999999'); + if (!count($arr)) + return FALSE; + foreach ($arr as $key => $val) { + $items[strftime('%d', $this->_datetime2timestamp($val['start']))][number_format(strftime('%H', $this->_datetime2timestamp($val['start'])))][]= array ( + 'start' => substr($val['start'], strpos($val['start'], 'T')+1), + 'end' => substr($val['end'], strpos($val['end'], 'T') + 1), + 'title' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE), + 'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR), + ); + } + #print_r($items); + return $items; } - function _strtotime($input) + function getDayEntrys() { - ## !! 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); + ## build array within all entrys of current day ## + + $this->buildDay(); + + $day = strftime("%Y%m%d", $this->Day[0]['timestamp']); + + $arr = $this->displayScheduleMethod($day.'T00:00:00', $day.'T23:59:59.999999'); + if (!count($arr)) + return FALSE; + foreach ($arr as $key => $val) { + $items[strftime('%d', $this->_datetime2timestamp($val['start']))][]= array ( + 'start' => substr($val['start'], strpos($val['start'], 'T')+1), + 'end' => substr($val['end'], strpos($val['end'], 'T') + 1), + 'title' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE), + 'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR), + ); + } + #print_r($items); + return $items; } + function getDayHourlyEntrys($year, $month, $day) + { + $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) { + $items[date('H', $this->_datetime2timestamp($val['start']))][]= array ( + 'start' => substr($val['start'], strpos($val['start'], 'T')+1), + 'end' => substr($val['end'], strpos($val['end'], 'T') + 1), + 'title' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE), + 'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR), + ); + } + print_r($items); + return $items; + } 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)) @@ -103,7 +149,7 @@ class uiScheduler extends uiCalendar $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); + print_r($arr); return $arr; } @@ -132,7 +178,7 @@ class uiScheduler extends uiCalendar )); $curr = current($arr); - if ($this->_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, @@ -238,6 +284,22 @@ 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 "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 _oneOrMore($in) { return $id < 1 ? ceil($in) : round($in);