From 0b1e4d764e34b1269f950ffa45c0957fdc363dee Mon Sep 17 00:00:00 2001 From: MatteoPistorello Date: Thu, 31 Oct 2024 15:11:40 +0100 Subject: [PATCH] feat: gestione tel e mailto per le tabelle datatables --- ajax_dataload.php | 12 +++++++++++- include/manager.php | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ajax_dataload.php b/ajax_dataload.php index 18c9a9f44..087189311 100755 --- a/ajax_dataload.php +++ b/ajax_dataload.php @@ -177,8 +177,18 @@ $column['data-color'] = isset($column['data-color']) ? $column['data-color'] : color_inverse(trim($column['data-background'])); } + elseif (preg_match('/^mailto_(.+?)$/', trim($field), $m)) { + $column['class'] = ''; + $value = ($r[$field] ? ' '.$r[$field].'' : ''); + } + + elseif (preg_match('/^tel_(.+?)$/', trim($field), $m)) { + $column['class'] = ''; + $value = ($r[$field] ? ' '.$r[$field].'' : ''); + } + // Link della colonna - if ($field != '_print_') { + if ($field != '_print_' && !preg_match('/^tel_(.+?)$/', trim($field), $m) && !preg_match('/^mailto_(.+?)$/', trim($field), $m)) { $id_record = $r['id']; $hash = ''; diff --git a/include/manager.php b/include/manager.php index 511a51ec2..53e4eec06 100755 --- a/include/manager.php +++ b/include/manager.php @@ -128,6 +128,10 @@ $attr_td .= " width='30'"; $name = str_replace('icon_', 'icon_title_', $name); $field = str_replace('icon_', '', $field); + } elseif (preg_match('/^mailto_/', (string) $field)) { + $field = str_replace('mailto_', '', $field); + } elseif (preg_match('/^tel_/', (string) $field)) { + $field = str_replace('tel_', '', $field); } if (isMobile()) {