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
d1a8e31e
Commit
d1a8e31e
authored
Jun 23, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes in nonchargeable
parent
10cbb645
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
202 additions
and
59 deletions
+202
-59
database/migrations/2022_06_23_104235_add_project_type_column.php
+32
-0
database/migrations/2022_06_23_123259_add_project_type_column_in_project_team.php
+32
-0
packages/portal/timesheet/resources/views/dashboard/editProjectTeam.blade.php
+6
-7
packages/portal/timesheet/resources/views/dashboard/nonChargeableForm.blade.php
+39
-12
packages/portal/timesheet/routes/web.php
+5
-0
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+66
-19
packages/portal/timesheet/src/ServiceProvider.php
+22
-21
No files found.
database/migrations/2022_06_23_104235_add_project_type_column.php
0 → 100644
View file @
d1a8e31e
<?php
use
Illuminate\Support\Facades\Schema
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
class
AddProjectTypeColumn
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'project'
,
function
(
Blueprint
$table
)
{
$table
->
integer
(
'p_project_type'
)
->
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_type'
);
});
}
}
database/migrations/2022_06_23_123259_add_project_type_column_in_project_team.php
0 → 100644
View file @
d1a8e31e
<?php
use
Illuminate\Support\Facades\Schema
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
class
AddProjectTypeColumnInProjectTeam
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'project_team'
,
function
(
Blueprint
$table
)
{
$table
->
integer
(
'pt_project_type'
)
->
after
(
'pt_staff_id'
)
->
unsigned
()
->
nullable
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
table
(
'project_team'
,
function
(
Blueprint
$table
)
{
$table
->
dropColumn
(
'pt_project_type'
);
});
}
}
packages/portal/timesheet/resources/views/dashboard/editProjectTeam.blade.php
View file @
d1a8e31e
...
...
@@ -11,22 +11,21 @@
<input type="
hidden
" name="
pid
" value="
{{
$team
->
fk_project_id
}}
">
<div class="
field
">
<label for="
projectteam
">Project Team</label>
<input
onselect="
myDepartment
()
"
type="
text
" name="
projectteam
" value="
{{
$team
->
pt_team
}}
" readonly="
readonly
">
<input type="
text
" name="
projectteam
" value="
{{
$team
->
pt_team
}}
" readonly="
readonly
">
</div>
<div class="
field
">
<label>Role</label>
<select name="
role
" class="
ui
fluid
dropdown
">
<option value="">Role</option>
<option value="
1
">Program Executive</option>
<option value="
2
">Developer</option>
<option value="
3
">System Analyst</option>
<option value="
4
">Tester</option>
@foreach(
$role
as
$key
=>
$value
)
<option value="
{{
$value
->
id
}}
">
{
{$value->role}
}
</option>
@endforeach
</select>
</div>
<div class="
field
">
<label>Project Status</label>
<label>Project
Team
Status</label>
<select name="
status
" class="
ui
fluid
dropdown
">
<option value="">Project 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/nonChargeableForm.blade.php
View file @
d1a8e31e
...
...
@@ -18,13 +18,39 @@ input[type=number] {
<
div
class
="
ui
small
modal
task
">
<div class="
header
">
Add
Task
Add Non-Chargeable
Task
</div>
<form action="">
<div class="
content
">
<form class="
ui
form
" action="
{{
route
(
'timesheet::dashboard.addnonchargeabletask'
)}}
" method="
POST
">
{
{csrf_field()}
}
<div class="
field
">
<label>Select Task</label>
<div class="
ui
selection
dropdown
">
<input type="
hidden
" name="
chargeableProject
">
<i class="
dropdown
icon
"></i>
<div class="
default
text
">Task</div>
<div class="
menu
">
@foreach(
$chargeables
as
$key
=>
$chargeable
)
<div class="
item
" data-value="
{{
$chargeable
->
p_project_description
}}
">
{
{$chargeable->p_project_description}
}
</div>
@endforeach
</div>
</div>
</div>
<div class="
field
">
<label>Non-Chargeable Task (**optional)</label>
<input type="
text
" name="
nonChargeableProject
" placeholder="
Add
New
Task
">
</div>
<div class="
field
">
<label>Task Status</label>
<select name="
status
" class="
ui
fluid
dropdown
">
<option value="">Task Status</option>
<option value="
1
">Active</option>
<option value="
0
">Inactive</option>
</select>
</div>
<button class="
ui
close
button
">Cancel</button>
<button class="
ui
blue
button
" type="
submit
">Submit</button>
</form>
<div class="
actions
">
<div class="
ui
blue
button
">Add</div>
</div>
</div>
...
...
@@ -75,7 +101,7 @@ input[type=number] {
<table class="
ui
celled
structured
table
">
<thead>
<tr>
<th c
olspan="
2
">Non-Chargeable</th>
<th c
lass="
single
line
">Non-Chargeable</th>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<th>
<button type="
submit
" class="
fluid
center
aligned
ui
blue
compact
labeled
icon
button
">
...
...
@@ -85,7 +111,6 @@ input[type=number] {
</th>
</tr>
<tr>
<th class="
single
line
">Project Code</th>
<th class="
single
line
">Project Name</th>
@if(
$phase
== 1)
...
...
@@ -110,9 +135,6 @@ input[type=number] {
<?php
$total
= 0; ?>
<tr>
<td class="
single
line
">
{
{$project['td_project_code']}
}
</td>
<td class="
single
line
">
{
{$project['td_project_name']}
}
</td>
@if(
$phase
== 1)
...
...
@@ -180,12 +202,17 @@ input[type=number] {
<script>
$(function(){
$("
#task").click(function(){
$("
#task").click(function()
{
$
(
".task"
)
.
modal
(
'show'
);
});
$
(
".task"
)
.
modal
({
$
(
".task"
)
.
modal
(
{
closable
:
true
});
$
(
".task"
)
.
modal
(
'attach events'
,
'.close.button'
);
});
</
script
>
...
...
packages/portal/timesheet/routes/web.php
View file @
d1a8e31e
...
...
@@ -28,6 +28,11 @@ Route::group(
Route
::
get
(
'editPeranan'
,[
'uses'
=>
'DashboardController@editPeranan'
,
'as'
=>
'dashboard.editPeranan'
]);
Route
::
post
(
'updaterole'
,[
'uses'
=>
'DashboardController@updaterole'
,
'as'
=>
'dashboard.updaterole'
]);
// 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'
]);
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
d1a8e31e
...
...
@@ -136,7 +136,9 @@ class DashboardController extends Controller
public
function
senaraiProjectTeam
(
Request
$request
)
{
$pid
=
$request
->
id
;
$project
=
Pteam
::
where
(
'fk_project_id'
,
$request
->
id
)
->
get
();
$project
=
Pteam
::
where
(
'fk_project_id'
,
$request
->
id
)
->
orderBy
(
'role_id'
)
->
get
();
$projectlist
=
[];
// dd($projectlistct);
...
...
@@ -163,9 +165,12 @@ class DashboardController extends Controller
public
function
penambahanProjectTeam
(
Request
$request
)
{
$pid
=
$request
->
id
;
$project
=
Project
::
where
(
'id'
,
$request
->
id
)
->
first
();
//find($request->id);
$project
=
Project
::
where
(
'id'
,
$request
->
id
)
->
first
();
//find($request->id);
$departments
=
Department
::
all
()
->
except
([
7
,
8
]);
// ->except($departments->code,['']);
foreach
(
$departments
as
$key
=>
$value
)
{
...
...
@@ -183,6 +188,8 @@ class DashboardController extends Controller
public
function
addprojectteam
(
Request
$request
)
{
$chargeable
=
1
;
$userId
=
users
::
find
(
Auth
::
id
())
->
u_staffID
;
...
...
@@ -203,6 +210,7 @@ class DashboardController extends Controller
$pt
->
pt_project_task_sts
=
$request
->
status
;
$pt
->
role_id
=
$request
->
role
;
$pt
->
updated_by
=
$userId
;
$pt
->
pt_project_type
=
$chargeable
;
$pt
->
save
();
}
...
...
@@ -216,9 +224,11 @@ class DashboardController extends Controller
$team
=
Pteam
::
where
(
'id'
,
$request
->
id
)
->
first
();
$role
=
Role
::
all
();
// dd($role);
$pid
=
$team
->
fk_project_id
;
return
view
(
'timesheet::dashboard.editprojectteam'
,
compact
(
'team'
,
'pid'
));
return
view
(
'timesheet::dashboard.editprojectteam'
,
compact
(
'team'
,
'pid'
,
'role'
));
}
public
function
updateprojectteam
(
Request
$request
)
...
...
@@ -226,31 +236,33 @@ class DashboardController extends Controller
$pid
=
$request
->
pid
;
$userId
=
users
::
find
(
Auth
::
id
())
->
u_staffID
;
// dd($request);
$team
=
Pteam
::
where
(
'id'
,
$request
->
id
)
->
first
();
$team
->
pt_project_task_sts
=
$request
->
status
;
$team
->
role_id
=
$request
->
role
;
$team
->
updated_by
=
$userId
;
// letak query utk update role
// $team->pt_role = $request->role;
$team
->
update
();
$project
=
Pteam
::
where
(
'fk_project_id'
,
$request
->
pid
)
->
get
();
//
$project = Pteam::where('fk_project_id',$request->pid)
//
->get();
$projectlist
=
[];
foreach
(
$project
as
$key
=>
$value
)
{
//
$projectlist = [];
//
foreach ($project as $key => $value) {
$projectlist
[]
=
[
//
$projectlist[] = [
'id'
=>
$value
->
id
,
'projectcode'
=>
$value
->
toProject
->
p_project_code
,
'projectname'
=>
$value
->
pt_project_description
,
'projectteam'
=>
$value
->
pt_team
,
'status'
=>
$value
->
pt_project_task_sts
,
];
//
'id' => $value->id,
//
'projectcode' => $value->toProject->p_project_code,
//
'projectname' => $value->pt_project_description,
//
'projectteam' => $value->pt_team,
//
'status' => $value->pt_project_task_sts,
//
];
}
return
view
(
'timesheet::dashboard.senaraiProjectTeam'
,
compact
(
'projectlist'
,
'project'
,
'pid'
));
// }
return
redirect
()
->
route
(
'timesheet::dashboard.senaraiProjectTeam'
,
[
'id'
=>
$pid
])
->
with
(
'success'
,
'Project Team Edited Successfully'
);;
}
public
function
senaraiPeranan
()
...
...
@@ -408,11 +420,12 @@ class DashboardController extends Controller
$userId
=
users
::
find
(
Auth
::
id
())
->
u_staffID
;
$chargeables
=
Project
::
all
();
$project
=
Pteam
::
where
(
'pt_staff_id'
,
$userId
)
->
get
();
$projectlist
=
[];
// nanti project code query dari table project:
foreach
(
$project
as
$key
=>
$value
)
{
...
...
@@ -474,7 +487,41 @@ class DashboardController extends Controller
{
$hour
=
null
;
}
return
view
(
'timesheet::dashboard.nonchargeableForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
));
return
view
(
'timesheet::dashboard.nonchargeableForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
,
'chargeables'
));
}
public
function
addnonchargeabletask
(
Request
$request
)
{
$nonchargeable
=
2
;
$user
=
Users
::
select
(
'name'
,
'u_staffID'
)
->
where
(
'id'
,
Auth
::
id
())
->
first
();
// dd($user->name);
if
(
$request
->
chargeableProject
!=
null
&&
$request
->
nonChargeableProject
==
null
)
{
dd
(
'select only'
);
// $data = new Pteam;
// $data->pt_project_description = $request->chargeableProject;
// $data->pt_team = $user->name;
// $data->pt_staff_id = $user->u_staffID;
// $data->pt_project_task_sts = $request->status;
// $data->updated_by = $user->u_staffID;
// $data->pt_project_type = $nonchargeable;
}
else
if
(
$request
->
chargeableProject
!=
null
&&
$request
->
nonChargeableProject
!=
null
)
{
dd
(
'select and input'
);
}
else
if
(
$request
->
chargeableProject
==
null
&&
$request
->
nonChargeableProject
!=
null
)
{
dd
(
'input ja'
);
}
else
{
dd
(
'blank'
);
}
// $data = new Pteam;
// $data =
}
public
function
overheadForm
(
Request
$request
)
...
...
packages/portal/timesheet/src/ServiceProvider.php
View file @
d1a8e31e
...
...
@@ -58,19 +58,19 @@ class ServiceProvider extends BaseServiceProvider
->
data
(
'icon'
,
'calendar alternate outline'
)
->
active
(
'kalendar/*'
)
->
data
(
'permission'
,
Permission
::
kehadiran
);
$dashboard
->
add
(
__
(
'Timesheet Viewer'
)
,
route
(
'timesheet::dashboard.timesheetViewer'
)
)
$dashboard
->
add
(
__
(
'Timesheet Viewer'
))
->
data
(
'icon'
,
'eye icon'
)
->
active
(
'timesheetViewer/*'
)
->
data
(
'permission'
,
Permission
::
kehadiran
);
$dashboard
->
add
(
__
(
'Timesheet Review'
)
,
route
(
'timesheet::dashboard.timesheetReview'
)
)
$dashboard
->
add
(
__
(
'Timesheet Review'
))
->
data
(
'icon'
,
'file alternate icon'
)
->
active
(
'timesheetReview/*'
)
->
data
(
'permission'
,
Permission
::
kehadiran
);
$dashboard
->
add
(
__
(
'Timesheet Approval'
)
,
route
(
'timesheet::dashboard.timesheetApproval'
)
)
$dashboard
->
add
(
__
(
'Timesheet Approval'
))
->
data
(
'icon'
,
'check square icon'
)
->
active
(
'timesheetApproval/*'
)
->
data
(
'permission'
,
Permission
::
kehadiran
);
$dashboard
->
add
(
__
(
'Timesheet Report'
)
,
route
(
'timesheet::dashboard.timesheetReport'
)
)
$dashboard
->
add
(
__
(
'Timesheet Report'
))
->
data
(
'icon'
,
'file alternate icon'
)
->
active
(
'timesheetReport/*'
)
->
data
(
'permission'
,
Permission
::
kehadiran
);
...
...
@@ -84,11 +84,11 @@ class ServiceProvider extends BaseServiceProvider
->
data
(
'icon'
,
'users icon'
)
->
active
(
'pengurusan/*'
)
->
data
(
'permission'
,
Permission
::
pengurusan
);
$pengurusanProject
->
add
(
__
(
'Senarai Project Team'
)
,
route
(
'timesheet::dashboard.senaraiProjectTeam'
)
)
$pengurusanProject
->
add
(
__
(
'Senarai Project Team'
))
->
data
(
'icon'
,
'users icon'
)
->
active
(
'pengurusan/*'
)
->
data
(
'permission'
,
Permission
::
pengurusan
);
$pengurusanProject
->
add
(
__
(
'Penambahan Project Team'
)
,
route
(
'timesheet::dashboard.penambahanProjectTeam'
)
)
$pengurusanProject
->
add
(
__
(
'Penambahan Project Team'
))
->
data
(
'icon'
,
'users icon'
)
->
active
(
'pengurusan/*'
)
->
data
(
'permission'
,
Permission
::
pengurusan
);
...
...
@@ -109,12 +109,6 @@ class ServiceProvider extends BaseServiceProvider
->
active
(
'pengurusan/*'
)
->
data
(
'permission'
,
Permission
::
pengurusan
);
$calendar
=
$this
->
app
[
'laravolt.menu'
]
->
add
(
__
(
'Kalendar'
))
->
data
(
'icon'
,
'calendar alternate'
);
$calendar
->
add
(
__
(
'Kalendar'
),
route
(
'timesheet::dashboard.kalendar'
))
->
data
(
'icon'
,
'calendar alternate outline'
)
->
active
(
'kalendar/*'
)
->
data
(
'permission'
,
Permission
::
calendar
);
// $calendar->add(__('Chargeable'), route('timesheet::dashboard.kalendarCharge'))
// ->data('icon', 'calendar alternate outline')
// ->active('kalendarCharge/*')
...
...
@@ -141,19 +135,25 @@ class ServiceProvider extends BaseServiceProvider
->
active
(
'overheadForm/*'
)
->
data
(
'permission'
,
Permission
::
kehadiran
);
$calendar
=
$this
->
app
[
'laravolt.menu'
]
->
add
(
__
(
'Kalendar'
))
->
data
(
'icon'
,
'calendar alternate'
);
$calendar
->
add
(
__
(
'Kalendar'
),
route
(
'timesheet::dashboard.kalendar'
))
->
data
(
'icon'
,
'calendar alternate outline'
)
->
active
(
'kalendar/*'
)
->
data
(
'permission'
,
Permission
::
calendar
);
// $menu->add(__('Maklumat Cuti'), route('ecuti::quota.index'))
// ->data('icon', 'circle outline')
// ->active('quota/*')
// ->data('permission', Permission::MAKLUMAT_CUTI);
$pengurusan
=
$this
->
app
[
'laravolt.menu'
]
->
add
(
__
(
'Pengurusan'
))
->
data
(
'icon'
,
'align justify'
);
$pengurusan
->
add
(
__
(
'Pengurusan Peranan'
),
route
(
'timesheet::dashboard.pengurusan'
))
->
data
(
'icon'
,
'users icon'
)
->
active
(
'pengurusan/*'
)
->
data
(
'permission'
,
Permission
::
pengurusan
);
$pengurusan
->
add
(
__
(
'Perkhidmatan'
),
url
(
'/perkhidmatan/'
))
->
data
(
'icon'
,
'handshake icon'
)
->
active
(
'perkhidmatan/*'
)
->
data
(
'permission'
,
Permission
::
perkhidmatan
);
//
$pengurusan = $this->app['laravolt.menu']->add(__('Pengurusan'))->data('icon', 'align justify');
//
$pengurusan->add(__('Pengurusan Peranan'), route('timesheet::dashboard.pengurusan'))
//
->data('icon', 'users icon')
//
->active('pengurusan/*')
//
->data('permission', Permission::pengurusan);
//
$pengurusan->add(__('Perkhidmatan'), url('/perkhidmatan/'))
//
->data('icon', 'handshake icon')
//
->active('perkhidmatan/*')
//
->data('permission', Permission::perkhidmatan);
}
}
\ No newline at end of file
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