/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($programid, $workstreamid, $subjectid) { $program = Program::findOrFail($programid); $workstream = WorkStream::where('id', $workstreamid)->with('RAGs', 'Risks', 'Projects.RAGs', 'Members.User', 'Tasks.ActionOwner')->first(); $subject = Project::where('id', $subjectid)->with('RAGs', 'Risks', 'Members.User', 'Tasks.ActionOwner', 'Comments')->first(); $subjecttype = 'Project'; $subjectid = $subject->id; return view('Project.show', compact('program', 'workstream', 'subject', 'subjecttype', 'subjectid')); }
public function OpenLoadForm($projectID) { //get the project try { $project = Project::findOrFail($projectID); } catch (ModelNotFoundException $e) { abort(404, "Project with the id {$projectID} not found"); } $program = Program::findOrFail($project->program_id); $workstream = WorkStream::findOrFail($project->work_stream_id); return view('Project.UploadMicrosoftProjectPlan', compact('project', 'workstream', 'program')); }
public function show($programid, $workstreamid) { try { $program = Program::findOrFail($programid); } catch (ModelNotFoundException $e) { App::abort(404, 'Program not found'); } $subject = WorkStream::where('id', $workstreamid)->with('RAGs', 'Risks', 'Projects.RAGs', 'Members.User', 'Tasks.ActionOwner')->first(); if (!$subject) { App::abort(404, 'WorkStream not found'); } $subjecttype = 'WorkStream'; $subjectid = $subject->id; return view('workstream.show', compact('program', 'subject', 'subjecttype', 'subjectid')); }
public function editWorkstreamRiskOrIssue($programid, $workstreamid, $riskid) { $program = Program::findOrFail($programid); $workstream = WorkStream::findOrFail($workstreamid); $risk = Risk::findorFail($riskid); //return "Owner id: $risk->owner , Owner Name: $risk->OwnerName"; $title = "Edit {$risk->title} for the {$workstream->name} Workstream"; $breadcrumbs[] = ['Home', URL::asset('/home'), false]; $breadcrumbs[] = ['Programs', URL::asset('programs'), false]; $breadcrumbs[] = [$program->name, URL::asset('/') . "/programs/{$programid}", false]; $breadcrumbs[] = ['Workstreams', '', false]; $breadcrumbs[] = [$workstream->name, URL::asset('/') . "/programs/{$programid}/workstreams/{$workstreamid}", false]; $breadcrumbs[] = ['Risks & Issues', '', false]; $breadcrumbs[] = [$risk->title, '', false]; $breadcrumbs[] = ['Edit', URL::asset('/') . "/programs/{$programid}/workstreams/{$workstreamid}/risksandissues/{$riskid}/edit", true]; $redirect = "/programs/{$programid}/workstreams/{$workstreamid}"; //return $risk->NextReviewDate; return $this->edit($risk, $title, $breadcrumbs, $redirect); }
public static function getSubjectName($subjecttype, $subjectid) { switch ($subjecttype) { case "Program": $program = Program::findOrFail($subjectid); return $program->name; break; case "WorkStream": $workstream = WorkStream::findOrFail($subjectid); return $workstream->name; break; case "Project": $project = Project::findOrFail($subjectid); return $project->name; break; case "Risk": $risk = Risk::findOrFail($subjectid); return $risk->title; break; case "Rag": $rag = rag::findOrFail($subjectid); return $rag->title; break; case "Task": $task = Task::findOrFail($subjectid); return $task->title; break; case "Dependency": $dependency = Dependency::findOrFail($subjectid); return $dependency->title; break; case "ChangeRequest": $changerequest = ChangeRequest::findOrFail($subjectid); return $changerequest->title; break; case "Meeting": $meeting = Meeting::findOrFail($subjectid); return $meeting->title; break; case "Action": $action = Action::findOrFail($subjectid); return $action->title; break; case "Link": $link = Link::findOrFail($subjectid); return $link->title; break; case "Assumption": $assumption = Assumption::findOrFail($subjectid); return $assumption->title; break; } }