[Erp5-report] r17881 - in /erp5/trunk/bt5/erp5_crm: SkinTemplateItem/portal_skins/erp5_crm/...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Nov 28 17:21:48 CET 2007


Author: jerome
Date: Wed Nov 28 17:21:47 2007
New Revision: 17881

URL: http://svn.erp5.org?rev=17881&view=rev
Log:
Before calling catalog in Event_getPropertyDictFromContent, check we have a reference to search against, otherwise we'll get the first campaign or ticket.
( update comment about non catalogued email addresses )

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

Modified: erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getPropertyDictFromContent.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getPropertyDictFromContent.xml?rev=17881&r1=17880&r2=17881&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getPropertyDictFromContent.xml (original)
+++ erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getPropertyDictFromContent.xml Wed Nov 28 17:21:47 2007
@@ -81,6 +81,8 @@
     Event_finishIngestion)\n
 """\n
 \n
+getResultValue = context.getPortalObject().portal_catalog.getResultValue\n
+\n
 def getPersonList(information_text):\n
   result = []\n
   for recipient in information_text.split(\',\'):\n
@@ -88,7 +90,7 @@
       recipient = recipient[recipient.find(\'<\') + 1:]\n
       recipient = recipient[:recipient.find(\'>\')]\n
     if recipient:\n
-      email = context.portal_catalog.getResultValue(url_string=recipient, portal_type="Email")\n
+      email = getResultValue(url_string=recipient, portal_type="Email")\n
       if email is not None:\n
         result.append(email.getParentValue().getRelativeUrl())\n
   return result\n
@@ -102,20 +104,27 @@
 reference_search_list = []\n
 text_search_list = []\n
 for text, prop_dict in context.getSearchableReferenceList():\n
-  if text: text_search_list.append(text)\n
-  if prop_dict.has_key(\'reference\'): reference_search_list.append(prop_dict[\'reference\'])\n
+  if text:\n
+    text_search_list.append(text)\n
+  if prop_dict.has_key(\'reference\'):\n
+    reference_search_list.append(prop_dict[\'reference\'])\n
 \n
 # Search reference ticket or project\n
 follow_up_type_list = context.getPortalProjectTypeList() + context.getPortalTicketTypeList()\n
-follow_up = context.portal_catalog.getResultValue(reference=reference_search_list, portal_type=follow_up_type_list)\n
-if follow_up is None:\n
-  follow_up = context.portal_catalog.getResultValue(reference=text_search_list, portal_type=follow_up_type_list)\n
+follow_up = None\n
+if reference_search_list:\n
+  follow_up = getResultValue(reference=reference_search_list, portal_type=follow_up_type_list)\n
+if follow_up is None and text_search_list:\n
+  follow_up = getResultValue(reference=text_search_list, portal_type=follow_up_type_list)\n
 \n
 # Build dict.\n
 result = {}\n
-if sender_list: result[\'source_list\'] = sender_list\n
-if to_list or cc_list: result[\'destination_list\'] = to_list + cc_list\n
-if follow_up is not None: result[\'follow_up\'] = follow_up.getRelativeUrl()\n
+if sender_list:\n
+  result[\'source_list\'] = sender_list\n
+if to_list or cc_list:\n
+  result[\'destination_list\'] = to_list + cc_list\n
+if follow_up is not None:\n
+  result[\'follow_up\'] = follow_up.getRelativeUrl()\n
 \n
 return result\n
 
@@ -168,9 +177,10 @@
                         <key> <string>co_varnames</string> </key>
                         <value>
                           <tuple>
-                            <string>getPersonList</string>
                             <string>_getattr_</string>
                             <string>context</string>
+                            <string>getResultValue</string>
+                            <string>getPersonList</string>
                             <string>content_information</string>
                             <string>sender_list</string>
                             <string>to_list</string>
@@ -182,8 +192,8 @@
                             <string>prop_dict</string>
                             <string>_getitem_</string>
                             <string>follow_up_type_list</string>
+                            <string>None</string>
                             <string>follow_up</string>
-                            <string>None</string>
                             <string>result</string>
                             <string>_write_</string>
                           </tuple>

Modified: erp5/trunk/bt5/erp5_crm/bt/comment
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/bt/comment?rev=17881&r1=17880&r2=17881&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_crm/bt/comment (original)
+++ erp5/trunk/bt5/erp5_crm/bt/comment Wed Nov 28 17:21:47 2007
@@ -1,1 +1,1 @@
-FIXME: email address are not catalogged, so the CMFMailIn doesn't work
+FIXME: email address are not catalogged, so the CMFMailIn doesn't work. ( for now you have to install erp5_dms)

Modified: erp5/trunk/bt5/erp5_crm/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/bt/revision?rev=17881&r1=17880&r2=17881&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_crm/bt/revision (original)
+++ erp5/trunk/bt5/erp5_crm/bt/revision Wed Nov 28 17:21:47 2007
@@ -1,1 +1,1 @@
-124
+125




More information about the Erp5-report mailing list