Commit 3b28098c authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

crm: replace Ticket_viewNewEventDialog with new Ticket_viewCreateFollowUpEventWorkflowActionDialog.

it can be used as both portal type action and workflow action.

also add 'Declare as Delivered' transition so that the created event can become directly delivered state.
parent bb107b53
...@@ -79,8 +79,8 @@ if response_workflow_action == \'send\':\n ...@@ -79,8 +79,8 @@ if response_workflow_action == \'send\':\n
elif response_workflow_action == \'plan\':\n elif response_workflow_action == \'plan\':\n
response.plan()\n response.plan()\n
return context.Base_redirect(form_id, keep_items={\'portal_status_message\': message})\n return context.Base_redirect(form_id, keep_items={\'portal_status_message\': message})\n
elif response_workflow_action == \'stop\':\n elif response_workflow_action == \'deliver\':\n
response.stop()\n response.deliver()\n
return response.Base_redirect(\'view\', keep_items={\'portal_status_message\': message})\n return response.Base_redirect(\'view\', keep_items={\'portal_status_message\': message})\n
elif response_workflow_action == \'draft\':\n elif response_workflow_action == \'draft\':\n
return response.Base_redirect(\'view\', keep_items={\'portal_status_message\': message})\n return response.Base_redirect(\'view\', keep_items={\'portal_status_message\': message})\n
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>return [(context.Base_translateString("Send it immediately"), "send"),\n <value> <string>return [(context.Base_translateString("Send it immediately"), "send"),\n
(context.Base_translateString("Plan it at the given date"),\'plan\'),\n (context.Base_translateString("Plan it at the given date"),\'plan\'),\n
(context.Base_translateString("Declare as Received"),\'stop\'),\n (context.Base_translateString("Declare as Delivered"),\'deliver\'),\n
(context.Base_translateString("Edit it as a draft"),"draft")]\n (context.Base_translateString("Edit it as a draft"),"draft")]\n
</string> </value> </string> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </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>"""Returns the default text format for response events.\n
\n
This script is here so that we can easily customized depending on the context event, ticket or user preferences.\n
"""\n
return context.getPortalObject().portal_preferences.getPreferredTextFormat()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Ticket_getPreferredFollowUpEventContentType</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </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>"""Returns the default portal type for response events.\n
\n
This script is here so that we can easily customized depending on the context event, ticket or user preferences.\n
"""\n
\n
return \'Mail Message\'\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Ticket_getPreferredFollowUpEventPortalType</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </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>"""Returns the default sender for response events.\n
\n
This script is here so that we can easily customized depending on the context event, ticket or user preferences.\n
"""\n
\n
if context.hasSource():\n
return context.getSource()\n
logged_in_user = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
if logged_in_user is not None:\n
return logged_in_user.getRelativeUrl()\n
return \'\'\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Ticket_getPreferredFollowUpEventSource</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -51,11 +51,7 @@ ...@@ -51,11 +51,7 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string>"""\n
This script creates a new event with given metadata and\n
attaches it to the current ticket.\n
"""\n """\n
\n
\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
translateString = portal.Base_translateString\n translateString = portal.Base_translateString\n
module = portal.getDefaultModule(portal_type)\n module = portal.getDefaultModule(portal_type)\n
...@@ -63,45 +59,50 @@ module = portal.getDefaultModule(portal_type)\n ...@@ -63,45 +59,50 @@ module = portal.getDefaultModule(portal_type)\n
if not portal.Base_checkPermission(module.getId(), "Add portal content"):\n if not portal.Base_checkPermission(module.getId(), "Add portal content"):\n
return context.Base_redirect(form_id,\n return context.Base_redirect(form_id,\n
keep_items=dict(\n keep_items=dict(\n
portal_status_message=translateString("You do not have permission to add new event.")))\n portal_status_message=translateString("You do not have permission to add new event.")))\n
\n
# Create a new event\n
event = module.newContent(portal_type=portal_type, \n
title=title,\n
text_content=text_content,\n
content_type=portal.portal_preferences.getPreferredTextEditor() and \'text/html\' or \'text/plain\',\n
resource=resource,\n
source=source,\n
destination=destination,\n
start_date=DateTime(),\n
follow_up=context.getRelativeUrl())\n
\n \n
# Create a new event\n
response = module.newContent(portal_type=portal_type,\n
source=source,\n
destination=destination,\n
resource=resource,\n
title=title,\n
text_content=text_content,\n
start_date=start_date,\n
follow_up_value=context,\n
content_type=content_type)\n
\n \n
if notification_message:\n if notification_message:\n
event.Event_setTextContentFromNotificationMessage(\n response.Event_setTextContentFromNotificationMessage(\n
reference=notification_message)\n reference=notification_message\n
)\n
\n \n
# Trigger appropriate workflow action\n if workflow_action:\n
if not keep_draft:\n portal.portal_workflow.doActionFor(\n
if direction == \'incoming\':\n context,\n
# Support event_workflow and event_simulation_workflow\n workflow_action,\n
if portal.portal_workflow.isTransitionPossible(event, \'receive\'):\n )\n
event.receive()\n
if portal.portal_workflow.isTransitionPossible(event, \'stop\'):\n
event.stop()\n
else:\n
event.plan()\n
\n \n
# Redirect to event\n message = translateString(\n
portal_status_message = translateString(\n
"Created and associated a new ${portal_type} to the ticket.", \n "Created and associated a new ${portal_type} to the ticket.", \n
mapping=dict(portal_type = translateString(portal_type)))\n mapping=dict(portal_type = translateString(portal_type)))\n
return event.Base_redirect(\'view\', keep_items = dict(portal_status_message=portal_status_message), **kw)\n \n
if event_workflow_action == \'send\':\n
response.start()\n
elif event_workflow_action == \'plan\':\n
response.plan()\n
elif event_workflow_action == \'deliver\':\n
response.deliver()\n
elif event_workflow_action == \'draft\':\n
pass\n
else:\n
raise NotImplementedError(\'Do not know what to do\')\n
return response.Base_redirect(\'view\', keep_items={\'portal_status_message\': message})\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>form_id=\'view\', portal_type=None, title=None, resource=None, text_content=None,direction=None, source=None, destination=None, keep_draft=False, notification_message=None, **kw</string> </value> <value> <string>form_id=None, portal_type=None, resource=None, title=None, text_content=None, start_date=None, event_workflow_action=None, notification_message=None, source=None, destination=None, content_type=None, workflow_action=None, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </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>"""Preview the response from notification message for ticket create response dialog.\n
"""\n
if notification_message:\n
temp_event = context.getPortalObject().event_module.newContent(\n
temp_object=True,\n
portal_type=portal_type,\n
source=source,\n
destination=destination,\n
follow_up_value=context,\n
resource=resource,\n
language=context.getLanguage(),\n
content_type=content_type)\n
\n
try:\n
title_field_id = \'your_title\'\n
field = getattr(context, dialog_id)[title_field_id]\n
original_title = field.getFieldValue(title_field_id, \'default\')[0](field, title_field_id)\n
  • @kazuhiko

    @frequent asked me if he is using this method correctly, he found code from here. In

    https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5Form/ProxyField.py#L685

    I understand field should not be string, so I think this always raises AttributeError caught below. Can you please explain?

  • I did not know this API, why not just using field.get_value('default') ?

    As far as I see, Ticket_updateCreateResponseWorkflowActionDialog and Ticket_updateNewEventDialog are the only users of these API.

  • ( I am assuming @frequent comment must be fore this context )

    Why not just pass the title via parameters, then instead of meddling with getting the field value, just:

    I could not find the reference, but I remember @kazuhiko and I discussed this. The idea was to always include the title of the notification message even if user used "preview" feature using update button or something, but I don't remember what.

    Also keep in mind that notification message title can also contain substitution variables.

    Today I don't remember the reason for all this and I don't know why we don't just get the title.

  • I did not know this API, why not just using field.get_value('default') ?

    Maybe I didn't know get_value() API...

    And for title, the intention here is provide a 'good template' for user, thus it is like 'EVENT TITLE (FIELD DEFAULT TITLE)' format and then the user can edit it as she likes.

Please register or sign in to reply
except (AttributeError, KeyError):\n
original_title = \'\'\n
temp_event.Event_setTextContentFromNotificationMessage(\n
reference=notification_message,\n
substitution_method_parameter_dict=dict(\n
reply_body=\'\',\n
reply_subject=original_title))\n
title = temp_event.getTitle().strip()\n
\n
if original_title and original_title not in title:\n
title = \'%s (%s)\' % (title, original_title)\n
\n
# XXX this relies on formulator internals, we force the variables in request and\n
# re-render the form.\n
request = container.REQUEST\n
request.set(\'your_notification_message\', \'\')\n
request.set(\'your_title\', title)\n
request.set(\'your_text_content\', temp_event.getTextContent())\n
request.set(\'your_content_type\', temp_event.getContentType())\n
request.set(\'your_resource\', temp_event.getResource())\n
\n
return getattr(context, dialog_id)()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>portal_type, notification_message, resource, text_content, content_type, source, destination, dialog_id, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Ticket_updateNewEventDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/> <global name="ERP5 Form" module="erp5.portal_type"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -41,6 +41,12 @@ ...@@ -41,6 +41,12 @@
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>Use this dialog to create a new event and associate it to a Ticket.</string> </value> <value> <string>Use this dialog to create a new event and associate it to a Ticket.</string> </value>
</item> </item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>encoding</string> </key> <key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value> <value> <string>UTF-8</string> </value>
...@@ -68,7 +74,9 @@ ...@@ -68,7 +74,9 @@
<item> <item>
<key> <string>bottom</string> </key> <key> <string>bottom</string> </key>
<value> <value>
<list/> <list>
<string>your_workflow_action</string>
</list>
</value> </value>
</item> </item>
<item> <item>
...@@ -77,7 +85,7 @@ ...@@ -77,7 +85,7 @@
<list> <list>
<string>your_notification_message</string> <string>your_notification_message</string>
<string>your_text_content</string> <string>your_text_content</string>
<string>your_keep_draft</string> <string>your_event_workflow_action</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -94,16 +102,18 @@ ...@@ -94,16 +102,18 @@
<string>your_title</string> <string>your_title</string>
<string>your_portal_type</string> <string>your_portal_type</string>
<string>your_resource</string> <string>your_resource</string>
<string>your_direction</string> <string>your_start_date</string>
<string>your_source</string> <string>your_content_type</string>
<string>your_destination</string>
</list> </list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>right</string> </key> <key> <string>right</string> </key>
<value> <value>
<list/> <list>
<string>your_source</string>
<string>your_destination</string>
</list>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -135,7 +145,7 @@ ...@@ -135,7 +145,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>New Event</string> </value> <value> <string>Create New Event</string> </value>
</item> </item>
<item> <item>
<key> <string>unicode_mode</string> </key> <key> <string>unicode_mode</string> </key>
...@@ -143,6 +153,10 @@ ...@@ -143,6 +153,10 @@
</item> </item>
<item> <item>
<key> <string>update_action</string> </key> <key> <string>update_action</string> </key>
<value> <string>Ticket_updateNewEventDialog</string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
......
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>default</string>
<string>items</string> <string>items</string>
<string>required</string>
<string>title</string> <string>title</string>
</list> </list>
</value> </value>
...@@ -53,6 +55,12 @@ ...@@ -53,6 +55,12 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -64,7 +72,7 @@ ...@@ -64,7 +72,7 @@
<item> <item>
<key> <string>items</string> </key> <key> <string>items</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -82,6 +90,10 @@ ...@@ -82,6 +90,10 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_list_field</string> </value> <value> <string>my_list_field</string> </value>
...@@ -96,6 +108,10 @@ ...@@ -96,6 +108,10 @@
<list/> <list/>
</value> </value>
</item> </item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
...@@ -126,7 +142,20 @@ ...@@ -126,7 +142,20 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.Ticket_getArrowItemList()</string> </value> <value> <string>here/getDestinationDecision</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/Ticket_getArrowItemList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -10,16 +10,16 @@ ...@@ -10,16 +10,16 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>required</string> <string>first_item</string>
<string>items</string>
<string>orientation</string> <string>orientation</string>
<string>title</string> <string>title</string>
<string>items</string>
</list> </list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>your_direction</string> </value> <value> <string>your_event_workflow_action</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -59,6 +59,10 @@ ...@@ -59,6 +59,10 @@
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>first_item</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -69,10 +73,18 @@ ...@@ -69,10 +73,18 @@
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
<item>
<key> <string>orientation</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -84,17 +96,40 @@ ...@@ -84,17 +96,40 @@
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_radio_field</string> </value> <value> <string>my_radio_field</string> </value>
</item> </item>
<item>
<key> <string>first_item</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item> </item>
<item> <item>
<key> <string>orientation</string> </key> <key> <string>items</string> </key>
<value> <string>horizontal</string> </value> <value>
<list>
<tuple>
<string>Send it immediately</string>
<string>send</string>
</tuple>
<tuple>
<string>Plan it at the given date</string>
<string>plan</string>
</tuple>
<tuple>
<string>Declare as Received</string>
<string>stop</string>
</tuple>
<tuple>
<string>Edit it as a Draft</string>
<string>draft</string>
</tuple>
</list>
</value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>orientation</string> </key>
<value> <int>1</int> </value> <value> <string>horizontal</string> </value>
</item> </item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
...@@ -102,7 +137,7 @@ ...@@ -102,7 +137,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Direction</string> </value> <value> <string>Action to be Triggered on the Response Event</string> </value>
</item> </item>
</dictionary> </dictionary>
</value> </value>
...@@ -118,7 +153,7 @@ ...@@ -118,7 +153,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: [(here.Base_translateString(x[0]), x[1]) for x in ((\'Incoming\', \'incoming\'), (\'Outgoing\', \'outgoing\'))]</string> </value> <value> <string>here/Event_getWorkflowActionList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<value> <value>
<list> <list>
<string>items</string> <string>items</string>
<string>required</string>
<string>title</string> <string>title</string>
</list> </list>
</value> </value>
...@@ -67,6 +68,12 @@ ...@@ -67,6 +68,12 @@
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
<item>
<key> <string>required</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -96,6 +103,10 @@ ...@@ -96,6 +103,10 @@
<list/> <list/>
</value> </value>
</item> </item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
...@@ -118,7 +129,20 @@ ...@@ -118,7 +129,20 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>here/Event_getNotificationMessageItemList</string> </value> <value> <string>python: context.Event_getNotificationMessageItemList(response_only=True)</string> </value>
  • Changing response_only to True here had a bad side effect that when using "Create Event" from a campaign user can only see response notification messages, which is not applicable for this.

    A way of configuring this is discussed in !46 (merged)

    @kazuhiko this was the context.

    Edited by Jérome Perrin
  • Why not just pass the title via parameters, then instead of meddling with getting the field value, just:

    if title is not None:
        original_title = title
      else:
        original_title = ''
    
      temp_event.Event_setTextContentFromNotificationMessage(
       reference=notification_message,
       substitution_method_parameter_dict=dict(
         reply_body='',
         reply_subject=original_title)
       )
    
      notification_title = temp_event.getTitle().strip()
    
      # XXX this relies on formulator internals, we force the variables in request and
      # re-render the form.
      request = container.REQUEST
      request.set('your_notification_message', '')
      request.set('your_title', original_title or notification_title)
      ...

    No need for extra scripts.

Please register or sign in to reply
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>request/mass_workflow_action | nothing</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -10,7 +10,10 @@ ...@@ -10,7 +10,10 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>default</string>
<string>items</string>
<string>required</string> <string>required</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -52,6 +55,12 @@ ...@@ -52,6 +55,12 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -60,6 +69,12 @@ ...@@ -60,6 +69,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -68,6 +83,10 @@ ...@@ -68,6 +83,10 @@
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -75,13 +94,23 @@ ...@@ -75,13 +94,23 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>your_portal_type</string> </value> <value> <string>my_list_field</string> </value>
</item> </item>
<item> <item>
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewCRMFieldLibrary</string> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
...@@ -91,10 +120,40 @@ ...@@ -91,10 +120,40 @@
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string>Event Type</string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.Ticket_getPreferredFollowUpEventPortalType()</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(here.Localizer.erp5_ui.gettext(x), x) for x in here.getPortalEventTypeList()]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>here/Ticket_getEventResourceItemList</string> </value> <value> <string>python: here.Ticket_getResourceItemList(portal_type=\'Event\', include_context=False)</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>default</string>
<string>items</string> <string>items</string>
<string>required</string>
<string>title</string> <string>title</string>
</list> </list>
</value> </value>
...@@ -53,6 +55,12 @@ ...@@ -53,6 +55,12 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -64,9 +72,13 @@ ...@@ -64,9 +72,13 @@
<item> <item>
<key> <string>items</string> </key> <key> <string>items</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -82,6 +94,10 @@ ...@@ -82,6 +94,10 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_list_field</string> </value> <value> <string>my_list_field</string> </value>
...@@ -96,6 +112,10 @@ ...@@ -96,6 +112,10 @@
<list/> <list/>
</value> </value>
</item> </item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
...@@ -126,7 +146,20 @@ ...@@ -126,7 +146,20 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.Ticket_getArrowItemList()</string> </value> <value> <string>python: context.Ticket_getPreferredFollowUpEventSource()</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/Ticket_getArrowItemList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -10,13 +10,14 @@ ...@@ -10,13 +10,14 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string> <string>default_now</string>
<string>editable</string>
</list> </list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>your_keep_draft</string> </value> <value> <string>your_start_date</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -52,6 +53,10 @@ ...@@ -52,6 +53,10 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -71,22 +76,26 @@ ...@@ -71,22 +76,26 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default_now</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_checkbox</string> </value> <value> <string>my_event_start_date</string> </value>
</item> </item>
<item> <item>
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value> <value> <string>Base_viewCRMFieldLibrary</string> </value>
</item> </item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string>Keep in Draft State</string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
<string>css_class</string> <string>css_class</string>
<string>default</string> <string>default</string>
<string>editable</string> <string>editable</string>
<string>height</string> <string>enabled</string>
<string>text_editor</string>
<string>title</string> <string>title</string>
<string>width</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -63,22 +63,26 @@ ...@@ -63,22 +63,26 @@
</item> </item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>enabled</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>form_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>height</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -86,11 +90,13 @@ ...@@ -86,11 +90,13 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>text_editor</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>width</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -112,6 +118,10 @@ ...@@ -112,6 +118,10 @@
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <int>1</int> </value> <value> <int>1</int> </value>
</item> </item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_text_content</string> </value> <value> <string>my_text_content</string> </value>
...@@ -120,21 +130,17 @@ ...@@ -120,21 +130,17 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewCRMFieldLibrary</string> </value> <value> <string>Base_viewCRMFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>height</string> </key>
<value> <int>5</int> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>text_editor</string> </key>
<value> <string>Message</string> </value> <value> <string>text_area</string> </value>
</item> </item>
<item> <item>
<key> <string>width</string> </key> <key> <string>title</string> </key>
<value> <int>40</int> </value> <value> <string>Message</string> </value>
</item> </item>
</dictionary> </dictionary>
</value> </value>
...@@ -142,4 +148,43 @@ ...@@ -142,4 +148,43 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>string:</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>not: request/mass_workflow_action | nothing</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.Base_getEditorFieldPreferredTextEditor(content_type=request.get(\'your_content_type\') or context.Ticket_getPreferredFollowUpEventContentType())</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>editable</string> <string>enabled</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -52,6 +53,12 @@ ...@@ -52,6 +53,12 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -64,6 +71,10 @@ ...@@ -64,6 +71,10 @@
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -72,25 +83,42 @@ ...@@ -72,25 +83,42 @@
<value> <value>
<dictionary> <dictionary>
<item> <item>
<key> <string>editable</string> </key> <key> <string>enabled</string> </key>
<value> <int>1</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_event_title</string> </value> <value> <string>my_string_field</string> </value>
</item> </item>
<item> <item>
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewCRMFieldLibrary</string> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item> </item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string>Title</string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>not: request/mass_workflow_action | nothing</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
<string>cancel_action</string> <string>cancel_action</string>
<string>delete</string> <string>delete</string>
<string>delete_action</string> <string>delete_action</string>
<string>deliver</string>
<string>initial_deliver_action</string>
<string>initial_stop_action</string> <string>initial_stop_action</string>
<string>plan</string> <string>plan</string>
<string>plan_action</string> <string>plan_action</string>
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
<key> <string>actbox_category</string> </key> <key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value> <value> <string>workflow</string> </value>
</item> </item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>actbox_name</string> </key> <key> <string>actbox_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -46,7 +50,7 @@ ...@@ -46,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Deliver</string> </value> <value> <string>Declare as Delivered</string> </value>
</item> </item>
<item> <item>
<key> <string>trigger_type</string> </key> <key> <string>trigger_type</string> </key>
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
<key> <string>actbox_category</string> </key> <key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value> <value> <string>workflow</string> </value>
</item> </item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>actbox_name</string> </key> <key> <string>actbox_name</string> </key>
<value> <string>Deliver</string> </value> <value> <string>Deliver</string> </value>
...@@ -46,7 +50,7 @@ ...@@ -46,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Deliver Action</string> </value> <value> <string>Declare as Delivered Action</string> </value>
</item> </item>
<item> <item>
<key> <string>trigger_type</string> </key> <key> <string>trigger_type</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string>Declare as Delivered</string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string>%(content_url)s/Base_viewWorkflowActionDialog?workflow_action=initial_deliver_action</string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string>deliver</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>initial_deliver_action</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Declare as Delivered Action</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>roles</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Owner</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -322,6 +322,11 @@ ...@@ -322,6 +322,11 @@
<td>//input[@name="field_your_title"]</td>\n <td>//input[@name="field_your_title"]</td>\n
<td>ZUITE-TEST-CREATE-EVENT-EVENT-001</td>\n <td>ZUITE-TEST-CREATE-EVENT-EVENT-001</td>\n
</tr>\n </tr>\n
<tr>\n
<td>select</td>\n
<td>//select[@name="field_your_destination"]</td>\n
<td>functional_test_username</td>\n
</tr>\n
<tr>\n <tr>\n
<td>type</td>\n <td>type</td>\n
<td>//textarea[@name="field_your_text_content"]</td>\n <td>//textarea[@name="field_your_text_content"]</td>\n
...@@ -329,7 +334,7 @@ ...@@ -329,7 +334,7 @@
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>click</td>\n <td>click</td>\n
<td>//input[@name="field_your_direction" and @value="outgoing"]</td>\n <td>//input[@name="field_your_event_workflow_action" and @value="plan"]</td>\n
<td></td>\n <td></td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
......
...@@ -158,19 +158,17 @@ class TestCRM(BaseTestCRM): ...@@ -158,19 +158,17 @@ class TestCRM(BaseTestCRM):
for ptype in [x for x in self.portal.getPortalEventTypeList() if x != for ptype in [x for x in self.portal.getPortalEventTypeList() if x !=
'Acknowledgement']: 'Acknowledgement']:
# incoming # incoming
ticket.Ticket_newEvent(direction='incoming', ticket.Ticket_newEvent(portal_type=ptype,
portal_type=ptype,
title='Incoming Title', title='Incoming Title',
description='New Desc') event_workflow_action='deliver')
self.tic() self.tic()
new_event, = ticket.getFollowUpRelatedValueList(portal_type=ptype) new_event, = ticket.getFollowUpRelatedValueList(portal_type=ptype)
self.assertEqual('stopped', new_event.getSimulationState()) self.assertEqual('delivered', new_event.getSimulationState())
# outgoing # outgoing
ticket.Ticket_newEvent(direction='outgoing', ticket.Ticket_newEvent(portal_type=ptype,
portal_type=ptype, title='Outgoing Title',
title='Outgoing Title', event_workflow_action='plan')
description='New Desc')
self.tic() self.tic()
new_event, = [event for event in ticket.getFollowUpRelatedValueList(portal_type=ptype) if\ new_event, = [event for event in ticket.getFollowUpRelatedValueList(portal_type=ptype) if\
event.getTitle() == 'Outgoing Title'] event.getTitle() == 'Outgoing Title']
...@@ -183,8 +181,7 @@ class TestCRM(BaseTestCRM): ...@@ -183,8 +181,7 @@ class TestCRM(BaseTestCRM):
self.portal.event_module.manage_permission('Add portal content', [], 0) self.portal.event_module.manage_permission('Add portal content', [], 0)
ticket.Ticket_newEvent(portal_type='Letter', ticket.Ticket_newEvent(portal_type='Letter',
title='New Title', title='New Title',
description='New Desc', event_workflow_action='plan')
direction='incoming')
def checkCreateRelatedEventSelectionParamsOnPersonModule(self, direction): def checkCreateRelatedEventSelectionParamsOnPersonModule(self, direction):
# create related event from selected persons. # create related event from selected persons.
...@@ -1176,8 +1173,8 @@ class TestCRMMailSend(BaseTestCRM): ...@@ -1176,8 +1173,8 @@ class TestCRMMailSend(BaseTestCRM):
# Create a event # Create a event
ticket.Ticket_newEvent(portal_type='Mail Message', ticket.Ticket_newEvent(portal_type='Mail Message',
title='Our new product', title='Our new product',
description='Buy this now!', text_content='Buy this now!',
direction='outgoing') event_workflow_action='plan')
# Set sender and attach a document to the event. # Set sender and attach a document to the event.
event, = self.portal.event_module.objectValues() event, = self.portal.event_module.objectValues()
...@@ -1223,8 +1220,8 @@ class TestCRMMailSend(BaseTestCRM): ...@@ -1223,8 +1220,8 @@ class TestCRMMailSend(BaseTestCRM):
# Create a event # Create a event
ticket.Ticket_newEvent(portal_type='Mail Message', ticket.Ticket_newEvent(portal_type='Mail Message',
title='Our new product', title='Our new product',
description='Buy this now!', text_content='Buy this now!',
direction='outgoing') event_workflow_action='plan')
# Set sender and attach a document to the event. # Set sender and attach a document to the event.
event, = self.portal.event_module.objectValues() event, = self.portal.event_module.objectValues()
...@@ -1269,8 +1266,8 @@ class TestCRMMailSend(BaseTestCRM): ...@@ -1269,8 +1266,8 @@ class TestCRMMailSend(BaseTestCRM):
# Create a event # Create a event
ticket.Ticket_newEvent(portal_type='Mail Message', ticket.Ticket_newEvent(portal_type='Mail Message',
title='Our new product', title='Our new product',
description='Buy this now!', text_content='Buy this now!',
direction='outgoing') event_workflow_action='plan')
# Set sender and attach a document to the event. # Set sender and attach a document to the event.
event, = self.portal.event_module.objectValues() event, = self.portal.event_module.objectValues()
...@@ -1315,8 +1312,8 @@ class TestCRMMailSend(BaseTestCRM): ...@@ -1315,8 +1312,8 @@ class TestCRMMailSend(BaseTestCRM):
# Create a event # Create a event
ticket.Ticket_newEvent(portal_type='Mail Message', ticket.Ticket_newEvent(portal_type='Mail Message',
title='Our new product', title='Our new product',
description='Buy this now!', text_content='Buy this now!',
direction='outgoing') event_workflow_action='plan')
# Set sender and attach a document to the event. # Set sender and attach a document to the event.
event, = self.portal.event_module.objectValues() event, = self.portal.event_module.objectValues()
...@@ -1362,8 +1359,8 @@ class TestCRMMailSend(BaseTestCRM): ...@@ -1362,8 +1359,8 @@ class TestCRMMailSend(BaseTestCRM):
# Create a event # Create a event
ticket.Ticket_newEvent(portal_type='Mail Message', ticket.Ticket_newEvent(portal_type='Mail Message',
title='Our new product', title='Our new product',
description='Buy this now!', text_content='Buy this now!',
direction='outgoing') event_workflow_action='plan')
# Set sender and attach a document to the event. # Set sender and attach a document to the event.
event, = self.portal.event_module.objectValues() event, = self.portal.event_module.objectValues()
...@@ -1404,8 +1401,8 @@ class TestCRMMailSend(BaseTestCRM): ...@@ -1404,8 +1401,8 @@ class TestCRMMailSend(BaseTestCRM):
# Create a event # Create a event
ticket.Ticket_newEvent(portal_type='Mail Message', ticket.Ticket_newEvent(portal_type='Mail Message',
title='Our new product', title='Our new product',
description='Buy this now!', text_content='Buy this now!',
direction='incoming') event_workflow_action='deliver')
# Set sender and attach a document to the event. # Set sender and attach a document to the event.
event, = self.portal.event_module.objectValues() event, = self.portal.event_module.objectValues()
...@@ -1419,7 +1416,7 @@ class TestCRMMailSend(BaseTestCRM): ...@@ -1419,7 +1416,7 @@ class TestCRMMailSend(BaseTestCRM):
response_workflow_action='send', response_workflow_action='send',
) )
self.assertEqual(event.getSimulationState(), "stopped") self.assertEqual(event.getSimulationState(), "delivered")
# answer event must have been created # answer event must have been created
self.assertEqual(len(self.portal.event_module), 2) self.assertEqual(len(self.portal.event_module), 2)
...@@ -1460,8 +1457,8 @@ class TestCRMMailSend(BaseTestCRM): ...@@ -1460,8 +1457,8 @@ class TestCRMMailSend(BaseTestCRM):
# Create a event # Create a event
ticket.Ticket_newEvent(portal_type='Mail Message', ticket.Ticket_newEvent(portal_type='Mail Message',
title='Our new product', title='Our new product',
description='Buy this now!', text_content='Buy this now!',
direction='outgoing') event_workflow_action='plan')
# Set sender and attach a document to the event. # Set sender and attach a document to the event.
event, = self.portal.event_module.objectValues() event, = self.portal.event_module.objectValues()
...@@ -1518,8 +1515,8 @@ class TestCRMMailSend(BaseTestCRM): ...@@ -1518,8 +1515,8 @@ class TestCRMMailSend(BaseTestCRM):
# Create a event # Create a event
ticket.Ticket_newEvent(portal_type='Mail Message', ticket.Ticket_newEvent(portal_type='Mail Message',
title='Our new product', title='Our new product',
description='Buy this now!', text_content='Buy this now!',
direction='outgoing') event_workflow_action='plan')
# Set sender and attach a document to the event. # Set sender and attach a document to the event.
event, = self.portal.event_module.objectValues() event, = self.portal.event_module.objectValues()
......
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