added note field on template and export

This commit is contained in:
2026-07-10 08:28:46 +02:00
parent 2ab667df22
commit f4ea06fb93
6 changed files with 100 additions and 10 deletions
@@ -77,7 +77,8 @@ $stmt = $pdo->prepare("
field_label,
main_field,
is_visible_import,
is_visible_parts
is_visible_parts,
is_addnote
FROM template_mapping
WHERE template_id = ?
ORDER BY field_order ASC, id ASC
@@ -183,7 +184,9 @@ $apiSampleJson = $template['api_sample_json'] ?? '';
#schemaFieldsTable th:nth-child(2),
#schemaFieldsTable td:nth-child(2),
#schemaFieldsTable th:nth-child(3),
#schemaFieldsTable td:nth-child(3) {
#schemaFieldsTable td:nth-child(3),
#schemaFieldsTable th:nth-child(4),
#schemaFieldsTable td:nth-child(4) {
width: 48px;
/* 🔥 più stretto */
text-align: center;
@@ -195,7 +198,8 @@ $apiSampleJson = $template['api_sample_json'] ?? '';
/* Make checkbox itself not oversized */
#schemaFieldsTable td:nth-child(1) input[type="checkbox"],
#schemaFieldsTable td:nth-child(2) input[type="checkbox"],
#schemaFieldsTable td:nth-child(3) input[type="checkbox"] {
#schemaFieldsTable td:nth-child(3) input[type="checkbox"],
#schemaFieldsTable td:nth-child(4) input[type="checkbox"] {
transform: scale(0.95);
margin: 0;
}
@@ -398,6 +402,7 @@ $apiSampleJson = $template['api_sample_json'] ?? '';
<th style="width:45px; text-align:center;">Main</th>
<th style="width:45px; text-align:center;">Import</th>
<th style="width:45px; text-align:center;">Parts</th>
<th style="width:45px; text-align:center;">Note</th>
<th style="width:320px;">Title</th>
<th style="width:70px; text-align:center;">Order</th>
<th style="width:120px;">Type</th>
@@ -428,7 +433,12 @@ $apiSampleJson = $template['api_sample_json'] ?? '';
data-mapping-id="<?php echo (int)$mapping['id']; ?>"
<?php echo ((int)($mapping['is_visible_parts'] ?? 0) === 1) ? 'checked' : ''; ?>>
</td>
<td class="text-center">
<input type="checkbox"
class="addnote-checkbox"
data-mapping-id="<?php echo (int)$mapping['id']; ?>"
<?php echo ((int)($mapping['is_addnote'] ?? 0) === 1) ? 'checked' : ''; ?>>
</td>
<td class="title-col">
<?php echo htmlspecialchars($mapping['field_label'] ?? 'N/A'); ?>
<?php if ((int)$mapping['is_required'] === 1): ?>
@@ -442,8 +452,6 @@ $apiSampleJson = $template['api_sample_json'] ?? '';
<td><?php echo htmlspecialchars($mapping['data_type'] ?? 'N/A'); ?></td>
<td><?php echo htmlspecialchars($mapping['data_type'] ?? 'N/A'); ?></td>
<td>
<?php
$isSceltaMultipla = ($mapping['data_type'] === 'SceltaMultipla');
@@ -1938,6 +1946,10 @@ $apiSampleJson = $template['api_sample_json'] ?? '';
if (el.classList.contains('visible-parts-checkbox')) {
saveMappingFlag(el, 'is_visible_parts');
}
if (el.classList.contains('addnote-checkbox')) {
saveMappingFlag(el, 'is_addnote');
}
});
// AUTO VALUE select change -> save auto_value
document.getElementById('schemaFieldsBody').addEventListener('change', function(event) {