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.ERP5Type.Document.Alarm</string>
<string>Alarm</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>active_sense_method_id</string> </key>
<value> <string>BugModule_sendOpenBugListReminder</string> </value>
</item>
<item>
<key> <string>alarm_date</string> </key>
<value>
<object>
<klass>
<global id="1.1" name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_aday</string> </key>
<value> <string>Mon</string> </value>
</item>
<item>
<key> <string>_amon</string> </key>
<value> <string>Sep</string> </value>
</item>
<item>
<key> <string>_d</string> </key>
<value> <float>38611.4590278</float> </value>
</item>
<item>
<key> <string>_day</string> </key>
<value> <int>18</int> </value>
</item>
<item>
<key> <string>_dayoffset</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>_fday</string> </key>
<value> <string>Monday</string> </value>
</item>
<item>
<key> <string>_fmon</string> </key>
<value> <string>September</string> </value>
</item>
<item>
<key> <string>_hour</string> </key>
<value> <int>13</int> </value>
</item>
<item>
<key> <string>_millis</string> </key>
<value> <long>1158577260000</long> </value>
</item>
<item>
<key> <string>_minute</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>_month</string> </key>
<value> <int>9</int> </value>
</item>
<item>
<key> <string>_nearsec</string> </key>
<value> <float>0.0</float> </value>
</item>
<item>
<key> <string>_pday</string> </key>
<value> <string>Mon.</string> </value>
</item>
<item>
<key> <string>_pm</string> </key>
<value> <string>pm</string> </value>
</item>
<item>
<key> <string>_pmhour</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>_pmon</string> </key>
<value> <string>Sep.</string> </value>
</item>
<item>
<key> <string>_second</string> </key>
<value> <float>0.0</float> </value>
</item>
<item>
<key> <string>_t</string> </key>
<value> <float>1158577260.0</float> </value>
</item>
<item>
<key> <string>_tz</string> </key>
<value> <string>GMT+2</string> </value>
</item>
<item>
<key> <string>_year</string> </key>
<value> <int>2006</int> </value>
</item>
<item>
<key> <string>time</string> </key>
<value> <float>0.459027777775</float> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Sends a summary email with all open bugs.</string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>open_bugs_alarm</string> </value>
</item>
<item>
<key> <string>periodicity_day_frequency</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>periodicity_hour</string> </key>
<value>
<tuple>
<int>13</int>
</tuple>
</value>
</item>
<item>
<key> <string>periodicity_hour_frequency</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>periodicity_minute</string> </key>
<value>
<tuple>
<int>1</int>
</tuple>
</value>
</item>
<item>
<key> <string>periodicity_minute_frequency</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>periodicity_month</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_month_day</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_month_frequency</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>periodicity_start_date</string> </key>
<value>
<object>
<klass> <reference id="1.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_aday</string> </key>
<value> <string>Fri</string> </value>
</item>
<item>
<key> <string>_amon</string> </key>
<value> <string>Sep</string> </value>
</item>
<item>
<key> <string>_d</string> </key>
<value> <float>38593.9166667</float> </value>
</item>
<item>
<key> <string>_day</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>_dayoffset</string> </key>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>_fday</string> </key>
<value> <string>Friday</string> </value>
</item>
<item>
<key> <string>_fmon</string> </key>
<value> <string>September</string> </value>
</item>
<item>
<key> <string>_hour</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_millis</string> </key>
<value> <long>1157061600000</long> </value>
</item>
<item>
<key> <string>_minute</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_month</string> </key>
<value> <int>9</int> </value>
</item>
<item>
<key> <string>_nearsec</string> </key>
<value> <float>0.0</float> </value>
</item>
<item>
<key> <string>_pday</string> </key>
<value> <string>Fri.</string> </value>
</item>
<item>
<key> <string>_pm</string> </key>
<value> <string>am</string> </value>
</item>
<item>
<key> <string>_pmhour</string> </key>
<value> <int>12</int> </value>
</item>
<item>
<key> <string>_pmon</string> </key>
<value> <string>Sep.</string> </value>
</item>
<item>
<key> <string>_second</string> </key>
<value> <float>0.0</float> </value>
</item>
<item>
<key> <string>_t</string> </key>
<value> <float>1157061600.0</float> </value>
</item>
<item>
<key> <string>_tz</string> </key>
<value> <string>GMT+2</string> </value>
</item>
<item>
<key> <string>_year</string> </key>
<value> <int>2006</int> </value>
</item>
<item>
<key> <string>time</string> </key>
<value> <float>0.916666666664</float> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>periodicity_stop_date</string> </key>
<value>
<object>
<klass> <reference id="1.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_aday</string> </key>
<value> <string>Wed</string> </value>
</item>
<item>
<key> <string>_amon</string> </key>
<value> <string>Jan</string> </value>
</item>
<item>
<key> <string>_d</string> </key>
<value> <float>401401.958333</float> </value>
</item>
<item>
<key> <string>_day</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>_dayoffset</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_fday</string> </key>
<value> <string>Wednesday</string> </value>
</item>
<item>
<key> <string>_fmon</string> </key>
<value> <string>January</string> </value>
</item>
<item>
<key> <string>_hour</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_millis</string> </key>
<value> <long>32503676400000</long> </value>
</item>
<item>
<key> <string>_minute</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_month</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>_nearsec</string> </key>
<value> <float>0.0</float> </value>
</item>
<item>
<key> <string>_pday</string> </key>
<value> <string>Wed.</string> </value>
</item>
<item>
<key> <string>_pm</string> </key>
<value> <string>am</string> </value>
</item>
<item>
<key> <string>_pmhour</string> </key>
<value> <int>12</int> </value>
</item>
<item>
<key> <string>_pmon</string> </key>
<value> <string>Jan.</string> </value>
</item>
<item>
<key> <string>_second</string> </key>
<value> <float>0.0</float> </value>
</item>
<item>
<key> <string>_t</string> </key>
<value> <float>32503676400.0</float> </value>
</item>
<item>
<key> <string>_tz</string> </key>
<value> <string>GMT+1</string> </value>
</item>
<item>
<key> <string>_year</string> </key>
<value> <int>3000</int> </value>
</item>
<item>
<key> <string>time</string> </key>
<value> <float>0.958333333314</float> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>periodicity_week</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_week_day</string> </key>
<value>
<tuple>
<string>Monday</string>
</tuple>
</value>
</item>
<item>
<key> <string>periodicity_week_frequency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Alarm</string> </value>
</item>
<item>
<key> <string>sense_method_id</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Open bugs alarm</string> </value>
</item>
<item>
<key> <string>uid</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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 2006-08-29 jerome
* Remove related keys, they are automatically generated. * Remove related keys, they are automatically generated.
......
91 93
\ No newline at end of file \ 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