Commit 3f1eabe0 authored by Alexandre Boeglin's avatar Alexandre Boeglin

Modified Base_setDefaultSecurity.

JP added Base_jumpToRelationObject.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5243 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 987567c9
...@@ -103,8 +103,8 @@ elif doAction0 == \'add\':\n ...@@ -103,8 +103,8 @@ elif doAction0 == \'add\':\n
, \'view\'\n , \'view\'\n
, \'portal_status_message=Object+Created.\')\n , \'portal_status_message=Object+Created.\')\n
return request.RESPONSE.redirect( redirect_url )\n return request.RESPONSE.redirect( redirect_url )\n
# Otherwise, check if this is an automatic menu (template)\n
elif doAction0 == \'template\':\n elif doAction0 == \'template\':\n
# Support for document templates (copy / paste a document from preferences)\n
template_relative_url = \' \'.join(Base_doAction[1:])\n template_relative_url = \' \'.join(Base_doAction[1:])\n
template = context.getPortalObject().restrictedTraverse(template_relative_url)\n template = context.getPortalObject().restrictedTraverse(template_relative_url)\n
if template is not None:\n if template is not None:\n
...@@ -112,8 +112,9 @@ elif doAction0 == \'template\':\n ...@@ -112,8 +112,9 @@ elif doAction0 == \'template\':\n
preference.manage_copyObjects(ids=[template.getId()], REQUEST=request, RESPONSE=None)\n preference.manage_copyObjects(ids=[template.getId()], REQUEST=request, RESPONSE=None)\n
new_content_list = context.manage_pasteObjects(request[\'__cp\'])\n new_content_list = context.manage_pasteObjects(request[\'__cp\'])\n
new_content_id = new_content_list[0][\'new_id\']\n new_content_id = new_content_list[0][\'new_id\']\n
redirect_url = \'%s/%s/%s?%s\' % ( context.absolute_url()\n new_content = context[new_content_id]\n
, new_content_id\n new_content.makeTemplateInstance()\n
redirect_url = \'%s/%s?%s\' % ( new_content.absolute_url()\n
, \'view\'\n , \'view\'\n
, \'portal_status_message=Template+Created.\')\n , \'portal_status_message=Template+Created.\')\n
else: \n else: \n
...@@ -121,7 +122,7 @@ elif doAction0 == \'template\':\n ...@@ -121,7 +122,7 @@ elif doAction0 == \'template\':\n
, \'view\'\n , \'view\'\n
, \'portal_status_message=Template+Does+not+Exist.\')\n , \'portal_status_message=Template+Does+not+Exist.\')\n
return request.RESPONSE.redirect( redirect_url )\n return request.RESPONSE.redirect( redirect_url )\n
\n \n
return getattr(context,form_id)(request)\n return getattr(context,form_id)(request)\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value> <string encoding="base64">O/INCg==</string> </value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>search_method = getattr(context, \'get%sValueList\' %\n
string.join([string.capitalize(x) for x in base_category.split(\'_\')], \'\'))\n
related_object_list = search_method(portal_type=portal_type)\n
\n
if len(related_object_list)==0:\n
url = context.absolute_url()\n
message = \'No+%s+related.\' % portal_type.replace(\' \', \'+\')\n
\n
elif len(related_object_list)==1:\n
url = related_object_list[0].absolute_url()\n
message = \'%s+related+to+%s:+%s.\' %\\\n
(portal_type.replace(\' \', \'+\'),\n
context.getPortalType().replace(\' \', \'+\'), \n
context.getTitleOrId())\n
\n
else:\n
request=context.REQUEST\n
selection_uid_list = [x.getUid() for x in related_object_list]\n
kw = {\'uid\': selection_uid_list}\n
context.portal_selections.setSelectionParamsFor(\'Base_jumpToRelatedObjectList\', kw)\n
request.set(\'object_uid\', context.getUid())\n
request.set(\'uids\', selection_uid_list)\n
return context.Base_jumpToRelatedObjectList(uids=selection_uid_list, REQUEST=request)\n
\n
redirect_url = \'%s/%s?%s\' % (url, \'view\', \'portal_status_message=%s\' % message)\n
context.REQUEST[ \'RESPONSE\' ].redirect(redirect_url)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/nexedi/erp5_core/Base_jumpToRelationObject</string> </value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>base_category, portal_type=None</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>base_category</string>
<string>portal_type</string>
<string>getattr</string>
<string>context</string>
<string>_getattr_</string>
<string>string</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>x</string>
<string>search_method</string>
<string>related_object_list</string>
<string>len</string>
<string>url</string>
<string>message</string>
<string>_getitem_</string>
<string>request</string>
<string>selection_uid_list</string>
<string>kw</string>
<string>redirect_url</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_jumpToRelationObject</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Jump to the object in relation with the current context</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -90,7 +90,8 @@ common_permission_list = [\n ...@@ -90,7 +90,8 @@ common_permission_list = [\n
]\n ]\n
\n \n
author_permission_list = [\n author_permission_list = [\n
\'Add portal content\'\n \'Add portal content\',\n
\'Add portal folders\',\n
]\n ]\n
\n \n
assignor_permission_list = [\n assignor_permission_list = [\n
......
2006-01-23 Alex
* Added "Add portal folders" permission for Author in Base_setDefaultSecurity
2006-01-21 JP 2006-01-21 JP
* Added Base_jumpToRelationObject to ease the implementation of jump menus
* Added support for user based role assignment (ERP5Type_getSecurityCategoryFromArrow) * Added support for user based role assignment (ERP5Type_getSecurityCategoryFromArrow)
2006-01-20 JP & Jerome 2006-01-20 JP & Jerome
......
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