docs(03): create phase 3 plans
Phase 3: Job Management Core - 4 plans created - 8 total tasks defined - Ready for execution Plans: - 03-01: Job submission form (Formidable + ACF) - 03-02: Job edit form with ownership validation - 03-03: Admin email notification on submission - 03-04: Admin moderation UI enhancements Parallelization: - Wave 1: 03-01, 03-02, 03-04 (independent) - Wave 2: 03-03 (depends on 03-01)
This commit is contained in:
255
.planning/phases/03-job-management-core/03-04-PLAN.md
Normal file
255
.planning/phases/03-job-management-core/03-04-PLAN.md
Normal file
@@ -0,0 +1,255 @@
|
||||
---
|
||||
phase: 03-job-management-core
|
||||
plan: 04
|
||||
type: execute
|
||||
depends_on: []
|
||||
files_modified: [includes/class-admin-ui.php, includes/class-ddhh-job-manager.php, ddhh-job-manager.php]
|
||||
---
|
||||
|
||||
<objective>
|
||||
Enhance WordPress admin interface for job moderation with custom columns, filters, and quick actions.
|
||||
|
||||
Purpose: Give admins efficient tools to moderate job submissions. Better visibility = faster moderation = core value delivered.
|
||||
Output: Admin job listing with pending count badge, status filters, and provider info columns.
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
~/.claude/get-shit-done/workflows/execute-plan.md
|
||||
~/.claude/get-shit-done/templates/summary.md
|
||||
</execution_context>
|
||||
|
||||
<context>
|
||||
@.planning/PROJECT.md
|
||||
@.planning/ROADMAP.md
|
||||
@.planning/STATE.md
|
||||
@.planning/phases/01-foundation-setup/01-02-SUMMARY.md
|
||||
@.planning/phases/01-foundation-setup/01-03-SUMMARY.md
|
||||
@includes/class-post-types.php
|
||||
@includes/class-acf-fields.php
|
||||
|
||||
**Tech stack available:** WordPress admin hooks, job_offer CPT, ACF fields
|
||||
**Established patterns:** German labels for admin UI
|
||||
**Constraining decisions:**
|
||||
- Admin moderation is core workflow (PROJECT.md)
|
||||
- Jobs start as pending (Phase 01-03)
|
||||
- ACF fields available: job_location, job_type, job_contact_email
|
||||
</context>
|
||||
|
||||
<tasks>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 1: Add custom admin columns for job moderation</name>
|
||||
<files>includes/class-admin-ui.php</files>
|
||||
<action>
|
||||
Create new file `includes/class-admin-ui.php` with class `DDHH_JM_Admin_UI`.
|
||||
|
||||
**Custom Columns for job_offer post type:**
|
||||
|
||||
Hook into `manage_job_offer_posts_columns` filter to add columns:
|
||||
1. **Anbieter** (Provider) - Organization name + contact person
|
||||
2. **Standort** (Location) - job_location ACF field
|
||||
3. **Art** (Type) - job_type ACF field
|
||||
4. **Eingereicht am** (Submitted) - Post creation date
|
||||
|
||||
Remove default columns if cluttering:
|
||||
- 'date' (replaced by custom "Eingereicht am")
|
||||
- 'author' (replaced by custom "Anbieter" with org name)
|
||||
|
||||
Hook into `manage_job_offer_posts_custom_column` action to populate column data:
|
||||
- **Anbieter:** Display `{org_name}<br><small>{contact_person}</small>` where org_name is user meta 'ddhh_org_name'
|
||||
- **Standort:** get_field('job_location', $post_id)
|
||||
- **Art:** get_field('job_type', $post_id)
|
||||
- **Eingereicht am:** get_the_date('d.m.Y H:i', $post_id)
|
||||
|
||||
Make columns sortable via `manage_edit-job_offer_sortable_columns` filter (at minimum: Eingereicht am, Standort, Art).
|
||||
|
||||
AVOID cluttering admin with too many columns - remove non-essential defaults.
|
||||
WHY: Admins need to see moderation-relevant info at a glance, not every detail.
|
||||
</action>
|
||||
<verify>
|
||||
1. Class file created with proper structure
|
||||
2. Custom columns registered via manage_*_columns hooks
|
||||
3. Column data populated correctly
|
||||
4. Sortable columns work
|
||||
5. php -l includes/class-admin-ui.php (no errors)
|
||||
</verify>
|
||||
<done>
|
||||
- Admin columns added: Anbieter, Standort, Art, Eingereicht am
|
||||
- Column data populated from user meta and ACF fields
|
||||
- Sortable columns functional
|
||||
- No PHP syntax errors
|
||||
</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 2: Add status filters and pending count badge</name>
|
||||
<files>includes/class-admin-ui.php</files>
|
||||
<action>
|
||||
Add status filter links and pending count badge to admin job listing.
|
||||
|
||||
**Status Filters:**
|
||||
Hook into `views_edit-job_offer` filter to add custom view links:
|
||||
- All
|
||||
- Pending (Ausstehend)
|
||||
- Published (Veröffentlicht)
|
||||
- Draft (Entwurf)
|
||||
|
||||
Each link should include count of posts in that status.
|
||||
|
||||
**Pending Count Badge:**
|
||||
Add visual badge to "Pending" link using CSS class 'count':
|
||||
```php
|
||||
$pending_count = wp_count_posts('job_offer')->pending;
|
||||
$views['pending'] = sprintf(
|
||||
'<a href="%s">%s <span class="count">(%d)</span></a>',
|
||||
admin_url('edit.php?post_type=job_offer&post_status=pending'),
|
||||
__('Ausstehend', 'ddhh-job-manager'),
|
||||
$pending_count
|
||||
);
|
||||
```
|
||||
|
||||
Make "Pending" link prominent if count > 0 - admins should see it immediately.
|
||||
|
||||
**Quick Actions:**
|
||||
Keep default WordPress quick actions (Edit, Quick Edit, Trash) - don't remove.
|
||||
Consider adding custom "Approve" quick action that publishes post directly:
|
||||
- Link: wp_nonce_url with action 'approve_job'
|
||||
- Handler: Check nonce, verify user is admin, update post_status to 'publish'
|
||||
- Optional but helpful for one-click approval
|
||||
|
||||
AVOID removing WordPress's built-in quick actions - admins expect them.
|
||||
WHY: Standard WordPress UX, admins are familiar with Edit/Trash.
|
||||
</action>
|
||||
<verify>
|
||||
1. Status filter links present in admin
|
||||
2. Pending count badge shows correct number
|
||||
3. Filters work correctly when clicked
|
||||
4. Quick actions functional
|
||||
5. php -l includes/class-admin-ui.php (no errors)
|
||||
</verify>
|
||||
<done>
|
||||
- Status filter links added with counts
|
||||
- Pending badge visible and accurate
|
||||
- Filters functional
|
||||
- Quick actions preserved (Edit, Trash, etc.)
|
||||
- No PHP syntax errors
|
||||
</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 3: Integrate admin UI enhancements into plugin</name>
|
||||
<files>includes/class-ddhh-job-manager.php, ddhh-job-manager.php</files>
|
||||
<action>
|
||||
**File 1: ddhh-job-manager.php**
|
||||
Add require statement:
|
||||
```php
|
||||
require_once plugin_dir_path( __FILE__ ) . 'includes/class-admin-ui.php';
|
||||
```
|
||||
|
||||
**File 2: includes/class-ddhh-job-manager.php**
|
||||
Initialize admin UI hooks (admin-only):
|
||||
```php
|
||||
if ( is_admin() ) {
|
||||
add_action( 'init', array( 'DDHH_JM_Admin_UI', 'setup_hooks' ) );
|
||||
}
|
||||
```
|
||||
|
||||
Create `setup_hooks()` static method in DDHH_JM_Admin_UI class that registers all admin hooks:
|
||||
- manage_job_offer_posts_columns
|
||||
- manage_job_offer_posts_custom_column
|
||||
- manage_edit-job_offer_sortable_columns
|
||||
- views_edit-job_offer
|
||||
|
||||
AVOID loading admin hooks on frontend - check is_admin().
|
||||
WHY: Performance - frontend doesn't need admin column logic.
|
||||
</action>
|
||||
<verify>
|
||||
1. Require statement added to main plugin file
|
||||
2. Admin UI hooks initialized only in admin
|
||||
3. setup_hooks() method exists in DDHH_JM_Admin_UI
|
||||
4. php -l on both files (no errors)
|
||||
</verify>
|
||||
<done>
|
||||
- Admin UI class required
|
||||
- Hooks initialized (admin-only)
|
||||
- Integration complete
|
||||
- No PHP syntax errors
|
||||
</done>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
|
||||
<verification>
|
||||
Before declaring plan complete:
|
||||
- [ ] Custom admin columns visible in job_offer listing
|
||||
- [ ] Column data accurate (provider org, location, type, date)
|
||||
- [ ] Status filters functional
|
||||
- [ ] Pending count badge shows correct number
|
||||
- [ ] Sortable columns work
|
||||
- [ ] Only loads in admin (not frontend)
|
||||
- [ ] No PHP syntax errors
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
|
||||
- All tasks completed
|
||||
- Admin moderation UI enhanced
|
||||
- Custom columns provide visibility
|
||||
- Status filters aid workflow
|
||||
- Phase 3 complete - ready for Phase 4
|
||||
</success_criteria>
|
||||
|
||||
<output>
|
||||
After completion, create `.planning/phases/03-job-management-core/03-04-SUMMARY.md` with:
|
||||
|
||||
---
|
||||
phase: 03-job-management-core
|
||||
plan: 04
|
||||
subsystem: admin-ui
|
||||
tags: [admin, moderation, columns, filters, wordpress-admin]
|
||||
requires: [01-02, 01-03]
|
||||
provides: [admin-job-columns, status-filters]
|
||||
affects: []
|
||||
tech-stack:
|
||||
added: []
|
||||
patterns: [admin-columns, admin-filters, sortable-columns]
|
||||
key-files:
|
||||
created: [includes/class-admin-ui.php]
|
||||
modified: [includes/class-ddhh-job-manager.php, ddhh-job-manager.php]
|
||||
key-decisions:
|
||||
- Removed default 'author' and 'date' columns in favor of custom ones
|
||||
- Pending count badge for visibility
|
||||
- Admin-only hook loading for performance
|
||||
issues-created: []
|
||||
---
|
||||
|
||||
# Phase 3 Plan 4: Admin Moderation UI Summary
|
||||
|
||||
**[Substantive one-liner - what shipped]**
|
||||
|
||||
## Accomplishments
|
||||
|
||||
- [Key outcomes]
|
||||
|
||||
## Files Created/Modified
|
||||
|
||||
- `includes/class-admin-ui.php` - [description]
|
||||
- `includes/class-ddhh-job-manager.php` - [description]
|
||||
- `ddhh-job-manager.php` - [description]
|
||||
|
||||
## Admin Interface Changes
|
||||
|
||||
[Screenshot or description of new columns, filters, badges]
|
||||
|
||||
## Decisions Made
|
||||
|
||||
[Implementation choices, or "None"]
|
||||
|
||||
## Issues Encountered
|
||||
|
||||
[Problems and resolutions, or "None"]
|
||||
|
||||
## Next Step
|
||||
|
||||
Phase 3 complete. Ready for Phase 4: Job Deactivation System
|
||||
</output>
|
||||
Reference in New Issue
Block a user