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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
e3c97b8d
Commit
e3c97b8d
authored
Nov 17, 2022
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core/erp5_web_renderjs_ui_test: warn when no related document is found in case of jump
parent
c0edeb1a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormJumpNoDocument.zpt
...nderjs_ui_page_templates_zuite/testFormJumpNoDocument.zpt
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedObject.py
...teItem/portal_skins/erp5_core/Base_jumpToRelatedObject.py
+5
-1
No files found.
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormJumpNoDocument.zpt
View file @
e3c97b8d
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUiJump/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUiJump/macros/init"
/>
</tal:block>
</tal:block>
<tal:block
tal:define=
"notification_configuration python: {'class': '
success
',
<tal:block
tal:define=
"notification_configuration python: {'class': '
error
',
'text': 'No Bar related.'}"
>
'text': 'No Bar related.'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification"
/>
</tal:block>
</tal:block>
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedObject.py
View file @
e3c97b8d
...
@@ -4,6 +4,7 @@ Base_translateString = portal.Base_translateString
...
@@ -4,6 +4,7 @@ Base_translateString = portal.Base_translateString
checkPerm
=
portal
.
portal_membership
.
checkPermission
checkPerm
=
portal
.
portal_membership
.
checkPermission
redirect_context
=
context
redirect_context
=
context
status_level
=
'success'
if
jump_from_relative_url
is
None
:
if
jump_from_relative_url
is
None
:
relation
=
context
relation
=
context
...
@@ -58,6 +59,7 @@ if len(related_list) == 0:
...
@@ -58,6 +59,7 @@ if len(related_list) == 0:
'No %s Related'
%
document_caption
,
'No %s Related'
%
document_caption
,
default
=
Base_translateString
(
'No ${portal_type} related.'
,
default
=
Base_translateString
(
'No ${portal_type} related.'
,
mapping
=
{
'portal_type'
:
Base_translateString
(
document_caption
)}))
mapping
=
{
'portal_type'
:
Base_translateString
(
document_caption
)}))
status_level
=
'warning'
elif
len
(
related_list
)
==
1
:
elif
len
(
related_list
)
==
1
:
relation_found
=
1
relation_found
=
1
...
@@ -83,6 +85,7 @@ elif len(related_list) == 1:
...
@@ -83,6 +85,7 @@ elif len(related_list) == 1:
"that_title"
:
context
.
getTitleOrId
()
}),)
"that_title"
:
context
.
getTitleOrId
()
}),)
else
:
else
:
message
=
Base_translateString
(
"You are not authorised to view the related document."
)
message
=
Base_translateString
(
"You are not authorised to view the related document."
)
status_level
=
'warning'
relation_found
=
0
relation_found
=
0
else
:
else
:
...
@@ -119,6 +122,7 @@ else:
...
@@ -119,6 +122,7 @@ else:
related_object_list
.
append
(
obj
)
related_object_list
.
append
(
obj
)
if
len
(
related_object_list
)
==
0
:
if
len
(
related_object_list
)
==
0
:
message
=
Base_translateString
(
"You are not authorised to view any related document."
)
message
=
Base_translateString
(
"You are not authorised to view any related document."
)
status_level
=
'warning'
relation_found
=
0
relation_found
=
0
else
:
else
:
selection_uid_list
=
[
x
.
getUid
()
for
x
in
related_object_list
]
selection_uid_list
=
[
x
.
getUid
()
for
x
in
related_object_list
]
...
@@ -134,7 +138,7 @@ else:
...
@@ -134,7 +138,7 @@ else:
uid
=
selection_uid_list
,
uid
=
selection_uid_list
,
portal_status_message
=
message
))
portal_status_message
=
message
))
query_params
=
dict
(
portal_status_message
=
message
)
query_params
=
dict
(
portal_status_message
=
message
,
portal_status_level
=
status_level
)
if
selection_name
and
not
relation_found
:
if
selection_name
and
not
relation_found
:
query_params
[
'selection_name'
]
=
selection_name
query_params
[
'selection_name'
]
=
selection_name
query_params
[
'selection_index'
]
=
selection_index
query_params
[
'selection_index'
]
=
selection_index
...
...
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