CRM app and teamwork

For developersVersion 1.0.0Last updated:

Its own bar. The CRM doesn’t use the generic header of the other screens (breadcrumb, large title, intro line): it’s an app with its own bar.

  • Common bar (Builder_OS_CRM_Admin::render_bar(), constant NAV): a pill with eight icon entries: Overview, Contacts, Inbox, Deals, Calendar (combines Tasks and Appointments), Campaigns (combines email campaigns and broadcasts), Automations and Reports; on the right, the “CRM settings” button (opens Settings). The current entry is lime with its name; the others are icons, and widen to show their name on hover or focus (no animation with “reduce motion”). The usual routes (builder-os-crm-tasks, -appointments, -broadcasts) remain and open the matching view in Calendar and Campaigns.
  • Live counts: Inbox = conversations unassigned or where the customer had the last word; Calendar = my overdue tasks.
  • Connected team: WordPress photos (get_avatar_url) with “N online”, only when someone else is there.
  • Row 2 (if needed): “back” and a compact title on records, the section’s tabs and their actions.
  • The CRM guide opens with “?” on any CRM screen or from “Help” in the Settings menu.
  • The workspace uses the full width and, in the Inbox, the full height (--bos-crm-top, measured in the browser). The h1 still exists, for screen readers only.
  • Filter builder_os_crm_page_head: title, crumbs (the last one gives the “back”), actions and tabs ([ etiqueta, url, actual ]). lead and here are accepted for compatibility and are no longer drawn.

