Hinweis auf doc/umstellung_eur.txt Beim Mandanten anlegen.
[kivitendo-erp.git] / xslt / xulmenu.xsl
index 3a7df20..a5c109c 100644 (file)
@@ -1,24 +1,50 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-    xmlns:html="http://www.w3.org/1999/xhtml" 
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:html="http://www.w3.org/1999/xhtml"
     xmlns:svg="http://www.w3.org/2000/svg"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
+<xsl:output media-type="application/vnd.mozilla.xul+xml"/>
 <xsl:template match="/">
-  <xsl:apply-templates/>
+  <xsl:choose>
+    <xsl:when test="system-property('xsl:vendor')='Transformiix'">
+
+      <xsl:apply-templates/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="html"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="doc" mode="html">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+      <meta http-equiv="refresh" content="5;url=menu.pl?action=display"/>
+    </head>
+    <body style="background-color: #eee; color: #333;">
+     <div style="margin-top: 2em; margin-left: auto; margin-right: auto; border: solid 0.1em #f88; width: 30em; background-color:#fff; font-size: 0.8em;font-family: Verdana, Arial, Helvetica; padding: 2em;">
+      <h2>XUL-Men&#252; ist aktiviert</h2>
+      <h3>Nur der Firefox-Browser mag das XUL-Men&#252;.</h3>
+      Wir schalten auf die kompatiblere <a href="menu.pl?action=display">HTML-Variante</a> um.
+      <h3>Only the Firefox-Browser likes the XUL-Menu.</h3>
+      We switch to the <a href="menu.pl?action=display">HTML-Version</a> now.      
+     </div>
+    </body>
+  </html>
 </xsl:template>
 
 <!-- main document structure -->
 <!-- ******************************************************************* -->
 <xsl:template match="doc">
-<xsl:processing-instruction
-name="xml-stylesheet">href="xslt/style1.css" type="text/css"</xsl:processing-instruction>
-  <window>
-    <html:title>
-      LX-Office Version <xsl:value-of select='/doc/version'/> 
-      - <xsl:value-of select='/doc/name'/> 
+<xsl:processing-instruction name="xml-stylesheet">href="xslt/style1.css" type="text/css"</xsl:processing-instruction>
+  <xsl:variable name="callback"><xsl:value-of select='/doc/callback'/></xsl:variable>
+  <xsl:variable name="title">
+      LX-Office Version <xsl:value-of select='/doc/version'/>
+      - <xsl:value-of select='/doc/name'/>
       - <xsl:value-of select='/doc/db'/>
-    </html:title>
+    </xsl:variable>
    <!-- <xsl:call-template name="style"/>-->
+  <window title="{$title}">
+  <html:title/>
     <xsl:call-template name="script"/>
     <toolbox>
       <xsl:apply-templates select="menu"/>
@@ -27,13 +53,13 @@ name="xml-stylesheet">href="xslt/style1.css" type="text/css"</xsl:processing-ins
     <hbox flex="1">
       <vbox id="sidebar" style="overflow:hidden">
 
-        <xsl:apply-templates mode="tree"/>
+        <xsl:apply-templates mode="tree" select="menu"/>
 
         <xsl:call-template name="ArtikelSuche"/>
         <!--<iframe src="xslt/trans.xml" flex="1" id="uhr"/>-->
       </vbox>
-      <splitter/>
-          <html:iframe id="main_window" src="{/*//item[@id='Programm--Version']/@link}" flex="1" style="border:0px"/>
+      <splitter state="open" collapse="before" resizeafter="farthest"><grippy/></splitter>
+      <browser id="main_window" type="content" src="{$callback}" flex="1" style="border:0px"/>
     </hbox>
   </window>
 </xsl:template>
@@ -42,13 +68,7 @@ name="xml-stylesheet">href="xslt/style1.css" type="text/css"</xsl:processing-ins
 
 <!-- the top menu -->
 <!-- ******************************************************************* -->
