Commit a8fc7357 authored by Fabien Morin's avatar Fabien Morin

remove the hardcoded language 'en' to use the localizer default language

-> This is the work of François-Xavier Algrain

Add Assignee proxy role to make possible for annonymous to get the notification
document

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38732 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c8ce3408
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -71,6 +68,9 @@ valid_portal_type_list = (\'Notification Message\',)\n ...@@ -71,6 +68,9 @@ valid_portal_type_list = (\'Notification Message\',)\n
if language is None:\n if language is None:\n
language = portal.Localizer.get_selected_language()\n language = portal.Localizer.get_selected_language()\n
\n \n
# Find the default language\n
default_language = portal.Localizer.get_default_language() or \'en\'\n
\n
if validation_state is None:\n if validation_state is None:\n
validation_state = (\'validated\',)\n validation_state = (\'validated\',)\n
\n \n
...@@ -85,12 +85,12 @@ notification_message_list = portal_catalog(reference=reference,\n ...@@ -85,12 +85,12 @@ notification_message_list = portal_catalog(reference=reference,\n
group_by=(\'reference\',),\n group_by=(\'reference\',),\n
**kw)\n **kw)\n
\n \n
if len(notification_message_list) == 0 and language != \'en\':\n if len(notification_message_list) == 0 and language != default_language:\n
# Search again with English as a fallback.\n # Search again with English as a fallback.\n
notification_message_list = portal_catalog(reference=reference,\n notification_message_list = portal_catalog(reference=reference,\n
portal_type=valid_portal_type_list,\n portal_type=valid_portal_type_list,\n
validation_state=validation_state,\n validation_state=validation_state,\n
language=\'en\',\n language=default_language,\n
sort_on=[(\'version\', \'descending\')],\n sort_on=[(\'version\', \'descending\')],\n
group_by=(\'reference\',),\n group_by=(\'reference\',),\n
**kw)\n **kw)\n
...@@ -129,7 +129,9 @@ return notification_message\n ...@@ -129,7 +129,9 @@ return notification_message\n
<item> <item>
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</string> </key>
<value> <value>
<tuple/> <tuple>
<string>Assignee</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -166,6 +168,7 @@ return notification_message\n ...@@ -166,6 +168,7 @@ return notification_message\n
<string>portal_catalog</string> <string>portal_catalog</string>
<string>valid_portal_type_list</string> <string>valid_portal_type_list</string>
<string>None</string> <string>None</string>
<string>default_language</string>
<string>_apply_</string> <string>_apply_</string>
<string>notification_message_list</string> <string>notification_message_list</string>
<string>len</string> <string>len</string>
......
863 864
\ No newline at end of file \ 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