FRS Universal KPI System

/** * ============================================================================== * FRS UNIVERSAL KPI SYSTEM * Contains: * 1. Smart Group ID Logic (Owner + Member + Admin checks) * 2. KPI Cards Shortcode [kpi-fire-frm-stats-for-group] * 3. Form Helper Shortcodes [my_current_group_id] & [pmpro_groupid] * ============================================================================== */ //…Continue reading

KPI Layout Fixer (JS)

add_action(‘wp_enqueue_scripts’, function () { // OPTIONAL: Uncomment the line below to only run this on your dashboard page // if ( !is_page(‘maintenance-dashboard’) ) return; wp_register_script(‘mlog-inline-fixer’, ”, [], null, true); wp_enqueue_script(‘mlog-inline-fixer’); $js = { for (const m of mutations) { if…Continue reading

FRS Quiz Certificate Generator

/** * FRS Quiz Certificate Generator * 1. Calculates Score Percentage [frs_quiz_percentage] * 2. Attaches the Certificate PDF to emails automatically */ // — PART 1: SCORE CALCULATOR SHORTCODE — // Usage in View: [frs_quiz_percentage field=”31471″ total=”6″ entry=”[id]”] add_shortcode( ‘frs_quiz_percentage’,…Continue reading

FRS KPI Charts

/* === FRS KPI Charts (AJAX Real-Time Version) === – Layout: 2 Charts (Pie + Line) – SECURITY UPDATE: Filters Line Chart SQL by Group ID – FIX: Matches “Universal System” function naming */ // 1. Register the Shortcode (The…Continue reading

FRS Work Order Assignee Dropdown

/** * FRS Work Order Assignee Dropdown * Populates the “Assign To” dropdown with ONLY members of the current user’s group. */ add_filter(‘frm_get_field_options’, ‘frs_populate_group_members_dropdown’, 10, 2); function frs_populate_group_members_dropdown($options, $field) { // 1. CONFIGURATION // Use the ID you provided (29800)…Continue reading

FRS Filter Closed Work Orders

/** * FRS Filter Closed Work Orders * Removes non-open work orders from the Maintenance Log dropdown. * OPTIMIZED: Uses 1 query instead of looping queries. */ add_filter(‘frm_setup_new_fields_vars’, ‘frs_removeNonOpenWorkOrders’, 30, 2); add_filter(‘frm_setup_edit_fields_vars’, ‘frs_removeNonOpenWorkOrders’, 30, 2); function frs_removeNonOpenWorkOrders( $values, $field )…Continue reading

FRS PMP Update Sync

/** * FRS PMP Update Sync * Updates the Staff Directory entry when a user changes their Membership Level. * (e.g. Upgrades, Downgrades, or Cancels) */ add_action(‘pmpro_after_change_membership_level’, ‘frs_sync_pmp_update_to_directory’, 10, 2); function frs_sync_pmp_update_to_directory($level_id, $user_id) { // — CONFIGURATION — $target_form_key =…Continue reading

FRS Staff Directory PMP Sync

/** * FRS Staff Directory PMP Sync * Adds the user’s PMPro Membership Level Name (e.g. “Team 365”) to the entry. * Uses Direct Field ID: 29401 */ add_action(‘frm_after_create_entry’, ‘frs_add_pmp_level_to_entry’, 10, 2); function frs_add_pmp_level_to_entry($entry_id, $form_id) { // — CONFIGURATION —…Continue reading

FRS Asset Dropdown Formatter

/** * FRS Asset Dropdown Formatter * Adds Name & Location to the Asset ID dropdown (e.g., “A-101 – Drill – Warehouse”) * Note: Called via Ajax by Formidable Forms */ function frs_addAssetNameAndLocationToSelectionOption() { // 1. Sanitize Input $options =…Continue reading

FRS System Configuration

/** * FRS SYSTEM CONFIGURATION * Defines the Keys and IDs used by all other FRS snippets. * DO NOT DELETE – The Work Order System relies on this. */ // 1. Form Keys define(“WORK_ORDER_FORM_KEY”, “workorder”); define(“MAINTENANCE_LOG_FORM_KEY”, “maintenanceform3”); define(“ASSET_FORM_KEY”, “inventory2”);…Continue reading