Merge branch 'master' of https://git.bukova.info/repos/git/isspst
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
package info.bukova.isspst.services.requirement;
|
||||
|
||||
import info.bukova.isspst.Constants;
|
||||
import info.bukova.isspst.data.Requirement;
|
||||
import info.bukova.isspst.data.RequirementState;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -11,11 +14,16 @@ public class RequirementServiceImpl extends
|
||||
RequirementBaseServiceImpl<Requirement> implements RequirementService,
|
||||
RequirementBaseService<Requirement> {
|
||||
|
||||
@Autowired
|
||||
private RequirementTypeService reqTypeService;
|
||||
|
||||
@Override
|
||||
protected Requirement createEntity() {
|
||||
Requirement entity = new Requirement();
|
||||
|
||||
entity.setReqDate(new Date());
|
||||
entity.setType(reqTypeService.getTypeById(Constants.REQTYPE_ORDER));
|
||||
entity.setState(RequirementState.NEW);
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
@@ -9,22 +9,21 @@ import org.zkoss.bind.annotation.NotifyChange;
|
||||
|
||||
public class RequirementSubpage<T extends RequirementBase> extends ListViewModel<T> {
|
||||
|
||||
protected RequirementBaseService<T> reqService;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void init() {
|
||||
reqService = (RequirementBaseService<T>) service;
|
||||
private RequirementBaseService<T> getReqService()
|
||||
{
|
||||
return (RequirementBaseService<T>) service;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadLazyData(T data) {
|
||||
reqService.loadAuthItems(data);
|
||||
this.getReqService().loadAuthItems(data);
|
||||
}
|
||||
|
||||
@Command
|
||||
@NotifyChange({"dataBean", "canApprove"})
|
||||
public void approve() {
|
||||
reqService.approve(getDataBean());
|
||||
this.getReqService().approve(getDataBean());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -35,11 +34,9 @@ public class RequirementSubpage<T extends RequirementBase> extends ListViewModel
|
||||
|
||||
public boolean isCanApprove() {
|
||||
if (getDataBean() != null) {
|
||||
return reqService.canApprove(getDataBean());
|
||||
return this.getReqService().canApprove(getDataBean());
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ public class TripRequirementListAll extends RequirementSubpage<TripRequirement>
|
||||
|
||||
allCentres = workgroupService.getCentres();
|
||||
allWorkgroups = workgroupService.getWorkgroups();
|
||||
super.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -33,7 +33,6 @@ public class TripRequirementListCentre extends RequirementSubpage<TripRequiremen
|
||||
dataFilter = new TripRequirementFilter(getFilterTemplate());
|
||||
|
||||
myCentres = workgroupService.getUserCentres(userService.getCurrent());
|
||||
super.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,7 +35,6 @@ public class TripRequirementListWorkgroup extends RequirementSubpage<TripRequire
|
||||
|
||||
myCentres = workgroupService.getUserCentres(userService.getCurrent());
|
||||
myWorkgroups = workgroupService.getUserWorkgroups(userService.getCurrent());
|
||||
super.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user