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
Mikolaï Krol
erp5
Commits
d61d906b
Commit
d61d906b
authored
Jun 08, 2015
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core: Allow to jump from a Portal Type to its currently set Property Sheets.
parent
84f100ea
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
429 additions
and
0 deletions
+429
-0
product/ERP5/bootstrap/erp5_core/ActionTemplateItem/portal_types/Base%20Type/jump_property_sheets.xml
...ateItem/portal_types/Base%20Type/jump_property_sheets.xml
+100
-0
product/ERP5/bootstrap/erp5_core/ActionTemplateItem/portal_types/Preference%20Tool%20Type/jump_property_sheets.xml
...l_types/Preference%20Tool%20Type/jump_property_sheets.xml
+100
-0
product/ERP5/bootstrap/erp5_core/ActionTemplateItem/portal_types/Preference%20Type/jump_property_sheets.xml
...m/portal_types/Preference%20Type/jump_property_sheets.xml
+100
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BaseType_jumpToPropertySheetList.xml
...rtal_skins/erp5_core/BaseType_jumpToPropertySheetList.xml
+95
-0
product/ERP5/bootstrap/erp5_core/bt/change_log
product/ERP5/bootstrap/erp5_core/bt/change_log
+3
-0
product/ERP5/bootstrap/erp5_core/bt/template_action_path_list
...uct/ERP5/bootstrap/erp5_core/bt/template_action_path_list
+3
-0
product/ERP5Type/ERP5Type.py
product/ERP5Type/ERP5Type.py
+28
-0
No files found.
product/ERP5/bootstrap/erp5_core/ActionTemplateItem/portal_types/Base%20Type/jump_property_sheets.xml
0 → 100644
View file @
d61d906b
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_jump
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_jump
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
jump_property_sheets
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
View
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Action Information
</string>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
1.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Property Sheets
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/BaseType_jumpToPropertySheetList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
python:portal.Base_checkPermission(\'portal_property_sheets\', \'View\')
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/ActionTemplateItem/portal_types/Preference%20Tool%20Type/jump_property_sheets.xml
0 → 100644
View file @
d61d906b
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_jump
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_jump
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
jump_property_sheets
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
View
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Action Information
</string>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
1.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Property Sheets
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/BaseType_jumpToPropertySheetList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
python:portal.Base_checkPermission(\'portal_property_sheets\', \'View\')
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/ActionTemplateItem/portal_types/Preference%20Type/jump_property_sheets.xml
0 → 100644
View file @
d61d906b
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_jump
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_jump
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
jump_property_sheets
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
View
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Action Information
</string>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
1.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Property Sheets
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/BaseType_jumpToPropertySheetList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
python:portal.Base_checkPermission(\'portal_property_sheets\', \'View\')
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BaseType_jumpToPropertySheetList.xml
0 → 100644
View file @
d61d906b
<?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>
_body
</string>
</key>
<value>
<string>
portal = context.getPortalObject()\n
translateString = portal.Base_translateString\n
\n
property_sheet_value_list = context.getRecursivePropertySheetValueList()\n
if not len(property_sheet_value_list):\n
return context.Base_redirect(\n
\'view\',\n
keep_items={\'portal_status_message\':\n
translateString(\'No ${portal_type} related.\',\n
mapping={\'portal_type\': \'Property Sheet\'})})\n
\n
elif len(property_sheet_value_list) == 1:\n
property_sheet = property_sheet_value_list[0]\n
return property_sheet.Base_redirect(\n
\'view\',\n
keep_items={\'portal_status_message\':\n
translateString(\'${this_portal_type} related to ${that_portal_type}: ${that_title}.\',\n
mapping={\'this_portal_type\': \'Property Sheet\',\n
\'that_portal_type\': context.getPortalType(),\n
\'that_title\': context.getTitleOrId()})})\n
\n
property_sheet_uid_list = [property_sheet.getUid()\n
for property_sheet in property_sheet_value_list]\n
\n
return portal.portal_property_sheets.Base_redirect(\n
\'view\',\n
keep_items={\'reset\': 1,\n
\'ignore_hide_rows\': 1,\n
\'uid\': property_sheet_uid_list})\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
BaseType_jumpToPropertySheetList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/bt/change_log
View file @
d61d906b
2015-06-08 arnaud.fontaine
* Allow to jump from a Portal Type to its currently set Property Sheets.
2015-06-08 arnaud.fontaine
* Sort Property Sheets by ID by default.
...
...
product/ERP5/bootstrap/erp5_core/bt/template_action_path_list
View file @
d61d906b
...
...
@@ -23,6 +23,7 @@ Attribute Unicity Constraint | view
Base Category | view
Base Domain | view
Base Type | action_view
Base Type | jump_property_sheets
Base Type | role_view
Base Type | translation_view
Base Type | update_local_roles
...
...
@@ -79,10 +80,12 @@ Id Tool | view
Memcached Plugin | view
Memcached Tool | view
Predicate | view
Preference Tool Type | jump_property_sheets
Preference Tool Type | view
Preference Tool | advanced
Preference Tool | view
Preference Type | action_view
Preference Type | jump_property_sheets
Preference Type | role_view
Preference Type | translation_view
Preference Type | update_local_roles
...
...
product/ERP5Type/ERP5Type.py
View file @
d61d906b
...
...
@@ -467,6 +467,34 @@ class ERP5TypeInformation(XMLObject,
self
.
getPortalType
(),
type_property_sheet_value_list
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getRecursivePropertySheetValueList'
)
def
getRecursivePropertySheetValueList
(
self
):
"""
Get all the Property Sheets for this Portal Type, not only the one set on
'type_property_sheet' property but also the ones defined on
'property_sheets' property on each parent classes.
"""
import
erp5.portal_type
portal_type_class
=
getattr
(
erp5
.
portal_type
,
self
.
getId
())
portal_type_class
.
loadClass
()
# XXX-arnau: There should be no need of checking this property (IOW
# checking the MRO should be enough), but this is not enough for Portal
# Types Accessor Holder (erp5.accessor_holder.portal_type), used by
# Preferences for example (defining getAccessorHolderList() which
# returns a single Accessor Holder from several Property
# Sheets). Probably this behavior should be changed to have one Accessor
# Holder per Property Sheet ?
property_sheet_name_set
=
set
(
self
.
getTypePropertySheetList
())
for
klass
in
portal_type_class
.
mro
():
if
klass
.
__module__
==
'erp5.accessor_holder.property_sheet'
:
property_sheet_name_set
.
add
(
klass
.
__name__
)
return
getPropertySheetValueList
(
self
.
getPortalObject
(),
property_sheet_name_set
)
# XXX these methods, _baseGetTypeClass, getTypeMixinList, and
# getTypeInterfaceList, are required for a bootstrap issue that
# the portal type class Base Type is required for _aq_dynamic on
...
...
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