19 package org.turro.dossier.zul.issue;
21 import org.turro.dossier.db.DossierPU;
22 import org.turro.dossier.entity.Dossier;
23 import org.turro.dossier.entity.Issue;
24 import org.turro.dossier.entity.IssueStatus;
25 import org.turro.dossier.search.DossierResults;
26 import org.turro.elephant.util.DateFormats;
27 import org.turro.elephant.util.Images;
28 import org.turro.i18n.I_;
29 import org.turro.voteit.MyVote;
30 import org.turro.voteit.VoteItUtil;
31 import org.turro.zkoss.grid.GroupExtended;
32 import org.turro.zkoss.grid.PagingGrid;
33 import org.zkoss.zk.ui.Component;
34 import org.zkoss.zk.ui.ext.AfterCompose;
35 import org.zkoss.zul.Column;
36 import org.zkoss.zul.Columns;
37 import org.zkoss.zul.Group;
38 import org.zkoss.zul.Hlayout;
39 import org.zkoss.zul.Image;
40 import org.zkoss.zul.Label;
41 import org.zkoss.zul.Row;
53 private void addColumns() {
54 Columns cols =
new Columns();
55 cols.setSizable(
true);
56 cols.setMenupopup(
"auto");
59 Column col =
new Column(
"#");
60 col.setWidth(
"150px");
61 cols.appendChild(col);
62 col =
new Column(
I_.
get(
"Creation"));
63 col.setWidth(
"150px");
64 cols.appendChild(col);
65 col =
new Column(
I_.
get(
"My vote"));
66 col.setWidth(
"200px");
67 cols.appendChild(col);
68 col =
new Column(
I_.
get(
"Description"));
69 cols.appendChild(col);
72 private void addRows() {
73 DossierResults dossierResults =
new DossierResults();
74 for(Dossier dossier : dossierResults.getDossierList()) {
75 if(dossier.getFullParticipants().isVoteParticipant(dossierResults.getByParticipant())) {
76 boolean groupCreated =
false;
77 for(Issue issue : dossier.getOpenIssues()) {
82 MyVote myVote = VoteItUtil.myVote(DossierPU.getObjectPath(issue), dossierResults.getByParticipant());
85 row.setSclass(
"draft");
87 row.appendChild(
new Label(
"#" + issue.getId()));
88 row.appendChild(
new Label(DateFormats.format(issue.getIssueDate(),
true)));
89 row.appendChild(getComponent(myVote, issue));
90 row.appendChild(
new IssueLabel(issue));
97 private void createGroup(Dossier dossier) {
98 Group group =
new GroupExtended(dossier.getFullDescription());
100 getRows(
true).appendChild(group);
108 private Component getComponent(
MyVote myVote,
Issue issue) {
109 Hlayout hbox =
new Hlayout();
113 }
else if(myVote.
getVote() == -1) {
114 hbox.appendChild(
new Image(Images.getImage(
"cancel")));
117 if(issue.
getStatus().equals(IssueStatus.STATUS_REUNION)) {
118 hbox.appendChild(
new Image(Images.getImage(
"contacts")));
static String getImage(String image)
static String get(String msg)
Rows getRows(boolean create)