Commit f11b1a2a authored by Jérome Perrin's avatar Jérome Perrin Committed by Gabriel Monnerat

CRM: put a confirmation dialog in clone ticket and event.

And use searchAndActivate instead of cloning all events in current transaction
parent 1105f030
......@@ -30,7 +30,9 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
......@@ -71,7 +73,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Ticket_cloneTicketAndEventList</string> </value>
<value> <string>string:${object_url}/Ticket_viewCloneTicketAndEventListDialog</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -30,7 +30,9 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
......@@ -71,7 +73,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Ticket_cloneTicketAndEventList</string> </value>
<value> <string>string:${object_url}/Ticket_viewCloneTicketAndEventListDialog</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -30,7 +30,9 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
......@@ -71,7 +73,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Ticket_cloneTicketAndEventList</string> </value>
<value> <string>string:${object_url}/Ticket_viewCloneTicketAndEventListDialog</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -73,7 +73,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Ticket_cloneTicketAndEventList</string> </value>
<value> <string>string:${object_url}/Ticket_viewCloneTicketAndEventListDialog</string> </value>
</item>
</dictionary>
</pickle>
......
<?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>event = context.Base_createCloneDocument(batch_mode=True)\n
event.setFollowUp(follow_up_relative_url)\n
return event\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>follow_up_relative_url</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Event_clone</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -51,24 +51,23 @@
<item>
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
event_list = context.getFollowUpRelatedValueList(portal_type=portal.getPortalEventTypeList(), checked_permission=\'View\')\n
\n
new_ticket = context.Base_createCloneDocument(form_id=None, batch_mode=True)\n
\n
new_ticket = context.Base_createCloneDocument(form_id=None, clone=1, batch_mode=1)\n
new_ticket_url = new_ticket.getRelativeUrl()\n
portal.portal_catalog.searchAndActivate(\n
portal_type=portal.getPortalEventTypeList(),\n
default_follow_up_uid=context.getUid(),\n
method_id=\'Event_clone\',\n
method_kw=dict(follow_up_relative_url=new_ticket.getRelativeUrl()))\n
\n
for event in event_list:\n
new_event = event.Base_createCloneDocument(form_id=None, clone=1, batch_mode=1)\n
new_event.setFollowUp(new_ticket_url)\n
\n
portal_status_message = context.Base_translateString(\'Ticket and events are cloned.\')\n
portal_status_message = portal.Base_translateString(\'Events are beeing cloned in the background.\')\n
keep_items = {\'portal_status_message\':portal_status_message}\n
new_ticket.Base_redirect(form_id=\'view\', keep_items=keep_items)\n
new_ticket.Base_redirect(form_id=form_id, keep_items=keep_items)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>form_id=\'\'</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
</pickle>
<pickle>
<dictionary>
<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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Ticket_cloneTicketAndEventList</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Ticket_viewCloneTicketAndEventListDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Ticket_viewNewEventDialog</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Clone Ticket and Events</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </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