added fkag clone parts note

This commit is contained in:
2026-07-06 17:06:17 +02:00
parent 485748859e
commit 2ab667df22
3 changed files with 13 additions and 1 deletions
+4 -1
View File
@@ -10,6 +10,9 @@ $data = json_decode(file_get_contents('php://input'), true);
$sourceIddatadb = isset($data['source_iddatadb']) ? (int)$data['source_iddatadb'] : 0;
$targetList = $data['target_iddatadb_list'] ?? [];
// Default true: se il client non manda il parametro, cloniamo comunque le note
// (comportamento di default richiesto, coerente con la checkbox pre-spuntata)
$cloneNotes = array_key_exists('clone_notes', $data) ? !empty($data['clone_notes']) : true;
$cloneAnalyses = !empty($data['clone_analyses']);
$targetIds = array_values(array_unique(array_filter(array_map('intval', (array)$targetList), function ($v) use ($sourceIddatadb) {
@@ -102,7 +105,7 @@ try {
':part_description' => $part['part_description'],
':mix' => $part['mix'] ?? 'N',
':idmatrice' => $part['idmatrice'] !== '' ? $part['idmatrice'] : null,
':note' => $part['note'] ?? null,
':note' => $cloneNotes ? ($part['note'] ?? null) : null,
':dateexpiry' => $part['dateexpiry'] ?? null,
]);