|
|
|
@ -469,7 +469,7 @@ class ProjectController extends Controller
|
|
|
|
|
|
|
|
|
|
return response()->json(['status' => 'success', 'code' => 200, 'data' => $userProyek, 'totalRecord' => $totalRecord], 200); |
|
|
|
|
} |
|
|
|
|
public function detail($id){ |
|
|
|
|
public function detail(Request $request, $id, $gantt_id = null){ |
|
|
|
|
if(empty($id) || !is_int((int)$id)) |
|
|
|
|
return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); |
|
|
|
|
|
|
|
|
@ -477,12 +477,15 @@ class ProjectController extends Controller
|
|
|
|
|
|
|
|
|
|
if(!$result) |
|
|
|
|
return response()->json(['status'=>'failed','message'=> 'Data not found!','code'=> 404], 404); |
|
|
|
|
|
|
|
|
|
$gantt = MasterFunctionsHelper::getLatestGantt($id); |
|
|
|
|
if (!isset($gantt_id)) { |
|
|
|
|
$gantt = MasterFunctionsHelper::getLatestGantt($id); |
|
|
|
|
$ganttId = $gantt['last_gantt_id']; |
|
|
|
|
} else { |
|
|
|
|
$ganttId = $gantt_id; |
|
|
|
|
} |
|
|
|
|
$result->projectManager = User::where('id', $result->pm_id)->value('name'); |
|
|
|
|
$result->header = Activity::whereNull('parent_id')->where("proyek_id", $id)->where("version_gantt_id", $gantt['last_gantt_id'])->first(); |
|
|
|
|
$result->header = Activity::whereNull('parent_id')->where("proyek_id", $id)->where("version_gantt_id", $ganttId)->first(); |
|
|
|
|
// dd($result->header->start_date); |
|
|
|
|
$ganttId = $gantt['last_gantt_id']; |
|
|
|
|
|
|
|
|
|
$actualStartExist = Activity::where('version_gantt_id', $ganttId)->whereNotNull('actual_start')->exists(); |
|
|
|
|
$actualEndExist = Activity::where('version_gantt_id', $ganttId)->whereNotNull('actual_end')->exists(); |
|
|
|
@ -507,7 +510,7 @@ class ProjectController extends Controller
|
|
|
|
|
} |
|
|
|
|
$result->header->start_date = $startDate; |
|
|
|
|
$result->header->end_date = $endDate; |
|
|
|
|
return response()->json(['status'=>'success','code'=> 200,'data'=>$result, 'gantt'=>$gantt], 200); |
|
|
|
|
return response()->json(['status'=>'success','code'=> 200,'data'=>$result], 200); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getOverdueActivities(Request $request){ |
|
|
|
|