diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_notifyByEmail.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_notifyByEmail.xml index 618ddd897ecb4a5dc59cd70f8a3414ae60c4d7cf..901abe0582f8ad3d3706c2b15158a06e2013d8c8 100644 --- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_notifyByEmail.xml +++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_notifyByEmail.xml @@ -69,6 +69,8 @@ <item> <key> <string>_body</string> </key> <value> <string>pref=context.portal_preferences.getPreferredDmsIngestEmailNotification()\n +if len(pref)==0:return\n +pref=pref[0]\n if pref==\'never\':return\n \n subjecttpl=\'ingested %(name)s\'\n @@ -129,9 +131,10 @@ context.MailHost.send(msg,mto,mfro,subject)\n <string>_getattr_</string> <string>context</string> <string>pref</string> + <string>len</string> + <string>_getitem_</string> <string>subjecttpl</string> <string>msgtpl</string> - <string>_getitem_</string> <string>ob</string> <string>subject</string> <string>msg</string> diff --git a/bt5/erp5_dms/bt/revision b/bt5/erp5_dms/bt/revision index 6fc1e6e18c45e38dba6c96fe27ed3514edfbb064..e3e1916cf59ce0dff1e15c2e837a89ff67d9e40d 100644 --- a/bt5/erp5_dms/bt/revision +++ b/bt5/erp5_dms/bt/revision @@ -1 +1 @@ -178 \ No newline at end of file +187 \ No newline at end of file diff --git a/product/ERP5/PropertySheet/DMSPreference.py b/product/ERP5/PropertySheet/DMSPreference.py index d13deb787d3987d1ba1ce669c72c9fb75abbed88..4cbadf05f0fc5132d61997b2884f8357306f23d4 100644 --- a/product/ERP5/PropertySheet/DMSPreference.py +++ b/product/ERP5/PropertySheet/DMSPreference.py @@ -63,9 +63,15 @@ class DMSPreference: 'mode' : '' }, { 'id' : 'preferred_dms_ingest_email_notification', '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, 'mode' : '' }, + {'id' : 'dms_ingest_email_notification_selection', + 'description' : 'possible values for preferred_dms_ingest_email_notification', + 'type':'lines', + 'default':['always','problem','never'], + 'mode':'w'}, )