-<xsl:template match="menu">
-<!--<div style="background:grey">-->
-  <menubar id="sample-menubar">
-    <xsl:apply-templates/>
-  </menubar>
-<!--</div>-->
-</xsl:template>
+<xsl:template match="menu"><menubar id="sample-menubar" flex="1"><xsl:apply-templates/></menubar></xsl:template>
 <!-- ******************************************************************* -->
 
 
@@ -87,27 +107,27 @@ name="xml-stylesheet">href="xslt/style1.css" type="text/css"</xsl:processing-ins
 <!-- template for the top menu items
 *********************************************************************************  -->
 <xsl:template match="item">
 <xsl:choose>
-    <xsl:when test="item">
-        <menu id="{@name}_menu" label="{@name}" class="menu-iconic" image="image/icons/16x16/{@id}.png">
-          <menupopup id="file-popup">
-    <xsl:apply-templates/>
-          </menupopup>
-        </menu>
-    </xsl:when>
-    <xsl:otherwise>
-    <menuitem target="{@target}" link="{@link}" label="{@name}" oncommand="openLink(event)" class="menuitem-iconic" image="image/icons/16x16/{@id}.png" lxid="{@id}" onclick="openLinkNewTab(event)"/>
-    </xsl:otherwise>
 </xsl:choose>
+ <xsl:choose>
+  <xsl:when test="item">
+   <menu id="{@name}_menu" label="{@name}" class="menu-iconic" image="image/icons/16x16/{@id}.png">
+    <menupopup id="file-popup">
+     <xsl:apply-templates/>
+    </menupopup>
+   </menu>
+  </xsl:when>
+  <xsl:otherwise>
+   <menuitem target="{@target}" link="{@link}" label="{@name}" oncommand="openLink(event)" class="menuitem-iconic" image="image/icons/16x16/{@id}.png" lxid="{@id}" onclick="openLinkNewTab(event)"/>
+  </xsl:otherwise>
+ </xsl:choose>
 </xsl:template>
 <!-- ***************************************************************************  -->
 
 
-<!-- templates for the treeview 
+<!-- templates for the treeview
 **********************************************************************************   -->
 <xsl:template match="menu" mode="tree">
 <toolbar>
-<label value="Hauptmenue"/>
+<label value="Hauptmen&#252;"/>
 </toolbar>
   <tree flex="1" onselect="openTreeLink(event)" style="margin:0px;" hidecolumnpicker="true">
     <treecols>
@@ -143,7 +163,7 @@ name="xml-stylesheet">href="xslt/style1.css" type="text/css"</xsl:processing-ins
 <!-- ***************************************************************************  -->
 
 
-<!-- template für die uhr
+<!-- template fuer die uhr
 ********************************************************************************  -->
 <xsl:template name="uhr">
 
@@ -151,11 +171,11 @@ name="xml-stylesheet">href="xslt/style1.css" type="text/css"</xsl:processing-ins
 <!-- ***************************************************************************  -->
 
 
-<!-- scripts 
+<!-- scripts
 ********************************************************************************  -->
 <xsl:template name="script">
   <html:script type="text/ecmascript">
-  
+
   function openLink(event)
     {
     var path=event.target.getAttribute("link")
@@ -165,11 +185,11 @@ name="xml-stylesheet">href="xslt/style1.css" type="text/css"</xsl:processing-ins
       }
       else
       {
-        var bf=document.getElementsByTagName("iframe").item(0)
+        var bf=document.getElementById("main_window")
         bf.setAttribute("src",path)
       }
     }
-    
+
   function openLinkNewTab(event)
     {
     if(event.button!=1) return
@@ -181,17 +201,17 @@ name="xml-stylesheet">href="xslt/style1.css" type="text/css"</xsl:processing-ins
       else
       {
 window.open(path,"_new","")
+
       }
     }
-    
-    
+
+
   function openLinkNewWindow(event)
     {
       var path=event.target.getAttribute("link")
-      window.open(path,"_new","")
+      window.open(path,"_blank","")
     }