Overview (admin.php?page=builder-os-crm, class Builder_OS_CRM_Dashboard).

  • At the top, the greeting and “Needs attention today”: unanswered, overdue tasks, today’s appointments and the next one.
  • Four figures with a trend against the previous period: new contacts, open conversations, pipeline value and won deals.
  • Activity per day (SVG generated on the server, no JS), pipeline by stage, tasks to handle (overdue and next 7 days) and the team.
  • Period of 7, 30 or 90 days. Real data only, with empty states.
  • From lead to sale (Builder_OS_CRM_Setup, includes/modules/crm/class-builder-os-crm-setup.php): setup steps; since 4.15.2 there’s no card in the Overview: register_setup() adds them (ids crm_<key>, group crm “From lead to sale”) to “Getting started” (chapter 30) and flush() also clears bos_setup_summary. Each step is checked against the real state (Builder_OS_CRM_Setup::steps(): { key, title, why, done, optional, action_label, action_url }). Seven steps: form (a published public page with data-bos-form, [bos_form or a package’s form block), mail (SMTP with a server, a ready CRM provider or an active mail plugin, and no failures in builder_os_mail_log in 7 days or since the last SMTP save), contact (a contact with source form:* or chat), chat (builder_os_chat.enabled and a channel with valid data), welcome (an active automation with trigger form_submitted or contact_created whose published version has an email or whatsapp step), pipeline (a pipeline with stages and a deal) and agenda (optional: an active appointment type; only if Appointments is available). Progress counts only the required ones, like the rest of “Getting started”.
    • There’s no longer a “Hide” or “Show in Overview” on screen; the bos_crm_setup_hidden meta and POST crm/setup/hide are kept for compatibility. Cache: transient bos_crm_setup (60 s, global), cleared when saving builder_os_smtp, builder_os_chat, builder_os_forms_settings, builder_os_crm_providers, a post or a contact; it queries nothing on public pages. The option builder_os_crm_setup_smtp_at marks the last SMTP save. Everything is deleted in uninstall.php.
    • REST (bos_crm_view): GET builder-os/v1/crm/setup → { steps, done, total, complete, next, hidden } and POST builder-os/v1/crm/setup/hide { hidden: bool }. MCP (“CRM” group, read only): crm_get_setup_status (no arguments; the same as the GET, uncached).
  • CRM off: if someone opens a builder-os-crm* screen with the CRM off (Builder_OS_CRM::off_page_denied()), whoever has manage_options goes to the CRM card in Settings (#bos-crm-switch) and everyone else sees “The CRM is turned off on this site. Ask whoever manages it to turn it on in Settings.” (403) instead of WordPress’s “you don’t have permission”.

Contacts moves to admin.php?page=builder-os-crm-contacts. The old links page=builder-os-crm&contact=… (and company, view, filters) still open Contacts.

  • Companies, Labels and Fields are tabs of Contacts.
  • At the top there are filtering figure cards (Contacts, Mine, Subscribed with %, New in 7 days) and the Owner column (owner in saved views).
  • On mobile, the list is shown as cards.
  • The record shows the data as properties and, on the left, the work with the person (Messages, Appointments, Deals, Tasks). On the right go the activity, the consent and the rest.
  • The source is shown by name (“WooCommerce”, “Form”…) and dates use wp_date in the site’s format.

Inbox: control hierarchy (see “Inbox v2” for the new features).

  • Views panel with counts: Mine, Unassigned, All, Snoozed, Starred, each conversation tag and each channel.
  • List header: “Open ▾” (Open, Snoozed, Resolved, All), “Unread only”, sort order and a “Filters” button with removable chips.
  • Each row carries the avatar with the channel, the assignee (or an empty circle), up to two tags with “+n” and the waiting time.
  • “Reconnecting…” appears only if the connection drops.
  • Throughout the CRM, statuses are badges with a soft background or plain text, never colored dots.

Presence (teams of 1 to about 10 people).

  • Where it shows: in the bar, who has the CRM open. In the Inbox list, “Sofía” (viewing) or “Sofía replies”. In the thread, “Sofía is replying to this conversation”.
  • Timing: “Replying” = typed in the composer in the last 15 s; it expires at 30 s. A presence that isn’t renewed stops counting at 70 s.
  • Transport: no WebSockets or Heartbeat and nothing on the public site; it rides on the polls that already existed.
    • The CRM heartbeat (admin-ajax.php?action=bos_jobs_tick, every 20 s, with nonce and bos_crm_view) carries the section.
    • The Inbox poll (GET crm/inbox/poll, every 8 s) carries the conversation and pres=view|reply.
    • When opening a thread, GET crm/inbox/{id}?pres=view tells you right away if someone else is already handling it.
    • No polling while the tab is hidden.
  • Storage: user meta {prefijo}bos_crm_presence (t, s, c, st), written at most every 25 s if nothing changes. Only counts for whoever keeps bos_crm_view. Uninstall deletes it.

Near-live refresh. The same heartbeat brings the signature of the open section (Tasks: creations, completions, reassignments and due dates; Appointments: creations, changes and cancellations) and the bar’s counts. If the signature changes, bos:crm:changed (detail.section) fires and the Calendar (tasks and appointments) redraws itself, except with a dialog open.

API for whoever extends the CRM.

  • PHP: Builder_OS_CRM_Presence::touch( $section, $conv = 0, $state = 'view' ), ::team(), ::badges(), ::signature( $section ).
  • Browser: window.BOSCRM.team( lista ), .avatar( usuario, clase ) and .badges( mapa ).
  • Avatars: .bos-crm-av with six stable tints per person (is-t0…is-t5, in light and dark), sizes is-xs / is-xxs and is-empty (unassigned).

Checklist.

  • The CRM opens on the Overview, with its bar (sections as icons, the current one in lime) and no breadcrumb or large title.
  • Old links to a record (page=builder-os-crm&contact=N) open the record in Contacts.
  • Inbox: “Open ▾” takes precedence; “Mine” and “Unassigned” filter correctly.
  • With two people in the Inbox, each sees the other and, if one types, the other sees “… replies” in about 10 s.
  • A task created by someone else appears without reloading in about 20 s; the bar’s counts update on their own.
  • No status has a colored dot in front of it.
  • The “From lead to sale” group shows up in “Getting started” with the right progress and checks itself off as each step is done; each link opens its screen; the CRM Overview has no card; it looks right in dark mode and at 390 px.

Tests. tests/php/bos-test-crm-presence.php (26 checks), tests/e2e/e2e-crm-f0.js and tests/e2e/e2e-crm-inbox.js.