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