45 RoleMap rm =
new RoleMap(Application.getApplication());
46 if(rm.containsKey(
"erp-purchase,erp-sales")) {
48 Menu m = bar.addMenu(Application.getString(
"lSupplyChain"));
49 Menupopup mp = bar.addMenupopup(m);
51 if(rm.get(
"erp-purchase:new")) {
52 Menu mm = bar.addMenu(mp, Application.getString(
"lPurchase"));
53 Menupopup mip = bar.addMenupopup(mm);
54 bar.addMenuitem(mip, Application.getString(
"lOrders"),
"/_zul/images/orders.png",
"/WEB-INF/_zul/erp/purchase/orders.zul",
false);
55 bar.addMenuitem(mip, Application.getString(
"lHoursOrder"),
null,
"/WEB-INF/_zul/erp/purchase/hoursOrder.zul",
false);
56 bar.addMenuitem(mip, Application.getString(
"lProductsOrder"),
null,
"/WEB-INF/_zul/erp/purchase/productsOrder.zul",
false);
57 bar.addMenuSeparator(mp);
58 bar.addMenuitem(mip, Application.getString(
"lReceipts"),
"/_zul/images/receipts.png",
"/WEB-INF/_zul/erp/purchase/receipts.zul",
false);
59 bar.addMenuitem(mip, Application.getString(
"lHoursReceipt"),
null,
"/WEB-INF/_zul/erp/purchase/hoursReceipt.zul",
false);
60 bar.addMenuitem(mip, Application.getString(
"lProductsReceipt"),
null,
"/WEB-INF/_zul/erp/purchase/productsReceipt.zul",
false);
63 if(rm.get(
"erp-sales:new")) {
64 Menu mm = bar.addMenu(mp, Application.getString(
"lSales"));
65 Menupopup mip = bar.addMenupopup(mm);
66 bar.addMenuitem(mip, Application.getString(
"lCustomerOrders"),
"/_zul/images/orders.png",
"/WEB-INF/_zul/erp/sales/orders.zul",
false);
67 bar.addMenuitem(mip, Application.getString(
"lNewCustomerOrder"),
"/_zul/images/order_new.png",
new EventListener() {
69 public void onEvent(Event event)
throws Exception {
75 if(rm.containsKey(
"erp-workorder,erp-task,erp-reference")) {
77 Menu m = bar.addMenu(Application.getString(
"lManufacturing"));
78 Menupopup mp = bar.addMenupopup(m);
79 if(rm.get(
"erp-task:list")) {
80 bar.addMenuitem(mp, Application.getString(
"lPendingTasks"),
"/_zul/images/task_pending.png",
"/WEB-INF/_zul/erp/task/pendingTasks.zul",
true);
81 bar.addMenuitem(mp, Application.getString(
"lWorkload"),
"/_zul/images/workload.png",
"/WEB-INF/_zul/erp/task/workloads.zul",
true);
83 bar.addMenuitem(mp, Application.getString(
"lTimeControl"),
null,
"/WEB-INF/_zul/erp/resource/timeControl.zul",
false);
84 if(rm.get(
"erp-workorder:list") || rm.get(
"erp-reference:list") || rm.get(
"erp-task:list")) {
85 Menu mm = bar.addMenu(mp, Application.getString(
"lWorkOrders"));
86 Menupopup mip = bar.addMenupopup(mm);
87 if(rm.get(
"erp-workorder:list")) {
88 bar.addMenuitem(mip, Application.getString(
"lWorkOrders"),
"/_zul/images/workorder.png",
"/WEB-INF/_zul/erp/workorder/workorders.zul",
true);
90 if(rm.get(
"erp-task:list")) {
91 bar.addMenuitem(mip, Application.getString(
"lTasks"),
"/_zul/images/task.png",
"/WEB-INF/_zul/erp/task/tasks.zul",
false);
93 bar.addToolbarSeparator(
true);
94 bar.addMenuSeparator(mip);
95 if(rm.get(
"erp-workorder:new")) {
96 bar.addMenuitem(mip, Application.getString(
"lNewWorkOrder"),
"/_zul/images/workorder_new.png",
new EventListener() {
98 public void onEvent(Event event)
throws Exception {
99 showModalZulFile(
"lNewWorkOrder",
"/WEB-INF/_zul/erp/workorder/newWorkorder.zul",
null);
103 if(rm.get(
"erp-workorder:new")) {
104 bar.addMenuitem(mip, Application.getString(
"lNewProductOrder"),
"/_zul/images/productorder_new.png",
new EventListener() {
106 public void onEvent(Event event)
throws Exception {
107 showModalZulFile(
"lNewProductOrder",
"/WEB-INF/_zul/erp/workorder/newProductorder.zul",
null);
111 bar.addToolbarSeparator(
true);
113 if(rm.get(
"erp-config:list")) {
114 Menu mm = bar.addMenu(mp, Application.getString(
"lConfiguration"));
115 Menupopup mip = bar.addMenupopup(mm);
116 bar.addMenuitem(mip, Application.getString(
"lHumanResources"),
"/_zul/images/operator.png",
"/WEB-INF/_zul/erp/config/humanResources.zul");
117 bar.addMenuitem(mip, Application.getString(
"lAptitudes"),
"/_zul/images/aptitude.png",
"/WEB-INF/_zul/erp/config/aptitudes.zul");
118 bar.addMenuitem(mip, Application.getString(
"lResources"),
"/_zul/images/resource.png",
"/WEB-INF/_zul/erp/config/resources.zul");