@@ -296,13 +296,8 @@ protected void addFields() {
296
296
ComboBox birthDateMonth = addField (PersonDto .BIRTH_DATE_MM , ComboBox .class );
297
297
// @TODO: Done for nullselection Bug, fixed in Vaadin 7.7.3
298
298
birthDateMonth .setNullSelectionAllowed (true );
299
- birthDateMonth .addItems (DateHelper .getMonthsInYear ());
300
- birthDateMonth .setPageLength (12 );
301
299
birthDateMonth .setInputPrompt (I18nProperties .getString (Strings .month ));
302
300
birthDateMonth .setCaption ("" );
303
- DateHelper .getMonthsInYear ()
304
- .forEach (month -> birthDateMonth .setItemCaption (month , de .symeda .sormas .api .Month .values ()[month - 1 ].toString ()));
305
- setItemCaptionsForMonths (birthDateMonth );
306
301
ComboBox birthDateYear = addField (PersonDto .BIRTH_DATE_YYYY , ComboBox .class );
307
302
birthDateYear .setCaption (I18nProperties .getPrefixCaption (PersonDto .I18N_PREFIX , PersonDto .BIRTH_DATE ));
308
303
// @TODO: Done for nullselection Bug, fixed in Vaadin 7.7.3
@@ -446,6 +441,13 @@ protected void addFields() {
446
441
initializeVisibilitiesAndAllowedVisibilities ();
447
442
initializeAccessAndAllowedAccesses ();
448
443
444
+ if (isEditableAllowed (PersonDto .BIRTH_DATE_MM )) {
445
+ birthDateMonth .addItems (DateHelper .getMonthsInYear ());
446
+ birthDateMonth .setPageLength (13 );
447
+ DateHelper .getMonthsInYear ()
448
+ .forEach (month -> birthDateMonth .setItemCaption (month , de .symeda .sormas .api .Month .values ()[month - 1 ].toString ()));
449
+ }
450
+
449
451
if (!getField (PersonDto .OCCUPATION_TYPE ).isVisible ()
450
452
&& !getField (PersonDto .ARMED_FORCES_RELATION_TYPE ).isVisible ()
451
453
&& !getField (PersonDto .EDUCATION_TYPE ).isVisible ())
0 commit comments