Example #1
0
    def issued_tasks(self):
        types = ['opengever.task.task', 'opengever.inbox.forwarding']
        catalog = getToolByName(self.context, 'portal_catalog')
        results = catalog(portal_type=types,
                          issuer=get_current_inbox_principal(self.context),
                          review_state=OPEN_TASK_STATES)

        return results[:5]
Example #2
0
    def assigned_tasks(self):
        """
        Get tasks that have been created on a different client and
        are assigned to this client's inbox.
        """
        query_util = getUtility(ITaskQuery)
        query = query_util._get_tasks_for_responsible_query(
            get_current_inbox_principal(self.context))

        query = query.filter(Task.review_state.in_(OPEN_TASK_STATES))

        # If a task has a successor task, it should only list one of them,
        # the one which is physically one the current client.
        query = query.filter(
            or_(
                and_(Task.predecessor == None, Task.successors == None),
                Task.client_id == get_client_id()))

        return query.all()[:5]