1 package org.turro.crm.zul.menu;
4 import java.util.HashMap;
5 import org.turro.annotation.ExternalMenu;
6 import org.turro.crm.entity.Customer;
7 import org.turro.crm.entity.SaleProspect;
8 import org.turro.crm.entity.Vendor;
9 import org.turro.menu.ElephantMenu;
10 import static org.turro.menu.ElephantMenu.showZulFile;
11 import org.turro.menu.ElephantMenuBar;
12 import org.turro.security.Permission;
13 import org.zkoss.zk.ui.event.Event;
14 import org.zkoss.zk.ui.event.EventListener;
25 bar.
addMenu(
"Commercial",
Permission.
from(
"sale-action",
"sale-prospect",
"campaign",
"customer",
"vendor"))
39 .
addMenuitem(
"New campaign",
"campaign_new", (EventListener) (Event event) -> {
42 .addMenuitem(
"New sale prospect",
"sale_new", (EventListener) (Event event) -> {
45 .addMenuitem(
"New customer",
"customer_new", (EventListener) (Event event) -> {
48 .addMenuitem(
"New vendor",
"vendor_new", (EventListener) (Event event) -> {
54 showEntity(
id,
"customerId",
"Customer",
"/crm/customer.zul");
58 showEntity(
id,
"vendorId",
"Vendor",
"/crm/vendor.zul");
62 showEntity(
id,
"campaignId",
"Campaign",
"/crm/campaign.zul");
66 showEntity(
id,
"saleProspectId",
"Sale prospect",
"/crm/saleprospect.zul");
74 HashMap<String, Object> map =
new HashMap<String, Object>();
75 map.put(
"vendor", vendor);
76 map.put(
"salep", saleProspect);
77 map.put(
"from", from);
79 showZulFile(
"Sale actions",
"/crm/saleactions.zul", map);
83 HashMap<String, Object> map =
new HashMap<String, Object>();
84 map.put(
"vendor", vendor);
85 map.put(
"saleProspect", saleProspect);
86 map.put(
"customer", customer);
static Permission from(String... roles)