Commit 87f5ed02 authored by Jérome Perrin's avatar Jérome Perrin

Base_createNewDocument was a duplicated script (in core and xhtml style),...

Base_createNewDocument was a duplicated script (in core and xhtml style), remove it from xhtml style

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20724 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3d19f4a5
<?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>
<none/>
</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>"""Add an object of the same type as self in the container, unless\n
this type cannot be added in the container.\n
"""\n
N_ = context.getPortalObject().Base_translateString\n
REQUEST=context.REQUEST\n
parent = context.getParentValue()\n
allowed_type_list = parent.getVisibleAllowedContentTypeList()\n
\n
if not allowed_type_list:\n
return context.ERP5Site_redirect(\'%s/%s/view\' % (\n
parent.getUrl(), context.getId()),\n
keep_items={\'portal_status_message\':\n
N_("You are not allowed to add new content in this context.")})\n
\n
if context.getPortalType() not in allowed_type_list:\n
return context.ERP5Site_redirect(\'%s/%s/view\' % (\n
parent.getUrl(), context.getId()),\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_id = parent.generateNewId()\n
context.portal_types.constructContent(type_name=context.portal_type,\n
container=parent,\n
id=str(new_id),\n
RESPONSE=REQUEST.RESPONSE)\n
return context.ERP5Site_redirect(\'%s/%s/view\' % (parent.getUrl(), new_id),\n
keep_items={\'portal_status_message\': N_("Object Created.")})\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></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>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>N_</string>
<string>REQUEST</string>
<string>parent</string>
<string>allowed_type_list</string>
<string>dict</string>
<string>new_id</string>
<string>str</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_createNewDocument</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
528 529
\ 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