=== Legba Event ===
Contributors: pierreht
Tags: events, calendar, registration, rsvp, bilingual
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.7.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Bilingual (French/English) event calendar with registrations, waitlists, repeating events and free maps. Made for community organizations.

== Description ==

**Calendar views** — one shortcode or block, five views:

* Month: navigable month with a clickable day grid and expandable event cards.
* Tiles: image cards for the month.
* Schedule: agenda grouped by day.
* Upcoming list with "load more".
* Happening now: live events with time remaining, then what comes next.

Visitors can switch views, filter by type, location and organizer, and search — without reloading the page.

**Events**

* Start/end, all-day and multi-day events, optional hidden end time.
* Repeating events: daily, weekly (several weekdays), monthly (same date or "2nd Tuesday / last Friday"), yearly; end after N times, on a date or never; skip dates.
* Subtitle, colour, featured events, status (scheduled, cancelled, postponed, rescheduled, moved online), online meeting link, "learn more" link.
* Locations with address and map, organizers with contact details, colour-coded event types.
* Add to Google Calendar, Apple or Outlook (.ics), plus a site-wide iCalendar feed.
* Share links, schema.org Event data for search engines.
* Duplicate events in one click.

**Registrations (included, no add-on)**

* Seat limit per date, several people per registration, waitlist promoted first come, first served.
* Confirmation, waitlist and "a seat opened up" emails in each person's language (French or English).
* Registrations list per date and CSV export that opens cleanly in Excel.
* Duplicate registrations blocked, spam honeypot.

**Public event submissions**

* `[cevreg_submit_form]` lets anyone propose an event (title, dates, description, location, types, online link, image, contact details).
* Submissions arrive as "Pending" with a count on the Events menu; the team is emailed and approves with one click; the person gets a receipt and a "published" email.
* Spam protection: honeypot, minimum fill time, a per-visitor hourly limit, image type and size checks (all adjustable).

**Settings you control** — about 50 options without code: time format, first day of the week, fonts, light or dark look, shadows, button and date shapes, six free map styles, colored pins, directions with Google Maps, Apple Maps or Waze, required phone, comments and consent fields, closing registrations early, a thank-you page, a copy of confirmations, a cancellation link in emails, proposal guidelines and more.

**Bilingual by design** — every calendar can show French only, English only, or both side by side, whatever the site language.

= Shortcodes =

`[cevreg_calendar view="month" lang="both" type="" location="" organizer="" featured="only|first" limit="10" filters="yes" search="yes" switcher="yes" grid="yes" hide_past="no"]`

`[cevreg_registration_form id="123"]`

`[cevreg_submit_form lang="both"]`

`[cevreg_my_events]`

A shortcode builder is included under Events → Settings, and the "Event calendar" block offers the same options.

= REST API =

* `GET /wp-json/cevreg/v1/events?start=YYYY-MM-DD&end=YYYY-MM-DD` — occurrences as JSON.
* `GET /wp-json/cevreg/v1/calendar?view=month&month=YYYY-MM` — calendar HTML (used by the calendar script).

== External services ==

This plugin works without any account or API key. It connects to the outside services below only in the situations described. Nothing is sent to the plugin author.

**Map tiles (off by default; only after the site owner turns maps on in Events → Settings → Maps)**
When maps are on and a page shows one, the visitor's browser downloads map images from the provider chosen in the settings. Like any web request, the provider receives the visitor's IP address, browser information and the map area being viewed. No personal data from the site is sent.

* OpenStreetMap standard tiles (tile.openstreetmap.org) — default. Terms: https://osmfoundation.org/wiki/Terms_of_Use — Privacy: https://osmfoundation.org/wiki/Privacy_Policy
* CARTO basemaps (basemaps.cartocdn.com), only if "Light", "Dark" or "Colorful" is chosen. Terms: https://carto.com/legal — Privacy: https://carto.com/privacy
* Humanitarian OpenStreetMap tiles (tile.openstreetmap.fr), only if "Humanitarian" is chosen. Terms and privacy: https://www.openstreetmap.fr/mentions-legales/
* OpenTopoMap (tile.opentopomap.org), only if "Topographic" is chosen. Terms and privacy: https://opentopomap.org/about

**Address search (admin only)**
OpenStreetMap Nominatim (nominatim.openstreetmap.org) is called from the location screen only when an editor clicks "Find on map". The typed address (and the country filter, if set) is sent to get coordinates. Usage policy: https://operations.osmfoundation.org/policies/nominatim/ — Privacy: https://osmfoundation.org/wiki/Privacy_Policy

**Online payments (only when the site owner turns them on in Events → Settings → Payments)**

