Commit 8e271a5a authored by Jérome Perrin's avatar Jérome Perrin

Add an alarm to send a summary of all open bugs.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9959 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 551f82e4
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
portal = context.getPortalObject()\n
bug_module = portal.bug_module\n
from_name = portal.getProperty(\'email_from_name\', \'ERP5\')\n
from_address = portal.getProperty(\'email_from_address\', \'postmaster@localhost\')\n
to_address = portal.getProperty(\'email_to_address\', from_address)\n
server_url = portal.ERP5Site_getAbsoluteUrl()\n
\n
body_text_line_list = []\n
addBodyLine = body_text_line_list.append\n
bug_count = 0\n
\n
assigned_to_dict={}\n
not_assigned_bug_list=[]\n
\n
for bug in bug_module.searchFolder(portal_type=\'Bug\',\n
validation_state=\'open\',\n
sort_on=((\'id\', \'asc\', \'int\'),)):\n
bug = bug.getObject()\n
if bug.getDestination():\n
assigned_to_dict.setdefault(bug.getDestination(), []).append(bug)\n
else:\n
not_assigned_bug_list.append(bug)\n
bug_count += 1\n
\n
for assignee, bug_list in assigned_to_dict.items():\n
addBodyLine(" Assigned to %s:" % bug_list[0].getDestinationTitle())\n
for bug in bug_list:\n
addBodyLine(" [#%s] %s" % (bug.getId(), bug.getTitle()))\n
addBodyLine(" %s/%s/view" % (server_url, bug.getRelativeUrl()))\n
addBodyLine(\'\')\n
addBodyLine(\'\')\n
\n
if not_assigned_bug_list:\n
addBodyLine(\'\')\n
addBodyLine(" Not assigned:")\n
for bug in not_assigned_bug_list:\n
addBodyLine(" [#%s] %s" % (bug.getId(), bug.getTitle()))\n
addBodyLine(" %s/%s/view" % (server_url, bug.getRelativeUrl()))\n
addBodyLine(\'\')\n
\n
mail_text = """From: "%s" <%s>\n
To: %s\n
Subject: %s: %s Opened bugs\n
MIME-Version: 1.0\n
Content-Type: text/plain;\n
charset="utf-8"\n
Content-Transfer-Encoding: 8bit\n
Content-Disposition: inline\n
\n
%s""" % (\n
from_name,\n
from_address,\n
to_address,\n
portal.title_or_id(),\n
bug_count,\n
\'\\n\'.join(body_text_line_list)\n
)\n
if bug_count:\n
portal.MailHost.send(mail_text)\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>bug_module</string>
<string>from_name</string>
<string>from_address</string>
<string>to_address</string>
<string>server_url</string>
<string>body_text_line_list</string>
<string>addBodyLine</string>
<string>bug_count</string>
<string>assigned_to_dict</string>
<string>not_assigned_bug_list</string>
<string>_getiter_</string>
<string>bug</string>
<string>assignee</string>
<string>bug_list</string>
<string>_getitem_</string>
<string>mail_text</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>BugModule_sendOpenBugListReminder</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2006-09-15 jerome
* Add an alarm to send a summary of all open bugs.
2006-08-29 jerome
* Remove related keys, they are automatically generated.
......@@ -93,4 +96,4 @@ working copies
* Added missing Category : bug_difficulty
2005-08-22 Kevin
* Add a "my_id" field on Bug_view form
* Add a "my_id" field on Bug_view form
\ No newline at end of file
91
\ No newline at end of file
93
\ No newline at end of file
portal_alarms/open_bugs_alarm
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment