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
717543df
Commit
717543df
authored
Feb 10, 2025
by
Azhan Hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync new user, permissible to role hr and timesheet SA
parent
3cf7643e
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
192 additions
and
0 deletions
+192
-0
app/Enums/Permission.php
+1
-0
packages/portal/timesheet/resources/views/dashboard/dashboardstaff.blade.php
+9
-0
packages/portal/timesheet/resources/views/users/list.blade.php
+61
-0
packages/portal/timesheet/routes/web.php
+5
-0
packages/portal/timesheet/src/Http/Controllers/UsersController.php
+50
-0
packages/portal/timesheet/src/ServiceProvider.php
+7
-0
public/web/d.json
+54
-0
resources/views/vendor/ui/layouts/base.blade.php
+5
-0
No files found.
app/Enums/Permission.php
View file @
717543df
...
...
@@ -29,5 +29,6 @@ final class Permission extends Enum
const
tsapproval
=
'tsapproval'
;
const
stafftimesheet
=
'stafftimesheet'
;
const
timesheetnotsubmit
=
'timesheetnotsubmit'
;
const
usermanagement
=
'usermanagement'
;
}
packages/portal/timesheet/resources/views/dashboard/dashboardstaff.blade.php
View file @
717543df
...
...
@@ -40,6 +40,15 @@
<a class="
ui
teal
left
ribbon
label
">Timesheet Status</a>
<br>
<br>
<!-- kak shikin -->
@if(auth()->user()->id == 6)
<button class="
tiny
center
aligned
ui
purple
right
compact
labeled
icon
button
" onclick="
window
.
location
.
href
=
'{{ route('
timesheet
::
users
.
syncNewUsers
') }}'
;
">
<i class="
angle
double
right
icon
"></i>
Sync New User
</button>
<br>
<br>
@endif
@foreach(
$timesheet
as
$key
=>
$time
)
<!-- <?php
// dd(
$time->tm_timesheet_master_sts
);
...
...
packages/portal/timesheet/resources/views/users/list.blade.php
0 → 100644
View file @
717543df
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
div
class
="
ui
segment
">
<a class="
ui
blue
left
ribbon
label
">List of Users</a>
<br>
<br>
<button class="
tiny
center
aligned
ui
purple
right
compact
labeled
icon
button
" onclick="
window
.
location
.
href
=
'{{ route('
timesheet
::
users
.
syncNewUsers
') }}'
;
">
<i class="
angle
double
right
icon
"></i>
Sync New User
</button>
<br>
<br>
<table id="
listUser
" class="
datatable
">
<thead>
<tr>
<th>No</th>
<th>Name</th>
<th>Email</th>
<th>Status</th>
<th>Created At</th>
</tr>
</thead>
<tbody>
@foreach(
$users
as
$key
=>
$user
)
<?php
// dd(
$user
);
?>
<tr>
<td>
{
{$loop->iteration}
}
</td>
<td>
{
{$user->name}
}
</td>
<td>
{
{$user->email}
}
</td>
<td>
{
{$user->status}
}
</td>
<td>
{
{$user->created_at}
}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection
@push('script')
<script>
$(document).ready(function() {
$('#listUser').DataTable({
"
searching
": true,
"
bSort
": false,
"
pageLength
": 50,
language: {
url: "
{{
url
(
'web/d.json'
)
}}
" // file yang translate ke bahasa melayu
}
});
});
</script>
@endpush
\ No newline at end of file
packages/portal/timesheet/routes/web.php
View file @
717543df
...
...
@@ -2,6 +2,8 @@
// use App\Mail\EditProject;
use
Portal\Timesheet\Http\Controllers\UsersController
;
Route
::
group
(
[
'namespace'
=>
'\Portal\Timesheet\Http\Controllers'
,
...
...
@@ -137,6 +139,9 @@ Route::group(
Route
::
get
(
'draftdeleted'
,[
'uses'
=>
'FormController@draftdeleted'
,
'as'
=>
'form.draftdeleted'
]);
Route
::
get
(
'sync'
,[
'uses'
=>
'FormController@sync'
,
'as'
=>
'form.sync'
]);
Route
::
get
(
'users/list'
,[
'uses'
=>
'UsersController@senaraiUsers'
,
'as'
=>
'users.senaraiUsers'
]);
Route
::
get
(
'users/sync'
,[
'uses'
=>
'UsersController@syncNewUsers'
,
'as'
=>
'users.syncNewUsers'
]);
// nonChargeableForm
// Route::get('nonChargeableForm',['uses' => 'FormController@nonChargeableForm', 'as' => 'form.nonChargeableForm']);
// Route::post('savenonchargeablehours',['uses' => 'FormController@savenonchargeablehours', 'as' => 'form.savenonchargeablehours']);
...
...
packages/portal/timesheet/src/Http/Controllers/UsersController.php
0 → 100644
View file @
717543df
<?php
namespace
Portal\Timesheet\Http\Controllers
;
use
Illuminate\Routing\Controller
;
use
Carbon\Carbon
;
use
DB
;
use
Portal\Timesheet\Model\Users
;
use
Portal\Timesheet\Model\Ts_master
;
use
Portal\Timesheet\Model\Ts_detail
;
use
Portal\Timesheet\Model\Project
;
use
Portal\Timesheet\Model\Department
;
use
Portal\Timesheet\Model\Pteam
;
use
Portal\Timesheet\Model\Staff_info
;
use
Portal\Timesheet\Model\Overhead
;
use
Portal\Timesheet\Model\Role
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Input
;
use
File
;
use
Redirect
;
use
App\Mail\StatusAccept
;
use
App\Mail\StatusReject
;
use
Mail
;
use
Curl
;
use
Auth
;
use
Illuminate\Support\Facades\Artisan
;
class
UsersController
extends
Controller
{
public
function
senaraiUsers
()
{
$users
=
Users
::
all
();
return
view
(
'timesheet::users.list'
,
compact
(
'users'
));
}
public
function
syncNewUsers
()
{
// Run command manual
$output
=
shell_exec
(
'php /www/html/timesheet3f/artisan migrate:user-cron 2>&1'
);
// Log the output for debugging
\Log
::
info
(
"migrate:user-cron output: "
.
$output
);
return
redirect
(
'users/list'
)
->
withSuccess
(
'Senarai staff telah dikemaskini'
);
}
}
\ No newline at end of file
packages/portal/timesheet/src/ServiceProvider.php
View file @
717543df
...
...
@@ -173,6 +173,13 @@ class ServiceProvider extends BaseServiceProvider
->
active
(
'pengurusan/*'
)
->
data
(
'permission'
,
Permission
::
pengurusan
);
// dd(auth());
$pengurusanSistem
=
$this
->
app
[
'laravolt.menu'
]
->
add
(
__
(
'System Management'
))
->
data
(
'icon'
,
'align justify'
);
$pengurusanSistem
->
add
(
__
(
'List of Users'
),
route
(
'timesheet::users.senaraiUsers'
))
->
data
(
'icon'
,
'users icon'
)
->
active
(
'usermanagement/*'
)
->
data
(
'permission'
,
Permission
::
usermanagement
);
// $calendar->add(__('Chargeable'), route('timesheet::dashboard.kalendarCharge'))
// ->data('icon', 'calendar alternate outline')
// ->active('kalendarCharge/*')
...
...
public/web/d.json
0 → 100644
View file @
717543df
{
"emptyTable"
:
"Tiada data"
,
"info"
:
"Paparan dari _START_ hingga _END_ dari _TOTAL_ rekod"
,
"infoEmpty"
:
"Paparan 0 hingga 0 dari 0 rekod"
,
"infoFiltered"
:
"(Ditapis dari jumlah _MAX_ rekod)"
,
"infoThousands"
:
","
,
"lengthMenu"
:
"Papar _MENU_ rekod"
,
"loadingRecords"
:
"Diproses..."
,
"processing"
:
"Sedang diproses..."
,
"search"
:
"Carian:"
,
"zeroRecords"
:
"Tiada padanan rekod yang dijumpai."
,
"paginate"
:
{
"first"
:
"Pertama"
,
"previous"
:
"Sebelum"
,
"next"
:
"Seterusnya"
,
"last"
:
"Akhir"
},
"aria"
:
{
"sortAscending"
:
": diaktifkan kepada susunan lajur menaik"
,
"sortDescending"
:
": diaktifkan kepada susunan lajur menurun"
},
"autoFill"
:
{
"cancel"
:
"batal"
,
"fill"
:
"Isi semua sel dengan <i>%d<
\/
i>"
,
"fillHorizontal"
:
"Isi sel secara mendatar"
,
"fillVertical"
:
"Isi sel secara menegak"
},
"buttons"
:
{
"collection"
:
"Koleksi <span class=
\"
ui-button-icon-primary ui-icon ui-icon-triangle-1-s
\"
><
\/
span>"
,
"copy"
:
"Salin"
,
"print"
:
"Cetak"
,
"colvis"
:
"Kolum Pilihan"
},
"thousands"
:
","
,
"_comment"
:{
"select"
:
{
"cells"
:
{
"1"
:
"1 sel terpilih"
,
"_"
:
"%d sel terpilih"
},
"columns"
:
{
"1"
:
"1 kolum terpilih"
,
"_"
:
"%d kolum terpilih"
},
"rows"
:
{
"1"
:
"1 baris terpilih"
,
"_"
:
"%d baris terpilih"
}
}
},
"editor"
:
{
"close"
:
"Tutup"
}
}
resources/views/vendor/ui/layouts/base.blade.php
View file @
717543df
...
...
@@ -77,6 +77,11 @@
<script
type=
"text/javascript"
src=
"{{ asset('js/jquery-3.1.1.min.js') }}"
></script>
<script
type=
"text/javascript"
src=
"{{ mix('js/all.js', 'laravolt') }}"
></script>
<!-- ✅ Load DataTables (AFTER all.js) -->
<link
rel=
"stylesheet"
href=
"https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css"
>
<script
src=
"https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"
></script>
<script
type=
"text/javascript"
src=
"{{ asset('calendar/lib/main.js') }}"
></script>
<script
type=
"text/javascript"
src=
"{{ asset('calendar/lib/locales-all.js') }}"
></script>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/jquery.blockUI/2.70/jquery.blockUI.min.js"
></script>
...
...
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