* PayPal (api-m.paypal.com, or api-m.sandbox.paypal.com in test mode): the amount, currency, event name and return links are sent to create and capture the order; the person then pays on PayPal. Terms: https://www.paypal.com/legalhub — Privacy: https://www.paypal.com/myaccount/privacy/privacyhub
* Stripe (api.stripe.com): the amount, currency, event name and the registrant's email are sent to create a Checkout session; the person then pays on Stripe. Terms: https://stripe.com/legal — Privacy: https://stripe.com/privacy

**Links the visitor chooses to open (nothing is sent until the visitor clicks)**

* "Add to calendar": Google Calendar (calendar.google.com) receives the event title, dates, place and description in the link. Terms: https://policies.google.com/terms — Privacy: https://policies.google.com/privacy
* "Directions" and "Larger map": opens OpenStreetMap, Google Maps, Apple Maps or Waze (setting) with the event location. Google: https://policies.google.com/privacy — Apple: https://www.apple.com/legal/privacy/ — Waze: https://www.waze.com/legal/privacy
* "Share": opens Facebook, LinkedIn or X with the event link. Facebook: https://www.facebook.com/privacy/policy — LinkedIn: https://www.linkedin.com/legal/privacy-policy — X: https://x.com/en/privacy

**Bundled libraries**
Leaflet 1.9.4 (BSD-2-Clause) is included in assets/vendor/leaflet and loaded from the site itself, not from a CDN.

== Frequently Asked Questions ==

= Who can see registrations? =
Editors and administrators (`edit_others_posts`). Change it with the `cevreg_manage_capability` filter.

= Can I use the block editor for events? =
Events use the classic screen so dates and repeat rules are always visible. `add_filter( 'cevreg_use_block_editor', '__return_true' );` switches back.

= Developer hooks =
`cevreg_event_query_args`, `cevreg_schema`, `cevreg_notify_admin`, `cevreg_registered` (action).

== Changelog ==

= 0.7.0 =
* Redesigned settings screen: header with key figures, side navigation with icons, cards, switches, sticky save bar and a live appearance preview.
* 50 new options: 10 each in General (week start, 12/24-hour clock, list size and horizon, summary length, empty message, default filters and search, add-to-calendar, event page address), Appearance (font, text size, light/dark scheme, card background, shadows, date badge shape, button shape, spacing, hover effect, animations), Maps (map style, height, marker color, black and white, wheel zoom, where maps appear, directions service, larger map link, address search country), Registrations (phone field, comments field, consent checkbox and text, seats left, closing delay, default capacity, thank-you page, Bcc copy, self-cancellation link) and Proposals (guidelines, minimum description, default type, online link field, required image, image size, hourly limit, notification address, thank-you message, clean-up of old proposals).
* Registrants can cancel their own registration from their emails; the seat goes to the waitlist.
* Refreshed front-end look: softer cards, gradient date badges, nicer buttons, forms and empty states.

= 0.6.0 =
* Extension points for ticket types, emails (extra lines and attachments), event page sections, submission holds and payment references.
* Registration form: ticket type choice with live total; "From" prices in listings.
* Database: ticket, ticket code and check-in time on registrations.
* Legba Event Pro 1.1: ticket types (Early Bird, VIP…), PDF tickets with QR code, check-in screen with camera scanning, saved events with reminders, reviews, polls, paid event proposals, CSV/ICS/RSS import with calendar sync, CSV export and RSS feed, AI writing assistant (OpenAI), Zoom and Jitsi links, webhooks (Zapier, Make, IFTTT) and an Event API with keys.

= 0.5.1 =
* Automatic email reminders to confirmed registrants 7, 3 and 1 day(s) before the event, in each person's language, with the event details. Choose the days and write your own French and English messages; each event can turn them off and add a note.
* "Send a reminder now" button on the Registrations screen.

= 0.5.0 =
* New "Event details open" option in the block (accordion or event page).
* Extension points for add-ons: views, opening modes, card styles, settings tabs, event fields.
* Legba Event Pro (separate package): full month grid, week, day, year, map of all events (OpenStreetMap or Google Maps), slider, countdowns, lightbox, gradients, Font Awesome icons, highlight layouts, several locations/organizers and a shortcode generator with live preview.

= 0.4.0 =
* "My events" page for members: follow, edit and withdraw proposals.
* Trusted partners (by role or per user) publish without review.
* Paid events: PayPal, Stripe (cards, Apple Pay, Google Pay), Interac e-Transfer and pay on site; seats held during payment, server-side verification, signed Stripe webhook, mark as paid, paid waitlist promotion.

= 0.3.0 =
* Public event submission form with approval workflow and email notifications.

= 0.2.0 =
* Full calendar: month grid and cards, tiles, schedule, list and "happening now" views with live filters and search.
* Repeating events, locations with OpenStreetMap maps, organizers, event types, statuses, featured and online events.
* Add to calendar (.ics / Google), iCalendar feed, share links, JSON-LD, REST API, block, widget, settings with shortcode builder, duplicate.
* Registrations per date for repeating events.

= 0.1.0 =
* First version: bilingual registration form, waitlist, CSV export.
