diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py
index 9dbed7f2b1255f22e2ccbb327aeb9157494dfc82..f6178d419cae085d08e79b5aae7cb6aa7c4b73b7 100644 (file)
--- a/roundup/cgi_client.py
+++ b/roundup/cgi_client.py
-# $Id: cgi_client.py,v 1.4 2001-07-28 00:34:34 richard Exp $
+# $Id: cgi_client.py,v 1.10 2001-07-30 02:37:34 richard Exp $
import os, cgi, pprint, StringIO, urlparse, re, traceback
message = ''
style = open(os.path.join(self.TEMPLATES, 'style.css')).read()
userid = self.db.user.lookup(self.user)
- if self.user == 'admin':
- extras = ' | <a href="list_classes">Class List</a>'
- else:
- extras = ''
self.write('''<html><head>
<title>%s</title>
<style type="text/css">%s</style>
<body bgcolor=#ffffff>
%s
<table width=100%% border=0 cellspacing=0 cellpadding=2>
-<tr class="location-bar"><td><big><strong>%s</strong></big></td>
-<td align=right valign=bottom>%s</td></tr>
-<tr class="location-bar">
-<td align=left><a href="issue?status=unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:columns=activity,status,title&:group=priority">All issues</a> |
-<a href="issue?priority=fatal-bug,bug">Bugs</a> |
-<a href="issue?priority=usability">Support</a> |
-<a href="issue?priority=feature">Wishlist</a> |
-<a href="newissue">New Issue</a>
-%s</td>
-<td align=right><a href="user%s">Your Details</a></td>
+<tr class="location-bar"><td><big><strong>%s</strong></big>
+(login: <a href="user%s">%s</a>)</td></tr>
</table>
-'''%(title, style, message, title, self.user, extras, userid))
+'''%(title, style, message, title, userid, self.user))
def pagefoot(self):
if self.debug:
def index_filterspec(self):
''' pull the index filter spec from the form
+
+ Links and multilinks want to be lists - the rest are straight
+ strings.
'''
- # all the other form args are filters
+ props = self.db.classes[self.classname].getprops()
+ # all the form args not starting with ':' are filters
filterspec = {}
for key in self.form.keys():
if key[0] == ':': continue
+ prop = props[key]
value = self.form[key]
- if type(value) == type([]):
- value = [arg.value for arg in value]
+ if prop.isLinkType or prop.isMultilinkType:
+ if type(value) == type([]):
+ value = [arg.value for arg in value]
+ else:
+ value = value.value.split(',')
+ l = filterspec.get(key, [])
+ l = l + value
+ filterspec[key] = l
else:
- value = value.value.split(',')
- l = filterspec.get(key, [])
- l = l + value
- filterspec[key] = l
+ filterspec[key] = value.value
return filterspec
+ default_index_sort = ['-activity']
+ default_index_group = ['priority']
+ default_index_filter = []
+ default_index_columns = ['id','activity','title','status','assignedto']
+ default_index_filterspec = {'status': ['1', '2', '3', '4', '5', '6', '7']}
def index(self):
''' put up an index
'''
self.classname = 'issue'
if self.form.has_key(':sort'): sort = self.index_arg(':sort')
- else: sort=['-activity']
+ else: sort = self.default_index_sort
if self.form.has_key(':group'): group = self.index_arg(':group')
- else: group=['priority']
+ else: group = self.default_index_group
if self.form.has_key(':filter'): filter = self.index_arg(':filter')
- else: filter = []
+ else: filter = self.default_index_filter
if self.form.has_key(':columns'): columns = self.index_arg(':columns')
- else: columns=['activity','status','title']
+ else: columns = self.default_index_columns
filterspec = self.index_filterspec()
if not filterspec:
- filterspec['status'] = ['1', '2', '3', '4', '5', '6', '7']
+ filterspec = self.default_index_filterspec
return self.list(columns=columns, filter=filter, group=group,
sort=sort, filterspec=filterspec)
'''
cn = self.classname
- self.pagehead('Index: %s'%cn)
+ self.pagehead('Index of %s'%cn)
if sort is None: sort = self.index_arg(':sort')
if group is None: group = self.index_arg(':group')
if filter is None: filter = self.index_arg(':filter')
nid = self.nodeid
m = []
for name, prop in cl.getprops().items():
- value = cl.get(nid, name)
+ # TODO: the None default is only here because we
+ # don't have schema migration :(
+ if prop.isMultilinkType:
+ value = cl.get(nid, name, [])
+ else:
+ value = cl.get(nid, name, None)
if prop.isLinkType:
link = self.db.classes[prop.classname]
key = link.getkey()
m.append('%s: %s'%(name, value))
# handle the note
+ note = None
if self.form.has_key('__note'):
- note = self.form['__note'].value
+ note = self.form['__note']
+ if note and note.value:
+ note = note.value
if '\n' in note:
summary = re.split(r'\n\r?', note)[0]
else:
htmltemplate.newitem(self, self.TEMPLATES, self.db, self.classname,
self.form)
self.pagefoot()
+ newuser = newissue
def showuser(self, message=None):
''' display an item
#
# $Log: not supported by cvs2svn $
+# Revision 1.9 2001/07/30 01:25:07 richard
+# Default implementation is now "classic" rather than "extended" as one would
+# expect.
+#
+# Revision 1.8 2001/07/29 08:27:40 richard
+# Fixed handling of passed-in values in form elements (ie. during a
+# drill-down)
+#
+# Revision 1.7 2001/07/29 07:01:39 richard
+# Added vim command to all source so that we don't get no steenkin' tabs :)
+#
+# Revision 1.6 2001/07/29 04:04:00 richard
+# Moved some code around allowing for subclassing to change behaviour.
+#
+# Revision 1.5 2001/07/28 08:16:52 richard
+# New issue form handles lack of note better now.
+#
+# Revision 1.4 2001/07/28 00:34:34 richard
+# Fixed some non-string node ids.
+#
# Revision 1.3 2001/07/23 03:56:30 richard
# oops, missed a config removal
#
# Revision 1.1 2001/07/22 11:58:35 richard
# More Grande Splite
#
+#
+# vim: set filetype=python ts=4 sw=4 et si