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.
<?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 | |||
|
|||
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> |
... | @@ -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> | ||
|
|||
</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> | ||
... | ... |