[Erp5-report] r8076 - /erp5/trunk/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/bug_w...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jun 20 10:25:00 CEST 2006


Author: jerome
Date: Tue Jun 20 10:24:59 2006
New Revision: 8076

URL: http://svn.erp5.org?rev=8076&view=rev
Log:
add message-id and in-reply-to headers for threading

Modified:
    erp5/trunk/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/bug_workflow/scripts/sendNotification.xml

Modified: erp5/trunk/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/bug_workflow/scripts/sendNotification.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/bug_workflow/scripts/sendNotification.xml?rev=8076&r1=8075&r2=8076&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/bug_workflow/scripts/sendNotification.xml (original)
+++ erp5/trunk/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/bug_workflow/scripts/sendNotification.xml Tue Jun 20 10:24:59 2006
@@ -79,9 +79,22 @@
 if not to_address:\n
   return\n
 \n
+# compute Message-ID and In-Reply-To header, for threading on MUAs\n
+history = portal.portal_workflow.getInfoFor(ob=bug,\n
+                                            name=\'history\',\n
+                                            wf_id=\'bug_workflow\',\n
+                                            default=())\n
+comment_count = len([item for item in history\n
+                     if str(item[\'action\']).endswith(\'_action\')])\n
+message_id = "<%s-%s.%s>" % (bug.getId(), comment_count+1, from_address)\n
+in_reply_to = "<%s-%s.%s>" % (bug.getId(), comment_count, from_address)\n
+\n
+\n
 text="""From: "%s" <%s>\n
 To: %s\n
 Subject: [Bug #%s] %s\n
+Message-Id: %s\n
+In-Reply-To: %s\n
 MIME-Version: 1.0\n
 Content-Type: text/plain;\n
   charset="utf-8"\n
@@ -99,8 +112,8 @@
 Follow-ups:\n
 \n
 %s\n
-""" % (from_name, from_address, to_address, bug.getId(), bug.getTitle(), \n
-       bug.getTitle(), bug.getSourceTitle(), bug.getDestinationTitle(),\n
+""" % (from_name, from_address, to_address, bug.getId(), bug.getTitle(), message_id, in_reply_to,\n
+       bug.getTitle(), bug.getSourceTitle() or \'\', bug.getDestinationTitle() or \'\',\n
        bug.getValidationStateTitle(), bug.getPath(),\n
        \'\\n\'.join([\'  \' + x for x in bug.getDescription().split(\'\\n\')]),\n
        \'\\n\'.join([\'  \' + x for x in bug.Bug_getFollowUpListAsText().split(\'\\n\')]),\n
@@ -163,9 +176,16 @@
                             <string>from_name</string>
                             <string>from_address</string>
                             <string>to_address</string>
+                            <string>history</string>
+                            <string>len</string>
                             <string>append</string>
                             <string>$append0</string>
                             <string>_getiter_</string>
+                            <string>item</string>
+                            <string>str</string>
+                            <string>comment_count</string>
+                            <string>message_id</string>
+                            <string>in_reply_to</string>
                             <string>x</string>
                             <string>text</string>
                           </tuple>




More information about the Erp5-report mailing list