Commit e3999c18 authored by Łukasz Nowak's avatar Łukasz Nowak

slapos_crm: Introduce action to reply and assign to user

parent 14c39681
ticket = sci['object']
kw = sci['kwargs']
event = ticket.Ticket_getCausalityValue()
event.Event_createResponse(
response_event_portal_type=kw['response_event_portal_type'],
response_event_resource=kw['response_event_resource'],
response_event_title=kw.get('response_event_title'),
response_event_text_content=kw.get('response_event_text_content'),
response_event_start_date=kw['response_event_start_date'],
response_workflow_action=kw['response_workflow_action'],
response_event_notification_message=kw['response_event_notification_message'],
default_destination=kw['default_destination'],
response_event_content_type=kw['response_event_content_type'])
ticket.suspend()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Script" module="erp5.portal_type"/>
</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>_params</string> </key>
<value> <string>sci</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_createResponseAndSuspend</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Script</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -17,6 +17,7 @@
<value>
<tuple>
<string>destination/portal_workflow/ticket_workflow/transition_create_response_and_invalidate_action</string>
<string>destination/portal_workflow/ticket_workflow/transition_create_response_and_suspend_action</string>
<string>destination/portal_workflow/ticket_workflow/transition_invalidate</string>
<string>destination/portal_workflow/ticket_workflow/transition_invalidate_action</string>
<string>destination/portal_workflow/ticket_workflow/transition_suspend</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Transition" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>%(content_url)s/Ticket_viewCreateResponseWorkflowActionDialog?workflow_action=create_response_and_suspend_action</string> </value>
</item>
<item>
<key> <string>action_name</string> </key>
<value> <string>Create Response and Assign to User</string> </value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/workflow</string>
<string>before_script/portal_workflow/ticket_workflow/script_checkConsistency</string>
<string>after_script/portal_workflow/ticket_workflow/script_createResponseAndInvalidate</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Create an response and mark the ticket as suspended in the same time.</string> </value>
</item>
<item>
<key> <string>guard_expression</string> </key>
<value> <string>python: here.Ticket_getCausalityValue() is not None</string> </value>
</item>
<item>
<key> <string>guard_group</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>guard_permission</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>guard_role</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
</tuple>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>transition_create_response_and_suspend_action</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Transition</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Create Response and Assign to User Action</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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