Aggiunta selezione stampe predefinite per template

This commit is contained in:
Thomas Zilio 2018-02-22 09:44:26 +01:00
parent 013ff189d1
commit 830982c089
3 changed files with 19 additions and 1 deletions

View File

@ -486,7 +486,7 @@ if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) {
// db_host // db_host
echo ' echo '
<div class=""> <div class="col-md-12">
{[ "type": "text", "label": "'.tr('Host del database').'", "name": "db_host", "placeholder": "'.tr("Indirizzo dell'host del database").'", "value": "'.$host.'", "help": "'.tr('Esempio').': localhost", "show-help": 1, "required": 1 ]} {[ "type": "text", "label": "'.tr('Host del database').'", "name": "db_host", "placeholder": "'.tr("Indirizzo dell'host del database").'", "value": "'.$host.'", "help": "'.tr('Esempio').': localhost", "show-help": 1, "required": 1 ]}
</div> </div>
</div> </div>

View File

@ -30,6 +30,8 @@ switch (post('op')) {
'read_notify' => $post['read_notify'], 'read_notify' => $post['read_notify'],
], ['id' => $id_record]); ], ['id' => $id_record]);
$dbo->sync('zz_email_print', ['id_email' => $id_record], ['id_print' => (array) $post['prints']]);
$_SESSION['infos'][] = tr('Informazioni salvate correttamente!'); $_SESSION['infos'][] = tr('Informazioni salvate correttamente!');
break; break;

View File

@ -66,6 +66,22 @@ echo '
</div> </div>
</div> </div>
<?php
// Stampe
$selected_prints = $dbo->fetchArray('SELECT id_print FROM zz_email_print WHERE id_email = '.prepare($id_record));
$selected = array_column($selected_prints, 'id_print');
echo '
<div class="row">
<div class="col-md-12">
{[ "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($records[0]['id_module']).'" ]}
</div>
</div>';
?>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
{[ "type": "textarea", "label": "<?php echo tr('Contenuto'); ?>", "name": "body", "value": "$body$" ]} {[ "type": "textarea", "label": "<?php echo tr('Contenuto'); ?>", "name": "body", "value": "$body$" ]}