upskill-event-manager/includes/class-hvac-event-manage-header.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

70 lines
No EOL
2 KiB
PHP

<?php
/**
* HVAC Event Manage Header
*
* @package HVACCommunityEvents
*/
if (!defined('ABSPATH')) {
exit;
}
/**
* Class to handle event management page header
*/
class HVAC_Event_Manage_Header {
/**
* Constructor - DISABLED: Replaced with HVAC_Menu_System
*/
public function __construct() {
// Old event manage header disabled to prevent conflicts with new WordPress menu system
// All functionality moved to HVAC_Menu_System class
// // Only use the tribe-specific action to avoid duplication
// // Check if we should render the header based on the context
// add_action('init', array($this, 'maybe_add_header_hook'));
}
/**
* Conditionally add the header hook
*/
public function maybe_add_header_hook() {
// Add header before the event submission page
// Temporarily disabled to debug duplicate header issue
// add_action('tribe_events_community_before_event_submission_page', array($this, 'render_header'));
}
/**
* Render the header
*/
public function render_header() {
// Always show the navigation header
echo $this->get_header_html();
}
/**
* Get the header HTML
*/
private function get_header_html() {
ob_start();
?>
<!-- Navigation Header -->
<div class="hvac-dashboard-header">
<h1 class="entry-title">Create Event</h1>
<div class="hvac-dashboard-nav">
<a href="/trainer/dashboard/" class="ast-button ast-button-secondary">Dashboard</a>
<a href="/trainer/certificate-reports/" class="ast-button ast-button-secondary">Certificate Reports</a>
<a href="/trainer/generate-certificates/" class="ast-button ast-button-secondary">Generate Certificates</a>
<button class="ast-button hvac-help-trigger">Help</button>
</div>
</div>
<?php
return ob_get_clean();
}
}
// Initialize
new HVAC_Event_Manage_Header();