19 package org.turro.publication.command;
21 import org.turro.annotation.ElephantPlugin;
22 import org.turro.commentit.CommentItUtil;
23 import org.turro.elephant.context.Application;
24 import org.turro.elephant.util.Images;
25 import org.turro.i18n.I_;
26 import org.turro.plugin.command.SelfSummaryPlugin;
27 import org.turro.publication.db.PublicationPU;
28 import org.turro.publication.zul.menu.PublicationMenu;
29 import org.turro.publication.zul.www.PublicationChart;
30 import org.turro.zkoss.label.LabelTypes;
31 import org.turro.zkoss.layout.GroupboxArrow;
32 import org.zkoss.zk.ui.event.Event;
33 import org.zkoss.zk.ui.event.EventListener;
34 import org.zkoss.zk.ui.event.Events;
35 import org.zkoss.zul.Button;
36 import org.zkoss.zul.Hlayout;
37 import org.zkoss.zul.Image;
38 import org.zkoss.zul.Space;
50 if(app.
isInRole(
"publication:accept")) {
51 int pubs = pendingPublications(),
53 if(pubs > 0 || coms > 0) {
56 protected void doFillContent() {
60 Hlayout hbox =
new Hlayout();
62 hbox.setSclass(
"z-valign-middle");
63 hbox.setValign(
"middle");
67 hbox.appendChild(
new Space());
70 hbox.appendChild(
new Space());
71 Button visit =
new Button(
I_.
get(
"Pending to accept"));
72 visit.addEventListener(Events.ON_CLICK,
new EventListener<Event>() {
74 public void onEvent(Event event) throws Exception {
75 PublicationMenu.showPending();
78 hbox.appendChild(visit);
85 private int pendingPublications() {
86 Number n = (Number)
new PublicationPU().getSingleResult(
87 "select count(p) from Publication as p where accepted = FALSE");
88 return n ==
null ? 0 : n.intValue();
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)