1515# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717#
18- # $Id: interfaces.py,v 1.10 2001-10-05 02:23:24 richard Exp $
18+ # $Id: interfaces.py,v 1.11 2001-10-09 07:38:58 richard Exp $
1919
20- import instance_config , urlparse , os
20+ import instance_config
2121from roundup import cgi_client , mailgw
2222
23- class Client (cgi_client .Client ):
24- ''' derives basic mail gateway implementation from the standard module,
23+ class Client (cgi_client .ExtendedClient ):
24+ ''' derives basic CGI implementation from the standard module,
2525 with any specific extensions
2626 '''
2727 TEMPLATES = instance_config .TEMPLATES
28- showsupport = cgi_client .Client .shownode
29- showtimelog = cgi_client .Client .shownode
30- newsupport = cgi_client .Client .newnode
31- newtimelog = cgi_client .Client .newnode
32-
33- default_index_sort = ['-activity' ]
34- default_index_group = ['priority' ]
35- default_index_filter = []
36- default_index_columns = ['activity' ,'status' ,'title' ,'assignedto' ]
37- default_index_filterspec = {'status' : ['1' , '2' , '3' , '4' , '5' , '6' , '7' ]}
38-
39- def pagehead (self , title , message = None ):
40- url = self .env ['SCRIPT_NAME' ] + '/' #self.env.get('PATH_INFO', '/')
41- machine = self .env ['SERVER_NAME' ]
42- port = self .env ['SERVER_PORT' ]
43- if port != '80' : machine = machine + ':' + port
44- base = urlparse .urlunparse (('http' , machine , url , None , None , None ))
45- if message is not None :
46- message = '<div class="system-msg">%s</div>' % message
47- else :
48- message = ''
49- style = open (os .path .join (self .TEMPLATES , 'style.css' )).read ()
50- user_name = self .user or ''
51- if self .user == 'admin' :
52- admin_links = ' | <a href="list_classes">Class List</a>'
53- else :
54- admin_links = ''
55- if self .user not in (None , 'anonymous' ):
56- userid = self .db .user .lookup (self .user )
57- user_info = '''
58- <a href="issue?assignedto=%s&status=unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:columns=id,activity,status,title,assignedto&:group=priority">My Issues</a> |
59- <a href="support?assignedto=%s&status=unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:columns=id,activity,status,title,assignedto&:group=customername">My Support</a> |
60- <a href="user%s">My Details</a> | <a href="logout">Logout</a>
61- ''' % (userid , userid , userid )
62- else :
63- user_info = '<a href="login">Login</a>'
64- if self .user is not None :
65- add_links = '''
66- | Add
67- <a href="newissue">Issue</a>,
68- <a href="newsupport">Support</a>,
69- <a href="newuser">User</a>
70- '''
71- else :
72- add_links = ''
73- self .write ('''<html><head>
74- <title>%s</title>
75- <style type="text/css">%s</style>
76- </head>
77- <body bgcolor=#ffffff>
78- %s
79- <table width=100%% border=0 cellspacing=0 cellpadding=2>
80- <tr class="location-bar"><td><big><strong>%s</strong></big></td>
81- <td align=right valign=bottom>%s</td></tr>
82- <tr class="location-bar">
83- <td align=left>All
84- <a href="issue?status=unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:columns=id,activity,status,title,assignedto&:group=priority">Issues</a>,
85- <a href="support?status=unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:columns=id,activity,status,title,assignedto&:group=customername">Support</a>
86- | Unassigned
87- <a href="issue?assignedto=admin&status=unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:columns=id,activity,status,title,assignedto&:group=priority">Issues</a>,
88- <a href="support?assignedto=admin&status=unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:columns=id,activity,status,title,assignedto&:group=customername">Support</a>
89- %s
90- %s</td>
91- <td align=right>%s</td>
92- </table>
93- ''' % (title , style , message , title , user_name , add_links , admin_links ,
94- user_info ))
9528
9629class MailGW (mailgw .MailGW ):
9730 ''' derives basic mail gateway implementation from the standard module,
@@ -103,6 +36,26 @@ class MailGW(mailgw.MailGW):
10336
10437#
10538# $Log: not supported by cvs2svn $
39+ # Revision 1.10 2001/10/05 02:23:24 richard
40+ # . roundup-admin create now prompts for property info if none is supplied
41+ # on the command-line.
42+ # . hyperdb Class getprops() method may now return only the mutable
43+ # properties.
44+ # . Login now uses cookies, which makes it a whole lot more flexible. We can
45+ # now support anonymous user access (read-only, unless there's an
46+ # "anonymous" user, in which case write access is permitted). Login
47+ # handling has been moved into cgi_client.Client.main()
48+ # . The "extended" schema is now the default in roundup init.
49+ # . The schemas have had their page headings modified to cope with the new
50+ # login handling. Existing installations should copy the interfaces.py
51+ # file from the roundup lib directory to their instance home.
52+ # . Incorrectly had a Bizar Software copyright on the cgitb.py module from
53+ # Ping - has been removed.
54+ # . Fixed a whole bunch of places in the CGI interface where we should have
55+ # been returning Not Found instead of throwing an exception.
56+ # . Fixed a deviation from the spec: trying to modify the 'id' property of
57+ # an item now throws an exception.
58+ #
10659# Revision 1.9 2001/08/07 00:24:43 richard
10760# stupid typo
10861#
0 commit comments