$form->{snumber} durch $form->{snumbers} ersetzt, da dies eigentlich so vorgesehen...
[kivitendo-erp.git] / bin / mozilla / menunew.pl
index 57b2e02..6b74be7 100644 (file)
@@ -52,7 +52,7 @@ sub display {
   &acc_menu;
 
   print qq|
-<iframe src="login.pl?login=$form->{login}&password=$form->{password}&action=company_logo&path=$form->{path}" width="100%" height="93%" name="main_window" style="position: absolute; border:0px;">
+<iframe id="win1" src="login.pl?login=$form->{login}&password=$form->{password}&action=company_logo&path=$form->{path}" width="100%" height="93%" name="main_window" style="position: absolute; border:0px;">
 <p>Ihr Browser kann leider keine eingebetteten Frames anzeigen.
 </p>
 </iframe>
@@ -65,7 +65,10 @@ sub display {
 
 sub clock_line {
 
-  $login = "["
+  $fensterlink="menunew.pl?login=$form->{login}&password=$form->{password}&path=$form->{path}&action=display";
+  $fenster = "["."<a href=\"$fensterlink\" target=\"_blank\">neues Fenster</a>]";
+
+  $login = "[Nutzer "
     . $form->{login}
     . " - <a href=\"login.pl?path="
     . $form->{"path"}
@@ -100,61 +103,22 @@ sub clock_line {
   print qq|
 <script type="text/javascript">
 <!--
-var clockid=new Array()
-var clockidoutside=new Array()
-var i_clock=-1
-var thistime= new Date()
-var hours= | . $Stunden . qq|;
-var minutes= | . $Minuten . qq|;
-var seconds= | . $Sekunden . qq|;
-if (eval(hours) <10) {hours="0"+hours}
-if (eval(minutes) < 10) {minutes="0"+minutes}
-if (seconds < 10) {seconds="0"+seconds}
-//var thistime = hours+":"+minutes+":"+seconds
-var thistime = hours+":"+minutes
-
-function writeclock() {
-       i_clock++
-       if (document.all \|\| document.getElementById \|\| document.layers) {
-               clockid[i_clock]="clock"+i_clock
-               document.write("<font family=arial size=2><span id='"+clockid[i_clock]+"' style='position:relative'>"+thistime+"</span></font>")
-       }
-}
-
+var h=$Stunden; var m=$Minuten; var s=$Sekunden;
 function clockon() {
-       thistime= new Date()
-       hours=thistime.getHours()
-       minutes=thistime.getMinutes()
-       seconds=thistime.getSeconds()
-       if (eval(hours) <10) {hours="0"+hours}
-       if (eval(minutes) < 10) {minutes="0"+minutes}
-       if (seconds < 10) {seconds="0"+seconds}
-       //thistime = hours+":"+minutes+":"+seconds
-       thistime = hours+":"+minutes
-
-       if (document.all) {
-               for (i=0;i<=clockid.length-1;i++) {
-                       var thisclock=eval(clockid[i])
-                       thisclock.innerHTML=thistime
-               }
-       }
-
-       if (document.getElementById) {
-               for (i=0;i<=clockid.length-1;i++) {
-                       document.getElementById(clockid[i]).innerHTML=thistime
-               }
-       }
-       var timer=setTimeout("clockon()",60000)
+  s=++s%60;if(s==0){m=++m%60;if(m==0)h=++h%24;}
+  document.getElementById('clock_id').innerHTML = (h<10?'0'+h:h)+":"+(m<10?'0'+m:m)+":"+(s<10?'0'+s:s);
+  var timer=setTimeout("clockon()", 1000);
 }
-//window.onload=clockon
+window.onload=clockon
 //-->
 </script>
 <table border="0" width="100%" background="image/bg_titel.gif" cellpadding="0" cellspacing="0">
-       <tr>
-               <td align="right" style="vertical-align:middle; color:white; font-family:verdana,arial,sans-serif; font-size: 12px;" nowrap>|
-    . $login . $datum . qq| <script>writeclock()</script>&nbsp;
-               </td>
-       </tr>
+  <tr>
+    <td style="color:white; font-family:verdana,arial,sans-serif; font-size: 12px;"> &nbsp; $fenster &nbsp; [<a href="JavaScript:top.main_window.print()">drucken</a>]</td>
+    <td align="right" style="vertical-align:middle; color:white; font-family:verdana,arial,sans-serif; font-size: 12px;" nowrap>
+      $login $datum <span id='clock_id' style='position:relative'></span>&nbsp;
+    </td>
+  </tr>
 </table>
 |;
 }
@@ -175,6 +139,8 @@ sub acc_menu {
 var isDOM = (document.getElementById ? true : false); 
 var isIE4 = ((document.all && !isDOM) ? true : false);
 var isNS4 = (document.layers ? true : false);
+//var KO = (navigator.appName=="Konqueror" \|\| navigator.appName=="Opera") ;
+var KO = ((navigator.userAgent.indexOf('Opera',0) != -1) \|\| (navigator.userAgent.indexOf('Konqueror',0) != -1));
 function getRef(id) {
        if (isDOM) return document.getElementById(id);
        if (isIE4) return document.all[id];
@@ -186,6 +152,7 @@ function getSty(id) {
 var popTimer = 0;
 var litNow = new Array();
 function popOver(menuNum, itemNum) {
+       if (KO) document.getElementById("win1").style.visibility = "hidden";
        clearTimeout(popTimer);
        hideAllBut(menuNum);
        litNow = getTree(menuNum, itemNum);
@@ -204,6 +171,7 @@ function popOver(menuNum, itemNum) {
 function popOut(menuNum, itemNum) {
        if ((menuNum == 0) && !menu[menuNum][itemNum].target)
                hideAllBut(0)
+               if (KO) document.getElementById("win1").style.visibility = "visible";
        else
                popTimer = setTimeout('hideAllBut(0)', 500);
 }
@@ -234,6 +202,7 @@ function hideAllBut(menuNum) {
                        menu[count][0].ref.visibility = 'hidden';
        changeCol(litNow, false);
 }
+
 function Menu(isVert, popInd, x, y, width, overCol, backCol, borderClass, textClass) {
        this.isVert = isVert;
        this.popInd = popInd
@@ -257,6 +226,11 @@ function Item(text, href, frame, length, spacing, target) {
        this.target = target;
        this.ref = null;
 }
+function go(link,frame) {
+       tmp=eval("top."+frame);
+       tmp.location=link;
+        //top.main_window.location=link;
+}
 function writeMenus() {
        if (!isDOM && !isIE4 && !isNS4) return;
        for (currMenu = 0; currMenu < menu.length; currMenu++) with (menu[currMenu][0]) {
@@ -274,9 +248,10 @@ function writeMenus() {
                                str += '<layer id="' + itemID + '" left="' + itemX + '" top="' + itemY + '" width="' +  w + '" height="' + h + '" visibility="inherit" ';
                                if (backCol) str += 'bgcolor="' + backCol + '" ';
                        }
-                       if (borderClass) str += 'class="' + borderClass + '" ';
+                       if (borderClass) str += 'class="' + borderClass + '" "';
                        str += 'onMouseOver="popOver(' + currMenu + ',' + currItem + ')" onMouseOut="popOut(' + currMenu + ',' + currItem + ')">';
-                       str += '<table width="' + (w - 8) + '" border="0" cellspacing="0" cellpadding="' + (!isNS4 && borderClass ? 3 : 0) + '"><tr><td align="left" height="' + (h - 7) + '">' + '<a class="' + textClass + '" href="' + href + '"' + (frame ? ' target="' + frame + '">' : '>') + text + '</a></td>';
+                       str += '<table width="' + (w - 8) + '" border="0" cellspacing="0" cellpadding="' + (!isNS4 && borderClass ? 3 : 0) + '">';
+                       str +='<tr><td style="cursor:pointer;" align="left" height="' + (h - 7) + '" onClick=\\'go("' + href + '","' + frame + '")\\'>' + text + '</a></td>';
                        if (target > 0) {
                                menu[target][0].parentMenu = currMenu;
                                menu[target][0].parentItem = currItem;
@@ -334,6 +309,7 @@ document.onclick = clickHandle;
 function clickHandle(evt) {
        if (isNS4) document.routeEvent(evt);
        hideAllBut(0);
+       if (KO) document.getElementById("win1").style.visibility = "visible";
 }
 function moveRoot() {
        with(menu[0][0].ref) left = ((parseInt(left) < 100) ? 100 : 5);
@@ -373,6 +349,7 @@ sub section_menu {
   $main = 0;
 
   #$pm=0;
+  $shlp=0;
   while (@menuorder) {
     $item  = shift @menuorder;
     $label = $item;
@@ -386,9 +363,14 @@ sub section_menu {
     if ($menu->{$item}{submenu}) {
       $menu->{$item}{$item} = !$form->{$item};
 
-      # Untermenü
-      if ($mlz{"s$ml"} > 1) { $z = $mlz{"s$ml"}++; $sm = 1; }
-      else { $z = $sm; $mlz{"s$ml"}++; }
+      # Untermen
+      if ($mlz{"s$ml"} > 1) { 
+               $z++; 
+               $sm = 1; 
+      } else { 
+               $z = $sm; 
+               $mlz{"s$ml"}++; 
+      }
       print
         qq|menu[$mlz{$ml}][$z] = new Item('$label', '#', '', defLength, 0, |
         . ++$pm
@@ -403,7 +385,7 @@ sub section_menu {
     } else {
       if ($menu->{$item}{module}) {
 
-        #Untermenüpunkte
+        #Untermenüpunkte
         $target = $menu->{$item}{target};
         $uri    = $menu->menuitemNew(\%myconfig, \%$form, $item, $level);
 
@@ -416,13 +398,14 @@ sub section_menu {
         $mm++;
         $pm++;
         %mlz   = ($ml, $pm, "s$ml", 1);
+        $shlp = $sm;
         $sm    = 1;
         $breit = 15 + length($label) * 6;
         print
           qq|menu[0][$mm] = new Item('  $label', '#', '', $breit, 10, $pm);    \n|;
         print qq|menu[$pm] = new Array();\n|;
         print
-          qq|menu[$pm][0] = new Menu(true, '>', 0, 22, 180, defOver, defBack, 'itemBorder', 'itemText');\n|;
+          qq|menu[$pm][0] = new Menu(true, '>', 0, 20, 180, defOver, defBack, 'itemBorder', 'itemText');\n|;
 
         #print qq|<tr><td class="bg" height="22" align="left" valign="middle" ><img src="image/$item.png" style="vertical-align:middle">&nbsp;<a href="menu.pl?path=bin/mozilla&action=acc_menu&level=$ml_&login=$form->{login}&password=$form->{password}" class="nohover">$label</a>&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>\n|;
         &section_menu($menu, $item);