Compare commits

...

2 Commits

Author SHA1 Message Date
FabioL 6c68612e29 Fix descrizione articoli con apici 2024-09-06 09:59:51 +02:00
valentina bd51a5241a Aggiunta controllo campi personalizzati doppi 2024-09-06 09:46:50 +02:00
2 changed files with 20 additions and 6 deletions

View File

@ -514,11 +514,16 @@ if ($structure->permission == 'rw') {
Filter::set('get', 'id_record', $id_record);
foreach ($values as $key => $value) {
$dbo->insert('zz_field_record', [
'id_record' => $id_record,
'id_field' => $key,
'value' => $value,
]);
$name = $dbo->fetchOne('SELECT `name` FROM `zz_fields` WHERE `id` = '.prepare($key));
$custom_fields = new HTMLBuilder\Manager\FieldManager;
$campo = $custom_fields->getValue(['id_record' => $id_record, 'id_module' => $id_module], $name);
if (empty($campo)){
$dbo->insert('zz_field_record', [
'id_record' => $id_record,
'id_field' => $key,
'value' => $value,
]);
}
}
}

View File

@ -65,7 +65,16 @@ use Modules\Iva\Aliquota;
<div class="row">
<div class="col-md-12">
{[ "type": "textarea", "label": "<?php echo tr('Descrizione'); ?>", "name": "descrizione", "required": 1, "value": "<?php echo $articolo->getTranslation('title'); ?>", "charcounter": 1 ]}
<?php
echo input([
'type' => 'textarea',
'label' => tr('Descrizione'),
'name' => 'descrizione',
'required' => 1,
'value' => $articolo->getTranslation('title'),
'charcounter' => 1
])
?>
</div>
</div>