- Created shared dashboard components in app/Views/shared/: - dashboard_config.php, dashboard_table.php, dashboard_validate.php - dialog_sample.php, dialog_val.php, script_dashboard.php, script_validate.php - layout_dashboard.php - Removed duplicate views from role-specific directories (admin, cs, lab, phlebo, superuser) - Consolidated 575-line duplicate index.php files into shared components - Updated controllers to use new shared view structure - Added ApiValidateController for validation endpoints - Reduced code duplication across 5 role-based dashboards 🤖 Generated with [Claude Code](https://claude.com/claude-code)
75 lines
2.4 KiB
PHP
75 lines
2.4 KiB
PHP
<?php
|
|
/**
|
|
* Dashboard Role Configuration
|
|
*
|
|
* Defines role-specific settings for dashboard views to eliminate code duplication.
|
|
*
|
|
* Configuration Schema:
|
|
* - title: Dashboard title displayed in navbar
|
|
* - columns: Column visibility settings
|
|
* - lab: Show "No Lab" column (SP_ACCESSNUMBER)
|
|
* - resto: Show "ResTo" column (ODR_CRESULT_TO)
|
|
* - register: Show "No Register" column (HOSTORDERNUMBER)
|
|
* - sampleDialog: Sample dialog behavior
|
|
* - commentEditable: Allow editing the comment textarea
|
|
* - showCollectButtons: Show Collect/Un-Coll/Un-Recv buttons
|
|
* - menuItems: Navigation menu items
|
|
*/
|
|
|
|
return [
|
|
'admin' => [
|
|
'title' => 'Admin Dashboard',
|
|
'sampleDialog' => [
|
|
'commentEditable' => true,
|
|
'showCollectButtons' => true,
|
|
],
|
|
'menuItems' => [
|
|
['label' => 'Dashboard', 'href' => 'admin', 'icon' => 'chart-bar'],
|
|
['label' => 'Validate', 'href' => 'admin/validate', 'icon' => 'check-circle'],
|
|
],
|
|
],
|
|
'cs' => [
|
|
'title' => 'CS Dashboard',
|
|
'sampleDialog' => [
|
|
'commentEditable' => false,
|
|
'showCollectButtons' => false,
|
|
],
|
|
'menuItems' => [
|
|
['label' => 'Dashboard', 'href' => 'cs', 'icon' => 'chart-bar'],
|
|
],
|
|
],
|
|
'lab' => [
|
|
'title' => 'Lab Analyst Dashboard',
|
|
'sampleDialog' => [
|
|
'commentEditable' => true,
|
|
'showCollectButtons' => true,
|
|
],
|
|
'menuItems' => [
|
|
['label' => 'Dashboard', 'href' => 'lab', 'icon' => 'chart-bar'],
|
|
['label' => 'Validate', 'href' => 'lab/validate', 'icon' => 'check-circle'],
|
|
],
|
|
],
|
|
'phlebo' => [
|
|
'title' => 'Phlebotomist Dashboard',
|
|
'sampleDialog' => [
|
|
'commentEditable' => false,
|
|
'showCollectButtons' => false,
|
|
],
|
|
'menuItems' => [
|
|
['label' => 'Dashboard', 'href' => 'phlebo', 'icon' => 'chart-bar'],
|
|
],
|
|
],
|
|
'superuser' => [
|
|
'title' => 'Superuser Dashboard',
|
|
'sampleDialog' => [
|
|
'commentEditable' => true,
|
|
'showCollectButtons' => true,
|
|
],
|
|
'menuItems' => [
|
|
['label' => 'Dashboard', 'href' => 'superuser', 'icon' => 'chart-bar'],
|
|
['label' => 'Validate', 'href' => 'superuser/validate', 'icon' => 'check-circle'],
|
|
['label' => 'Users', 'href' => 'superuser/users', 'icon' => 'users'],
|
|
],
|
|
],
|
|
];
|