Commit 841df14b authored by Yusei Tahara's avatar Yusei Tahara

2008-5-29 yusei

* Modifiy response transition in event_workflow, now it create a new event and send it to recepient immediately.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21213 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9841bfcc
......@@ -85,6 +85,7 @@ related_event = portal.event_module.newContent(\n
source=context.getDefaultDestination(),\n
destination=context.getDefaultSource(),\n
causality=context.getRelativeUrl(),\n
follow_up=context.getFollowUp(),\n
)\n
</string> </value>
</item>
......
......@@ -67,23 +67,28 @@
<key> <string>_body</string> </key>
<value> <string># this script allows to create a new follow up ticket for a given event\n
event_object = context\n
event_module = context.getPortalObject().getDefaultModule(\n
respond_event_portal_type)\n
event_module = context.getPortalObject().getDefaultModule(respond_event_portal_type)\n
# Create the outgoing\n
respond_event = event_module.newContent(\n
portal_type=respond_event_portal_type,\n
title=respond_event_title,\n
description=respond_event_description,\n
resource=respond_event_resource,\n
start_date=DateTime(),\n
source=context.getDefaultDestination(),\n
destination=context.getDefaultSource(),\n
causality=context.getRelativeUrl(),\n
)\n
follow_up=context.getFollowUp(),\n
text_content=respond_event_text_content,\n
text_format=\'text/plain\'\n
)\n
\n
if respond_event_quotation:\n
respond_event.edit(text_content=context.getReplyBody())\n
# Change the state to outgoing\n
respond_event.plan()\n
# Change the state to posted\n
respond_event.start()\n
\n
if respond_event.portal_type==\'Mail Message\' and respond_event.getSource():\n
respond_event.send()\n
else:\n
respond_event.send(mfrom=object.portal_preferences.getPreferredEventSenderEmail())\n
</string> </value>
</item>
<item>
......@@ -106,7 +111,7 @@ respond_event.plan()\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>respond_event_portal_type, respond_event_title, respond_event_quotation, respond_event_description=\'\'</string> </value>
<value> <string>respond_event_portal_type, respond_event_title, respond_event_resource, respond_event_text_content</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -134,14 +139,15 @@ respond_event.plan()\n
<tuple>
<string>respond_event_portal_type</string>
<string>respond_event_title</string>
<string>respond_event_quotation</string>
<string>respond_event_description</string>
<string>respond_event_resource</string>
<string>respond_event_text_content</string>
<string>context</string>
<string>event_object</string>
<string>_getattr_</string>
<string>event_module</string>
<string>DateTime</string>
<string>respond_event</string>
<string>object</string>
</tuple>
</value>
</item>
......@@ -153,9 +159,7 @@ respond_event.plan()\n
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<string></string>
</tuple>
<none/>
</value>
</item>
<item>
......
......@@ -80,11 +80,13 @@
<key> <string>left</string> </key>
<value>
<list>
<string>your_respond_event_portal_type</string>
<string>my_default_source_title</string>
<string>my_default_destination_title</string>
<string>your_respond_event_title</string>
<string>your_respond_event_description</string>
<string>your_respond_event_portal_type</string>
<string>your_respond_event_resource</string>
<string>your_respond_event_text_content</string>
<string>your_workflow_action</string>
<string>your_respond_event_quotation</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.ProxyField</string>
<string>ProxyField</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_respond_event_description</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>extra_context</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>extra_context</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>extra_context</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_description</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Event_viewFieldLibrary</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -12,7 +12,9 @@
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
<list>
<string>required</string>
</list>
</value>
</item>
<item>
......@@ -90,6 +92,10 @@
<key> <string>form_id</string> </key>
<value> <string>Event_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</value>
</item>
......
......@@ -3,7 +3,7 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="CheckBoxField" module="Products.Formulator.StandardFields"/>
<global name="ListField" module="Products.Formulator.StandardFields"/>
<tuple/>
</tuple>
</pickle>
......@@ -11,7 +11,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_respond_event_quotation</string> </value>
<value> <string>your_respond_event_resource</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -21,6 +21,14 @@
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>unknown_selection</string> </key>
<value> <string>You selected an item that was not in the list.</string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -60,14 +68,42 @@
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -107,14 +143,44 @@
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -132,7 +198,7 @@
</item>
<item>
<key> <string>default</string> </key>
<value> <int>1</int> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -154,13 +220,43 @@
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Keep Original Message</string> </value>
<value> <string>Event Nature</string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
......@@ -168,4 +264,20 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/Event_getResourceItemList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.ProxyField</string>
<string>ProxyField</string>
</tuple>
<none/>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
......@@ -17,6 +14,7 @@
<value>
<list>
<string>editable</string>
<string>required</string>
</list>
</value>
</item>
......@@ -103,6 +101,10 @@
<key> <string>form_id</string> </key>
<value> <string>Event_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</value>
</item>
......
......@@ -66,26 +66,25 @@
<item>
<key> <string>_body</string> </key>
<value> <string># this script allows to create a new respond event for\n
# the current event\n
\n
# the current event and send message immediately.\n
portal = state_change.getPortal()\n
portal_workflow = portal.portal_workflow\n
event = state_change[\'object\']\n
respond_event_portal_type = None\n
\n
history = event.portal_workflow.getInfoFor(event, \'history\', wf_id=\'event_workflow\')\n
\n
for history_item in history[::-1]:\n
if history_item[\'action\'] == \'respond_action\':\n
respond_event_portal_type = history_item[\'respond_event_portal_type\']\n
respond_event_title = history_item[\'respond_event_title\']\n
respond_event_description = history_item[\'respond_event_description\']\n
respond_event_quotation = history_item[\'respond_event_quotation\']\n
break\n
portal_type = portal_workflow.getInfoFor(event,\n
\'respond_event_portal_type\',\n
wf_id=\'event_workflow\')\n
title = portal_workflow.getInfoFor(event,\n
\'respond_event_title\',\n
wf_id=\'event_workflow\')\n
resource = portal_workflow.getInfoFor(event,\n
\'respond_event_resource\',\n
wf_id=\'event_workflow\')\n
text_content = portal_workflow.getInfoFor(event,\n
\'respond_event_text_content\',\n
wf_id=\'event_workflow\')\n
\n
if respond_event_portal_type is not None:\n
event.Event_createRespondEvent(respond_event_portal_type,\n
respond_event_title,\n
respond_event_quotation,\n
respond_event_description,)\n
event.Event_createRespondEvent(portal_type, title, resource, text_content)\n
</string> </value>
</item>
<item>
......@@ -135,17 +134,15 @@ if respond_event_portal_type is not None:\n
<value>
<tuple>
<string>state_change</string>
<string>_getattr_</string>
<string>portal</string>
<string>portal_workflow</string>
<string>_getitem_</string>
<string>event</string>
<string>None</string>
<string>respond_event_portal_type</string>
<string>_getattr_</string>
<string>history</string>
<string>_getiter_</string>
<string>history_item</string>
<string>respond_event_title</string>
<string>respond_event_description</string>
<string>respond_event_quotation</string>
<string>portal_type</string>
<string>title</string>
<string>resource</string>
<string>text_content</string>
</tuple>
</value>
</item>
......
<?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>message = state_change.kwargs[\'reply_body\']\n
subject = state_change.kwargs[\'reply_subject\']\n
recipient = state_change.kwargs[\'reply_to\']\n
object = state_change[\'object\']\n
\n
state_change[\'object\'].MailHost.send(message, mto=recipient, \n
mfrom=object.portal_preferences.getPreferredEventSenderEmail(),\n
subject=subject)\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>_params</string> </key>
<value> <string>state_change</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>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>state_change</string>
<string>_getitem_</string>
<string>_getattr_</string>
<string>message</string>
<string>subject</string>
<string>recipient</string>
<string>object</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>Event_replyMailMessage</string> </value>
</item>
<item>
<key> <string>uid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -109,19 +109,19 @@
<value>
<dictionary>
<item>
<key> <string>respond_event_description</string> </key>
<key> <string>respond_event_portal_type</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>respond_event_portal_type</string> </key>
<key> <string>respond_event_resource</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
<item>
<key> <string>respond_event_quotation</string> </key>
<key> <string>respond_event_text_content</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value>
......@@ -152,7 +152,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: state_change.kwargs.get(\'respond_event_description\')</string> </value>
<value> <string>python: state_change.kwargs.get(\'respond_event_portal_type\')</string> </value>
</item>
</dictionary>
</pickle>
......@@ -160,18 +160,15 @@
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.Expression</string>
<string>Expression</string>
</tuple>
<none/>
<global name="Expression" module="Products.CMFCore.Expression"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: state_change.kwargs.get(\'respond_event_portal_type\')</string> </value>
<value> <string>python: state_change.kwargs.get(\'respond_event_resource\')</string> </value>
</item>
</dictionary>
</pickle>
......@@ -187,7 +184,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: state_change.kwargs.get(\'respond_event_quotation\')</string> </value>
<value> <string>python: state_change.kwargs.get(\'respond_event_text_content\')</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -27,7 +27,7 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Stores the description of the event which is automatically created when the event is responded</string> </value>
<value> <string>Stores the nature of the event which is automatically created when the event is responded</string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>respond_event_description</string> </value>
<value> <string>respond_event_resource</string> </value>
</item>
<item>
<key> <string>info_guard</string> </key>
......
......@@ -27,7 +27,7 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Store the boolean which tell if we quote original event or not</string> </value>
<value> <string>Stores the text content of the event which is automatically created when the event is responded</string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>respond_event_quotation</string> </value>
<value> <string>respond_event_text_content</string> </value>
</item>
<item>
<key> <string>info_guard</string> </key>
......
2008-5-29 yusei
* Modifiy response transition in event_workflow, now it create a new event and send it to recepient immediately.
2008-5-27 yusei
* Replace "Create Related Event" action with a equivalent workflow method.
* Fixed appearance of content in view and preview.
......
247
\ No newline at end of file
249
\ 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