Commit 9be26af4 authored by Niklaus Giger's avatar Niklaus Giger

Merge branch '3.6' of github.com:elexis/elexis-3-core into f9098

parents 2ddd90c6 217c1c06
Pipeline #6006 passed with stages
in 2 minutes and 24 seconds
......@@ -56,6 +56,16 @@
class="ch.elexis.core.data.util.PatientDataAccessor"
name="Patient">
</DataAccess>
<TextPlaceHolder
name="Kostentraeger"
resolver="ch.elexis.core.data.text.resolver.FallKostentraegerResolver"
type="ch.elexis.data.Fall">
</TextPlaceHolder>
<TextPlaceHolder
name="Kostenträger"
resolver="ch.elexis.core.data.text.resolver.FallKostentraegerResolver"
type="ch.elexis.data.Fall">
</TextPlaceHolder>
</extension>
<extension
point="org.eclipse.core.runtime.preferences">
......
package ch.elexis.core.data.text.resolver;
import java.util.Optional;
import ch.elexis.core.data.interfaces.text.ITextResolver;
import ch.elexis.core.data.util.FallDataAccessor;
import ch.elexis.data.Fall;
import ch.elexis.data.Kontakt;
public class FallKostentraegerResolver implements ITextResolver {
/**
* @see FallDataAccessor#getObject(String, ch.elexis.data.PersistentObject, String, String[])
*/
@Override
public Optional<String> resolve(Object object) {
if (object instanceof Fall) {
Kontakt costBearer = ((Fall) object).getCostBearer();
if (costBearer != null) {
String label = costBearer.getLabel();
String fullName = label.substring(0, label.indexOf(","));
return Optional.of(fullName);
}
}
return Optional.empty();
}
}
......@@ -61,6 +61,7 @@ public class FallDataAccessor implements IDataAccess {
if (descriptor.equalsIgnoreCase(KOSTENTRAEGER)
|| descriptor.equalsIgnoreCase(KOSTENTRAEGER_UMLAUT)) {
// WARN does not seem to be called anymore - see FallKostentraegerResolver
result = new Result<Object>(costBearer.getPostAnschrift(true));
} else if (descriptor.equalsIgnoreCase(KOSTENTRAEGER_KUERZEL)
......
......@@ -403,7 +403,7 @@ public class ReminderDetailDialog extends TitleAreaDialog {
rvapc.setConfiguredVisibility(reminder.getVisibility(),
reminder.isPatientRelated() && patient != null);
} else {
rvapc.setConfiguredVisibility(Visibility.ALWAYS, patient != null);
rvapc.setConfiguredVisibility(null, patient != null);
}
updateModelToTarget();
}
......
......@@ -18,11 +18,9 @@ import org.eclipse.swt.widgets.Label;
import ch.elexis.core.constants.Preferences;
import ch.elexis.core.constants.StringConstants;
import ch.elexis.core.data.activator.CoreHub;
import ch.elexis.core.data.events.ElexisEventDispatcher;
import ch.elexis.core.model.issue.Visibility;
import ch.elexis.core.ui.icons.Images;
import ch.elexis.core.ui.views.Messages;
import ch.elexis.data.Patient;
public class ReminderVisibilityAndPopupComposite extends Composite {
......@@ -153,10 +151,15 @@ public class ReminderVisibilityAndPopupComposite extends Composite {
if (noPatientSelectedComposite.equals(stackLayout.topControl)) {
popupOnLogin.setSelection(Visibility.POPUP_ON_LOGIN == visibility);
} else {
visibility = (visibility == null) ? Visibility.ALWAYS : visibility;
Patient patient = ElexisEventDispatcher.getSelectedPatient();
boolean defaultPatientRelated = CoreHub.userCfg.get(Preferences.USR_REMINDER_DEFAULT_PATIENT_RELATED, true);
showOnlyOnSelectedPatient.setSelection(defaultPatientRelated && patient != null);
if (visibility == null) {
visibility = Visibility.ALWAYS;
boolean defaultPatientRelated = CoreHub.userCfg.get(Preferences.USR_REMINDER_DEFAULT_PATIENT_RELATED,
false);
if (withPatientRelation && defaultPatientRelated) {
visibility = Visibility.ON_PATIENT_SELECTION;
}
}
showOnlyOnSelectedPatient.setSelection(Visibility.ON_PATIENT_SELECTION == visibility);
showOnlyOnSelectedPatient.setToolTipText(Messages.ReminderView_defaultPatientRelatedTooltip);
showOnlyOnSelectedPatient.setToolTipText("Der Vorgabewert kann unter Einstellungen..Anwender..Pendenzen geändert werden");
comboPopup.setEnabled(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment