Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
3
3f-timesheet
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dockers
3f-timesheet
Commits
002dd1f9
Commit
002dd1f9
authored
Sep 21, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migration and set project director when add new project
parent
a5916ce8
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
43 deletions
+92
-43
database/migrations/2022_09_20_150405_alter_table_in_project.php
+32
-0
packages/portal/timesheet/resources/views/maintenance/penambahanProject.blade.php
+18
-3
packages/portal/timesheet/resources/views/maintenance/senaraiProject.blade.php
+2
-0
packages/portal/timesheet/routes/web.php
+8
-8
packages/portal/timesheet/src/Http/Controllers/MaintenanceController.php
+27
-32
packages/portal/timesheet/src/Model/Project.php
+5
-0
No files found.
database/migrations/2022_09_20_150405_alter_table_in_project.php
0 → 100644
View file @
002dd1f9
<?php
use
Illuminate\Support\Facades\Schema
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
class
AlterTableInProject
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'project'
,
function
(
Blueprint
$table
)
{
$table
->
integer
(
'p_project_director'
)
->
after
(
'p_project_task_team'
)
->
unsigned
()
->
nullable
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
table
(
'project'
,
function
(
Blueprint
$table
)
{
$table
->
dropColumn
(
'p_project_director'
);
});
}
}
packages/portal/timesheet/resources/views/maintenance/penambahanProject.blade.php
View file @
002dd1f9
...
...
@@ -7,16 +7,28 @@
<form class="
ui
form
" action="
{{
route
(
'timesheet::maintenance.addnewproject'
)}}
" method="
POST
">
{
{csrf_field()}
}
<div class="
two
fields
">
<div class="
five
wide
field
">
<div class="
eight
wide
field
">
<label>Project Code</label>
<input type="
text
" name="
projectcode
" placeholder="
Project
Code
">
</div>
<div class="
five
wide
field
">
<div class="
eight
wide
field
">
<label>Project Name</label>
<input type="
text
" name="
projectname
" placeholder="
Project
Name
">
</div>
</div>
<div class="
field
">
<div class="
two
fields
">
<div class="
eight
wide
field
">
<label>Project Director</label>
<select name="
projectdirector
" class="
ui
fluid
dropdown
">
<option value="">Project Director</option>
@foreach(
$pd
as
$key
=>
$value
)
<option value="
{{
data_get
(
$value
,
'id'
)}}
">
{
{data_get($value,'fullname')}
}
</option>
@endforeach
</select>
</div>
<div class="
eight
wide
field
">
<label>Project Manager</label>
<select name="
projectmanager
" class="
ui
fluid
dropdown
">
<option value="">Project Manager</option>
...
...
@@ -25,6 +37,9 @@
@endforeach
</select>
</div>
</div>
<div class="
field
">
<label>Project Status</label>
<select name="
status
" class="
ui
fluid
dropdown
">
...
...
packages/portal/timesheet/resources/views/maintenance/senaraiProject.blade.php
View file @
002dd1f9
...
...
@@ -13,6 +13,7 @@
<th class="
single
line
">Project Code</th>
<th class="
single
line
">Project Name</th>
<th class="
single
line
">Project Manager</th>
<th class="
single
line
">Project Director</th>
<th class="
text
-
center
single
line
">Status</th>
<th class="
text
-
center
single
line
">Action</th>
</tr>
...
...
@@ -24,6 +25,7 @@
<td class="
single
line
">{{ data_get(
$project
,'projectcode') }} </td>
<td class="
single
line
">{{ data_get(
$project
,'projectname') }} </td>
<td class="
single
line
">{{ data_get(
$project
,'projectmanager') }} </td>
<td class="
single
line
">{{ data_get(
$project
,'projectdirector') }} </td>
<td class="
text
-
center
single
line
">{{ data_get(
$project
,'status') }} </td>
<td class="
text
-
center
single
line
">
<button class="
compact
green
ui
button
" onclick="
window
.
location
.
href
=
'{{ route('
timesheet
::
maintenance
.
senaraiProjectTeam
', ['
id
' => $project['
id
']]) }}'
;
">
...
...
packages/portal/timesheet/routes/web.php
View file @
002dd1f9
...
...
@@ -72,32 +72,32 @@ Route::group(
// route to form
Route
::
get
(
'chargeableForm'
,[
'uses'
=>
'FormController@chargeableForm'
,
'as'
=>
'form.chargeableForm'
]);
Route
::
get
(
'nonChargeableForm'
,[
'uses'
=>
'FormController@nonChargeableForm'
,
'as'
=>
'form.nonChargeableForm'
]);
Route
::
get
(
'overheadForm'
,[
'uses'
=>
'FormController@overheadForm'
,
'as'
=>
'form.overheadForm'
]);
Route
::
post
(
'savechargeablehours'
,[
'uses'
=>
'FormController@savechargeablehours'
,
'as'
=>
'form.savechargeablehours'
]);
Route
::
post
(
'savenonchargeablehours'
,[
'uses'
=>
'FormController@savenonchargeablehours'
,
'as'
=>
'form.savenonchargeablehours'
]);
Route
::
post
(
'saveoverheadhours'
,[
'uses'
=>
'FormController@saveoverheadhours'
,
'as'
=>
'form.saveoverheadhours'
]);
Route
::
post
(
'addOverheadDescription'
,[
'uses'
=>
'FormController@addOverheadDescription'
,
'as'
=>
'form.addOverheadDescription'
]);
Route
::
get
(
'notelist'
,[
'uses'
=>
'FormController@notelist'
,
'as'
=>
'form.notelist'
]);
Route
::
get
(
'penambahannote'
,[
'uses'
=>
'FormController@penambahannote'
,
'as'
=>
'form.penambahannote'
]);
Route
::
post
(
'addnote'
,
[
'uses'
=>
'FormController@addnote'
,
'as'
=>
'form.addnote'
]);
Route
::
get
(
'filterChargeable'
,[
'uses'
=>
'FormController@filterChargeable'
,
'as'
=>
'form.filterChargeable'
]);
Route
::
get
(
'filterNonChargeable'
,[
'uses'
=>
'FormController@filterNonChargeable'
,
'as'
=>
'form.filterNonChargeable'
]);
Route
::
get
(
'filterOverhead'
,[
'uses'
=>
'FormController@filterOverhead'
,
'as'
=>
'form.filterOverhead'
]);
Route
::
get
(
'filterNotes'
,[
'uses'
=>
'FormController@filterNotes'
,
'as'
=>
'form.filterNotes'
]);
Route
::
post
(
'chargeableselectmonthphase'
,
[
'uses'
=>
'FormController@chargeableselectmonthphase'
,
'as'
=>
'form.chargeableselectmonthphase'
]);
Route
::
post
(
'nonchargeableselectmonthphase'
,
[
'uses'
=>
'FormController@nonchargeableselectmonthphase'
,
'as'
=>
'form.nonchargeableselectmonthphase'
]);
Route
::
post
(
'overheadselectmonthphase'
,
[
'uses'
=>
'FormController@overheadselectmonthphase'
,
'as'
=>
'form.overheadselectmonthphase'
]);
Route
::
post
(
'noteselectmonthphase'
,
[
'uses'
=>
'FormController@noteselectmonthphase'
,
'as'
=>
'form.noteselectmonthphase'
]);
Route
::
post
(
'action/upload'
,
[
'uses'
=>
'FormController@uploadAttachement'
,
'as'
=>
'form.upload'
]);
// nonChargeableForm
Route
::
post
(
'addnonchargeabletask'
,[
'uses'
=>
'FormController@addnonchargeabletask'
,
'as'
=>
'form.addnonchargeabletask'
]);
// Route::get('nonChargeableForm',['uses' => 'FormController@nonChargeableForm', 'as' => 'form.nonChargeableForm']);
// Route::post('savenonchargeablehours',['uses' => 'FormController@savenonchargeablehours', 'as' => 'form.savenonchargeablehours']);
// Route::get('filterNonChargeable',['uses' => 'FormController@filterNonChargeable', 'as' => 'form.filterNonChargeable']);
// Route::post('nonchargeableselectmonthphase', ['uses' => 'FormController@nonchargeableselectmonthphase', 'as' => 'form.nonchargeableselectmonthphase']);
// Route::post('addnonchargeabletask',['uses' => 'FormController@addnonchargeabletask', 'as' => 'form.addnonchargeabletask']);
//calendar
Route
::
get
(
'kalendarCharge'
,[
'uses'
=>
'CalendarController@kalendarCharge'
,
'as'
=>
'kalendar.kalendarCharge'
]);
Route
::
get
(
'kalendarNonCharge'
,[
'uses'
=>
'CalendarController@kalendarNonCharge'
,
'as'
=>
'kalendar.kalendarNonCharge'
]);
Route
::
get
(
'kalendar'
,[
'uses'
=>
'CalendarController@kalendar'
,
'as'
=>
'kalendar.kalendar'
]);
//
Route::get('kalendarCharge',['uses' => 'CalendarController@kalendarCharge', 'as' => 'kalendar.kalendarCharge']);
//
Route::get('kalendarNonCharge',['uses' => 'CalendarController@kalendarNonCharge', 'as' => 'kalendar.kalendarNonCharge']);
//
Route::get('kalendar',['uses' => 'CalendarController@kalendar', 'as' => 'kalendar.kalendar']);
//php_sqlsrv_80_ts_x86.dll
Route
::
get
(
'ajax/stafflist/{dept}'
,[
'uses'
=>
'MaintenanceController@loadstaff'
,
'as'
=>
'maintenance.loadstaff'
]);
...
...
packages/portal/timesheet/src/Http/Controllers/MaintenanceController.php
View file @
002dd1f9
...
...
@@ -32,6 +32,8 @@ class MaintenanceController extends Controller
{
$chargeable
=
1
;
$project
=
Project
::
where
(
'p_project_type'
,
$chargeable
)
->
with
(
'projectDirector'
)
->
with
(
'projectManager'
)
->
get
();
$projectlist
=
[];
...
...
@@ -39,28 +41,21 @@ class MaintenanceController extends Controller
if
(
count
(
$project
)
>
0
)
{
foreach
(
$project
as
$key
=>
$value
){
$pm
=
Pteam
::
where
(
'fk_project_id'
,
$value
->
id
)
->
where
(
'role_id'
,
1
)
->
where
(
'pt_project_task_sts'
,
1
)
->
first
();
// dd($pm->pt_team);
$projectlist
[]
=
[
'id'
=>
$value
->
id
,
'projectcode'
=>
$value
->
p_project_code
,
'projectname'
=>
$value
->
p_project_description
,
'projectmanager'
=>
$pm
->
pt_team
,
'projectmanager'
=>
$value
->
projectManager
->
fullname
,
'projectdirector'
=>
$value
->
projectDirector
->
fullname
,
'status'
=>
$value
->
p_project_sts
,
];
}
}
else
{
$projectlist
=
[];
}
return
view
(
'timesheet::maintenance.senaraiProject'
,
compact
(
'projectlist'
));
...
...
@@ -73,14 +68,15 @@ class MaintenanceController extends Controller
->
where
(
'status'
,
1
)
->
get
();
// dd($pm);
return
view
(
'timesheet::maintenance.penambahanProject'
,
compact
(
'pm'
));
$pd
=
Staff_info
::
whereIn
(
'id'
,
[
45
,
46
,
47
])
->
get
();
return
view
(
'timesheet::maintenance.penambahanProject'
,
compact
(
'pm'
,
'pd'
));
}
public
function
addnewproject
(
Request
$request
)
{
$chargeable
=
1
;
$nonchargeable
=
2
;
$userId
=
users
::
find
(
Auth
::
id
())
->
u_staffID
;
...
...
@@ -92,39 +88,38 @@ class MaintenanceController extends Controller
}
else
{
// dd($request);
$project
=
new
Project
;
$project
->
p_project_code
=
$request
->
projectcode
;
$project
->
p_project_description
=
$request
->
projectname
;
$project
->
p_project_type
=
$chargeable
;
$project
->
p_project_task_team
=
$request
->
projectmanager
;
$project
->
p_project_director
=
$request
->
projectdirector
;
$project
->
p_project_sts
=
$request
->
status
;
$project
->
updated_by
=
$userId
;
$project
->
save
();
$noncharge
=
new
Project
;
$noncharge
->
p_project_description
=
$request
->
projectname
;
$noncharge
->
p_project_type
=
$nonchargeable
;
$noncharge
->
p_project_sts
=
$request
->
status
;
$noncharge
->
updated_by
=
$userId
;
$noncharge
->
save
();
$projectId
=
Project
::
select
(
'id'
)
->
where
(
'p_project_code'
,
$request
->
projectcode
)
->
value
(
'id'
);
$sname
=
Staff_info
::
select
(
'fullname'
)
->
where
(
'staff_id'
,
$request
->
projectmanager
)
->
value
(
'fullname'
);
// dd($projectId);
$project
=
Project
::
where
(
'p_project_code'
,
$request
->
projectcode
)
->
with
(
'projectDirector'
)
->
with
(
'projectManager'
)
->
first
();
$team
=
new
Pteam
;
$team
->
role_id
=
1
;
$team
->
pt_project_description
=
$request
->
projectname
;
$team
->
fk_project_id
=
$projectId
;
$team
->
pt_staff_id
=
$request
->
projectmanager
;
$team
->
pt_team
=
$sname
;
$team
->
fk_project_id
=
$project
->
id
;
$team
->
pt_staff_id
=
$project
->
projectManager
->
staff_id
;
$team
->
pt_team
=
$project
->
projectManager
->
fullname
;
$team
->
pt_project_type
=
$chargeable
;
$team
->
pt_project_task_sts
=
1
;
$team
->
updated_by
=
$userId
;
$team
->
save
();
$team
=
new
Pteam
;
$team
->
role_id
=
7
;
$team
->
pt_project_description
=
$request
->
projectname
;
$team
->
fk_project_id
=
$project
->
id
;
$team
->
pt_staff_id
=
$project
->
projectDirector
->
staff_id
;
$team
->
pt_team
=
$project
->
projectDirector
->
fullname
;
$team
->
pt_project_type
=
$chargeable
;
$team
->
pt_project_task_sts
=
1
;
$team
->
updated_by
=
$userId
;
...
...
packages/portal/timesheet/src/Model/Project.php
View file @
002dd1f9
...
...
@@ -18,6 +18,11 @@ class Project extends Model
return
$this
->
hasOne
(
'Portal\Timesheet\Model\Staff_info'
,
'staff_id'
,
'p_project_task_team'
);
}
public
function
projectDirector
()
{
return
$this
->
hasOne
(
'Portal\Timesheet\Model\Staff_info'
,
'id'
,
'p_project_director'
);
}
public
function
projectTeam
()
{
return
$this
->
hasOne
(
'Portal\Timesheet\Model\Pteam'
,
'fk_project_id'
,
'id'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment