Commit f6c3def2 authored by Yusei Tahara's avatar Yusei Tahara

2008-06-11 yusei

* Move Event_send and mail templates to erp5_base. Notification tool depends on them.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21495 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f15d32bd
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</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[
if body is None:\n
body = context.getTextContent() #XXX This does not support structured text format.\n
\n
# Subject\n
if subject is None:\n
subject = context.getTitle()\n
\n
# From\n
if from_url is None:\n
sender = context.getSourceValue()\n
if sender.getTitle():\n
from_url = \'"%s" <%s>\' % (sender.getTitle(),\n
sender.getDefaultEmailText())\n
else:\n
from_url = sender.getDefaultEmailText()\n
\n
# Return-Path\n
if reply_url is None:\n
reply_url = context.portal_preferences.getPreferredEventSenderEmail()\n
additional_headers = None\n
if reply_url:\n
additional_headers = {\'Return-Path\':reply_url}\n
\n
# To (multiple)\n
to_url_list = []\n
if to_url is None:\n
for recipient in context.getDestinationValueList():\n
email = recipient.getDefaultEmailText()\n
if email:\n
if recipient.getTitle():\n
to_url_list.append(\'"%s" <%s>\' % (recipient.getTitle(), email))\n
else:\n
to_url_list.append(email)\n
else:\n
raise ValueError, \'Recipient %s has no defined email\' % recipient\n
elif same_type(to_url, \'\'):\n
to_url_list.append(to_url)\n
\n
# Attachments\n
if attachment_list is None:\n
attachment_list = []\n
document_type_list = context.getPortalDocumentTypeList()\n
for attachment in context.getAggregateValueList():\n
mime_type, content = attachment.getMimeTypeAndContent()\n
name = attachment.getReference()\n
\n
attachment_list.append({\'mime_type\':mime_type,\n
\'content\':content,\n
\'name\':name})\n
\n
# Build message per destination\n
mail_message = None\n
if context.getTextFormat()==\'text/html\':\n
mail_template = context.Event_viewHtmlMimeMessage\n
else:\n
mail_template = context.Event_viewMimeMessage\n
\n
for to_url in to_url_list:\n
multipart = mail_template.as_message(mfrom=from_url,\n
mto=to_url,\n
subject=subject,\n
body=body,\n
encoding=\'utf-8\')\n
for attachment_dict in attachment_list:\n
multipart.add_file(data=attachment_dict[\'content\'],\n
content_type=attachment_dict[\'mime_type\'],\n
filename=attachment_dict[\'name\'])\n
mail_message = str(multipart)\n
context.activate(activity=\'SQLQueue\').sendMailHostMessage(mail_message)\n
\n
context.setData(mail_message)\n
\n
# Transit event workflow\n
if context.getTypeInfo() is not None:\n
context.plan()\n
context.order()\n
context.start()\n
\n
if download:\n
return mail_message\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>from_url=None, to_url=None, reply_url=None, subject=None, body=None, attachment_format=None, attachment_list=None, download=None, **kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</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>8</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>from_url</string>
<string>to_url</string>
<string>reply_url</string>
<string>subject</string>
<string>body</string>
<string>attachment_format</string>
<string>attachment_list</string>
<string>download</string>
<string>kw</string>
<string>None</string>
<string>_getattr_</string>
<string>context</string>
<string>sender</string>
<string>additional_headers</string>
<string>to_url_list</string>
<string>_getiter_</string>
<string>recipient</string>
<string>email</string>
<string>ValueError</string>
<string>same_type</string>
<string>document_type_list</string>
<string>attachment</string>
<string>mime_type</string>
<string>content</string>
<string>name</string>
<string>mail_message</string>
<string>mail_template</string>
<string>multipart</string>
<string>attachment_dict</string>
<string>_getitem_</string>
<string>str</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
<none/>
<none/>
<none/>
<none/>
<none/>
<none/>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Event_send</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="MailTemplate" module="Products.MailTemplates.MailTemplate"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:body xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:metal="http://xml.zope.org/namespaces/metal"\n
><html><body><tal:x replace="structure options/body"/></body></html></tal:body>
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Event_viewHtmlMimeMessage</string> </value>
</item>
<item>
<key> <string>mailhost</string> </key>
<value> <string>MailHost</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="MailTemplate" module="Products.MailTemplates.MailTemplate"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:body xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:metal="http://xml.zope.org/namespaces/metal"\n
><tal:x replace="structure options/body"/></tal:body>
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/plain</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Event_viewMimeMessage</string> </value>
</item>
<item>
<key> <string>mailhost</string> </key>
<value> <string>MailHost</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2008-06-11 yusei
* Move Event_send and mail templates to erp5_base. Notification tool depends on them.
2008-06-03 vincentd
* add security to manager in the assignment_workflow for Close and Open states
and query_workflow for Cancelled and Answered states
......
320
\ No newline at end of file
321
\ 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