parent
7b6976f823
commit
568bed6f9b
@ -0,0 +1,51 @@
|
||||
package info.bukova.isspst.ui;
|
||||
|
||||
import org.zkoss.bind.annotation.Command;
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
import org.zkoss.zul.Window;
|
||||
|
||||
public class MainMenu
|
||||
{
|
||||
private String contextPath;
|
||||
|
||||
private String moduleUrl;
|
||||
|
||||
@Init
|
||||
public void init()
|
||||
{
|
||||
this.contextPath = Executions.getCurrent().getContextPath();
|
||||
this.moduleUrl = Executions.getCurrent().getDesktop().getRequestPath();
|
||||
}
|
||||
|
||||
public String getContextPath()
|
||||
{
|
||||
return this.contextPath;
|
||||
}
|
||||
|
||||
public String getModuleUrl()
|
||||
{
|
||||
return this.moduleUrl;
|
||||
}
|
||||
|
||||
@Command
|
||||
public void passwd()
|
||||
{
|
||||
Window window = (Window) Executions.createComponents("/app/passwd.zul", null, null);
|
||||
window.doModal();
|
||||
}
|
||||
|
||||
@Command
|
||||
public void numSeries()
|
||||
{
|
||||
Window window = (Window) Executions.createComponents("/settings/numberSeries.zul", null, null);
|
||||
window.doModal();
|
||||
}
|
||||
|
||||
@Command
|
||||
public void globalSettings()
|
||||
{
|
||||
Window window = (Window) Executions.createComponents("/settings/globalSettings.zul", null, null);
|
||||
window.doModal();
|
||||
}
|
||||
}
|
@ -1,72 +0,0 @@
|
||||
package info.bukova.isspst.ui;
|
||||
|
||||
import org.zkoss.bind.annotation.Command;
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
import org.zkoss.zul.Window;
|
||||
|
||||
public class NavigationVM {
|
||||
|
||||
private String contextPath;
|
||||
private String moduleUrl;
|
||||
|
||||
@Init
|
||||
public void init() {
|
||||
contextPath = Executions.getCurrent().getContextPath();
|
||||
moduleUrl = Executions.getCurrent().getDesktop().getRequestPath();
|
||||
}
|
||||
|
||||
@Command
|
||||
public void passwd() {
|
||||
Window window = (Window)Executions.createComponents("/app/passwd.zul", null, null);
|
||||
window.doModal();
|
||||
}
|
||||
|
||||
@Command
|
||||
public void numSeries() {
|
||||
Window window = (Window)Executions.createComponents("/settings/numberSeries.zul", null, null);
|
||||
window.doModal();
|
||||
}
|
||||
|
||||
@Command
|
||||
public void globalSettings() {
|
||||
Window window = (Window)Executions.createComponents("/settings/globalSettings.zul", null, null);
|
||||
window.doModal();
|
||||
}
|
||||
|
||||
public String getContextPath() {
|
||||
return contextPath;
|
||||
}
|
||||
|
||||
public String getModuleUrl() {
|
||||
return moduleUrl;
|
||||
}
|
||||
|
||||
public boolean isOrders() {
|
||||
return moduleUrl.contains("orders");
|
||||
}
|
||||
|
||||
public boolean isTrips() {
|
||||
return moduleUrl.contains("trips");
|
||||
}
|
||||
|
||||
public boolean isSettings() {
|
||||
return moduleUrl.contains("settings");
|
||||
}
|
||||
|
||||
public boolean isAdmin() {
|
||||
return moduleUrl.contains("admin");
|
||||
}
|
||||
|
||||
public boolean isUser() {
|
||||
return moduleUrl.contains("passwd");
|
||||
}
|
||||
|
||||
public boolean isLists() {
|
||||
return moduleUrl.contains("lists");
|
||||
}
|
||||
|
||||
public boolean isRequirements() {
|
||||
return moduleUrl.contains("requirements");
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
<?page title="Main Menu" contentType="text/html;charset=UTF-8"?>
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<?taglib uri="/WEB-INF/security.tld" prefix="sec"?>
|
||||
<zk xmlns:n="native">
|
||||
<menubar
|
||||
id="menubar"
|
||||
apply="org.zkoss.bind.BindComposer"
|
||||
viewModel="@id('vm') @init('info.bukova.isspst.ui.MainMenu')"
|
||||
autodrop="true">
|
||||
<menuitem
|
||||
label="${labels.Information}"
|
||||
href="/" />
|
||||
<menuseparator />
|
||||
<menuitem
|
||||
label="${labels.Requirements}"
|
||||
href="/requirements/actual" />
|
||||
<!-- menuitem
|
||||
label="${labels.Orders}"
|
||||
href="/orders/actual" /-->
|
||||
<menuitem
|
||||
label="${labels.BussinessTrips}"
|
||||
href="/trips/requirement" />
|
||||
<menuseparator />
|
||||
<menu label="${labels.Lists}">
|
||||
<menupopup>
|
||||
<menuitem
|
||||
label="${labels.AgendaMaterial}"
|
||||
href="/lists/material"
|
||||
disabled="${not sec:isAllGranted('PERM_READ_MATERIAL')}" />
|
||||
<menuitem
|
||||
label="${labels.AgendaServices}"
|
||||
href="/lists/service"
|
||||
disabled="${not sec:isAllGranted('PERM_READ_SERVICES')}" />
|
||||
<menuitem
|
||||
label="${labels.AgendaSuppliers}"
|
||||
href="/lists/addressbook"
|
||||
disabled="${not sec:isAllGranted('PERM_READ_ADDRESSBOOK')}" />
|
||||
<menuitem
|
||||
label="${labels.AgendaBuildings}"
|
||||
href="/lists/buildings"
|
||||
disabled="${not sec:isAllGranted('PERM_READ_BUILDINGS')}" />
|
||||
<menuitem
|
||||
label="${labels.AgendaMUnits}"
|
||||
href="/lists/munits"
|
||||
disabled="${not sec:isAllGranted('PERM_READ_MUNITS')}" />
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu label="${labels.Settings}">
|
||||
<menupopup>
|
||||
<menuitem
|
||||
label="${labels.GlobalSettings}…"
|
||||
onClick="@command('globalSettings')" />
|
||||
<menuitem
|
||||
label="${labels.AgendaWorkflow}"
|
||||
href="/settings/workflow"
|
||||
disabled="${not sec:isAllGranted('PERM_EDIT_WORKFLOW')}" />
|
||||
<menuitem
|
||||
label="${labels.NumberSeries}…"
|
||||
onClick="@command('numSeries')" />
|
||||
<menu label="${labels.Administration}">
|
||||
<menupopup>
|
||||
<menuitem
|
||||
label="${labels.AgendaUsers}"
|
||||
href="/admin/users"
|
||||
disabled="${not sec:isAllGranted('PERM_READ_USERS')}" />
|
||||
<menuitem
|
||||
label="${labels.Permissions}"
|
||||
href="/admin/permissions"
|
||||
disabled="${not sec:isAllGranted('PERM_READ_PERMISSIONS')}" />
|
||||
<menuitem
|
||||
label="${labels.AgendaWorkgroups}"
|
||||
href="/admin/workgroups"
|
||||
disabled="${not sec:isAllGranted('PERM_READ_WORKGROUPS')}" />
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu label="${labels.User}">
|
||||
<menupopup>
|
||||
<menuitem
|
||||
label="${labels.ChangePassword}…"
|
||||
onClick="@command('passwd')" />
|
||||
<menuitem
|
||||
label="${labels.Logout}"
|
||||
href="/j_spring_security_logout" />
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menubar>
|
||||
</zk>
|
@ -1,70 +0,0 @@
|
||||
<?page title="menu" contentType="text/html;charset=UTF-8"?>
|
||||
<zk xmlns:n="native">
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<?taglib uri="/WEB-INF/security.tld" prefix="sec"?>
|
||||
|
||||
<tabbox mold="accordion" apply="org.zkoss.bind.BindComposer"
|
||||
viewModel="@id('vm') @init('info.bukova.isspst.ui.NavigationVM')">
|
||||
<tabs>
|
||||
<tab id="requirements" label="${labels.MenuRequirements}" selected="@load(vm.requirements)"/>
|
||||
<tab id="orders" label="${labels.MenuOrders}" selected="@load(vm.orders)"/>
|
||||
<tab id="trips" label="Služební cesty" selected="@load(vm.trips)"/>
|
||||
<tab id="lists" label="${labels.MenuLists}" selected="@load(vm.lists)"/>
|
||||
<tab id="settings" label="${labels.MenuSettings}" selected="@load(vm.settings)"/>
|
||||
<tab id="admin" label="${labels.MenuAdministration}" selected="@load(vm.admin)"/>
|
||||
<tab id="user" label="${labels.MenuUser}" selected="@load(vm.user)"/>
|
||||
</tabs>
|
||||
<tabpanels hflex="1">
|
||||
<tabpanel>
|
||||
<menubar orient="vertical">
|
||||
<menuitem label="${labels.AgendaActRequirements}" href="/requirements/actual" />
|
||||
<menuitem label="${labels.AgendaRequirementsHistory}" href="/requirements/history" />
|
||||
</menubar>
|
||||
</tabpanel>
|
||||
<tabpanel>
|
||||
<menubar orient="vertical">
|
||||
<menuitem label="${labels.AgendaMyOrders}" href="/orders/actual" />
|
||||
<menuitem label="${labels.AgendaOrdersHistory}" href="/orders/history" />
|
||||
</menubar>
|
||||
</tabpanel>
|
||||
<tabpanel>
|
||||
<menubar orient="vertical">
|
||||
<menuitem label="Požadavky" href="/trips/requirement" />
|
||||
<menuitem label="${labels.AgendaOrdersHistory}"/>
|
||||
</menubar>
|
||||
</tabpanel>
|
||||
<tabpanel>
|
||||
<menubar orient="vertical">
|
||||
<menuitem label="${labels.AgendaSuppliers}" href="/lists/addressbook" disabled="${not sec:isAllGranted('PERM_READ_ADDRESSBOOK')}"/>
|
||||
<menuitem label="${labels.AgendaMaterial}" href="/lists/material" disabled="${not sec:isAllGranted('PERM_READ_MATERIAL')}"/>
|
||||
<menuitem label="${labels.AgendaServices}" href="/lists/service" disabled="${not sec:isAllGranted('PERM_READ_SERVICES')}"/>
|
||||
<menuitem label="${labels.AgendaMUnits}" href="/lists/munits" disabled="${not sec:isAllGranted('PERM_READ_MUNITS')}" width="120px"/>
|
||||
<menuitem label="${labels.AgendaBuildings}" href="/lists/buildings" disabled="${not sec:isAllGranted('PERM_READ_BUILDINGS')}" />
|
||||
<!-- <menuitem label="${labels.AgendaRooms}" href="/lists/rooms" disabled="${not sec:isAllGranted('PERM_READ_ROOMS')}" /> -->
|
||||
</menubar>
|
||||
</tabpanel>
|
||||
<tabpanel>
|
||||
<menubar orient="vertical">
|
||||
<menuitem label="${labels.AgendaWorkflow}" href="/settings/workflow" disabled="${not sec:isAllGranted('PERM_EDIT_WORKFLOW')}"/>
|
||||
<menuitem label="Číselné řady" onClick="@command('numSeries')"/>
|
||||
<menuitem label="Limity částek"/>
|
||||
<menuitem label="${labels.GlobalSettings}" onClick="@command('globalSettings')"/>
|
||||
</menubar>
|
||||
</tabpanel>
|
||||
<tabpanel>
|
||||
<menubar orient="vertical">
|
||||
<menuitem label="${labels.AgendaUsers}" href="/admin/users" disabled="${not sec:isAllGranted('PERM_READ_USERS')}" width="120px"/>
|
||||
<menuitem label="Práva" href="/admin/permissions" disabled="${not sec:isAllGranted('PERM_READ_PERMISSIONS')}"/>
|
||||
<menuitem label="${labels.AgendaWorkgroups}" href="/admin/workgroups" disabled="${not sec:isAllGranted('PERM_READ_WORKGROUPS')}"/>
|
||||
</menubar>
|
||||
</tabpanel>
|
||||
<tabpanel>
|
||||
<menubar orient="vertical">
|
||||
<menuitem label="Změnit heslo" width="120px" onClick="@command('passwd')"/>
|
||||
<menuitem label="Odhlásit" href="/j_spring_security_logout"/>
|
||||
</menubar>
|
||||
</tabpanel>
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
|
||||
</zk>
|
Loading…
Reference in New Issue