Commit a7a06aa3 authored by Gabriel Monnerat's avatar Gabriel Monnerat

move code to BusinessConfiguration_afterUNGConfiguration because this code is...

move code to BusinessConfiguration_afterUNGConfiguration because this code is to configure the UNG Web Site

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44703 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 37a8fb3e
...@@ -56,9 +56,25 @@ from AccessControl import getSecurityManager\n ...@@ -56,9 +56,25 @@ from AccessControl import getSecurityManager\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
portal_preferences = portal.portal_preferences\n portal_preferences = portal.portal_preferences\n
business_template = context.getSpecialiseValue()\n business_template = context.getSpecialiseValue()\n
N_ = context.Base_translateString\n
isTransitionPossible = portal.portal_workflow.isTransitionPossible\n isTransitionPossible = portal.portal_workflow.isTransitionPossible\n
\n \n
# enable erp5 preference\n
ung_preference = getattr(portal.portal_preferences, \'ung_preference\', None)\n
if ung_preference is not None and isTransitionPossible(ung_preference, \'enable\'):\n
ung_preference.enable()\n
\n
# publish the ung web site\n
ung_web_site = getattr(portal.web_site_module, \'ung\', None)\n
if ung_web_site is not None and isTransitionPossible(ung_web_site, \'publish\', None):\n
ung_web_site.publish()\n
\n
language = context.getGlobalConfigurationAttr("default_available_language")\n
context.log(language)\n
ung_web_site.setDefaultAvailableLanguage(language)\n
for web_section in ung_web_site.contentValues(portal_types=\'Web Section\'):\n
if isTransitionPossible(web_section, \'publish\', None):\n
web_section.publish()\n
\n
if business_template is not None:\n if business_template is not None:\n
# update role settings for modules which exists already\n # update role settings for modules which exists already\n
for portal_type in business_template.getTemplatePortalTypeRolesList():\n for portal_type in business_template.getTemplatePortalTypeRolesList():\n
......
...@@ -50,25 +50,8 @@ ...@@ -50,25 +50,8 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>context.log(kw)\n <value> <string>default_available_language = kw.get("default_available_language", "en")\n
portal = context.getPortalObject()\n context.setGlobalConfigurationAttr(default_available_language=default_available_language)\n
isTransitionPossible = portal.portal_workflow.isTransitionPossible\n
\n
# enable erp5 preference\n
ung_preference = getattr(portal.portal_preferences, \'ung_preference\', None)\n
if ung_preference is not None and isTransitionPossible(ung_preference, \'enable\'):\n
ung_preference.enable()\n
\n
# publish the ung web site\n
ung_web_site = getattr(portal.web_site_module, \'ung\', None)\n
if ung_web_site is not None and isTransitionPossible(ung_web_site, \'publish\', None):\n
ung_web_site.publish()\n
\n
language = kw.get("default_available_language", "en")\n
ung_web_site.setDefaultAvailableLanguage(language)\n
for web_section in ung_web_site.contentValues(portal_types=\'Web Section\'):\n
if isTransitionPossible(web_section, \'publish\', None):\n
web_section.publish()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
13 14
\ 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