xref: /plugin/calendar/README.md (revision 9ccd446ecbe25932c2e89f7608c11495a1f1dbac)
1# DokuWiki Calendar Plugin — Matrix Edition
2
3A full-featured calendar plugin for DokuWiki with five visual themes, Outlook sync, conflict detection, and an admin panel for managing events across namespaces.
4
5**Version:** 6.0.0
6**Author:** atari911 (atari911@gmail.com)
7**License:** GPL 2
8**Requires:** DokuWiki "Kaos" (2024) or newer
9
10---
11
12## Installation
13
141. Download the latest release ZIP.
152. Extract into `lib/plugins/` so the path is `lib/plugins/calendar/`.
163. Go to **Admin → Calendar Management** to verify.
17
18Alternatively, place the ZIP in the DokuWiki plugin manager upload field.
19
20---
21
22## Quick Start
23
24Add any of these to a wiki page:
25
26```
27{{calendar}}                          Full month calendar with event panel
28{{eventlist sidebar}}                 Sidebar widget (week grid + today/tomorrow)
29{{eventpanel}}                        Standalone event list
30{{eventlist range=30}}                Upcoming events for the next 30 days
31{{eventlist range=-7,30}}             Past 7 days through next 30 days
32```
33
34### Namespace-scoped calendars
35
36```
37{{calendar namespace=work}}           Only show events in the "work" namespace
38{{eventlist sidebar namespace=personal}}
39```
40
41### Theme selection
42
43```
44{{calendar theme=matrix}}
45{{calendar theme=purple}}
46{{calendar theme=pink}}
47{{calendar theme=professional}}
48{{calendar theme=wiki}}
49```
50
51The `wiki` theme reads your DokuWiki template's `style.ini` colors automatically. The default theme for sidebar widgets can be set globally in **Admin → Calendar Management → Themes**.
52
53---
54
55## Features
56
57### Calendar views
58
59- **Full calendar** — Month grid with clickable day cells, integrated event panel, month picker, AJAX navigation.
60- **Sidebar widget** — Compact week grid with expandable day events, Today / Tomorrow / Important Events sections, conflict badges.
61- **Event panel** — Standalone chronological event list with past-event collapsing.
62- **Event list** — Date-range-based display for dashboards and overview pages.
63
64### Event management
65
66- Create, edit, and delete events without page reload (AJAX).
67- All-day and timed events with start/end times.
68- Multi-day events with end date support.
69- Recurring events (daily, weekly, biweekly, monthly, yearly) with series editing.
70- Tasks with completion checkboxes and past-due badges.
71- Event colors (8 presets + custom hex picker).
72- Rich descriptions with full DokuWiki markup (bold, italic, links, etc.).
73- Draggable event dialogs.
74- Namespace-based organization.
75
76### Conflict detection
77
78Overlapping timed events on the same day display an ⚠️ badge with a tooltip listing all conflicts. Works across all views including after AJAX navigation.
79
80### Five themes
81
82| Theme | Style |
83|---|---|
84| **Matrix** | Green-on-dark with glow effects |
85| **Purple** | Purple-on-dark with soft highlights |
86| **Pink** | Hot pink neon on dark with particle effects |
87| **Professional** | Clean blue-on-white, no glow |
88| **Wiki** | Inherits colors from your DokuWiki template |
89
90All themes are applied via CSS variables — no inline style overrides. The sidebar widget, full calendar, event panel, day popups, conflict tooltips, and event dialogs all inherit theme colors consistently.
91
92### Outlook sync (one-way: DokuWiki → Outlook)
93
94Push calendar events to Microsoft 365 / Outlook via the Graph API.
95
96- **Delta sync** — Only new, modified, or deleted events hit the API. Unchanged events are skipped entirely using hash-based change tracking.
97- **Category mapping** — Map DokuWiki namespaces or event colors to Outlook color categories.
98- **Duplicate detection** — Automatic cleanup of duplicate events.
99- **Dry-run mode** — Preview what would sync before committing.
100- **Cron-friendly** — Run on a schedule; typical syncs with few changes complete in seconds.
101
102Setup: copy `sync_config.php`, add your Azure app credentials, and run:
103
104```bash
105php lib/plugins/calendar/sync_outlook.php --dry-run
106php lib/plugins/calendar/sync_outlook.php
107```
108
109See `OUTLOOK_SYNC_SETUP.md` and `CRON_SETUP.md` for full instructions.
110
111---
112
113## Admin panel
114
115Access via **Admin → Calendar Management**. Four tabs:
116
117### Manage Events
118
119- **Event statistics** — Total events, namespaces, files, recurring series.
120- **Re-scan / Export / Import** — Bulk operations across all namespaces.
121- **Cleanup** — Delete events by age, status (completed tasks / past events), or date range. Automatic backup before deletion. Preview before committing.
122- **Recurring events table** — View, edit, and delete recurring series. Sortable columns, search filter. Edit dialog lets you change title, times, interval, and namespace for all occurrences at once.
123- **Namespace explorer** — Tree view of all events by namespace. Checkbox selection, drag-and-drop between namespaces, rename/delete namespaces, create new namespaces.
124
125### Update Plugin
126
127- Current version display.
128- Upload a new ZIP to update in place (automatic backup).
129- Paginated changelog viewer (all 150+ versions).
130- Clear DokuWiki cache.
131
132### Outlook Sync
133
134- Azure credential configuration (encrypted storage).
135- Category mapping editor.
136- Live sync runner with real-time log output.
137- Cron status detection.
138
139### Themes
140
141- Global sidebar widget theme selector with live preview.
142- Week start day setting (Sunday or Monday).
143
144---
145
146## File structure
147
148```
149calendar/
150├── syntax.php            Main plugin (calendar rendering, PHP event logic)
151├── action.php            AJAX handlers (create, edit, delete, navigate)
152├── admin.php             Admin panel (4 tabs, all management features)
153├── calendar-main.js      Client-side JavaScript (2,800+ lines)
154├── style.css             All CSS with theme variables (3,200+ lines)
155├── script.js             Empty loader (avoids DokuWiki concatenation)
156├── sync_outlook.php      Outlook sync script (delta-aware)
157├── sync_config.php       Outlook sync credentials (edit this)
158├── get_system_stats.php  System monitoring endpoint
159├── plugin.info.txt       Plugin metadata
160├── lang/en/lang.php      Language strings
161├── CHANGELOG.md          Full version history
162├── OUTLOOK_SYNC_SETUP.md Outlook sync setup guide
163├── CRON_SETUP.md         Cron job setup guide
164└── QUICK_REFERENCE.md    Syntax quick reference
165```
166
167---
168
169## Event data storage
170
171Events are stored as JSON files in DokuWiki's `data/meta/` directory:
172
173```
174data/meta/calendar/2026-02.json              Default namespace
175data/meta/work/calendar/2026-02.json         "work" namespace
176data/meta/personal/calendar/2026-02.json     "personal" namespace
177```
178
179Each file is keyed by date, with an array of events per date. Events are plain JSON — no database required.
180
181---
182
183## Syntax reference
184
185### Full calendar
186
187```
188{{calendar}}
189{{calendar namespace=work theme=purple}}
190```
191
192### Sidebar widget
193
194```
195{{eventlist sidebar}}
196{{eventlist sidebar namespace=personal theme=wiki}}
197```
198
199### Event panel
200
201```
202{{eventpanel}}
203{{eventpanel namespace=work}}
204```
205
206### Event list with date range
207
208```
209{{eventlist range=30}}              Next 30 days
210{{eventlist range=-7,30}}           Past 7 days + next 30
211{{eventlist range=90 namespace=work}}
212```
213
214---
215
216## Week start day
217
218By default the week grid starts on Sunday. To change to Monday, go to **Admin → Calendar Management → Themes** and select Monday. This applies globally to all sidebar widgets.
219
220---
221
222## Changelog
223
224See `CHANGELOG.md` for the full version history. Recent highlights:
225
226- **6.0.0** — Code audit, admin cleanup, fresh README.
227- **5.5.8** — Delta sync for Outlook (hash-based change tracking).
228- **5.5.0** — Full CSS refactor, CSS variables as single source of truth for all themes.
229- **5.0.0** — Wiki theme with automatic template color inheritance.
230- **4.0.0** — Sidebar widget, five themes, conflict detection, system monitoring.
231
232---
233
234## Version 6.0.0
235