Commit 27fce95d authored by Julien Muchembled's avatar Julien Muchembled

Fix 'Find' in ZMI + cleanup.

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/portal_types@29244 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f2684ace
......@@ -1717,9 +1717,7 @@ class ERP5Generator(PortalGenerator):
for t in BusinessTemplate,:
t = t.factory_type_information
if not tool.hasObject(t['id']):
tool._setObject(t['id'],
ERP5TypeInformation(portal_type=ERP5TypeInformation.portal_type,
uid=None, **t))
tool._setObject(t['id'], ERP5TypeInformation(uid=None, **t))
def setupERP5Core(self,p,**kw):
"""
......
......@@ -17,10 +17,6 @@
<key> <string>allow_discussion</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>content_meta_type</string> </key>
<value> <string>ERP5 Action Information</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Action Information...</string> </value>
......
......@@ -32,14 +32,6 @@
<key> <string>acquire_local_roles</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>content_icon</string> </key>
<value> <string>typeinfo.gif</string> </value>
</item>
<item>
<key> <string>content_meta_type</string> </key>
<value> <string>ERP5 Type Information</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Portal Type is the meta portal type information for all standard portal types in ERP5.</string> </value>
......
......@@ -32,14 +32,6 @@
<key> <string>acquire_local_roles</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>content_icon</string> </key>
<value> <string>folder_icon.gif</string> </value>
</item>
<item>
<key> <string>content_meta_type</string> </key>
<value> <string>ERP5 Folder</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>The Types Tool centralises all portal type definitions.</string> </value>
......
55
\ No newline at end of file
57
\ No newline at end of file
......@@ -112,12 +112,12 @@ class ActionInformation(XMLObject):
security.declareProtected(AccessContentsInformation, 'PrincipiaSearchSource')
def PrincipiaSearchSource(self):
# Support for "Find" tab in ZMI
search_source_list = [self.getId(),
search_source_list = [self.getReference(),
self.getTitle(),
self.getDescription(),
self.getActionText(),
self.getConditionText()]
return ' '.join(search_source_list)
return ' '.join(filter(None, search_source_list))
#
# XXX CMF compatibility
......@@ -143,7 +143,7 @@ class ActionInformation(XMLObject):
def getMapping(self):
""" Get a mapping of this object's data.
"""
return { 'id': self.getId(),
return { 'id': self.getReference(),
'title': self.getTitle(),
'description': self.getDescription(),
'category': self.getActionType(),
......@@ -160,9 +160,3 @@ class ActionInformation(XMLObject):
so that 'action_expression' property can be renamed to 'action'.
"""
return ActionInfo(self, ec)
# def Title(self):
# return self.getTitle()
#
# def Description(self):
# return self.getDescription()
......@@ -23,7 +23,6 @@
from Globals import InitializeClass, DTMLFile
from AccessControl import ClassSecurityInfo, getSecurityManager
from Acquisition import aq_base, aq_inner, aq_parent
from zExceptions import BadRequest
import Products
import Products.CMFCore.TypesTool
......@@ -596,7 +595,7 @@ class ERP5TypeInformation(XMLObject,
self.getTypeInitScriptId()]
search_source_list += self.getTypePropertySheetList(())
search_source_list += self.getTypeBaseCategoryList(())
return ' '.join(search_source_list)
return ' '.join(filter(None, search_source_list))
#
# USE_BASE_TYPE
......
......@@ -107,7 +107,7 @@ class TranslationProviderBase:
original_property_domain_keys.sort()
# Only update if required in order to prevent ZODB from growing
if original_property_domain_dict is None or\
if original_property_domain_dict is None or \
property_domain_keys != original_property_domain_keys:
# Update existing dict
property_domain_dict.update(original_property_domain_dict)
......
......@@ -170,7 +170,7 @@ try:
original_init(self, action, ec)
if not isinstance(action, dict):
# ivan
if self.data.get('icon', None) is not None:
if self.data.get('icon') is not None:
self.data['icon'] = self._getIcon
self._lazy_keys.append('icon')
else:
......
......@@ -45,7 +45,7 @@ def CMFCoreUtils_getViewFor(obj, view='view'):
for action in actions:
# portal_types hack
action_type = action.getActionType()
reference = getattr(action, 'reference', None) or action.id
reference = getattr(action, 'reference', action.id)
if reference == view or action_type.endswith('_%s' % view): # Patch 2: consider anything ending by _view
if _verifyActionPermissions(obj, action):
if action.isVisible() and action.testCondition(test_context): # Patch 3: test actions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment