diff --git a/be/Modules/ActivityLog/Http/Controllers/ActivityLogController.php b/be/Modules/ActivityLog/Http/Controllers/ActivityLogController.php
index 0a1e8d7..fdbbe69 100644
--- a/be/Modules/ActivityLog/Http/Controllers/ActivityLogController.php
+++ b/be/Modules/ActivityLog/Http/Controllers/ActivityLogController.php
@@ -3,17 +3,22 @@
namespace Modules\ActivityLog\Http\Controllers;
use App\Http\Controllers\Controller;
+use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Http\Request;
use Spatie\Activitylog\Models\Activity;
use App\Services\ActivityLogger;
class ActivityLogController extends Controller
{
+ use AuthorizesRequests;
+
/**
* Display a listing of the resource.
*/
public function index(Request $request)
{
+ $this->authorize('viewAny', Activity::class);
+
// ActivityLogger::logView(new Activity, 'Viewed activity logs');
$perPage = $request->get('per_page', 10);
@@ -27,8 +32,10 @@ class ActivityLogController extends Controller
$q->where('description', 'ILIKE', "%{$search}%")
->orWhere('subject_type', 'ILIKE', "%{$search}%")
->orWhere('event', 'ILIKE', "%{$search}%")
- ->orWhere('causer.name', 'ILIKE', "%{$search}%")
- ->orWhere('causer.email', 'ILIKE', "%{$search}%");
+ ->orWhereHas('causer', function ($causerQuery) use ($search) {
+ $causerQuery->where('name', 'ILIKE', "%{$search}%")
+ ->orWhere('email', 'ILIKE', "%{$search}%");
+ });
});
}
diff --git a/be/Modules/ActivityLog/Providers/ActivityLogServiceProvider.php b/be/Modules/ActivityLog/Providers/ActivityLogServiceProvider.php
index d1fad58..69101d9 100644
--- a/be/Modules/ActivityLog/Providers/ActivityLogServiceProvider.php
+++ b/be/Modules/ActivityLog/Providers/ActivityLogServiceProvider.php
@@ -3,7 +3,10 @@
namespace Modules\ActivityLog\Providers;
use Illuminate\Support\Facades\Blade;
+use Illuminate\Support\Facades\Gate;
use Illuminate\Support\ServiceProvider;
+use Modules\ActivityLog\Policies\ActivityLogPolicy;
+use Spatie\Activitylog\Models\Activity;
use Nwidart\Modules\Traits\PathNamespace;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
@@ -21,6 +24,8 @@ class ActivityLogServiceProvider extends ServiceProvider
*/
public function boot(): void
{
+ Gate::policy(Activity::class, ActivityLogPolicy::class);
+
$this->registerCommands();
$this->registerCommandSchedules();
$this->registerTranslations();
diff --git a/be/Modules/MembershipApplication/Resources/views/pdf/approved-letter.blade.php b/be/Modules/MembershipApplication/Resources/views/pdf/approved-letter.blade.php
index 8646b8d..21c1fea 100644
--- a/be/Modules/MembershipApplication/Resources/views/pdf/approved-letter.blade.php
+++ b/be/Modules/MembershipApplication/Resources/views/pdf/approved-letter.blade.php
@@ -66,7 +66,11 @@
@section('letter-signature')
KOPERASI PERMODALAN KELANTAN BERHAD
-
+
+ @if (! empty($signatureUrl))
+
+ @endif
+
MUHAMMAD NAFIS BIN ZAINUDIN
Pengurus Besar
b/p Setiausaha
diff --git a/be/Modules/User/Config/config.php b/be/Modules/User/Config/config.php
index 57bdafc..6484b21 100644
--- a/be/Modules/User/Config/config.php
+++ b/be/Modules/User/Config/config.php
@@ -4,5 +4,5 @@ return [
'name' => 'User',
'public_profile_token_ttl_days' => (int) env('PUBLIC_PROFILE_TOKEN_TTL_DAYS', 90),
'frontend_url' => rtrim(env('FRONTEND_URL', env('APP_URL', 'http://localhost')), '/'),
- 'digital_card_logo_path' => env('DIGITAL_CARD_LOGO_PATH', public_path('images/logo/logo-kopkb.svg')),
+ 'digital_card_logo_path' => env('DIGITAL_CARD_LOGO_PATH', public_path('images/logo/logo.svg')),
];
diff --git a/be/app/Services/LetterService.php b/be/app/Services/LetterService.php
index ba27182..a7f9c81 100644
--- a/be/app/Services/LetterService.php
+++ b/be/app/Services/LetterService.php
@@ -56,11 +56,14 @@ class LetterService
public function prepareViewData(array $overrides = []): array
{
$logoPath = $overrides['logoPath'] ?? config('mail.logo_path');
+ $signaturePath = $overrides['signaturePath'] ?? config('letter.signature_path');
return array_merge([
'letterLayout' => LetterLayout::resolve(),
'logoPath' => $logoPath,
- 'logoUrl' => $this->resolveLogoDataUri($logoPath),
+ 'logoUrl' => $this->resolveImageDataUri($logoPath),
+ 'signaturePath' => $signaturePath,
+ 'signatureUrl' => $this->resolveImageDataUri($signaturePath),
'organizationAddress' => $overrides['organizationAddress'] ?? null,
'organizationContact' => $overrides['organizationContact'] ?? null,
], $overrides);
@@ -97,14 +100,14 @@ class LetterService
return $browsershot;
}
- protected function resolveLogoDataUri(?string $logoPath): ?string
+ protected function resolveImageDataUri(?string $path): ?string
{
- if (empty($logoPath) || ! file_exists($logoPath)) {
+ if (empty($path) || ! file_exists($path)) {
return null;
}
- $mime = mime_content_type($logoPath) ?: 'image/svg+xml';
+ $mime = mime_content_type($path) ?: 'image/svg+xml';
- return 'data:'.$mime.';base64,'.base64_encode(file_get_contents($logoPath));
+ return 'data:'.$mime.';base64,'.base64_encode(file_get_contents($path));
}
}
diff --git a/be/config/letter.php b/be/config/letter.php
index dad463b..4b232b4 100644
--- a/be/config/letter.php
+++ b/be/config/letter.php
@@ -82,4 +82,12 @@ return [
'black' => '#000000',
],
+ /*
+ |--------------------------------------------------------------------------
+ | Assets
+ |--------------------------------------------------------------------------
+ */
+
+ 'signature_path' => resource_path('assets/signatures/signature.svg'),
+
];
diff --git a/be/config/mail.php b/be/config/mail.php
index 86d1427..3b53d7f 100644
--- a/be/config/mail.php
+++ b/be/config/mail.php
@@ -124,6 +124,6 @@ return [
|
*/
- 'logo_path' => public_path('images/logo/logo-kopkb-letterhead.svg'),
+ 'logo_path' => public_path('images/logo/logo.svg'),
];
diff --git a/be/public/images/logo/logo-kopkb.svg b/be/public/images/logo/logo-kopkb.svg
deleted file mode 100644
index ef88ccb..0000000
--- a/be/public/images/logo/logo-kopkb.svg
+++ /dev/null
@@ -1,418 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/be/resources/assets/signatures/signature.svg b/be/resources/assets/signatures/signature.svg
new file mode 100644
index 0000000..aa1cf66
--- /dev/null
+++ b/be/resources/assets/signatures/signature.svg
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
diff --git a/be/resources/views/pdf/layouts/letter.blade.php b/be/resources/views/pdf/layouts/letter.blade.php
index e649a3a..35f34c6 100644
--- a/be/resources/views/pdf/layouts/letter.blade.php
+++ b/be/resources/views/pdf/layouts/letter.blade.php
@@ -239,6 +239,12 @@
height: var(--letter-signature-space-height);
}
+ .signature-space-img {
+ height: var(--letter-signature-space-height);
+ width: auto;
+ display: block;
+ }
+
.signatory-name {
font-weight: bold;
text-transform: uppercase;
diff --git a/be/resources/views/pdf/preview-approved-membership.blade.php b/be/resources/views/pdf/preview-approved-membership.blade.php
index fd2819b..620b66f 100644
--- a/be/resources/views/pdf/preview-approved-membership.blade.php
+++ b/be/resources/views/pdf/preview-approved-membership.blade.php
@@ -27,19 +27,19 @@
2. Sukacita dimaklumkan bahawa, permohonan tuan untuk menjadi anggota Koperasi
- Permodalan Kelantan Berhad(KoPKB) telah {{ membership_applications.board_result }} dalam {{ User manual fills before generate }}
+ Permodalan Kelantan Berhad(KoPKB) telah dalam
3. Pihak Koperasi akan membuat potongan gaji melalui majikan tuan sebagaiman ketetapan berikut:-