Aggiunta controllo campi personalizzati doppi
This commit is contained in:
parent
f93046c9c4
commit
bd51a5241a
15
actions.php
15
actions.php
|
@ -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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue