Code

better CGI text searching - but hidden filter fields are disappearing...
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Thu, 16 Aug 2001 07:34:59 +0000 (07:34 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Thu, 16 Aug 2001 07:34:59 +0000 (07:34 +0000)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@238 57a73879-2fb5-44c3-a270-3262357dd7e2

CHANGES.txt
README.txt
roundup/htmltemplate.py
roundup/hyperdb.py

index 5d727ecf783392edc97c645df7f16216efb029ba..ca2077533d97272860a7d4235b0644f619e1a11d 100644 (file)
@@ -2,6 +2,10 @@ This file contains the changes to the Roundup system over time. The entries
 are given with the most recent entry first.
 
 2001-xx-xx - 0.2.7
+Feature:
+ . Text searches are now case insensitive. All forms of text search use
+   regular expressions now.
+
 Fixed:
  . Had another 2.1-ism in the unit tests
  . Made the mail parser a little more robust w.r.t missing Subject:
index a15d3f9e2622040c7038054e9c623f6194333b99..9f17170f27f92a483dfae341620c36c37bd21df7 100644 (file)
@@ -105,6 +105,10 @@ cgi_client
 date:
   . date subtraction doesn't work correctly "if the dates cross leap years,
     phases of the moon, ..."
+cgi:
+  . setting an issue to resolved, and no other changes, results in a change
+    message with no indication of what changed
+  . enabling a filter disables the current filter hidden fields...
 
 
 6. Author
index 1a8e1d91efb3e4901de092a4b8c33835902b7111..3d9d69e70b3933f21ab964327230d44135fe302f 100644 (file)
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: htmltemplate.py,v 1.20 2001-08-15 23:43:18 richard Exp $
+# $Id: htmltemplate.py,v 1.21 2001-08-16 07:34:59 richard Exp $
 
 import os, re, StringIO, urllib, cgi, errno
 
@@ -505,18 +505,18 @@ def index(client, templates, db, classname, filterspec={}, filter=[],
         columns = l
 
     # now display the index section
-    w('<table width=100% border=0 cellspacing=0 cellpadding=2>')
-    w('<tr class="list-header">')
+    w('<table width=100% border=0 cellspacing=0 cellpadding=2>\n')
+    w('<tr class="list-header">\n')
     for name in columns:
         cname = name.capitalize()
         if show_display_form:
             anchor = "%s?%s"%(classname, sortby(name, columns, filter,
                 sort, group, filterspec))
-            w('<td><span class="list-item"><a href="%s">%s</a></span></td>'%(
+            w('<td><span class="list-item"><a href="%s">%s</a></span></td>\n'%(
                 anchor, cname))
         else:
-            w('<td><span class="list-item">%s</span></td>'%cname)
-    w('</tr>')
+            w('<td><span class="list-item">%s</span></td>\n'%cname)
+    w('</tr>\n')
 
     # this stuff is used for group headings - optimise the group names
     old_group = None
@@ -575,49 +575,49 @@ def index(client, templates, db, classname, filterspec={}, filter=[],
 
     # now add in the filter/columns/group/etc config table form
     w('<p>')
-    w('<table width=100% border=0 cellspacing=0 cellpadding=2>')
+    w('<table width=100% border=0 cellspacing=0 cellpadding=2>\n')
     names = []
     for name in cl.getprops().keys():
         if name in all_filters or name in all_columns:
             names.append(name)
     w('<tr class="location-bar">')
-    w('<th align="left" colspan=%s>View customisation...</th></tr>'%
+    w('<th align="left" colspan=%s>View customisation...</th></tr>\n'%
         (len(names)+1))
     w('<tr class="location-bar"><th>&nbsp;</th>')
     for name in names:
         w('<th>%s</th>'%name.capitalize())
-    w('</tr>')
+    w('</tr>\n')
 
     # filter
     if all_filters:
-        w('<tr><th width="1%" align=right class="location-bar">Filters</th>')
+        w('<tr><th width="1%" align=right class="location-bar">Filters</th>\n')
         for name in names:
             if name not in all_filters:
                 w('<td>&nbsp;</td>')
                 continue
             if name in filter: checked=' checked'
             else: checked=''
-            w('<td align=middle>')
-            w('<input type="checkbox" name=":filter" value="%s" %s></td>'%(name,
-                checked))
-        w('</tr>')
+            w('<td align=middle>\n')
+            w(' <input type="checkbox" name=":filter" value="%s" %s></td>\n'%(
+                name, checked))
+        w('</tr>\n')
 
     # columns
     if all_columns:
-        w('<tr><th width="1%" align=right class="location-bar">Columns</th>')
+        w('<tr><th width="1%" align=right class="location-bar">Columns</th>\n')
         for name in names:
             if name not in all_columns:
                 w('<td>&nbsp;</td>')
                 continue
             if name in columns: checked=' checked'
             else: checked=''
-            w('<td align=middle>')
-            w('<input type="checkbox" name=":columns" value="%s" %s></td>'%(
+            w('<td align=middle>\n')
+            w(' <input type="checkbox" name=":columns" value="%s" %s></td>\n'%(
                 name, checked))
-        w('</tr>')
+        w('</tr>\n')
 
         # group
-        w('<tr><th width="1%" align=right class="location-bar">Grouping</th>')
+        w('<tr><th width="1%" align=right class="location-bar">Grouping</th>\n')
         for name in names:
             prop = properties[name]
             if name not in all_columns:
@@ -625,16 +625,16 @@ def index(client, templates, db, classname, filterspec={}, filter=[],
                 continue
             if name in group: checked=' checked'
             else: checked=''
-            w('<td align=middle>')
-            w('<input type="checkbox" name=":group" value="%s" %s></td>'%(
+            w('<td align=middle>\n')
+            w(' <input type="checkbox" name=":group" value="%s" %s></td>\n'%(
                 name, checked))
-        w('</tr>')
+        w('</tr>\n')
 
     w('<tr class="location-bar"><td width="1%">&nbsp;</td>')
     w('<td colspan="%s">'%len(names))
-    w('<input type="submit" value="Redisplay"></td></tr>')
-    w('</table>')
-    w('</form>')
+    w('<input type="submit" value="Redisplay"></td></tr>\n')
+    w('</table>\n')
+    w('</form>\n')
 
 
 #
@@ -742,6 +742,10 @@ def newitem(client, templates, db, classname, form, replace=re.compile(
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.20  2001/08/15 23:43:18  richard
+# Fixed some isFooTypes that I missed.
+# Refactored some code in the CGI code.
+#
 # Revision 1.19  2001/08/12 06:32:36  richard
 # using isinstance(blah, Foo) now instead of isFooType
 #
index 6951a6f3e2a791124e315fb3334478e01d7399bd..3cb774a7635cb935b5217e7e98db54bb49108306 100644 (file)
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: hyperdb.py,v 1.17 2001-08-16 06:59:58 richard Exp $
+# $Id: hyperdb.py,v 1.18 2001-08-16 07:34:59 richard Exp $
 
 # standard python modules
 import cPickle, re, string
@@ -567,11 +567,11 @@ class Class:
                     u.append(entry)
                 l.append((1, k, u))
             elif isinstance(propclass, String):
-                if '*' in v or '?' in v:
-                    # simple glob searching
-                    v = v.replace('?', '.')
-                    v = v.replace('*', '.*?')
-                    l.append((2, k, re.compile(v, re.I)))
+                # simple glob searching
+                v = re.sub(r'([\|\{\}\\\.\+\[\]\(\)])', r'\\\1', v)
+                v = v.replace('?', '.')
+                v = v.replace('*', '.*?')
+                l.append((2, k, re.compile(v, re.I)))
             else:
                 l.append((6, k, v))
         filterspec = l
@@ -794,6 +794,9 @@ def Choice(name, *options):
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.17  2001/08/16 06:59:58  richard
+# all searches use re now - and they're all case insensitive
+#
 # Revision 1.16  2001/08/15 23:43:18  richard
 # Fixed some isFooTypes that I missed.
 # Refactored some code in the CGI code.