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 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; } }
protected function getWorkstream($id) { return WorkStream::findOrFail($id); }