Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alecs_myu
erp5
Commits
0ee3eaa0
Commit
0ee3eaa0
authored
Jun 18, 2013
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Base_createCloneDocument for categories + optimizations
parent
866c9cd8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
37 deletions
+32
-37
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_paste.xml
.../SkinTemplateItem/portal_skins/erp5_core/Folder_paste.xml
+17
-28
product/ERP5/bootstrap/erp5_core/bt/revision
product/ERP5/bootstrap/erp5_core/bt/revision
+1
-1
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_createCloneDocument.xml
...ortal_skins/erp5_xhtml_style/Base_createCloneDocument.xml
+13
-7
product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
+1
-1
No files found.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_paste.xml
View file @
0ee3eaa0
...
...
@@ -50,40 +50,29 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
REQUEST=context.REQUEST\n
error_message = \'\'\n
Base_translateString = context.Base_translateString\n
<value>
<string>
portal = context.getPortalObject()\n
\n
if context.cb_dataValid:\n
# We first look if the content of objects to paste is allowed\n
# inside this folder\n
object_list = context.cb_dataItems()\n
try:\n
portal_type_
list = [x.getPortalType() for x in object_list]
\n
portal_type_
set = set(x.getPortalType() for x in object_list)
\n
except AttributeError:\n
error_message =
Base_translateString(\'Sorry, you can not paste these items here.\')
\n
error_message =
\'Sorry, you can not paste these items here.\'
\n
else:\n
allowed_type_list = [x for x in context.getVisibleAllowedContentTypeList()]\n
for portal_type in portal_type_list:\n
if portal_type not in allowed_type_list:\n
error_message = Base_translateString(\'Sorry, you can not paste these items here.\')\n
\n
if context.cb_dataValid and error_message==\'\':\n
if portal_type_set.issubset(context.getVisibleAllowedContentTypeList()):\n
try:\n
new_item_list = context.manage_pasteObjects(
REQUEST[\'__cp\'])\n
new_item_list = context.manage_pasteObjects(portal.
REQUEST[\'__cp\'])\n
except KeyError:\n
return context.Base_redirect(form_id,\n
keep_items=dict(portal_status_message=Base_translateString(\'Nothing to paste.\')))\n
error_message = \'Nothing to paste.\'\n
else:\n
new_id_list = [i[\'new_id\'] for i in new_item_list]\n
return context.Base_redirect(form_id,\n
keep_items=dict(portal_status_message=Base_translateString(\'Items paste in progress.\')))\n
\n
elif context.cb_dataValid and error_message != \'\':\n
return context.Base_redirect(form_id, keep_items=dict(portal_status_message=error_message))\n
\n
error_message = Base_translateString(\'Copy or cut one or more items to paste first.\')\n
return context.Base_redirect(form_id, keep_items=dict(portal_status_message=error_message))\n
#new_id_list = [i[\'new_id\'] for i in new_item_list]\n
error_message = \'Items paste in progress.\'\n
else:\n
error_message = \'Sorry, you can not paste these items here.\'\n
else:\n
error_message = \'Copy or cut one or more items to paste first.\'\n
return context.Base_redirect(form_id, keep_items=dict(\n
portal_status_message=portal.Base_translateString(error_message)))\n
</string>
</value>
</item>
<item>
...
...
product/ERP5/bootstrap/erp5_core/bt/revision
View file @
0ee3eaa0
41093
\ No newline at end of file
41094
\ No newline at end of file
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_createCloneDocument.xml
View file @
0ee3eaa0
...
...
@@ -56,8 +56,9 @@
\n
Pretty messages are provided to the user.\n
"""\n
translateString = context.Base_translateString\n
form_data = context.REQUEST.form\n
portal = context.getPortalObject()\n
translateString = portal.Base_translateString\n
form_data = portal.REQUEST.form\n
\n
if clone:\n
portal_type = context.getPortalType()\n
...
...
@@ -65,10 +66,12 @@ else:\n
portal_type = form_data[\'clone_portal_type\']\n
\n
# We copy contents in place if possible\n
directory = getattr(context, \'original_container\', None) or context.getParentValue()\n
allowed_type_list = directory.getVisibleAllowedContentTypeList()\n
is_user_allowed_copy_or_move = context.Base_checkPermission(context.getRelativeUrl(), \'Copy or Move\')\n
if portal_type not in allowed_type_list or not is_user_allowed_copy_or_move:\n
try:\n
directory = context.aq_explicit.original_container\n
except AttributeError:\n
directory = context.getParentValue()\n
if not (portal_type in directory.getVisibleAllowedContentTypeList() and\n
portal.portal_membership.checkPermission(\'Copy or Move\', context)):\n
if batch_mode:\n
return None\n
else:\n
...
...
@@ -90,7 +93,10 @@ if web_mode:\n
# Standard cloning method\n
if clone:\n
# Copy and paste the object\n
original_id = getattr(context, \'original_id\', None) or context.getId()\n
try:\n
original_id = context.aq_explicit.original_id\n
except AttributeError:\n
original_id = context.getId()\n
# This is required for objects acquired in Web Section\n
clipboard = directory.manage_copyObjects(ids=[original_id])\n
context.REQUEST.set(\'__cp\', clipboard) # CopySupport is using this to set\n
...
...
product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
View file @
0ee3eaa0
1098
\ No newline at end of file
1099
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment