diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index c0b6201294c8e625cdf43793efbb3de71da3488d..a359c58eaee7d5bff0db3100e9818f8fa822adc2 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.25 2001-11-30 20:28:10 rochecompaan Exp $
+# $Id: roundupdb.py,v 1.26 2001-12-05 14:26:44 rochecompaan Exp $
__doc__ = """
Extending hyperdb with types specific to issue-tracking.
appended to the "messages" field of the specified issue.
"""
- def sendmessage(self, nodeid, msgid, oldvalues):
+ def sendmessage(self, nodeid, msgid):
"""Send a message to the members of an issue's nosy list.
The message is sent only to users on the nosy list who are not
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]
m.append(self.email_signature(nodeid, msgid))
# add author information
- if oldvalues:
- m.append("%s%s added the comment:"%(authname, authaddr))
- else:
+ if len(self.get(nodeid,'messages')) == 1:
m.append("New submission from %s%s:"%(authname, authaddr))
+ else:
+ m.append("%s%s added the comment:"%(authname, authaddr))
m.append('')
# add the content
- m.append(content)
+ m.append(self.db.msg.get(msgid, 'content'))
# put in roundup's signature
if self.EMAIL_SIGNATURE_POSITION == 'bottom':
line = '_' * max(len(web), len(email))
return '%s\n%s\n%s\n%s'%(line, email, web, line)
- def generateChangeNote(self, nodeid, oldvalues):
+ def generateChangeNote(self, nodeid, newvalues):
"""Generate a change note that lists property changes
"""
cn = self.classname
props = cl.getprops(protected=0)
# determine what changed
- for key in props.keys():
+ for key in newvalues.keys():
if key in ['files','messages']: continue
- new_value = cl.get(nodeid, key)
+ new_value = newvalues[key]
# the old value might be non existent
try:
- old_value = oldvalues[key]
+ old_value = cl.get(nodeid, key)
if type(old_value) is type([]):
old_value.sort()
new_value.sort()
if old_value != new_value:
- changed[key] = old_value
+ changed[key] = new_value
except:
- old_value = None
- changed[key] = old_value
+ changed[key] = new_value
# list the changes
m = ['','----------']
- for propname, oldvalue in changed.items():
+ for propname, value in changed.items():
prop = cl.properties[propname]
- value = cl.get(nodeid, propname, None)
+ oldvalue = cl.get(nodeid, propname, None)
change = '%s -> %s'%(oldvalue, value)
if isinstance(prop, hyperdb.Link):
link = self.db.classes[prop.classname]
elif isinstance(prop, hyperdb.Multilink):
change = ''
if value is None: value = []
+ if oldvalue is None: oldvalue = []
l = []
link = self.db.classes[prop.classname]
key = link.labelprop(default_to_id=1)
- if oldvalue is None: oldvalue = []
# check for additions
for entry in value:
if entry in oldvalue: continue
#
# $Log: not supported by cvs2svn $
+# Revision 1.25 2001/11/30 20:28:10 rochecompaan
+# Property changes are now completely traceable, whether changes are
+# made through the web or by email
+#
# Revision 1.24 2001/11/30 11:29:04 rochecompaan
# Property changes are now listed in emails generated by Roundup
#