protected function insertNonFunctionalRequirement(Request $request, $id)
 {
     $array = Input::all();
     $validator = Validator::make($array, ['name' => 'required', 'content' => 'required']);
     if ($validator->fails()) {
         return Response::json('validation failed.', 400);
     } else {
         $requirement = new NonFunctionalRequirement();
         $requirement->Project_FK = $id;
         $requirement->name = $request->input('name');
         $requirement->content = $request->input('content');
         $requirement->save();
         return Response::json($requirement);
     }
 }
Ejemplo n.º 2
0
 protected function getRequirementSpecificationPercent($id)
 {
     $counter = 0;
     $introduction = ProjectIntroduction::where('Project_FK', '=', $id)->first();
     if (count($introduction) > 0) {
         $counter++;
     }
     $non = NonFunctionalRequirement::where('Project_FK', '=', $id)->first();
     if (count($non) > 0) {
         $counter++;
     }
     $quality = ProjectQuality::where('Project_FK', '=', $id)->first();
     if (count($quality) > 0) {
         $counter++;
     }
     $need = NeedToHave::where('Project_FK', '=', $id)->first();
     if (count($need) > 0) {
         $counter++;
     }
     $nice = NiceToHave::where('Project_FK', '=', $id)->first();
     if (count($nice) > 0) {
         $counter++;
     }
     $result = Result::where('Project_FK', '=', $id)->first();
     if (count($result) > 0) {
         $counter++;
     }
     $use = ProjectUse::where('Project_FK', '=', $id)->first();
     if (count($use) > 0) {
         $counter++;
     }
     $actual = ActualState::where('Project_FK', '=', $id)->first();
     if (count($actual) > 0) {
         $counter++;
     }
     $target = TargetState::where('Project_FK', '=', $id)->first();
     if (count($target) > 0) {
         $counter++;
     }
     $data = ProductData::where('Project_FK', '=', $id)->first();
     if (count($data) > 0) {
         $counter++;
     }
     return $counter;
 }