Commit ea7b4757 authored by DevPilot's avatar DevPilot

fix(player-affairs): buttons gated by a different module's permission, and one...

fix(player-affairs): buttons gated by a different module's permission, and one by a permission marked deprecated

كل شاشات الموديول تقريبًا كانت بتتحكم في ظهور أزرار الإضافة/التعديل بصلاحية
sa.player.manage اللي أصلًا مسجّلة في SportsActivity مش هنا — فموظف عنده
صلاحياته الصحيحة (player.register، player.edit، player.evaluate،
player.manage_injuries، player.manage_fitness) ما كانش بيشوف زراره خالص.

وشاشة اعتماد الشهادات الطبية كانت بتتحكم بصلاحية sa.medical.approve
اللي متسجّلة في كود SportsActivity نفسه بعلامة '(ملغي) استخدم
medical.board.approve' — يعني حتى المصلحة الأصلية بتقول إنها ملغاة،
والصلاحية الحقيقية للـ route هي player.approve_medical. كل الأزرار
بقت بتتحكم بنفس الصلاحية اللي الـ route فعليًا محتاجها.
parent a77f34ec
...@@ -5,7 +5,7 @@ $__template->layout('Layout.main'); ...@@ -5,7 +5,7 @@ $__template->layout('Layout.main');
<?php $__template->section('title'); ?>تقييمات اللاعبين<?php $__template->endSection(); ?> <?php $__template->section('title'); ?>تقييمات اللاعبين<?php $__template->endSection(); ?>
<?php $__template->section('page_actions'); ?> <?php $__template->section('page_actions'); ?>
<?php if (can('sa.player.manage')): ?> <?php if (can('player.evaluate')): ?>
<a href="/evaluations/create" class="btn btn-primary"><i data-lucide="plus" style="width:16px;height:16px;vertical-align:middle;margin-left:4px;"></i> تقييم جديد</a> <a href="/evaluations/create" class="btn btn-primary"><i data-lucide="plus" style="width:16px;height:16px;vertical-align:middle;margin-left:4px;"></i> تقييم جديد</a>
<?php endif; ?> <?php endif; ?>
<?php $__template->endSection(); ?> <?php $__template->endSection(); ?>
......
...@@ -5,7 +5,7 @@ $__template->layout('Layout.main'); ...@@ -5,7 +5,7 @@ $__template->layout('Layout.main');
<?php $__template->section('title'); ?>اختبارات اللياقة<?php $__template->endSection(); ?> <?php $__template->section('title'); ?>اختبارات اللياقة<?php $__template->endSection(); ?>
<?php $__template->section('page_actions'); ?> <?php $__template->section('page_actions'); ?>
<?php if (can('sa.player.manage')): ?> <?php if (can('player.manage_fitness')): ?>
<a href="/fitness-tests/create" class="btn btn-primary"><i data-lucide="plus" style="width:16px;height:16px;vertical-align:middle;margin-left:4px;"></i> اختبار جديد</a> <a href="/fitness-tests/create" class="btn btn-primary"><i data-lucide="plus" style="width:16px;height:16px;vertical-align:middle;margin-left:4px;"></i> اختبار جديد</a>
<?php endif; ?> <?php endif; ?>
<?php $__template->endSection(); ?> <?php $__template->endSection(); ?>
......
...@@ -5,7 +5,7 @@ $__template->layout('Layout.main'); ...@@ -5,7 +5,7 @@ $__template->layout('Layout.main');
<?php $__template->section('title'); ?>شئون اللاعبين<?php $__template->endSection(); ?> <?php $__template->section('title'); ?>شئون اللاعبين<?php $__template->endSection(); ?>
<?php $__template->section('page_actions'); ?> <?php $__template->section('page_actions'); ?>
<?php if (can('sa.player.manage')): ?> <?php if (can('player.register')): ?>
<a href="/players/create" class="btn btn-primary"><i data-lucide="plus" style="width:16px;height:16px;vertical-align:middle;margin-left:4px;"></i> تسجيل لاعب جديد</a> <a href="/players/create" class="btn btn-primary"><i data-lucide="plus" style="width:16px;height:16px;vertical-align:middle;margin-left:4px;"></i> تسجيل لاعب جديد</a>
<?php endif; ?> <?php endif; ?>
<?php $__template->endSection(); ?> <?php $__template->endSection(); ?>
...@@ -124,7 +124,7 @@ $allCardStatuses = Player::getCardStatuses(); ...@@ -124,7 +124,7 @@ $allCardStatuses = Player::getCardStatuses();
<a href="/players/<?= (int) $p['id'] ?>" class="btn btn-sm btn-outline" style="font-size:12px;padding:4px 10px;"> <a href="/players/<?= (int) $p['id'] ?>" class="btn btn-sm btn-outline" style="font-size:12px;padding:4px 10px;">
<i data-lucide="eye" style="width:13px;height:13px;vertical-align:middle;"></i> عرض <i data-lucide="eye" style="width:13px;height:13px;vertical-align:middle;"></i> عرض
</a> </a>
<?php if (can('sa.player.manage')): ?> <?php if (can('player.edit')): ?>
<a href="/players/<?= (int) $p['id'] ?>/edit" class="btn btn-sm btn-outline" style="font-size:12px;padding:4px 10px;"> <a href="/players/<?= (int) $p['id'] ?>/edit" class="btn btn-sm btn-outline" style="font-size:12px;padding:4px 10px;">
<i data-lucide="edit-3" style="width:13px;height:13px;vertical-align:middle;"></i> تعديل <i data-lucide="edit-3" style="width:13px;height:13px;vertical-align:middle;"></i> تعديل
</a> </a>
...@@ -156,7 +156,7 @@ $allCardStatuses = Player::getCardStatuses(); ...@@ -156,7 +156,7 @@ $allCardStatuses = Player::getCardStatuses();
ابدأ بتسجيل لاعب جديد في النادي. ابدأ بتسجيل لاعب جديد في النادي.
<?php endif; ?> <?php endif; ?>
</p> </p>
<?php if (can('sa.player.manage')): ?> <?php if (can('player.register')): ?>
<a href="/players/create" class="btn btn-primary"><i data-lucide="plus" style="width:16px;height:16px;vertical-align:middle;margin-left:4px;"></i> تسجيل لاعب جديد</a> <a href="/players/create" class="btn btn-primary"><i data-lucide="plus" style="width:16px;height:16px;vertical-align:middle;margin-left:4px;"></i> تسجيل لاعب جديد</a>
<?php endif; ?> <?php endif; ?>
</div> </div>
......
...@@ -5,7 +5,7 @@ $__template->layout('Layout.main'); ...@@ -5,7 +5,7 @@ $__template->layout('Layout.main');
<?php $__template->section('title'); ?>سجل الإصابات<?php $__template->endSection(); ?> <?php $__template->section('title'); ?>سجل الإصابات<?php $__template->endSection(); ?>
<?php $__template->section('page_actions'); ?> <?php $__template->section('page_actions'); ?>
<?php if (can('sa.player.manage')): ?> <?php if (can('player.manage_injuries')): ?>
<a href="/injuries/create" class="btn btn-primary"><i data-lucide="plus" style="width:16px;height:16px;vertical-align:middle;margin-left:4px;"></i> تسجيل إصابة</a> <a href="/injuries/create" class="btn btn-primary"><i data-lucide="plus" style="width:16px;height:16px;vertical-align:middle;margin-left:4px;"></i> تسجيل إصابة</a>
<?php endif; ?> <?php endif; ?>
<?php $__template->endSection(); ?> <?php $__template->endSection(); ?>
......
...@@ -93,7 +93,7 @@ $recordTypes = PlayerMedicalRecord::getRecordTypes(); ...@@ -93,7 +93,7 @@ $recordTypes = PlayerMedicalRecord::getRecordTypes();
</div> </div>
<!-- Actions --> <!-- Actions -->
<?php if ($filter === 'pending' && can('sa.medical.approve')): ?> <?php if ($filter === 'pending' && can('player.approve_medical')): ?>
<div style="display:flex;flex-direction:column;gap:8px;flex-shrink:0;min-width:160px;"> <div style="display:flex;flex-direction:column;gap:8px;flex-shrink:0;min-width:160px;">
<form method="POST" action="/medical-approvals/<?= (int) $rec['id'] ?>/approve" style="margin:0;"> <form method="POST" action="/medical-approvals/<?= (int) $rec['id'] ?>/approve" style="margin:0;">
<?= csrf_field() ?> <?= csrf_field() ?>
...@@ -116,7 +116,7 @@ $recordTypes = PlayerMedicalRecord::getRecordTypes(); ...@@ -116,7 +116,7 @@ $recordTypes = PlayerMedicalRecord::getRecordTypes();
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php if ($filter === 'pending' && can('sa.medical.approve')): ?> <?php if ($filter === 'pending' && can('player.approve_medical')): ?>
<div id="rejectForm-<?= (int) $rec['id'] ?>" style="display:none;margin-top:15px;padding:15px;background:#FEF2F2;border:1px solid #FCA5A5;border-radius:8px;"> <div id="rejectForm-<?= (int) $rec['id'] ?>" style="display:none;margin-top:15px;padding:15px;background:#FEF2F2;border:1px solid #FCA5A5;border-radius:8px;">
<form method="POST" action="/medical-approvals/<?= (int) $rec['id'] ?>/reject"> <form method="POST" action="/medical-approvals/<?= (int) $rec['id'] ?>/reject">
<?= csrf_field() ?> <?= csrf_field() ?>
......
...@@ -7,7 +7,7 @@ $__template->layout('Layout.main'); ...@@ -7,7 +7,7 @@ $__template->layout('Layout.main');
<?php $__template->section('title'); ?><?= e($player->full_name_ar) ?><?php $__template->endSection(); ?> <?php $__template->section('title'); ?><?= e($player->full_name_ar) ?><?php $__template->endSection(); ?>
<?php $__template->section('page_actions'); ?> <?php $__template->section('page_actions'); ?>
<?php if (can('sa.player.manage')): ?> <?php if (can('player.edit')): ?>
<a href="/players/<?= (int) $player->id ?>/edit" class="btn btn-outline"><i data-lucide="edit-3" style="width:15px;height:15px;vertical-align:middle;margin-left:4px;"></i> تعديل</a> <a href="/players/<?= (int) $player->id ?>/edit" class="btn btn-outline"><i data-lucide="edit-3" style="width:15px;height:15px;vertical-align:middle;margin-left:4px;"></i> تعديل</a>
<?php endif; ?> <?php endif; ?>
<a href="/players" class="btn btn-outline"><i data-lucide="arrow-right" style="width:15px;height:15px;vertical-align:middle;margin-left:4px;"></i> العودة للقائمة</a> <a href="/players" class="btn btn-outline"><i data-lucide="arrow-right" style="width:15px;height:15px;vertical-align:middle;margin-left:4px;"></i> العودة للقائمة</a>
......
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