feat: gestione mailto campi input
This commit is contained in:
parent
263d79e0ed
commit
4725d27527
6
mail.php
6
mail.php
|
@ -118,14 +118,14 @@ $idx = 0;
|
|||
foreach ($emails as $email) {
|
||||
echo '
|
||||
<div class="col-md-12">
|
||||
{[ "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 ]}
|
||||
</div>';
|
||||
}
|
||||
|
||||
if (empty($emails)) {
|
||||
echo '
|
||||
<div class="col-md-12">
|
||||
{[ "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 ]}
|
||||
</div>';
|
||||
}
|
||||
echo '
|
||||
|
@ -197,7 +197,7 @@ echo '
|
|||
echo '
|
||||
<div class="hidden" id="template-destinatario">
|
||||
<div class="col-md-12">
|
||||
{[ "type": "email", "name": "destinatari[-id-]", "icon-before": "choice|email|'.$template['type'].'", "extra": "onkeyup=\'aggiungiDestinatario();\'", "class": "destinatari" ]}
|
||||
{[ "type": "text", "name": "destinatari[-id-]", "icon-before": "choice|email|'.$template['type'].'", "extra": "onkeyup=\'aggiungiDestinatario();\'", "class": "destinatari email-mask" ]}
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
|
|
|
@ -119,11 +119,11 @@ echo '
|
|||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "text", "label": "'.tr('Email').'", "name": "email", "class": "email-mask", "placeholder":"casella@dominio.ext", "icon-before": "<i class=\"fa fa-envelope\"></i>", "validation": "email" ]}
|
||||
{[ "type": "email", "label": "'.tr('Email').'", "name": "email", "placeholder":"casella@dominio.ext", "validation": "email" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "text", "label": "'.tr('PEC').'", "name": "pec", "class": "email-mask", "placeholder":"pec@dominio.ext", "icon-before": "<i class=\'fa fa-envelope-o\'></i>" ]}
|
||||
{[ "type": "email", "label": "'.tr('PEC').'", "name": "pec", "placeholder":"pec@dominio.ext" ]}
|
||||
</div>';
|
||||
|
||||
$help_codice_destinatario = tr("Per impostare il codice specificare prima '<b>Tipologia</b>' e '<b>Nazione</b>' dell'anagrafica").':<br><br><ul><li>'.tr('Azienda (B2B) - Codice Destinatario, 7 caratteri').'</li><li>'.tr('Ente pubblico (B2G/PA) - Codice Univoco Ufficio (www.indicepa.gov.it), 6 caratteri').'</li><li>'.tr('Privato (B2C) - viene utilizzato il Codice Fiscale').'</li></ul>Se non si conosce il codice destinatario lasciare vuoto il campo. Verrà applicato in automatico quello previsto di default dal sistema (\'0000000\', \'999999\', \'XXXXXXX\').';
|
||||
|
|
|
@ -162,7 +162,7 @@ if (in_array($id_azienda, $tipi_anagrafica)) {
|
|||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "text", "label": "<?php echo tr('PEC'); ?>", "name": "pec", "class": "email-mask", "placeholder":"pec@dominio.ext", "value": "$pec$", "icon-before": "<i class='fa fa-envelope-o'></i>", "validation": "email" ]}
|
||||
{[ "type": "email", "label": "<?php echo tr('PEC'); ?>", "name": "pec", "placeholder":"pec@dominio.ext", "value": "$pec$", "validation": "email" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
|
@ -218,7 +218,7 @@ if (in_array($id_azienda, $tipi_anagrafica)) {
|
|||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "text", "label": "<?php echo tr('Email'); ?>", "name": "email", "class": "email-mask", "placeholder": "casella@dominio.ext", "value": "$email$", "icon-before": "<i class='fa fa-envelope'></i>", "validation": "email" ]}
|
||||
{[ "type": "email", "label": "<?php echo tr('Email'); ?>", "name": "email", "placeholder": "casella@dominio.ext", "value": "$email$", "validation": "email" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ if (!$record['predefined']) {
|
|||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "email", "label": "<?php echo tr('Destinatario fisso'); ?>", "name": "reply_to", "value": "$reply_to$", "help": "<?php echo 'Rispondi a questo indirizzo e-mail.'; ?>" ]}
|
||||
{[ "type": "text", "class": "email-mask", "label": "<?php echo tr('Destinatario fisso'); ?>", "name": "reply_to", "value": "$reply_to$", "help": "<?php echo 'Rispondi a questo indirizzo e-mail.'; ?>" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -80,11 +80,10 @@ foreach ($destinatari_filtrati as $destinatario) {
|
|||
'<div class="text-center">'.
|
||||
(!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,
|
||||
]) :
|
||||
|
|
|
@ -35,7 +35,7 @@ include_once __DIR__.'/../../core.php';
|
|||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "email", "label": "<?php echo tr('Email mittente'); ?>", "name": "from_address", "required": 1 ]}
|
||||
{[ "type": "text", "class": "email-mask", "label": "<?php echo tr('Email mittente'); ?>", "name": "from_address", "required": 1 ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ echo '
|
|||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "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 ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
|
|
|
@ -46,7 +46,7 @@ echo '
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{[ "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" ]}
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ echo '
|
|||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Indirizzo email').'", "name": "email", "class": "email-mask", "validation": "email"]}
|
||||
{[ "type": "email", "label": "'.tr('Indirizzo email').'", "name": "email", "validation": "email"]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ echo '
|
|||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "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" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ echo '
|
|||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "text", "label": "'.tr('Indirizzo email').'", "name": "email", "class": "email-mask", "validation": "email" ]}
|
||||
{[ "type": "email", "label": "'.tr('Indirizzo email').'", "name": "email", "validation": "email" ]}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
{[ "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.").'" ]}
|
||||
|
|
|
@ -78,7 +78,7 @@ echo '
|
|||
{[ "type": "telefono", "label": "'.tr('Cellulare').'", "name": "cellulare", "value": "$cellulare$" ]}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
{[ "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" ]}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
{[ "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.").'" ]}
|
||||
|
|
|
@ -134,7 +134,7 @@ if (empty($token)) {
|
|||
|
||||
{[ "type": "text", "label": "'.tr('Username').'", "placeholder": "'.tr('Username').'", "name": "username", "icon-before": "<i class=\"fa fa-user\"></i>", "required": 1 ]}
|
||||
|
||||
{[ "type": "email", "label": "'.tr('Email').'", "placeholder": "'.tr('Email').'", "name": "email", "icon-before": "<i class=\"fa fa-envelope\"></i>", "required": 1 ]}';
|
||||
{[ "type": "text", "class": "email-mask", "label": "'.tr('Email').'", "placeholder": "'.tr('Email').'", "name": "email", "icon-before": "<i class=\"fa fa-envelope\"></i>", "required": 1 ]}';
|
||||
} else {
|
||||
echo '
|
||||
<input type="hidden" name="op" value="update">
|
||||
|
|
|
@ -261,6 +261,8 @@ class DefaultHandler implements HandlerInterface
|
|||
|
||||
$values['type'] = 'text';
|
||||
|
||||
$values['icon-before'] = $values['value'] ? '<a href="mailto:'.$values['value'].'" target="_blank"><i class="fa fa-envelope"></i></a>' : '<i class="fa fa-envelope"></i>';
|
||||
|
||||
// Delega al metodo "text", per la generazione del codice HTML
|
||||
return $this->text($values, $extras);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue