--- phase: 03-job-management-core plan: 01 subsystem: job-submission tags: [formidable, job-creation, post-creation, acf-mapping] # Dependency graph requires: - phase: 01-foundation-setup provides: [job_offer CPT, ACF fields, post types] - phase: 02-provider-registration-auth provides: [provider role, formidable patterns, dashboard template] provides: - job-submission-form - formidable-post-creation-pattern - acf-field-mapping affects: [03-02, 03-03, 04-01] # Tech tracking tech-stack: added: [formidable-post-creation-action] patterns: [post-creation-action, acf-field-mapping, form-to-cpt] key-files: created: [] modified: [includes/class-formidable.php, templates/provider-dashboard.php] key-decisions: - "Job submissions create posts with 'pending' status enforcing admin moderation" - "Form fields map directly to ACF meta fields using Formidable's Create Post action" - "Logo uploaded as file field, stored as attachment ID in ACF" - "Success redirect to provider dashboard after submission" patterns-established: - "Formidable form creation: check existing form by key before creating to avoid duplicates" - "Field IDs stored in array for use in form action configuration" - "Static form ID caching in class properties for performance" issues-created: [] # Metrics duration: 15min completed: 2026-01-14 --- # Phase 3 Plan 1: Job Submission Form Summary **Formidable job submission form with 7 fields creating pending job_offer posts mapped to ACF fields** ## Performance - **Duration:** 15 min - **Started:** 2026-01-14T10:30:00Z - **Completed:** 2026-01-14T10:45:00Z - **Tasks:** 2 - **Files modified:** 2 ## Accomplishments - Created Formidable job submission form programmatically with key 'job_submission' - Configured 7 fields with German labels: title, description, location, type, deadline, email, logo - Set up Create Post action to create job_offer posts with pending status - Mapped all form fields to corresponding ACF fields - Integrated form into provider dashboard above job listings table - Added visual styling to separate form section from listings ## Task Commits Each task was committed atomically: 1. **Task 1: Create Formidable job submission form with ACF field mapping** - `650c7b0` (feat) 2. **Task 2: Add form to provider dashboard with access control** - `600e355` (feat) ## Files Created/Modified - `includes/class-formidable.php` - Added create_job_submission_form() method with 7 fields (title, description, location, type, deadline, email, logo), Create Post action configuration, and get_job_submission_form_id() helper - `templates/provider-dashboard.php` - Added job submission form section above listings table with visual separation styling (gray background, padding, border-radius) ## Technical Details **Form Structure:** - Form key: 'job_submission' - Submit button: "Stellenangebot einreichen" - Success message: "Ihr Stellenangebot wurde zur Prüfung eingereicht!" - Success action: Redirect to /anbieter-dashboard/ - Form description: "Alle Felder mit * sind Pflichtfelder. Ihr Angebot wird vor Veröffentlichung geprüft." **Field Mappings:** - job_title (text, required) → post_title - job_description (textarea, required) → post_content - job_location (text, required) → meta:job_location - job_type (select, required) → meta:job_type (choices: Vollzeit, Teilzeit, Ehrenamt) - job_deadline (date, optional, format: d.m.Y) → meta:job_deadline - job_contact_email (email, required) → meta:job_contact_email - job_logo (file, optional, accept: image/jpeg, image/png, max: 2MB) → meta:job_logo **Create Post Action Configuration:** - Post type: job_offer - Post status: pending (enforces admin moderation) - Post author: current_user (providers own their submissions) - All ACF fields mapped via post_custom_fields array ## Decisions Made **Form creation pattern:** Used same duplicate-prevention pattern as registration form - check for existing form by key before creating. This prevents multiple forms on plugin reactivation. **Field ID storage:** Stored field IDs in array immediately after creation to use in Create Post action configuration. This ensures correct field-to-meta mappings. **Static caching:** Added static property for job_submission_form_id following existing pattern from registration form for consistent performance optimization. **Dashboard integration:** Placed form above job listings table rather than below to make it prominent for providers creating their first job. Added visual separation with background color and padding. ## Deviations from Plan None - plan executed exactly as written. ## Issues Encountered None - implementation proceeded smoothly following established Formidable patterns from Phase 02-01. ## Next Phase Readiness Ready for 03-02 (job edit form). Job submission form is functional and creates pending job_offer posts with all ACF fields populated. Providers can now submit jobs from their dashboard. Edit functionality is the natural next step for managing existing submissions. --- *Phase: 03-job-management-core* *Completed: 2026-01-14*