-- =============================================================================
-- Plesk dashboard menu: Super Admin (99999) – add Users + Volunteer Management
-- =============================================================================
-- Run this on the same database as the Plesk Event Register (e.g. el_paraiso).
-- Requires tables: EventDashBoardMenus and/or `EventDashboardMenu-Buttons`
-- (create them with Plesk/event-dashboard-menus.sql if missing).
--
-- PHP files that USE these menu tables / this behaviour:
--   Plesk/event-dashboard.php              – includes menu, shows dashboard
--   Plesk/event-dashboard-menu-plesk.php   – reads menu from DB, renders buttons
--   Plesk/event-volunteer-management.php   – Volunteer Management (allowed: 99999, 999914)
--   Plesk/event-user-management.php        – Users page (linked by 'users' button)
--   Plesk/event-dashboard-menus-admin.php  – CRUD for menu buttons (member 99999, 999914)
--
-- Plesk-tools PHP files that link to dashboard / Volunteer Management:
--   Plesk-tools/tools-setup-volunteer-management.php  – setup; links to event-volunteer-management.php
--   Plesk-tools/tools-add-upload-restriction.php      – links to event-volunteer-management.php
--   Plesk-tools/update-managing-director-folder.php   – links to event-volunteer-management.php
-- =============================================================================

-- 1) Legacy table: one row per member (comma-separated button keys)
INSERT INTO EventDashBoardMenus (memberid, menu_buttons) VALUES
('99999', 'users, create event, import, webmail, myrole, boarddocs, volunteermanagement, serviceorder, volunteerwebmail, google workspace, logout')
ON DUPLICATE KEY UPDATE menu_buttons = VALUES(menu_buttons);

-- 2) Normalized table: one row per button (preferred by event-dashboard-menu-plesk.php)
INSERT INTO `EventDashboardMenu-Buttons` (memberid, sort_order, button_key) VALUES
('99999', 1, 'users'),
('99999', 2, 'create event'),
('99999', 3, 'import'),
('99999', 4, 'webmail'),
('99999', 5, 'myrole'),
('99999', 6, 'boarddocs'),
('99999', 7, 'volunteermanagement'),
('99999', 8, 'serviceorder'),
('99999', 9, 'volunteerwebmail'),
('99999', 10, 'google workspace'),
('99999', 11, 'logout')
ON DUPLICATE KEY UPDATE button_key = VALUES(button_key);
