public function ParseFile($projectid, $flagid, $filename) { //convert to an array $arrayofimportedtasks = $this->ProcessImportedProjectFile($filename, $flagid); //get collection of tasks currently imported for this project $dbtasks = Task::where('subject_type', 'Project')->where('subject_id', $projectid)->where('imported', 1)->orderBy('sequence')->get(); //save array to a session variable session(['msimportarray' => $arrayofimportedtasks]); //put the tasks into a tree structure $output = $this->GenerateHTMLOutput($arrayofimportedtasks, $dbtasks); return $output; }
public function indexTask($subjecttype, $subjectid, Request $request) { $title = "Tasks for {$subjecttype} " . Breadcrumbs::getSubjectName($subjecttype, $subjectid); $breadcrumbs = Breadcrumbs::getBreadCrumb($subjecttype, $subjectid); $breadcrumbs[] = ['Tasks', action('TaskController@indexTask', [$subjecttype, $subjectid]), true]; $tasks = Task::where('subject_type', $subjecttype)->where('subject_id', $subjectid)->get(); if ($subjecttype == 'Project') { $project = Project::findOrFail($subjectid); return view('Tasks.indexProject', compact('subjectid', 'subjecttype', 'tasks', 'title', 'breadcrumbs', 'project')); } else { return view('Tasks.index', compact('subjectid', 'subjecttype', 'tasks', 'title', 'breadcrumbs')); } }
public function dashboard($userid) { $user = User::findOrFail($userid); //get programs, workstreams and projects that the user is a member of $programs = Program::whereHas('Members', function ($q) use($userid) { $q->where('user_id', $userid); })->get(); $workstreams = WorkStream::whereHas('Members', function ($q) use($userid) { $q->where('user_id', $userid); })->get(); $projects = Project::whereHas('Members', function ($q) use($userid) { $q->where('user_id', $userid); })->get(); //get tasks for the user $tasks = Task::where('action_owner', $userid)->get(); //Get the users actions $actions = Action::where('actionee', $userid)->get(); //Get risks and issues assigned to the user $risks = Risk::where('owner', $userid)->orWhere('action_owner', $userid)->get(); //return $risks; return view('Users.dashboard', compact('user', 'programs', 'workstreams', 'projects', 'tasks', 'risks', 'actions')); }
public function TaskCount() { return Task::where('action_owner', $this->id)->where('status', 'Open')->count(); }