Fix audit logs and issue reports pages, rename Issues to Tasks

修復稽核日誌與任務報表頁面,並將「問題」改名為「任務」

## Changes 變更內容

### Bug Fixes 錯誤修復
1. Fixed audit logs page 500 error
   - Added missing $auditableTypes variable to controller
   - Changed $events to $actions in view
   - Added description and ip_address columns to audit_logs table
   - Updated AuditLog model fillable array

2. Fixed issue reports page SQLite compatibility errors
   - Replaced MySQL NOW() function with Laravel now() helper
   - Replaced TIMESTAMPDIFF() with PHP-based date calculation
   - Fixed request->date() default value handling

### Feature Changes 功能變更
3. Renamed "Issues" terminology to "Tasks" throughout the system
   - Updated navigation menus (Admin: Issues → Admin: Tasks)
   - Updated all issue-related views to use task terminology
   - Changed Chinese labels from "問題" to "任務"
   - Updated dashboard, issue tracker, and reports pages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-30 10:47:04 +08:00
parent bf6179c457
commit bcff65cf67
10 changed files with 324 additions and 247 deletions

View File

@@ -46,6 +46,7 @@ class AdminAuditLogController extends Controller
$users = AuditLog::with('user')->whereNotNull('user_id')->select('user_id')->distinct()->get()->map(function ($log) {
return $log->user;
})->filter();
$auditableTypes = AuditLog::select('auditable_type')->distinct()->whereNotNull('auditable_type')->orderBy('auditable_type')->pluck('auditable_type');
return view('admin.audit.index', [
'logs' => $logs,
@@ -56,6 +57,7 @@ class AdminAuditLogController extends Controller
'endDate' => $end,
'actions' => $actions,
'users' => $users,
'auditableTypes' => $auditableTypes,
]);
}