Skip to content

Commit

Permalink
restore role last used. default values for lawyer and assistant are e…
Browse files Browse the repository at this point in the history
…mpty. issue #2693
  • Loading branch information
j-dimension committed Nov 24, 2024
1 parent d0f8a00 commit 7b71d5d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ public AddAddressSearchDialog(java.awt.Frame parent, boolean modal, String targe
EditorsRegistry.getInstance().clearStatus();
}

if (this.partyTypes.size() > 0) {
if (!this.partyTypes.isEmpty()) {
this.targetReferenceType = this.partyTypes.get(0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -776,8 +776,8 @@ public NewCaseStep() {
ThreadUtils.addComponent(tagPanel, tb);
}

this.cmbLawyer.setSelectedItem(UserSettings.getInstance().getCurrentUser().getPrincipalId());
this.cmbAssistant.setSelectedItem(UserSettings.getInstance().getCurrentUser().getPrincipalId());
// this.cmbLawyer.setSelectedItem(UserSettings.getInstance().getCurrentUser().getPrincipalId());
// this.cmbAssistant.setSelectedItem(UserSettings.getInstance().getCurrentUser().getPrincipalId());


}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,7 @@

import com.jdimension.jlawyer.client.editors.files.AddressBeanListCellRenderer;
import com.jdimension.jlawyer.client.settings.ClientSettings;
import com.jdimension.jlawyer.client.settings.UserSettings;
import com.jdimension.jlawyer.client.wizard.*;
import com.jdimension.jlawyer.persistence.AddressBean;
import com.jdimension.jlawyer.persistence.PartyTypeBean;
Expand All @@ -673,8 +674,6 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;

/**
Expand Down Expand Up @@ -713,6 +712,13 @@ public SelectAddressStep() {
for (String s : refTypeNames) {
this.cmbRefType.addItem(s);
}

UserSettings uset=UserSettings.getInstance();
String lastPartyType = uset.getSetting(UserSettings.CONF_CASE_LASTPARTYTYPE_NEWCASEASSISTANT, "");
if(lastPartyType!=null) {
this.cmbRefType.setSelectedItem(lastPartyType);
}


} catch (Throwable t) {
log.error("Unable to get party types", t);
Expand All @@ -733,6 +739,9 @@ public void nextEvent() {

this.data.put("newaddress.partytype", selectedType);
this.data.put("newaddress.selectedaddress", this.cmbRecipient.getSelectedItem());

UserSettings uset=UserSettings.getInstance();
uset.setSetting(UserSettings.CONF_CASE_LASTPARTYTYPE_NEWCASEASSISTANT, refType);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ public class UserSettingsKeys {
public static final String CONF_DOCUMENTS_LASTSORTMODE="client.documents.lastsortmode";

public static final String CONF_CASE_LASTPARTYTYPE = "user.case.lastpartytype";
public static final String CONF_CASE_LASTPARTYTYPE_NEWCASEASSISTANT = "user.case.lastpartytype.newcase";

public static final String CONF_CASES_EXPORT_TOLOCAL="user.case.pdfexport.tolocal";
public static final String CONF_CASES_EXPORT_TOCASE="user.case.pdfexport.tocase";
Expand Down

0 comments on commit 7b71d5d

Please sign in to comment.