diff --git a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Base_getEntityListFromFromHeader.xml b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Base_getEntityListFromFromHeader.xml index 4716cdb684a48f19c50f80a55b393434701351a7..43d9ceb43d236a1ecf148a03aa6cadf42a9ccba5 100644 --- a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Base_getEntityListFromFromHeader.xml +++ b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Base_getEntityListFromFromHeader.xml @@ -53,18 +53,12 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string encoding="cdata"><![CDATA[ - -getResultValue = context.portal_catalog.getResultValue\n + <value> <string>getResultValue = context.portal_catalog.getResultValue\n +\n +from Products.ERP5Type.Utils import Email_parseAddressHeader\n \n result = []\n -for recipient in text.split(\',\'):\n - if "<" in recipient:\n - recipient = recipient[recipient.find(\'<\') + 1:]\n - recipient = recipient[:recipient.find(\'>\')]\n - else:\n - # Remove extra spaces.\n - recipient = recipient.strip()\n +for name, recipient in Email_parseAddressHeader(text):\n if recipient:\n email = getResultValue(url_string={\'query\':recipient, \'key\':\'ExactMatch\'}, portal_type=\'Email\', parent_portal_type=\'Person\')\n if email is None:\n @@ -72,9 +66,7 @@ for recipient in text.split(\',\'):\n if email is not None:\n result.append(email.getParentValue())\n return result\n - - -]]></string> </value> +</string> </value> </item> <item> <key> <string>_code</string> </key> @@ -114,10 +106,12 @@ return result\n <string>_getattr_</string> <string>context</string> <string>getResultValue</string> + <string>Products.ERP5Type.Utils</string> + <string>Email_parseAddressHeader</string> <string>result</string> <string>_getiter_</string> + <string>name</string> <string>recipient</string> - <string>_getitem_</string> <string>email</string> <string>None</string> </tuple> diff --git a/bt5/erp5_crm/bt/revision b/bt5/erp5_crm/bt/revision index 7d4983b9898662edf7c4b760af9ab971404ddd74..c95da112f9eac2c30e51543dea8ec04ab0e435a9 100644 --- a/bt5/erp5_crm/bt/revision +++ b/bt5/erp5_crm/bt/revision @@ -1 +1 @@ -458 \ No newline at end of file +459 \ No newline at end of file