Commit 61e73e83 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

respect user's input for source or destionation in Base_addEvent.

before, user's input is completely ignored and calculated good values
are automatically set. and the commit fc54fbaa somehow tried to
respect user's source input, but it caused worse result for incoming
case. so this commit reverts fc54fbaa and set source and destination
just as user's input if not empty.
parent 20362ede
...@@ -67,9 +67,8 @@ portal_entity_type_list = portal.getPortalEntityTypeList()\n ...@@ -67,9 +67,8 @@ portal_entity_type_list = portal.getPortalEntityTypeList()\n
logged_in_user_value = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n logged_in_user_value = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
start_date = DateTime()\n start_date = DateTime()\n
\n \n
person = source\n
organisation = None\n organisation = None\n
if logged_in_user_value is not None and person is None:\n if logged_in_user_value is not None:\n
person = logged_in_user_value.getRelativeUrl()\n person = logged_in_user_value.getRelativeUrl()\n
organisation = logged_in_user_value.getSubordination()\n organisation = logged_in_user_value.getSubordination()\n
\n \n
...@@ -85,15 +84,18 @@ if context.getPortalType() in portal_entity_type_list:\n ...@@ -85,15 +84,18 @@ if context.getPortalType() in portal_entity_type_list:\n
else:\n else:\n
follow_up = context.getRelativeUrl()\n follow_up = context.getRelativeUrl()\n
\n \n
# XXX if source or destination is explicitcy choosen, what should be\n
# source_section or destination_section ???\n
\n
if direction == \'outgoing\':\n if direction == \'outgoing\':\n
source_url = person\n source_url = source or person\n
source_section_url = organisation\n source_section_url = organisation\n
destination_url = person_relative_url or organisation_relative_url\n destination_url = destination or person_relative_url or organisation_relative_url\n
destination_section_url = organisation_relative_url\n destination_section_url = organisation_relative_url\n
elif direction == \'incoming\':\n elif direction == \'incoming\':\n
source_url = person_relative_url or organisation_relative_url\n source_url = source or person_relative_url or organisation_relative_url\n
source_section_url = organisation_relative_url\n source_section_url = organisation_relative_url\n
destination_url = person\n destination_url = destination or person\n
destination_section_url = organisation\n destination_section_url = organisation\n
else:\n else:\n
raise NotImplementedError, \'The specified direction is not handled: %r\' % (direction,)\n raise NotImplementedError, \'The specified direction is not handled: %r\' % (direction,)\n
...@@ -139,7 +141,7 @@ event.Base_redirect(keep_items={\'portal_status_message\': message})\n ...@@ -139,7 +141,7 @@ event.Base_redirect(keep_items={\'portal_status_message\': message})\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>title, direction, portal_type, resource, text_content=None, notification_message=None, batch_mode=False, keep_draft=False, follow_up=None, source=None, **kw</string> </value> <value> <string>title, direction, portal_type, resource, text_content=None, notification_message=None, batch_mode=False, keep_draft=False, follow_up=None, source=None, destination=None, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
657 658
\ 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