Commit 436658fe authored by Mahmoud Aglan's avatar Mahmoud Aglan

fix(archive): translate all English field names and values to Arabic in snapshot views

Adds comprehensive translation maps for DB column names (field labels),
enum values (status, relationship, classification, gender), section headers,
and boolean fields. All archive snapshot data now displays in Arabic.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 045155c8
...@@ -14,6 +14,46 @@ ...@@ -14,6 +14,46 @@
<?php $__template->section('content'); ?> <?php $__template->section('content'); ?>
<?php <?php
$reasonLabels = ['transfer' => 'تحويل', 'full_transfer' => 'تحويل كامل', 'separation' => 'فصل', 'child_separation' => 'فصل ابن', 'child_mandatory_25' => 'فصل إلزامي (25 سنة)', 'divorce' => 'طلاق', 'death' => 'وفاة', 'waiver' => 'تنازل', 'sports_conversion' => 'تحويل رياضي', 'cross_branch' => 'نقل بين فروع', 'status_change' => 'تغيير حالة', 'data_correction' => 'تصحيح بيانات', 'manual' => 'يدوي']; $reasonLabels = ['transfer' => 'تحويل', 'full_transfer' => 'تحويل كامل', 'separation' => 'فصل', 'child_separation' => 'فصل ابن', 'child_mandatory_25' => 'فصل إلزامي (25 سنة)', 'divorce' => 'طلاق', 'death' => 'وفاة', 'waiver' => 'تنازل', 'sports_conversion' => 'تحويل رياضي', 'cross_branch' => 'نقل بين فروع', 'status_change' => 'تغيير حالة', 'data_correction' => 'تصحيح بيانات', 'manual' => 'يدوي'];
$fieldLabels = [
'id' => 'المعرف', 'member_id' => 'رقم العضو', 'membership_number' => 'رقم العضوية', 'membership_type' => 'نوع العضوية',
'membership_value' => 'قيمة العضوية', 'membership_origin_date' => 'تاريخ بداية العضوية', 'ownership_transfer_date' => 'تاريخ نقل الملكية',
'full_name_ar' => 'الاسم بالعربية', 'full_name_en' => 'الاسم بالإنجليزية', 'national_id' => 'الرقم القومي',
'date_of_birth' => 'تاريخ الميلاد', 'gender' => 'النوع', 'phone' => 'الهاتف', 'email' => 'البريد الإلكتروني',
'address' => 'العنوان', 'branch_id' => 'الفرع', 'qualification_id' => 'المؤهل', 'status' => 'الحالة',
'join_date' => 'تاريخ الالتحاق', 'form_date' => 'تاريخ الاستمارة', 'form_number' => 'رقم الاستمارة',
'activated_at' => 'تاريخ التفعيل', 'activated_by_payment_id' => 'دفعة التفعيل', 'created_at' => 'تاريخ الإنشاء',
'updated_at' => 'تاريخ التحديث', 'archived_at' => 'تاريخ الأرشفة', 'archived_by' => 'أرشف بواسطة',
'is_archived' => 'مؤرشف', 'notes' => 'ملاحظات', 'photo_path' => 'الصورة',
'relationship' => 'صلة القرابة', 'child_order' => 'ترتيب الابن', 'spouse_order' => 'ترتيب الزوجة',
'classification' => 'التصنيف', 'addition_fee' => 'رسوم الإضافة', 'fee_breakdown_json' => 'تفاصيل الرسوم',
'fee_receipt_number' => 'رقم إيصال الرسوم', 'is_frozen' => 'مجمد', 'frozen_reason' => 'سبب التجميد',
'can_separate' => 'يمكن الفصل', 'can_get_independent' => 'يمكن الاستقلال',
'category' => 'الفئة', 'relationship_to_member' => 'صلة القرابة بالعضو',
'has_championship' => 'بطل رياضي', 'disability_documentation' => 'إثبات إعاقة',
'marriage_date' => 'تاريخ الزواج', 'marriage_certificate_path' => 'عقد الزواج',
'transferred_from_transfer_id' => 'محوّل من تحويل', 'transferred_from_death_id' => 'محوّل من وفاة',
'transferred_from_waiver_id' => 'محوّل من تنازل', 'transferred_from_divorce_id' => 'محوّل من طلاق',
'deceased_member_name' => 'اسم العضو المتوفى', 'waived_from_member_name' => 'اسم العضو المتنازل',
'created_by' => 'أنشئ بواسطة', 'updated_by' => 'حُدّث بواسطة',
];
$valueLabels = [
'son' => 'ابن', 'daughter' => 'ابنة', 'wife' => 'زوجة', 'husband' => 'زوج',
'brother' => 'أخ', 'sister' => 'أخت', 'mother' => 'أم', 'father' => 'أب',
'male' => 'ذكر', 'female' => 'أنثى',
'active' => 'نشط', 'inactive' => 'غير نشط', 'pending' => 'معلق', 'pending_payment' => 'بانتظار الدفع',
'potential' => 'محتمل', 'payment_pending' => 'بانتظار الدفع', 'under_review' => 'تحت المراجعة',
'accepted' => 'مقبول', 'frozen' => 'مجمد', 'suspended' => 'موقوف', 'dropped' => 'مسقط',
'deceased' => 'متوفى', 'transferred' => 'محوّل', 'waived' => 'متنازل عنه', 'divorced' => 'مطلق',
'included' => 'مشمول', 'paid' => 'مدفوع', 'temporary' => 'مؤقت', 'separated' => 'مفصول',
'acquired' => 'مكتسب', 'working' => 'عامل', 'seasonal' => 'موسمي', 'foreign' => 'أجنبي',
'sports' => 'رياضي', 'honorary' => 'شرفي',
'nanny' => 'مربية', 'driver' => 'سائق', 'relative' => 'قريب', 'friend' => 'صديق',
'stepchild' => 'ربيب', 'orphan' => 'يتيم',
];
$booleanFields = ['is_archived', 'is_frozen', 'can_separate', 'can_get_independent', 'has_championship', 'disability_documentation'];
?> ?>
<?php if (!empty($isChainView)): ?> <?php if (!empty($isChainView)): ?>
...@@ -124,7 +164,7 @@ $reasonLabels = ['transfer' => 'تحويل', 'full_transfer' => 'تحويل كا ...@@ -124,7 +164,7 @@ $reasonLabels = ['transfer' => 'تحويل', 'full_transfer' => 'تحويل كا
<table style="width:100%;font-size:13px;"> <table style="width:100%;font-size:13px;">
<?php foreach ($snapshot['full_data'] as $key => $value): ?> <?php foreach ($snapshot['full_data'] as $key => $value): ?>
<tr style="border-bottom:1px solid #F9FAFB;"> <tr style="border-bottom:1px solid #F9FAFB;">
<td style="padding:6px 0;color:#6B7280;width:35%;font-weight:500;"><?= e($key) ?></td> <td style="padding:6px 0;color:#6B7280;width:35%;font-weight:500;"><?= e($fieldLabels[$key] ?? $key) ?></td>
<td style="padding:6px 0;"> <td style="padding:6px 0;">
<?php if (is_array($value)): ?> <?php if (is_array($value)): ?>
<code style="font-size:11px;background:#F3F4F6;padding:2px 6px;border-radius:3px;"><?= e(json_encode($value, JSON_UNESCAPED_UNICODE)) ?></code> <code style="font-size:11px;background:#F3F4F6;padding:2px 6px;border-radius:3px;"><?= e(json_encode($value, JSON_UNESCAPED_UNICODE)) ?></code>
...@@ -135,8 +175,10 @@ $reasonLabels = ['transfer' => 'تحويل', 'full_transfer' => 'تحويل كا ...@@ -135,8 +175,10 @@ $reasonLabels = ['transfer' => 'تحويل', 'full_transfer' => 'تحويل كا
<summary style="cursor:pointer;color:#0D7377;font-size:12px;">عرض (<?= mb_strlen((string) $value) ?> حرف)</summary> <summary style="cursor:pointer;color:#0D7377;font-size:12px;">عرض (<?= mb_strlen((string) $value) ?> حرف)</summary>
<div style="margin-top:5px;padding:8px;background:#F9FAFB;border-radius:4px;font-size:12px;word-break:break-all;"><?= e((string) $value) ?></div> <div style="margin-top:5px;padding:8px;background:#F9FAFB;border-radius:4px;font-size:12px;word-break:break-all;"><?= e((string) $value) ?></div>
</details> </details>
<?php elseif (in_array($key, $booleanFields, true)): ?>
<?= ((string) $value === '1' || $value === true) ? 'نعم' : 'لا' ?>
<?php else: ?> <?php else: ?>
<?= e((string) $value) ?> <?= e($valueLabels[(string) $value] ?? (string) $value) ?>
<?php endif; ?> <?php endif; ?>
</td> </td>
</tr> </tr>
...@@ -147,10 +189,13 @@ $reasonLabels = ['transfer' => 'تحويل', 'full_transfer' => 'تحويل كا ...@@ -147,10 +189,13 @@ $reasonLabels = ['transfer' => 'تحويل', 'full_transfer' => 'تحويل كا
<!-- Related Data --> <!-- Related Data -->
<?php if (!empty($snapshot['related_data'])): ?> <?php if (!empty($snapshot['related_data'])): ?>
<?php
$sectionLabels = ['children' => 'الأبناء', 'spouses' => 'الزوجات', 'temporary_members' => 'الأعضاء المؤقتين', 'documents' => 'المستندات', 'subscriptions' => 'الاشتراكات', 'payments' => 'المدفوعات', 'installment_plans' => 'خطط التقسيط', 'fines' => 'الغرامات'];
?>
<?php foreach ($snapshot['related_data'] as $section => $records): ?> <?php foreach ($snapshot['related_data'] as $section => $records): ?>
<div class="card" style="margin-bottom:20px;"> <div class="card" style="margin-bottom:20px;">
<div style="padding:15px 20px;border-bottom:1px solid #E5E7EB;"> <div style="padding:15px 20px;border-bottom:1px solid #E5E7EB;">
<h3 style="margin:0;color:#0D7377;"><?= e($section) ?> <span style="color:#9CA3AF;font-size:14px;">(<?= count($records) ?>)</span></h3> <h3 style="margin:0;color:#0D7377;"><?= e($sectionLabels[$section] ?? $section) ?> <span style="color:#9CA3AF;font-size:14px;">(<?= count($records) ?>)</span></h3>
</div> </div>
<div style="padding:20px;"> <div style="padding:20px;">
<?php if (empty($records)): ?> <?php if (empty($records)): ?>
...@@ -168,14 +213,16 @@ $reasonLabels = ['transfer' => 'تحويل', 'full_transfer' => 'تحويل كا ...@@ -168,14 +213,16 @@ $reasonLabels = ['transfer' => 'تحويل', 'full_transfer' => 'تحويل كا
<table style="width:100%;font-size:12px;"> <table style="width:100%;font-size:12px;">
<?php foreach ($record as $rk => $rv): ?> <?php foreach ($record as $rk => $rv): ?>
<tr> <tr>
<td style="padding:3px 0;color:#6B7280;width:35%;"><?= e($rk) ?></td> <td style="padding:3px 0;color:#6B7280;width:35%;"><?= e($fieldLabels[$rk] ?? $rk) ?></td>
<td style="padding:3px 0;"> <td style="padding:3px 0;">
<?php if ($rv === null): ?> <?php if ($rv === null): ?>
<span style="color:#D1D5DB;">فارغ</span> <span style="color:#D1D5DB;">فارغ</span>
<?php elseif (is_array($rv)): ?> <?php elseif (is_array($rv)): ?>
<code style="font-size:10px;"><?= e(json_encode($rv, JSON_UNESCAPED_UNICODE)) ?></code> <code style="font-size:10px;"><?= e(json_encode($rv, JSON_UNESCAPED_UNICODE)) ?></code>
<?php elseif (in_array($rk, $booleanFields, true)): ?>
<?= ((string) $rv === '1' || $rv === true) ? 'نعم' : 'لا' ?>
<?php else: ?> <?php else: ?>
<?= e((string) $rv) ?> <?= e($valueLabels[(string) $rv] ?? (string) $rv) ?>
<?php endif; ?> <?php endif; ?>
</td> </td>
</tr> </tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment