19 package org.turro.dossier.command;
21 import java.util.Collection;
22 import org.turro.annotation.ElephantPlugin;
23 import org.turro.dossier.db.DossierPU;
24 import org.turro.dossier.entity.Dossier;
25 import org.turro.dossier.search.DossierResults;
26 import org.turro.dossier.zul.menu.DossierMenu;
27 import org.turro.elephant.context.Application;
28 import org.turro.elephant.util.Images;
29 import org.turro.i18n.I_;
30 import org.turro.jpa.Dao;
31 import org.turro.plugin.command.SelfSummaryPlugin;
32 import org.turro.zkoss.label.LabelTypes;
33 import org.turro.zkoss.layout.GroupboxArrow;
34 import org.zkoss.zk.ui.event.Event;
35 import org.zkoss.zk.ui.event.EventListener;
36 import org.zkoss.zk.ui.event.Events;
37 import org.zkoss.zul.Button;
38 import org.zkoss.zul.Hlayout;
39 import org.zkoss.zul.Image;
40 import org.zkoss.zul.Include;
41 import org.zkoss.zul.Space;
50 private Collection<Dossier> dossiers;
57 if(!dossiers.isEmpty()) {
60 protected void doFillContent() {
61 Include report =
new Include(
"/WEB-INF/_zul/dossier/dossierSummary.zul");
65 Hlayout hbox =
new Hlayout();
67 hbox.setSclass(
"z-valign-middle");
68 hbox.setValign(
"middle");
72 hbox.appendChild(
new Space());
73 Button visit =
new Button(
I_.
get(
"My dossiers"));
74 visit.addEventListener(Events.ON_CLICK,
new EventListener<Event>() {
76 public void onEvent(Event event) throws Exception {
77 DossierMenu.showMyDossiers();
80 hbox.appendChild(visit);
81 if(app.
isInRole(
"dossier:participants")) {
83 Button pending =
new Button(
I_.
get(
"Pending to accept"));
84 pending.addEventListener(Events.ON_CLICK,
new EventListener<Event>() {
86 public void onEvent(Event event) throws Exception {
87 DossierMenu.showPending();
90 hbox.appendChild(pending);
99 private void openDossiers() {
100 DossierResults ir =
new DossierResults();
101 dossiers = ir.getDossierList();
104 private long pending() {
105 Dao dao =
new DossierPU();
106 Long count = (Long) dao.getSingleResultOrNull(
107 "select count(a) from ParticipantRequest as a");
108 count += (Long) dao.getSingleResultOrNull(
109 "select count(a) from CategoryRequest as a");
Object addResult(String key, Object value)
boolean isInRole(String role)
static Application getApplication()
static String getImage(String image)
static String get(String msg)
static Label getPreLabel(String value)
static Label getSoftLabel(String value)
void setCaption(Component comp)