Ejemplo n.º 1
0
 public function update($id, TaskRequest $request)
 {
     $task = Task::findOrFail($id);
     $task->name_en = $request->input('name_en');
     $task->name_bn = $request->input('name_bn');
     $task->component_id = $request->input('component_id');
     $task->module_id = $request->input('module_id');
     $task->route = $request->input('route');
     $task->icon = $request->input('icon');
     $task->description = $request->input('description');
     $task->ordering = $request->input('ordering');
     $task->updated_by = Auth::user()->id;
     $task->updated_at = time();
     $task->update();
     Session()->flash('flash_message', 'Task has been updated!');
     return redirect('tasks');
 }
Ejemplo n.º 2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @param  TaskRequest  $request
  * @return Response
  */
 public function update($id, TaskRequest $request)
 {
     $task = Task::findOrFail($id);
     $task->completed = $request->input('completed');
     $task->content = $request->input('content');
     $task->priority = $request->input('priority');
     $task->location = $request->input('location');
     $task->time = $request->input('time');
     $task->completed = $request->input('completed');
     $task->save();
     return response()->json();
 }
Ejemplo n.º 3
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(TaskRequest $request)
 {
     // dd($request->input());
     $task = Task::create(['title' => $request->input('title'), 'description' => $request->input('description'), 'is_active' => $request->input('is_active')]);
     $taskId = $task->id;
     foreach ($request->input('implementer') as $implementer) {
         \DB::table('task_implementer')->insert([['task_id' => $taskId, 'user_id' => $implementer]]);
     }
     foreach ($request->input('owner') as $owner) {
         \DB::table('task_owner')->insert([['task_id' => $taskId, 'user_id' => $owner]]);
     }
     // insert moverId into tables task_mover
     \DB::table('task_mover')->insert([['task_id' => $taskId, 'user_id' => $request->input('mover')]]);
     // insert supervisorId into tables task_supervisor
     foreach ($request->input('supervisor') as $supervisor) {
         \DB::table('task_supervisor')->insert([['task_id' => $taskId, 'user_id' => $supervisor]]);
     }
     return redirect('tasks');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param Task $task
  * @param TaskRequest $taskRequest
  * @return Response
  */
 public function update(Task $task, TaskRequest $taskRequest)
 {
     $task->update($taskRequest->input());
     return redirect()->route('tasks.show', $task->id);
 }
Ejemplo n.º 5
0
 /**
  * Se dispara el evento de que la tarea se ha asignado cuando haya un cambio de responsable
  *
  * @param TaskRequest $request
  * @param Task $task
  * @param User $oldResponsible
  */
 private function notifyToNewResponsible(TaskRequest $request, Task $task, User $oldResponsible)
 {
     if ($oldResponsible->id != $request->input('responsible_id')) {
         event(new TaskWasAssigned($task, $this->user));
         Log::info("Tarea Actualizada", ['task' => $task->name, 'responsible' => $task->responsible->name]);
     }
 }
Ejemplo n.º 6
0
 /**
  * create a Task
  * @param  TaskRequest $request
  * @return task               created task Object
  */
 private function createTask(TaskRequest $request)
 {
     $task = Auth::user()->tasks()->create($request->all());
     if ($request->input('tag_list')) {
         $this->syncTags($task, $request->input('tag_list'));
     }
     return $task;
 }