Commit 462d0f7c authored by Bartek Górny's avatar Bartek Górny

improved preference storage (advice by Jerome)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10327 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 59b1daa3
...@@ -69,6 +69,8 @@ ...@@ -69,6 +69,8 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>pref=context.portal_preferences.getPreferredDmsIngestEmailNotification()\n <value> <string>pref=context.portal_preferences.getPreferredDmsIngestEmailNotification()\n
if len(pref)==0:return\n
pref=pref[0]\n
if pref==\'never\':return\n if pref==\'never\':return\n
\n \n
subjecttpl=\'ingested %(name)s\'\n subjecttpl=\'ingested %(name)s\'\n
...@@ -129,9 +131,10 @@ context.MailHost.send(msg,mto,mfro,subject)\n ...@@ -129,9 +131,10 @@ context.MailHost.send(msg,mto,mfro,subject)\n
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>pref</string> <string>pref</string>
<string>len</string>
<string>_getitem_</string>
<string>subjecttpl</string> <string>subjecttpl</string>
<string>msgtpl</string> <string>msgtpl</string>
<string>_getitem_</string>
<string>ob</string> <string>ob</string>
<string>subject</string> <string>subject</string>
<string>msg</string> <string>msg</string>
......
178 187
\ No newline at end of file \ No newline at end of file
...@@ -63,9 +63,15 @@ class DMSPreference: ...@@ -63,9 +63,15 @@ class DMSPreference:
'mode' : '' }, 'mode' : '' },
{ 'id' : 'preferred_dms_ingest_email_notification', { 'id' : 'preferred_dms_ingest_email_notification',
'description' : 'None - always, "always", "problem (only if problem), "never"', 'description' : 'None - always, "always", "problem (only if problem), "never"',
'type' : 'string', # is it possible to use int in radio? 'type' : 'selection',
'select_variable':'getDmsIngestEmailNotificationSelectionList',
'preference':1, 'preference':1,
'mode' : '' }, 'mode' : '' },
{'id' : 'dms_ingest_email_notification_selection',
'description' : 'possible values for preferred_dms_ingest_email_notification',
'type':'lines',
'default':['always','problem','never'],
'mode':'w'},
) )
......
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