upskill-event-manager/templates/page-manage-event.php
ben ac8c09a294 feat: Phase 2 TEC Community Events replacement with native HVAC forms
Replace TEC Community Events templates with native HVAC Event Form Builder:

 Template Replacements:
- page-tec-create-event.php: Now uses HVAC_Event_Form_Builder with template integration
- page-manage-event.php: Redirects to integrated event management system
- Both templates preserve trainer authentication and role-based access

 Native HVAC Implementation:
- Enabled hvac_create_event shortcode with comprehensive form builder
- Integrated template system with category support (general,training,workshop,certification)
- Added Phase 2 success indicators and enhanced UI styling
- Auto-save functionality and template selector AJAX integration

 Authentication & Security:
- Proper trainer login redirect (/training-login/) for role-specific access
- Role validation for hvac_trainer/hvac_master_trainer
- WordPress nonce security and input sanitization maintained

 Backward Compatibility:
- Legacy URL redirects preserved through existing route manager
- TEC Core integration maintained for event display and calendar functions
- Template system ready for bulk operations and advanced features

🔄 Ready for Phase 2B: Template system UI enhancements and Save-as-Template functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-25 08:45:08 -03:00

40 lines
1 KiB
PHP

<?php
/**
* Template Name: Manage Event (Redirect)
* Description: Redirects to integrated HVAC event management system
*/
// Define constant to indicate we are in a page template
define('HVAC_IN_PAGE_TEMPLATE', true);
// Security check
if (!is_user_logged_in()) {
wp_redirect(home_url('/training-login/'));
exit;
}
// Check user roles
$user = wp_get_current_user();
if (!array_intersect(['hvac_trainer', 'hvac_master_trainer'], $user->roles)) {
wp_die(__('Access denied. Trainer role required.', 'hvac-community-events'));
}
// Redirect to integrated event management page
$redirect_url = home_url('/trainer/event/manage/');
// Preserve query parameters if present
if (!empty($_GET)) {
$redirect_url = add_query_arg($_GET, $redirect_url);
}
// Log the redirect for debugging (if debug mode is enabled)
if (defined('WP_DEBUG') && WP_DEBUG) {
error_log('Phase 2: Redirecting page-manage-event.php to integrated version: ' . $redirect_url);
}
// Perform the redirect
wp_safe_redirect($redirect_url, 301);
exit;
<?php
get_footer();