From 3bfbf614a38c8bd020af4e98574d62d9471a8766 Mon Sep 17 00:00:00 2001 From: sebastian Date: Thu, 28 Apr 2005 16:00:04 +0000 Subject: [PATCH] *** empty log message *** --- .../htmlUI/var/SmartyExtensions.inc.php | 4 +- .../var/templates/popup/SCHEDULER.addItem.tpl | 6 +- .../var/templates/scheduler/context_week.tpl | 1 - .../htmlUI/var/templates/scheduler/day.tpl | 6 +- .../var/templates/scheduler/day_onclick.tpl | 9 +++ .../htmlUI/var/templates/scheduler/week.tpl | 14 ++-- .../var/templates/scheduler/week_onclick.tpl | 9 +++ .../var/templates/script/contextmenu.js.tpl | 40 +++++------ livesupport/modules/htmlUI/var/ui_conf.php | 3 +- .../modules/htmlUI/var/ui_scheduler.class.php | 71 ++++++++++++------- 10 files changed, 96 insertions(+), 67 deletions(-) delete mode 100755 livesupport/modules/htmlUI/var/templates/scheduler/context_week.tpl create mode 100755 livesupport/modules/htmlUI/var/templates/scheduler/day_onclick.tpl create mode 100755 livesupport/modules/htmlUI/var/templates/scheduler/week_onclick.tpl diff --git a/livesupport/modules/htmlUI/var/SmartyExtensions.inc.php b/livesupport/modules/htmlUI/var/SmartyExtensions.inc.php index 18929fe01..1839fa4e1 100644 --- a/livesupport/modules/htmlUI/var/SmartyExtensions.inc.php +++ b/livesupport/modules/htmlUI/var/SmartyExtensions.inc.php @@ -1,4 +1,4 @@ -register_object('UIBROWSER', $uiBrowser); $Smarty->register_object('BROWSE', $uiBrowser->BROWSE); $Smarty->register_object('SEARCH', $uiBrowser->SEARCH); @@ -118,7 +118,7 @@ function S_niceTime($param) $in = str_replace(' ', '', $in); if (preg_match('/^[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}$/', $in)) list($h, $i, $s) = explode(':', $in); - elseif (preg_match('/^[0-9]{1,2}:[0-9]{1,2}$/', $in)) list($i, $s) = explode(':', $in); + elseif (preg_match('/^[0-9]{1,2}:[0-9]{1,2}$/', $in)) list($i, $s) = explode(':', $in); else $s = $in; if ($all || $h > 0) $H = sprintf('%02d', $h).':'; diff --git a/livesupport/modules/htmlUI/var/templates/popup/SCHEDULER.addItem.tpl b/livesupport/modules/htmlUI/var/templates/popup/SCHEDULER.addItem.tpl index a1b4da0ca..39e4b5941 100755 --- a/livesupport/modules/htmlUI/var/templates/popup/SCHEDULER.addItem.tpl +++ b/livesupport/modules/htmlUI/var/templates/popup/SCHEDULER.addItem.tpl @@ -41,9 +41,9 @@ function SCHEDULE_snap2Hour() function SCHEDULE_snap2Prev() { {/literal} - document.forms["schedule"].elements["time[H]"].value = "{$SCHEDULER->schedulePrev.hour}"; - document.forms["schedule"].elements["time[i]"].value = "{$SCHEDULER->schedulePrev.minute}"; - document.forms["schedule"].elements["time[s]"].value = "{$SCHEDULER->schedulePrev.second}"; + document.forms["schedule"].elements["time[H]"].value = "{$SCHEDULER->schedulePrev.hour|string_format:'%d'}"; + document.forms["schedule"].elements["time[i]"].value = "{$SCHEDULER->schedulePrev.minute|string_format:'%d'}"; + document.forms["schedule"].elements["time[s]"].value = "{$SCHEDULER->schedulePrev.second|string_format:'%d'}"; {literal} } diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/context_week.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/context_week.tpl deleted file mode 100755 index 14343a936..000000000 --- a/livesupport/modules/htmlUI/var/templates/scheduler/context_week.tpl +++ /dev/null @@ -1 +0,0 @@ -onClick="return contextmenu('year={$_day.year}&month={$_day.month}&day={$_day.day}&hour={$_hour}&minute=0&second=0', 'SCHEDULER.addItem')" diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl index a450a04ab..8ade3de46 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl @@ -33,11 +33,11 @@ {if is_array($_entrys[$_hour])} - {$_hour|string_format:"%02d"}:00 + {$_hour|string_format:"%02d"}:00 {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} @@ -48,7 +48,7 @@ {else} - + {$_hour|string_format:"%02d"}:00 diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/day_onclick.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/day_onclick.tpl new file mode 100755 index 000000000..e5b36f5c8 --- /dev/null +++ b/livesupport/modules/htmlUI/var/templates/scheduler/day_onclick.tpl @@ -0,0 +1,9 @@ +{getHour time=$i.end assign="_endH"} + +{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')" +{else} + onClick="return contextmenu('year={$SCHEDULER->curr.year}&month={$SCHEDULER->curr.month}&day={$SCHEDULER->curr.day}&hour={$_hour}&minute=0&second=0', 'SCHEDULER.addItem')" +{/if} + +{assign var="_endH" value=null} diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl index b96083b58..bcbac82a2 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl @@ -31,7 +31,7 @@ {foreach from=$SCHEDULER->Week item="_Day"} {* hier werden die Tagesnummern angezeigt *} - {$_Day.day} + {$_Day.day} {/foreach} @@ -46,20 +46,20 @@ {$_hour} {foreach from=$SCHEDULER->Week item="_day"} {if is_array($_entrys[$_day.day][$_hour])} - + - {foreach from=$_entrys[$_day.day][$_hour] item="i"} + {foreach from=$_entrys[$_day.day][$_hour] item="i"}

{$i.title|truncate:12}

-

{$i.start|truncate:5:""} - {$i.end|truncate:5:""}

+

{$i.start|truncate:8:""} - {$i.end|truncate:8:""}

{$i.creator}

- {*
*} + {*
*} {/foreach} {else} - - + + {/if} {/foreach} diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/week_onclick.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/week_onclick.tpl new file mode 100755 index 000000000..45398750c --- /dev/null +++ b/livesupport/modules/htmlUI/var/templates/scheduler/week_onclick.tpl @@ -0,0 +1,9 @@ +{getHour time=$i.end assign="_endH"} + +{if $_endH == $_hour} + onClick="return contextmenu('year={$_day.year}&month={$_day.month}&day={$_day.day}&hour={getHour time=$i.end}&minute={getMinute time=$i.end}&second={getSecond time=$i.end}', 'SCHEDULER.addItem')" +{else} + onClick="return contextmenu('year={$_day.year}&month={$_day.month}&day={$_day.day}&hour={$_hour}&minute=0&second=0', 'SCHEDULER.addItem')" +{/if} + +{assign var="_endH" value=null} diff --git a/livesupport/modules/htmlUI/var/templates/script/contextmenu.js.tpl b/livesupport/modules/htmlUI/var/templates/script/contextmenu.js.tpl index bbd9727af..dcc6b5f6b 100755 --- a/livesupport/modules/htmlUI/var/templates/script/contextmenu.js.tpl +++ b/livesupport/modules/htmlUI/var/templates/script/contextmenu.js.tpl @@ -28,20 +28,16 @@ for (var i = 1; i < contextmenu.arguments.length; ++i) { switch (contextmenu.arguments[i]) { {/literal} - case "PL.display": - contextmenuHtml = contextmenuHtml + "
  •  ##Display this Playlist## 
  • "; - break; - case "PL.release": - contextmenuHtml = contextmenuHtml + "
  •  ##Close playlist## 
  • "; + contextmenuHtml = contextmenuHtml + "
  •  ##Close playlist## 
  • "; break; case "PL.addItem": - contextmenuHtml = contextmenuHtml + "
  •  ##Add to active Playlist## 
  • "; + contextmenuHtml = contextmenuHtml + "
  •  ##Add to active Playlist## 
  • "; break; case "PL.removeItem": - contextmenuHtml = contextmenuHtml + "
  •  ##Remove File from Playlist## 
  • "; + contextmenuHtml = contextmenuHtml + "
  •  ##Remove File from Playlist## 
  • "; break; case "PL.activate": @@ -49,56 +45,52 @@ break; case "PL.create": - contextmenuHtml = contextmenuHtml + "
  •  ##New Playlist using this File## 
  • "; + contextmenuHtml = contextmenuHtml + "
  •  ##New Playlist using this File## 
  • "; break; case "PL.changeFadeIn": - contextmenuHtml = contextmenuHtml + "
  •  ##Change Fadein## 
  • "; + contextmenuHtml = contextmenuHtml + "
  •  ##Change Fadein## 
  • "; break; case "PL.changeTransition": - contextmenuHtml = contextmenuHtml + "
  •  ##Change Transition## 
  • "; + contextmenuHtml = contextmenuHtml + "
  •  ##Change Transition## 
  • "; break; case "PL.changeFadeOut": - contextmenuHtml = contextmenuHtml + "
  •  ##Change Fadeout## 
  • "; - break; - - case "PL.editMetaData": - contextmenuHtml = contextmenuHtml + "
  •  ##Edit Metadata## 
  • "; + contextmenuHtml = contextmenuHtml + "
  •  ##Change Fadeout## 
  • "; break; case "SP.addItem": - contextmenuHtml = contextmenuHtml + "
  •  ##Add to ScratchPad## 
  • "; + contextmenuHtml = contextmenuHtml + "
  •  ##Add to ScratchPad## 
  • "; break; case "SP.removeItem": - contextmenuHtml = contextmenuHtml + "
  •  ##Remove from Scratchpad## 
  • "; + contextmenuHtml = contextmenuHtml + "
  •  ##Remove from Scratchpad## 
  • "; break; case "listen": i++; - contextmenuHtml = contextmenuHtml + "
  •  ##Listen to File## 
  • "; + contextmenuHtml = contextmenuHtml + "
  •  ##Listen to File## 
  • "; break; case "edit": - contextmenuHtml = contextmenuHtml + "
  •  ##Edit File## 
  • "; + contextmenuHtml = contextmenuHtml + "
  •  ##Edit File## 
  • "; break; case "delete": - contextmenuHtml = contextmenuHtml + "
  •  ##Delete File## 
  • "; + contextmenuHtml = contextmenuHtml + "
  •  ##Delete File## 
  • "; break; case "fileList": - contextmenuHtml = contextmenuHtml + "
  •  ##List Folder## 
  • "; + contextmenuHtml = contextmenuHtml + "
  •  ##List Folder## 
  • "; break; case "SCHEDULER.addItem": - contextmenuHtml = contextmenuHtml + "
  •  ##Insert Playlist here## 
  • "; + contextmenuHtml = contextmenuHtml + "
  •  ##Insert Playlist here## 
  • "; break; case "SCHEDULER.removeItem": - contextmenuHtml = contextmenuHtml + "
  •  ##Remove Playlist## 
  • "; + contextmenuHtml = contextmenuHtml + "
  •  ##Remove Playlist## 
  • "; break; case "SUBJECTS.chgPasswd": @@ -118,7 +110,7 @@ break; case "SUBJECTS.removeSubj": - contextmenuHtml = contextmenuHtml + "
  •  ##Delete## 
  • "; + contextmenuHtml = contextmenuHtml + "
  •  ##Delete## 
  • "; break; {literal} diff --git a/livesupport/modules/htmlUI/var/ui_conf.php b/livesupport/modules/htmlUI/var/ui_conf.php index be83b79e8..0ba8f0140 100755 --- a/livesupport/modules/htmlUI/var/ui_conf.php +++ b/livesupport/modules/htmlUI/var/ui_conf.php @@ -70,7 +70,8 @@ define('UI_BROWSE_DEFAULT_KEY_3', 'dc:source'); define('UI_BROWSE_DEFAULT_LIMIT', 10); ## Scheduler / Calendar -define('UI_SCHEDULER_FIRSTWEEKDAY', 1); +define('UI_SCHEDULER_FIRSTWEEKDAY', 1); +define('UI_SCHEDULER_PAUSE_PL2PL', '5 seconds'); diff --git a/livesupport/modules/htmlUI/var/ui_scheduler.class.php b/livesupport/modules/htmlUI/var/ui_scheduler.class.php index 7781d41b1..16b259086 100755 --- a/livesupport/modules/htmlUI/var/ui_scheduler.class.php +++ b/livesupport/modules/htmlUI/var/ui_scheduler.class.php @@ -100,37 +100,51 @@ class uiScheduler extends uiCalendar if (is_numeric($second)) $this->scheduleAt['second'] = sprintf('%02d', $second); $week = $this->getWeekEntrys(); - ## search for next entry - if (count($week[$this->scheduleAt['day']]) >= 1) { - foreach ($week[$this->scheduleAt['day']] as $entry) { - if (strtotime($entry[0]['start']) >= strtotime($this->scheduleAt['hour'].':'.$this->scheduleAt['minute'].':'.$this->scheduleAt['second'])) { - list($this->scheduleNext['hour'], $this->scheduleNext['minute'], $this->scheduleNext['second']) = explode(':', strftime('%H:%M:%S', strtotime($entry[0]['start'])-1)); - break; - } - } - } else { - ## start at midnight - $this->scheduleNext['hour'] = 0; - $this->scheduleNext['minute'] = 0; - $this->scheduleNext['second'] = 0; - } - reset ($week); ## search for previous entry if (count($week[$this->scheduleAt['day']]) >= 1) { foreach (array_reverse($week[$this->scheduleAt['day']]) as $entry) { if (strtotime($entry[0]['end']) <= strtotime($this->scheduleAt['hour'].':'.$this->scheduleAt['minute'].':'.$this->scheduleAt['second'])) { - list($this->schedulePrev['hour'], $this->schedulePrev['minute'], $this->schedulePrev['second']) = explode(':', strftime('%H:%M:%S', strtotime($entry[0]['end'])+1)); + $prev = TRUE; + list ($this->schedulePrev['hour'], $this->schedulePrev['minute'], $this->schedulePrev['second']) + = explode (':', strftime('%H:%M:%S', strtotime('+'.UI_SCHEDULER_PAUSE_PL2PL, strtotime($entry[0]['end']))) + ); break; } } - } else { + } + if ($prev !== TRUE) { ## start at midnight $this->schedulePrev['hour'] = 0; $this->schedulePrev['minute'] = 0; $this->schedulePrev['second'] = 0; } + reset ($week); + + ## search for next entry + if (count($week[$this->scheduleAt['day']]) >= 1) { + foreach ($week[$this->scheduleAt['day']] as $entry) { + if (strtotime($entry[0]['start']) >= strtotime($this->scheduleAt['hour'].':'.$this->scheduleAt['minute'].':'.$this->scheduleAt['second'])) { + $next = TRUE; + list ($this->scheduleNext['hour'], $this->scheduleNext['minute'], $this->scheduleNext['second']) + = explode (':', strftime('%H:%M:%S', strtotime('-'.UI_SCHEDULER_PAUSE_PL2PL, strtotime($entry[0]['start'])))); + break; + } + } + } + if ($next !== TRUE) { + ## end at midnight + $thisDay = $this->scheduleAt['year']."-".$this->scheduleAt['month']."-".$this->scheduleAt['day']; + $nextDayStamp = strtotime('+1 day', $thisDay); + $this->scheduleNext['year'] = strftime('%Y', $nextDayStamp); + $this->scheduleNext['month'] = strftime('%m', $nextDayStamp);; + $this->scheduleNext['day'] = strftime('%d', $nextDayStamp); + $this->scheduleNext['hour'] = 0; + $this->scheduleNext['minute'] = 0; + $this->scheduleNext['second'] = 0; + } + #print_r($this->schedulePrev); #print_r($this->scheduleNext); @@ -141,9 +155,9 @@ class uiScheduler extends uiCalendar { ## 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'); + $thisWeekStart = strftime("%Y%m%d", $this->Week[0]['timestamp']); + $nextWeekStart = strftime("%Y%m%d", $this->Week[6]['timestamp'] + 86400); + $arr = $this->displayScheduleMethod($thisWeekStart.'T00:00:00', $nextWeekStart.'T00:00:00'); #print_r($arr); if (!count($arr)) @@ -154,7 +168,7 @@ class uiScheduler extends uiCalendar 'id' => $this->Base->gb->_idFromGunid($val['playlistId']), 'scheduleid'=> $val['id'], 'start' => substr($val['start'], strpos($val['start'], 'T')+1), - 'end' => substr($val['end'], strpos($val['end'], '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), 'type' => 'Playlist' @@ -170,8 +184,9 @@ class uiScheduler extends uiCalendar { ## 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'); + $thisDay = strftime("%Y%m%d", $this->Day[0]['timestamp']); + $nextDay = strftime("%Y%m%d", $this->Day[0]['timestamp'] + 86400); + $arr = $this->displayScheduleMethod($thisDay.'T00:00:00', $nextDay.'T00:00:00'); #print_r($arr); if (!count($arr)) @@ -193,6 +208,7 @@ class uiScheduler extends uiCalendar return $items; } + /* function getDayHourlyEntrys($year, $month, $day) { $date = $year.$month.$day; @@ -210,11 +226,13 @@ class uiScheduler extends uiCalendar #print_r($items); return $items; } + */ function getDayUsage($year, $month, $day) { - $date = $year.$month.$day; - $arr = $this->displayScheduleMethod($date.'T00:00:00', $date.'T23:59:59.999999'); + $thisDay = $year.$month.$day; + $nextDay = strftime("%Y%m%d", strtotime('+1 day', strtotime("$year-$month-$day"))); + $arr = $this->displayScheduleMethod($thisDay.'T00:00:00', $nextDay.'T00:00:00'); if (!count($arr)) return FALSE; foreach ($arr as $key=>$val) { @@ -239,6 +257,7 @@ class uiScheduler extends uiCalendar } + /* function getDayTiming($year, $month, $day) { #echo $year.$month.$day; @@ -288,7 +307,7 @@ class uiScheduler extends uiCalendar #print_r($list); return $list; } - + */ function getDayTimingScale() {