Merge pull request #4920 from christianbeeznest/ofaj-21077

User: Improve inscription form - refs BT#21077
pull/4922/head
christianbeeznest 1 year ago committed by GitHub
commit 17c413c4d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      public/main/auth/inscription.php
  2. 11
      public/main/inc/lib/formvalidator/Element/DatePicker.php

@ -477,6 +477,7 @@ if (false === $userAlreadyRegisteredShowTerms &&
false, false,
[], [],
$requiredFields, $requiredFields,
true
); );
$extraFieldsLoaded = true; $extraFieldsLoaded = true;
} }

@ -42,8 +42,17 @@ class DatePicker extends HTML_QuickForm_text
} }
$label = $this->getLabel(); $label = $this->getLabel();
$requiredFields = api_get_setting('registration.required_extra_fields_in_inscription', true);
if (!empty($requiredFields) && $requiredFields['options']) {
$requiredFields = $requiredFields['options'];
}
$variable = str_replace('extra_', '',$id);
$requiredSymbol = '';
if (in_array($variable, $requiredFields)) {
$requiredSymbol = '<span class="form_required">*</span>';
}
return ' return '
<div>'.$label.'</div> <div>'.$requiredSymbol.$label.'</div>
<div id="'.$id.'" class="flex flex-row mt-1"> <div id="'.$id.'" class="flex flex-row mt-1">
<input '.$this->_getAttrString($this->_attributes).' <input '.$this->_getAttrString($this->_attributes).'
class="form-control border" type="text" value="'.$value.'" placeholder="'.get_lang('Select date ..').'" data-input> class="form-control border" type="text" value="'.$value.'" placeholder="'.get_lang('Select date ..').'" data-input>

Loading…
Cancel
Save