=== Automaize Event Calendar ===
Contributors:      automaize
Tags:              events, calendar, event calendar, recurring events, woocommerce
Requires at least: 6.0
Tested up to:      7.0
Requires PHP:      7.4
Stable tag:        1.6.1
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

Displays upcoming events in a responsive tile grid. Supports recurring events and optional WooCommerce ticket integration.

== Description ==

**Automaize Event Calendar** lets you create and manage events directly in the WordPress admin and display them anywhere on your site using a simple shortcode.

**Key features:**

* Responsive tile grid (1–4 columns, auto-adjusts on mobile)
* Events sorted chronologically — next event first
* Past events hidden automatically
* Recurring events: weekly, monthly by date, monthly by weekday (e.g. first Monday), or individual custom dates
* Configurable visibility window (how many days into the future) and maximum event count
* Per-event button text, subtitle, and time display
* Optional WooCommerce product link per event for ticket sales or booking
* REST API for a companion mobile app (public event browsing, plus an API-key-protected staff surface to manage events)
* Theme-overridable templates
* Fully translatable (ready for translation via GlotPress on WordPress.org)

**Shortcode usage:**

`[amzec_events]`

Optional attributes:

* `count` – maximum number of events to show (default: 12)
* `future_days` – show events up to N days in the future; 0 = unlimited (default: 0)
* `columns` – number of tile columns 1–4 (default: 3)
* `category` – comma-separated category slugs to filter

Example: `[amzec_events count="6" columns="2" future_days="90"]`

== Installation ==

1. Upload the `automaize-event-calendar` folder to `/wp-content/plugins/`.
2. Activate the plugin via **Plugins › Installed Plugins**.
3. Go to **Events › Einstellungen** to configure defaults.
4. Create events under **Events › Neu hinzufügen**.
5. Add the shortcode `[amzec_events]` to any page or post.

== Frequently Asked Questions ==

= How do I display events in a different number of columns? =

Use the `columns` attribute: `[amzec_events columns="2"]`. On tablets the grid automatically reduces to 2 columns, and on mobile to 1 column.

= Can I show only a specific category? =

Yes: `[amzec_events category="workshop,seminar"]`

= How does WooCommerce integration work? =

When editing an event, enter the ID of an existing WooCommerce product in the sidebar. An add-to-cart button will appear on the single event page.

= Can themes override the templates? =

Yes. Copy `templates/partials/event-tile.php` to `amzec-event-tile.php` in your theme root to override the tile, or `templates/single-amzec_event.php` to `single-amzec_event.php` in your theme root to override the single event page.

= Will deleting the plugin remove my events? =

Yes — uninstalling (deleting) the plugin removes all event posts, taxonomy terms, and plugin settings. Deactivating alone does not remove any data.

== Screenshots ==

1. Event tile grid on the frontend
2. Event edit screen with date, time and recurrence settings
3. Plugin settings page

== Changelog ==

= 1.6.1 =
* Tweak: the event tile image (`[amzec_events]` grid) is now a 1:1 square instead of 16:9 - a bigger, more prominent image at typical tile widths.

= 1.6.0 =
* New: "Tischbuchung an diesem Tag freischalten" (see AMZEC_Table_Booker_Integration) is now readable and writable through the REST API (`tablebooker_enabled` on the public/staff event responses and `POST`/`PUT /staff/events`), so the mobile app can expose it directly in the event form instead of requiring a separate trip to wp-admin.

= 1.5.1 =
* Fix: the single event page no longer relies on get_header()/get_footer() (i.e. on whatever theme/page builder happens to be active) - it's now fully self-contained, with its own header/footer matching the Kerstins static site's own branding/nav/footer directly (same styles.css, same logo). Diagnosed after a page builder (Breakdance) started silently swallowing ALL front-end WordPress output site-wide (confirmed via blank raw feeds/sitemap too, not just event pages) with no PHP error logged - deactivating it was the fix, so no more dependency on it for event pages either.
* Admin: the "Tischbuchung an diesem Tag freischalten" checkbox now shows a warning when an event's own time falls outside the regular opening hours (or on an otherwise-closed day) and the box isn't ticked - leaving it unchecked silently limits bookings to the normal hours instead of the event's actual time, which was reported as confusing guests.

= 1.5.0 =
* New: `GET /amzec/v1/today-menu` - resolves what a guest should see as "today's menu": today's event's menu (if one has a menu PDF), otherwise the standard menu. The standard menu is simple structured data (title/intro/sections/items/footer, not a PDF), stored via the new `POST /amzec/v1/staff/standard-menu` and maintained in parallel with the website's à la carte page - meant for native, inline display in the app rather than a PDF viewer.

= 1.4.0 =
* New: in-app ticket purchase for paid events. `POST /amzec/v1/events/{id}/ticket-order` creates a pending WooCommerce order (guest, for the event's linked product) and returns WooCommerce's own guest checkout URL; `GET /amzec/v1/events/{id}/ticket-order/{order_id}?key=` reports payment/reservation status. Once WooCommerce marks the order paid, a matching table reservation is created automatically in the Restaurant Reservation plugin (if active). The public `/events`/`/events/{id}` responses now include a `ticket` object (price, currency, stock) when an event has a linked product. The admin "Ticket-Produkt" field is now a real product dropdown instead of a raw numeric ID.

= 1.3.1 =
* Event editing now uses the classic (non-block) editor instead of Gutenberg. Event descriptions are always plain text anyway (both from wp-admin and the app), so this buys nothing functionally but meaningfully lowers peak memory on the event edit screen - helpful on hosts with a tight PHP memory_limit.

= 1.3.0 =
* New: menu PDF per event. Upload a PDF in the "Speisekarte (PDF)" box on the event edit screen (or via `POST`/`DELETE /staff/events/{id}/menu` from the app); guests get a "Speisekarte ansehen" button on the event page that opens it in an overlay instead of navigating away. The public `/events` and `/events/{id}` responses now include `menu_pdf_url`.

= 1.2.0 =
* Added `GET /staff/media`: a paginated listing of existing image attachments in the WordPress media library, so the app can offer "choose an existing image" alongside "upload a new one" when setting an event's featured image. `POST /staff/events/{id}/image` now also accepts a `media_id` of an existing attachment as an alternative to a file upload.

= 1.1.0 =
* New: REST API for the Kerstins mobile companion app (public event browsing plus an API-key-protected staff surface to create, edit, delete events and upload a featured image — including full recurrence support)

= 1.0.5 =
* New: Optional integration with Automaize Restaurant Table Booker — freischaltbare Tischbuchung an einzelnen Event-Tagen, auch außerhalb der regulären Öffnungszeiten oder während Betriebsferien

= 1.0.4 =
* Fix: Event tiles now align vertically across columns (CSS subgrid)
* Fix: "Mehr erfahren" button now displays correctly on Breakdance pages

= 1.0.3 =
* Fix: Column layout now works correctly on Breakdance pages (inline style beats page-builder CSS)

= 1.0.2 =
* New: Per-event display limit for recurring events ("Max. Anzeigen im Kalender")
* Fix: CSS grid now loads correctly on Breakdance-built pages

= 1.0.1 =
* Fix: German admin labels (meta box and settings page title)

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.0.3 =
Fixes column layout on Breakdance-built pages.

= 1.0.1 =
Adds per-event display limit for recurring events.

= 1.0.0 =
Initial release.
