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
Léo-Paul Géneau
erp5
Commits
4a36016f
Commit
4a36016f
authored
Jan 08, 2020
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core: add message when jumping to a module
parent
9c9e243a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedObject.py
...teItem/portal_skins/erp5_core/Base_jumpToRelatedObject.py
+19
-3
No files found.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedObject.py
View file @
4a36016f
from
ZTUtils
import
make_query
#
from ZTUtils import make_query
portal
=
context
.
getPortalObject
()
Base_translateString
=
portal
.
Base_translateString
checkPerm
=
portal
.
portal_membership
.
checkPermission
...
...
@@ -29,10 +29,18 @@ if related:
module_id
=
portal
.
getDefaultModuleId
(
portal_type
[
0
],
None
)
if
module_id
is
not
None
:
module
=
portal
.
getDefaultModule
(
portal_type
[
0
])
message
=
Base_translateString
(
# first, try to get a full translated message with portal types
"Documents related to %s."
%
context
.
getPortalType
(),
# if not found, fallback to generic translation
default
=
Base_translateString
(
'Documents related to ${that_portal_type} : ${that_title}.'
,
mapping
=
{
"that_portal_type"
:
context
.
getTranslatedPortalType
(),
"that_title"
:
context
.
getTitleOrId
()
}),)
return
module
.
Base_redirect
(
'view'
,
keep_items
=
{
'default_%s_uid'
%
base_category
:
relation
.
getUid
(),
'ignore_hide_rows'
:
1
,
'reset'
:
1
})
'reset'
:
1
,
'portal_status_message'
:
message
})
search_method
=
getattr
(
relation
,
'get%sRelatedList'
%
getter_base_name
)
else
:
search_method
=
getattr
(
relation
,
'get%sList'
%
getter_base_name
)
...
...
@@ -109,9 +117,17 @@ else:
relation_found
=
0
else
:
selection_uid_list
=
[
x
.
getUid
()
for
x
in
related_object_list
]
message
=
Base_translateString
(
# first, try to get a full translated message with portal types
"Documents related to %s."
%
context
.
getPortalType
(),
# if not found, fallback to generic translation
default
=
Base_translateString
(
'Documents related to ${that_portal_type} : ${that_title}.'
,
mapping
=
{
"that_portal_type"
:
context
.
getTranslatedPortalType
(),
"that_title"
:
context
.
getTitleOrId
()
}),)
return
context
.
Base_redirect
(
relation_form_id
,
keep_items
=
dict
(
reset
=
1
,
uid
=
selection_uid_list
))
uid
=
selection_uid_list
,
portal_status_message
=
message
))
query_params
=
dict
(
portal_status_message
=
message
)
if
selection_name
and
not
relation_found
:
...
...
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