18 package org.turro.dossier.zul.issue;
20 import java.util.List;
21 import org.turro.dossier.issue.IssueWrapper;
22 import org.turro.dossier.search.IssueResults;
23 import org.turro.elephant.context.Application;
24 import org.turro.i18n.I_;
25 import org.turro.zkoss.grid.GroupExtended;
26 import org.turro.zkoss.grid.PagingGrid;
27 import org.zkoss.zul.Column;
28 import org.zkoss.zul.Columns;
29 import org.zkoss.zul.Group;
30 import org.zkoss.zul.Rows;
39 private boolean showDossier =
false;
60 this.showDossier = showDossier;
63 private void addColumns() {
64 Columns cols =
new Columns();
65 cols.setSizable(
true);
66 cols.setMenupopup(
"auto");
69 Column col =
new Column(
"#");
71 cols.appendChild(col);
72 col =
new Column(
I_.
get(
"Description"));
73 cols.appendChild(col);
74 col =
new Column(
I_.
get(
"Creation"));
75 col.setWidth(
"100px");
76 cols.appendChild(col);
77 col =
new Column(
I_.
get(
"Start date"));
78 col.setWidth(
"100px");
79 col.setVisible(
false);
80 cols.appendChild(col);
81 col =
new Column(
I_.
get(
"Delivery"));
82 col.setWidth(
"100px");
83 cols.appendChild(col);
84 col =
new Column(
I_.
get(
"Control"));
85 col.setWidth(
"100px");
86 col.setVisible(
false);
87 cols.appendChild(col);
88 col =
new Column(
I_.
get(
"Status"));
89 col.setWidth(
"130px");
90 cols.appendChild(col);
94 cols.appendChild(col);
98 private void addRows(List<IssueWrapper> issues) {
100 boolean expanded =
true;
106 if(rows !=
null) removeChild(rows);
111 IssueStage stage =
null;
113 for(
final IssueWrapper wissue : issues) {
114 IssueStage current = getStage(wissue, stage);
115 if(!(current.equals(stage))) {
117 createGroup(stage, expanded);
120 IssueRow row =
new IssueRow();
121 row.setValue(wissue);
122 rows.appendChild(row);
128 private void createGroup(IssueStage stage,
boolean expanded) {
129 Group group =
new GroupExtended(I_.byKey(stage.toString()));
130 group.setOpen(expanded);
131 rows.appendChild(group);
134 private IssueStage getStage(IssueWrapper wissue, IssueStage current) {
136 if(wissue.isUnrelated()) {
137 return IssueStage.ISSUE_STAGE_UNRELATED;
140 if(wissue.hasPassedNow()) {
141 return IssueStage.ISSUE_STAGE_DATE_SURPASSED;
144 if(!wissue.hasPassedStartDate() || !wissue.canStartBySources()) {
145 return IssueStage.ISSUE_STAGE_TO_COME;
148 int stage = wissue.getRelevanceOrderByContact();
151 case 1:
return IssueStage.ISSUE_STAGE_TO_DO;
152 case 2:
return IssueStage.ISSUE_STAGE_REUNION;
153 case 5:
return IssueStage.ISSUE_STAGE_FROZEN;
156 return IssueStage.ISSUE_STAGE_TO_MONITOR;
java.util.List< IssueWrapper > getIssueList()
void setIssueResults(IssueResults results)
void setIssueList(List< IssueWrapper > issues)
void setShowDossier(boolean showDossier)
boolean isInRole(String role)
static Application getApplication()
static String get(String msg)
void setRowCount(int rows)