From e5120cbf0b7804ba68e66010fa2bc478b5b74e91 Mon Sep 17 00:00:00 2001 From: sebastian Date: Wed, 27 Apr 2005 16:34:33 +0000 Subject: [PATCH] *** empty log message *** --- .../modules/htmlUI/var/html/ui_handler.php | 6 +-- .../var/templates/library/actionhandler.tpl | 3 +- .../htmlUI/var/templates/library/results.tpl | 17 ++++--- .../htmlUI/var/templates/loader/index.tpl | 3 ++ .../modules/htmlUI/var/templates/menu.tpl | 2 +- .../var/templates/playlist/actionhandler.tpl | 3 +- .../htmlUI/var/templates/playlist/editor.tpl | 20 +++++--- .../var/templates/popup/SCHEDULER.addItem.tpl | 2 +- .../htmlUI/var/templates/scheduler/day.tpl | 2 +- .../htmlUI/var/templates/scheduler/week.tpl | 2 +- .../templates/scratchpad/actionhandler.tpl | 5 +- .../htmlUI/var/templates/scratchpad/main.tpl | 15 +++--- .../var/templates/script/collector.js.tpl | 10 ++-- .../var/templates/script/contextmenu.js.tpl | 4 +- .../templates/subjects/manageGroupMember.tpl | 18 ++++--- .../var/templates/subjects/overview.tpl | 13 +++-- .../modules/htmlUI/var/ui_scheduler.class.php | 32 +++++++++--- .../modules/htmlUI/var/ui_subjects.class.php | 50 +++++++++++++++---- 18 files changed, 135 insertions(+), 72 deletions(-) diff --git a/livesupport/modules/htmlUI/var/html/ui_handler.php b/livesupport/modules/htmlUI/var/html/ui_handler.php index f2d3d81cd..d8baabf37 100644 --- a/livesupport/modules/htmlUI/var/html/ui_handler.php +++ b/livesupport/modules/htmlUI/var/html/ui_handler.php @@ -1,6 +1,6 @@ SUBJECTS->removeSubj($_REQUEST); break; - case "SUBJECTS.addSubj2Group": - $uiHandler->SUBJECTS->addSubj2Group($_REQUEST); + case "SUBJECTS.addSubj2Gr": + $uiHandler->SUBJECTS->addSubj2Gr($_REQUEST); break; case "SUBJECTS.removeSubjFromGr": diff --git a/livesupport/modules/htmlUI/var/templates/library/actionhandler.tpl b/livesupport/modules/htmlUI/var/templates/library/actionhandler.tpl index baa60c7ec..029a54e6f 100755 --- a/livesupport/modules/htmlUI/var/templates/library/actionhandler.tpl +++ b/livesupport/modules/htmlUI/var/templates/library/actionhandler.tpl @@ -1,5 +1,4 @@ -{include file="sub/mouseover.tpl"} -onClick="hidealttextnow(); return contextmenu('{$i.id}' +onClick="return contextmenu('{$i.id}' , 'SP.addItem' {if $i.type|lower == 'audioclip'} diff --git a/livesupport/modules/htmlUI/var/templates/library/results.tpl b/livesupport/modules/htmlUI/var/templates/library/results.tpl index 8cb0ec391..8d6cd1a7f 100755 --- a/livesupport/modules/htmlUI/var/templates/library/results.tpl +++ b/livesupport/modules/htmlUI/var/templates/library/results.tpl @@ -8,10 +8,10 @@ - - - - + + + + {foreach from=$_results.items item=i} @@ -25,8 +25,10 @@ {/if} - - + + {/foreach} @@ -76,4 +78,5 @@ ##No match found.## {/if} -{assign var="_PL_activeId" value=NULL} +{assign var="_PL_activeId" value=null} +{assign var="_duration" value=null} diff --git a/livesupport/modules/htmlUI/var/templates/loader/index.tpl b/livesupport/modules/htmlUI/var/templates/loader/index.tpl index 4ca0b8a9d..77f0374b6 100755 --- a/livesupport/modules/htmlUI/var/templates/loader/index.tpl +++ b/livesupport/modules/htmlUI/var/templates/loader/index.tpl @@ -3,6 +3,7 @@
+ +
##Title####Creator####Duration####Type####Title####Creator####Duration####Type##
{$i.creator}{assign var="_duration" value=$i.duration}{niceTime in=$_duration}{$i.type|lower|capitalize}{assign var="_duration" value=$i.duration}{niceTime in=$_duration} + {$i.type|lower|capitalize} +
diff --git a/livesupport/modules/htmlUI/var/templates/menu.tpl b/livesupport/modules/htmlUI/var/templates/menu.tpl index 503280832..036192acb 100755 --- a/livesupport/modules/htmlUI/var/templates/menu.tpl +++ b/livesupport/modules/htmlUI/var/templates/menu.tpl @@ -21,7 +21,7 @@ {/if} diff --git a/livesupport/modules/htmlUI/var/templates/playlist/actionhandler.tpl b/livesupport/modules/htmlUI/var/templates/playlist/actionhandler.tpl index 04539a968..617f0b84a 100755 --- a/livesupport/modules/htmlUI/var/templates/playlist/actionhandler.tpl +++ b/livesupport/modules/htmlUI/var/templates/playlist/actionhandler.tpl @@ -1,2 +1 @@ -{include file="sub/mouseover.tpl"} -onClick="hidealttextnow(); return contextmenu('{$i.attrs.id}', {if $i.type|lower == "audioclip"}'listen', '{$i.gunid}', {/if} 'PL.removeItem')" +onClick="return contextmenu('{$i.attrs.id}', {if $i.type|lower == "audioclip"}'listen', '{$i.gunid}', {/if} 'PL.removeItem')" diff --git a/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl b/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl index 3ff86c404..2afdda7de 100755 --- a/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl +++ b/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl @@ -16,10 +16,10 @@ - ##Name## - ##Duration## - ##Artist## - ##Type## + ##Name## + ##Duration## + ##Artist## + ##Type## ##Move## @@ -34,11 +34,15 @@ {$i.title} - {$i.duration} + + {assign var="_duration" value=$i.duration}{niceTime in=$_duration} + {$i.creator} - {$i.type|lower|capitalize} + + {$i.type|capitalize} + - ##move up## + ##move up## ##move down## @@ -75,4 +79,4 @@ - +{assign var="_duration" value=null} diff --git a/livesupport/modules/htmlUI/var/templates/popup/SCHEDULER.addItem.tpl b/livesupport/modules/htmlUI/var/templates/popup/SCHEDULER.addItem.tpl index c8f74c8f0..a1b4da0ca 100755 --- a/livesupport/modules/htmlUI/var/templates/popup/SCHEDULER.addItem.tpl +++ b/livesupport/modules/htmlUI/var/templates/popup/SCHEDULER.addItem.tpl @@ -32,7 +32,7 @@ function SCHEDULE_submit() function SCHEDULE_snap2Hour() { {/literal} - document.forms["schedule"].elements["time[H]"].value = "{$SCHEDULER->scheduleAt.hour}"; + document.forms["schedule"].elements["time[H]"].value = "{$SCHEDULER->scheduleAt.hour|string_format:'%d'}"; document.forms["schedule"].elements["time[i]"].value = "0"; document.forms["schedule"].elements["time[s]"].value = "0"; {literal} diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl index 5a0673681..a450a04ab 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/day.tpl @@ -42,7 +42,7 @@ {$i.start}-{$i.end} {$i.creator} -
+ {*
*} {/foreach} diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl index bd4ebffac..b96083b58 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/week.tpl @@ -54,7 +54,7 @@

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

{$i.creator}

-
+ {*
*} {/foreach} {else} diff --git a/livesupport/modules/htmlUI/var/templates/scratchpad/actionhandler.tpl b/livesupport/modules/htmlUI/var/templates/scratchpad/actionhandler.tpl index 9219891c9..2f43c37e0 100755 --- a/livesupport/modules/htmlUI/var/templates/scratchpad/actionhandler.tpl +++ b/livesupport/modules/htmlUI/var/templates/scratchpad/actionhandler.tpl @@ -1,5 +1,4 @@ -{include file="sub/mouseover.tpl"} -onClick="hidealttextnow(); return contextmenu('{$i.id}' +onClick="return contextmenu('{$i.id}' , 'SP.removeItem' {if $i.type == 'audioclip'} @@ -32,4 +31,4 @@ onClick="hidealttextnow(); return contextmenu('{$i.id}' , 'PL.activate', 'PL.create', 'delete' {/if} {/if} -)" +)" \ No newline at end of file diff --git a/livesupport/modules/htmlUI/var/templates/scratchpad/main.tpl b/livesupport/modules/htmlUI/var/templates/scratchpad/main.tpl index 375320ed4..af969c692 100755 --- a/livesupport/modules/htmlUI/var/templates/scratchpad/main.tpl +++ b/livesupport/modules/htmlUI/var/templates/scratchpad/main.tpl @@ -14,7 +14,7 @@ ##Title## ##Duration## - ##Type## + ##Type## @@ -41,8 +41,10 @@ {$i.title|truncate:12:'...':true} {/if} {* on some reason object call doesn´t like usage of array *} {assign var="_duration" value=$i.duration} - {niceTime in=$_duration} - {$i.type|capitalize} + {niceTime in=$_duration} + + {$i.type|capitalize} + {/foreach} @@ -66,8 +68,8 @@ ##Clear## @@ -76,4 +78,5 @@ -{assign var="_PL_activeId" value=NULL} \ No newline at end of file +{assign var="_PL_activeId" value=null} +{assign var="_duration" value=null} \ No newline at end of file diff --git a/livesupport/modules/htmlUI/var/templates/script/collector.js.tpl b/livesupport/modules/htmlUI/var/templates/script/collector.js.tpl index 5136d8bca..0f422e6de 100755 --- a/livesupport/modules/htmlUI/var/templates/script/collector.js.tpl +++ b/livesupport/modules/htmlUI/var/templates/script/collector.js.tpl @@ -3,15 +3,19 @@ function collector_submit(formname, action) { - var href = '{/literal}{$UI_HANDLER}{literal}?act='+action; + var href = ''; var n; for (n=0; n < (document.forms[formname].elements.length); n++) { - if (document.forms[formname].elements[n].checked && document.forms[formname].elements[n].name!='all') { + if (document.forms[formname].elements[n].checked && document.forms[formname].elements[n].name != 'all') { href = href + '&id[]=' + document.forms[formname].elements[n].name; } } - hpopup(href); + + if (href == '') + return false; + + hpopup({/literal}'{$UI_HANDLER}{literal}?act=' + action + href); } function collector_switchAll(formname) diff --git a/livesupport/modules/htmlUI/var/templates/script/contextmenu.js.tpl b/livesupport/modules/htmlUI/var/templates/script/contextmenu.js.tpl index af7091f5d..bbd9727af 100755 --- a/livesupport/modules/htmlUI/var/templates/script/contextmenu.js.tpl +++ b/livesupport/modules/htmlUI/var/templates/script/contextmenu.js.tpl @@ -109,8 +109,8 @@ contextmenuHtml = contextmenuHtml + "
  •  ##Manage group members## 
  • "; break; - case "SUBJECTS.addSubj2Group": - contextmenuHtml = contextmenuHtml + "
  •  ##Add to group## 
  • "; + case "SUBJECTS.addSubj2Gr": + contextmenuHtml = contextmenuHtml + "
  •  ##Add to group## 
  • "; break; case "SUBJECTS.removeSubjFromGr": diff --git a/livesupport/modules/htmlUI/var/templates/subjects/manageGroupMember.tpl b/livesupport/modules/htmlUI/var/templates/subjects/manageGroupMember.tpl index 6e6717ba6..17e53c0bc 100755 --- a/livesupport/modules/htmlUI/var/templates/subjects/manageGroupMember.tpl +++ b/livesupport/modules/htmlUI/var/templates/subjects/manageGroupMember.tpl @@ -14,8 +14,8 @@
    - ##Name## - ##Type## + ##Login## + ##Type## {assign var="_member" value=$SUBJECTS->getGroupMember($_REQUEST.id)} @@ -25,7 +25,7 @@ onClick="return contextmenu('login={urlencode str=$i.login}&gname={urlencode str=$_gname}', 'SUBJECTS.removeSubjFromGr')"> {$i.login} - {$i.type|capitalize} + {$i.type|capitalize} {/foreach} {else} @@ -35,11 +35,13 @@ + +

    ##Add Members##

    @@ -50,7 +52,7 @@ - ##Name## + ##Login## ##Type## @@ -62,8 +64,8 @@ - {$i.login} - {$i.type|capitalize} + {$i.login} + {$i.type|capitalize} {/if} @@ -76,7 +78,7 @@
    diff --git a/livesupport/modules/htmlUI/var/templates/subjects/overview.tpl b/livesupport/modules/htmlUI/var/templates/subjects/overview.tpl index 85fee21f8..342f902f5 100755 --- a/livesupport/modules/htmlUI/var/templates/subjects/overview.tpl +++ b/livesupport/modules/htmlUI/var/templates/subjects/overview.tpl @@ -5,24 +5,25 @@ - - - + + + {foreach from=$SUBJECTS->getSubjectsWCnt() item=i} + {if $i.type|lower == 'g'}{assign var="_type" value="group"}{else}{assign var="_type" value="user"}{/if} - - + {/foreach} @@ -37,3 +38,5 @@ + +{assign var="_type" value=null} diff --git a/livesupport/modules/htmlUI/var/ui_scheduler.class.php b/livesupport/modules/htmlUI/var/ui_scheduler.class.php index 40ccc0c78..7781d41b1 100755 --- a/livesupport/modules/htmlUI/var/ui_scheduler.class.php +++ b/livesupport/modules/htmlUI/var/ui_scheduler.class.php @@ -101,26 +101,42 @@ class uiScheduler extends uiCalendar $week = $this->getWeekEntrys(); ## search for next entry - 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; + 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 - 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)); - break; + 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)); + break; + } } + } else { + ## start at midnight + $this->schedulePrev['hour'] = 0; + $this->schedulePrev['minute'] = 0; + $this->schedulePrev['second'] = 0; } + #print_r($this->schedulePrev); #print_r($this->scheduleNext); } + function getWeekEntrys() { ## build array within all entrys of current week ## diff --git a/livesupport/modules/htmlUI/var/ui_subjects.class.php b/livesupport/modules/htmlUI/var/ui_subjects.class.php index fb0e880cd..83b403b54 100755 --- a/livesupport/modules/htmlUI/var/ui_subjects.class.php +++ b/livesupport/modules/htmlUI/var/ui_subjects.class.php @@ -43,29 +43,29 @@ class uiSubjects * * @param formdata array('login', 'pass') */ - function addSubj(&$formdata) + function addSubj(&$request) { include dirname(__FILE__). '/formmask/subjects.php'; $this->setRedir(); - if ($this->Base->_validateForm($formdata, $mask[$formdata['passwd'] ? 'addUser' : 'addGroup']) !== TRUE) { + if ($this->Base->_validateForm($request, $mask[$request['passwd'] ? 'addUser' : 'addGroup']) !== TRUE) { return FALSE; } if ($this->Base->gb->checkPerm($this->Base->userid, 'subjects') !== TRUE) { $this->Base->_retMsg('Access denied.'); return FALSE; } - if ($this->Base->gb->getSubjId($formdata['login'])) { - $this->Base->_retMsg('User or group "$1" already exists.', $formdata['login']); + if ($this->Base->gb->getSubjId($request['login'])) { + $this->Base->_retMsg('User or group "$1" already exists.', $request['login']); $this->Base->redirUrl = $_SERVER['HTTP_REFERER']; return FALSE; } - if (PEAR::isError($res = $this->Base->gb->addSubj($formdata['login'], ($formdata['passwd']==='' ? NULL : $formdata['passwd'])))) { + if (PEAR::isError($res = $this->Base->gb->addSubj($request['login'], ($request['passwd']==='' ? NULL : $request['passwd'])))) { $this->Base->_retMsg($res->getMessage()); return FALSE; } - if (UI_VERBOSE) $this->Base->_retMsg('Subject $1 added.', $formdata['login']); + if (UI_VERBOSE) $this->Base->_retMsg('Subject $1 added.', $request['login']); return TRUE; } @@ -77,7 +77,7 @@ class uiSubjects * * @param login string, login name of removed user */ - function removeSubj($request) + function removeSubj(&$request) { $this->setReload(); @@ -127,7 +127,7 @@ class uiSubjects * @param pass string, new password * @param pass2 string, retype of new password */ - function chgPasswd($request) + function chgPasswd(&$request) { $this->setRedir(); @@ -204,7 +204,6 @@ class uiSubjects } - /** * addSubj2Group * @@ -215,9 +214,23 @@ class uiSubjects * @param gname string * @param reid string, local id of managed group, just needed for redirect */ - function addSubj2Group(&$request) + function addSubj2Gr(&$request) { - $this->Base->redirUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close'; + $this->setReload(); + + if (!$request['login'] && !$request['id']) { + $this->Base->_retMsg('Nothing selected.'); + return FALSE; + } + + ## loop for multiple action + if (is_array($request['id'])) { + foreach ($request['id'] as $val) { + $req = array('login' => $this->Base->gb->getSubjName($val), 'gname' => $request['gname']); + $this->addSubj2Gr($req); + } + return TRUE; + } if ($this->Base->gb->checkPerm($this->Base->userid, 'subjects') !== TRUE){ $this->Base->_retMsg('Access denied.'); @@ -243,6 +256,21 @@ class uiSubjects function removeSubjFromGr(&$request) { $this->setReload(); + + if (!$request['login'] && !$request['id']) { + $this->Base->_retMsg('Nothing selected.'); + return FALSE; + } + + ## loop for multiple action + if (is_array($request['id'])) { + foreach ($request['id'] as $val) { + $req = array('login' => $this->Base->gb->getSubjName($val), 'gname' => $request['gname']); + $this->removeSubjFromGr($req); + } + return TRUE; + } + if ($this->Base->gb->checkPerm($this->Base->userid, 'subjects') !== TRUE){ $this->Base->_retMsg('Access denied.'); return FALSE;
    ##Name####Members####Type####Login####Members####Type##
    {$i.login} + {if $i.type|lower == 'g'} {$i.cnt} {else} - {/if} {$i.type|capitalize}{$_type|capitalize}