use of de.symeda.sormas.ui.person.PersonEditForm in project SORMAS-Project by hzi-braunschweig.
the class CasePersonView method initView.
@Override
protected void initView(String params) {
CaseDataDto caseData = FacadeProvider.getCaseFacade().getCaseDataByUuid(getCaseRef().getUuid());
CommitDiscardWrapperComponent<PersonEditForm> personEditComponent = ControllerProvider.getPersonController().getPersonEditComponent(PersonContext.CASE, caseData.getPerson().getUuid(), caseData.getDisease(), caseData.getDiseaseDetails(), UserRight.CASE_EDIT, getViewMode());
setSubComponent(personEditComponent);
setCaseEditPermission(personEditComponent);
}
use of de.symeda.sormas.ui.person.PersonEditForm in project SORMAS-Project by hzi-braunschweig.
the class RelatedLabMessageHandler method handlePersonCorrection.
@Override
protected void handlePersonCorrection(LabMessageDto labMessage, PersonDto person, PersonDto updatedPerson, List<String[]> changedFields, RelatedLabMessageHandlerChain chain) {
CorrectionPanel<PersonDto> personCorrectionPanel = new CorrectionPanel<>(() -> new PersonEditForm(person.isPseudonymized()), person, updatedPerson, Strings.headingPreviousPersonInformation, Strings.headingUpdatedPersonInformation, changedFields);
showCorrectionWindow(labMessage, Strings.headingCorrectPerson, personCorrectionPanel, p -> {
FacadeProvider.getPersonFacade().savePerson(p);
Notification.show(I18nProperties.getString(Strings.messagePersonSaved), Notification.Type.TRAY_NOTIFICATION);
}, chain);
}
use of de.symeda.sormas.ui.person.PersonEditForm in project SORMAS-Project by hzi-braunschweig.
the class EventParticipantEditForm method setPerson.
@Override
public void setPerson(PersonDto person) {
if (person != null) {
this.getValue().setPerson(person);
} else {
this.getValue().setPerson(originalPerson);
}
getFieldGroup().unbind(pef);
pef = new PersonEditForm(PersonContext.EVENT_PARTICIPANT, event.getDisease(), event.getDiseaseDetails(), null, person != null ? person.isPseudonymized() : isPersonPseudonymized);
pef.setWidth(100, Unit.PERCENTAGE);
pef.setImmediate(true);
getFieldGroup().bind(pef, EventParticipantDto.PERSON);
getContent().addComponent(pef, EventParticipantDto.PERSON);
}
use of de.symeda.sormas.ui.person.PersonEditForm in project SORMAS-Project by hzi-braunschweig.
the class EventParticipantEditForm method addFields.
@Override
protected void addFields() {
if (event == null) {
// workaround to stop initialization until event is set
return;
}
if (searchPerson) {
searchPersonButton = createPersonSearchButton(PERSON_SEARCH_LOC);
searchPersonButton.setCaption(I18nProperties.getString(Strings.infoSearchPersonOnDependentForm));
getContent().addComponent(searchPersonButton, PERSON_SEARCH_LOC);
}
pef = new PersonEditForm(PersonContext.EVENT_PARTICIPANT, event.getDisease(), event.getDiseaseDetails(), null, isPersonPseudonymized);
pef.setWidth(100, Unit.PERCENTAGE);
pef.setImmediate(true);
getFieldGroup().bind(pef, EventParticipantDto.PERSON);
getContent().addComponent(pef, EventParticipantDto.PERSON);
addField(EventParticipantDto.INVOLVEMENT_DESCRIPTION, TextField.class);
ComboBox region = addInfrastructureField(EventParticipantDto.REGION);
region.setDescription(I18nProperties.getPrefixDescription(EventParticipantDto.I18N_PREFIX, EventParticipantDto.REGION));
ComboBox district = addInfrastructureField(EventParticipantDto.DISTRICT);
district.setDescription(I18nProperties.getPrefixDescription(EventParticipantDto.I18N_PREFIX, EventParticipantDto.DISTRICT));
region.addValueChangeListener(e -> {
RegionReferenceDto regionDto = (RegionReferenceDto) e.getProperty().getValue();
FieldHelper.updateItems(district, regionDto != null ? FacadeProvider.getDistrictFacade().getAllActiveByRegion(regionDto.getUuid()) : null);
});
region.addItems(FacadeProvider.getRegionFacade().getAllActiveByServerCountry());
LocationDto locationDto = event.getEventLocation();
boolean shouldBeRequired = locationDto.getRegion() == null || locationDto.getDistrict() == null;
region.setRequired(shouldBeRequired);
district.setRequired(shouldBeRequired);
addField(EventParticipantDto.REPORTING_USER, ComboBox.class);
setReadOnly(true, EventParticipantDto.REPORTING_USER);
initializeVisibilitiesAndAllowedVisibilities();
initializeAccessAndAllowedAccesses();
addField(EventParticipantDto.VACCINATION_STATUS);
addField(EventParticipantDto.DELETION_REASON);
addField(EventParticipantDto.OTHER_DELETION_REASON, TextArea.class).setRows(3);
setVisible(false, EventParticipantDto.DELETION_REASON, EventParticipantDto.OTHER_DELETION_REASON);
}
use of de.symeda.sormas.ui.person.PersonEditForm in project SORMAS-Project by hzi-braunschweig.
the class TravelEntryPersonView method initView.
@Override
protected void initView(String params) {
TravelEntryDto dto = FacadeProvider.getTravelEntryFacade().getByUuid(getReference().getUuid());
CommitDiscardWrapperComponent<PersonEditForm> travelEntryPersonComponent = ControllerProvider.getPersonController().getPersonEditComponent(PersonContext.TRAVEL_ENTRY, dto.getPerson().getUuid(), dto.getDisease(), dto.getDiseaseDetails(), UserRight.TRAVEL_ENTRY_EDIT, null);
setSubComponent(travelEntryPersonComponent);
setTravelEntryEditPermission(travelEntryPersonComponent);
}
Aggregations