1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.fp.document.authorization;
17
18
19 import org.kuali.ole.fp.document.DistributionOfIncomeExpenseDocument;
20 import org.kuali.ole.sys.OLEPropertyConstants;
21 import org.kuali.ole.sys.OleAuthorizationConstants;
22 import org.kuali.ole.sys.businessobject.ElectronicPaymentClaim;
23 import org.kuali.ole.sys.document.authorization.OLEAccountingDocumentPresentationControllerBase;
24 import org.kuali.rice.kim.api.identity.Person;
25 import org.kuali.rice.krad.document.Document;
26 import org.kuali.rice.krad.uif.lifecycle.ViewLifecycle;
27 import org.kuali.rice.krad.uif.view.View;
28 import org.kuali.rice.krad.uif.view.ViewModel;
29 import org.kuali.rice.krad.uif.view.ViewPresentationController;
30 import org.kuali.rice.krad.web.form.DocumentFormBase;
31 import org.kuali.rice.krad.web.form.UifFormBase;
32
33 import java.util.List;
34 import java.util.Set;
35
36 public class OLEDistributionOfIncomeAndExpenseDocumentPresentationController extends OLEAccountingDocumentPresentationControllerBase {
37
38
39
40
41 @Override
42 public Set<String> getEditModes(View view, UifFormBase model) {
43 Set<String> editModes = super.getEditModes(view, model);
44 Document document = ((DocumentFormBase) model).getDocument();
45
46
47 DistributionOfIncomeExpenseDocument distributionOfIncomeAndExpenseDocument = (DistributionOfIncomeExpenseDocument) document;
48 List<ElectronicPaymentClaim> electronicPaymentClaims = distributionOfIncomeAndExpenseDocument.getElectronicPaymentClaims();
49
50 if (electronicPaymentClaims == null) {
51 distributionOfIncomeAndExpenseDocument.refreshReferenceObject(OLEPropertyConstants.ELECTRONIC_PAYMENT_CLAIMS);
52 electronicPaymentClaims = distributionOfIncomeAndExpenseDocument.getElectronicPaymentClaims();
53 }
54
55 if (electronicPaymentClaims != null && electronicPaymentClaims.size() > 0) {
56 editModes.add(OleAuthorizationConstants.DistributionOfIncomeAndExpenseEditMode.SOURCE_LINE_READ_ONLY_MODE);
57 }
58
59 return editModes;
60 }
61
62 }