def show_update(self, id, *args, **kwargs): c.tasklist = safe_get(TaskList, id, check_live=True) c.managers = c.tasklist.managers() c.administrators = c.usermapper.project_member_names("ProjectAdmin") c.update = True p = {} for feature in c.tasklist.features: p['feature_' + feature.name] = 1 setattr(c, 'feature_' + feature.name, 1) if has_permission('tasklist', 'update'): c.contextual_wrapper_class = 'tt-context-tasklist-update' return filled_render('tasklist/show_update.myt', c.tasklist, p) else: c.contextual_wrapper_class = 'tt-context-tasklist-preferences' return filled_render('tasklist/show_preferences.myt', c.tasklist, p)
def _assignment_permitted(new_owner): return (h.has_permission(controller="task", action="assign")) or ( new_owner == c.username and h.has_permission(controller="task", action="claim") )
def visibleTasks(self): import tasktracker.lib.helpers as h return [c for c in Task.select(AND(Task.q.task_listID == self.id, Task.q.live == True)) if h.has_permission('task', 'show', id=c.id)]
def completedTasks(self): import tasktracker.lib.helpers as h return [c for c in Task.select(AND(Task.q.statusID == Status.q.id, Status.q.done == False, Task.q.task_listID == self.id, Task.q.live == True)) if h.has_permission('task', 'show', id=c.id)]
def topLevelTasks(self): import tasktracker.lib.helpers as h return [c for c in Task.selectBy(parentID=0, live=True, task_listID=self.id) if h.has_permission('task', 'show', id=c.id)]
def liveChildren(self): import tasktracker.lib.helpers as h return [c for c in self.children if c.live and h.has_permission('task', 'show', id=c.id)]