[Erp5-report] r43725 nicolas - in /erp5/trunk/bt5/erp5_crm: SkinTemplateItem/portal_skins/e...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Feb 25 10:57:26 CET 2011


Author: nicolas
Date: Fri Feb 25 10:57:25 2011
New Revision: 43725

URL: http://svn.erp5.org?rev=43725&view=rev
Log:
Avoid unnecessary Acquisitions lookup
remove empty values in edit_kw

Modified:
    erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Entity_addEvent.xml
    erp5/trunk/bt5/erp5_crm/bt/revision

Modified: erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Entity_addEvent.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Entity_addEvent.xml?rev=43725&r1=43724&r2=43725&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Entity_addEvent.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Entity_addEvent.xml [utf8] Fri Feb 25 10:57:25 2011
@@ -52,20 +52,18 @@
             <key> <string>_body</string> </key>
             <value> <string>from DateTime import DateTime\n
 from AccessControl import getSecurityManager\n
+portal = context.getPortalObject()\n
 \n
 # Search current user ID\n
 user_id = getSecurityManager().getUser().getId()\n
 source = None\n
 person_subordination = None\n
-for person in context.portal_catalog(reference=user_id, portal_type=\'Person\'):\n
+for person in portal.portal_catalog(reference=user_id, portal_type=\'Person\'):\n
   source = person.getRelativeUrl()\n
   person_subordination = person.getSubordination()\n
   break\n
 \n
-follow_up_url = None\n
 start_date = DateTime()\n
-stop_date = None\n
-causality = None\n
 destination = context.getRelativeUrl()\n
 \n
 if direction == \'out\':\n
@@ -85,7 +83,7 @@ elif direction == \'in\':\n
   destination_url = source\n
   destination_section_url = person_subordination\n
 else:\n
-  raise KeyError, \'Direction Specified not handling: %s\' % direction\n
+  raise NotImplementedError, \'The specified direction is not handled: %r\' % (direction,)\n
 \n
 event_kw = {}\n
 event_kw[\'portal_type\'] = portal_type\n
@@ -95,16 +93,13 @@ event_kw[\'source\'] = source_url\n
 event_kw[\'source_section\'] = source_section_url\n
 event_kw[\'destination\'] = destination_url\n
 event_kw[\'destination_section\'] = destination_section_url\n
-event_kw[\'follow_up\'] = follow_up_url\n
 event_kw[\'start_date\'] = start_date\n
-event_kw[\'stop_date\'] = stop_date\n
-event_kw[\'causality\'] = causality\n
 \n
 # Create event\n
-module = context.getDefaultModule(portal_type=portal_type)\n
+module = portal.getDefaultModule(portal_type=portal_type)\n
 event = module.newContent(**event_kw)\n
 \n
-message = context.Base_translateString(\'New event created.\')\n
+message = portal.Base_translateString(\'New event created.\')\n
 \n
 event.Base_redirect(keep_items={\'portal_status_message\': message})\n
 </string> </value>

Modified: erp5/trunk/bt5/erp5_crm/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/bt/revision?rev=43725&r1=43724&r2=43725&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_crm/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_crm/bt/revision [utf8] Fri Feb 25 10:57:25 2011
@@ -1 +1 @@
-522
\ No newline at end of file
+523
\ No newline at end of file



More information about the Erp5-report mailing list