-  
+
   function openTreeLink(event)
     {
       var tree=event.target
@@ -199,47 +219,56 @@ window.open(path,"_new","")
       var item=tree.view.getItemAtIndex(selIndex)
       var link=item.getAttribute("link")
       if(link) document.getElementById("main_window").setAttribute("src",link)
-    }  
-  
+    }
+
   function updateClock()
     {
       var d= new Date()
-      var sec=d.getSeconds() 
-      var min=d.getMinutes() 
+      var sec=d.getSeconds()
+      var min=d.getMinutes()
       var std=(d.getHours() % 12 ) + min/60
       document.getElementById("std").setAttribute("transform","rotate("+std*30+",20,20)")
       document.getElementById("min").setAttribute("transform","rotate("+min*6+",20,20)")
       document.getElementById("sec").setAttribute("transform","rotate("+sec*6+",20,20)")
     }
-  
+
   function PrintW()
     {
       document.getElementById("main_window").contentWindow.print()
     }
-  
+
   function doSearch(){
   var t=document.getElementById("searchboxtext").value
   document.getElementById("desc").value=t
   document.getElementById("sb").click()
-  
+
   }
   function checkEnter(event){
   if(event.keyCode==13) doSearch()
   }
   //setInterval("updateClock()",1000)
-  
+  function MyGoBack(){
+document.getElementById("main_window").contentWindow.history.back()
+}
+  function MyGoForward(){
+document.getElementById("main_window").contentWindow.history.forward()
+}
   </html:script>
 </xsl:template>
 <!-- ***************************************************************************  -->
 
 <!-- special buttons ( logout , print, open new window )
+The tooltips, like tooltiptext="Neues Fenster", do not appear in my Firefox/Prism browsers. Why?
+https://developer.mozilla.org/en/XUL_Tutorial/Popup_Menus
+https://developer.mozilla.org/en/XUL/Attribute/tooltiptext
 ****************************************************************************  -->
 <xsl:template name="specialbuttons">
-  <toolbarbutton image="image/icons/24x24/Batch Printing.png" tooltiptext="hallo" oncommand="PrintW(event)"/>
-  <toolbarbutton image="image/icons/24x24/Neues Fenster.png" tooltip="Neues Fenster" link="menuXML.pl?action=display&amp;login={/doc/login}&amp;password={/doc/password}" target="_top" oncommand="openLinkNewWindow(event)"/>
-  <toolbarbutton label="Logout" link="{/*//item[@id='Programm--Logout']/@link}" target="_top" oncommand="openLink(event)">
-    <image src="image/icons/24x24/Programm--Logout.png" width="24" height="24" />
-  </toolbarbutton>
+    <toolbarbutton image="image/icons/24x24/Batch Printing.png" oncommand="PrintW(event)" tooltiptext="Drucken"/>
+    <toolbarbutton image="image/icons/24x24/Neues Fenster.png" tooltiptext="Neues Fenster" link="menuXML.pl?action=display" target="_top" oncommand="openLinkNewWindow(event)"/>
+    <toolbarbutton image="image/icons/24x24/Program--Logout.png" link="{/*//item[@id='Program--Logout']/@link}" target="_top" oncommand="openLink(event)" tooltiptext="Abmelden"/>
+  <toolbarseparator/>
+    <toolbarbutton image="image/icons/24x24/leftarrow_24.png" tooltiptext="Schritt zurück" oncommand="MyGoBack()"/>
+    <toolbarbutton image="image/icons/24x24/rightarrow_24.png" tooltiptext="Schritt vor" oncommand="MyGoForward()"/>
 </xsl:template>
 <!-- ***************************************************************************  -->
 
@@ -247,12 +276,10 @@ window.open(path,"_new","")
 <!-- searchbox
 ****************************************************************************  -->
 <xsl:template name="searchbox">
-<vbox style="padding-top:5px">
+<vbox style="padding-top:2px">
   <hbox>
-
-    <textbox height="22px" style="font-size:12px;margin-right:0px" width="200px" id="searchboxtext" onkeypress="checkEnter(event)"/>
-<toolbarbutton type="toolbar" width="20" height="20" style="padding:5px !important"
-image="xslt/images/16x16/CRM--Schnellsuche.png" flex="0" oncommand="doSearch()"/>
+    <textbox style="font-size:11px;margin-right:0px" width="200px" id="searchboxtext" onkeypress="checkEnter(event)"/> 
+    <toolbarbutton type="toolbar" width="20" height="20" style="padding:5px !important" image="image/icons/16x16/CRM--Schnellsuche.png" flex="0" oncommand="doSearch()"/>
 </hbox>
 
 </vbox>
