Ejemplo n.º 1
0
    def available(self):
        """If ICheckedOut is provided by context then return empty list. 
        If ICheckedIn is provided and context is not the latest version 
        return empty list, else default."""
        if ICheckedOut.providedBy(self.context):
            return []

        if ICheckedIn.providedBy(self.context):
            vc = getToolByName(self.context, 'upfront_versioning_catalog')
            ob = vc.getLatestVersionOf(self.context)
            if ob != self.context:
                return []

        return BaseWorkflowSubMenuItem.available(self)
Ejemplo n.º 2
0
 def __init__(self, context, request):
     # Have to set the context to the root.
     helper = zope.component.queryAdapter(context, IExposureSourceAdapter)
     exposure, workspace, path = helper.source()
     context = exposure
     WorkflowSubMenuItem.__init__(self, context, request)