summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bb835e0)
raw | patch | inline | side by side (parent: bb835e0)
author | rochecompaan <rochecompaan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 30 Nov 2001 20:28:10 +0000 (20:28 +0000) | ||
committer | rochecompaan <rochecompaan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 30 Nov 2001 20:28:10 +0000 (20:28 +0000) |
made through the web or by email
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@440 57a73879-2fb5-44c3-a270-3262357dd7e2
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@440 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/cgi_client.py | patch | blob | history | |
roundup/roundupdb.py | patch | blob | history |
diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py
index 478cda0c3ccfd1820da202f6438cd9741b37f1f7..02560d9ac20609b040af4c4313467a9519c0cca0 100644 (file)
--- a/roundup/cgi_client.py
+++ b/roundup/cgi_client.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: cgi_client.py,v 1.70 2001-11-30 00:06:29 richard Exp $
+# $Id: cgi_client.py,v 1.71 2001-11-30 20:28:10 rochecompaan Exp $
__doc__ = """
WWW request handler (also used in the stand-alone server).
note = self.form['__note']
note = note.value
if changed or note:
+ p = self._post_editnode(self.nodeid, changed)
+ props['messages'] = p['messages']
+ props['files'] = p['files']
cl.set(self.nodeid, **props)
- self._post_editnode(self.nodeid, changed)
# and some nice feedback for the user
message = _('%(changes)s edited ok')%{'changes':
', '.join(changed)}
' the web.\n')%{'classname': cn}
m = [summary]
- # figure the changes and add them to the message
- first = 1
- for name, prop in props.items():
- if changes is not None and name not in changes: continue
- if first:
- m.append('\n-------')
- first = 0
- value = cl.get(nid, name, None)
- if isinstance(prop, hyperdb.Link):
- link = self.db.classes[prop.classname]
- key = link.labelprop(default_to_id=1)
- if value is not None and key:
- value = link.get(value, key)
- else:
- value = '-'
- elif isinstance(prop, hyperdb.Multilink):
- if value is None: value = []
- l = []
- link = self.db.classes[prop.classname]
- key = link.labelprop(default_to_id=1)
- for entry in value:
- if key:
- l.append(link.get(entry, key))
- else:
- l.append(entry)
- value = ', '.join(l)
- m.append('%s: %s'%(name, value))
-
# now create the message
content = '\n'.join(m)
message_id = self.db.msg.create(author=self.getuid(),
messages = cl.get(nid, 'messages')
messages.append(message_id)
props = {'messages': messages, 'files': files}
- cl.set(nid, **props)
+ return props
def newnode(self, message=None):
''' Add a new node to the database.
props = {}
try:
nid = self._createnode()
- self._post_editnode(nid)
+ props = self._post_editnode(nid)
+ cl.set(nid, **props)
# and some nice feedback for the user
message = _('%(classname)s created ok')%{'classname': cn}
except:
#
# $Log: not supported by cvs2svn $
+# Revision 1.70 2001/11/30 00:06:29 richard
+# Converted roundup/cgi_client.py to use _()
+# Added the status file, I18N_PROGRESS.txt
+#
# Revision 1.69 2001/11/29 23:19:51 richard
# Removed the "This issue has been edited through the web" when a valid
# change note is supplied.
diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index 4b94a10bfb72cea8a2ef34656e3543b6b8cd8636..c0b6201294c8e625cdf43793efbb3de71da3488d 100644 (file)
--- a/roundup/roundupdb.py
+++ b/roundup/roundupdb.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: roundupdb.py,v 1.24 2001-11-30 11:29:04 rochecompaan Exp $
+# $Id: roundupdb.py,v 1.25 2001-11-30 20:28:10 rochecompaan Exp $
__doc__ = """
Extending hyperdb with types specific to issue-tracking.
if rlen == len(recipients):
return
+ # get the change note
+ if oldvalues:
+ change_note = self.generateChangeNote(nodeid, oldvalues)
+ else:
+ change_note = ''
+
+ # add the change note to the message content
+ content = self.db.msg.get(msgid, 'content')
+ content += change_note
+
# update the message's recipients list
self.db.msg.set(msgid, recipients=recipients)
+ self.db.msg.setcontent('msg', msgid, content)
# send an email to the people who missed out
sendto = [self.db.user.get(i, 'address') for i in recipients]
else:
authaddr = ''
- # get the change note
- if oldvalues:
- change_note = self.generateChangeNote(nodeid, oldvalues)
- else:
- change_note = ''
-
# make the message body
m = ['']
# put in roundup's signature
if self.EMAIL_SIGNATURE_POSITION == 'top':
- m.append(self.email_signature(nodeid, msgid, change_note))
+ m.append(self.email_signature(nodeid, msgid))
# add author information
if oldvalues:
m.append('')
# add the content
- m.append(self.db.msg.get(msgid, 'content'))
+ m.append(content)
# put in roundup's signature
if self.EMAIL_SIGNATURE_POSITION == 'bottom':
- m.append(self.email_signature(nodeid, msgid, change_note))
+ m.append(self.email_signature(nodeid, msgid))
# get the files for this message
files = self.db.msg.get(msgid, 'files')
writer.addheader('To', ', '.join(sendto))
writer.addheader('From', '%s <%s>'%(self.INSTANCE_NAME,
self.ISSUE_TRACKER_EMAIL))
- writer.addheader('Reply-To:', '%s <%s>'%(self.INSTANCE_NAME,
+ writer.addheader('Reply-To', '%s <%s>'%(self.INSTANCE_NAME,
self.ISSUE_TRACKER_EMAIL))
writer.addheader('MIME-Version', '1.0')
raise MessageSendError, \
"Couldn't send confirmation email: %s"%value
- def email_signature(self, nodeid, msgid, change_note):
+ def email_signature(self, nodeid, msgid):
''' Add a signature to the e-mail with some useful information
'''
web = self.ISSUE_TRACKER_WEB + 'issue'+ nodeid
email = '"%s" <%s>'%(self.INSTANCE_NAME, self.ISSUE_TRACKER_EMAIL)
line = '_' * max(len(web), len(email))
- return '%s\n%s\n%s\n%s\n%s'%(line, email, web, change_note, line)
+ return '%s\n%s\n%s\n%s'%(line, email, web, line)
def generateChangeNote(self, nodeid, oldvalues):
"""Generate a change note that lists property changes
changed[key] = old_value
# list the changes
- m = []
+ m = ['','----------']
for propname, oldvalue in changed.items():
prop = cl.properties[propname]
value = cl.get(nodeid, propname, None)
oldvalue = ''
change = '%s -> %s'%(oldvalue, value)
elif isinstance(prop, hyperdb.Multilink):
+ change = ''
if value is None: value = []
l = []
link = self.db.classes[prop.classname]
else:
l.append(entry)
if l:
- change = change + ' -%s'%(', '.join(l))
+ change += ' -%s'%(', '.join(l))
m.append('%s: %s'%(propname, change))
return '\n'.join(m)
#
# $Log: not supported by cvs2svn $
+# Revision 1.24 2001/11/30 11:29:04 rochecompaan
+# Property changes are now listed in emails generated by Roundup
+#
# Revision 1.23 2001/11/27 03:17:13 richard
# oops
#