Commit 31398c34 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

a bit cleanup of the code.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26091 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fe3e0833
...@@ -41,6 +41,7 @@ from Acquisition import aq_inner ...@@ -41,6 +41,7 @@ from Acquisition import aq_inner
from Acquisition import aq_parent from Acquisition import aq_parent
from Acquisition import aq_self from Acquisition import aq_self
from AccessControl import ModuleSecurityInfo
from AccessControl.SecurityInfo import allow_class from AccessControl.SecurityInfo import allow_class
from Products.CMFCore import utils from Products.CMFCore import utils
...@@ -276,7 +277,7 @@ def int2letters(i): ...@@ -276,7 +277,7 @@ def int2letters(i):
#Get message id for translation #Get message id for translation
def getMessageIdWithContext(msg_id, context, context_id): def getMessageIdWithContext(msg_id, context, context_id):
return '%s [%s in %s]' % (msg_id,context,context_id) return '%s [%s in %s]' % (msg_id, context, context_id)
#Get translation of msg id #Get translation of msg id
def getTranslationStringWithContext(self, msg_id, context, context_id): def getTranslationStringWithContext(self, msg_id, context, context_id):
...@@ -284,16 +285,15 @@ def getTranslationStringWithContext(self, msg_id, context, context_id): ...@@ -284,16 +285,15 @@ def getTranslationStringWithContext(self, msg_id, context, context_id):
portal_workflow = portal.portal_workflow portal_workflow = portal.portal_workflow
localizer = portal.Localizer localizer = portal.Localizer
selected_language = localizer.get_selected_language() selected_language = localizer.get_selected_language()
msg_id_context = getMessageIdWithContext(msg_id,context, context_id) msg_id_context = getMessageIdWithContext(msg_id, context, context_id)
result = localizer.erp5_ui.gettext( result = localizer.erp5_ui.gettext(
msg_id_context,default='') msg_id_context, default='')
if result == '': if result == '':
result = localizer.erp5_ui.gettext(msg_id) result = localizer.erp5_ui.gettext(msg_id)
return result.encode('utf8') return result.encode('utf8')
from AccessControl import ModuleSecurityInfo
ModuleSecurityInfo('Products.ERP5Type.Utils').declarePublic( ModuleSecurityInfo('Products.ERP5Type.Utils').declarePublic(
'getMessageIdForWorkflowState','getTranslationStringWithContext', 'getMessageIdWithContext', 'getTranslationStringWithContext')
'getMessageIdWithContext' )
##################################################### #####################################################
# Globals initialization # Globals initialization
...@@ -801,7 +801,6 @@ def importLocalDocument(class_id, document_path = None): ...@@ -801,7 +801,6 @@ def importLocalDocument(class_id, document_path = None):
setattr(Products.ERP5Type.Document, document_constructor_name, setattr(Products.ERP5Type.Document, document_constructor_name,
document_constructor) document_constructor)
setDefaultClassProperties(document_class) setDefaultClassProperties(document_class)
from AccessControl import ModuleSecurityInfo
ModuleSecurityInfo('Products.ERP5Type.Document').declareProtected( ModuleSecurityInfo('Products.ERP5Type.Document').declareProtected(
Permissions.AddPortalContent, document_constructor_name,) Permissions.AddPortalContent, document_constructor_name,)
InitializeClass(document_class) InitializeClass(document_class)
......
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