1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 public class CourseRetireByProposalConfigurer extends CourseProposalConfigurer {
37
38
39
40
41
42
43
44
45 @Override
46 public void configure(final CourseProposalController layout) {
47 type = "course";
48 state = DtoConstants.STATE_DRAFT;
49 nextState = DtoConstants.STATE_RETIRED;
50
51 groupName = LUUIConstants.COURSE_GROUP_NAME;
52
53 if (modelDefinition.getMetadata().isCanEdit()) {
54 addCluStartSection(layout);
55 String sections = getLabel(LUUIConstants.COURSE_SECTIONS);
56
57 layout.addMenu(sections);
58
59
60 layout.addMenuItem(sections, (SectionView)generateRetirementInfoSection(initSectionView(CourseSections.COURSE_INFO, getLabel(LUUIConstants.RETIREMENT_LABEL_KEY))));
61
62
63 layout.addMenuItem(sections, new CollaboratorSectionView(CourseSections.PEOPLE_PERMISSONS, getLabel(LUUIConstants.SECTION_AUTHORS_AND_COLLABORATORS), COURSE_PROPOSAL_MODEL));
64
65
66 documentTool = new DocumentTool(LUUIConstants.REF_DOC_RELATION_PROPOSAL_TYPE,CourseSections.DOCUMENTS, getLabel(LUUIConstants.TOOL_DOCUMENTS_LABEL_KEY));
67 documentTool.setModelDefinition((DataModelDefinition)modelDefinition);
68 layout.addMenuItem(sections, documentTool);
69
70
71 List<Enum<?>> excludedViews = new ArrayList<Enum<?>>();
72 excludedViews.add(CourseSections.DOCUMENTS);
73 excludedViews.add(CourseSections.COURSE_REQUISITES);
74 layout.addCommonButton(LUUIConstants.COURSE_SECTIONS, layout.getSaveButton(), excludedViews);
75 layout.addCommonButton(LUUIConstants.COURSE_SECTIONS, layout.getCancelButton(CourseSections.SUMMARY), excludedViews);
76
77
78 summaryConfigurer = GWT.create(CourseRetireSummaryConfigurer.class);
79 summaryConfigurer.init(type, state, groupName,(DataModelDefinition)modelDefinition, stmtTypes, (Controller)layout, COURSE_PROPOSAL_MODEL);
80 layout.addSpecialMenuItem(summaryConfigurer.generateProposalSummarySection(true), "Review and Submit");
81
82
83
84 layout.addButtonForView(CourseSections.DOCUMENTS, getContinueButton(layout));
85 } else {
86 summaryConfigurer = GWT.create(CourseRetireSummaryConfigurer.class);
87 summaryConfigurer.init(type, state, groupName,(DataModelDefinition)modelDefinition, stmtTypes, (Controller)layout, COURSE_PROPOSAL_MODEL);
88 layout.removeMenuNavigation();
89 layout.addView(summaryConfigurer.generateProposalSummarySection(false));
90 }
91
92
93 layout.addContentWidget(layout.getWfUtilities().getProposalStatusLabel());
94
95
96 final CommentTool commentTool = new CommentTool(CourseSections.COMMENTS, getLabel(LUUIConstants.TOOL_COMMENTS_LABEL_KEY), "kuali.comment.type.generalRemarks", "Proposal Comments");
97 commentTool.setController(layout);
98
99 layout.addContentWidget(new KSButton("Comments", ButtonStyle.DEFAULT_ANCHOR, new ClickHandler() {
100
101 @Override
102 public void onClick(ClickEvent event) {
103 commentTool.show();
104 }
105 }));
106
107
108 final DecisionPanel decisionPanel = new DecisionPanel(CourseSections.DECISIONS, getLabel(LUUIConstants.TOOL_DECISION_LABEL_KEY), "kuali.comment.type.generalRemarks");
109 layout.addView(decisionPanel);
110 layout.addContentWidget(new KSButton("Decisions", ButtonStyle.DEFAULT_ANCHOR, new ClickHandler() {
111
112 @Override
113 public void onClick(ClickEvent event) {
114 decisionPanel.show();
115 }
116 }));
117 }
118
119 protected Section generateRetirementInfoSection(Section section) {
120 FieldDescriptor fd = addField(section, PROPOSAL_PATH + "/" + PREV_START_TERM, generateMessageInfo(LUUIConstants.PROPOSAL_PREV_START_TERM));
121 fd.getFieldWidget().setVisible(false);
122 fd.hideLabel();
123
124 addField(section, PROPOSAL_TITLE_PATH, generateMessageInfo(LUUIConstants.PROPOSED_PROPOSAL_TITLE_LABEL_KEY));
125 addField(section, PROPOSAL_PATH + "/" + PROPOSED_RATIONALE + "/" + RichTextInfoConstants.PLAIN, generateMessageInfo(LUUIConstants.RETIREMENT_RATIONALE_LABEL_KEY),
126 new KSCharCount(modelDefinition.getMetadata(QueryPath.parse(PROPOSAL_PATH + "/" + PROPOSED_RATIONALE+ "/" + RichTextInfoConstants.PLAIN))));
127 addReadOnlyField(section, COURSE + "/" + START_TERM, generateMessageInfo(LUUIConstants.START_TERM_LABEL_KEY));
128 addField(section, PROPOSAL_PATH + "/" + PROPOSED_END_TERM, generateMessageInfo(LUUIConstants.PROPOSED_END_TERM_LABEL_KEY));
129 addField(section, PROPOSAL_PATH + "/" + PROPOSED_LAST_TERM_OFFERED, generateMessageInfo(LUUIConstants.PROPOSED_LAST_TERM_OFFERED_LABEL_KEY));
130 addField(section, PROPOSAL_PATH + "/" + PROPOSED_LAST_COURSE_CATALOG_YEAR, generateMessageInfo(LUUIConstants.PROPOSED_LAST_COURSE_CATALOG_YEAR_LABEL_KEY));
131 addField(section, PROPOSAL_PATH + "/" + OTHER_COMMENTS, generateMessageInfo(LUUIConstants.OTHER_COMMENTS_LABEL_KEY));
132
133 return section;
134 }
135
136 }