Commit 97f6df3e authored by Rafael Monnerat's avatar Rafael Monnerat

Enable preferences.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45022 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f82ee82f
......@@ -55,25 +55,32 @@ from AccessControl import getSecurityManager\n
from Products.ERP5Type.Log import log\n
\n
portal = context.getPortalObject()\n
portal_preferences = portal.portal_preferences\n
bt = context.portal_templates.getInstalledBusinessTemplate("erp5_demo_maxma_sample")\n
N_ = context.Base_translateString\n
bt = portal.portal_templates.getInstalledBusinessTemplate("erp5_demo_maxma_sample")\n
isTransitionPossible = portal.portal_workflow.isTransitionPossible\n
\n
for obj in context.portal_catalog(path=["%%/%s" % i.replace("**", "%") for i in bt.getTemplatePathList()]):\n
for obj in portal.portal_catalog(path=["%%/%s" % i.replace("**", "%") for i in bt.getTemplatePathList()]):\n
obj.activate().updateLocalRolesOnSecurityGroups()\n
\n
for gadget in context.portal_gadgets.objectValues():\n
for document in portal.portal_catalog(portal_type=bt.getTemplatePortalTypeRoleList()):\n
document.updateLocalRolesOnSecurityGroups()\n
\n
conversion_server_hostname = portal.portal_preferences.getPreferredOoodocServerAddress()\n
conversion_server_port = portal.portal_preferences.getPreferredOoodocServerPortNumber()\n
for preference_id in ["default_configurator_preference", "default_configurator_system_preference"]:\n
preference = getattr(portal.portal_preferences, preference_id)\n
if preference.getPortalType() == "System Preference":\n
preference.setPreferredOoodocServerPortNumber(conversion_server_port)\n
preference.setPreferredOoodocServerAddress(conversion_server_hostname)\n
\n
if isTransitionPossible(preference, "enable"):\n
preference.enable()\n
preference.updateLocalRolesOnSecurityGroups()\n
\n
for gadget in portal.portal_gadgets.objectValues():\n
if gadget.getValidationState() == \'invisible\':\n
gadget.visible()\n
gadget.public()\n
\n
# update security settings for default preference # XXX why ???\n
default_configurator_preference = getattr(portal_preferences,\n
\'default_configurator_preference\', None)\n
if default_configurator_preference is not None:\n
default_configurator_preference.updateLocalRolesOnSecurityGroups()\n
\n
# set manually in \'Module Properties\' respective business_application category\n
# XXX This should be part of Configuration Item probably, but as access_tab is\n
# going to be deprecated, make sure it still requires set business application\n
......@@ -127,7 +134,7 @@ log("%s" % printed)\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>alter_preferences=True</string> </value>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
16
\ No newline at end of file
17
\ 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