Features: - Implement two fee types: entrance fee and annual fee (both NT$1,000) - Add 50% discount for disability certificate holders - Add disability certificate upload in member profile - Integrate disability verification into cashier approval workflow - Add membership fee settings in system admin Document permissions: - Fix hard-coded role logic in Document model - Use permission-based authorization instead of role checks Additional features: - Add announcements, general ledger, and trial balance modules - Add income management and accounting entries - Add comprehensive test suite with factories - Update UI translations to Traditional Chinese 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
198 lines
14 KiB
PHP
198 lines
14 KiB
PHP
<x-app-layout>
|
|
<x-slot name="header">
|
|
<h2 class="text-xl font-semibold leading-tight text-gray-800 dark:text-gray-200">
|
|
新增任務 (建立任務)
|
|
</h2>
|
|
</x-slot>
|
|
|
|
<div class="py-12">
|
|
<div class="mx-auto max-w-3xl sm:px-6 lg:px-8">
|
|
<div class="bg-white shadow sm:rounded-lg dark:bg-gray-800 px-4 py-5 sm:p-6">
|
|
<form method="POST" action="{{ route('admin.issues.store') }}" class="space-y-6">
|
|
@csrf
|
|
|
|
<!-- Title -->
|
|
<div>
|
|
<label for="title" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
標題 <span class="text-red-500">*</span>
|
|
</label>
|
|
<input type="text" name="title" id="title" value="{{ old('title') }}" required maxlength="255"
|
|
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100 @error('title') border-red-300 @enderror"
|
|
placeholder="任務簡述">
|
|
@error('title')<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>@enderror
|
|
</div>
|
|
|
|
<!-- Description -->
|
|
<div>
|
|
<label for="description" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
描述
|
|
</label>
|
|
<textarea name="description" id="description" rows="5"
|
|
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100"
|
|
placeholder="詳細描述此任務...">{{ old('description') }}</textarea>
|
|
@error('description')<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>@enderror
|
|
</div>
|
|
|
|
<!-- Task Type and Priority -->
|
|
<div class="grid grid-cols-1 gap-6 sm:grid-cols-2">
|
|
<div>
|
|
<label for="issue_type" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
任務類型 <span class="text-red-500">*</span>
|
|
</label>
|
|
<select name="issue_type" id="issue_type" required
|
|
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100 @error('issue_type') border-red-300 @enderror">
|
|
<option value="">選擇類型...</option>
|
|
<option value="work_item" @selected(old('issue_type') === 'work_item')>工作項目</option>
|
|
<option value="project_task" @selected(old('issue_type') === 'project_task')>專案任務</option>
|
|
<option value="maintenance" @selected(old('issue_type') === 'maintenance')>維護</option>
|
|
<option value="member_request" @selected(old('issue_type') === 'member_request')>會員請求</option>
|
|
</select>
|
|
@error('issue_type')<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>@enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label for="priority" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
優先級 <span class="text-red-500">*</span>
|
|
</label>
|
|
<select name="priority" id="priority" required
|
|
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100 @error('priority') border-red-300 @enderror">
|
|
<option value="">選擇優先級...</option>
|
|
<option value="low" @selected(old('priority') === 'low')>低 ↓</option>
|
|
<option value="medium" @selected(old('priority', 'medium') === 'medium')>中 →</option>
|
|
<option value="high" @selected(old('priority') === 'high')>高 ↑</option>
|
|
<option value="urgent" @selected(old('priority') === 'urgent')>緊急 ⇈</option>
|
|
</select>
|
|
@error('priority')<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>@enderror
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Assignee and Due Date -->
|
|
<div class="grid grid-cols-1 gap-6 sm:grid-cols-2">
|
|
<div>
|
|
<label for="assigned_to_user_id" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
指派給
|
|
</label>
|
|
<select name="assigned_to_user_id" id="assigned_to_user_id"
|
|
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100">
|
|
<option value="">未指派</option>
|
|
@foreach($users as $user)
|
|
<option value="{{ $user->id }}" @selected(old('assigned_to_user_id') == $user->id)>{{ $user->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">選填:指派給團隊成員</p>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="due_date" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
截止日期
|
|
</label>
|
|
<input type="date" name="due_date" id="due_date" value="{{ old('due_date') }}"
|
|
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100">
|
|
@error('due_date')<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>@enderror
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Estimated Hours -->
|
|
<div>
|
|
<label for="estimated_hours" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
預估時數
|
|
</label>
|
|
<input type="number" name="estimated_hours" id="estimated_hours" value="{{ old('estimated_hours') }}" step="0.5" min="0"
|
|
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100"
|
|
placeholder="0.0">
|
|
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">完成此任務的預估時間</p>
|
|
</div>
|
|
|
|
<!-- Member (for member requests) -->
|
|
<div>
|
|
<label for="member_id" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
相關會員
|
|
</label>
|
|
<select name="member_id" id="member_id"
|
|
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100">
|
|
<option value="">無</option>
|
|
@foreach($members as $member)
|
|
<option value="{{ $member->id }}" @selected(old('member_id') == $member->id)>{{ $member->full_name }}</option>
|
|
@endforeach
|
|
</select>
|
|
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">連結至會員(用於會員請求)</p>
|
|
</div>
|
|
|
|
<!-- Parent Task (for sub-tasks) -->
|
|
<div>
|
|
<label for="parent_issue_id" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
父任務
|
|
</label>
|
|
<select name="parent_issue_id" id="parent_issue_id"
|
|
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100">
|
|
<option value="">無(頂層任務)</option>
|
|
@foreach($openIssues as $parentIssue)
|
|
<option value="{{ $parentIssue->id }}" @selected(old('parent_issue_id') == $parentIssue->id)>
|
|
{{ $parentIssue->issue_number }} - {{ $parentIssue->title }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">將此設為另一個任務的子任務</p>
|
|
</div>
|
|
|
|
<!-- Labels -->
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
|
標籤
|
|
</label>
|
|
<div class="grid grid-cols-2 sm:grid-cols-3 gap-2">
|
|
@foreach($labels as $label)
|
|
<label class="inline-flex items-center">
|
|
<input type="checkbox" name="labels[]" value="{{ $label->id }}"
|
|
@checked(in_array($label->id, old('labels', [])))
|
|
class="rounded border-gray-300 text-indigo-600 shadow-sm focus:ring-indigo-500 dark:bg-gray-700 dark:border-gray-600">
|
|
<span class="ml-2 inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium"
|
|
style="background-color: {{ $label->color }}20; color: {{ $label->color }}">
|
|
{{ $label->name }}
|
|
</span>
|
|
</label>
|
|
@endforeach
|
|
</div>
|
|
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">選擇一個或多個標籤來分類此任務</p>
|
|
</div>
|
|
|
|
<!-- Actions -->
|
|
<div class="flex items-center justify-end gap-x-4 border-t border-gray-200 pt-6 dark:border-gray-700">
|
|
<a href="{{ route('admin.issues.index') }}"
|
|
class="rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 dark:bg-gray-700 dark:text-gray-100 dark:ring-gray-600 dark:hover:bg-gray-600">
|
|
取消
|
|
</a>
|
|
<button type="submit"
|
|
class="inline-flex justify-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:bg-indigo-500 dark:hover:bg-indigo-400 dark:focus:ring-offset-gray-800">
|
|
新增任務
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Help Section -->
|
|
<div class="mt-6 rounded-lg bg-blue-50 p-4 dark:bg-blue-900/30 border-l-4 border-blue-400">
|
|
<div class="flex">
|
|
<div class="flex-shrink-0">
|
|
<svg class="h-5 w-5 text-blue-400" fill="currentColor" viewBox="0 0 20 20">
|
|
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"/>
|
|
</svg>
|
|
</div>
|
|
<div class="ml-3">
|
|
<h3 class="text-sm font-medium text-blue-800 dark:text-blue-200">建立任務</h3>
|
|
<div class="mt-2 text-sm text-blue-700 dark:text-blue-300">
|
|
<ul class="list-disc pl-5 space-y-1">
|
|
<li>使用工作項目處理一般任務和待辦事項</li>
|
|
<li>專案任務用於特定的專案里程碑</li>
|
|
<li>會員請求追蹤來自會員的查詢或請求</li>
|
|
<li>將任務指派給團隊成員以追蹤責任歸屬</li>
|
|
<li>使用標籤輕鬆分類和篩選任務</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|