+ db.update_task(id_, postvars['title'][0], postvars['default_effort'][0], postvars['joined_tags'][0], collect_checked('tag_', postvars), collect_checked('link_', postvars), postvars['comment'][0])
+ if 'as_todo' in postvars.keys() and id_ not in db.selected_day.todos.keys():
+ db.update_todo_mini(id_, db.selected_date, None, False, 1.0)
+ elif 'as_todo' not in postvars.keys() and id_ in db.selected_day.todos.keys():
+ todo = db.selected_day.todos[id_]
+ if todo.internals_empty() and (not todo.done) and todo.day_effort is None:
+ del db.selected_day.todos[id_]
+ else:
+ raise PlomException('cannot deselect task as todo of preserve-worthy values')
+
+ elif 'new_day' == site:
+ redir_params += [('search', postvars['search'][0])]
+ if 'choose_task' in postvars.keys():
+ for i, uuid in enumerate(postvars['choose_task']):
+ if not uuid in db.selected_day.todos.keys():
+ # task = db.tasks[uuid]
+ db.update_todo_mini(uuid, db.selected_date, None, False, 1.0)
+ if 'choose_todo' in postvars.keys():
+ for i, id_ in enumerate(postvars['choose_todo']):
+ if not id_ in [todo.id_ for todo in db.selected_day.linked_todos_as_list]:
+ db.link_day_with_todo(db.selected_date, id_)
+
+ elif 'do_day' == site:
+ if 'filter' in postvars.keys():
+ redir_params += [('hide_done', int('hide_done' in postvars.keys()))]
+ else:
+ db.selected_date = postvars['date'][0]
+ redir_params += [('date', db.selected_date)]
+ db.selected_day.comment = postvars['day_comment'][0]
+ if 'todo_id' in postvars.keys():
+ for i, todo_id in enumerate(postvars['todo_id']):
+ old_todo = None if not todo_id in db.todos.keys() else db.todos[todo_id]
+ done = ('done' in postvars) and (todo_id in postvars['done'])
+ day_effort_input = postvars['effort'][i]
+ day_effort = float(day_effort_input) if len(day_effort_input) > 0 else None
+ comment = postvars['effort_comment'][i]
+ importance = float(postvars['importance'][i])
+ if old_todo and old_todo.done == done and old_todo.day_effort == day_effort and comment == old_todo.comment and old_todo.importance == importance:
+ continue
+ db.update_todo_for_day(todo_id, db.selected_date, day_effort, done, comment, importance)
+
+ elif 'day' == site: