Commit 78c3695f authored by Yoshinori Okuji's avatar Yoshinori Okuji

Fix a mistake in specifing languages ('en') -> ('en',).

Rewrite local_pt.
Fix the creation of UserFolderWithGroups.
Override setupPermissions.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1400 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8fbcdc8d
...@@ -193,7 +193,7 @@ class ERP5Site ( CMFSite, FolderMixIn ): ...@@ -193,7 +193,7 @@ class ERP5Site ( CMFSite, FolderMixIn ):
for key in workflow_title_list: for key in workflow_title_list:
sorted_global_actions.append({'title': key, 'disabled': 1}) sorted_global_actions.append({'title': key, 'disabled': 1})
sorted_global_actions.extend(sorted_workflow_actions[key]) sorted_global_actions.extend(sorted_workflow_actions[key])
sorted_global_actions.append({'title': 'Other', 'disabled': 1}) sorted_global_actions.append({'title': 'Others', 'disabled': 1})
sorted_global_actions.extend(other_global_actions) sorted_global_actions.extend(other_global_actions)
return sorted_global_actions return sorted_global_actions
...@@ -310,9 +310,9 @@ class ERP5Generator(PortalGenerator): ...@@ -310,9 +310,9 @@ class ERP5Generator(PortalGenerator):
addLocalizer('', ('en',)) addLocalizer('', ('en',))
localizer = getToolByName(p, 'Localizer') localizer = getToolByName(p, 'Localizer')
addMessageCatalog = localizer.manage_addProduct['Localizer'].manage_addMessageCatalog addMessageCatalog = localizer.manage_addProduct['Localizer'].manage_addMessageCatalog
addMessageCatalog('default', 'ERP5 Localized Messages', ('en')) addMessageCatalog('default', 'ERP5 Localized Messages', ('en',))
addMessageCatalog('erp5_ui', 'ERP5 Localized Interface', ('en')) addMessageCatalog('erp5_ui', 'ERP5 Localized Interface', ('en',))
addMessageCatalog('erp5_content', 'ERP5 Localized Content', ('en')) addMessageCatalog('erp5_content', 'ERP5 Localized Content', ('en',))
# Add Translation Service # Add Translation Service
p.manage_addProduct['TranslationService'].addPlacefulTranslationService('translation_service') p.manage_addProduct['TranslationService'].addPlacefulTranslationService('translation_service')
...@@ -333,34 +333,45 @@ class ERP5Generator(PortalGenerator): ...@@ -333,34 +333,45 @@ class ERP5Generator(PortalGenerator):
# 'index_html', 'Member list', '<dtml-return roster>') # 'index_html', 'Member list', '<dtml-return roster>')
def setupFrontPage(self, p): def setupFrontPage(self, p):
text = """<span metal:define-macro="body"> text = """<span metal:define-macro="body">
<span tal:condition="python: not here.portal_membership.isAnonymousUser()">
<br/> <span tal:condition="python: not here.portal_membership.isAnonymousUser()">
<br/> <br/>
<br/> <br/>
<br/> <br/>
<h3 align=center>Welcome to your new information system</h3> <br/>
<table border=1 align=center> <h2 align="center" i18n:translate="" i18n:domain="content">
<tr tal:define="module_list python:here.objectValues('ERP5 Folder'); Welcome to your new information system
dummy python:module_list.sort(lambda x,y: cmp(x.getTitle(), y.getTitle())); </h2>
module_len python:len(module_list); <table border="1" align="center">
col_size python:16; <tr tal:define="module_list python:here.ERP5Site_getModuleItemList();
col_len python:module_len / col_size"> module_len python:len(module_list);
<td> col_size python:16;
<img src="erp5_logo.png" alt="ERP5 Logo" /> col_len python:(module_len + col_size) / col_size">
</td> <td>
<td tal:repeat="col_no python:range(col_len)" valign="top" class="ModuleShortcut"> <img src="erp5_logo.png" alt="ERP5 Logo" />
<p tal:repeat="module python:module_list[col_size*col_no:min(col_size*(col_no+1),module_len)] "><a href="composant" </td>
tal:content="module/title" <tal:block tal:repeat="col_no python:range(col_len)">
tal:attributes="href module/id">Composants</a></p> <td valign="top" class="ModuleShortcut">
</td> <tal:block tal:repeat="module python:module_list[col_size*col_no:min(col_size*(col_no+1),module_len)] ">
</tr> <p>
</table> <a href="person"
tal:content="python: module[1]"
tal:attributes="href python: module[0]">
Person
</a>
</p>
</tal:block>
</td>
</tal:block>
</tr>
</table>
</span>
<span tal:condition="python: here.portal_membership.isAnonymousUser()">
<p tal:define="dummy python:request.RESPONSE.redirect('%s/login_form' % here.absolute_url())"/>
</span>
</span>
<span tal:condition="python: here.portal_membership.isAnonymousUser()">
<p tal:define="dummy python:request.RESPONSE.redirect('%s/login_form' % here.absolute_url())"/>
</span>
</span> </span>
""" """
p.manage_addProduct['PageTemplates'].manage_addPageTemplate( p.manage_addProduct['PageTemplates'].manage_addPageTemplate(
...@@ -409,11 +420,42 @@ class ERP5Generator(PortalGenerator): ...@@ -409,11 +420,42 @@ class ERP5Generator(PortalGenerator):
def setupUserFolder(self, p): def setupUserFolder(self, p):
try: try:
# Use NuxUserGroups instead of the standard acl_users. # Use NuxUserGroups instead of the standard acl_users.
p.manage_addProduct['NuxUserGroups'].manage_addUserFolderWithGroups() p.manage_addProduct['NuxUserGroups'].addUserFolderWithGroups()
except: except:
# No way. # No way.
PortalGenerator.setupUserFolder(self, p) PortalGenerator.setupUserFolder(self, p)
def setupPermissions(self, p):
permission_dict = {
'Access Transient Objects' : ('Manager', 'Anonymous'),
'Access contents information' : ('Manager', 'Member', 'Anonymous'),
'Access future portal content' : ('Manager', 'Reviewer'),
'Access session data' : ('Manager', 'Anonymous'),
'AccessContentsInformation' : ('Manager', 'Member'),
'Add portal content' : ('Manager', 'Owner'),
'Add portal folders' : ('Manager', 'Owner'),
'Delete objects' : ('Manager', 'Owner'),
'FTP access' : ('Manager', 'Owner'),
'List folder contents' : ('Manager', 'Member'),
'List portal members' : ('Manager', 'Member'),
'List undoable changes' : ('Manager', 'Member'),
'Manage properties' : ('Manager', 'Owner'),
'Modify portal content' : ('Manager', 'Owner'),
'Reply to item' : ('Manager', 'Member'),
'Review portal content' : ('Manager', 'Reviewer'),
'Search ZCatalog' : ('Manager', 'Member'),
'Set own password' : ('Manager', 'Member'),
'Set own properties' : ('Manager', 'Member'),
'Undo changes' : ('Manager', 'Owner'),
'View' : ('Manager', 'Member', 'Owner', 'Anonymous'),
'View management screens' : ('Manager', 'Owner')
}
for permission in p.ac_inherited_permissions(1):
name = permission[0]
role_list = permission_dict.get(name, ('Manager',))
p.manage_permission(name, roles=role_list, acquire=0)
def setup(self, p, create_userfolder): def setup(self, p, create_userfolder):
self.setupTools(p) self.setupTools(p)
self.setupMailHost(p) self.setupMailHost(p)
......
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