예제 #1
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $tasks = Task::all();
     return view('tasks.index')->withTasks($tasks);
     //eturn $tasks->all();
 }
예제 #2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     // 1. No es retorna: paginacion
     //return Task::all();
     $task = Task::all();
     return Response::json(['data' => $this->transformCollection($task)], 200);
 }
예제 #3
0
 public function tasks()
 {
     $tasks = Task::all();
     // $taskUsers = array();
     $view = view('admin.tasks', ['tasks' => $tasks]);
     return $view;
 }
 public function update(Request $request, $id)
 {
     array_forget($request, "_token");
     $all_request = $request->all();
     $task = Task::find($id);
     foreach ($all_request as $key => $value) {
         /*
          * remove all underscore contained
          * in the edit form field
          */
         $key = preg_replace("/^_/", "", $key);
         $task->{$key} = $value;
     }
     if ($task->update()) {
         \Session::flash("success_message", "Task Successfully Updated");
     } else {
         \Session::flash("error_message", "Unexpected Error Task could not be updated");
     }
     $tasks = Task::all();
     if ($request->ajax()) {
         response()->json("Task Successfully Updated");
         exit;
         // return \Redirect::back();
     }
     return View("taskmanager.index", ['tasks' => $tasks, 'title' => 'Tasks']);
 }
예제 #5
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //1. No és retorna: paginació
     //return Task::all();
     $task = Task::all();
     return $this->respond($this->taskTransformer->transformCollection($task->all()));
 }
예제 #6
0
 /**
  * Display a list of all of the user's task.
  *
  * @param  Request  $request
  * @return Response
  */
 public function index(Request $request)
 {
     //        return view('tasks.index', [
     //            'tasks' => $this->tasks->forUser($request->user()),
     //        ]);
     $tasks = Task::all();
     return view('tasks.index', ['tasks' => $tasks]);
 }
 public function index()
 {
     //
     $user = Auth::user();
     //  echo $user->name;
     $tasks = Task::all();
     return view('tasks.index')->withTasks($tasks);
 }
예제 #8
0
 public function index()
 {
     $tasks = Task::all();
     //return $tasks;
     //return view('task.index',compact('tasks'));
     return view('tasks.index', compact('tasks'));
     //return view('welcome');
 }
예제 #9
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (Sentinel::hasAccess('task.view')) {
         $tasks = Task::all();
         return view('notifications.tasks.tasks', compact('tasks'));
     } else {
         return back()->withErrors(['NoAccess' => 'No tiene permisos para acceder a esta area.']);
     }
 }
예제 #10
0
 public function liste()
 {
     if (Auth::user()) {
         $id = Auth::user()->id;
     }
     $tasks = Task::all()->where('user_id', $id);
     $lists = Liste::all()->where('user_id', $id);
     return view('list', compact('tasks', 'lists'));
 }
 public function todolist()
 {
     //return View::make('todolist');
     $tasks = Task::all();
     return View::make('todolist')->with('tasks', $tasks);
     //or
     // return View::make('todolist', compact('tasks'));
     //or
     //return View::make('home',['tasks'=> $tasks]);
 }
예제 #12
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tasks = Task::all();
     //
     //
     //$task = Task::all();
     //        return $this->respond([
     //            'data' => $this->TaskTransformer->transformCollection($task->all())
     //        ]);
     return Response::json($this->TaskTransformer->transformCollection($tasks), 200);
 }
예제 #13
0
 public function getIndex()
 {
     $user = \Auth::user();
     $pendings = User::where('standing', 'unconfirmed')->get();
     $event = $this->currentEvent();
     $committee = Committee::where('event_id', $event->id)->get();
     $committees = Committee::all();
     $heads = Head::all();
     $users = User::all();
     $events = Event::all();
     $tasks = Task::all();
     return view('admin/admin', compact('user', 'users', 'pendings', 'events', 'event', 'heads', 'committee', 'committees', 'tasks'));
 }
예제 #14
0
 public function index()
 {
     //Envoi de mail
     /*
     Mail::send('emails.test', ['user' => 'ludo'], function ($message) {
       $message->from('*****@*****.**', 'Your Application');
     
       $message->to('*****@*****.**')->subject('Your Reminder!');
     });
     */
     $tasks = Task::all();
     return view('task.index', compact('tasks'));
 }
예제 #15
0
 public function randomize()
 {
     $users = User::all();
     $tasks = Task::all();
     srand((double) microtime() * 10000);
     foreach ($users as $user) {
         if (rand(0, 2) == 1) {
             $taskExemption = new TaskExemption();
             $taskExemption->user_id = $user->id;
             $taskExemption->task_id = $tasks[rand(0, count($tasks) - 1)]->id;
             $taskExemption->save();
         }
     }
 }
예제 #16
0
 function getTask()
 {
     $user = \Auth::user();
     $events = Event::all();
     $event = Event::latest('id')->first();
     $tasks = Task::all();
     $categories = array('Pending', 'In-progress', 'Delayed', 'Finished');
     //Array of head->id of user
     $heads_comm = Head::where('event_id', $event->id)->where('user_id', $user->id)->get(array('comm_id'))->toArray();
     //members of committee
     $mem = Member::whereIn('comm_id', $heads_comm)->get(array('user_id'))->toArray();
     $members = User::whereIn('id', $mem)->get();
     //committees where user is head
     $committees = Committee::whereIn('id', $heads_comm)->get();
     return view('pages/task', compact('user', 'members', 'events', 'event', 'committees', 'tasks', 'categories'));
 }
