$value) { $replaces['{'.$key.'}'] = $value; } $body = str_replace(array_keys($replaces), array_values($replaces), $body); $subject = str_replace(array_keys($replaces), array_values($replaces), $subject); //Campi mancanti $rs2 = $dbo->fetchArray('SELECT from_address, server, port FROM zz_smtp WHERE id='.prepare($template['id_smtp'])); $campi_mancanti = []; if ($rs2[0]['from_address'] == '') { array_push($campi_mancanti, 'Mittente'); } if ($rs2[0]['server'] == '') { array_push($campi_mancanti, 'Server SMTP'); } if ($rs2[0]['port'] == '') { array_push($campi_mancanti, 'Porta'); } if (sizeof($campi_mancanti) > 0) { echo "
Prima di procedere all'invio completa: ".implode(', ', $campi_mancanti).'
'.Modules::link('Gestione email', $template['id_smtp'], tr('Vai alla scheda account email'), null).'
'; } // Form echo '

'.tr('Mittente').': '.$smtp['from_name'].' <'.$smtp['from_address'].'>

'; if (!empty($smtp['cc'])) { echo '

'.tr('CC').': '.$smtp['cc'].'

'; } if (!empty($smtp['cc'])) { echo '

'.tr('CCN').': '.$smtp['bcc'].'

'; } echo ' '.tr('Destinatari').'
{[ "type": "email", "name": "destinatari[]", "value": "'.$email.'", "icon-before": "choice|email", "extra": "onkeyup=\'aggiungi_destinatario();\'", "class": "destinatari", "required": 1 ]}

{[ "type": "text", "label": "'.tr('Oggetto').'", "name": "subject", "value": "'.$subject.'", "required": 1 ]}
{[ "type": "checkbox", "label": "'.tr('Notifica di lettura').'", "name": "read_notify", "value": "'.$template['read_notify'].'" ]}
'; // Stampe $selected_prints = $dbo->fetchArray('SELECT id_print FROM zz_email_print WHERE id_email = '.prepare($template['id'])); $selected = array_column($selected_prints, 'id_print'); echo '
{[ "type": "select", "multiple": "1", "label": "'.tr('Stampe').'", "name": "prints[]", "value": "'.implode(',', $selected).'", "values": "query=SELECT id, title AS text FROM zz_prints WHERE id_module = '.prepare($id_module).'" ]}
'; // Allegati echo '
{[ "type": "select", "multiple": "1", "label": "'.tr('Allegati').'", "name": "attachments[]", "values": "query=SELECT id, nome AS text FROM zz_files WHERE id_module = '.prepare($id_module).' AND id_record = '.prepare($id_record)." UNION SELECT id, CONCAT(nome, ' (Azienda)') AS text FROM zz_files WHERE id_module = ".prepare(Modules::get('Anagrafiche')['id'])." AND id_record = (SELECT valore FROM zz_settings WHERE nome = 'Azienda predefinita')\" ]}
"; echo '
{[ "type": "textarea", "label": "'.tr('Contenuto').'", "name": "body", "value": '.json_encode($body).' ]}
'; echo '
'; echo '
{[ "type": "email", "name": "destinatari[]", "icon-before": "choice|email|cc", "extra": "onkeyup=\'aggiungi_destinatario();\'", "class": "destinatari" ]}
'; echo ' '; echo ' '; echo ' ';