Ejemplo n.º 1
0
    def get_related_tasks_to_sync(self, transition=''):
        tasks = []
        stc = ISuccessorTaskController(self.context)
        predecessor = stc.get_predecessor(None)
        if predecessor:
            tasks.append(predecessor)

        tasks.extend(stc.get_successors())

        return tasks
Ejemplo n.º 2
0
    def sync_deadline(self, new_deadline, text):
        sct = ISuccessorTaskController(self.context)
        for successor in sct.get_successors():

            response = remote_request(
                successor.client_id,
                '@@remote_deadline_modifier',
                successor.physical_path,
                data={
                    'new_deadline': new_deadline.toordinal(),
                    'text': text})

            if response.read().strip() != 'OK':
                raise Exception(
                    'Updating deadline on remote client %s. failed (%s)' % (
                        successor.client_id, response.read()))
Ejemplo n.º 3
0
    def sync_deadline(self, new_deadline, text):
        sct = ISuccessorTaskController(self.context)
        for successor in sct.get_successors():

            response = remote_request(
                successor.client_id,
                '@@remote_deadline_modifier',
                successor.physical_path,
                data={
                    'new_deadline': new_deadline.toordinal(),
                    'text': text})

            if response.read().strip() != 'OK':
                raise Exception(
                    'Updating deadline on remote client %s. failed (%s)' % (
                        successor.client_id, response.read()))
Ejemplo n.º 4
0
    def get_tasks_to_sync(self, transition):
        if not self._is_synced_transition(transition):
            return []

        tasks = []
        stc = ISuccessorTaskController(self.context)

        predecessor = stc.get_predecessor(None)

        # Fowarding predecessors should not be synced.
        if predecessor is not None and predecessor.task_type != u"forwarding_task_type":
            tasks.append(predecessor)

        tasks.extend(stc.get_successors())

        return tasks
Ejemplo n.º 5
0
    def get_tasks_to_sync(self, transition):
        if not self._is_synced_transition(transition):
            return []

        tasks = []
        stc = ISuccessorTaskController(self.context)

        predecessor = stc.get_predecessor(None)

        #Fowarding predecessors should not be synced.
        if (predecessor is not None and
            predecessor.task_type != u'forwarding_task_type'):
            tasks.append(predecessor)

        tasks.extend(stc.get_successors())

        return tasks
Ejemplo n.º 6
0
 def get_successor_tasks(self):
     """ Get the task from which this task was copied
     """
     controller = ISuccessorTaskController(self.context)
     return controller.get_successors()
Ejemplo n.º 7
0
 def get_successor_tasks(self):
     """ Get the task from which this task was copied
     """
     controller = ISuccessorTaskController(self.context)
     return controller.get_successors()