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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
146512d0
Commit
146512d0
authored
Jul 31, 2020
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core: jump to document script
parent
ecc84727
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
0 deletions
+97
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedDocumentList.py
.../portal_skins/erp5_core/Base_jumpToRelatedDocumentList.py
+35
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedDocumentList.xml
...portal_skins/erp5_core/Base_jumpToRelatedDocumentList.xml
+62
-0
No files found.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedDocumentList.py
0 → 100644
View file @
146512d0
portal
=
context
.
getPortalObject
()
Base_translateString
=
portal
.
Base_translateString
redirect_context
=
context
catalog_list
=
context
.
Base_getRelatedDocumentList
(
limit
=
2
)
if
len
(
catalog_list
)
==
0
:
message
=
Base_translateString
(
'No Document Related'
)
elif
len
(
catalog_list
)
==
1
:
redirect_context
=
catalog_list
[
0
].
getObject
()
if
target_form_id
is
not
None
:
form_id
=
target_form_id
message
=
Base_translateString
(
# first, try to get a full translated message with portal types
"%s related to %s."
%
(
redirect_context
.
getPortalType
(),
context
.
getPortalType
()),
# if not found, fallback to generic translation
default
=
Base_translateString
(
'${this_portal_type} related to ${that_portal_type} : ${that_title}.'
,
mapping
=
{
"this_portal_type"
:
redirect_context
.
getTranslatedPortalType
(),
"that_portal_type"
:
context
.
getTranslatedPortalType
(),
"that_title"
:
context
.
getTitleOrId
()
}),)
else
:
form_id
=
relation_form_id
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
()
}),)
query_params
=
dict
(
portal_status_message
=
message
)
return
redirect_context
.
Base_redirect
(
form_id
,
keep_items
=
query_params
)
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedDocumentList.xml
0 → 100644
View file @
146512d0
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</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>
_params
</string>
</key>
<value>
<string>
form_id=\'view\', target_form_id=None, relation_form_id=\'Base_viewDocumentSearchableList\'
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_jumpToRelatedDocumentList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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