commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue-contrib] r292 - address/forms


From: reinhard
Subject: [gnue-contrib] r292 - address/forms
Date: Fri, 4 Feb 2011 03:30:19 -0600 (CST)

Author: reinhard
Date: 2011-02-04 03:30:19 -0600 (Fri, 04 Feb 2011)
New Revision: 292

Modified:
   address/forms/address.gfd
Log:
Some more updates.


Modified: address/forms/address.gfd
===================================================================
--- address/forms/address.gfd   2011-02-03 09:42:25 UTC (rev 291)
+++ address/forms/address.gfd   2011-02-04 09:30:19 UTC (rev 292)
@@ -49,6 +49,15 @@
 
  <!-- ==================================================================== -->
 
+ <menu name="mnu__main_menu__">
+   <menu name="mnu__navigation__" label="Optionen">
+     <menuitem name="mnu__prev_record__" hotkey="F1"/>
+     <menuitem name="mnu__next_record__" hotkey="F2"/>
+   </menu>
+ </menu>
+
+ <!-- ==================================================================== -->
+
  <logic>
    <block name="blk_company" datasource="dts_company" startup="full">
      <field name="id"           field="id"         datatype="number" 
length="8"/>
@@ -322,7 +331,7 @@
              <button label="&gt;&gt;">
                <trigger type="ON-ACTION">blk_contact.last_record()</trigger>
              </button>
-             <entry block="blk_company" field="contact_count"/>
+             <entry block="blk_company" field="contact_count" style="label"/>
            </hbox>
          </vbox>
        </vbox>
@@ -607,43 +616,16 @@
    </action>
 
    <action name="act_filter">
-     # This is a workaround for SQLite3 not knowing that UPPER('ä') = 'Ä'.
-     def build(aval, last=0):
-       cmap = {u'ö': u'Ö', u'Ö': u'ö',
-               u'ä': u'Ä', u'Ä': u'ä',
-               u'ü': u'Ü', u'Ü': u'ü'}
-
-       result = []
-
-       for ix in range(last, len(aval)):
-         if aval[ix] in cmap:
-           cc = aval[ix]
-           newval = aval[0:ix] + cmap[cc] + aval[ix + 1:]
-
-           xres = build(newval, ix + 1)
-           result.extend(xres)
-
-       result.append(aval)
-       return result
-
-     def build_pattern(pattern):
-       result = []
-
-       for item in build(pattern):
-         result.extend ([ \
-           ['like', ['upper', ['field', 'matchcode']], ['const', item]], \
-           ['like', ['upper', ['field', 'name1']], ['const', item]], \
-           ['like', ['upper', ['field', 'name2']], ['const', item]]])
-
-       result.insert(0, 'or')
-       return result
-
      val = blk.search.value
      old = getParameter('prm_search')
 
      if old != val:
          if val is not None:
-             blk_company.query(build_pattern("%%" + val + "%%"))
+             val = u"%%" + val + u"%%"
+             blk_company.set_filter(['or',
+                 ['like', ['upper', ['field', 'matchcode']], ['const', val]],
+                 ['like', ['upper', ['field', 'name1']], ['const', val]],
+                 ['like', ['upper', ['field', 'name2']], ['const', val]]])
          else:
              blk_company.clear()
 
@@ -652,9 +634,7 @@
 
    <action name="act_button_focus">
      act_filter.run()
-     # FIXME: get_record_count not available before gnue-forms 0.6-pre1
-     # if blk_company.get_record_count() == 1 and 
blk_company.get_record_status() == 'clean':
-     if blk_company.getResultSet().getRecordCount() == 1 and 
blk_company.get_record_status() == 'clean':
+     if blk_company.get_record_count() == 1 and 
blk_company.get_record_status() == 'clean':
          act_select.run()
    </action>
 
@@ -737,40 +717,14 @@
    </action>
 
    <action name="act_filter">
-     # This is a workaround for SQLite3 not knowing that UPPER('ä') = 'Ä'.
-     def build(aval, last=0):
-       cmap = {u'ö': u'Ö', u'Ö': u'ö',
-               u'ä': u'Ä', u'Ä': u'ä',
-               u'ü': u'Ü', u'Ü': u'ü'}
-
-       result = []
-
-       for ix in range(last, len(aval)):
-         if aval[ix] in cmap:
-           cc = aval[ix]
-           newval = aval[0:ix] + cmap[cc] + aval[ix + 1:]
-
-           xres = build(newval, ix + 1)
-           result.extend(xres)
-
-       result.append(aval)
-       return result
-
-     def build_pattern(pattern):
-       result = []
-
-       for item in build(pattern):
-         result.extend ([['like', ['upper', ['field', 'surname']], ['const', 
item]],
-                         ['like', ['upper', ['field', 'firstname']], ['const', 
item]]])
-
-       result.insert(0, 'or')
-       return result
-
      val = blk.search.value
      old = getParameter('prm_search')
      if old != val:
          if val is not None:
-             blk_contact.query(build_pattern("%%" + val + "%%"))
+             val = u"%%" + val + u"%%"
+             blk_company.set_filter(['or',
+                 ['like', ['upper', ['field', 'surname']], ['const', val]],
+                 ['like', ['upper', ['field', 'firstname']], ['const', val]]])
          else:
              blk_contact.clear()
 
@@ -779,9 +733,7 @@
 
    <action name="act_button_focus">
      act_filter.run()
-     # FIXME: get_record_count not available before gnue-forms 0.6-pre1
-     # if blk_contact.get_record_count() == 1 and 
blk_contact.get_record_status() == 'clean':
-     if blk_contact.getResultSet().getRecordCount() == 1 and 
blk_contact.get_record_status() == 'clean':
+     if blk_contact.get_record_count() == 1 and 
blk_contact.get_record_status() == 'clean':
          act_select.run()
    </action>
 
@@ -884,9 +836,7 @@
 
    <action name="act_button_focus">
      act_filter.run()
-     # FIXME: get_record_count not available before gnue-forms 0.6-pre1
-     # if blk_contact.get_record_count() == 1 and 
blk_contact.get_record_status() == 'clean':
-     if blk_contact.getResultSet().getRecordCount() == 1 and 
blk_contact.get_record_status() == 'clean':
+     if blk_contact.get_record_count() == 1 and 
blk_contact.get_record_status() == 'clean':
          act_select.run()
    </action>
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]