diff --git a/livesupport/modules/htmlUI/index.php b/livesupport/modules/htmlUI/index.php index 92007e2f7..b15f6a5e1 100644 --- a/livesupport/modules/htmlUI/index.php +++ b/livesupport/modules/htmlUI/index.php @@ -1,4 +1,3 @@ diff --git a/livesupport/modules/htmlUI/var/html/styles.css b/livesupport/modules/htmlUI/var/html/styles.css index ab6db92a2..e92466b5d 100755 --- a/livesupport/modules/htmlUI/var/html/styles.css +++ b/livesupport/modules/htmlUI/var/html/styles.css @@ -1,4 +1,4 @@ - body { +body { background-color : ThreedLightShadow; font-family : monospace; } diff --git a/livesupport/modules/htmlUI/var/html/ui_handler.php b/livesupport/modules/htmlUI/var/html/ui_handler.php index b7797af9d..412c4f5e8 100644 --- a/livesupport/modules/htmlUI/var/html/ui_handler.php +++ b/livesupport/modules/htmlUI/var/html/ui_handler.php @@ -222,7 +222,7 @@ switch($_REQUEST['act']){ $uiHandler->SCHEDULER->setReload(); break; - case "SCHEDULER.uploadPlaylistMethod": + case "SCHEDULER.uploadPlaylistMethod": $uiHandler->SCHEDULER->uploadPlaylistMethod($_REQUEST); $uiHandler->SCHEDULER->setReload(); break; @@ -240,4 +240,6 @@ if (ob_get_contents()) { } ob_end_clean ?> - \ No newline at end of file + + + \ No newline at end of file diff --git a/livesupport/modules/htmlUI/var/index.php b/livesupport/modules/htmlUI/var/index.php index 0715bf676..607ee2da4 100644 --- a/livesupport/modules/htmlUI/var/index.php +++ b/livesupport/modules/htmlUI/var/index.php @@ -1,4 +1,3 @@ \ No newline at end of file diff --git a/livesupport/modules/htmlUI/var/templates/file/objects.tpl b/livesupport/modules/htmlUI/var/templates/file/objects.tpl index 43f3af406..44c60fd52 100755 --- a/livesupport/modules/htmlUI/var/templates/file/objects.tpl +++ b/livesupport/modules/htmlUI/var/templates/file/objects.tpl @@ -8,7 +8,7 @@ Title Type -   +   {if $START.pid}[go up]{/if} diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/calendar.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/calendar.tpl index e9f5f4798..f8668430a 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/calendar.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/calendar.tpl @@ -1,33 +1,63 @@ +{$SCHEDULER->buildDecade()} +{$SCHEDULER->buildYear()} {$SCHEDULER->buildMonth()} {$SCHEDULER->buildWeek()} - - - {foreach from=$SCHEDULER->Week item="_Weekday"} - - {/foreach} - -{foreach from=$SCHEDULER->Month item="_Day"} - {if $_Day.isFirst} - - - {/if} - - {if $_Day.isEmpty} -
- {elseif $_Day.isSelected} -
- {else} -
- {/if} - {$_Day.day} -
- - {if $_Day.isLast} - - {/if} -{/foreach} +
+ + + + + + + + {foreach from=$SCHEDULER->Week item="_Weekday"} + + {/foreach} + + {foreach from=$SCHEDULER->Month item="_Day"} + {if $_Day.isFirst} + + + {/if} + + {if $_Day.isLast} + + {/if} + {/foreach}
{$SCHEDULER->curr.year}-{$SCHEDULER->curr.month}-{$SCHEDULER->curr.day}
 {$_Weekday.label.short}
{$_Day.week} +
{$SCHEDULER->curr.year}-{$SCHEDULER->curr.month}-{$SCHEDULER->curr.day}
<< +
+ +
+
+
+ +
+ +
>>
 {$_Weekday.label.short}
{$_Day.week} + + {if $_Day.isEmpty} +
+ {elseif $_Day.isSelected} +
+ {else} +
+ {/if} + {$_Day.day} +
+
diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl index 48ce7840f..40180c7d1 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl @@ -1,7 +1,5 @@ {$SCHEDULER->buildDay()} -Day View - {foreach from=$SCHEDULER->Day item="_Hour"} diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/input.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/input.tpl deleted file mode 100755 index e0e25ecf8..000000000 --- a/livesupport/modules/htmlUI/var/templates/scheduler/input.tpl +++ /dev/null @@ -1,21 +0,0 @@ -{SEARCH->getResult assign=_results} - -{if $_results.cnt > 0} -
- {foreach from=$_results.items item=i} - - - - - - {/foreach} -
- {if $PLAYLIST.id == $i.id} - {$i.title|truncate:30} - {else} - {$i.title|truncate:30} - {/if} - {$i.type}{$i.gunid}
-{else} - No match found. -{/if} diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/main.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/main.tpl index cb50cdc31..23d04b447 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/main.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/main.tpl @@ -4,7 +4,7 @@ - + {include file="scheduler/calendar.tpl"} diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/month.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/month.tpl index 0d1b13354..18a172a76 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/month.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/month.tpl @@ -1,8 +1,6 @@ {$SCHEDULER->buildMonth()} {$SCHEDULER->buildWeek()} -Month View - diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/schedule.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/schedule.tpl new file mode 100755 index 000000000..15eb3123b --- /dev/null +++ b/livesupport/modules/htmlUI/var/templates/scheduler/schedule.tpl @@ -0,0 +1,108 @@ +{$SCHEDULER->copyPlFromSP()} + + + + + : + : + + - + + + +
+ + + + + + diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl index 0422eaafa..414206687 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl @@ -1,7 +1,5 @@ {$SCHEDULER->buildWeek()} -Week View -
@@ -18,7 +16,21 @@ Week View {if $_Day.isEmpty} {else} - + {/if} {if $_Day.isLast} diff --git a/livesupport/modules/htmlUI/var/ui_calendar.class.php b/livesupport/modules/htmlUI/var/ui_calendar.class.php index 41853d32c..d1dd09eb4 100755 --- a/livesupport/modules/htmlUI/var/ui_calendar.class.php +++ b/livesupport/modules/htmlUI/var/ui_calendar.class.php @@ -7,6 +7,38 @@ class uiCalendar $this->firstDayOfWeek = 1; } + function buildDecade() + { + for ($Year=$this->curr['year']-3; $Year<=$this->curr['year']+5; $Year++) { + $this->Decade[] = array( + 'year' => $Year, + 'isSelected' => $Year==$this->curr['year'] ? TRUE : FALSE + ); + } + + } + + + function buildYear() + { + require_once 'Calendar/Year.php'; + require_once 'Calendar/Month.php'; + + $Year = new Calendar_Year($this->curr['year']); + # mark current month + $sel = new Calendar_Month($this->curr['year'], $this->curr['month']); + $selections = array($sel); + + $Year->build($selections, $this->firstDayOfWeek); + while ($Month = $Year->fetch()) { + $this->Year[] = array( + 'month' => $this->Base->_twoDigits($Month->thisMonth()), + 'label' => $this->_getMonthName($Month), + 'isSelected' => $Month->isSelected() + ); + } + } + function buildMonth() { @@ -19,15 +51,16 @@ class uiCalendar $Month = new Calendar_Month_Weekdays($this->curr['year'], $this->curr['month'], $this->firstDayOfWeek); # mark today # $sel = new Calendar_Day($this->curr['year'], $this->curr['month'], $this->curr['day']); - $selection = array($sel); + $selections = array($sel); - $Month->build($selection); + $Month->build($selections); while ($Day = $Month->fetch()) { $this->Month[] = array( 'day' => $this->Base->_twoDigits($Day->thisDay()), 'week' => $this->_getWeekNr($Day), - 'month' => $this->Base->_twoDigits($Day->thisMonth()), - 'year' => $Day->thisYear(), + 'month' => $Day->thisMonth()<=12 ? $this->Base->_twoDigits($Day->thisMonth()) : '01', ## due to bug in + 'year' => $Day->thisMonth()<=12 ? $Day->thisYear() : $Day->thisYear()+1, ## Calendar_Month_Weekdays + 'label' => $this->_getDayName($Day), 'isEmpty' => $Day->isEmpty(), 'isFirst' => $Day->isFirst(), 'isLast' => $Day->isLast(), @@ -48,6 +81,9 @@ class uiCalendar while ($Day = $Week->fetch()) { $this->Week[] = array( 'day' => $this->Base->_twoDigits($Day->thisDay()), + 'week' => $this->_getWeekNr($Day), + 'month' => $this->Base->_twoDigits($Day->thisMonth()), + 'year' => $Day->thisYear(), 'label' => $this->_getDayName($Day), ); } @@ -81,10 +117,20 @@ class uiCalendar } } + + ## some data which PEAR::Calendar does not provide ########################################################################################## + function _getMonthName(&$date) { + $timestamp = mktime($date->thisHour(), $date->thisMinute(), $date->thisSecond(), $date->thisMonth(), $date->thisDay(), $date->thisYear()); + #echo $date->thisHour().$date->thisMinute().$date->thisSecond().$date->thisYear().$date->thisMonth().$date->thisDay().$timestamp."
"; + return array('short' => strftime("%b", $timestamp), + 'full' => strftime("%B", $timestamp)); + } + + function _getWeekNr(&$date) { $timestamp = mktime($date->thisHour(), $date->thisMinute(), $date->thisSecond(), $date->thisMonth(), $date->thisDay(), $date->thisYear()); #echo $date->thisHour().$date->thisMinute().$date->thisSecond().$date->thisYear().$date->thisMonth().$date->thisDay().$timestamp."
"; - return date("W", $timestamp); + return strftime("%V", $timestamp); } diff --git a/livesupport/modules/htmlUI/var/ui_handler.class.php b/livesupport/modules/htmlUI/var/ui_handler.class.php index 5aecb78a2..701b2b6f6 100644 --- a/livesupport/modules/htmlUI/var/ui_handler.class.php +++ b/livesupport/modules/htmlUI/var/ui_handler.class.php @@ -52,7 +52,9 @@ class uiHandler extends uiBase { $this->redirUrl = UI_BROWSER.'?popup[]=login'; return FALSE; } - setcookie($this->config['authCookieName'], $sessid); + #setcookie($this->config['authCookieName'], $sessid); + echo ""; + ob_flush(); $id = $this->gb->getObjId($formdata['login'], $this->gb->storId); if(PEAR::isError($id)) { $this->_retMsg('Login failed'); @@ -76,7 +78,9 @@ class uiHandler extends uiBase { function logout($trigger_login = FALSE) { $this->gb->logout($this->sessid); - setcookie($this->config['authCookieName'], ''); + #setcookie($this->config['authCookieName'], ''); + echo ""; + ob_clean(); session_destroy(); if ($trigger_login) diff --git a/livesupport/modules/htmlUI/var/ui_handler_init.php b/livesupport/modules/htmlUI/var/ui_handler_init.php index e064d96cc..fbf104bfd 100644 --- a/livesupport/modules/htmlUI/var/ui_handler_init.php +++ b/livesupport/modules/htmlUI/var/ui_handler_init.php @@ -8,6 +8,11 @@ require_once dirname(__FILE__).'/ui_handler.class.php'; ## initialize objects ############################################### $uiHandler =& new uiHandler($config); $uiBase =& $uiHandler; - +?> + + + +Your request is processed... + diff --git a/livesupport/modules/htmlUI/var/ui_scheduler.class.php b/livesupport/modules/htmlUI/var/ui_scheduler.class.php index f3710fd74..7e3aafd49 100755 --- a/livesupport/modules/htmlUI/var/ui_scheduler.class.php +++ b/livesupport/modules/htmlUI/var/ui_scheduler.class.php @@ -29,7 +29,23 @@ class uiScheduler extends uiCalendar extract($arr); if ($view) $this->curr['view'] = $view; if ($year) $this->curr['year'] = $year; - if ($month) $this->curr['month']= $month; + if (is_numeric($month)) $this->curr['month'] = $month; + if ($month=='++') { + if ($this->curr['month']==12) { + $this->curr['month'] = '01'; + $this->curr['year']++; + } else { + $this->curr['month'] = $this->Base->_twoDigits(++$this->curr['month']); + } + } + if ($month=='--') { + if ($this->curr['month']=='01') { + $this->curr['month'] = 12; + $this->curr['year']--; + } else { + $this->curr['month'] = $this->Base->_twoDigits(--$this->curr['month']); + } + } if ($day) $this->curr['day'] = $day; if ($hour) $this->curr['hour'] = $hour; } @@ -43,14 +59,21 @@ class uiScheduler extends uiCalendar } - function getDayUsagePercentage($year, $month, $day) + function getDayUsage($year, $month, $day) { - $duration = 0; $date = $year.$month.$day; $arr = $this->displayScheduleMethod($date.'T00:00:00', $date.'T23:59:59.999999'); - if (!count($arr)) { + if (!count($arr)) return FALSE; - } + #print_r($arr); + return $arr; + } + + function getDayUsagePercentage($year, $month, $day) + { + $duration = 0; + if (!$arr = $this->getDayUsage($year, $month, $day)) + return false; foreach ($arr as $val) { $duration =+ $this->_datetime2timestamp($val['end'])-$this->_datetime2timestamp($val['start']); @@ -58,6 +81,15 @@ class uiScheduler extends uiCalendar return $duration/86400*100; } + + function copyPlFromSP() + { + foreach ($this->Base->SCRATCHPAD->get() as $val) { + if (strtolower($val['type'])=='playlist') + $this->playlists[] = $val; + } + } + ## XML-RPC methods ############################################################################################ function initXmlRpc() { @@ -69,10 +101,10 @@ class uiScheduler extends uiCalendar function uploadPlaylistMethod(&$formdata) { $gunid = $formdata['gunid']; - $datetime = $formdate['datetime']; - - $r = $this->spc->UploadPlaylistMethod($this->Base->sessid, $gunid, '20050308T04:44:00.000000'.UI_TIMEZONE); - var_dump($r); + $datetime = $this->curr['year'].$this->curr['month'].$this->curr['day'].'T'.$formdata['time']; + echo $datetime; + $r = $this->spc->UploadPlaylistMethod($this->Base->sessid, $gunid, $datetime.UI_TIMEZONE); + #var_dump($r); }
 {$_Day.day} + {$_Day.day} + {assign var="_oneday" value=$SCHEDULER->getDayUsage($_Day.year, $_Day.month, $_Day.day)} + {if is_array($_oneday)} + + {foreach from=$_oneday item="i"} + + {/foreach} +
+ Start:{$i.start|regex_replace:"/[0-9]+T/":""} +
+ End:  {$i.end|regex_replace:"/[0-9]+T/":""} +
+ {/if} +