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
1b125b1e
Commit
1b125b1e
authored
Jun 29, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter pm selection, changes in overhead description modal, validation and check null error
parent
8f784e21
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
128 additions
and
42 deletions
+128
-42
packages/portal/timesheet/resources/views/ajax/senaraistaff.blade.php
+8
-5
packages/portal/timesheet/resources/views/dashboard/chargeableForm.blade.php
+1
-1
packages/portal/timesheet/resources/views/dashboard/editProjectTeam.blade.php
+1
-1
packages/portal/timesheet/resources/views/dashboard/nonChargeableForm.blade.php
+2
-2
packages/portal/timesheet/resources/views/dashboard/overheadForm.blade.php
+5
-6
packages/portal/timesheet/resources/views/dashboard/penambahanProject.blade.php
+6
-4
packages/portal/timesheet/resources/views/dashboard/penambahanProjectTeam.blade.php
+1
-1
packages/portal/timesheet/resources/views/dashboard/senaraiProject.blade.php
+4
-4
packages/portal/timesheet/routes/web.php
+3
-1
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+87
-17
packages/portal/timesheet/src/Model/Project.php
+5
-0
packages/portal/timesheet/src/Model/Staff_info.php
+5
-0
No files found.
packages/portal/timesheet/resources/views/ajax/senaraistaff.blade.php
View file @
1b125b1e
@
foreach
(
$staffs
as
$key
=>
$staff
)
<
div
class
="
item
" data-value="
{{
$staff
->
id
}}
" data-text="
{{
$staff
->
fullname
}}
">
@
if
(
$staffs
)
@
foreach
(
$staffs
as
$key
=>
$staff
)
<
div
class
="
item
" data-value="
{{
$staff
->
id
}}
" data-text="
{{
$staff
->
fullname
}}
">
{
{$staff->fullname}
}
</div>
@endforeach
\ No newline at end of file
</div>
@endforeach
@else
@endif
\ No newline at end of file
packages/portal/timesheet/resources/views/dashboard/chargeableForm.blade.php
View file @
1b125b1e
...
...
@@ -45,7 +45,7 @@ input[type=number] {
<input type="
hidden
" name="
year
" value="
{{
$year
}}
">
<input type="
hidden
" name="
month
" value="
{{
$month
}}
">
<input type="
hidden
" name="
phase
" value="
{{
$phase
}}
">
<table class="
ui
celled
structured
table
">
<table class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th colspan="
2
">Chargeable</th>
...
...
packages/portal/timesheet/resources/views/dashboard/editProjectTeam.blade.php
View file @
1b125b1e
...
...
@@ -16,7 +16,7 @@
<div class="
field
">
<label>Role</label>
<select name="
role
" class="
ui
fluid
dropdown
">
<option value="
">Role
</option>
<option value="
{{
$team
->
role_id
}}
">
{
{$teamRole->role}
}
</option>
@foreach(
$role
as
$key
=>
$value
)
<option value="
{{
$value
->
id
}}
">
{
{$value->role}
}
</option>
@endforeach
...
...
packages/portal/timesheet/resources/views/dashboard/nonChargeableForm.blade.php
View file @
1b125b1e
...
...
@@ -31,7 +31,7 @@ input[type=number] {
<div class="
default
text
">Task</div>
<div class="
menu
">
@foreach(
$nonchargeables
as
$key
=>
$nonchargeable
)
<div class="
item
" data-value="
{{
$nonchargeable
->
id
}}
">
{
{
$nonchargeable->p_project_description
}
}
</div>
<div class="
item
" data-value="
{{
$nonchargeable
->
id
}}
">{{
data_get(
$nonchargeable
, 'p_project_description')
}}</div>
@endforeach
</div>
</div>
...
...
@@ -98,7 +98,7 @@ input[type=number] {
<input type="
hidden
" name="
year
" value="
{{
$year
}}
">
<input type="
hidden
" name="
month
" value="
{{
$month
}}
">
<input type="
hidden
" name="
phase
" value="
{{
$phase
}}
">
<table class="
ui
celled
structured
table
">
<table class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th class="
single
line
">Non-Chargeable</th>
...
...
packages/portal/timesheet/resources/views/dashboard/overheadForm.blade.php
View file @
1b125b1e
...
...
@@ -45,7 +45,8 @@ input[type=number] {
<input type="
hidden
" name="
year
" value="
{{
$year
}}
">
<input type="
hidden
" name="
month
" value="
{{
$month
}}
">
<input type="
hidden
" name="
phase
" value="
{{
$phase
}}
">
<table class="
ui
celled
structured
table
">
<table class="
ui
celled
structured
unstackable
table
" >
<thead>
<tr>
<th>Overhead</th>
...
...
@@ -101,7 +102,7 @@ input[type=number] {
}
?>
<td >
<input type="
text
" onkeypress="
onlynumber
(
event
)
" id="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" name="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" value="
@
if
(
$valuehour
){{
$valuehour
->
td_hours
}}
@
else
@
endif
" min="
0
" max="
24
" style="
padding
:
2
px
;
margin
:
unset
" onchange="
limiter
(
this
,
'{{$project['
td_project
']}}'
);
">
<input type="
text
" onkeypress="
onlynumber
(
event
)
" id="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" name="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" value="
@
if
(
$valuehour
){{
$valuehour
->
td_hours
}}
@
else
@
endif
" min="
0
" max="
24
"
size="
2
"
style="
padding
:
2
px
;
margin
:
unset
" onchange="
limiter
(
this
,
'{{$project['
td_project
']}}'
);
">
</td>
@endfor
@else
...
...
@@ -122,7 +123,6 @@ input[type=number] {
$total
+= data_get(
$valuehour
,'td_hours');
}
?>
<td >
<input type="
text
" onkeypress="
onlynumber
(
event
)
" id="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" name="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" value="
@
if
(
$valuehour
){{
$valuehour
->
td_hours
}}
@
else
@
endif
" min="
0
" max="
24
" style="
padding
:
2
px
;
margin
:
unset
" onchange="
limiter
(
this
,
'{{$project['
td_project
']}}'
);
">
...
...
@@ -130,9 +130,7 @@ input[type=number] {
@endfor
@endif
<td>
<button class="
ui
center
blue
button
">
<i class="
ui
center
edit
white
icon
"></i>
</button>
<input type="
text
" name="
desc
" value="
icon
">
</td>
<td>
<input type="
text
" onkeypress="
onlynumber
(
event
)
" name="
total
-
{{
$project
[
'td_project'
]}}
" id="
total
-
{{
$project
[
'td_project'
]}}
" style="
padding
-
right
:
4
px
;
padding
-
left
:
4
px
;
" onchange="
limiter
(
this
,
'{{$project['
td_project
']}}'
);
" readonly="" value=
{
{$total}
}
>
...
...
@@ -154,6 +152,7 @@ input[type=number] {
Phase 1
</button>
@endif
</div>
@endsection
...
...
packages/portal/timesheet/resources/views/dashboard/penambahanProject.blade.php
View file @
1b125b1e
...
...
@@ -18,19 +18,21 @@
<label>Project Manager</label>
<select name="
projectmanager
" class="
ui
fluid
dropdown
">
<option value="">Project Manager</option>
<option value="
842
">Rashdan</option>
<option value="
920
">Maimunah</option>
@foreach(
$pm
as
$key
=>
$value
)
<option value="
{{
$value
->
staff_id
}}
">
{
{$value->fullname}
}
</option>
@endforeach
</select>
</div>
<div class="
field
">
<label>Project Status</label>
<select name="
status
" class="
ui
fluid
dropdown
">
<
option value="">Project Status</option
>
<
!-- <option value="">Project Status</option> --
>
<option value="
1
">Active</option>
<option value="
0
">Inactive</option>
</select>
</div>
<button class="
ui
button
" type="
submit
">Submit</button>
<button class="
ui
blue
button
" type="
submit
">Submit</button>
<button class="
ui
green
button
" type="
button
" onclick="
window
.
location
.
href
=
'{{ route('
timesheet
::
dashboard
.
senaraiProject
') }} '
;
">Back</button>
</form>
</div>
...
...
packages/portal/timesheet/resources/views/dashboard/penambahanProjectTeam.blade.php
View file @
1b125b1e
...
...
@@ -49,7 +49,7 @@
<div class="
field
">
<label>Project Status</label>
<select name="
status
" class="
ui
fluid
dropdown
">
<
option value="">Project Team Status</option
>
<
!-- <option value="">Project Team Status</option> --
>
<option value="
1
">Active</option>
<option value="
0
">Inactive</option>
</select>
...
...
packages/portal/timesheet/resources/views/dashboard/senaraiProject.blade.php
View file @
1b125b1e
...
...
@@ -22,10 +22,10 @@
@foreach(
$projectlist
as
$key
=>
$project
)
<tr>
<td>
{
{$key+1}
}
</td>
<td>
{
{
$project['projectcode']
}
}
</td>
<td>
{
{
$project['projectname']
}
}
</td>
<td>
{
{
$project['projectmanager']
}
}
</td>
<td>
{
{
$project['status']
}
}
</td>
<td>{{
data_get(
$project
,'projectcode')
}} </td>
<td>{{
data_get(
$project
,'projectname')
}} </td>
<td>{{
data_get(
$project
,'projectmanager')
}} </td>
<td>{{
data_get(
$project
,'status')
}} </td>
<td><a href="
{{
route
(
'timesheet::dashboard.senaraiProjectTeam'
,
[
'id'
=>
$project
[
'id'
]])
}}
">Project Team</a></td>
</tr>
@endforeach
...
...
packages/portal/timesheet/routes/web.php
View file @
1b125b1e
...
...
@@ -9,8 +9,10 @@ Route::group(
],
function
()
{
//dashboard
Route
::
get
(
'home'
,[
'uses'
=>
'DashboardController@index'
,
'as'
=>
'dashboard.index'
]);
//maintenance
Route
::
get
(
'senaraiProject'
,[
'uses'
=>
'DashboardController@senaraiProject'
,
'as'
=>
'dashboard.senaraiProject'
]);
Route
::
get
(
'penambahanProject'
,[
'uses'
=>
'DashboardController@penambahanProject'
,
'as'
=>
'dashboard.penambahanProject'
]);
Route
::
get
(
'senaraiProjectTeam'
,[
'uses'
=>
'DashboardController@senaraiProjectTeam'
,
'as'
=>
'dashboard.senaraiProjectTeam'
]);
...
...
@@ -31,12 +33,12 @@ Route::group(
// nonChargeableForm
Route
::
post
(
'addnonchargeabletask'
,[
'uses'
=>
'DashboardController@addnonchargeabletask'
,
'as'
=>
'dashboard.addnonchargeabletask'
]);
// route to form
Route
::
get
(
'chargeableForm'
,[
'uses'
=>
'DashboardController@chargeableForm'
,
'as'
=>
'dashboard.chargeableForm'
]);
Route
::
get
(
'nonChargeableForm'
,[
'uses'
=>
'DashboardController@nonChargeableForm'
,
'as'
=>
'dashboard.nonChargeableForm'
]);
Route
::
get
(
'overheadForm'
,[
'uses'
=>
'DashboardController@overheadForm'
,
'as'
=>
'dashboard.overheadForm'
]);
//calendar
Route
::
get
(
'kalendarCharge'
,[
'uses'
=>
'DashboardController@kalendarCharge'
,
'as'
=>
'dashboard.kalendarCharge'
]);
Route
::
get
(
'kalendarNonCharge'
,[
'uses'
=>
'DashboardController@kalendarNonCharge'
,
'as'
=>
'dashboard.kalendarNonCharge'
]);
Route
::
get
(
'kalendar'
,[
'uses'
=>
'DashboardController@kalendar'
,
'as'
=>
'dashboard.kalendar'
]);
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
1b125b1e
...
...
@@ -78,51 +78,73 @@ class DashboardController extends Controller
public
function
senaraiProject
()
{
$project
=
Project
::
all
();
$chargeable
=
1
;
$project
=
Project
::
where
(
'p_project_type'
,
$chargeable
)
->
get
();
$projectlist
=
[];
// nanti project code query dari table project:
if
(
count
(
$project
)
>
0
)
{
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
();
foreach
(
$project
as
$key
=>
$value
)
{
// dd($pm->pt_team);
$projectlist
[]
=
[
'id'
=>
$value
->
id
,
'projectcode'
=>
$value
->
p_project_code
,
'projectname'
=>
$value
->
p_project_description
,
'projectmanager'
=>
$
value
->
projectManager
->
fullname
,
'projectmanager'
=>
$
pm
->
pt_team
,
'status'
=>
$value
->
p_project_sts
,
];
}
}
else
{
$projectlist
=
null
;
}
// dd($projectlist);
$projectlist
=
[];
}
return
view
(
'timesheet::dashboard.senaraiProject'
,
compact
(
'projectlist'
));
}
public
function
penambahanProject
()
{
$pms
=
4
;
$pm
=
DB
::
table
(
'staff_info'
)
// ->where('fk_lkp_department', $pms)
->
where
(
'flag_pm'
,
1
)
->
where
(
'status'
,
1
)
// ->join('users', 'u_staffID', '=', 'staff_id')
->
get
();
return
view
(
'timesheet::dashboard.penambahanProject'
);
// dd($pm);
return
view
(
'timesheet::dashboard.penambahanProject'
,
compact
(
'pm'
));
}
public
function
addnewproject
(
Request
$request
)
{
$chargeable
=
1
;
$nonchargeable
=
2
;
$userId
=
users
::
find
(
Auth
::
id
())
->
u_staffID
;
if
(
$request
->
projectcode
==
null
||
$request
->
projectname
==
null
||
$request
->
projectmanager
==
null
)
{
return
redirect
()
->
route
(
'timesheet::dashboard.penambahanProject'
)
->
withErrors
(
'The information is not complete. Please re-enter!'
);
}
else
{
// dd($request);
$project
=
new
Project
;
$project
->
p_project_code
=
$request
->
projectcode
;
$project
->
p_project_description
=
$request
->
projectname
;
...
...
@@ -132,14 +154,47 @@ class DashboardController extends Controller
$project
->
updated_by
=
$userId
;
$project
->
save
();
return
redirect
()
->
route
(
'timesheet::dashboard.penambahanProject'
)
$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);
$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
->
pt_project_type
=
$chargeable
;
$team
->
pt_project_task_sts
=
1
;
$team
->
updated_by
=
$userId
;
$team
->
save
();
}
return
redirect
()
->
route
(
'timesheet::dashboard.senaraiProject'
)
->
with
(
'success'
,
'New Project Added'
);
}
public
function
senaraiProjectTeam
(
Request
$request
)
{
$chargeable
=
1
;
$pid
=
$request
->
id
;
$project
=
Pteam
::
where
(
'fk_project_id'
,
$request
->
id
)
->
where
(
'pt_project_type'
,
$chargeable
)
// ->where('pt_project_task_sts', 1)
->
orderBy
(
'pt_project_task_sts'
,
'DESC'
)
->
orderBy
(
'role_id'
)
->
get
();
$projectlist
=
[];
...
...
@@ -172,7 +227,7 @@ class DashboardController extends Controller
->
first
();
//find($request->id);
$departments
=
Department
::
all
()
->
except
([
7
,
8
]);
->
except
([
7
]);
// ->except($departments->code,['']);
foreach
(
$departments
as
$key
=>
$value
)
...
...
@@ -198,6 +253,12 @@ class DashboardController extends Controller
$expstaff
=
explode
(
','
,
$request
->
staffId
);
if
(
$request
->
staffId
==
null
||
$request
->
role
==
null
)
{
dd
(
$request
);
return
redirect
()
->
route
(
'timesheet::dashboard.penambahanProjectTeam'
,
[
'pcode'
=>
$request
->
pcode
,
'pname'
=>
$request
->
pname
,
$request
->
id
]);
}
else
{
foreach
(
$expstaff
as
$key
=>
$value
)
{
$staff
=
Staff_info
::
where
(
'fk_users'
,
$value
)
...
...
@@ -218,6 +279,8 @@ class DashboardController extends Controller
$pt
->
save
();
}
}
return
redirect
()
->
route
(
'timesheet::dashboard.senaraiProject'
)
->
with
(
'success'
,
'Project Team Added Successfully'
);
...
...
@@ -228,11 +291,15 @@ class DashboardController extends Controller
$team
=
Pteam
::
where
(
'id'
,
$request
->
id
)
->
first
();
$teamRole
=
Role
::
where
(
'id'
,
$team
->
role_id
)
->
first
();
// dd($team);
$role
=
Role
::
all
();
// dd($role);
$pid
=
$team
->
fk_project_id
;
return
view
(
'timesheet::dashboard.editprojectteam'
,
compact
(
'team'
,
'pid'
,
'role'
));
return
view
(
'timesheet::dashboard.editprojectteam'
,
compact
(
'team'
,
'pid'
,
'role'
,
'teamRole'
));
}
public
function
updateprojectteam
(
Request
$request
)
...
...
@@ -419,19 +486,22 @@ class DashboardController extends Controller
{
$hour
=
null
;
}
return
view
(
'timesheet::dashboard.chargeableForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
));
}
public
function
nonChargeableForm
(
Request
$request
)
{
$nonchargeable
=
2
;
$userId
=
users
::
find
(
Auth
::
id
())
->
u_staffID
;
$nonchargeables
=
Project
::
all
();
$nonchargeables
=
Project
::
where
(
'p_project_type'
,
$nonchargeable
)
->
get
();
$project
=
Pteam
::
where
(
'pt_staff_id'
,
$userId
)
->
where
(
'pt_project_type'
,
2
)
->
where
(
'pt_project_type'
,
$nonchargeable
)
->
get
();
$projectlist
=
[];
...
...
@@ -738,7 +808,7 @@ class DashboardController extends Controller
$date
=
$request
->
year
.
'-'
.
$request
->
month
.
'-'
.
sprintf
(
'%02d'
,
$keyday
);
$checkTimesheetDetail
=
Ts_detail
::
where
(
'td_project'
,
$projectid
)
->
where
(
'td_project_type'
,
$
non
chargeable
)
->
where
(
'td_project_type'
,
$chargeable
)
->
where
(
'td_date'
,
$date
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
first
();
...
...
packages/portal/timesheet/src/Model/Project.php
View file @
1b125b1e
...
...
@@ -18,6 +18,11 @@ class Project extends Model
return
$this
->
hasOne
(
'Portal\Timesheet\Model\Staff_info'
,
'staff_id'
,
'p_project_task_team'
);
}
public
function
projectTeam
()
{
return
$this
->
hasOne
(
'Portal\Timesheet\Model\Pteam'
,
'fk_project_id'
,
'id'
);
}
/**
* undocumented function
*
...
...
packages/portal/timesheet/src/Model/Staff_info.php
View file @
1b125b1e
...
...
@@ -18,6 +18,11 @@ class Staff_info extends Model
return
$this
->
hasMany
(
'Portal\Timesheet\Model\Department'
,
'id'
,
'fk_lkp_department'
);
}
public
function
toUser
()
{
return
$this
->
hasOne
(
'Portal\Timesheet\Model\Users'
,
'u_staffID'
,
'staff_id'
);
}
// public function project_code()
// {
// return $this->hasMany('Portal\Timesheet\Model\Ts_detail','td_project','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