mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-16 19:40:44 +01:00
feat: gestione tel e mailto per le tabelle datatables
This commit is contained in:
parent
438c10ab08
commit
0b1e4d764e
@ -177,8 +177,18 @@ if (!empty($query)) {
|
|||||||
$column['data-color'] = isset($column['data-color']) ? $column['data-color'] : color_inverse(trim($column['data-background']));
|
$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
|
// 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'];
|
$id_record = $r['id'];
|
||||||
$hash = '';
|
$hash = '';
|
||||||
|
|
||||||
|
@ -128,6 +128,10 @@ if (!empty($type) && $type != 'menu' && $type != 'custom') {
|
|||||||
$attr_td .= " width='30'";
|
$attr_td .= " width='30'";
|
||||||
$name = str_replace('icon_', 'icon_title_', $name);
|
$name = str_replace('icon_', 'icon_title_', $name);
|
||||||
$field = str_replace('icon_', '', $field);
|
$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()) {
|
if (isMobile()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user