diff --git a/modules/helpdesk/i18n/default_de.json b/modules/helpdesk/i18n/default_de.json index 7854d70..0c83416 100644 --- a/modules/helpdesk/i18n/default_de.json +++ b/modules/helpdesk/i18n/default_de.json @@ -403,6 +403,7 @@ "Date": "Datum", "Checkbox": "Checkbox", "Select": "Auswahl", + "User selection": "Benutzerauswahl", "Text content": "Textinhalt", "Maximum %d fields allowed": "Maximal %d Felder erlaubt", "Field %d: unknown type \"%s\"": "Feld %d: unbekannter Typ \"%s\"", diff --git a/modules/helpdesk/i18n/default_en.json b/modules/helpdesk/i18n/default_en.json index 1439539..6c486e2 100644 --- a/modules/helpdesk/i18n/default_en.json +++ b/modules/helpdesk/i18n/default_en.json @@ -403,6 +403,7 @@ "Date": "Date", "Checkbox": "Checkbox", "Select": "Select", + "User selection": "User selection", "Text content": "Text content", "Maximum %d fields allowed": "Maximum %d fields allowed", "Field %d: unknown type \"%s\"": "Field %d: unknown type \"%s\"", diff --git a/modules/helpdesk/pages/helpdesk/software-products/_form.phtml b/modules/helpdesk/pages/helpdesk/software-products/_form.phtml index 8716d54..e610941 100644 --- a/modules/helpdesk/pages/helpdesk/software-products/_form.phtml +++ b/modules/helpdesk/pages/helpdesk/software-products/_form.phtml @@ -53,6 +53,7 @@ $handoverSchemaFields = is_array($handoverSchemaFields ?? null) ? $handoverSchem 'type_date' => t('Date'), 'type_checkbox' => t('Checkbox'), 'type_select' => t('Select'), + 'type_user-select' => t('User selection'), 'text_content' => t('Text content'), 'field' => t('Field'), 'preview' => t('Preview'), diff --git a/modules/helpdesk/web/js/handover-schema-editor.js b/modules/helpdesk/web/js/handover-schema-editor.js index ea5e261..af19463 100644 --- a/modules/helpdesk/web/js/handover-schema-editor.js +++ b/modules/helpdesk/web/js/handover-schema-editor.js @@ -6,7 +6,7 @@ */ import { resolveHost } from '/js/core/app-dom.js'; -const FIELD_TYPES = ['heading', 'paragraph', 'text', 'textarea', 'number', 'date', 'checkbox', 'select']; +const FIELD_TYPES = ['heading', 'paragraph', 'text', 'textarea', 'number', 'date', 'checkbox', 'select', 'user-select']; const DISPLAY_ONLY_TYPES = ['heading', 'paragraph']; const EMPTY_API = Object.freeze({ destroy: () => {} }); @@ -385,6 +385,12 @@ function init(root) { option.textContent = opt.label || ''; input.appendChild(option); }); + } else if (field.type === 'user-select') { + input = document.createElement('select'); + const placeholder = document.createElement('option'); + placeholder.value = ''; + placeholder.textContent = t['type_user-select'] || 'User selection'; + input.appendChild(placeholder); } else { input = document.createElement('input'); input.type = field.type === 'number' ? 'number' : field.type === 'date' ? 'date' : 'text';