示例#1
0
 public static void sendModeration(String name, float point) {
   Task t = new Task(name, point);
   t.status = TaskStatus.PENDING;
   t.suggestedBy = SUser.findByEmail(Auth.connected());
   t.save();
   thanks();
 }
示例#2
0
文件: Task.java 项目: taiz/creamy
 /** Create a task */
 public static Task create(Integer project, String folder, String title) {
   Task task = new Task();
   task.project = Project.find.ref(project);
   task.folder = folder;
   task.title = title;
   task.save();
   return task;
 }
示例#3
0
 public static Result newTask() {
   User user = loadUser();
   Form<Task> filledForm = taskForm.bindFromRequest();
   if (filledForm.hasErrors()) {
     flash("error", "The task could not be saved.");
     return badRequest(main.render("Tasks", null, tasks.render(user.tasks, filledForm)));
   } else {
     Task task = filledForm.get();
     task.owner = user;
     task.save();
     return created(main.render("Tasks", null, tasks.render(user.tasks, taskForm)));
   }
 }
示例#4
0
 public static void create(Task task) {
   task.save();
 }
示例#5
0
 /**
  * Saves a task
  *
  * @param storyId
  */
 public static void save(String storyId, JsonObject body) {
   Task task = gson.fromJson(body, Task.class);
   task.story = new Key<Story>(Story.class, Long.valueOf(storyId));
   task.save();
   renderText(gson.toJson(task));
 }
示例#6
0
 // This is actually performing the update and save the object
 private static void doUpdate(Task toUpdate, JsonObject body) {
   if (toUpdate != null) {
     workUnit.updateObject(toUpdate, body);
     toUpdate.save();
   }
 }
 public static Task create(Task task, Long project, String folder) {
   task.project = Project.find.ref(project);
   task.folder = folder;
   task.save();
   return task;
 }