=== Public Court Records ===
Contributors: dizwebdesign
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 0.7.17
License: GPLv2 or later

Mansfield Municipal Court records with MMC JSON import, public search, private proof PDFs, and revision history.

== Description ==

Stores Mansfield Municipal Court data from Mansfield Municipal Collector (MMC) JSON. Search on the front end. Proof PDFs live in a private evidence folder (not the media library) and are visible only to administrators and assigned permission groups.

== Installation ==

1. Upload the plugin ZIP via Plugins → Add New → Upload.
2. Activate and open Court Records → Dashboard → Run update & sync.
3. Import MMC `pcr-import` JSON (upload or filesystem path). Optionally set the print-PDF folder in Settings.
4. Use Court Records → Proof PDFs to manage evidence files, and Permissions to grant `pcr_view_evidence`.

== Changelog ==

= 0.7.17 =
* Multisite: network activation/deactivation runs per-site bootstrap; new sites get bootstrap when plugin is network-active; uninstall checks delete-data opt-in per blog.

= 0.7.16 =
* Case detail: restore Case docket list (date / DIN / entry).
* Fix charges showing as the word "Array" (PHP cast of charge lists on import/save); rebuild text from charge rows.
* Import: merge charge/docket child rows without array-to-string corruption; store docket entry_text correctly.
* DB v30 backfill repairs existing "Array" charges_text and docket text.

= 0.7.15 =
* Case detail: stop duplicating collection provenance in Additional details (staff Collection evidence only).

= 0.7.14 =
* Case detail: one Proof PDF section (bottom only); removed duplicate at top.

= 0.7.13 =
* Collection evidence: bottom of case detail; staff/admin only (not public or evidence-group viewers).

= 0.7.12 =
* Defendant party details: preserve DOB, gender, race, and court party ID from MMC JSON import; show them in case review.

= 0.7.10 =
* Data conflict (closed): flag Closed cases when docket/events lack sentencing, dismissal, or other closure evidence. DB v29 re-backfills flags on Update & sync.

= 0.7.9 =
* Charge classes: court LEVEL=M DEGREE=M → MM (Minor Misdemeanor); LEVEL=M DEGREE=U → UM (Unclassified Misdemeanor). Re-classifies matching rows on Update & sync (DB v28).

= 0.7.8 =
* Popup modals are draggable (title or “Drag to move” bar). Nested modals (e.g. View case from a charge-class list) stack so both panels stay reachable and movable.

= 0.7.7 =
* Collection evidence: import per-case collected_at, collection_log, and collection_evidence; show provenance next to Proof PDF for evidence-capable users.
* Prefer case collected_at for scraped_at when present in the import payload.

= 0.7.6 =
* Judge review: click a charge class to open the closed-case charge list in a modal; admins can View case and set degree (especially Misdemeanor/Felony degree unknown).

= 0.7.5 =
* Data conflict banner when court status is still open but docket/events look terminal (e.g. Sentencing); court status stays authoritative.
* Dashboard filing-conflict stats with year filter and Cases list jump (DB v27).

= 0.7.4 =
* Judge stats: average / median / min / max completion days per charge class (M1, M2…).
* Gutenberg block “Judge review stats” (same as [pcr_judge_stats judge="…"]).

= 0.7.3 =
* Judge review open watch list: case number opens that case in a popup modal.
* Charge classes keep M1/M2/M3… (and F1…) separate; re-backfill class_code (DB v26).

= 0.7.2 =
* Judge review admin screen and [pcr_judge_stats] shortcode: completion days, per-charge classes, open watch list; combined Magistrate row with red label.

= 0.6.9 =
* MMC heartbeat REST (`pcr/v1/mmc-status`) and Settings panel showing collector run state from the laptop.

= 0.6.8 =
* MMC ingest: resolve proof PDFs by sanitized ZIP names or case-number prefix; report PDF link errors in the import summary.

= 0.6.7 =
* Case detail (pending review): Proof PDF Open link at top and bottom for admins; always shown when a PDF is linked.

= 0.6.6 =
* MMC can request push as pending review or approved via envelope `review_status` (overrides site “require review” for that batch; needs_review cases still pending).

= 0.6.5 =
* Pending review and case view: show Open proof PDF first; hide court website detail link (blocked for direct access). Missing PDF is called out clearly.

= 0.6.4 =
* MMC Test connection (dry_run, empty cases) returns OK instead of HTTP 500.

= 0.6.3 =
* Hub ZIP updates now record the new version and sync DB/pages (fixes stuck “Database or pages need repair” after DWD hub update).

= 0.6.2 =
* Optional REST ingest from MMC (`POST /wp-json/pcr/v1/mmc-import`). Off by default. Same merge pipeline as JSON file import.

= 0.6.1 =
* Permission groups can set per-user search quotas (day/week/month) and a Paid searcher cap to search all courts. Free and anonymous searchers must pick a court. Anonymous IP quotas live in Settings.

= 0.6.0 =
* MMC JSON import only (no browser-extension REST/CSV/ZIP). Proof PDFs stored in a private folder, not the gallery, with an admin PDF manager. Search and case view include magistrate, prosecutors, caption, and court history.

= 0.5.24 =
* Security: field-type sanitization for case save/import (textarea docket/charges, URL detail link, attorney/date filters); allowlisted bulk redirect query args; import format validation.

= 0.5.23 =
* Parties Attorney field: ignore court party-table side labels (e.g. DEFENDANT) mistaken for attorney names.

