clearify customer add/edit name/company requirements
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -95,16 +95,6 @@ return [
|
||||
'title' => lng('admin.contactdata'),
|
||||
'image' => 'icons/user_add.png',
|
||||
'fields' => [
|
||||
'name' => [
|
||||
'label' => lng('customer.name'),
|
||||
'type' => 'text',
|
||||
'mandatory_ex' => true
|
||||
],
|
||||
'firstname' => [
|
||||
'label' => lng('customer.firstname'),
|
||||
'type' => 'text',
|
||||
'mandatory_ex' => true
|
||||
],
|
||||
'gender' => [
|
||||
'label' => lng('gender.title'),
|
||||
'type' => 'select',
|
||||
@@ -114,10 +104,23 @@ return [
|
||||
2 => lng('gender.female')
|
||||
]
|
||||
],
|
||||
'firstname' => [
|
||||
'label' => lng('customer.firstname'),
|
||||
'desc' => lng('customer.nameorcompany_desc'),
|
||||
'type' => 'text',
|
||||
'mandatory_ex' => ['company']
|
||||
],
|
||||
'name' => [
|
||||
'label' => lng('customer.name'),
|
||||
'desc' => lng('customer.nameorcompany_desc'),
|
||||
'type' => 'text',
|
||||
'mandatory_ex' => ['company']
|
||||
],
|
||||
'company' => [
|
||||
'label' => lng('customer.company'),
|
||||
'desc' => lng('customer.nameorcompany_desc'),
|
||||
'type' => 'text',
|
||||
'mandatory_ex' => true
|
||||
'mandatory_ex' => ['firstname', 'name']
|
||||
],
|
||||
'street' => [
|
||||
'label' => lng('customer.street'),
|
||||
|
||||
@@ -93,18 +93,6 @@ return [
|
||||
'title' => lng('admin.contactdata'),
|
||||
'image' => 'icons/user_edit.png',
|
||||
'fields' => [
|
||||
'name' => [
|
||||
'label' => lng('customer.name'),
|
||||
'type' => 'text',
|
||||
'mandatory_ex' => true,
|
||||
'value' => $result['name']
|
||||
],
|
||||
'firstname' => [
|
||||
'label' => lng('customer.firstname'),
|
||||
'type' => 'text',
|
||||
'mandatory_ex' => true,
|
||||
'value' => $result['firstname']
|
||||
],
|
||||
'gender' => [
|
||||
'label' => lng('gender.title'),
|
||||
'type' => 'select',
|
||||
@@ -115,10 +103,25 @@ return [
|
||||
],
|
||||
'selected' => $result['gender']
|
||||
],
|
||||
'firstname' => [
|
||||
'label' => lng('customer.firstname'),
|
||||
'desc' => lng('customer.nameorcompany_desc'),
|
||||
'type' => 'text',
|
||||
'mandatory_ex' => ['company'],
|
||||
'value' => $result['firstname']
|
||||
],
|
||||
'name' => [
|
||||
'label' => lng('customer.name'),
|
||||
'desc' => lng('customer.nameorcompany_desc'),
|
||||
'type' => 'text',
|
||||
'mandatory_ex' => ['company'],
|
||||
'value' => $result['name']
|
||||
],
|
||||
'company' => [
|
||||
'label' => lng('customer.company'),
|
||||
'desc' => lng('customer.nameorcompany_desc'),
|
||||
'type' => 'text',
|
||||
'mandatory_ex' => true,
|
||||
'mandatory_ex' => ['firstname', 'name'],
|
||||
'value' => $result['company']
|
||||
],
|
||||
'street' => [
|
||||
|
||||
@@ -546,6 +546,7 @@ return [
|
||||
'name' => 'Name',
|
||||
'firstname' => 'Vorname',
|
||||
'company' => 'Firma',
|
||||
'nameorcompany_desc' => 'Entweder Vorname/Name oder Firma ist erforderlich',
|
||||
'street' => 'Straße',
|
||||
'zipcode' => 'PLZ',
|
||||
'city' => 'Ort',
|
||||
|
||||
@@ -589,6 +589,7 @@ return [
|
||||
'name' => 'Name',
|
||||
'firstname' => 'First name',
|
||||
'company' => 'Company',
|
||||
'nameorcompany_desc' => 'Either firstname/name or company is required',
|
||||
'street' => 'Street',
|
||||
'zipcode' => 'Zipcode',
|
||||
'city' => 'City',
|
||||
|
||||
@@ -72,6 +72,29 @@
|
||||
{% if field.note is defined and field.note is not empty %}
|
||||
<small class="text-info">{{ field.note|raw }}</small>
|
||||
{% endif %}
|
||||
|
||||
{% if field.mandatory_ex is not empty and field.mandatory_ex is iterable and field.mandatory_ex|length > 0 %}
|
||||
<script>
|
||||
$(function () {
|
||||
$('#{{ id }}').attr('required', true);
|
||||
$('#{{ id }}').trigger('change');
|
||||
$('#{{ id }}').on('change', function(e) {
|
||||
if ($(this).val().length > 0) {
|
||||
{% for mex in field.mandatory_ex %}
|
||||
$('#{{ mex }}').attr('required', false);
|
||||
{% endfor %}
|
||||
$('#{{ id }}').attr('required', true);
|
||||
} else {
|
||||
{% for mex in field.mandatory_ex %}
|
||||
$('#{{ mex }}').attr('required', true);
|
||||
{% endfor %}
|
||||
$('#{{ id }}').attr('required', false);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
{% if norow == false and (field.type != 'hidden' or (field.type == 'hidden' and field.display is defined and field.display is not empty)) %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<i class="fa-solid fa-reply me-1"></i><span class="d-none d-xl-inline">{{ userinfo.switched_user.loginname }}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if userinfo.adminsession == 1 %}
|
||||
{% if userinfo.adminsession == 1 and call_static('\\Froxlor\\CurrentUser', 'getField', ['change_serversettings']) is not empty and call_static('\\Froxlor\\CurrentUser', 'getField', ['change_serversettings']) == 1 %}
|
||||
<li class="nav-item" id="updatecheck"></li>
|
||||
{% endif %}
|
||||
<li class="nav-item">
|
||||
|
||||
Reference in New Issue
Block a user