clearify customer add/edit name/company requirements

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-12-06 16:25:33 +01:00
parent 4501eb2723
commit d7a2ec35cc
6 changed files with 56 additions and 25 deletions

View File

@@ -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>

View File

@@ -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">