2017-09-22 12:31:06 +02:00
< ? php
include_once __DIR__ . '/../../core.php' ;
?>
2018-02-23 16:04:50 +01:00
< form action = " " method = " post " id = " edit-form " >
2017-09-22 12:31:06 +02:00
< input type = " hidden " name = " op " value = " update " >
< input type = " hidden " name = " backto " value = " record-edit " >
<!-- DATI -->
< div class = " panel panel-primary " >
< div class = " panel-heading " >
2018-02-18 19:53:23 +01:00
< h3 class = " panel-title " >< ? php echo tr ( 'Dati' ); ?> </h3>
2017-09-22 12:31:06 +02:00
</ div >
< div class = " panel-body " >
< div class = " row " >
2018-02-20 16:46:23 +01:00
< div class = " col-md-8 " >
2018-02-18 19:53:23 +01:00
{[ " type " : " text " , " label " : " <?php echo tr('Nome'); ?> " , " name " : " name " , " value " : " $name $ " , " required " : 1 ]}
2017-09-22 12:31:06 +02:00
</ div >
2018-02-20 16:46:23 +01:00
< div class = " col-md-4 " >
2018-07-18 15:20:10 +02:00
{[ " type " : " span " , " label " : " <?php echo tr('Modulo del template'); ?> " , " name " : " module " , " values " : " query=SELECT id, title AS descrizione FROM zz_modules WHERE enabled = 1 " , " value " : " <?php echo Modules::get( $record['id_module'] )['title']; ?> " ]}
2017-09-22 12:31:06 +02:00
</ div >
2018-02-20 16:46:23 +01:00
</ div >
< div class = " row " >
< div class = " col-md-8 " >
2019-08-29 10:25:14 +02:00
{[ " type " : " select " , " label " : " <?php echo tr('Indirizzo email'); ?> " , " name " : " smtp " , " value " : " $id_account $ " , " ajax-source " : " smtp " ]}
2018-02-20 16:46:23 +01:00
</ div >
2017-09-22 12:31:06 +02:00
< div class = " col-md-4 " >
2018-12-28 00:04:41 +01:00
{[ " type " : " checkbox " , " label " : " <?php echo tr('Richiedi notifica di lettura'); ?> " , " name " : " read_notify " , " value " : " $read_notify $ " , " placeholder " : " <?php echo tr('Richiedi la notifica di lettura al destinatario.'); ?> " ]}
2017-09-22 12:31:06 +02:00
</ div >
</ div >
< div class = " row " >
< div class = " col-md-8 " >
2018-02-18 19:53:23 +01:00
{[ " type " : " text " , " label " : " <?php echo tr('Oggetto'); ?> " , " name " : " subject " , " value " : " $subject $ " ]}
2017-09-22 12:31:06 +02:00
</ div >
< div class = " col-md-4 " >
2018-12-23 14:01:59 +01:00
< ? php $records [ 0 ][ 'icon' ] = ( empty ( $records [ 0 ][ 'icon' ])) ? 'fa fa-envelope' : $records [ 0 ][ 'icon' ]; ?>
{[ " type " : " text " , " label " : " <?php echo tr('Icona'); ?> " , " name " : " icon " , " value " : " <?php echo $records[0] ['icon']; ?> " , " help " : " <?php echo tr('Es. \ 'fa fa-envelope \ ''); ?> " ]}
2017-09-22 12:31:06 +02:00
</ div >
</ div >
< div class = " row " >
< div class = " col-md-4 " >
2018-12-28 08:07:56 +01:00
{[ " type " : " text " , " label " : " <?php echo tr('CC'); ?> " , " name " : " cc " , " value " : " $cc $ " , " help " : " <?php echo 'Copia carbone.'; ?> " ]}
2017-09-22 12:31:06 +02:00
</ div >
< div class = " col-md-4 " >
2018-12-28 08:07:56 +01:00
{[ " type " : " text " , " label " : " <?php echo tr('CCN'); ?> " , " name " : " bcc " , " value " : " $bcc $ " , " help " : " <?php echo 'Copia carbone nascosta.'; ?> " ]}
2017-09-22 12:31:06 +02:00
</ div >
< div class = " col-md-4 " >
2018-12-28 08:07:56 +01:00
{[ " type " : " email " , " label " : " <?php echo tr('Rispondi a'); ?> " , " name " : " reply_to " , " value " : " $reply_to $ " , " help " : " <?php echo 'Rispondi a questo indirizzo e-mail.'; ?> " ]}
2017-09-22 12:31:06 +02:00
</ div >
</ div >
2018-02-22 09:44:26 +01:00
< ? php
// Stampe
2019-08-29 10:25:14 +02:00
$selected_prints = $dbo -> fetchArray ( 'SELECT id_print FROM em_print_template WHERE id_template = ' . prepare ( $id_record ));
2018-02-22 09:44:26 +01:00
$selected = array_column ( $selected_prints , 'id_print' );
echo '
< div class = " row " >
< div class = " col-md-12 " >
2018-07-18 15:20:10 +02:00
{[ " 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( $record['id_module'] ).' AND enabled=1 " ]}
2018-02-22 09:44:26 +01:00
</ div >
</ div > ' ;
?>
2017-09-22 12:31:06 +02:00
< div class = " row " >
< div class = " col-md-12 " >
2018-09-07 17:43:52 +02:00
{[ " type " : " ckeditor " , " label " : " <?php echo tr('Contenuto'); ?> " , " name " : " body " , " value " : " $body $ " ]}
2017-09-22 12:31:06 +02:00
</ div >
</ div >
2018-02-23 09:51:42 +01:00
< ? php
// Variabili utilizzabili
2018-07-18 15:20:10 +02:00
$variables = include Modules :: filepath ( $record [ 'id_module' ], 'variables.php' );
2018-02-23 09:51:42 +01:00
2018-09-04 10:14:42 +02:00
echo '
<!-- Istruzioni per il contenuto -->
< div class = " box box-info " >
< div class = " box-header " >
2020-03-19 13:35:56 +01:00
< h3 class = " box-title " > '.tr(' Variabili ').' </ h3 >
2018-09-04 10:14:42 +02:00
</ div >
< div class = " box-body " > ' ;
if ( ! empty ( $variables )) {
2018-02-23 09:51:42 +01:00
echo '
2020-03-19 13:35:56 +01:00
< p > '.tr("Puoi utilizzare le seguenti variabili nell' oggetto e nel corpo della mail " ).':</p>
2018-09-04 10:14:42 +02:00
< ul > ' ;
2018-02-23 09:51:42 +01:00
foreach ( $variables as $variable => $value ) {
echo '
2018-09-04 10:14:42 +02:00
< li >< code > { '.$variable.' } </ code ></ li > ' ;
2018-02-23 09:51:42 +01:00
}
echo '
2018-09-04 10:14:42 +02:00
</ ul > ' ;
2018-02-23 09:51:42 +01:00
} else {
echo '
2018-09-04 10:14:42 +02:00
< p >< i class = " fa fa-warning " ></ i > '.tr(' Non sono state definite variabili da utilizzare nel template ').' .</ p > ' ;
2018-02-23 09:51:42 +01:00
}
2018-09-04 10:14:42 +02:00
echo '
</ div >
</ div >
< hr > ' ;
2018-02-23 09:51:42 +01:00
?>
2018-02-22 23:19:04 +01:00
2017-09-22 12:31:06 +02:00
</ div >
</ div >
</ form >
< a class = " btn btn-danger ask " data - backto = " record-list " >
< i class = " fa fa-trash " ></ i > < ? php echo tr ( 'Elimina' ); ?>
2019-08-26 18:02:05 +02:00
</ a >