[gnue-contrib] r292 - address/forms

[email protected] Fri, 4 Feb 2011 03:30:19 -0600 (CST)
Newsgroups gmane.comp.cms.gnue.cvs
Message-ID <[email protected]>
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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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 @@
=20
  <!-- =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -->
=20
+ <menu name=3D"mnu__main_menu__">
+   <menu name=3D"mnu__navigation__" label=3D"Optionen">
+     <menuitem name=3D"mnu__prev_record__" hotkey=3D"F1"/>
+     <menuitem name=3D"mnu__next_record__" hotkey=3D"F2"/>
+   </menu>
+ </menu>
+
+ <!-- =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -->
+
  <logic>
    <block name=3D"blk_company" datasource=3D"dts_company" startup=3D"ful=
l">
      <field name=3D"id"           field=3D"id"         datatype=3D"numbe=
r" length=3D"8"/>
@@ -322,7 +331,7 @@
              <button label=3D"&gt;&gt;">
                <trigger type=3D"ON-ACTION">blk_contact.last_record()</tr=
igger>
              </button>
-             <entry block=3D"blk_company" field=3D"contact_count"/>
+             <entry block=3D"blk_company" field=3D"contact_count" style=3D=
"label"/>
            </hbox>
          </vbox>
        </vbox>
@@ -607,43 +616,16 @@
    </action>
=20
    <action name=3D"act_filter">
-     # This is a workaround for SQLite3 not knowing that UPPER('=C3=A4')=
 =3D '=C3=84'.
-     def build(aval, last=3D0):
-       cmap =3D {u'=C3=B6': u'=C3=96', u'=C3=96': u'=C3=B6',
-               u'=C3=A4': u'=C3=84', u'=C3=84': u'=C3=A4',
-               u'=C3=BC': u'=C3=9C', u'=C3=9C': u'=C3=BC'}
-
-       result =3D []
-
-       for ix in range(last, len(aval)):
-         if aval[ix] in cmap:
-           cc =3D aval[ix]
-           newval =3D aval[0:ix] + cmap[cc] + aval[ix + 1:]
-
-           xres =3D build(newval, ix + 1)
-           result.extend(xres)
-
-       result.append(aval)
-       return result
-
-     def build_pattern(pattern):
-       result =3D []
-
-       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 =3D blk.search.value
      old =3D getParameter('prm_search')
=20
      if old !=3D val:
          if val is not None:
-             blk_company.query(build_pattern("%%" + val + "%%"))
+             val =3D u"%%" + val + u"%%"
+             blk_company.set_filter(['or',
+                 ['like', ['upper', ['field', 'matchcode']], ['const', v=
al]],
+                 ['like', ['upper', ['field', 'name1']], ['const', val]]=
,
+                 ['like', ['upper', ['field', 'name2']], ['const', val]]=
])
          else:
              blk_company.clear()
=20
@@ -652,9 +634,7 @@
=20
    <action name=3D"act_button_focus">
      act_filter.run()
-     # FIXME: get_record_count not available before gnue-forms 0.6-pre1
-     # if blk_company.get_record_count() =3D=3D 1 and blk_company.get_re=
cord_status() =3D=3D 'clean':
-     if blk_company.getResultSet().getRecordCount() =3D=3D 1 and blk_com=
pany.get_record_status() =3D=3D 'clean':
+     if blk_company.get_record_count() =3D=3D 1 and blk_company.get_reco=
rd_status() =3D=3D 'clean':
          act_select.run()
    </action>
=20
@@ -737,40 +717,14 @@
    </action>
=20
    <action name=3D"act_filter">
-     # This is a workaround for SQLite3 not knowing that UPPER('=C3=A4')=
 =3D '=C3=84'.
-     def build(aval, last=3D0):
-       cmap =3D {u'=C3=B6': u'=C3=96', u'=C3=96': u'=C3=B6',
-               u'=C3=A4': u'=C3=84', u'=C3=84': u'=C3=A4',
-               u'=C3=BC': u'=C3=9C', u'=C3=9C': u'=C3=BC'}
-
-       result =3D []
-
-       for ix in range(last, len(aval)):
-         if aval[ix] in cmap:
-           cc =3D aval[ix]
-           newval =3D aval[0:ix] + cmap[cc] + aval[ix + 1:]
-
-           xres =3D build(newval, ix + 1)
-           result.extend(xres)
-
-       result.append(aval)
-       return result
-
-     def build_pattern(pattern):
-       result =3D []
-
-       for item in build(pattern):
-         result.extend ([['like', ['upper', ['field', 'surname']], ['con=
st', item]],
-                         ['like', ['upper', ['field', 'firstname']], ['c=
onst', item]]])
-
-       result.insert(0, 'or')
-       return result
-
      val =3D blk.search.value
      old =3D getParameter('prm_search')
      if old !=3D val:
          if val is not None:
-             blk_contact.query(build_pattern("%%" + val + "%%"))
+             val =3D u"%%" + val + u"%%"
+             blk_company.set_filter(['or',
+                 ['like', ['upper', ['field', 'surname']], ['const', val=
]],
+                 ['like', ['upper', ['field', 'firstname']], ['const', v=
al]]])
          else:
              blk_contact.clear()
=20
@@ -779,9 +733,7 @@
=20
    <action name=3D"act_button_focus">
      act_filter.run()
-     # FIXME: get_record_count not available before gnue-forms 0.6-pre1
-     # if blk_contact.get_record_count() =3D=3D 1 and blk_contact.get_re=
cord_status() =3D=3D 'clean':
-     if blk_contact.getResultSet().getRecordCount() =3D=3D 1 and blk_con=
tact.get_record_status() =3D=3D 'clean':
+     if blk_contact.get_record_count() =3D=3D 1 and blk_contact.get_reco=
rd_status() =3D=3D 'clean':
          act_select.run()
    </action>
=20
@@ -884,9 +836,7 @@
=20
    <action name=3D"act_button_focus">
      act_filter.run()
-     # FIXME: get_record_count not available before gnue-forms 0.6-pre1
-     # if blk_contact.get_record_count() =3D=3D 1 and blk_contact.get_re=
cord_status() =3D=3D 'clean':
-     if blk_contact.getResultSet().getRecordCount() =3D=3D 1 and blk_con=
tact.get_record_status() =3D=3D 'clean':
+     if blk_contact.get_record_count() =3D=3D 1 and blk_contact.get_reco=
rd_status() =3D=3D 'clean':
          act_select.run()
    </action>
=20