@@ -269,10 +296,10 @@ image="xslt/images/16x16/CRM--Schnellsuche.png" flex="0" oncommand="doSearch()"/
   <input name="partsgroup" size="20"/>
   <input name="make" size="20"/>
   <input class="submit" type="submit" name="action" value="Weiter" id="sb"/>
-  <div style="display:none" >    
-  <input class="submit" type="submit" name="action" value="Top 100"/> 
-    <input type="hidden" name="serialnumber" size="20"/>  
-    <input type="hidden" name="ean" size="20"/>     
+  <div style="display:none" >
+  <input class="submit" type="submit" name="action" value="Top 100"/>
+    <input type="hidden" name="serialnumber" size="20"/>
+    <input type="hidden" name="ean" size="20"/>
     <input type="hidden" name="searchitems" value="part"/>
     <input type="hidden" name="title" value="Waren"/>
     <input type="hidden" name="revers" value="0"/>
@@ -290,15 +317,15 @@ image="xslt/images/16x16/CRM--Schnellsuche.png" flex="0" oncommand="doSearch()"/
     <input  name="onorder" class="checkbox" type="checkbox" value="1"/>
     <input  name="ordered" class="checkbox" type="checkbox" value="1"/>
     <input  name="rfq" class="checkbox" type="checkbox" value="1"/>Anfrage
-    <input  name="quoted" class="checkbox" type="checkbox" value="1"/>Angeboten  
+    <input  name="quoted" class="checkbox" type="checkbox" value="1"/>Angeboten
     <input type="hidden" name="transdatefrom" id="transdatefrom" size="11" title="dd.mm.yy"/>
-    <input  type="button" name="transdatefrom" id="trigger1" value="?"/> 
+    <input  type="button" name="transdatefrom" id="trigger1" value="?"/>
     <input name="transdateto" id="transdateto" size="11" title="dd.mm.yy"/>
     <input type="button" name="transdateto" id="trigger2" value="?"/>
     <input name="l_partnumber" class="checkbox" type="checkbox" value="Y" checked="true"/>Artikelnummer
     <input name="l_description" class="checkbox" type="checkbox" value="Y" checked="true"/>Artikelbeschreibung
     <input name="l_serialnumber" class="checkbox" type="checkbox" value="Y"/>Seriennummer
-    <input name="l_unit" class="checkbox" type="checkbox" value="Y" checked="true"/>Maßeinheit
+    <input name="l_unit" class="checkbox" type="checkbox" value="Y" checked="true"/>Maszeinheit
     <input name="l_listprice" class="checkbox" type="checkbox" value="Y"/>Listenpreis
     <input name="l_sellprice" class="checkbox" type="checkbox" value="Y" checked="true"/>Verkaufspreis
     <input name="l_lastcost" class="checkbox" type="checkbox" value="Y" checked="true"/>Einkaufspreis
@@ -315,8 +342,6 @@ image="xslt/images/16x16/CRM--Schnellsuche.png" flex="0" oncommand="doSearch()"/
     <input name="l_soldtotal" class="checkbox" type="checkbox" value="Y"/>Verkaufte Anzahl
     <input name="l_deliverydate" class="checkbox" type="checkbox" value="Y"/>Lieferdatum
     <input type="hidden" name="nextsub" value="generate_report"/>
-    <input type="hidden" name="login" value="{/doc/login}"/>
-    <input type="hidden" name="password" value="{/doc/password}"/>
     <input type="hidden" name="revers" value="0"/>
     <input type="hidden" name="lastsort" value=""/>
     <input type="hidden" name="sort" value="description"/>
@@ -325,4 +350,4 @@ image="xslt/images/16x16/CRM--Schnellsuche.png" flex="0" oncommand="doSearch()"/
   </form>
 </xsl:template>
 <!-- ***************************************************************************  -->
-</xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>