Filtrování požadavků přihlášeného uživatele. Refresh tabů v požadavcích
na služební cesty. refs #108 refs #100
This commit is contained in:
+6
-3
@@ -52,8 +52,9 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripR
|
|||||||
@Transactional
|
@Transactional
|
||||||
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
||||||
public List<TripRequirement> getAll() {
|
public List<TripRequirement> getAll() {
|
||||||
Query q = dao.getQuery("from TripRequirement where ownedBy = :owner");
|
Query q = dao.getQuery("from TripRequirement where ownedBy = :owner and state != :state");
|
||||||
q.setParameter("owner", getLoggedInUser());
|
q.setParameter("owner", getLoggedInUser());
|
||||||
|
q.setParameter("state", RequirementState.APPROVED);
|
||||||
return q.list();
|
return q.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,8 +65,9 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripR
|
|||||||
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_CENTRE_REQ')")
|
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_CENTRE_REQ')")
|
||||||
public List<TripRequirement> getCentreReq() {
|
public List<TripRequirement> getCentreReq() {
|
||||||
List<Workgroup> wgList = workgroupService.getUserCentres(getLoggedInUser());
|
List<Workgroup> wgList = workgroupService.getUserCentres(getLoggedInUser());
|
||||||
Query q = dao.getQuery("select tr from TripRequirement tr join tr.centre c where c in (:wgList)");
|
Query q = dao.getQuery("select tr from TripRequirement tr join tr.centre c where tr.state != :state and c in (:wgList)");
|
||||||
q.setParameterList("wgList", wgList);
|
q.setParameterList("wgList", wgList);
|
||||||
|
q.setParameter("state", RequirementState.APPROVED);
|
||||||
return q.list();
|
return q.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,8 +78,9 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripR
|
|||||||
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_WORKGROUP_REQ')")
|
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_WORKGROUP_REQ')")
|
||||||
public List<TripRequirement> getWorkgroupReq() {
|
public List<TripRequirement> getWorkgroupReq() {
|
||||||
List<Workgroup> wgList = workgroupService.getUserWorkgroups(getLoggedInUser());
|
List<Workgroup> wgList = workgroupService.getUserWorkgroups(getLoggedInUser());
|
||||||
Query q = dao.getQuery("select tr from TripRequirement tr join tr.workgroup w where w in (:wgList)");
|
Query q = dao.getQuery("select tr from TripRequirement tr join tr.workgroup w where tr.state != :state and w in (:wgList)");
|
||||||
q.setParameterList("wgList", wgList);
|
q.setParameterList("wgList", wgList);
|
||||||
|
q.setParameter("state", RequirementState.APPROVED);
|
||||||
return q.list();
|
return q.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -231,6 +231,10 @@ public class ListViewModel<T extends DataModel> {
|
|||||||
if (!newRec && editBean != null) {
|
if (!newRec && editBean != null) {
|
||||||
dataList.set(selIndex, editBean);
|
dataList.set(selIndex, editBean);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (newRec) {
|
||||||
|
BindUtils.postGlobalCommand(null, null, "reloadRelated", null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@GlobalCommand
|
@GlobalCommand
|
||||||
@@ -242,7 +246,7 @@ public class ListViewModel<T extends DataModel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Command
|
@Command
|
||||||
@NotifyChange("selIndex")
|
@NotifyChange({"selIndex", "dataBean"})
|
||||||
public void afterRender() {
|
public void afterRender() {
|
||||||
if (editBean != null && !editBean.isValid()) {
|
if (editBean != null && !editBean.isValid()) {
|
||||||
return;
|
return;
|
||||||
@@ -256,6 +260,10 @@ public class ListViewModel<T extends DataModel> {
|
|||||||
selIndex = dataList.size() - 1;
|
selIndex = dataList.size() - 1;
|
||||||
newRec = false;
|
newRec = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (selIndex > -1) {
|
||||||
|
this.setDataBean(dataList.get(selIndex));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command
|
@Command
|
||||||
@@ -273,6 +281,10 @@ public class ListViewModel<T extends DataModel> {
|
|||||||
return this.selIndex;
|
return this.selIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setSelIndex(int selIndex) {
|
||||||
|
this.selIndex = selIndex;
|
||||||
|
}
|
||||||
|
|
||||||
@Command
|
@Command
|
||||||
@NotifyChange({ "dataList", "fullFill" })
|
@NotifyChange({ "dataList", "fullFill" })
|
||||||
public void fullFill() {
|
public void fullFill() {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import info.bukova.isspst.data.RequirementBase;
|
|||||||
import info.bukova.isspst.services.requirement.RequirementBaseService;
|
import info.bukova.isspst.services.requirement.RequirementBaseService;
|
||||||
import info.bukova.isspst.ui.ListViewModel;
|
import info.bukova.isspst.ui.ListViewModel;
|
||||||
|
|
||||||
|
import org.zkoss.bind.BindUtils;
|
||||||
import org.zkoss.bind.annotation.Command;
|
import org.zkoss.bind.annotation.Command;
|
||||||
import org.zkoss.bind.annotation.NotifyChange;
|
import org.zkoss.bind.annotation.NotifyChange;
|
||||||
|
|
||||||
@@ -24,6 +25,7 @@ public class RequirementSubpage<T extends RequirementBase> extends ListViewModel
|
|||||||
@NotifyChange({"dataBean", "canApprove"})
|
@NotifyChange({"dataBean", "canApprove"})
|
||||||
public void approve() {
|
public void approve() {
|
||||||
this.getReqService().approve(getDataBean());
|
this.getReqService().approve(getDataBean());
|
||||||
|
BindUtils.postGlobalCommand(null, null, "reload", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.springframework.security.access.AccessDeniedException;
|
import org.springframework.security.access.AccessDeniedException;
|
||||||
import org.zkoss.bind.BindUtils;
|
import org.zkoss.bind.BindUtils;
|
||||||
|
import org.zkoss.bind.annotation.GlobalCommand;
|
||||||
import org.zkoss.bind.annotation.Init;
|
import org.zkoss.bind.annotation.Init;
|
||||||
|
import org.zkoss.bind.annotation.NotifyChange;
|
||||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||||
|
|
||||||
public class TripRequirementListAll extends RequirementSubpage<TripRequirement> {
|
public class TripRequirementListAll extends RequirementSubpage<TripRequirement> {
|
||||||
@@ -52,4 +54,10 @@ public class TripRequirementListAll extends RequirementSubpage<TripRequirement>
|
|||||||
return allWorkgroups;
|
return allWorkgroups;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GlobalCommand
|
||||||
|
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
||||||
|
public void reloadRelated() {
|
||||||
|
this.reload();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.springframework.security.access.AccessDeniedException;
|
import org.springframework.security.access.AccessDeniedException;
|
||||||
import org.zkoss.bind.BindUtils;
|
import org.zkoss.bind.BindUtils;
|
||||||
|
import org.zkoss.bind.annotation.GlobalCommand;
|
||||||
import org.zkoss.bind.annotation.Init;
|
import org.zkoss.bind.annotation.Init;
|
||||||
|
import org.zkoss.bind.annotation.NotifyChange;
|
||||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||||
|
|
||||||
public class TripRequirementListCentre extends RequirementSubpage<TripRequirement> {
|
public class TripRequirementListCentre extends RequirementSubpage<TripRequirement> {
|
||||||
@@ -49,6 +51,10 @@ public class TripRequirementListCentre extends RequirementSubpage<TripRequiremen
|
|||||||
return myCentres;
|
return myCentres;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GlobalCommand
|
||||||
|
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
||||||
|
public void reloadRelated() {
|
||||||
|
this.reload();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.springframework.security.access.AccessDeniedException;
|
import org.springframework.security.access.AccessDeniedException;
|
||||||
import org.zkoss.bind.BindUtils;
|
import org.zkoss.bind.BindUtils;
|
||||||
|
import org.zkoss.bind.annotation.GlobalCommand;
|
||||||
import org.zkoss.bind.annotation.Init;
|
import org.zkoss.bind.annotation.Init;
|
||||||
|
import org.zkoss.bind.annotation.NotifyChange;
|
||||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||||
|
|
||||||
public class TripRequirementListWorkgroup extends RequirementSubpage<TripRequirement> {
|
public class TripRequirementListWorkgroup extends RequirementSubpage<TripRequirement> {
|
||||||
@@ -55,4 +57,10 @@ public class TripRequirementListWorkgroup extends RequirementSubpage<TripRequire
|
|||||||
return myWorkgroups;
|
return myWorkgroups;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GlobalCommand
|
||||||
|
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
||||||
|
public void reloadRelated() {
|
||||||
|
this.reload();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,28 +22,30 @@
|
|||||||
<include src="/app/toolbar.zul" />
|
<include src="/app/toolbar.zul" />
|
||||||
<listbox
|
<listbox
|
||||||
model="@load(vm.dataList)"
|
model="@load(vm.dataList)"
|
||||||
selectedItem="@bind(vm.dataBean)">
|
selectedItem="@bind(vm.dataBean)"
|
||||||
<listhead menupopup="auto">
|
onAfterRender="@command('afterRender')"
|
||||||
|
selectedIndex="@bind(vm.selIndex)">
|
||||||
|
<listhead menupopup="auto" sizable="true">
|
||||||
<listheader
|
<listheader
|
||||||
label="${labels.RequirementsGridNumberSerie}"
|
label="${labels.RequirementsGridNumberSerie}"
|
||||||
sort="czech(numser)"
|
sort="czech(numser)"
|
||||||
width="10%" />
|
width="180px" />
|
||||||
<listheader
|
<listheader
|
||||||
label="${labels.RequirementsGridReqDate}"
|
label="${labels.RequirementsGridReqDate}"
|
||||||
sort="auto(reqDate)"
|
sort="auto(reqDate)"
|
||||||
width="13%" />
|
width="200px" />
|
||||||
<listheader
|
<listheader
|
||||||
label="${labels.RequirementsGridCenter}"
|
label="${labels.RequirementsGridCenter}"
|
||||||
sort="auto(centre)"
|
sort="auto(centre)"
|
||||||
width="10%" />
|
/>
|
||||||
<listheader
|
<listheader
|
||||||
label="${labels.RequirementsGridFrom}"
|
label="${labels.RequirementsGridFrom}"
|
||||||
sort="czech(from)"
|
sort="czech(from)"
|
||||||
width="40%" />
|
/>
|
||||||
<listheader
|
<listheader
|
||||||
label="${labels.RequirementsGridTo}"
|
label="${labels.RequirementsGridTo}"
|
||||||
sort="czech(to)"
|
sort="czech(to)"
|
||||||
width="40%" />
|
/>
|
||||||
</listhead>
|
</listhead>
|
||||||
<auxhead
|
<auxhead
|
||||||
sclass="category-center"
|
sclass="category-center"
|
||||||
@@ -126,7 +128,7 @@
|
|||||||
</auxheader>
|
</auxheader>
|
||||||
</auxhead>
|
</auxhead>
|
||||||
<template name="model">
|
<template name="model">
|
||||||
<listitem>
|
<listitem style="@load((each.state eq 'PARTIALLY') ? 'background-color: #fffb90' : ((each.state eq 'APPROVED') ? 'background-color: #afffb5' : ''))">
|
||||||
<listcell label="@load(each.numser)" />
|
<listcell label="@load(each.numser)" />
|
||||||
<listcell label="@load(each.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
|
<listcell label="@load(each.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
|
||||||
<listcell label="@load(each.centre.fullName)" />
|
<listcell label="@load(each.centre.fullName)" />
|
||||||
@@ -145,7 +147,9 @@
|
|||||||
<listbox
|
<listbox
|
||||||
model="@load(vmSub.dataList)"
|
model="@load(vmSub.dataList)"
|
||||||
selectedItem="@bind(vmSub.dataBean)"
|
selectedItem="@bind(vmSub.dataBean)"
|
||||||
hflex="7">
|
hflex="7"
|
||||||
|
onAfterRender="@command('afterRender')"
|
||||||
|
selectedIndex="@bind(vmSub.selIndex)">
|
||||||
<listhead menupopup="auto">
|
<listhead menupopup="auto">
|
||||||
<listheader
|
<listheader
|
||||||
label="${labels.RequirementsGridNumberSerie}"
|
label="${labels.RequirementsGridNumberSerie}"
|
||||||
@@ -293,7 +297,9 @@
|
|||||||
<listbox
|
<listbox
|
||||||
model="@load(vmSub.dataList)"
|
model="@load(vmSub.dataList)"
|
||||||
selectedItem="@bind(vmSub.dataBean)"
|
selectedItem="@bind(vmSub.dataBean)"
|
||||||
hflex="7">
|
hflex="7"
|
||||||
|
onAfterRender="@command('afterRender')"
|
||||||
|
selectedIndex="@bind(vmSub.selIndex)">
|
||||||
<listhead menupopup="auto">
|
<listhead menupopup="auto">
|
||||||
<listheader
|
<listheader
|
||||||
label="${labels.RequirementsGridNumberSerie}"
|
label="${labels.RequirementsGridNumberSerie}"
|
||||||
@@ -437,7 +443,7 @@
|
|||||||
</auxheader>
|
</auxheader>
|
||||||
</auxhead>
|
</auxhead>
|
||||||
<template name="model">
|
<template name="model">
|
||||||
<listitem>
|
<listitem style="@load((each.state eq 'PARTIALLY') ? 'background-color: #fffb90' : ((each.state eq 'APPROVED') ? 'background-color: #afffb5' : ''))">
|
||||||
<listcell label="@load(each.numser)" />
|
<listcell label="@load(each.numser)" />
|
||||||
<listcell label="@load(each.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
|
<listcell label="@load(each.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
|
||||||
<listcell label="@load(each.centre.fullName)" />
|
<listcell label="@load(each.centre.fullName)" />
|
||||||
@@ -463,7 +469,9 @@
|
|||||||
<listbox
|
<listbox
|
||||||
model="@load(vmSub.dataList)"
|
model="@load(vmSub.dataList)"
|
||||||
selectedItem="@bind(vmSub.dataBean)"
|
selectedItem="@bind(vmSub.dataBean)"
|
||||||
hflex="7">
|
hflex="7"
|
||||||
|
onAfterRender="@command('afterRender')"
|
||||||
|
selectedIndex="@bind(vmSub.selIndex)">
|
||||||
<listhead menupopup="auto">
|
<listhead menupopup="auto">
|
||||||
<listheader
|
<listheader
|
||||||
label="${labels.RequirementsGridNumberSerie}"
|
label="${labels.RequirementsGridNumberSerie}"
|
||||||
@@ -607,7 +615,7 @@
|
|||||||
</auxheader>
|
</auxheader>
|
||||||
</auxhead>
|
</auxhead>
|
||||||
<template name="model">
|
<template name="model">
|
||||||
<listitem>
|
<listitem style="@load((each.state eq 'PARTIALLY') ? 'background-color: #fffb90' : ((each.state eq 'APPROVED') ? 'background-color: #afffb5' : ''))">
|
||||||
<listcell label="@load(each.numser)" />
|
<listcell label="@load(each.numser)" />
|
||||||
<listcell label="@load(each.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
|
<listcell label="@load(each.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
|
||||||
<listcell label="@load(each.centre.fullName)" />
|
<listcell label="@load(each.centre.fullName)" />
|
||||||
|
|||||||
Reference in New Issue
Block a user