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
Matevz Golob
erp5
Commits
172d3457
Commit
172d3457
authored
May 23, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_core] Use listbox_uid parameter to get list of document to delete
parent
1d7a04d2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
55 deletions
+8
-55
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testDeleteDocumentList.zpt
...portal_tests/renderjs_ui_zuite/testDeleteDocumentList.zpt
+2
-49
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_delete.py
.../SkinTemplateItem/portal_skins/erp5_core/Folder_delete.py
+5
-5
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_delete.xml
...SkinTemplateItem/portal_skins/erp5_core/Folder_delete.xml
+1
-1
No files found.
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testDeleteDocumentList.zpt
View file @
172d3457
...
@@ -61,6 +61,8 @@
...
@@ -61,6 +61,8 @@
<tr><td>
click
</td>
<tr><td>
click
</td>
<td>
//a[@data-i18n='Delete Multiple Documents']
</td><td></td></tr>
<td>
//a[@data-i18n='Delete Multiple Documents']
</td><td></td></tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tr><td>
waitForElementNotPresent
</td>
<tr><td>
waitForElementNotPresent
</td>
...
@@ -102,55 +104,6 @@
...
@@ -102,55 +104,6 @@
<td>
//div[@data-gadget-scope="field_listbox"]//table/tbody/tr[6]/td[4]//a
</td>
<td>
//div[@data-gadget-scope="field_listbox"]//table/tbody/tr[6]/td[4]//a
</td>
<td>
draft
</td></tr>
<td>
draft
</td></tr>
<tr><td>
waitForElementPresent
</td>
<td>
//a[@data-i18n='Actions']
</td><td></td></tr>
<tr><td>
click
</td>
<td>
//a[@data-i18n='Actions']
</td><td></td></tr>
<tr><td>
waitForElementPresent
</td>
<td>
//a[@data-i18n='Delete Multiple Documents']
</td><td></td></tr>
<tr><td>
click
</td>
<td>
//a[@data-i18n='Delete Multiple Documents']
</td><td></td></tr>
<tal:block
tal:define=
"pagination_configuration python: {'header': '(6)', 'footer': '6 Records'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text"
/>
</tal:block>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tal:block
tal:define=
"notification_configuration python: {'class': 'error',
'text': 'All documents are selected! Submit again to proceed or Cancel and narrow down your search.'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification"
/>
</tal:block>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tr><td>
waitForElementNotPresent
</td>
<td>
//input[@name="action_confirm"]
</td><td></td></tr>
<tal:block
tal:define=
"notification_configuration python: {'class': 'success',
'text': 'Deleted.'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification"
/>
</tal:block>
<tal:block
tal:define=
"pagination_configuration python: {'header': '(6)', 'footer': '6 Records'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text"
/>
</tal:block>
<tr><td>
assertText
</td>
<td>
//div[@data-gadget-scope="field_listbox"]//table/tbody/tr[1]/td[4]//a
</td>
<td>
deleted
</td></tr>
<tr><td>
assertText
</td>
<td>
//div[@data-gadget-scope="field_listbox"]//table/tbody/tr[4]/td[4]//a
</td>
<td>
deleted
</td></tr>
<tr><td>
assertText
</td>
<td>
//div[@data-gadget-scope="field_listbox"]//table/tbody/tr[6]/td[4]//a
</td>
<td>
deleted
</td></tr>
</tbody></table>
</tbody></table>
</body>
</body>
</html>
</html>
\ No newline at end of file
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_delete.py
View file @
172d3457
...
@@ -22,11 +22,11 @@ translate = Base_translateString
...
@@ -22,11 +22,11 @@ translate = Base_translateString
REQUEST
=
kwargs
.
get
(
"REQUEST"
,
None
)
or
portal
.
REQUEST
REQUEST
=
kwargs
.
get
(
"REQUEST"
,
None
)
or
portal
.
REQUEST
if
selection_name
:
if
selection_name
:
uids
=
portal
.
portal_selections
.
getSelectionCheckedUidsFor
(
selection_name
)
listbox_uid
=
portal
.
portal_selections
.
getSelectionCheckedUidsFor
(
selection_name
)
if
portal
.
portal_selections
.
selectionHasChanged
(
md5_object_uid_list
,
uids
):
if
portal
.
portal_selections
.
selectionHasChanged
(
md5_object_uid_list
,
listbox_uid
):
return
context
.
Base_redirect
(
keep_items
=
{
'portal_status_message'
:
translate
(
"Sorry, your selection has changed."
)})
return
context
.
Base_redirect
(
keep_items
=
{
'portal_status_message'
:
translate
(
"Sorry, your selection has changed."
)})
if
not
uids
:
if
not
listbox_uid
:
return
context
.
Base_redirect
(
keep_items
=
{
return
context
.
Base_redirect
(
keep_items
=
{
'portal_status_message'
:
translate
(
"Please select one or more items first."
),
'portal_status_message'
:
translate
(
"Please select one or more items first."
),
'portal_status_level'
:
"warning"
})
'portal_status_level'
:
"warning"
})
...
@@ -34,8 +34,8 @@ if not uids:
...
@@ -34,8 +34,8 @@ if not uids:
if
True
:
if
True
:
# already filters out documents with relations that cannot be deleted
# already filters out documents with relations that cannot be deleted
object_list
=
context
.
Folder_getDeleteObjectList
(
uid
=
uids
)
object_list
=
context
.
Folder_getDeleteObjectList
(
uid
=
listbox_uid
)
object_not_deletable_len
=
len
(
uids
)
-
len
(
object_list
)
object_not_deletable_len
=
len
(
listbox_uid
)
-
len
(
object_list
)
# some documents cannot be deleted thus we stop and warn the user
# some documents cannot be deleted thus we stop and warn the user
if
object_not_deletable_len
==
1
:
if
object_not_deletable_len
==
1
:
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_delete.xml
View file @
172d3457
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
form_id=\'\',dialog_id=\'\',selection_index=None,object_uid=None,selection_name=None,field_id=None,cancel_url=\'\',md5_object_uid_list=\'\',
uids
=(), **kwargs
</string>
</value>
<value>
<string>
form_id=\'\',dialog_id=\'\',selection_index=None,object_uid=None,selection_name=None,field_id=None,cancel_url=\'\',md5_object_uid_list=\'\',
listbox_uid
=(), **kwargs
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
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