src/pyams_content/shared/common/zmi/dashboard.py
changeset 1060 29b1aaf9e080
parent 1024 cbc4b53f6dd2
child 1070 ea0c7ac589c4
equal deleted inserted replaced
1059:34e6d07ea2e9 1060:29b1aaf9e080
    20 from zope.dublincore.interfaces import IZopeDublinCore
    20 from zope.dublincore.interfaces import IZopeDublinCore
    21 from zope.interface import implementer, Interface
    21 from zope.interface import implementer, Interface
    22 from zope.intid.interfaces import IIntIds
    22 from zope.intid.interfaces import IIntIds
    23 
    23 
    24 from pyams_catalog.query import CatalogResultSet
    24 from pyams_catalog.query import CatalogResultSet
    25 from pyams_content import _
       
    26 from pyams_content.interfaces import MANAGE_SITE_ROOT_PERMISSION, PUBLISH_CONTENT_PERMISSION
    25 from pyams_content.interfaces import MANAGE_SITE_ROOT_PERMISSION, PUBLISH_CONTENT_PERMISSION
    27 from pyams_content.profile.interfaces import IAdminProfile
    26 from pyams_content.profile.interfaces import IAdminProfile
    28 from pyams_content.shared.common import CONTENT_TYPES
    27 from pyams_content.shared.common import CONTENT_TYPES
    29 from pyams_content.shared.common.interfaces import IBaseSharedTool, IWfSharedContent, IManagerRestrictions
    28 from pyams_content.shared.common.interfaces import IBaseSharedTool, IWfSharedContent, IManagerRestrictions
    30 from pyams_content.shared.common.interfaces.zmi import IDashboardTable, ISharedToolDashboardTable, \
    29 from pyams_content.shared.common.interfaces.zmi import IDashboardTable, ISharedToolDashboardTable, \
    57 from pyams_workflow.interfaces import IWorkflowState, IWorkflow, IWorkflowVersions, IWorkflowPublicationInfo
    56 from pyams_workflow.interfaces import IWorkflowState, IWorkflow, IWorkflowVersions, IWorkflowPublicationInfo
    58 from pyams_zmi.interfaces.menu import IContentManagementMenu
    57 from pyams_zmi.interfaces.menu import IContentManagementMenu
    59 from pyams_zmi.layer import IAdminLayer
    58 from pyams_zmi.layer import IAdminLayer
    60 from pyams_zmi.view import InnerAdminView
    59 from pyams_zmi.view import InnerAdminView
    61 
    60 
       
    61 from pyams_content import _
       
    62 
    62 
    63 
    63 #
    64 #
    64 # Shared tools common adapters
    65 # Shared tools common adapters
    65 #
    66 #
    66 
    67 
   231         try:
   232         try:
   232             owner = obj.owner
   233             owner = obj.owner
   233         except AttributeError:
   234         except AttributeError:
   234             return '--'
   235             return '--'
   235         else:
   236         else:
   236             manager = get_utility(ISecurityManager)
   237             if owner:
   237             return manager.get_principal(next(iter(owner))).title
   238                 manager = get_utility(ISecurityManager)
       
   239                 return manager.get_principal(next(iter(owner))).title
       
   240             else:
       
   241                 return '--'
   238 
   242 
   239 
   243 
   240 @adapter_config(name='modified', context=(Interface, IPyAMSLayer, IDashboardTable), provides=IColumn)
   244 @adapter_config(name='modified', context=(Interface, IPyAMSLayer, IDashboardTable), provides=IColumn)
   241 class SharedToolDashboardModifiedColumn(I18nColumn, GetAttrColumn):
   245 class SharedToolDashboardModifiedColumn(I18nColumn, GetAttrColumn):
   242     """Shared tool dashboard modified column"""
   246     """Shared tool dashboard modified column"""