Commit 29521b69 authored by Jérome Perrin's avatar Jérome Perrin

Base_createNewDocument : copy erp5_xhtml_version, and use absolute_url to make...

Base_createNewDocument : copy erp5_xhtml_version, and use absolute_url to make it work in virtual hosting environment.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20725 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 87f5ed02
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -68,27 +65,28 @@ ...@@ -68,27 +65,28 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>REQUEST=context.REQUEST\n <value> <string>"""Add an object of the same type as self in the container, unless\n
\n this type cannot be added in the container.\n
# Add an object of the same type as self\n """\n
N_ = context.getPortalObject().Base_translateString\n
REQUEST=context.REQUEST\n
parent = context.getParentValue()\n parent = context.getParentValue()\n
# XXX May be this need to be changed in order to get something else than\n allowed_type_list = parent.getVisibleAllowedContentTypeList()\n
# the permission "Add portal content"\n \n
new_id = parent.generateNewId()\n if not allowed_type_list:\n
context.portal_types.constructContent(type_name=context.portal_type,\n return context.ERP5Site_redirect(\'%s/%s\' % (context.absolute_url(), form_id),\n
container=parent,\n keep_items={\'portal_status_message\':\n
id=str(new_id),\n N_("You are not allowed to add new content in this context.")})\n
RESPONSE=REQUEST.RESPONSE)\n
# parent[new_id].flushActivity(invoke=1)\n
# parent.invokeFactory(type_name=context.portal_type,\n
# id=str(parent.generateNewId()),\n
# RESPONSE=REQUEST.RESPONSE)\n
#parent.portal_types.constructContent(type_name=context.portal_type,\n
# container=context,\n
# id=str(parent.generateNewId()),\n
# RESPONSE=REQUEST.RESPONSE)\n
\n \n
return REQUEST.RESPONSE\n if context.getPortalType() not in allowed_type_list:\n
return context.ERP5Site_redirect(\'%s/%s\' % (context.absolute_url(), form_id),\n
keep_items={\'portal_status_message\':\n
N_("You are not allowed to add ${portal_type} in this context.",\n
mapping=dict(portal_type=context.getTranslatedPortalType()))})\n
\n
new_content = parent.newContent(portal_type=context.getPortalType())\n
return context.ERP5Site_redirect(\'%s/%s\' % (new_content.absolute_url(), form_id),\n
keep_items={\'portal_status_message\': N_("Object Created.")})\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -103,6 +101,16 @@ return REQUEST.RESPONSE\n ...@@ -103,6 +101,16 @@ return REQUEST.RESPONSE\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>form_id=\'view\'</string> </value>
</item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
<value> <value>
...@@ -121,18 +129,21 @@ return REQUEST.RESPONSE\n ...@@ -121,18 +129,21 @@ return REQUEST.RESPONSE\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>form_id</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>N_</string>
<string>REQUEST</string> <string>REQUEST</string>
<string>parent</string> <string>parent</string>
<string>new_id</string> <string>allowed_type_list</string>
<string>str</string> <string>dict</string>
<string>new_content</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -144,7 +155,9 @@ return REQUEST.RESPONSE\n ...@@ -144,7 +155,9 @@ return REQUEST.RESPONSE\n
<item> <item>
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<none/> <tuple>
<string>view</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
808 810
\ 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