18 package org.turro.dossier.zul.menu;
20 import java.util.HashMap;
22 import org.turro.annotation.ExternalMenu;
23 import org.turro.command.Command;
24 import org.turro.dossier.db.DossierPU;
25 import org.turro.dossier.entity.Dossier;
26 import org.turro.dossier.entity.DossierType;
27 import org.turro.dossier.entity.Issue;
28 import org.turro.dossier.entity.IssuePredecessorType;
29 import org.turro.dossier.task.Subtask;
30 import org.turro.dossier.task.SubtaskTypeSelection;
31 import org.turro.entities.EntityCombobox;
32 import org.turro.i18n.I_;
33 import org.turro.jpa.Dao;
34 import org.turro.menu.ElephantMenu;
35 import org.turro.menu.ElephantMenuBar;
36 import org.turro.security.Permission;
37 import org.turro.zkoss.dialog.DialogField;
38 import org.turro.zkoss.dialog.Dialogs;
39 import org.turro.zul.frame.Framework;
40 import org.zkoss.zk.ui.event.Event;
41 import org.zkoss.zk.ui.event.EventListener;
55 .
addMenuitem(
"Knowledge base",
"kbase",
"/issue/knowledgeBase.zul",
true)
64 .
addMenuitem(
"Workload",
"piechart",
"/dossier/workload.zul")
69 .
addMenuitem(
"Pending to register", (EventListener) (Event event) -> {
71 frame.getDesktop().removeAttribute(
"dossierId");
75 .
addMenuitem(
"New Dossier",
"dossier_new", (EventListener) (Event event) -> {
78 .
addMenuitem(
"New Issue",
"issue_new", (EventListener) (Event event) -> {
81 .addToolbarSeparator(
true);
85 HashMap<String, Object> map =
new HashMap<>();
86 map.put(
"dossierGenerated", dossier);
88 showEntity(dossier.
getId(),
"dossierId",
"Project",
"/dossier/project.zul");
90 showEntity(dossier.
getId(),
"dossierId",
"Dossier",
"/dossier/dossier.zul", map);
97 showEntity(
id,
"dossierId",
"Project",
"/dossier/project.zul");
99 showEntity(
id,
"dossierId",
"Dossier",
"/dossier/dossier.zul");
104 showEntity(
id,
"dossierId",
"Activity",
"/dossier/activity.zul");
114 showEntity(
id,
"issueId",
"Issue",
"/issue/issue.zul");
122 showEntity(
id,
"projectGrantId",
"Project grant",
"/dossier/projectGrant.zul",
null);
126 showZulFile(
"My dossiers",
"/dossier/dossiers.zul");
145 Map.of(
"issue", nissue,
"subtask", subtask), command);
147 }).emptyCancel().
show();
163 if(type !=
null && rissue !=
null) {
167 }).emptyCancel().
show();
171 HashMap<String, Object> map =
new HashMap<>();
177 HashMap<String, Object> map =
new HashMap<>();
180 map.put(
"issue", issue);
185 showZulFile(
"Pending petitions",
"/dossier/pendingPetitions.zul");
189 if(
id ==
null ||
id == 0) {
192 Dao dao =
new DossierPU();
193 return (DossierType) dao.getSingleResultOrNull(
194 "select d.type from Dossier d where d.id = ?",
static Issue getDefaultIssue()
void setDossier(Dossier dossier)
IssuePredecessor save(Dao dao, Issue task)
void setRoot(String root)
static String get(String msg)
static Permission from(String... roles)
static DialogField field(String label)
Dialogs width(String width)
Dialogs height(String height)
Dialogs onOk(Consumer< Dialogs > onOk)
static Dialogs title(String title)
Dialogs addField(DialogField field)
void addContent(String label, String src)
static Framework getCurrent()