Browse Source

Format ActivityController

pull/3/head
Wahyu Ramadhan 1 year ago
parent
commit
96222016f0
  1. 720
      app/Http/Controllers/ActivityController.php
  2. 7
      app/Http/Controllers/ProjectController.php

720
app/Http/Controllers/ActivityController.php

File diff suppressed because it is too large Load Diff

7
app/Http/Controllers/ProjectController.php

@ -393,9 +393,14 @@ class ProjectController extends Controller
public function setBaseline($gantt_id) public function setBaseline($gantt_id)
{ {
$activities = Activity::where("version_gantt_id", $gantt_id)->get(); $activities = Activity::where("version_gantt_id", $gantt_id)->orderBy('id')->get();
foreach ($activities as $activity) { foreach ($activities as $activity) {
$successor = Link::where('t_activity_id', $activity->id)->first();
if ($successor) {
$predecessor = Activity::find($successor->s_activity_id);
$activity->start_date = $predecessor->end_date;
}
$activity->update([ $activity->update([
"planned_start"=>$activity->start_date, "planned_start"=>$activity->start_date,
"planned_end"=>$activity->end_date, "planned_end"=>$activity->end_date,

Loading…
Cancel
Save