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

FRS Status Synchronizer

/** * FRS Status Synchronizer * Syncs Status & Completion Date between Work Orders and Maintenance Logs. * Triggered when either form is created or updated. */ add_action(‘frm_after_update_entry’, ‘frs_sync_status_and_date’, 10, 2); add_action(‘frm_after_create_entry’, ‘frs_sync_status_and_date’, 30, 2); function frs_sync_status_and_date($entry_id, $form_id) { //…Continue reading

FRS Maintenance Log View Status Colors

add_shortcode(‘status_color’, function($atts) { $atts = shortcode_atts([‘status’ => ”], $atts); $status = $atts[‘status’]; switch ($status) { case ‘Open’: return ‘‘ . $status . ‘‘; case ‘On Hold’: return ‘‘ . $status . ‘‘; case ‘Closed’: return ‘‘ . $status . ‘‘;…Continue reading

FRS Work Order Dropdown Formatter

/** * Name: frs_addWorkOrderNameAndDescriptionToSelectionOption * Description: Secured version – Removes “Location” and prevents SQL Injection * Note: Called via Ajax **/ function frs_addWorkOrderNameAndDescriptionToSelectionOption() { // 1. Sanitize the input immediately $options = isset($_POST[“options”]) ? $_POST[“options”] : null; if (empty($options) ||…Continue reading

FRS Datatables Initialization

/** * Datatables Initialization (Safe Version) * Removes custom jQuery to prevent conflicts with Formidable/WordPress. * Usage: Place [datatables] on any page with a table you want to enhance. */ function frs_register_datatables() { // Styles wp_register_style( ‘DataTables_Styles’, ‘https://cdn.datatables.net/2.1.0/css/dataTables.dataTables.min.css’ ); wp_register_style(…Continue reading

FRS Parent Email Lookup

/** * Get Parent Email Shortcode * Usage: [frs-parent-email] * logic: Finds the Group Owner’s email based on the current user’s group. */ function frsGetParentEmail() { // 1. Use the “Universal Brain” to find the Group ID // This handles…Continue reading

FRS Work Order Number Generator

add_action(‘frm_after_create_entry’, ‘autoIDGenerator’, 30, 2); function autoIDGenerator($entry_id, $form_id ) { // Ensure constants are defined to prevent warnings if ( !defined(‘WORK_ORDER_FORM_KEY’) ) return; switch ($form_id) { case FrmForm::get_id_by_key(WORK_ORDER_FORM_KEY): workOrderNumberGenerator($entry_id); break; default: break; } } function workOrderNumberGenerator($entry_id) { // 1. Get the…Continue reading