def tasks_change_project(self, tasks_uuid): """ Move tasks to project/checklist; display window with defined projects to select. Args: tasks_uuid: list of tasks uuid to change Returns: True when success. """ dlg = DlgProjectTree(self.wnd) if not dlg.run(modal=True): return False parent_uuid = dlg.selected tasks_to_save = [] for task_uuid in tasks_uuid: task = OBJ.Task.get(self._session, uuid=task_uuid) if not task: _LOG.warn("tasks_change_status: task %r not found", task_uuid) continue if task.parent_uuid != parent_uuid: if task_logic.change_task_parent(task, parent_uuid, self._session): tasks_to_save.append(task) if tasks_to_save: return task_logic.save_modified_tasks(tasks_to_save, self._session) return False
def task_change_parent(self, parent_uuid): """ Change current task parent with confirmation. Args: parent_uuid: destination parent UUID Returns: True if parent was changed. """ parent = None if parent_uuid: parent = OBJ.Task.get(self._session, uuid=parent_uuid) if not self._confirm_change_task_parent(parent): return False return task_logic.change_task_parent(self._task, parent, self._session)