Skip to content

Commit

Permalink
Merge pull request #823 from NSSuresh11/OLE-8930
Browse files Browse the repository at this point in the history
OLE-8930 : Cannot add donor entries in eholdings
  • Loading branch information
sheiksalahudeen authored Jul 5, 2016
2 parents 8d5673e + 06acf0a commit 2909af1
Showing 1 changed file with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.kuali.ole.docstore.model.enums.DocType;
import org.kuali.ole.describe.bo.InstanceEditorFormDataHandler;
import org.kuali.ole.describe.form.InstanceEditorForm;
import org.kuali.ole.select.bo.OLEDonor;
import org.kuali.ole.select.bo.OLEEditorResponse;
import org.kuali.ole.select.businessobject.*;
import org.kuali.ole.select.document.OLEEResourceInstance;
Expand Down Expand Up @@ -377,14 +378,31 @@ public EditorForm saveDocument(EditorForm editorForm) {
List<DonorInfo> donorInfos = eHoldings.getDonorInfo();
if(donorInfos.size() > 0) {
for (DonorInfo donorInformation : donorInfos) {
if (null != donorInformation.getDonorNote()) {

if(donorInformation.getDonorPublicDisplay() != null || donorInformation.getDonorNote() != null) {
String modifiedDonorNoteValue = donorInformation.getDonorNote().replaceAll("\"","&quot;");
String modifiedDonorDisplayValue = donorInformation.getDonorPublicDisplay().replaceAll("\"","&quot;");
donorInformation.setDonorNote(modifiedDonorNoteValue);
donorInformation.setDonorPublicDisplay(modifiedDonorDisplayValue);
}
else {
Map donorMap = new HashMap();
donorMap.put("donorCode", donorInformation.getDonorCode());
OLEDonor oleDonor = KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(OLEDonor.class, donorMap);
String modifiedDonorNoteValue = oleDonor.getDonorNote().replaceAll("\"","&quot;");
String modifiedDonorDisplayValue = oleDonor.getDonorPublicDisplay().replaceAll("\"","&quot;");
donorInformation.setDonorNote(modifiedDonorNoteValue);
donorInformation.setDonorPublicDisplay(modifiedDonorDisplayValue);
}

/*if (null != donorInformation.getDonorNote()) {
String modifiedValue = donorInformation.getDonorNote().replaceAll("\"","&quot;");
donorInformation.setDonorNote(modifiedValue);
}
if (null != donorInformation.getDonorPublicDisplay()) {
String modifiedValue = donorInformation.getDonorPublicDisplay().replaceAll("\"","&quot;");
donorInformation.setDonorPublicDisplay(modifiedValue);
}
}*/
}
eHoldings.setDonorInfo(donorInfos);
}
Expand Down

0 comments on commit 2909af1

Please sign in to comment.