1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package edu.sampleu.travel.document.keyvalue; |
17 | |
|
18 | |
import java.util.ArrayList; |
19 | |
import java.util.List; |
20 | |
|
21 | |
import org.kuali.rice.core.util.KeyValue; |
22 | |
import org.kuali.rice.core.util.ConcreteKeyValue; |
23 | |
import org.kuali.rice.kns.util.KNSGlobalVariables; |
24 | |
import org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase; |
25 | |
import org.kuali.rice.kns.web.struts.form.KualiForm; |
26 | |
import org.kuali.rice.krad.document.Document; |
27 | |
import org.kuali.rice.krad.keyvalues.KeyValuesBase; |
28 | |
import org.kuali.rice.krad.util.GlobalVariables; |
29 | |
|
30 | 0 | public class TravelRequestType extends KeyValuesBase { |
31 | |
|
32 | |
public List getKeyValues() { |
33 | 0 | List<KeyValue> keyValues = new ArrayList<KeyValue>(); |
34 | |
|
35 | 0 | keyValues.add(new ConcreteKeyValue("", "")); |
36 | 0 | keyValues.add(new ConcreteKeyValue("TRT1", "Travel Request Type 1")); |
37 | 0 | keyValues.add(new ConcreteKeyValue("TRT2", "Travel Request Type 2")); |
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | 0 | KualiForm form = KNSGlobalVariables.getKualiForm(); |
43 | 0 | if ((form != null) && (form instanceof KualiDocumentFormBase)) { |
44 | 0 | Document doc =((KualiDocumentFormBase)form).getDocument(); |
45 | 0 | if (doc != null) { |
46 | 0 | keyValues.add(new ConcreteKeyValue("TRT3", "Travel Request Type 3")); |
47 | |
} |
48 | |
} |
49 | |
|
50 | 0 | return keyValues; |
51 | |
} |
52 | |
|
53 | |
} |