Commit fb09a3b3 by Azhan Hannan

Log Pia #193 : Notification Add New Project Team. Tambah details ‘Updated By’.…

Log Pia #193 : Notification Add New Project Team. Tambah details ‘Updated By’. Display Updated By from table project_team.updated_by
parent 6a5e073f
......@@ -524,7 +524,8 @@ class MaintenanceController extends Controller
public function addprojectteam(Request $request)
{
// dd(env('MAIL_SERVER'));
// dd($request);
$chargeable = 1;
$userId = users::find(Auth::id())
......@@ -583,6 +584,7 @@ class MaintenanceController extends Controller
$pteam = Pteam::where('fk_project_id', $request->pid)
->whereIn('pt_staff_id', $staffs)
->with('toRole')
->with('editor')
->get();
if (env('EMAIL_ENV') == 'local')
......@@ -598,7 +600,7 @@ class MaintenanceController extends Controller
$mailTo = data_get($project,'projectDirector.email');
}
// dd($mailTo);
// dd($pteam);
$data_staffs = [];
foreach ($pteam as $key => $team) {
......@@ -607,6 +609,7 @@ class MaintenanceController extends Controller
'name' => data_get($team,'pt_team'),
'role' => data_get($team,'toRole.role'),
'status' => data_get($team,'pt_project_task_sts'),
'editor' => data_get($team,'editor.fullname'),
];
}
......@@ -622,6 +625,7 @@ class MaintenanceController extends Controller
];
Mail::to($mailTo)->send(new AddProjectTeam($data_email, $data_staffs));
// return new AddProjectTeam($data_email, $data_staffs);
}
return redirect()->route('timesheet::maintenance.senaraiProjectTeam', ['id' => $request->pid])
......
......@@ -43,6 +43,12 @@ class Pteam extends Model
return $this->hasOne('Portal\Timesheet\Model\Staff_info','staff_id', 'pt_staff_id')->with('deptname');
}
public function editor()
{
// dd('1');
return $this->hasOne('Portal\Timesheet\Model\Staff_info','staff_id', 'updated_by');
}
/**
* undocumented function
......
......@@ -38,15 +38,17 @@ New project @if(count($data_staffs) > 1)members @else member @endif : <br>
<th style="border: black 1px solid;">Name</th>
<th style="border: black 1px solid;">Role</th>
<th style="border: black 1px solid;">Status</th>
<th style="border: black 1px solid;">Updated By</th>
</tr>
</thead>
<tbody>
@foreach($data_staffs as $key => $staff)
<tr>
<td style="border: black 1px solid; width: 10%;">{!! $key+1 !!} </td>
<td style="border: black 1px solid; width: 40%;">{!! $staff['name'] !!} </td>
<td style="border: black 1px solid; width: 40%;">{!! $staff['role'] !!}</td>
<td style="border: black 1px solid; width: 10%;">@if( $staff['status'] == 1) Active @else Inactive @endif</td>
<td style="border: black 1px solid;"> {!! $key+1 !!} </td>
<td style="border: black 1px solid;"> {!! $staff['name'] !!} </td>
<td style="border: black 1px solid;"> {!! $staff['role'] !!} </td>
<td style="border: black 1px solid;"> @if( $staff['status'] == 1) Active @else Inactive @endif </td>
<td style="border: black 1px solid;"> {!! $staff['editor'] !!} </td>
</tr>
@endforeach
</tbody>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment