Files
Viktor Miller 9c0657039a 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)
2026-01-14 19:35:57 +09:00

217 lines
7.2 KiB
Markdown

---
phase: 03-job-management-core
plan: 01
type: execute
depends_on: []
files_modified: [includes/class-formidable.php]
---
<objective>
Create Formidable Forms job submission form that creates job_offer posts with pending status.
Purpose: Enable providers to submit job listings through a frontend form. All submissions go to pending status for admin approval (core value: moderation before publication).
Output: Functional job submission form accessible to logged-in providers, creating job_offer posts with ACF fields populated.
</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-03-SUMMARY.md
@.planning/phases/02-provider-registration-auth/02-01-SUMMARY.md
@includes/class-formidable.php
@includes/class-acf-fields.php
@includes/class-post-types.php
**Tech stack available:** Formidable Forms Pro (with Post Creation), ACF Pro, job_offer CPT
**Established patterns:** Programmatic Formidable form creation (from 02-01)
**Constraining decisions:**
- Jobs must submit to pending status (Phase 01-03)
- German labels for all form fields (PROJECT.md)
- ACF fields: job_location, job_type, job_deadline, job_contact_email, job_logo (Phase 01-03)
- Form key pattern for easy retrieval (established in 02-01)
</context>
<tasks>
<task type="auto">
<name>Task 1: Create Formidable job submission form with ACF field mapping</name>
<files>includes/class-formidable.php</files>
<action>
Add `create_job_submission_form()` method to DDHH_JM_Formidable class. Programmatically create Formidable form with key 'job_submission' containing:
**Form Fields (all German labels):**
1. job_title (text, required) - "Stellentitel"
2. job_description (textarea, required) - "Stellenbeschreibung"
3. job_location (text, required) - "Standort"
4. job_type (select, required) - "Art" with choices: Vollzeit, Teilzeit, Ehrenamt
5. job_deadline (date, optional) - "Bewerbungsfrist" (format: d.m.Y)
6. job_contact_email (email, required) - "Kontakt-E-Mail"
7. job_logo (file upload, optional) - "Logo" (accept: image/jpeg, image/png, max: 2MB)
**Form Actions:**
- Create Post action configured to:
- Post type: 'job_offer'
- Post status: 'pending' (CRITICAL - enforces admin approval)
- Post title: mapped to job_title field
- Post content: mapped to job_description field
- Post author: current logged-in user (providers own their jobs)
- Custom field mappings to ACF fields:
- job_location → meta:job_location
- job_type → meta:job_type
- job_deadline → meta:job_deadline
- job_contact_email → meta:job_contact_email
- job_logo → meta:job_logo (as attachment ID)
**Form Settings:**
- Submit button text: "Stellenangebot einreichen"
- Success message: "Ihr Stellenangebot wurde zur Prüfung eingereicht!"
- Success action: Redirect to provider dashboard (/anbieter-dashboard/)
- Form description: "Alle Felder mit * sind Pflichtfelder. Ihr Angebot wird vor Veröffentlichung geprüft."
Add `get_job_submission_form_id()` helper method similar to `get_registration_form_id()`.
Hook form creation into existing `setup_registration_hooks()` or create separate `setup_job_forms_hooks()` if cleaner.
AVOID creating duplicate forms - check if form with key 'job_submission' exists before creating.
WHY: Prevents multiple identical forms in Formidable admin on plugin re-activation.
</action>
<verify>
1. Check form exists: In WP-Admin → Formidable → Forms, verify form titled "Stellenangebot einreichen" exists
2. Check field count: Form should have 7 fields total
3. Check form action: Form should have "Create Post" action set to post_type='job_offer', status='pending'
4. PHP syntax: php -l includes/class-formidable.php (no errors)
</verify>
<done>
- Formidable form created programmatically with key 'job_submission'
- All 7 fields present with German labels
- Create Post action configured with pending status
- ACF field mappings complete
- No PHP syntax errors
</done>
</task>
<task type="auto">
<name>Task 2: Add form to provider dashboard with access control</name>
<files>templates/provider-dashboard.php</files>
<action>
Add job submission form to provider dashboard template above the job listings table.
**Structure:**
```php
<div class="ddhh-job-submit-section">
<h2>Neues Stellenangebot erstellen</h2>
<?php
$form_id = DDHH_JM_Formidable::get_job_submission_form_id();
if ( $form_id ) {
echo do_shortcode( "[formidable id={$form_id}]" );
} else {
echo '<p>Formular konnte nicht geladen werden.</p>';
}
?>
</div>
<div class="ddhh-job-listings-section">
<h2>Meine Stellenangebote</h2>
<!-- existing job listings table -->
</div>
```
**Styling (add to existing <style> block):**
- .ddhh-job-submit-section: margin-bottom: 3rem, padding: 2rem, background: #f5f5f5, border-radius: 8px
- Form should be visually distinct from job listings table
AVOID adding shortcode if form doesn't exist - check $form_id first.
WHY: Prevents errors if Formidable Forms is deactivated.
</action>
<verify>
1. Template file updated with submission form section
2. Form appears above job listings table
3. Visual separation between form and listings
4. php -l templates/provider-dashboard.php (no errors)
</verify>
<done>
- Dashboard template includes job submission form
- Form section visually separated from listings
- Graceful fallback if form doesn't exist
- No PHP syntax errors
</done>
</task>
</tasks>
<verification>
Before declaring plan complete:
- [ ] Form 'job_submission' exists in Formidable Forms
- [ ] Form has 7 fields with German labels
- [ ] Create Post action configured with post_type='job_offer', status='pending'
- [ ] ACF fields mapped correctly in form action
- [ ] Form appears on provider dashboard at /anbieter-dashboard/
- [ ] No PHP syntax errors in modified files
</verification>
<success_criteria>
- All tasks completed
- Job submission form functional
- Form creates job_offer posts with pending status
- ACF fields populated from form submission
- Form accessible on provider dashboard
- Ready for Plan 03-02 (edit form)
</success_criteria>
<output>
After completion, create `.planning/phases/03-job-management-core/03-01-SUMMARY.md` with:
---
phase: 03-job-management-core
plan: 01
subsystem: job-submission
tags: [formidable, job-creation, post-creation, acf-mapping]
requires: [01-03, 02-01]
provides: [job-submission-form]
affects: [03-03]
tech-stack:
added: [formidable-post-creation]
patterns: [post-creation-action, acf-field-mapping]
key-files:
modified: [includes/class-formidable.php, templates/provider-dashboard.php]
key-decisions: []
issues-created: []
---
# Phase 3 Plan 1: Job Submission Form Summary
**[Substantive one-liner - what shipped]**
## Accomplishments
- [Key outcomes]
## Files Created/Modified
- `includes/class-formidable.php` - [description]
- `templates/provider-dashboard.php` - [description]
## Technical Details
[Form structure, field mappings, post creation action configuration]
## Decisions Made
[Any implementation choices, or "None"]
## Issues Encountered
[Problems and resolutions, or "None"]
## Next Step
Ready for 03-02-PLAN.md (job edit form)
</output>