Commit 3270183e authored by Sebastien Robin's avatar Sebastien Robin

erp5_crm: add batch_mode to PersonModule_newEvent to allow calls from another script

parent 7b740018
......@@ -68,6 +68,7 @@ if not person_list:\n
user = context.portal_membership.getAuthenticatedMember()\n
user_person = context.portal_catalog.getResultValue(portal_type=\'Person\', reference=str(user))\n
\n
event_list = []\n
# For every person, create an event\n
if not single_event:\n
count = 0\n
......@@ -88,6 +89,7 @@ if not single_event:\n
event.setDestinationValue(person.getObject())\n
event.setSourceValue(user_person)\n
event.plan()\n
event_list.append(event)\n
else:\n
if direction == \'incoming\' and len(person_list) > 1:\n
# This case is not possible\n
......@@ -104,6 +106,10 @@ else:\n
event.setSourceValue(user_person)\n
event.plan()\n
count = 1\n
event_list.append(event)\n
\n
if batch_mode:\n
return event_list\n
\n
portal_status_message = translateString("Created and associated ${count} new events to the selected ticket.", \n
mapping=dict(count=count))\n
......@@ -115,7 +121,7 @@ context.Base_redirect(form_id, keep_items = dict(portal_status_message=portal_st
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>portal_type, title, description, direction, selection_name, follow_up=None, single_event=0, text_content=None, form_id=None, **kw</string> </value>
<value> <string>portal_type, title, description, direction, selection_name, follow_up=None, single_event=0, text_content=None, form_id=None, batch_mode=0, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
662
\ No newline at end of file
663
\ 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