diff --git a/lib/formfields/admin/customer/formfield.customer_add.php b/lib/formfields/admin/customer/formfield.customer_add.php index 83c50b82..b2ff9f92 100644 --- a/lib/formfields/admin/customer/formfield.customer_add.php +++ b/lib/formfields/admin/customer/formfield.customer_add.php @@ -32,6 +32,7 @@ return [ 'title' => lng('admin.customer_add'), 'image' => 'fa-solid fa-user-plus', 'self_overview' => ['section' => 'customers', 'page' => 'customers'], + 'id' => 'customer_add', 'sections' => [ 'section_a' => [ 'title' => lng('admin.accountdata'), @@ -108,19 +109,19 @@ return [ 'label' => lng('customer.firstname'), 'desc' => lng('customer.nameorcompany_desc'), 'type' => 'text', - 'mandatory_ex' => ['company'] + 'mandatory' => true ], 'name' => [ 'label' => lng('customer.lastname'), 'desc' => lng('customer.nameorcompany_desc'), 'type' => 'text', - 'mandatory_ex' => ['company'] + 'mandatory' => true ], 'company' => [ 'label' => lng('customer.company'), 'desc' => lng('customer.nameorcompany_desc'), 'type' => 'text', - 'mandatory_ex' => ['firstname', 'name'] + 'mandatory' => true ], 'street' => [ 'label' => lng('customer.street'), diff --git a/lib/formfields/admin/customer/formfield.customer_edit.php b/lib/formfields/admin/customer/formfield.customer_edit.php index 65a33fa7..72d94408 100644 --- a/lib/formfields/admin/customer/formfield.customer_edit.php +++ b/lib/formfields/admin/customer/formfield.customer_edit.php @@ -32,6 +32,7 @@ return [ 'title' => lng('admin.customer_edit'), 'image' => 'fa-solid fa-user-pen', 'self_overview' => ['section' => 'customers', 'page' => 'customers'], + 'id' => 'customer_edit', 'sections' => [ 'section_a' => [ 'title' => lng('admin.accountdata'), @@ -107,21 +108,21 @@ return [ 'label' => lng('customer.firstname'), 'desc' => lng('customer.nameorcompany_desc'), 'type' => 'text', - 'mandatory_ex' => ['company'], + 'mandatory' => true, 'value' => $result['firstname'] ], 'name' => [ 'label' => lng('customer.lastname'), 'desc' => lng('customer.nameorcompany_desc'), 'type' => 'text', - 'mandatory_ex' => ['company'], + 'mandatory' => true, 'value' => $result['name'] ], 'company' => [ 'label' => lng('customer.company'), 'desc' => lng('customer.nameorcompany_desc'), 'type' => 'text', - 'mandatory_ex' => ['firstname', 'name'], + 'mandatory' => true, 'value' => $result['company'] ], 'street' => [ diff --git a/lng/de.lng.php b/lng/de.lng.php index 4fe88878..468e1b5c 100644 --- a/lng/de.lng.php +++ b/lng/de.lng.php @@ -815,6 +815,7 @@ return [ 'vmailquotawrong' => 'Die Kontingent-Größe muss positiv sein.', 'allocatetoomuchquota' => 'Sie versuchen "%s" MB Kontingent zu zuweisen, haben aber nicht genug übrig.', 'missingfields' => 'Es wurden nicht alle Felder augefüllt.', + 'requiredfield' => 'Dieses Feld ist ein Pflichtfeld.', 'accountnotexisting' => 'Der angegebene E-Mail-Account existiert nicht.', 'nopermissionsorinvalidid' => 'Entweder fehlen Ihnen die nötigen Rechte diese Einstellung zu ändern oder es wurde eine ungültige ID übergeben', 'phpsettingidwrong' => 'Eine PHP-Konfiguration mit dieser ID existiert nicht', diff --git a/lng/en.lng.php b/lng/en.lng.php index 914a7934..952e6177 100644 --- a/lng/en.lng.php +++ b/lng/en.lng.php @@ -882,6 +882,7 @@ return [ 'vmailquotawrong' => 'The quotasize must be positive number.', 'allocatetoomuchquota' => 'You tried to allocate %s MB Quota, but you do not have enough left.', 'missingfields' => 'Not all required fields were filled out.', + 'requiredfield' => 'This field is required.', 'accountnotexisting' => 'The given email account doesn\'t exist.', 'nopermissionsorinvalidid' => 'You don\'t have enough permissions to change these settings or an invalid id was given.', 'phpsettingidwrong' => 'A PHP Configuration with this id doesn\'t exist', diff --git a/package-lock.json b/package-lock.json index 1308c973..31876746 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "bootstrap": "^5.2.1", "chart.js": "^3.9.1", "jquery": "^3.6.1", + "jquery-validation": "^1.19.5", "laravel-mix": "^6.0.42", "resolve-url-loader": "^5.0.0", "sass": "^1.49.7", @@ -5396,6 +5397,15 @@ "integrity": "sha512-opJeO4nCucVnsjiXOE+/PcCgYw9Gwpvs/a6B1LL/lQhwWwpbVEVYDZ1FokFr8PRc7ghYlrFPuyHuiiDNTQxmcw==", "dev": true }, + "node_modules/jquery-validation": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/jquery-validation/-/jquery-validation-1.19.5.tgz", + "integrity": "sha512-X2SmnPq1mRiDecVYL8edWx+yTBZDyC8ohWXFhXdtqFHgU9Wd4KHkvcbCoIZ0JaSaumzS8s2gXSkP8F7ivg/8ZQ==", + "dev": true, + "peerDependencies": { + "jquery": "^1.7 || ^2.0 || ^3.1" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -13123,6 +13133,13 @@ "integrity": "sha512-opJeO4nCucVnsjiXOE+/PcCgYw9Gwpvs/a6B1LL/lQhwWwpbVEVYDZ1FokFr8PRc7ghYlrFPuyHuiiDNTQxmcw==", "dev": true }, + "jquery-validation": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/jquery-validation/-/jquery-validation-1.19.5.tgz", + "integrity": "sha512-X2SmnPq1mRiDecVYL8edWx+yTBZDyC8ohWXFhXdtqFHgU9Wd4KHkvcbCoIZ0JaSaumzS8s2gXSkP8F7ivg/8ZQ==", + "dev": true, + "requires": {} + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", diff --git a/package.json b/package.json index d3027a8c..45977562 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "bootstrap": "^5.2.1", "chart.js": "^3.9.1", "jquery": "^3.6.1", + "jquery-validation": "^1.19.5", "laravel-mix": "^6.0.42", "resolve-url-loader": "^5.0.0", "sass": "^1.49.7", diff --git a/templates/Froxlor/form/form.html.twig b/templates/Froxlor/form/form.html.twig index 381ce161..a149da8f 100644 --- a/templates/Froxlor/form/form.html.twig +++ b/templates/Froxlor/form/form.html.twig @@ -2,7 +2,7 @@ {% import "Froxlor/form/formfields.html.twig" as formfields %} -