예제 #17
0
 public static function start()
 {
     $lastRun = fopen(ENV('LAST_RUN'), 'c+');
     $now = Carbon::now();
     if (filesize(ENV('LAST_RUN')) == 19 && Carbon::parse(fgets($lastRun)) < $now->endOfWeek()) {
         fclose($lastRun);
         return false;
     } else {
         fwrite($lastRun, $now->startOfWeek());
         fclose($lastRun);
         Week::create();
     }
     $users = User::prefsFirst();
     //$users = User::whereIn('name', ['Sean Fraser', 'John Hodges', 'Warren Wilansky'])->with('taskPrefs')->get();
     $tasks = Task::all()->pluck('id')->diff(TaskExemption::common($users->pluck('id')))->shuffle();
     static::run($tasks, $users, 0);
 }
예제 #18
0
 /** @test */
 public function demo_efficient_lazy_eager_loading_eloquent_relationship_query(FunctionalTester $I)
 {
     // given ... 3 tasks, each belonging to a user
     // when ... we get all tasks
     $tasks = Task::all();
     // then ... should return all tasks
     $I->assertSame(3, count($tasks));
     // when ... we then "load" users for all tasks
     //          it would still result in only 2 SQL queries in total (which is efficient)
     //          this achieves lazy version of previous test, which allows us to conditionally load task's user after loading all tasks
     $tasks->load('user');
     // then ... should attach each task's user
     $I->assertSame("Sherlock Holmes", $tasks[0]->user['name']);
     // task 1
     $I->assertSame("Sherlock Holmes", $tasks[1]->user['name']);
     // task 2
     $I->assertSame("Dr Watson", $tasks[2]->user['name']);
     // task 3
 }
예제 #19
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $tasks = Task::all();
     $countNotification = 0;
     foreach ($tasks as $task) {
         $timeArray = explode(':', $task->notification_time);
         $dtTask = Carbon::createFromFormat('Y-m-d H:i:s', $task->notification_date);
         $dtTask->setTime($timeArray[0], $timeArray[1], 0);
         //dd(Carbon::now()->diffInMinutes($dtTask));
         if (Carbon::now()->diffInMinutes($dtTask) < $task->notification_reminder) {
             try {
                 $this->mailer->notificationTasks(['task' => $task]);
             } catch (Swift_RfcComplianceException $e) {
                 Log::error($e->getMessage());
             }
             $countNotification++;
         }
         Log::info(Carbon::now()->diffInMinutes($dtTask));
     }
     $this->info('Hecho, ' . $countNotification . ' notificaciones enviadas');
 }
예제 #20
0
 public function index()
 {
     /* Getting seed data from the original pinduin table
      */
     echo str_random(10);
     echo rand(1, 3);
     $tasks_seeds = DB::select('select * from tasks_orig limit 10');
     $tasks_seeds = DB::select('select status,tasks_owner,id_boards,seqnr,body,value from tasks_orig limit 10');
     //echo $tasks_seeds[0]->id;
     //var_dump((array) $photos[0]);
     foreach ($tasks_seeds as $tasks_seed) {
         //echo $tasks_seed->id.'<br>';
         var_dump((array) $tasks_seed);
         echo '<br>';
         //echo $tasks_seed->id.'<br>';
         echo '<br>';
     }
     //$photos = DB::table('tasks_orig')->get();
     $tasks = Task::all();
     dd($tasks_seeds, $tasks);
     $tasks = ['Make the Discovery Board', 'Make the Lists'];
     //		return $tasks;
     return view('tasks.index')->withTasks($tasks);
 }
예제 #21
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     // 1. No es retorna: paginació
     return Task::all();
 }
예제 #22
0
 public function listTask()
 {
     $tasks = Task::all();
     return view('admin.task.listTask')->with('tasks', $tasks);
 }
예제 #23
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return view('crud.index', ['title' => trans('task.title'), 'name' => 'task', 'collumns' => trans('task.collumns'), 'rows' => Task::all()]);
 }
 public function createTask($idbp)
 {
     $actions = DB::table('actions as a')->join('objectives as o', function ($join) use($idbp) {
         $join->on('a.objective_id', '=', 'o.id');
     })->join('goals as g', function ($join2) use($idbp) {
         $join2->on('o.goal_id', '=', 'g.id')->where('g.bpid', '=', $idbp);
     })->distinct()->pluck('a.description');
     $task = Task::all();
     $groups = Group::lists('name');
     $user = User::lists('name');
     $counted = count($task) + 1;
     $users = User::lists('name', 'id');
     $selectedUsers = array();
     $selectedGroups = array();
     $progress = ['0' => 'Not Started', '1' => 'In Progress', '2' => 'Done'];
     return view('businessPlan.createTask', compact('actions', 'counted', 'groups', 'user', 'idbp', 'users', 'selectedUsers', 'selectedGroups', 'progress'));
 }
예제 #25
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $task = Task::all();
     return $this->respond(['data' => $this->taskTransformer->transformCollection($task->all())]);
 }
예제 #26
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //problema 1, no retorna: paginació
     $task = Task::all();
     return $this->respond(['data' => $this->taskTransformer->transformCollection($task->all())]);
 }
예제 #27
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tasks = Task::all();
     return Response::json(['data' => $tasks->toArray()], 200);
     //return Task::all();
 }
예제 #28
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return Task::all()->toJson();
 }
예제 #29
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $task = Task::findOrFail($id);
     $task->delete();
     return view('pages.dashboard')->with('users', User::all())->with('task_categories', TaskCategory::all())->with('tasks', Task::all());
 }
예제 #30
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $page_title = "الصيانة الوقائية";
     $tasks = Task::all();
     return view('tasks.tasks_index', compact('tasks', 'page_title'));
 }