upskill-event-manager/templates/page-manage-event.php
bengizmo 40274d98ad feat: Implement comprehensive user role field and certification tracking system
• Add user role field to registration, profile display, and profile edit
  - 10 role options: technician, installer, supervisor, manager, trainer, consultant, sales rep, engineer, business owner, other
  - Required field with server-side validation
  - Radio buttons in registration, dropdown in profile edit
  - Displays in profile with proper capitalization

• Implement advanced certification tracking system
  - Date Certified: HTML5 date picker with validation (no future dates)
  - Certification Type: dropdown with "Certified measureQuick Trainer" and "Certified measureQuick Champion"
  - Certification Status: color-coded status badges (Active/Expired/Pending/Disabled)

• Add sophisticated role-based access control
  - Regular trainers: read-only access to certification fields
  - Administrators & master trainers: full edit access to certification fields
  - Visual indicators for read-only fields
  - Server-side permission validation

• Enhance plugin activation system
  - Initialize all 36 user meta fields for existing users
  - Smart default assignment based on user capabilities
  - Backward compatibility maintained

• Add professional UI styling
  - Blue-bordered certification section with trophy icon
  - Color-coded status badges with proper contrast
  - Read-only field styling with visual indicators
  - Enhanced form controls with focus states

• Comprehensive testing and documentation
  - E2E test coverage with visual verification
  - Updated API reference with new meta fields
  - Access control patterns documented
  - 100% test pass rate on staging environment

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 10:52:11 -03:00

90 lines
2.6 KiB
PHP

<?php
/**
* Template Name: Manage Event
* Description: Template for managing events (uses The Events Calendar)
*/
// Define constant to indicate we are in a page template
define('HVAC_IN_PAGE_TEMPLATE', true);
get_header();
// The Events Calendar handles the event creation/editing interface
// This template ensures proper WordPress theme integration
?>
<style>
/* Hide duplicate headers and fix layout for event manage page */
.hvac-event-manage-wrapper .tribe-community-events #tribe-bar-form,
.hvac-event-manage-wrapper #tribe-bar-views,
.hvac-event-manage-wrapper .tribe-events-page-title {
display: none !important;
}
.hvac-event-manage-wrapper {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
/* Fix The Events Calendar layout issues */
.hvac-event-manage-wrapper #tribe-community-events,
.hvac-event-manage-wrapper .tribe-community-events {
background: transparent !important;
border: none !important;
box-shadow: none !important;
margin-top: 0 !important;
}
/* Hide any duplicate site headers within the community events content */
.hvac-event-manage-wrapper .site-header,
.hvac-event-manage-wrapper .ast-header,
.hvac-event-manage-wrapper header {
display: none !important;
}
</style>
<div class="hvac-event-manage-wrapper">
<?php
// Display trainer navigation menu
if (class_exists('HVAC_Menu_System')) {
HVAC_Menu_System::instance()->render_trainer_menu();
}
?>
<div class="hvac-page-content">
<?php
// Let The Events Calendar handle the content
if (have_posts()) :
while (have_posts()) : the_post();
// Get the raw content and process it
global $post;
$raw_content = $post->post_content;
// Clean up any HTML comments
$patterns = [
'/<!--\s*wp:shortcode\s*-->/s',
'/<!--\s*\/wp:shortcode\s*-->/s',
'/<!--[^>]*wp:shortcode[^>]*-->/s',
'/<!--.*?-->/s'
];
foreach ($patterns as $pattern) {
$raw_content = preg_replace($pattern, '', $raw_content);
}
$raw_content = trim($raw_content);
// Process shortcodes
echo do_shortcode($raw_content);
endwhile;
else:
// Fallback - show the shortcode directly
echo do_shortcode('[tribe_community_events]');
endif;
?>
</div>
</div>
<?php
get_footer();