From 54a2f9e9bcf061be1bb33e4f75fdbc0201e3822a Mon Sep 17 00:00:00 2001 From: eli Date: Wed, 22 Jul 2026 11:24:00 -0400 Subject: [PATCH] Enhance call flow visualization by updating status and dial code display in call_flow_map.php --- resources/classes/call_flow_map.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/resources/classes/call_flow_map.php b/resources/classes/call_flow_map.php index 3b4c741..459a9d4 100644 --- a/resources/classes/call_flow_map.php +++ b/resources/classes/call_flow_map.php @@ -526,8 +526,13 @@ private function build_call_flow(string $uuid, ?string $parent_id = null, string $name = $row['call_flow_name'] ?? 'Call Flow'; $ext = !empty($row['call_flow_extension']) ? ' (' . $row['call_flow_extension'] . ')' : ''; - $status = !empty($row['call_flow_status']) ? "\nStatus: " . $row['call_flow_status'] : ''; - $this->add_node($node_id, "🔄 " . $name . $ext . $status, 'call_flow', 'Call Flow: ' . $name, [], $depth); + // Mirror FusionPBX call_flows list: status true → primary label, false → alternate + $status_text = ($row['call_flow_status'] ?? '') != 'false' + ? (!empty($row['call_flow_label']) ? $row['call_flow_label'] : 'Active') + : (!empty($row['call_flow_alternate_label']) ? $row['call_flow_alternate_label'] : 'Alternate'); + $status = "\nStatus: " . $status_text; + $dial = !empty($row['call_flow_feature_code']) ? "\nDial Code: " . $row['call_flow_feature_code'] : ''; + $this->add_node($node_id, "🔄 " . $name . $ext . $status . $dial, 'call_flow', 'Call Flow: ' . $name, [], $depth); if ($parent_id !== null) { $this->add_edge($parent_id, $node_id, $edge_label); @@ -773,7 +778,13 @@ private function build_extension_reverse(string $uuid): string { $n_id = 'cf_' . $cf['call_flow_uuid']; if (!in_array($n_id, $this->visited)) { $this->visited[] = $n_id; - $this->add_node($n_id, "🔄 " . $cf['call_flow_name'] . "\n(" . $cf['call_flow_extension'] . ")", 'call_flow', 'Call Flow: ' . $cf['call_flow_name'], [], 0); + $cf_ext = !empty($cf['call_flow_extension']) ? ' (' . $cf['call_flow_extension'] . ')' : ''; + $cf_status_text = ($cf['call_flow_status'] ?? '') != 'false' + ? (!empty($cf['call_flow_label']) ? $cf['call_flow_label'] : 'Active') + : (!empty($cf['call_flow_alternate_label']) ? $cf['call_flow_alternate_label'] : 'Alternate'); + $cf_status = "\nStatus: " . $cf_status_text; + $cf_dial = !empty($cf['call_flow_feature_code']) ? "\nDial Code: " . $cf['call_flow_feature_code'] : ''; + $this->add_node($n_id, "🔄 " . $cf['call_flow_name'] . $cf_ext . $cf_status . $cf_dial, 'call_flow', 'Call Flow: ' . $cf['call_flow_name'], [], 0); } $this->add_edge($n_id, $ext_node_id, $edge_label); }