diff --git a/app/call_flows/resources/classes/call_flows.php b/app/call_flows/resources/classes/call_flows.php index 6c5fed9978..96b669bbb2 100644 --- a/app/call_flows/resources/classes/call_flows.php +++ b/app/call_flows/resources/classes/call_flows.php @@ -56,6 +56,7 @@ if (!class_exists('call_flows')) { $this->list_page = 'call_flows.php'; $this->table = 'call_flows'; $this->uuid_prefix = 'call_flow_'; + $this->toggle_field = 'call_flow_enabled'; $this->toggle_values = ['true','false']; } @@ -187,7 +188,8 @@ if (!class_exists('call_flows')) { $uuids[] = "'".$record['uuid']."'"; } } - if (is_array($uuids) && @sizeof($uuids) != 0) { + + if (!empty($uuids)) { $sql = "select ".$this->uuid_prefix."uuid as uuid, ".$this->toggle_field." as toggle, "; $sql .= "dialplan_uuid, call_flow_feature_code, call_flow_context from v_".$this->table." "; $sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) "; @@ -195,7 +197,7 @@ if (!class_exists('call_flows')) { $parameters['domain_uuid'] = $_SESSION['domain_uuid']; $database = new database; $rows = $database->select($sql, $parameters, 'all'); - if (is_array($rows) && @sizeof($rows) != 0) { + if (!empty($rows)) { foreach ($rows as $row) { $call_flows[$row['uuid']]['state'] = $row['toggle']; $call_flows[$row['uuid']]['dialplan_uuid'] = $row['dialplan_uuid'];