= 0.5.22 =
* Parties section shows Judge and Attorney(s) even when plaintiff/defendant rows exist; judge from summary and JUDGE party rows.

= 0.5.21 =
* Case view: one Parties section (removed duplicate Party list); attorneys from party rows and Attorney column.

= 0.5.20 =
* Party list keeps plaintiff from court scrape (Summary Plaintiff, State/Prosecutor party types); partial re-sync no longer wipes plaintiff rows.

= 0.5.19 =
* Party list shows plaintiff for criminal/traffic cases (STATE OF OHIO when only defendant is scraped); caption/title parsing.

= 0.5.18 =
* Parties section and party list show plaintiff again (derive from party rows / summary).

= 0.5.17 =
* Court Type from case number when scrape/import omitted it; pair with extension 2.6.9.

= 0.5.16 =
* Court Type in case Overview: reads case/court type columns and summary JSON; DB backfill on update.

= 0.5.15 =
* Case Overview shows Court type (Criminal, Traffic, etc.) from court or case type fields.

= 0.5.14 =
* Case Days calculated only by the plugin from court dates; extension day counts are ignored.

= 0.5.13 =
* Case Days computed from actual file/status/disposition dates; fixes identical counts on many cases.

= 0.5.12 =
* Fix defendant duplicated as plaintiff on import and in case view; backfill on plugin update.

= 0.5.11 =
* Admin edit-case modal matches front-end form styling.

= 0.5.10 =
* Pending review: Approve/Deny selected works again; per-page selector no longer nests inside POST forms.

= 0.5.9 =
* Pending review: Edit record and History modals available from case view.

= 0.5.8 =
* Case modal: Evidence section at the bottom; list pagination (25/50/100) on admin Cases, Pending review, and search results.

= 0.5.7 =
* Case Days in Overview with open/closed status colors; charges list; docket section removed from modal.

= 0.5.6 =
* Extension re-sync backfills parties/charges/events/docket when previously empty; party list in case modal.

= 0.5.5 =
* Public search shows approved cases only; pending review hidden on front-end (admin screens unchanged).
* Case modal: plaintiff from parties, status fix, additional summary fields.

= 0.5.4 =
* Case detail shows charge rows, summary_extra overview fields, improved events/docket display.

= 0.5.3 =
* Case modal charges left-aligned; search results layout width auto, max 100%.

= 0.5.2 =
* Front-end: black text throughout plugin UI (theme override for light-on-dark themes).

= 0.5.1 =
* Front-end main content width: auto (theme-friendly layout).

= 0.5.0 =
* Case detail: Events section; expects full JSON sync for structured events and docket rows.

= 0.4.9 =
* Case detail popup: readable layout and styles in admin and on the site.

= 0.4.8 =
* Fix front-end width overflow; contained layout and scrollable results table.

= 0.4.7 =
* Fix hub fly-out link and plugin staying active after hub/catalog update.

= 0.4.6 =
* Fix administrator access to Court Records admin after plugin update (capabilities / hub menu).

= 0.4.5 =
* Full-width search layout; improved results table column sizing and readability.

= 0.4.4 =
* REST: POST /pcr/v1/record for incremental per-case extension sync; discovery flag supports_incremental_record.

= 0.4.3 =
* Full-width front-end layout; search results as rows that open case detail in a modal.

= 0.4.2 =
* Search and Submit record use popup modals; search results show on the page when the search modal closes.

= 0.4.1 =
* Search form and results on the page; improved black-on-white contrast for public UI.

= 0.4.0 =
* Import merge: detect new vs existing cases, update changed fields, preserve review status and empty import columns on re-import.
* Admin Cases: multiselect, bulk hide/unhide, bulk delete; hidden cases excluded from public search.

= 0.3.9 =
* Professional case record view with docket table; improved extension import docket handling.

= 0.3.8 =
* Statistics on the public search page (right sidebar) and admin dashboard; tracks search count and latest search criteria.

= 0.3.7 =
* Black modal close button; Court field first on the search form.

= 0.3.6 =
* Search modal scrolls on small screens; Search/Cancel stay visible at the bottom.
* Submit record (renamed from Add record) with manual court name when not in the database list.

= 0.3.5 =
* Search modal: placeholders and visible field labels on the public search form.

= 0.3.4 =
* Extension uploads land on the site first; administrators review in WordPress only (not in the extension).

= 0.3.3 =
* Admin tab navigation on all screens; dashboard review queue; Cases list shows review status with approve/deny.

= 0.3.2 =
* Extension API requires court_name and court_jurisdiction on import/PDF; removed WordPress default court settings.

= 0.3.1 =
* REST discover endpoint (public) for extension multi-site setup; connection profile JSON on Settings.
* Ping returns site URL, name, and installation ID.

= 0.3.0 =
* REST API (pcr/v1) for browser extension: import CSV/JSON/ZIP and upload PDFs.
* API key auth; optional review queue for extension imports; Pending review admin screen.

= 0.2.7 =
* Dashboard link to the public search page.

= 0.2.2 =
* Sequential PDF upload with progress; PDF archive per case (newest first).

= 0.2.1 =
* Settings page: download JSON backup and restore (full replace or settings-only).

= 0.2.0 =
* Advanced multi-field search with date ranges, open/closed filter, and days-open filters.
* Parsed date columns and computed days fields on import/save.

= 0.1.0 =
* Initial release: custom tables, import dedup by case number, modal UI, revisions, PDF evidence.
