19 package org.turro.dossier.command;
21 import java.util.Collection;
22 import java.util.EnumMap;
24 import org.turro.annotation.ElephantPlugin;
25 import org.turro.dossier.issue.IssueWrapper;
26 import org.turro.dossier.search.IssueResults;
27 import org.turro.dossier.zul.issue.IssueStage;
28 import org.turro.dossier.zul.menu.DossierMenu;
29 import org.turro.elephant.context.Application;
30 import org.turro.elephant.util.Images;
31 import org.turro.i18n.I_;
32 import org.turro.plugin.command.SelfSummaryPlugin;
33 import org.turro.zkoss.label.LabelTypes;
34 import org.turro.zkoss.layout.GridLayout;
35 import org.turro.zkoss.layout.GroupboxArrow;
36 import org.zkoss.zk.ui.event.Event;
37 import org.zkoss.zk.ui.event.EventListener;
38 import org.zkoss.zk.ui.event.Events;
39 import org.zkoss.zul.Button;
40 import org.zkoss.zul.Hlayout;
41 import org.zkoss.zul.Image;
42 import org.zkoss.zul.Space;
51 private Map<IssueStage, Integer> map;
61 protected void doFillContent() {
64 Hlayout hbox =
new Hlayout();
66 hbox.setSclass(
"z-valign-middle");
67 hbox.setValign(
"middle");
72 hbox.appendChild(
new Space());
77 hbox.appendChild(
new Space());
79 Button visit =
new Button(
I_.
get(
"My issues"));
80 visit.addEventListener(Events.ON_CLICK,
new EventListener<Event>() {
82 public void onEvent(Event event) throws Exception {
83 DossierMenu.showMyIssues();
86 hbox.appendChild(visit);
100 private void pendingIssues() {
101 map =
new EnumMap<>(IssueStage.class);
102 IssueResults ir =
new IssueResults();
103 Collection<IssueWrapper> iwl = ir.getIssueList();
104 for(IssueWrapper iw : iwl) {
105 IssueStage is = getStage(iw);
106 Integer i = map.get(is);
116 private IssueStage getStage(IssueWrapper wissue) {
118 if(wissue.isUnrelated()) {
119 return IssueStage.ISSUE_STAGE_UNRELATED;
122 if(wissue.hasPassedNow()) {
123 return IssueStage.ISSUE_STAGE_DATE_SURPASSED;
126 if(!wissue.hasPassedStartDate() || !wissue.canStartBySources()) {
127 return IssueStage.ISSUE_STAGE_TO_COME;
130 int stage = wissue.getRelevanceOrderByContact();
133 case 1:
return IssueStage.ISSUE_STAGE_TO_DO;
134 case 2:
return IssueStage.ISSUE_STAGE_REUNION;
135 case 5:
return IssueStage.ISSUE_STAGE_FROZEN;
138 return IssueStage.ISSUE_STAGE_TO_MONITOR;
Object addResult(String key, Object value)
boolean isInRole(String role)
static Application getApplication()
static String getImage(String image)
static String byKey(String key)
static String get(String msg)
static Label getPreLabel(String value)
static Label getSoftLabel(String value)
GridLayout addCaption(String label)
GridLayout addValue(String value)
void setCaption(Component comp)
ISSUE_STAGE_DATE_SURPASSED