From 4725d27527872218d51fd44c3f600fd38974ebb3 Mon Sep 17 00:00:00 2001 From: MatteoPistorello Date: Wed, 30 Oct 2024 12:16:43 +0100 Subject: [PATCH] feat: gestione mailto campi input --- mail.php | 6 +++--- modules/anagrafiche/add.php | 4 ++-- modules/anagrafiche/edit.php | 4 ++-- modules/emails/edit.php | 2 +- modules/newsletter/ajax/table.php | 3 +-- modules/smtp/add.php | 2 +- modules/smtp/edit.php | 2 +- modules/utenti/components/base.php | 2 +- plugins/referenti/add.php | 2 +- plugins/referenti/edit.php | 2 +- plugins/sedi/add.php | 2 +- plugins/sedi/edit.php | 2 +- reset.php | 2 +- src/HTMLBuilder/Handler/DefaultHandler.php | 2 ++ 14 files changed, 19 insertions(+), 18 deletions(-) diff --git a/mail.php b/mail.php index f2db1af35..317acc898 100755 --- a/mail.php +++ b/mail.php @@ -118,14 +118,14 @@ $idx = 0; foreach ($emails as $email) { echo '
- {[ "type": "email", "name": "destinatari['.$idx++.']", "value": "'.$email.'", "icon-before": "choice|email|'.$template['type'].'", "extra": "onkeyup=\'aggiungiDestinatario();\'", "class": "destinatari", "required": 0 ]} + {[ "type": "text", "name": "destinatari['.$idx++.']", "value": "'.$email.'", "icon-before": "choice|email|'.$template['type'].'", "extra": "onkeyup=\'aggiungiDestinatario();\'", "class": "destinatari email-mask", "required": 0 ]}
'; } if (empty($emails)) { echo '
- {[ "type": "email", "name": "destinatari['.$idx++.']", "value": "", "icon-before": "choice|email|'.$template['type'].'", "extra": "onkeyup=\'aggiungiDestinatario();\'", "class": "destinatari", "required": 0 ]} + {[ "type": "text", "name": "destinatari['.$idx++.']", "value": "", "icon-before": "choice|email|'.$template['type'].'", "extra": "onkeyup=\'aggiungiDestinatario();\'", "class": "destinatari email-mask", "required": 0 ]}
'; } echo ' @@ -197,7 +197,7 @@ echo ' echo ' '; diff --git a/modules/anagrafiche/add.php b/modules/anagrafiche/add.php index 3f4d65079..5bf0a034a 100755 --- a/modules/anagrafiche/add.php +++ b/modules/anagrafiche/add.php @@ -119,11 +119,11 @@ echo '
- {[ "type": "text", "label": "'.tr('Email').'", "name": "email", "class": "email-mask", "placeholder":"casella@dominio.ext", "icon-before": "", "validation": "email" ]} + {[ "type": "email", "label": "'.tr('Email').'", "name": "email", "placeholder":"casella@dominio.ext", "validation": "email" ]}
- {[ "type": "text", "label": "'.tr('PEC').'", "name": "pec", "class": "email-mask", "placeholder":"pec@dominio.ext", "icon-before": "" ]} + {[ "type": "email", "label": "'.tr('PEC').'", "name": "pec", "placeholder":"pec@dominio.ext" ]}
'; $help_codice_destinatario = tr("Per impostare il codice specificare prima 'Tipologia' e 'Nazione' dell'anagrafica").':

Se non si conosce il codice destinatario lasciare vuoto il campo. VerrĂ  applicato in automatico quello previsto di default dal sistema (\'0000000\', \'999999\', \'XXXXXXX\').'; diff --git a/modules/anagrafiche/edit.php b/modules/anagrafiche/edit.php index d71e2b037..285995e1c 100755 --- a/modules/anagrafiche/edit.php +++ b/modules/anagrafiche/edit.php @@ -162,7 +162,7 @@ if (in_array($id_azienda, $tipi_anagrafica)) {
- {[ "type": "text", "label": "", "name": "pec", "class": "email-mask", "placeholder":"pec@dominio.ext", "value": "$pec$", "icon-before": "", "validation": "email" ]} + {[ "type": "email", "label": "", "name": "pec", "placeholder":"pec@dominio.ext", "value": "$pec$", "validation": "email" ]}
@@ -218,7 +218,7 @@ if (in_array($id_azienda, $tipi_anagrafica)) {
- {[ "type": "text", "label": "", "name": "email", "class": "email-mask", "placeholder": "casella@dominio.ext", "value": "$email$", "icon-before": "", "validation": "email" ]} + {[ "type": "email", "label": "", "name": "email", "placeholder": "casella@dominio.ext", "value": "$email$", "validation": "email" ]}
diff --git a/modules/emails/edit.php b/modules/emails/edit.php index 182617efc..34893b668 100755 --- a/modules/emails/edit.php +++ b/modules/emails/edit.php @@ -96,7 +96,7 @@ if (!$record['predefined']) {
- {[ "type": "email", "label": "", "name": "reply_to", "value": "$reply_to$", "help": "" ]} + {[ "type": "text", "class": "email-mask", "label": "", "name": "reply_to", "value": "$reply_to$", "help": "" ]}
diff --git a/modules/newsletter/ajax/table.php b/modules/newsletter/ajax/table.php index a4407a822..0aeb2455d 100644 --- a/modules/newsletter/ajax/table.php +++ b/modules/newsletter/ajax/table.php @@ -80,11 +80,10 @@ foreach ($destinatari_filtrati as $destinatario) { '
'. (!empty($origine->email) ? input([ - 'type' => 'text', + 'type' => 'email', 'name' => 'email', 'id' => 'email_'.random_int(0, 99999), 'readonly' => '1', - 'class' => 'email-mask', 'value' => $origine->email, 'validation' => 'email|'.$id_modulo_anagrafiche.'|'.$destinatario->record_id, ]) : diff --git a/modules/smtp/add.php b/modules/smtp/add.php index 2957ac65d..1df0c7b58 100755 --- a/modules/smtp/add.php +++ b/modules/smtp/add.php @@ -35,7 +35,7 @@ include_once __DIR__.'/../../core.php';
- {[ "type": "email", "label": "", "name": "from_address", "required": 1 ]} + {[ "type": "text", "class": "email-mask", "label": "", "name": "from_address", "required": 1 ]}
diff --git a/modules/smtp/edit.php b/modules/smtp/edit.php index 3d4d73c2b..f24d7a0f7 100755 --- a/modules/smtp/edit.php +++ b/modules/smtp/edit.php @@ -53,7 +53,7 @@ echo '
- {[ "type": "email", "label": "'.tr('Email mittente').'", "name": "from_address", "value": "$from_address$", "required": 1 ]} + {[ "type": "text", "class": "email-mask", "label": "'.tr('Email mittente').'", "name": "from_address", "value": "$from_address$", "required": 1 ]}
diff --git a/modules/utenti/components/base.php b/modules/utenti/components/base.php index 05f501b76..87a7a1328 100755 --- a/modules/utenti/components/base.php +++ b/modules/utenti/components/base.php @@ -46,7 +46,7 @@ echo '
- {[ "type": "email", "label": "'.tr('Email').'", "name": "email", "required": 0, "value": "'.$utente['email'].'", "validation": "email" ]} + {[ "type": "text", "class": "email-mask", "label": "'.tr('Email').'", "name": "email", "required": 0, "value": "'.$utente['email'].'", "validation": "email" ]}
'; diff --git a/plugins/referenti/add.php b/plugins/referenti/add.php index 1ae97ed80..3e7d31fe2 100755 --- a/plugins/referenti/add.php +++ b/plugins/referenti/add.php @@ -45,7 +45,7 @@ echo '
- {[ "type": "text", "label": "'.tr('Indirizzo email').'", "name": "email", "class": "email-mask", "validation": "email"]} + {[ "type": "email", "label": "'.tr('Indirizzo email').'", "name": "email", "validation": "email"]}
diff --git a/plugins/referenti/edit.php b/plugins/referenti/edit.php index 4de825583..0e413e52d 100755 --- a/plugins/referenti/edit.php +++ b/plugins/referenti/edit.php @@ -44,7 +44,7 @@ echo '
- {[ "type": "text", "label": "'.tr('Indirizzo email').'", "name": "email", "class": "email-mask", "value" : "$email$", "validation": "email" ]} + {[ "type": "email", "label": "'.tr('Indirizzo email').'", "name": "email", "value" : "$email$", "validation": "email" ]}
diff --git a/plugins/sedi/add.php b/plugins/sedi/add.php index e675cac33..d6820aee0 100755 --- a/plugins/sedi/add.php +++ b/plugins/sedi/add.php @@ -78,7 +78,7 @@ echo '
- {[ "type": "text", "label": "'.tr('Indirizzo email').'", "name": "email", "class": "email-mask", "validation": "email" ]} + {[ "type": "email", "label": "'.tr('Indirizzo email').'", "name": "email", "validation": "email" ]}
{[ "type": "checkbox", "label": "'.tr('Opt-out per newsletter').'", "name": "disable_newsletter_add", "id": "disable_newsletter_m", "value": "0", "help": "'.tr("Blocco per l'invio delle email.").'" ]} diff --git a/plugins/sedi/edit.php b/plugins/sedi/edit.php index 49a155bcc..015db980a 100755 --- a/plugins/sedi/edit.php +++ b/plugins/sedi/edit.php @@ -78,7 +78,7 @@ echo ' {[ "type": "telefono", "label": "'.tr('Cellulare').'", "name": "cellulare", "value": "$cellulare$" ]}
- {[ "type": "text", "label": "'.tr('Indirizzo email').'", "name": "email", "value": "$email$", "class": "email-mask", "validation": "email" ]} + {[ "type": "email", "label": "'.tr('Indirizzo email').'", "name": "email", "value": "$email$", "validation": "email" ]}
{[ "type": "checkbox", "label": "'.tr('Opt-out per newsletter').'", "name": "disable_newsletter", "id": "disable_newsletter_m", "value": "'.empty($record['enable_newsletter']).'", "help": "'.tr("Blocco per l'invio delle email.").'" ]} diff --git a/reset.php b/reset.php index 91b244603..5c2c937b8 100755 --- a/reset.php +++ b/reset.php @@ -134,7 +134,7 @@ if (empty($token)) { {[ "type": "text", "label": "'.tr('Username').'", "placeholder": "'.tr('Username').'", "name": "username", "icon-before": "", "required": 1 ]} - {[ "type": "email", "label": "'.tr('Email').'", "placeholder": "'.tr('Email').'", "name": "email", "icon-before": "", "required": 1 ]}'; + {[ "type": "text", "class": "email-mask", "label": "'.tr('Email').'", "placeholder": "'.tr('Email').'", "name": "email", "icon-before": "", "required": 1 ]}'; } else { echo ' diff --git a/src/HTMLBuilder/Handler/DefaultHandler.php b/src/HTMLBuilder/Handler/DefaultHandler.php index 480e43183..dbfbb1cde 100755 --- a/src/HTMLBuilder/Handler/DefaultHandler.php +++ b/src/HTMLBuilder/Handler/DefaultHandler.php @@ -261,6 +261,8 @@ class DefaultHandler implements HandlerInterface $values['type'] = 'text'; + $values['icon-before'] = $values['value'] ? '' : ''; + // Delega al metodo "text", per la generazione del codice HTML return $this->text($values, $extras); }