#!/usr/bin/env python
# -*- coding: UTF-8 -*-



##################################################
## DEPENDENCIES
import sys
import os
import os.path
from os.path import getmtime, exists
import time
import types
import __builtin__
from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
from Cheetah.Template import Template
from Cheetah.DummyTransaction import DummyTransaction
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
from Cheetah.CacheRegion import CacheRegion
import Cheetah.Filters as Filters
import Cheetah.ErrorCatchers as ErrorCatchers
from nav.web.templates.MainTemplate import MainTemplate
from nav.web.templates.TreeSelectTemplate import TreeSelectTemplate
from nav.web.templates.SearchBoxTemplate import SearchBoxTemplate

##################################################
## MODULE CONSTANTS
try:
    True, False
except NameError:
    True, False = (1==1), (1==0)
VFFSL=valueFromFrameOrSearchList
VFSL=valueFromSearchList
VFN=valueForName
currentTime=time.time
__CHEETAH_version__ = '2.0.1'
__CHEETAH_versionTuple__ = (2, 0, 1, 'final', 0)
__CHEETAH_genTime__ = 1225031602.5006659
__CHEETAH_genTimestamp__ = 'Sun Oct 26 14:33:22 2008'
__CHEETAH_src__ = 'deviceManagementTemplate.tmpl'
__CHEETAH_srcLastModified__ = 'Fri Jan 19 14:16:23 2007'
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'

if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
    raise AssertionError(
      'This template was compiled with Cheetah version'
      ' %s. Templates compiled before version %s must be recompiled.'%(
         __CHEETAH_version__, RequiredCheetahVersion))

##################################################
## CLASSES

class deviceManagementTemplate(MainTemplate):

    ##################################################
    ## CHEETAH GENERATED METHODS


    def __init__(self, *args, **KWs):

        MainTemplate.__init__(self, *args, **KWs)
        if not self._CHEETAH__instanceInitialized:
            cheetahKWArgs = {}
            allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
            for k,v in KWs.items():
                if k in allowedKWs: cheetahKWArgs[k] = v
            self._initCheetahInstance(**cheetahKWArgs)
        

    def additionalCSS(self, **KWS):



        ## CHEETAH: generated from #def additionalCSS at line 33, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<link rel="stylesheet" type="text/css" href="/style/deviceManagement.css" />
''')
        _v = VFFSL(SL,"default_form_CSS",False)() # '$default_form_CSS()' on line 35, col 1
        if _v is not None: write(_filter(_v, rawExpr='$default_form_CSS()')) # from line 35, col 1.
        write('''
''')
        _v = VFFSL(SL,"default_tabs_CSS",False)() # '$default_tabs_CSS()' on line 36, col 1
        if _v is not None: write(_filter(_v, rawExpr='$default_tabs_CSS()')) # from line 36, col 1.
        write('''
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def content(self, **KWS):



        ## CHEETAH: generated from #def content at line 39, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<div style="border: 1px solid #666; margin:33px 0px; padding: 0px 19px;">
''')
        _v = VFFSL(SL,"makeMenu",False)(VFFSL(SL,"page.menu",True)) # '$makeMenu($page.menu)' on line 41, col 1
        if _v is not None: write(_filter(_v, rawExpr='$makeMenu($page.menu)')) # from line 41, col 1.
        write('''
''')
        if VFFSL(SL,"page.searchbox",True): # generated from line 42, col 1
            _v = VFFSL(SL,"displaySearchBox",False)(VFFSL(SL,"page.searchbox",True)) # '$displaySearchBox($page.searchbox)' on line 43, col 1
            if _v is not None: write(_filter(_v, rawExpr='$displaySearchBox($page.searchbox)')) # from line 43, col 1.
            write('''
''')
        write('''<h2>''')
        _v = VFFSL(SL,"page.title",True) # '$page.title' on line 45, col 5
        if _v is not None: write(_filter(_v, rawExpr='$page.title')) # from line 45, col 5.
        write('''</h2>
''')
        if VFFSL(SL,"page.submenu",True): # generated from line 46, col 1
            _v = VFFSL(SL,"makeSubMenu",False)(VFFSL(SL,"page.submenu",True)) # '$makeSubMenu($page.submenu)' on line 47, col 1
            if _v is not None: write(_filter(_v, rawExpr='$makeSubMenu($page.submenu)')) # from line 47, col 1.
            write('''
''')
        if VFFSL(SL,"page.name",True) == 'history': # generated from line 49, col 1
            _v = VFFSL(SL,"history",False)(VFFSL(SL,"page",True)) # '$history($page)' on line 50, col 1
            if _v is not None: write(_filter(_v, rawExpr='$history($page)')) # from line 50, col 1.
            write('''
''')
        elif VFFSL(SL,"page.name",True) == 'error': # generated from line 51, col 1
            _v = VFFSL(SL,"registererror",False)(VFFSL(SL,"page",True)) # '$registererror($page)' on line 52, col 1
            if _v is not None: write(_filter(_v, rawExpr='$registererror($page)')) # from line 52, col 1.
            write('''
''')
        elif VFFSL(SL,"page.name",True) == 'order': # generated from line 53, col 1
            _v = VFFSL(SL,"order",False)(VFFSL(SL,"page",True)) # '$order($page)' on line 54, col 1
            if _v is not None: write(_filter(_v, rawExpr='$order($page)')) # from line 54, col 1.
            write('''
''')
        elif VFFSL(SL,"page.name",True) == 'delete': # generated from line 55, col 1
            _v = VFFSL(SL,"delete",False)(VFFSL(SL,"page",True)) # '$delete($page)' on line 56, col 1
            if _v is not None: write(_filter(_v, rawExpr='$delete($page)')) # from line 56, col 1.
            write('''
''')
        elif VFFSL(SL,"page.name",True) == 'rma': # generated from line 57, col 1
            _v = VFFSL(SL,"rma",False)(VFFSL(SL,"page",True)) # '$rma($page)' on line 58, col 1
            if _v is not None: write(_filter(_v, rawExpr='$rma($page)')) # from line 58, col 1.
            write('''
''')
        elif VFFSL(SL,"page.name",True) == 'register': # generated from line 59, col 1
            _v = VFFSL(SL,"registerOne",False)(VFFSL(SL,"page",True)) # '$registerOne($page)' on line 60, col 1
            if _v is not None: write(_filter(_v, rawExpr='$registerOne($page)')) # from line 60, col 1.
            write('''
''')
        write('''</div>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def registerOne(self, page, **KWS):



        ## CHEETAH: generated from #def $registerOne($page) at line 69, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<p>
    ''')
        _v = VFFSL(SL,"page.description",True) # '$page.description' on line 71, col 5
        if _v is not None: write(_filter(_v, rawExpr='$page.description')) # from line 71, col 5.
        write('''
</p>
''')
        _v = VFFSL(SL,"showErrors",False)(VFFSL(SL,"page",True)) # '$showErrors($page)' on line 73, col 1
        if _v is not None: write(_filter(_v, rawExpr='$showErrors($page)')) # from line 73, col 1.
        write('''
