1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-06-05 22:09:38 +02:00

feat: gestione tel e mailto per le tabelle datatables

This commit is contained in:
MatteoPistorello
2024-10-31 15:11:40 +01:00
parent 438c10ab08
commit 0b1e4d764e
2 changed files with 15 additions and 1 deletions

View File

@ -177,8 +177,18 @@ if (!empty($query)) {
$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] ? '<a class="btn btn-default btn-sm btn-block" style="font-weight:normal;" href="mailto:'.$r[$field].'" target="_blank"><i class="fa fa-envelope text-primary"></i> '.$r[$field].'</a>' : '');
}
elseif (preg_match('/^tel_(.+?)$/', trim($field), $m)) {
$column['class'] = '';
$value = ($r[$field] ? '<a class="btn btn-default btn-sm btn-block" href="tel:'.$r[$field].'" target="_blank"><i class="fa fa-phone text-primary"></i> '.$r[$field].'</a>' : '');
}
// 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 = '';