<form action="''')
        _v = VFFSL(SL,"page.action",True) # '$page.action' on line 74, col 15
        if _v is not None: write(_filter(_v, rawExpr='$page.action')) # from line 74, col 15.
        write('''" method="post">
    <p>
        <table class="header-active" style="font-size: 13px;">
            <tr>
                <th align="left">Product</th>
                <th align="left">Serial</th>
            </tr>
            <tr>
                <td>''')
        _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['product']) # "$renderwidget($page.widgets['product'])" on line 82, col 21
        if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['product'])")) # from line 82, col 21.
        write('''</td>
                <td>''')
        _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['serial']) # "$renderwidget($page.widgets['serial'])" on line 83, col 21
        if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['serial'])")) # from line 83, col 21.
        write('''</td>
            </tr>
        </table>
    </p>
    <p>
        ''')
        _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['submit']) # "$renderwidget($page.widgets['submit'])" on line 88, col 9
        if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['submit'])")) # from line 88, col 9.
        write('''
    </p>
</form>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def rma(self, page, **KWS):



        ## CHEETAH: generated from #def rma($page) at line 93, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<p>''')
        _v = VFFSL(SL,"page.description",True) # '$page.description' on line 94, col 4
        if _v is not None: write(_filter(_v, rawExpr='$page.description')) # from line 94, col 4.
        write('''</p>
''')
        _v = VFFSL(SL,"showErrors",False)(VFFSL(SL,"page",True)) # '$showErrors($page)' on line 95, col 1
        if _v is not None: write(_filter(_v, rawExpr='$showErrors($page)')) # from line 95, col 1.
        write('''
''')
        if VFFSL(SL,"page.subname",True) == 'register': # generated from line 96, col 1
            write('''    <p>
''')
            qs = SearchBoxTemplate()
            write('''        ''')
            _v = VFN(VFFSL(SL,"qs",True),"searchbox",False)(VFFSL(SL,"page.rmasearchbox",True)) # '$qs.searchbox($page.rmasearchbox)' on line 99, col 9
            if _v is not None: write(_filter(_v, rawExpr='$qs.searchbox($page.rmasearchbox)')) # from line 99, col 9.
            write('''
    </p>
    <form action="''')
            _v = VFFSL(SL,"page.action",True) # '$page.action' on line 101, col 19
            if _v is not None: write(_filter(_v, rawExpr='$page.action')) # from line 101, col 19.
            write('''" method="post">
        ''')
            _v = VFFSL(SL,"hiddenInputs",False)(VFFSL(SL,"page",True)) # '$hiddenInputs($page)' on line 102, col 9
            if _v is not None: write(_filter(_v, rawExpr='$hiddenInputs($page)')) # from line 102, col 9.
            write('''
        <p>
            ''')
            _v = VFFSL(SL,"displayTreeSelect",False)(VFFSL(SL,"page.treeselect",True)) # '$displayTreeSelect($page.treeselect)' on line 104, col 13
            if _v is not None: write(_filter(_v, rawExpr='$displayTreeSelect($page.treeselect)')) # from line 104, col 13.
            write('''
        </p>
        <p>
            ''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['adddevice']) # "$renderwidget($page.widgets['adddevice'])" on line 107, col 13
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['adddevice'])")) # from line 107, col 13.
            write('''
        </p>
        <p>
            ''')
            _v = VFFSL(SL,"renderFormattedList",False)(VFFSL(SL,"page.rmalist",True)) # '$renderFormattedList($page.rmalist)' on line 110, col 13
            if _v is not None: write(_filter(_v, rawExpr='$renderFormattedList($page.rmalist)')) # from line 110, col 13.
            write('''    
        </p>
        <p>
            <table class="header-active" style="font-size: 13px;">
                <tr>
                    <th>''')
            _v = VFFSL(SL,"renderwhead",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['number']) # "$renderwhead($page.widgets['number'])" on line 115, col 25
            if _v is not None: write(_filter(_v, rawExpr="$renderwhead($page.widgets['number'])")) # from line 115, col 25.
            write('''</th>
                    <th>''')
            _v = VFFSL(SL,"renderwhead",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['retailer']) # "$renderwhead($page.widgets['retailer'])" on line 116, col 25
            if _v is not None: write(_filter(_v, rawExpr="$renderwhead($page.widgets['retailer'])")) # from line 116, col 25.
            write('''</th>
                    <th>''')
            _v = VFFSL(SL,"renderwhead",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['rmadate']) # "$renderwhead($page.widgets['rmadate'])" on line 117, col 25
            if _v is not None: write(_filter(_v, rawExpr="$renderwhead($page.widgets['rmadate'])")) # from line 117, col 25.
            write('''</th>
                </tr>
                <tr>
                    <td>''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['number']) # "$renderwidget($page.widgets['number'])" on line 120, col 25
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['number'])")) # from line 120, col 25.
            write('''</td>
                    <td>''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['retailer']) # "$renderwidget($page.widgets['retailer'])" on line 121, col 25
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['retailer'])")) # from line 121, col 25.
            write('''</td>
                    <td>''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['rmadate']) # "$renderwidget($page.widgets['rmadate'])" on line 122, col 25
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['rmadate'])")) # from line 122, col 25.
            write('''</td>
                </tr>
                <tr>
                    <th colspan="3">''')
            _v = VFFSL(SL,"renderwhead",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['comment']) # "$renderwhead($page.widgets['comment'])" on line 125, col 37
            if _v is not None: write(_filter(_v, rawExpr="$renderwhead($page.widgets['comment'])")) # from line 125, col 37.
            write('''</th>
                </tr>
                <tr>
                    <td colspan="3">''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['comment']) # "$renderwidget($page.widgets['comment'])" on line 128, col 37
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['comment'])")) # from line 128, col 37.
            write('''</td>
                </tr>
            </table>
        </p>
        <p>
            ''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['addrma']) # "$renderwidget($page.widgets['addrma'])" on line 133, col 13
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['addrma'])")) # from line 133, col 13.
            write('''
        </p>
    </form>
''')
        else: # generated from line 136, col 1
            write('''    <p>
       ''')
            _v = VFFSL(SL,"renderFormattedList",False)(VFFSL(SL,"page.rmaList",True)) # '$renderFormattedList($page.rmaList)' on line 138, col 8
            if _v is not None: write(_filter(_v, rawExpr='$renderFormattedList($page.rmaList)')) # from line 138, col 8.
            write('''
    </p>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def delete(self, page, **KWS):



        ## CHEETAH: generated from #def delete($page) at line 143, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<p>''')
        _v = VFFSL(SL,"page.description",True) # '$page.description' on line 144, col 4
        if _v is not None: write(_filter(_v, rawExpr='$page.description')) # from line 144, col 4.
        write('''</p>
''')
        _v = VFFSL(SL,"showErrors",False)(VFFSL(SL,"page",True)) # '$showErrors($page)' on line 145, col 1
        if _v is not None: write(_filter(_v, rawExpr='$showErrors($page)')) # from line 145, col 1.
        write('''
''')
        if VFFSL(SL,"page.subname",True) == 'confirmdelete': # generated from line 146, col 1
            write('''<form action="''')
            _v = VFFSL(SL,"page.action",True) # '$page.action' on line 147, col 15
            if _v is not None: write(_filter(_v, rawExpr='$page.action')) # from line 147, col 15.
            write('''" method="post">
    ''')
            _v = VFFSL(SL,"hiddenInputs",False)(VFFSL(SL,"page",True)) # '$hiddenInputs($page)' on line 148, col 5
            if _v is not None: write(_filter(_v, rawExpr='$hiddenInputs($page)')) # from line 148, col 5.
            write('''
    <p>
        ''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['moveto']) # "$renderwidget($page.widgets['moveto'])" on line 150, col 9
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['moveto'])")) # from line 150, col 9.
            write('''
    </p>
    <p>
        ''')
            _v = VFFSL(SL,"renderFormattedList",False)(VFFSL(SL,"page.moduleList",True)) # '$renderFormattedList($page.moduleList)' on line 153, col 9
            if _v is not None: write(_filter(_v, rawExpr='$renderFormattedList($page.moduleList)')) # from line 153, col 9.
            write('''
    </p>
    <p>
        ''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['confirm']) # "$renderwidget($page.widgets['confirm'])" on line 156, col 9
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['confirm'])")) # from line 156, col 9.
            write('''
    </p>
</form>
''')
        elif VFFSL(SL,"page.subname",True) == 'inventory' or VFFSL(SL,"page.subname",True) == 'inactive': # generated from line 159, col 1
            write('''<form action="''')
            _v = VFFSL(SL,"page.action",True) # '$page.action' on line 160, col 15
            if _v is not None: write(_filter(_v, rawExpr='$page.action')) # from line 160, col 15.
            write('''" method="post">
    <p>
        ''')
            _v = VFFSL(SL,"renderFormattedList",False)(VFFSL(SL,"page.moduleList",True)) # '$renderFormattedList($page.moduleList)' on line 162, col 9
            if _v is not None: write(_filter(_v, rawExpr='$renderFormattedList($page.moduleList)')) # from line 162, col 9.
            write('''
    </p>
    <p>
        ''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['move']) # "$renderwidget($page.widgets['move'])" on line 165, col 9
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['move'])")) # from line 165, col 9.
            write('''
    </p>
</form>
''')
        else: # generated from line 168, col 1
            write('''<form action="''')
            _v = VFFSL(SL,"page.action",True) # '$page.action' on line 169, col 15
            if _v is not None: write(_filter(_v, rawExpr='$page.action')) # from line 169, col 15.
            write('''" method="post">
    ''')
            _v = VFFSL(SL,"renderFormattedList",False)(VFFSL(SL,"page.moduleList",True)) # '$renderFormattedList($page.moduleList)' on line 170, col 5
            if _v is not None: write(_filter(_v, rawExpr='$renderFormattedList($page.moduleList)')) # from line 170, col 5.
            write('''
    <p>
        ''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['delete']) # "$renderwidget($page.widgets['delete'])" on line 172, col 9
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['delete'])")) # from line 172, col 9.
            write('''
    </p>
</form>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def order(self, page, **KWS):



        ## CHEETAH: generated from #def order(page) at line 178, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<p>''')
        _v = VFFSL(SL,"page.description",True) # '$page.description' on line 179, col 4
        if _v is not None: write(_filter(_v, rawExpr='$page.description')) # from line 179, col 4.
        write('''</p>
''')
        _v = VFFSL(SL,"showErrors",False)(VFFSL(SL,"page",True)) # '$showErrors($page)' on line 180, col 1
        if _v is not None: write(_filter(_v, rawExpr='$showErrors($page)')) # from line 180, col 1.
        write('''
''')
        if VFFSL(SL,"page.subname",True) == 'add' or VFFSL(SL,"page.subname",True) == 'edit': # generated from line 181, col 1
            write('''<form action="''')
            _v = VFFSL(SL,"page.action",True) # '$page.action' on line 182, col 15
            if _v is not None: write(_filter(_v, rawExpr='$page.action')) # from line 182, col 15.
            write('''" method="post">
''')
            _v = VFFSL(SL,"hiddenInputs",False)(VFFSL(SL,"page",True)) # '$hiddenInputs($page)' on line 183, col 1
            if _v is not None: write(_filter(_v, rawExpr='$hiddenInputs($page)')) # from line 183, col 1.
            write('''
<table class="header-active" style="font-size: 13px;">
    <tr>
        <td>''')
            _v = VFFSL(SL,"renderwhead",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['orderdate']) # "$renderwhead($page.widgets['orderdate'])" on line 186, col 13
            if _v is not None: write(_filter(_v, rawExpr="$renderwhead($page.widgets['orderdate'])")) # from line 186, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"renderwhead",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['product']) # "$renderwhead($page.widgets['product'])" on line 187, col 13
            if _v is not None: write(_filter(_v, rawExpr="$renderwhead($page.widgets['product'])")) # from line 187, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"renderwhead",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['amount']) # "$renderwhead($page.widgets['amount'])" on line 188, col 13
            if _v is not None: write(_filter(_v, rawExpr="$renderwhead($page.widgets['amount'])")) # from line 188, col 13.
            write('''</td>
    </tr>
    <tr>
        <td>''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['orderdate']) # "$renderwidget($page.widgets['orderdate'])" on line 191, col 13
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['orderdate'])")) # from line 191, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['product']) # "$renderwidget($page.widgets['product'])" on line 192, col 13
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['product'])")) # from line 192, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['amount']) # "$renderwidget($page.widgets['amount'])" on line 193, col 13
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['amount'])")) # from line 193, col 13.
            write('''</td>
    </tr>
    <tr>
        <td colspan="3">''')
            _v = VFFSL(SL,"renderwhead",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['org']) # "$renderwhead($page.widgets['org'])" on line 196, col 25
            if _v is not None: write(_filter(_v, rawExpr="$renderwhead($page.widgets['org'])")) # from line 196, col 25.
            write('''</td>
    </tr>
    <tr>
        <td colspan="3">''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['org']) # "$renderwidget($page.widgets['org'])" on line 199, col 25
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['org'])")) # from line 199, col 25.
            write('''</td>
    </tr>
    <tr>
        <td colspan="3">''')
            _v = VFFSL(SL,"renderwhead",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['comment']) # "$renderwhead($page.widgets['comment'])" on line 202, col 25
            if _v is not None: write(_filter(_v, rawExpr="$renderwhead($page.widgets['comment'])")) # from line 202, col 25.
            write('''
        ''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['comment']) # "$renderwidget($page.widgets['comment'])" on line 203, col 9
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['comment'])")) # from line 203, col 9.
            write('''</td>
    </tr>
    <tr>
        <td>''')
            _v = VFFSL(SL,"renderwhead",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['retailer']) # "$renderwhead($page.widgets['retailer'])" on line 206, col 13
            if _v is not None: write(_filter(_v, rawExpr="$renderwhead($page.widgets['retailer'])")) # from line 206, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"renderwhead",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['ordernumber']) # "$renderwhead($page.widgets['ordernumber'])" on line 207, col 13
            if _v is not None: write(_filter(_v, rawExpr="$renderwhead($page.widgets['ordernumber'])")) # from line 207, col 13.
            write('''</td>
        <td></td>
    </tr>
    <tr>
        <td>''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['retailer']) # "$renderwidget($page.widgets['retailer'])" on line 211, col 13
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['retailer'])")) # from line 211, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['ordernumber']) # "$renderwidget($page.widgets['ordernumber'])" on line 212, col 13
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['ordernumber'])")) # from line 212, col 13.
            write('''</td>
        <td></td>
    </tr>
</table>
<p>
''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['submit']) # "$renderwidget($page.widgets['submit'])" on line 217, col 1
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['submit'])")) # from line 217, col 1.
            write('''
''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['cancel']) # "$renderwidget($page.widgets['cancel'])" on line 218, col 1
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['cancel'])")) # from line 218, col 1.
            write('''
</p>
</form>
''')
        elif VFFSL(SL,"page.subname",True) == 'arrival': # generated from line 221, col 1
            if VFFSL(SL,"page.orderFound",True): # generated from line 222, col 1
                write('''<form action="''')
                _v = VFFSL(SL,"page.action",True) # '$page.action' on line 223, col 15
                if _v is not None: write(_filter(_v, rawExpr='$page.action')) # from line 223, col 15.
                write('''" method="post">
    <p><strong>''')
                _v = VFFSL(SL,"page.tableTitle",True) # '$page.tableTitle' on line 224, col 16
                if _v is not None: write(_filter(_v, rawExpr='$page.tableTitle')) # from line 224, col 16.
                write('''</strong></p>
    ''')
                _v = VFFSL(SL,"renderwhead",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['arrivaldate']) # "$renderwhead($page.widgets['arrivaldate'])" on line 225, col 5
                if _v is not None: write(_filter(_v, rawExpr="$renderwhead($page.widgets['arrivaldate'])")) # from line 225, col 5.
                write('''
    ''')
                _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['arrivaldate']) # "$renderwidget($page.widgets['arrivaldate'])" on line 226, col 5
                if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['arrivaldate'])")) # from line 226, col 5.
                write('''
    <p>
        <table class="header-active" cellpadding="5%" style="font-size: 13px;">
            <tr>
                <th>Product</th>
                <th>Serial</th>
                <th>State</th>
            </tr>
''')
                for i in range(0,VFFSL(SL,"page.numberOfInputs",True)): # generated from line 234, col 1
                    write('''            <tr>
                <td>''')
                    _v = VFFSL(SL,"page.productName",True) # '$page.productName' on line 236, col 21
                    if _v is not None: write(_filter(_v, rawExpr='$page.productName')) # from line 236, col 21.
                    write('''</td>
                <td>''')
                    _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['serial']) # "$renderwidget($page.widgets['serial'])" on line 237, col 21
                    if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['serial'])")) # from line 237, col 21.
                    write('''</td>
                <td>''')
                    _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['action']) # "$renderwidget($page.widgets['action'])" on line 238, col 21
                    if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['action'])")) # from line 238, col 21.
                    write('''</td>
            </tr>
''')
                write('''        </table>
    </p>
    <p>
        ''')
                _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['submit']) # "$renderwidget($page.widgets['submit'])" on line 244, col 9
                if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['submit'])")) # from line 244, col 9.
                write('''
        ''')
                _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['cancel']) # "$renderwidget($page.widgets['cancel'])" on line 245, col 9
                if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['cancel'])")) # from line 245, col 9.
                write('''
    </p>
</form>
''')
        elif VFFSL(SL,"page.subname",True) == 'delete': # generated from line 249, col 1
            write('''<p>
    ''')
            _v = VFFSL(SL,"orderDetails",False)(VFFSL(SL,"page.orderData",True)) # '$orderDetails($page.orderData)' on line 251, col 5
            if _v is not None: write(_filter(_v, rawExpr='$orderDetails($page.orderData)')) # from line 251, col 5.
            write('''
    <form action="''')
            _v = VFFSL(SL,"page.action",True) # '$page.action' on line 252, col 19
            if _v is not None: write(_filter(_v, rawExpr='$page.action')) # from line 252, col 19.
            write('''" method="post">
        ''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['confirm']) # "$renderwidget($page.widgets['confirm'])" on line 253, col 9
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['confirm'])")) # from line 253, col 9.
            write('''
        ''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['cancel']) # "$renderwidget($page.widgets['cancel'])" on line 254, col 9
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['cancel'])")) # from line 254, col 9.
            write('''
        ''')
            _v = VFFSL(SL,"hiddenInputs",False)(VFFSL(SL,"page",True)) # '$hiddenInputs($page)' on line 255, col 9
            if _v is not None: write(_filter(_v, rawExpr='$hiddenInputs($page)')) # from line 255, col 9.
            write('''
    </form>
</p>
''')
        elif VFFSL(SL,"page.subname",True) == 'details': # generated from line 258, col 1
            write('''<p>
    ''')
            _v = VFFSL(SL,"orderDetails",False)(VFFSL(SL,"page.orderData",True)) # '$orderDetails($page.orderData)' on line 260, col 5
            if _v is not None: write(_filter(_v, rawExpr='$orderDetails($page.orderData)')) # from line 260, col 5.
            write('''
</p>
''')
        elif VFFSL(SL,"page.subname",True) == 'history': # generated from line 262, col 1
            _v = VFFSL(SL,"renderFormattedList",False)(VFFSL(SL,"page.orderList",True)) # '$renderFormattedList($page.orderList)' on line 263, col 1
            if _v is not None: write(_filter(_v, rawExpr='$renderFormattedList($page.orderList)')) # from line 263, col 1.
            write('''
''')
        else: # generated from line 264, col 1
            #  Main order page
            _v = VFFSL(SL,"renderFormattedList",False)(VFFSL(SL,"page.orderList",True)) # '$renderFormattedList($page.orderList)' on line 266, col 1
            if _v is not None: write(_filter(_v, rawExpr='$renderFormattedList($page.orderList)')) # from line 266, col 1.
            write('''
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def history(self, page, **KWS):



        ## CHEETAH: generated from #def history(page) at line 270, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        if VFFSL(SL,"page.subname",True) == 'history': # generated from line 271, col 1
            write('''<p>
<table style="font-size: 13px;">
    <tr>
        <th align="left">From</th>
        <td>''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['startdate']) # "$renderwidget($page.widgets['startdate'])" on line 276, col 13
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['startdate'])")) # from line 276, col 13.
            write('''</td>
    </tr>
    <tr>
        <th align="left">To</th>
        <td>''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['enddate']) # "$renderwidget($page.widgets['enddate'])" on line 280, col 13
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['enddate'])")) # from line 280, col 13.
            write('''</td>
    </tr>
</table>
</p>
''')
            for box in VFFSL(SL,"page.boxList",True): # generated from line 284, col 1
                _v = VFFSL(SL,"renderFormattedList",False)(VFFSL(SL,"box",True)) # '$renderFormattedList($box)' on line 285, col 1
                if _v is not None: write(_filter(_v, rawExpr='$renderFormattedList($box)')) # from line 285, col 1.
                write('''
''')
        else: # generated from line 287, col 1
            write('''<p>''')
            _v = VFFSL(SL,"page.description",True) # '$page.description' on line 288, col 4
            if _v is not None: write(_filter(_v, rawExpr='$page.description')) # from line 288, col 4.
            write('''</p>
''')
            _v = VFFSL(SL,"showErrors",False)(VFFSL(SL,"page",True)) # '$showErrors($page)' on line 289, col 1
            if _v is not None: write(_filter(_v, rawExpr='$showErrors($page)')) # from line 289, col 1.
            write('''
<form action="''')
            _v = VFFSL(SL,"page.action",True) # '$page.action' on line 290, col 15
            if _v is not None: write(_filter(_v, rawExpr='$page.action')) # from line 290, col 15.
            write('''" method="post">
''')
            if VFFSL(SL,"page.treeselect",True): # generated from line 291, col 1
                write('''    ''')
                _v = VFFSL(SL,"displayTreeSelect",False)(VFFSL(SL,"page.treeselect",True)) # '$displayTreeSelect($page.treeselect)' on line 292, col 5
                if _v is not None: write(_filter(_v, rawExpr='$displayTreeSelect($page.treeselect)')) # from line 292, col 5.
                write('''
''')
                _v = VFFSL(SL,"submitButton",False)(VFFSL(SL,"page.submit",True)) # '$submitButton($page.submit)' on line 293, col 1
                if _v is not None: write(_filter(_v, rawExpr='$submitButton($page.submit)')) # from line 293, col 1.
                write('''
''')
            write('''</form>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def registererror(self, page, **KWS):



        ## CHEETAH: generated from #def registererror(page) at line 299, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<p>''')
        _v = VFFSL(SL,"page.description",True) # '$page.description' on line 300, col 4
        if _v is not None: write(_filter(_v, rawExpr='$page.description')) # from line 300, col 4.
        write('''</p>
''')
        _v = VFFSL(SL,"showErrors",False)(VFFSL(SL,"page",True)) # '$showErrors($page)' on line 301, col 1
        if _v is not None: write(_filter(_v, rawExpr='$showErrors($page)')) # from line 301, col 1.
        write('''
<form action="''')
        _v = VFFSL(SL,"page.action",True) # '$page.action' on line 302, col 15
        if _v is not None: write(_filter(_v, rawExpr='$page.action')) # from line 302, col 15.
        write('''" method="post">
''')
        if VFFSL(SL,"page.treeselect",True): # generated from line 303, col 1
            write('''    ''')
            _v = VFFSL(SL,"displayTreeSelect",False)(VFFSL(SL,"page.treeselect",True)) # '$displayTreeSelect($page.treeselect)' on line 304, col 5
            if _v is not None: write(_filter(_v, rawExpr='$displayTreeSelect($page.treeselect)')) # from line 304, col 5.
            write('''
''')
            #  Error description input
            write('''    <p>
        <table width="50%">
            <tr>
                <th>''')
            _v = VFFSL(SL,"renderwhead",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['comment']) # "$renderwhead($page.widgets['comment'])" on line 309, col 21
            if _v is not None: write(_filter(_v, rawExpr="$renderwhead($page.widgets['comment'])")) # from line 309, col 21.
            write('''</th>
            </tr>
            <tr>
                <td>''')
            _v = VFFSL(SL,"renderwidget",False)(VFN(VFFSL(SL,"page",True),"widgets",True)['comment']) # "$renderwidget($page.widgets['comment'])" on line 312, col 21
            if _v is not None: write(_filter(_v, rawExpr="$renderwidget($page.widgets['comment'])")) # from line 312, col 21.
            write('''</td>
            </tr>
        </table>
    </p>
''')
            _v = VFFSL(SL,"submitButton",False)(VFFSL(SL,"page.submit",True)) # '$submitButton($page.submit)' on line 316, col 1
            if _v is not None: write(_filter(_v, rawExpr='$submitButton($page.submit)')) # from line 316, col 1.
            write('''
''')
        write('''</form>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def makeSubMenuOld(self, menu, **KWS):



        ## CHEETAH: generated from #def $makeSubMenuOld($menu) at line 326, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<table style="background-image: url(\'/images/form/fill-active.gif\');border: 1px solid #666;font-size: 11;">
''')
        for item in VFFSL(SL,"menu",True): # generated from line 328, col 1
            write('''    <tr>
        <td><a href="''')
            _v = VFFSL(SL,"item",True)[2] # '$item[2]' on line 330, col 22
            if _v is not None: write(_filter(_v, rawExpr='$item[2]')) # from line 330, col 22.
            write('''" title="''')
            _v = VFFSL(SL,"item",True)[1] # '$item[1]' on line 330, col 39
            if _v is not None: write(_filter(_v, rawExpr='$item[1]')) # from line 330, col 39.
            write('''">''')
            _v = VFFSL(SL,"item",True)[0] # '$item[0]' on line 330, col 49
            if _v is not None: write(_filter(_v, rawExpr='$item[0]')) # from line 330, col 49.
            write('''</a></td>
    </tr>
''')
        write('''</table>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def makeSubMenu(self, menu, **KWS):



        ## CHEETAH: generated from #def makeSubMenu($menu) at line 336, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<br>
<font size="1">
[
''')
        first = True
        for item in VFFSL(SL,"menu",True): # generated from line 341, col 1
            if not VFFSL(SL,"first",True): # generated from line 342, col 1
                write('''    |
''')
            if VFFSL(SL,"item",True)[2]: # generated from line 345, col 1
                write('''<a title="''')
                _v = VFFSL(SL,"item",True)[1] # '$item[1]' on line 346, col 11
                if _v is not None: write(_filter(_v, rawExpr='$item[1]')) # from line 346, col 11.
                write('''" href="''')
                _v = VFFSL(SL,"item",True)[2] # '$item[2]' on line 346, col 27
                if _v is not None: write(_filter(_v, rawExpr='$item[2]')) # from line 346, col 27.
                write('''">''')
                _v = VFFSL(SL,"item",True)[0] # '$item[0]' on line 346, col 37
                if _v is not None: write(_filter(_v, rawExpr='$item[0]')) # from line 346, col 37.
                write('''</a>
''')
            else: # generated from line 347, col 1
                _v = VFFSL(SL,"item",True)[0] # '$item[0]' on line 348, col 1
                if _v is not None: write(_filter(_v, rawExpr='$item[0]')) # from line 348, col 1.
                write('''
''')
            first = False
        write(''']
</font>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def orderDetails(self, data, **KWS):



        ## CHEETAH: generated from #def $orderDetails($data) at line 356, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<strong>''')
        _v = VFFSL(SL,"page.orderDataHead",True) # '$page.orderDataHead' on line 357, col 9
        if _v is not None: write(_filter(_v, rawExpr='$page.orderDataHead')) # from line 357, col 9.
        write('''</strong>
<table style="font-size: 13px;">
    <tr>
        <td>''')
        _v = VFFSL(SL,"data",True)['ordernumber'][0] # "$data['ordernumber'][0]" on line 360, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['ordernumber'][0]")) # from line 360, col 13.
        write('''</td>
        <td>''')
        _v = VFFSL(SL,"data",True)['ordernumber'][1] # "$data['ordernumber'][1]" on line 361, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['ordernumber'][1]")) # from line 361, col 13.
        write('''</td>
    </tr>
    <tr>
        <td>''')
        _v = VFFSL(SL,"data",True)['product'][0] # "$data['product'][0]" on line 364, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['product'][0]")) # from line 364, col 13.
        write('''</td>
        <td>''')
        _v = VFFSL(SL,"data",True)['product'][1] # "$data['product'][1]" on line 365, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['product'][1]")) # from line 365, col 13.
        write('''</td>
    </tr>
    <tr>
        <td>''')
        _v = VFFSL(SL,"data",True)['amount'][0] # "$data['amount'][0]" on line 368, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['amount'][0]")) # from line 368, col 13.
        write('''</td>
        <td>''')
        _v = VFFSL(SL,"data",True)['amount'][1] # "$data['amount'][1]" on line 369, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['amount'][1]")) # from line 369, col 13.
        write('''</td>
    </tr>
    <tr>
        <td>''')
        _v = VFFSL(SL,"data",True)['arrived'][0] # "$data['arrived'][0]" on line 372, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['arrived'][0]")) # from line 372, col 13.
        write('''</td>
        <td>''')
        _v = VFFSL(SL,"data",True)['arrived'][1] # "$data['arrived'][1]" on line 373, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['arrived'][1]")) # from line 373, col 13.
        write('''</td>
    </tr>
    <tr>
        <td>''')
        _v = VFFSL(SL,"data",True)['ordered'][0] # "$data['ordered'][0]" on line 376, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['ordered'][0]")) # from line 376, col 13.
        write('''</td>
        <td>''')
        _v = VFFSL(SL,"data",True)['ordered'][1] # "$data['ordered'][1]" on line 377, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['ordered'][1]")) # from line 377, col 13.
        write('''</td>
    </tr>
    <tr>
        <td>''')
        _v = VFFSL(SL,"data",True)['registered'][0] # "$data['registered'][0]" on line 380, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['registered'][0]")) # from line 380, col 13.
        write('''</td>
        <td>''')
        _v = VFFSL(SL,"data",True)['registered'][1] # "$data['registered'][1]" on line 381, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['registered'][1]")) # from line 381, col 13.
        write('''</td>
    </tr>
''')
        if VFN(VFFSL(SL,"data",True),"has_key",False)('closed'): # generated from line 383, col 1
            write('''    <tr>
        <td>''')
            _v = VFFSL(SL,"data",True)['closed'][0] # "$data['closed'][0]" on line 385, col 13
            if _v is not None: write(_filter(_v, rawExpr="$data['closed'][0]")) # from line 385, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"data",True)['closed'][1] # "$data['closed'][1]" on line 386, col 13
            if _v is not None: write(_filter(_v, rawExpr="$data['closed'][1]")) # from line 386, col 13.
            write('''</td>
    </tr>
''')
        write('''    <tr>
        <td>''')
        _v = VFFSL(SL,"data",True)['retailer'][0] # "$data['retailer'][0]" on line 390, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['retailer'][0]")) # from line 390, col 13.
        write('''</td>
        <td>''')
        _v = VFFSL(SL,"data",True)['retailer'][1] # "$data['retailer'][1]" on line 391, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['retailer'][1]")) # from line 391, col 13.
        write('''</td>
    </tr>
    <tr>
        <td>''')
        _v = VFFSL(SL,"data",True)['username'][0] # "$data['username'][0]" on line 394, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['username'][0]")) # from line 394, col 13.
        write('''</td>
        <td>''')
        _v = VFFSL(SL,"data",True)['username'][1] # "$data['username'][1]" on line 395, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['username'][1]")) # from line 395, col 13.
        write('''</td>
    </tr>
    <tr>
        <td>''')
        _v = VFFSL(SL,"data",True)['org'][0] # "$data['org'][0]" on line 398, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['org'][0]")) # from line 398, col 13.
        write('''</td>
        <td>''')
        _v = VFFSL(SL,"data",True)['org'][1] # "$data['org'][1]" on line 399, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['org'][1]")) # from line 399, col 13.
        write('''</td>
    </tr>
    <tr>
        <td>''')
        _v = VFFSL(SL,"data",True)['comment'][0] # "$data['comment'][0]" on line 402, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['comment'][0]")) # from line 402, col 13.
        write('''</td>
        <td>''')
        _v = VFFSL(SL,"data",True)['comment'][1] # "$data['comment'][1]" on line 403, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['comment'][1]")) # from line 403, col 13.
        write('''</td>
    </tr>
    <tr>
        <td>''')
        _v = VFFSL(SL,"data",True)['updatedby'][0] # "$data['updatedby'][0]" on line 406, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['updatedby'][0]")) # from line 406, col 13.
        write('''</td>
        <td>''')
        _v = VFFSL(SL,"data",True)['updatedby'][1] # "$data['updatedby'][1]" on line 407, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['updatedby'][1]")) # from line 407, col 13.
        write('''</td>
    </tr>
    <tr>
        <td>''')
        _v = VFFSL(SL,"data",True)['lastupdated'][0] # "$data['lastupdated'][0]" on line 410, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['lastupdated'][0]")) # from line 410, col 13.
        write('''</td>
        <td>''')
        _v = VFFSL(SL,"data",True)['lastupdated'][1] # "$data['lastupdated'][1]" on line 411, col 13
        if _v is not None: write(_filter(_v, rawExpr="$data['lastupdated'][1]")) # from line 411, col 13.
        write('''</td>
    </tr>
</table>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def hiddenInputs(self, page, **KWS):



        ## CHEETAH: generated from #def hiddenInputs($page) at line 416, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        for input in VFFSL(SL,"page.hiddenInputs",True): # generated from line 417, col 1
            write('''<input type="hidden" name="''')
            _v = VFFSL(SL,"input",True)[0] # '$input[0]' on line 418, col 28
            if _v is not None: write(_filter(_v, rawExpr='$input[0]')) # from line 418, col 28.
            write('''" value="''')
            _v = VFFSL(SL,"input",True)[1] # '$input[1]' on line 418, col 46
            if _v is not None: write(_filter(_v, rawExpr='$input[1]')) # from line 418, col 46.
            write('''">
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def renderFormattedList(self, flist, **KWS):



        ## CHEETAH: generated from #def renderFormattedList($flist) at line 422, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<h3>''')
        _v = VFFSL(SL,"flist.title",True) # '$flist.title' on line 423, col 5
        if _v is not None: write(_filter(_v, rawExpr='$flist.title')) # from line 423, col 5.
        write('''</h3>
<table border="0" cellspacing="0" cellpadding="0" style="font-size: 13px;white-space: nowrap;">
    <tr class="header">
        <td class="startheader"></td>
''')
        for h,url in VFFSL(SL,"flist.headings",True): # generated from line 427, col 1
            write('''        <td valign="top">
''')
            if VFFSL(SL,"url",True): # generated from line 429, col 1
                write('''             <a href="''')
                _v = VFFSL(SL,"url",True) # '$url' on line 430, col 23
                if _v is not None: write(_filter(_v, rawExpr='$url')) # from line 430, col 23.
                write('''">''')
                _v = VFFSL(SL,"h",True) # '$h' on line 430, col 29
                if _v is not None: write(_filter(_v, rawExpr='$h')) # from line 430, col 29.
                write('''</a>&nbsp;
''')
            else: # generated from line 431, col 1
                write('''             ''')
                _v = VFFSL(SL,"h",True) # '$h' on line 432, col 14
                if _v is not None: write(_filter(_v, rawExpr='$h')) # from line 432, col 14.
                write('''&nbsp;
''')
            write('''        </td>
''')
        write('''        <td class="endheader"></td>
    </tr>
''')
        for row in VFFSL(SL,"flist.rows",True): # generated from line 438, col 1
            write('''    <tr>
        <td></td>
''')
            for col in VFFSL(SL,"row",True): # generated from line 441, col 1
                write('''        <td>
''')
                for part in VFFSL(SL,"col",True): # generated from line 443, col 1
                    write('''            ''')
                    _v = VFFSL(SL,"renderFormatString",False)(VFFSL(SL,"part",True)) # '$renderFormatString($part)' on line 444, col 13
                    if _v is not None: write(_filter(_v, rawExpr='$renderFormatString($part)')) # from line 444, col 13.
                    write('''&nbsp;&nbsp;
''')
                write('''        </td>
''')
            write('''        <td></td>
    </tr>
''')
        write('''</table>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def renderFormatString(self, fstring, **KWS):



        ## CHEETAH: generated from #def renderFormatString($fstring) at line 454, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        if type(VFFSL(SL,"fstring",True)) is str: # generated from line 455, col 1
            write('''    ''')
            _v = VFFSL(SL,"fstring",True) # '$fstring' on line 456, col 5
            if _v is not None: write(_filter(_v, rawExpr='$fstring')) # from line 456, col 5.
            write('''
''')
        elif type(VFFSL(SL,"fstring",True)) is list: # generated from line 457, col 1
            ftype = VFFSL(SL,"fstring",True)[0]
            if VFFSL(SL,"ftype",True) == 'url': # generated from line 459, col 1
                write('''    <a href="''')
                _v = VFFSL(SL,"fstring",True)[2] # '$fstring[2]' on line 460, col 14
                if _v is not None: write(_filter(_v, rawExpr='$fstring[2]')) # from line 460, col 14.
                write('''">''')
                _v = VFFSL(SL,"fstring",True)[1] # '$fstring[1]' on line 460, col 27
                if _v is not None: write(_filter(_v, rawExpr='$fstring[1]')) # from line 460, col 27.
                write('''</a>
''')
            elif VFFSL(SL,"ftype",True) == 'img': # generated from line 461, col 1
                write('''    <img src="''')
                _v = VFFSL(SL,"fstring",True)[1] # '$fstring[1]' on line 462, col 15
                if _v is not None: write(_filter(_v, rawExpr='$fstring[1]')) # from line 462, col 15.
                write('''">
''')
            elif VFFSL(SL,"ftype",True) == 'widget': # generated from line 463, col 1
                write('''    ''')
                _v = VFFSL(SL,"renderwidget",False)(VFFSL(SL,"fstring",True)[1]) # '$renderwidget($fstring[1])' on line 464, col 5
                if _v is not None: write(_filter(_v, rawExpr='$renderwidget($fstring[1])')) # from line 464, col 5.
                write('''
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def renderwhead(self, widget, **KWS):



        ## CHEETAH: generated from #def renderwhead($widget) at line 469, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        if VFFSL(SL,"widget.name",True): # generated from line 470, col 1
            write('''    ''')
            _v = VFFSL(SL,"widget.name",True) # '$widget.name' on line 471, col 5
            if _v is not None: write(_filter(_v, rawExpr='$widget.name')) # from line 471, col 5.
            write('''
''')
            if VFFSL(SL,"widget.required",True): # generated from line 472, col 1
                write('''    <span style="color: #ff0000">*</span>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def renderwidget(self, widget, **KWS):



        ## CHEETAH: generated from #def renderwidget($widget) at line 478, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        if VFFSL(SL,"widget.value",True): # generated from line 479, col 1
            value = VFFSL(SL,"widget.value",True)
        else: # generated from line 481, col 1
            value = ''
        if VFN(VFFSL(SL,"widget.options",True),"has_key",False)('style'): # generated from line 484, col 1
            style = VFN(VFFSL(SL,"widget",True),"options",True)['style']
        else: # generated from line 486, col 1
            style = ''
        if VFFSL(SL,"widget.type",True) == 'text': # generated from line 489, col 1
            if VFN(VFFSL(SL,"widget.options",True),"has_key",False)('size'): # generated from line 490, col 1
                size = VFN(VFFSL(SL,"widget",True),"options",True)['size']
            else: # generated from line 492, col 1
                size = '30'
            write('''    <input type="text" name="''')
            _v = VFFSL(SL,"widget.controlname",True) # '$widget.controlname' on line 495, col 30
            if _v is not None: write(_filter(_v, rawExpr='$widget.controlname')) # from line 495, col 30.
            write('''" value="''')
            _v = VFFSL(SL,"value",True) # '$value' on line 495, col 58
            if _v is not None: write(_filter(_v, rawExpr='$value')) # from line 495, col 58.
            write('''" style="''')
            _v = VFFSL(SL,"style",True) # '$style' on line 495, col 73
            if _v is not None: write(_filter(_v, rawExpr='$style')) # from line 495, col 73.
            write('''" size="''')
            _v = VFFSL(SL,"size",True) # '$size' on line 495, col 87
            if _v is not None: write(_filter(_v, rawExpr='$size')) # from line 495, col 87.
            write('''">
''')
        elif VFFSL(SL,"widget.type",True) == 'select': # generated from line 496, col 1
            write('''    <select name="''')
            _v = VFFSL(SL,"widget.controlname",True) # '$widget.controlname' on line 497, col 19
            if _v is not None: write(_filter(_v, rawExpr='$widget.controlname')) # from line 497, col 19.
            write('''" style="''')
            _v = VFFSL(SL,"style",True) # '$style' on line 497, col 47
            if _v is not None: write(_filter(_v, rawExpr='$style')) # from line 497, col 47.
            write('''">
''')
            for id,option,selected in VFN(VFFSL(SL,"widget",True),"options",True)['options']: # generated from line 498, col 1
                if VFFSL(SL,"value",True) == VFFSL(SL,"id",True): # generated from line 499, col 1
                    selected = True
                if VFFSL(SL,"selected",True): # generated from line 502, col 1
                    write('''        <option selected value="''')
                    _v = VFFSL(SL,"id",True) # '$id' on line 503, col 33
                    if _v is not None: write(_filter(_v, rawExpr='$id')) # from line 503, col 33.
                    write('''">''')
                    _v = VFFSL(SL,"option",True) # '$option' on line 503, col 38
                    if _v is not None: write(_filter(_v, rawExpr='$option')) # from line 503, col 38.
                    write('''</option>
''')
                else: # generated from line 504, col 1
                    write('''        <option value="''')
                    _v = VFFSL(SL,"id",True) # '$id' on line 505, col 24
                    if _v is not None: write(_filter(_v, rawExpr='$id')) # from line 505, col 24.
                    write('''">''')
                    _v = VFFSL(SL,"option",True) # '$option' on line 505, col 29
                    if _v is not None: write(_filter(_v, rawExpr='$option')) # from line 505, col 29.
                    write('''</option>
''')
            write('''    </select>
''')
        elif VFFSL(SL,"widget.type",True) == 'date': # generated from line 509, col 1
            i = 0
            for options in [VFN(VFFSL(SL,"widget",True),"options",True)['days'],VFN(VFFSL(SL,"widget",True),"options",True)['months'],VFN(VFFSL(SL,"widget",True),"options",True)['years']]: # generated from line 511, col 1
                write('''    <select name="''')
                _v = VFN(VFFSL(SL,"widget",True),"controlname",True)[i] # '$widget.controlname[i]' on line 512, col 19
                if _v is not None: write(_filter(_v, rawExpr='$widget.controlname[i]')) # from line 512, col 19.
                write('''" style="''')
                _v = VFFSL(SL,"style",True) # '$style' on line 512, col 50
                if _v is not None: write(_filter(_v, rawExpr='$style')) # from line 512, col 50.
                write('''">
''')
                i += 1
                for id,option,selected in VFFSL(SL,"options",True): # generated from line 514, col 1
                    if VFFSL(SL,"selected",True): # generated from line 515, col 1
                        write('''        <option selected value="''')
                        _v = VFFSL(SL,"id",True) # '$id' on line 516, col 33
                        if _v is not None: write(_filter(_v, rawExpr='$id')) # from line 516, col 33.
                        write('''">''')
                        _v = VFFSL(SL,"option",True) # '$option' on line 516, col 38
                        if _v is not None: write(_filter(_v, rawExpr='$option')) # from line 516, col 38.
                        write('''</option>
''')
                    else: # generated from line 517, col 1
                        write('''         <option value="''')
                        _v = VFFSL(SL,"id",True) # '$id' on line 518, col 25
                        if _v is not None: write(_filter(_v, rawExpr='$id')) # from line 518, col 25.
                        write('''">''')
                        _v = VFFSL(SL,"option",True) # '$option' on line 518, col 30
                        if _v is not None: write(_filter(_v, rawExpr='$option')) # from line 518, col 30.
                        write('''</option>
''')
                write('''    </select>
''')
        elif VFFSL(SL,"widget.type",True) == 'submit': # generated from line 523, col 1
            write('''
''')
            enabled = True
            if VFN(VFFSL(SL,"widget.options",True),"has_key",False)('enabled'): # generated from line 526, col 1
                if not VFN(VFFSL(SL,"widget",True),"options",True)['enabled']: # generated from line 527, col 1
                    enabled = False
            if VFFSL(SL,"enabled",True): # generated from line 531, col 1
                write('''    <input type="submit" name="''')
                _v = VFFSL(SL,"widget.controlname",True) # '$widget.controlname' on line 532, col 32
                if _v is not None: write(_filter(_v, rawExpr='$widget.controlname')) # from line 532, col 32.
                write('''" value="''')
                _v = VFFSL(SL,"widget.name",True) # '$widget.name' on line 532, col 60
                if _v is not None: write(_filter(_v, rawExpr='$widget.name')) # from line 532, col 60.
                write('''">
''')
            else: # generated from line 533, col 1
                write('''    <input type="submit" disbled name="''')
                _v = VFFSL(SL,"widget.controlname",True) # '$widget.controlname' on line 534, col 40
                if _v is not None: write(_filter(_v, rawExpr='$widget.controlname')) # from line 534, col 40.
                write('''" value="''')
                _v = VFFSL(SL,"widget.name",True) # '$widget.name' on line 534, col 68
                if _v is not None: write(_filter(_v, rawExpr='$widget.name')) # from line 534, col 68.
                write('''">
''')
        elif VFFSL(SL,"widget.type",True) == 'checkbox': # generated from line 536, col 1
            write('''    <input type="checkbox" name="''')
            _v = VFFSL(SL,"widget.controlname",True) # '$widget.controlname' on line 537, col 34
            if _v is not None: write(_filter(_v, rawExpr='$widget.controlname')) # from line 537, col 34.
            write('''" value="''')
            _v = VFFSL(SL,"widget.value",True) # '$widget.value' on line 537, col 62
            if _v is not None: write(_filter(_v, rawExpr='$widget.value')) # from line 537, col 62.
            write('''">
''')
        elif VFFSL(SL,"widget.type",True) == 'textarea': # generated from line 538, col 1
            options = VFFSL(SL,"widget.options",True)
            write('''    <textarea name="''')
            _v = VFFSL(SL,"widget.controlname",True) # '$widget.controlname' on line 540, col 21
            if _v is not None: write(_filter(_v, rawExpr='$widget.controlname')) # from line 540, col 21.
            write('''" rows="''')
            _v = VFFSL(SL,"options",True)['rows'] # "$options['rows']" on line 540, col 48
            if _v is not None: write(_filter(_v, rawExpr="$options['rows']")) # from line 540, col 48.
            write('''" cols="''')
            _v = VFFSL(SL,"options",True)['cols'] # "$options['cols']" on line 540, col 72
            if _v is not None: write(_filter(_v, rawExpr="$options['cols']")) # from line 540, col 72.
            write('''" style="''')
            _v = VFFSL(SL,"style",True) # '$style' on line 540, col 97
            if _v is not None: write(_filter(_v, rawExpr='$style')) # from line 540, col 97.
            write('''">''')
            _v = VFFSL(SL,"widget.value",True) # '$widget.value' on line 540, col 105
            if _v is not None: write(_filter(_v, rawExpr='$widget.value')) # from line 540, col 105.
            write('''</textarea>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def showErrors(self, page, **KWS):



        ## CHEETAH: generated from #def showErrors($page) at line 544, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        if VFFSL(SL,"page.errors",True): # generated from line 545, col 1
            for error in VFFSL(SL,"page.errors",True): # generated from line 546, col 1
                write('''    <span style="color: #ff0000;">''')
                _v = VFFSL(SL,"error",True) # '$error' on line 547, col 35
                if _v is not None: write(_filter(_v, rawExpr='$error')) # from line 547, col 35.
                write('''</span><br>
''')
        if VFFSL(SL,"page.messages",True): # generated from line 550, col 1
            for message in VFFSL(SL,"page.messages",True): # generated from line 551, col 1
                write('''    <span style="color: #00aa00;">''')
                _v = VFFSL(SL,"message",True) # '$message' on line 552, col 35
                if _v is not None: write(_filter(_v, rawExpr='$message')) # from line 552, col 35.
                write('''</span><br>
''')
        write('''
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def makeMenu(self, menu, **KWS):



        ## CHEETAH: generated from #def makeMenu($menu) at line 558, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<div id="tabs" style="margin: -24px -10px;">
<ul>
''')
        first = True
        for item,url,help in VFFSL(SL,"menu",True): # generated from line 562, col 1
            if VFFSL(SL,"url",True): # generated from line 563, col 1
                write('''<li>
<a title="''')
                _v = VFFSL(SL,"help",True) # '$help' on line 565, col 11
                if _v is not None: write(_filter(_v, rawExpr='$help')) # from line 565, col 11.
                write('''" href="''')
                _v = VFFSL(SL,"url",True) # '$url' on line 565, col 24
                if _v is not None: write(_filter(_v, rawExpr='$url')) # from line 565, col 24.
                write('''">''')
                _v = VFFSL(SL,"item",True) # '$item' on line 565, col 30
                if _v is not None: write(_filter(_v, rawExpr='$item')) # from line 565, col 30.
                write('''</a>
''')
            else: # generated from line 566, col 1
                write('''<li id="current">
<a>''')
                _v = VFFSL(SL,"item",True) # '$item' on line 568, col 4
                if _v is not None: write(_filter(_v, rawExpr='$item')) # from line 568, col 4.
                write('''</a>
''')
            first = False
            write('''</li>
''')
        write('''</ul>
</div>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def displaySearchBox(self, searchbox, **KWS):



        ## CHEETAH: generated from #def $displaySearchBox($searchbox) at line 578, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        qs = SearchBoxTemplate()
        write('''<div style="float: right;margin-right: 33px;margin-top:33px;">
''')
        _v = VFN(VFFSL(SL,"qs",True),"searchbox",False)(VFFSL(SL,"searchbox",True)) # '$qs.searchbox($searchbox)' on line 581, col 1
        if _v is not None: write(_filter(_v, rawExpr='$qs.searchbox($searchbox)')) # from line 581, col 1.
        write('''
</div>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def displayTreeSelect(self, treeselect, **KWS):



        ## CHEETAH: generated from #def $displayTreeSelect($treeselect) at line 585, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        ts = TreeSelectTemplate()
        _v = VFN(VFFSL(SL,"ts",True),"treeselect",False)(VFFSL(SL,"treeselect",True)) # '$ts.treeselect($treeselect)' on line 587, col 1
        if _v is not None: write(_filter(_v, rawExpr='$ts.treeselect($treeselect)')) # from line 587, col 1.
        write('''
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def submitButton(self, submit, **KWS):



        ## CHEETAH: generated from #def submitButton($submit) at line 590, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''    <p>
''')
        if VFFSL(SL,"submit",True)['enabled']: # generated from line 592, col 1
            write('''        <input type="submit" name="''')
            _v = VFFSL(SL,"submit",True)['control'] # "$submit['control']" on line 593, col 36
            if _v is not None: write(_filter(_v, rawExpr="$submit['control']")) # from line 593, col 36.
            write('''" value="''')
            _v = VFFSL(SL,"submit",True)['value'] # "$submit['value']" on line 593, col 63
            if _v is not None: write(_filter(_v, rawExpr="$submit['value']")) # from line 593, col 63.
            write('''">
''')
        else: # generated from line 594, col 1
            write('''        <input disabled type="submit" name="''')
            _v = VFFSL(SL,"submit",True)['control'] # "$submit['control']" on line 595, col 45
            if _v is not None: write(_filter(_v, rawExpr="$submit['control']")) # from line 595, col 45.
            write('''" value="''')
            _v = VFFSL(SL,"submit",True)['value'] # "$submit['value']" on line 595, col 72
            if _v is not None: write(_filter(_v, rawExpr="$submit['value']")) # from line 595, col 72.
            write('''">
''')
        write('''    </p>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def browse(self, **KWS):



        ## CHEETAH: generated from #def browse() at line 605, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        if not (VFFSL(SL,"args",True)['deviceHistList'] or VFFSL(SL,"args",True)['errorDevice'] or VFFSL(SL,"args",True)['rmaDevice']): # generated from line 606, col 1
            write('''<h2>''')
            _v = VFFSL(SL,"args",True)['title'] # "$args['title']" on line 607, col 5
            if _v is not None: write(_filter(_v, rawExpr="$args['title']")) # from line 607, col 5.
            write('''</h2>
''')
            qs = SearchBoxTemplate()
            ts = TreeSelectTemplate()
            write('''    ''')
            _v = VFN(VFFSL(SL,"qs",True),"searchbox",False)(VFFSL(SL,"args",True)['searchbox']) # "$qs.searchbox($args['searchbox'])" on line 610, col 5
            if _v is not None: write(_filter(_v, rawExpr="$qs.searchbox($args['searchbox'])")) # from line 610, col 5.
            write('''
<form action="''')
            _v = VFFSL(SL,"args",True)['action'] # "$args['action']" on line 611, col 15
            if _v is not None: write(_filter(_v, rawExpr="$args['action']")) # from line 611, col 15.
            write('''" method="post">
    ''')
            _v = VFN(VFFSL(SL,"ts",True),"treeselect",False)(VFFSL(SL,"args",True)['selectbox']) # "$ts.treeselect($args['selectbox'])" on line 612, col 5
            if _v is not None: write(_filter(_v, rawExpr="$ts.treeselect($args['selectbox'])")) # from line 612, col 5.
            write('''
    <table style="font-size: 13px;">
        <tr>
''')
            if VFFSL(SL,"args",True)['submit']['enabled']: # generated from line 615, col 1
                write('''            <td><input type="submit" name="''')
                _v = VFFSL(SL,"args",True)['submit']['control'] # "$args['submit']['control']" on line 616, col 44
                if _v is not None: write(_filter(_v, rawExpr="$args['submit']['control']")) # from line 616, col 44.
                write('''" value="''')
                _v = VFFSL(SL,"args",True)['submit']['value'] # "$args['submit']['value']" on line 616, col 79
                if _v is not None: write(_filter(_v, rawExpr="$args['submit']['value']")) # from line 616, col 79.
                write('''"></td>
''')
            else: # generated from line 617, col 1
                write('''            <td><input disabled type="submit" name="''')
                _v = VFFSL(SL,"args",True)['submit']['control'] # "$args['submit']['control']" on line 618, col 53
                if _v is not None: write(_filter(_v, rawExpr="$args['submit']['control']")) # from line 618, col 53.
                write('''" value="''')
                _v = VFFSL(SL,"args",True)['submit']['value'] # "$args['submit']['value']" on line 618, col 88
                if _v is not None: write(_filter(_v, rawExpr="$args['submit']['value']")) # from line 618, col 88.
                write('''"></td>
''')
            write('''        </tr>
    </table>
</form>
''')
        elif VFFSL(SL,"args",True)['deviceHistList']: # generated from line 623, col 1
            _v = VFFSL(SL,"deviceHistory",False)(VFFSL(SL,"args",True)['deviceHistList']) # "$deviceHistory($args['deviceHistList'])" on line 624, col 1
            if _v is not None: write(_filter(_v, rawExpr="$deviceHistory($args['deviceHistList'])")) # from line 624, col 1.
            write('''
''')
        elif VFFSL(SL,"args",True)['errorDevice']: # generated from line 625, col 1
            _v = VFFSL(SL,"registerError",False)(VFFSL(SL,"args",True)['errorDevice']) # "$registerError($args['errorDevice'])" on line 626, col 1
            if _v is not None: write(_filter(_v, rawExpr="$registerError($args['errorDevice'])")) # from line 626, col 1.
            write('''
''')
        elif VFFSL(SL,"args",True)['rmaDevice']: # generated from line 627, col 1
            _v = VFFSL(SL,"registerRma",False)(VFFSL(SL,"args",True)['rmaDevice']) # "$registerRma($args['rmaDevice'])" on line 628, col 1
            if _v is not None: write(_filter(_v, rawExpr="$registerRma($args['rmaDevice'])")) # from line 628, col 1.
            write('''
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def orderold(self, **KWS):



        ## CHEETAH: generated from #def orderold() at line 632, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<h3>Active orders <a href="''')
        _v = VFFSL(SL,"args",True)['update'] # "$args['update']" on line 633, col 28
        if _v is not None: write(_filter(_v, rawExpr="$args['update']")) # from line 633, col 28.
        write('''">(update)</a></h3>
<table>
    <tr>
        <th>Order number</th>
        <th>Product</th>
        <th>Amount</th>
        <th>Ordered</th>
        <th>Retailer</th>
        <th>Ordered by</th>
        <th>Organisation</th>
        <th>Arrival</th>
    </tr>
''')
        for order in VFFSL(SL,"args",True)['activeOrders']: # generated from line 645, col 1
            write('''    <tr>
        <td>''')
            _v = VFFSL(SL,"order.orderNumber",True) # '$order.orderNumber' on line 647, col 13
            if _v is not None: write(_filter(_v, rawExpr='$order.orderNumber')) # from line 647, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"order.product",True) # '$order.product' on line 648, col 13
            if _v is not None: write(_filter(_v, rawExpr='$order.product')) # from line 648, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"order.amount",True) # '$order.amount' on line 649, col 13
            if _v is not None: write(_filter(_v, rawExpr='$order.amount')) # from line 649, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"order.orderTime",True) # '$order.orderTime' on line 650, col 13
            if _v is not None: write(_filter(_v, rawExpr='$order.orderTime')) # from line 650, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"order.retailer",True) # '$order.retailer' on line 651, col 13
            if _v is not None: write(_filter(_v, rawExpr='$order.retailer')) # from line 651, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"order.orderedByPerson",True) # '$order.orderedByPerson' on line 652, col 13
            if _v is not None: write(_filter(_v, rawExpr='$order.orderedByPerson')) # from line 652, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"order.orderedByOrg",True) # '$order.orderedByOrg' on line 653, col 13
            if _v is not None: write(_filter(_v, rawExpr='$order.orderedByOrg')) # from line 653, col 13.
            write('''</td>
        <td><a href="register/''')
            _v = VFFSL(SL,"order.orderId",True) # '$order.orderId' on line 654, col 31
            if _v is not None: write(_filter(_v, rawExpr='$order.orderId')) # from line 654, col 31.
            write('''">Register arrival</a></td>
    </tr>
''')
        write('''    <tr>
        <td><a href="add">Add new order</a></td>
        <td colspan="6"></td>
    </tr>
</table>
<h3>Order history</h3>
<table>
    <tr>
        <th>Order number</th>
        <th>Product</th>
        <th>Amount</th>
        <th>Ordered</th>
        <th>Arrived</th>
        <th>Retailer</th>
        <th>Ordered by</th>
        <th>Organisation</th>
    </tr>
    <tr>
    </tr>
''')
        for order in VFFSL(SL,"args",True)['oldOrders']: # generated from line 676, col 1
            write('''    <tr>
        <td>''')
            _v = VFFSL(SL,"order.orderNumber",True) # '$order.orderNumber' on line 678, col 13
            if _v is not None: write(_filter(_v, rawExpr='$order.orderNumber')) # from line 678, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"order.product",True) # '$order.product' on line 679, col 13
            if _v is not None: write(_filter(_v, rawExpr='$order.product')) # from line 679, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"order.amount",True) # '$order.amount' on line 680, col 13
            if _v is not None: write(_filter(_v, rawExpr='$order.amount')) # from line 680, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"order.orderTime",True) # '$order.orderTime' on line 681, col 13
            if _v is not None: write(_filter(_v, rawExpr='$order.orderTime')) # from line 681, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"order.arrivedTime",True) # '$order.arrivedTime' on line 682, col 13
            if _v is not None: write(_filter(_v, rawExpr='$order.arrivedTime')) # from line 682, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"order.retailer",True) # '$order.retailer' on line 683, col 13
            if _v is not None: write(_filter(_v, rawExpr='$order.retailer')) # from line 683, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"order.orderedByPerson",True) # '$order.orderedByPerson' on line 684, col 13
            if _v is not None: write(_filter(_v, rawExpr='$order.orderedByPerson')) # from line 684, col 13.
            write('''</td>
        <td>''')
            _v = VFFSL(SL,"order.orderedByOrg",True) # '$order.orderedByOrg' on line 685, col 13
            if _v is not None: write(_filter(_v, rawExpr='$order.orderedByOrg')) # from line 685, col 13.
            write('''</td>
    </tr>
''')
        write(''' 
</table>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def addOrder(self, **KWS):



        ## CHEETAH: generated from #def addOrder() at line 692, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<h2>Add order</h2>
''')
        if VFFSL(SL,"args",True)['error']: # generated from line 694, col 1
            write('''<p style="color: #f00">''')
            _v = VFFSL(SL,"args",True)['error'] # "$args['error']" on line 695, col 24
            if _v is not None: write(_filter(_v, rawExpr="$args['error']")) # from line 695, col 24.
            write('''</p>
''')
        write('''<form action="''')
        _v = VFFSL(SL,"args",True)['action'] # "$args['action']" on line 697, col 15
        if _v is not None: write(_filter(_v, rawExpr="$args['action']")) # from line 697, col 15.
        write('''" method="post">
<table>
    <tr>
        <th>Product</th>
        <th>Amount</th>
        <th>Organisation</th>
        <th>Retailer</th>
        <th>Ordernr</th>
    </tr>
    <tr>
        <td>
            <select name="cn_prodid">
''')
        for id,descr in VFFSL(SL,"args",True)['productList']: # generated from line 709, col 1
            write('''                <option value="''')
            _v = VFFSL(SL,"id",True) # '$id' on line 710, col 32
            if _v is not None: write(_filter(_v, rawExpr='$id')) # from line 710, col 32.
            write('''">''')
            _v = VFFSL(SL,"descr",True) # '$descr' on line 710, col 37
            if _v is not None: write(_filter(_v, rawExpr='$descr')) # from line 710, col 37.
            write('''</option>
''')
        write('''            </select>
        </td>
        <td><input type="text" name="cn_number" size="3"></td>
        <td>
            <select name="cn_org">
''')
        for value,option in VFFSL(SL,"args",True)['orgList']: # generated from line 717, col 1
            write('''                <option value="''')
            _v = VFFSL(SL,"value",True) # '$value' on line 718, col 32
            if _v is not None: write(_filter(_v, rawExpr='$value')) # from line 718, col 32.
            write('''">''')
            _v = VFFSL(SL,"option",True) # '$option' on line 718, col 40
            if _v is not None: write(_filter(_v, rawExpr='$option')) # from line 718, col 40.
            write('''</option>
''')
        write('''            </select>
        </td>
        <td><input type="text" name="cn_retailer"></td>
        <td><input type="text" name="cn_ordernr"></td>
    </tr>
    <tr>
        <td colspan="5"><input type="submit" name="cn_submit" value="Add"></td>
    </tr>
</table>
</form>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def registerOrder(self, **KWS):



        ## CHEETAH: generated from #def registerOrder() at line 733, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<h2>Register arrival of order ''')
        _v = VFFSL(SL,"args",True)['orderid'] # "$args['orderid']" on line 734, col 31
        if _v is not None: write(_filter(_v, rawExpr="$args['orderid']")) # from line 734, col 31.
        write('''</h2>
''')
        if VFFSL(SL,"args",True)['error']: # generated from line 735, col 1
            write('''<p style="color: #f00">''')
            _v = VFFSL(SL,"args",True)['error'] # "$args['error']" on line 736, col 24
            if _v is not None: write(_filter(_v, rawExpr="$args['error']")) # from line 736, col 24.
            write('''</p>
''')
        write('''<form action="''')
        _v = VFFSL(SL,"args",True)['action'] # "$args['action']" on line 738, col 15
        if _v is not None: write(_filter(_v, rawExpr="$args['action']")) # from line 738, col 15.
        write('''" method="post">
    <table>
        <tr>
            <th>Product</th>
            <th>State</th>
            <th>Serial</th>
        </tr>
''')
        taborder = 1
        index = 0
        for event in VFFSL(SL,"args",True)['events']: # generated from line 747, col 1
            write('''        <tr>
            <td>''')
            _v = VFFSL(SL,"event.device.product.vendor.vendorid",True) # '$event.device.product.vendor.vendorid' on line 749, col 17
            if _v is not None: write(_filter(_v, rawExpr='$event.device.product.vendor.vendorid')) # from line 749, col 17.
            write(''' ''')
            _v = VFFSL(SL,"event.device.product.productno",True) # '$event.device.product.productno' on line 749, col 55
            if _v is not None: write(_filter(_v, rawExpr='$event.device.product.productno')) # from line 749, col 55.
            write('''</td>
''')
            if not VFFSL(SL,"event.device.serial",True): # generated from line 750, col 1
                write('''            <td>            
                <select name="cn_state">
''')
                for value,option in VFFSL(SL,"args",True)['statelist']: # generated from line 753, col 1
                    if VFFSL(SL,"value",True) == VFFSL(SL,"args",True)['states'][VFFSL(SL,"index",True)]: # generated from line 754, col 1
                        write('''                    <option value="''')
                        _v = VFFSL(SL,"value",True) # '$value' on line 755, col 36
                        if _v is not None: write(_filter(_v, rawExpr='$value')) # from line 755, col 36.
                        write('''" selected>''')
                        _v = VFFSL(SL,"option",True) # '$option' on line 755, col 53
                        if _v is not None: write(_filter(_v, rawExpr='$option')) # from line 755, col 53.
                        write('''</option>
''')
                    else: # generated from line 756, col 1
                        write('''                    <option value="''')
                        _v = VFFSL(SL,"value",True) # '$value' on line 757, col 36
                        if _v is not None: write(_filter(_v, rawExpr='$value')) # from line 757, col 36.
                        write('''">''')
                        _v = VFFSL(SL,"option",True) # '$option' on line 757, col 44
                        if _v is not None: write(_filter(_v, rawExpr='$option')) # from line 757, col 44.
                        write('''</option>                   
''')
                write('''                </select>
            </td>
            <td><input type="text" name="cn_serial" tabindex="''')
                _v = VFFSL(SL,"taborder",True) # '$taborder' on line 762, col 63
                if _v is not None: write(_filter(_v, rawExpr='$taborder')) # from line 762, col 63.
                write('''"></td>
''')
            else: # generated from line 763, col 1
                write('''            <td>Arrived</td>
            <td>''')
                _v = VFFSL(SL,"event.device.serial",True) # '$event.device.serial' on line 765, col 17
                if _v is not None: write(_filter(_v, rawExpr='$event.device.serial')) # from line 765, col 17.
                write('''</td>
''')
            write('''        </tr>
''')
            index = VFFSL(SL,"index",True) + 1
            taborder = VFFSL(SL,"taborder",True) + 1
        write('''        <tr>
            <td colspan="3"><input type="submit" name="cn_submit" value="Register"></td>
        </tr>
    </table>
</form>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def register(self, **KWS):



        ## CHEETAH: generated from #def register() at line 778, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<h2>Register new device</h2>
''')
        if VFFSL(SL,"args",True)['error']: # generated from line 780, col 1
            write('''<p style="color: #f00">''')
            _v = VFFSL(SL,"args",True)['error'] # "$args['error']" on line 781, col 24
            if _v is not None: write(_filter(_v, rawExpr="$args['error']")) # from line 781, col 24.
            write('''</p>
''')
        write('''<form action="''')
        _v = VFFSL(SL,"args",True)['action'] # "$args['action']" on line 783, col 15
        if _v is not None: write(_filter(_v, rawExpr="$args['action']")) # from line 783, col 15.
        write('''" method="post">
    <table>
        <tr>
            <th>Product</th>
            <th>Serial</th>
        </tr>
        <tr>
            <td><select name="cn_prodid">
''')
        for id,productno,descr in VFFSL(SL,"args",True)['productList']: # generated from line 791, col 1
            write('''                <option value="''')
            _v = VFFSL(SL,"id",True) # '$id' on line 792, col 32
            if _v is not None: write(_filter(_v, rawExpr='$id')) # from line 792, col 32.
            write('''">''')
            _v = VFFSL(SL,"productno",True) # '$productno' on line 792, col 37
            if _v is not None: write(_filter(_v, rawExpr='$productno')) # from line 792, col 37.
            write('''</option>
''')
        write('''            </select></td>
            <td><input type="text" name="cn_serial"></td>
        </tr>
        <tr>
            <td colspan="3">
                <input type="submit" name="cn_submit" value="Register">
            </td>
        </tr>
    </table>
</form>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def historyOld(self, **KWS):



        ## CHEETAH: generated from #def historyOld() at line 807, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        if VFFSL(SL,"args",True)['deviceHistList']: # generated from line 808, col 1
            _v = VFFSL(SL,"deviceHistory",False)(VFFSL(SL,"args",True)['deviceHistList']) # "$deviceHistory($args['deviceHistList'])" on line 809, col 1
            if _v is not None: write(_filter(_v, rawExpr="$deviceHistory($args['deviceHistList'])")) # from line 809, col 1.
            write('''
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def deviceHistory(self, deviceHistList, **KWS):



        ## CHEETAH: generated from #def deviceHistory($deviceHistList) at line 813, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        for device in VFFSL(SL,"deviceHistList",True): # generated from line 814, col 1
            if VFFSL(SL,"device.netboxId",True): # generated from line 815, col 1
                write('''<h3>Device history for box <a href="''')
                _v = VFFSL(SL,"device.url",True) # '$device.url' on line 816, col 37
                if _v is not None: write(_filter(_v, rawExpr='$device.url')) # from line 816, col 37.
                write('''">''')
                _v = VFFSL(SL,"device.sysname",True) # '$device.sysname' on line 816, col 50
                if _v is not None: write(_filter(_v, rawExpr='$device.sysname')) # from line 816, col 50.
                write('''</a></h3>
''')
            elif VFFSL(SL,"device.moduleId",True): # generated from line 817, col 1
                write('''<h3>Device history for module ''')
                _v = VFFSL(SL,"device.module",True) # '$device.module' on line 818, col 31
                if _v is not None: write(_filter(_v, rawExpr='$device.module')) # from line 818, col 31.
                write(''' in box <a href="''')
                _v = VFFSL(SL,"device.url",True) # '$device.url' on line 818, col 62
                if _v is not None: write(_filter(_v, rawExpr='$device.url')) # from line 818, col 62.
                write('''">''')
                _v = VFFSL(SL,"device.sysname",True) # '$device.sysname' on line 818, col 75
                if _v is not None: write(_filter(_v, rawExpr='$device.sysname')) # from line 818, col 75.
                write('''</a></h3>
''')
            else: # generated from line 819, col 1
                write('''<h3>Device history for device ''')
                _v = VFFSL(SL,"device.deviceId",True) # '$device.deviceId' on line 820, col 31
                if _v is not None: write(_filter(_v, rawExpr='$device.deviceId')) # from line 820, col 31.
                write('''</h3>
''')
            if VFFSL(SL,"device.error",True): # generated from line 822, col 1
                write('''<p style="color: #f00">''')
                _v = VFFSL(SL,"device.error",True) # '$device.error' on line 823, col 24
                if _v is not None: write(_filter(_v, rawExpr='$device.error')) # from line 823, col 24.
                write('''</p>
''')
            else: # generated from line 824, col 1
                write('''<table>
    <tr>
        <th>Event</th>
        <th>Time</th>
        <th>Description</th>
    </tr>
''')
                for sort_key,event in VFFSL(SL,"device.events",True): # generated from line 831, col 1
                    write('''    <tr>
        <td>''')
                    _v = VFFSL(SL,"event",True)['eventType'] # "$event['eventType']" on line 833, col 13
                    if _v is not None: write(_filter(_v, rawExpr="$event['eventType']")) # from line 833, col 13.
                    write('''</td>
        <td>''')
                    _v = VFFSL(SL,"event",True)['time'] # "$event['time']" on line 834, col 13
                    if _v is not None: write(_filter(_v, rawExpr="$event['time']")) # from line 834, col 13.
                    write('''</td>
        <td>''')
                    _v = VFFSL(SL,"event",True)['descr'] # "$event['descr']" on line 835, col 13
                    if _v is not None: write(_filter(_v, rawExpr="$event['descr']")) # from line 835, col 13.
                    write('''</td>
    </tr>
''')
                write('''</table>
''')
                if VFFSL(SL,"device.moduleevents",True): # generated from line 839, col 1
                    write('''<h3>Module history for <a href="''')
                    _v = VFFSL(SL,"device.url",True) # '$device.url' on line 840, col 33
                    if _v is not None: write(_filter(_v, rawExpr='$device.url')) # from line 840, col 33.
                    write('''">''')
                    _v = VFFSL(SL,"device.sysname",True) # '$device.sysname' on line 840, col 46
                    if _v is not None: write(_filter(_v, rawExpr='$device.sysname')) # from line 840, col 46.
                    write('''</a></h3>
<table>
    <tr>
        <th>Event</th>
        <th>Time</th>
        <th>Description</th>
    </tr>
''')
                    for sort_key,event in VFFSL(SL,"device.moduleevents",True): # generated from line 847, col 1
                        write('''    <tr>
        <td>''')
                        _v = VFFSL(SL,"event",True)['eventType'] # "$event['eventType']" on line 849, col 13
                        if _v is not None: write(_filter(_v, rawExpr="$event['eventType']")) # from line 849, col 13.
                        write('''</td>
        <td>''')
                        _v = VFFSL(SL,"event",True)['time'] # "$event['time']" on line 850, col 13
                        if _v is not None: write(_filter(_v, rawExpr="$event['time']")) # from line 850, col 13.
                        write('''</td>
        <td>''')
                        _v = VFFSL(SL,"event",True)['descr'] # "$event['descr']" on line 851, col 13
                        if _v is not None: write(_filter(_v, rawExpr="$event['descr']")) # from line 851, col 13.
                        write('''</td>
    </tr>
''')
                    write('''</table>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def registerError(self, device, **KWS):



        ## CHEETAH: generated from #def registerError($device) at line 860, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<h3>Register error situation</h3>
<form action="''')
        _v = VFFSL(SL,"args",True)['action'] # "$args['action']" on line 862, col 15
        if _v is not None: write(_filter(_v, rawExpr="$args['action']")) # from line 862, col 15.
        write('''" method="post">
    <table>
        <tr>
''')
        if VFFSL(SL,"device.netboxId",True): # generated from line 865, col 1
            write('''            <th>Register error situation for box ''')
            _v = VFFSL(SL,"device.sysname",True) # '$device.sysname' on line 866, col 50
            if _v is not None: write(_filter(_v, rawExpr='$device.sysname')) # from line 866, col 50.
            write('''</th>
''')
        elif VFFSL(SL,"device.moduleId",True): # generated from line 867, col 1
            write('''            <th>Register error situation for module ''')
            _v = VFFSL(SL,"device.module",True) # '$device.module' on line 868, col 53
            if _v is not None: write(_filter(_v, rawExpr='$device.module')) # from line 868, col 53.
            write(''' in netbox ''')
            _v = VFFSL(SL,"device.sysname",True) # '$device.sysname' on line 868, col 78
            if _v is not None: write(_filter(_v, rawExpr='$device.sysname')) # from line 868, col 78.
            write('''</th>
''')
        else: # generated from line 869, col 1
            write('''            <th>Register error situation for device ''')
            _v = VFFSL(SL,"device.deviceId",True) # '$device.deviceId' on line 870, col 53
            if _v is not None: write(_filter(_v, rawExpr='$device.deviceId')) # from line 870, col 53.
            write('''</th>
''')
        write('''        </tr>
        <tr>
            <td><input type="text" name="cn_error" size="60"></td>
        </tr>
        <tr>
            <td><input type="submit" name="cn_submit" value="Submit"></td>
        </tr>
    </table>
</form>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def showRma(self, **KWS):



        ## CHEETAH: generated from #def showRma() at line 884, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        if VFFSL(SL,"args",True)['rmaDevice']: # generated from line 885, col 1
            _v = VFFSL(SL,"registerRma",False)(VFFSL(SL,"args",True)['rmaDevice']) # "$registerRma($args['rmaDevice'])" on line 886, col 1
            if _v is not None: write(_filter(_v, rawExpr="$registerRma($args['rmaDevice'])")) # from line 886, col 1.
            write('''
''')
        else: # generated from line 887, col 1
            write('''<h3>Active RMA events <a href="''')
            _v = VFFSL(SL,"args",True)['update'] # "$args['update']" on line 888, col 32
            if _v is not None: write(_filter(_v, rawExpr="$args['update']")) # from line 888, col 32.
            write('''">(update)</a></h3>
''')
            if len(VFFSL(SL,"args",True)['rmaList']): # generated from line 889, col 1
                write('''<table>
    <tr>
        <th>Device</th>
        <th>Date</th>
        <th>Registered by</th>
        <th>Comment</th>
        <th></th>
        <th></th>
    </tr>
''')
                for device,date,username,comment,deviceid in VFFSL(SL,"args",True)['rmaList']: # generated from line 899, col 1
                    write('''    <tr>
        <td>''')
                    _v = VFFSL(SL,"device",True) # '$device' on line 901, col 13
                    if _v is not None: write(_filter(_v, rawExpr='$device')) # from line 901, col 13.
                    write('''</td>
        <td>''')
                    _v = VFFSL(SL,"date",True) # '$date' on line 902, col 13
                    if _v is not None: write(_filter(_v, rawExpr='$date')) # from line 902, col 13.
                    write('''</td>
        <td>''')
                    _v = VFFSL(SL,"username",True) # '$username' on line 903, col 13
                    if _v is not None: write(_filter(_v, rawExpr='$username')) # from line 903, col 13.
                    write('''</td>
        <td>''')
                    _v = VFFSL(SL,"comment",True) # '$comment' on line 904, col 13
                    if _v is not None: write(_filter(_v, rawExpr='$comment')) # from line 904, col 13.
                    write('''</td>
        <td><a href="''')
                    _v = VFFSL(SL,"args",True)['returned']['url'] # "$args['returned']['url']" on line 905, col 22
                    if _v is not None: write(_filter(_v, rawExpr="$args['returned']['url']")) # from line 905, col 22.
                    _v = VFFSL(SL,"deviceid",True) # '$deviceid' on line 905, col 46
                    if _v is not None: write(_filter(_v, rawExpr='$deviceid')) # from line 905, col 46.
                    write('''">''')
                    _v = VFFSL(SL,"args",True)['returned']['text'] # "$args['returned']['text']" on line 905, col 57
                    if _v is not None: write(_filter(_v, rawExpr="$args['returned']['text']")) # from line 905, col 57.
                    write('''</a></td>
        <td><a href="''')
                    _v = VFFSL(SL,"args",True)['newreturned']['url'] # "$args['newreturned']['url']" on line 906, col 22
                    if _v is not None: write(_filter(_v, rawExpr="$args['newreturned']['url']")) # from line 906, col 22.
                    _v = VFFSL(SL,"deviceid",True) # '$deviceid' on line 906, col 49
                    if _v is not None: write(_filter(_v, rawExpr='$deviceid')) # from line 906, col 49.
                    write('''">''')
                    _v = VFFSL(SL,"args",True)['newreturned']['text'] # "$args['newreturned']['text']" on line 906, col 60
                    if _v is not None: write(_filter(_v, rawExpr="$args['newreturned']['text']")) # from line 906, col 60.
                    write('''</a></td>
    </tr>
''')
                write('''</table>
''')
            write('''<p><a href="''')
            _v = VFFSL(SL,"args",True)['addrma']['url'] # "$args['addrma']['url']" on line 911, col 13
            if _v is not None: write(_filter(_v, rawExpr="$args['addrma']['url']")) # from line 911, col 13.
            write('''">''')
            _v = VFFSL(SL,"args",True)['addrma']['text'] # "$args['addrma']['text']" on line 911, col 37
            if _v is not None: write(_filter(_v, rawExpr="$args['addrma']['text']")) # from line 911, col 37.
            write('''</a></p>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def registerRma(self, device, **KWS):



        ## CHEETAH: generated from #def registerRma($device) at line 915, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<h3>Register RMA</h3>
''')
        if VFFSL(SL,"args",True)['error']: # generated from line 917, col 1
            write('''<p style="color: #f00">''')
            _v = VFFSL(SL,"args",True)['error'] # "$args['error']" on line 918, col 24
            if _v is not None: write(_filter(_v, rawExpr="$args['error']")) # from line 918, col 24.
            write('''</p>
''')
        write('''<form action="''')
        _v = VFFSL(SL,"args",True)['action'] # "$args['action']" on line 920, col 15
        if _v is not None: write(_filter(_v, rawExpr="$args['action']")) # from line 920, col 15.
        write('''" method="post">
    <table>
        <tr>
''')
        if VFFSL(SL,"device.moduleId",True): # generated from line 923, col 1
            write('''            <th>Module</th>
''')
        write('''            <th>Netbox</th>
            <th>RMA number</th>
            <th>Comment</th>
        </tr>
        <tr>
''')
        if VFFSL(SL,"device.moduleId",True): # generated from line 931, col 1
            write('''            <td>''')
            _v = VFFSL(SL,"device.module",True) # '$device.module' on line 932, col 17
            if _v is not None: write(_filter(_v, rawExpr='$device.module')) # from line 932, col 17.
            write('''</td>
''')
        write('''            <td>''')
        _v = VFFSL(SL,"device.sysname",True) # '$device.sysname' on line 934, col 17
        if _v is not None: write(_filter(_v, rawExpr='$device.sysname')) # from line 934, col 17.
        write('''</td>
            <td><input type="text" name="cn_rma"></td>
            <td><input type="text" name="cn_comment" size="60"></td>
        </tr>
    </table>
    <table>
        <tr>
            <td><input type="submit" name="cn_submit" value="Register"></td>
        </tr>
    </table>
</form>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def deleteOld(self, **KWS):



        ## CHEETAH: generated from #def deleteOld() at line 948, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<h3>Modules that have been down more than ''')
        _v = VFFSL(SL,"args",True)['threshold'] # "$args['threshold']" on line 949, col 43
        if _v is not None: write(_filter(_v, rawExpr="$args['threshold']")) # from line 949, col 43.
        write(''' hours</h3>
<form method="post" action="''')
        _v = VFFSL(SL,"args",True)['action'] # "$args['action']" on line 950, col 29
        if _v is not None: write(_filter(_v, rawExpr="$args['action']")) # from line 950, col 29.
        write('''">
    <table>
        <tr>
            <th>Select</th>
            <th>Module</th>
            <th>Sysname</th>
            <th>Down since</th>
        </tr>
''')
        for moduleid,module,sysname,downsince in VFFSL(SL,"args",True)['deleteList']: # generated from line 958, col 1
            write('''        <tr>
            <td><input type="radio" name="cn_moduleid" value="''')
            _v = VFFSL(SL,"moduleid",True) # '$moduleid' on line 960, col 63
            if _v is not None: write(_filter(_v, rawExpr='$moduleid')) # from line 960, col 63.
            write('''"></td>
            <td>''')
            _v = VFFSL(SL,"module",True) # '$module' on line 961, col 17
            if _v is not None: write(_filter(_v, rawExpr='$module')) # from line 961, col 17.
            write('''</td>
            <td>''')
            _v = VFFSL(SL,"sysname",True) # '$sysname' on line 962, col 17
            if _v is not None: write(_filter(_v, rawExpr='$sysname')) # from line 962, col 17.
            write('''</td>
            <td>''')
            _v = VFFSL(SL,"downsince",True) # '$downsince' on line 963, col 17
            if _v is not None: write(_filter(_v, rawExpr='$downsince')) # from line 963, col 17.
            write('''</td>
        </tr>
''')
        write('''    </table>
    <table>
        <tr>
            <td><input type="submit" name="cn_delete" value="Delete"></td>
            <td><input type="submit" name="cn_rma" value="Register RMA"></td>
        </tr>
    </table>
</form>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def writeBody(self, **KWS):



        ## CHEETAH: main method generated for this template
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        #  $Id: deviceManagementTemplate.tmpl 3809 2007-01-19 14:16:23Z jodal $
        # 
        #  Defines various functions for the different parts of the
        #  deviceTracker
        # 
        #  Copyright 2003, 2004 Norwegian University of Science and Technology
        # 
        #  This file is part of Network Administration Visualized (NAV)
        # 
        #  NAV is free software; you can redistribute it and/or modify
        #  it under the terms of the GNU General Public License as published by
        #  the Free Software Foundation; either version 2 of the License, or
        #  (at your option) any later version.
        # 
        #  NAV is distributed in the hope that it will be useful,
        #  but WITHOUT ANY WARRANTY; without even the implied warranty of
        #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        #  GNU General Public License for more details.
        # 
        #  You should have received a copy of the GNU General Public License
        #  along with NAV; if not, write to the Free Software
        #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
        # 
        # 
        #  Author: Hans Jørgen Hoel (hansjorg@orakel.ntnu.no)
        # 
        write('''



''')
        # 
        #  Page functions
        # 
        write('''







''')
        # 
        #  Help functions
        # 
        write('''















''')
        # 
        #  EOF
        write('''















''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        
    ##################################################
    ## CHEETAH GENERATED ATTRIBUTES


    _CHEETAH__instanceInitialized = False

    _CHEETAH_version = __CHEETAH_version__

    _CHEETAH_versionTuple = __CHEETAH_versionTuple__

    _CHEETAH_genTime = __CHEETAH_genTime__

    _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__

    _CHEETAH_src = __CHEETAH_src__

    _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__

    _mainCheetahMethod_for_deviceManagementTemplate= 'writeBody'

## END CLASS DEFINITION

if not hasattr(deviceManagementTemplate, '_initCheetahAttributes'):
    templateAPIClass = getattr(deviceManagementTemplate, '_CHEETAH_templateClass', Template)
    templateAPIClass._addCheetahPlumbingCodeToClass(deviceManagementTemplate)


# CHEETAH was developed by Tavis Rudd and Mike Orr
# with code, advice and input from many other volunteers.
# For more information visit http://www.CheetahTemplate.org/

##################################################
## if run from command line:
if __name__ == '__main__':
    from Cheetah.TemplateCmdLineIface import CmdLineIface
    CmdLineIface(templateObj=deviceManagementTemplate()).run()


