Požadavky na objednávky přepracovány do záložek.

Funkčnost sjednocena s požadavky na cestovní příkaz.

closes #109
multitenant
František Přibyl 10 years ago
parent c48fb65949
commit 50ee0215c0

@ -20,13 +20,13 @@ public class EntityMessageBuilder implements MessageBuilder {
@Override
public MailMessage buildMessage(MailMessage template, Object data) {
MailMessage msg = new MailMessage(template);
msg.setSubject(replacaProperties(msg.getSubject(), data));
msg.setText(replacaProperties(msg.getText(), data));
msg.setSubject(replaceProperties(msg.getSubject(), data));
msg.setText(replaceProperties(msg.getText(), data));
msg.setHtml(html);
return msg;
}
private String replacaProperties(String src, Object data) {
private String replaceProperties(String src, Object data) {
int current = 0;
List<String> properties = new ArrayList<String>();
boolean found = false;

@ -2,10 +2,12 @@ package info.bukova.isspst.services.requirement;
import info.bukova.isspst.data.RequirementBase;
import info.bukova.isspst.data.User;
import info.bukova.isspst.services.Service;
import java.util.List;
public interface RequirementBaseService<T extends RequirementBase> {
public interface RequirementBaseService<T extends RequirementBase> extends Service<T>
{
public void loadAuthItems(T data);
public void loadType(T data);
@ -14,4 +16,9 @@ public interface RequirementBaseService<T extends RequirementBase> {
public boolean canApprove(T entity);
public List<User> getNextApprover(T entity);
public List<T> getMy();
public List<T> getCentreReq();
public List<T> getWorkgroupReq();
}

@ -16,13 +16,16 @@ import info.bukova.isspst.services.AbstractOwnedService;
import info.bukova.isspst.services.LazyLoader;
import info.bukova.isspst.services.settings.GlobalSettingsService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.hibernate.LazyInitializationException;
import org.hibernate.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PostFilter;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
@ -37,6 +40,8 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
private GlobalSettingsService settingsService;
@Autowired
private UserService userService;
@Autowired
private WorkgroupService workgroupService;
@Override
@Transactional
@ -95,7 +100,28 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
wg = e.getWorkgroup();
}
for (JobMapping jm : wg.getMembers()) {
try
{
if (wg.getMembers() == null)
{
throw new LazyInitializationException("");
}
wg.getMembers().size();
}
catch (LazyInitializationException ex)
{
Query q = dao.getQuery("from Workgroup where id = :id");
q.setParameter("id", wg.getId());
wg = (Workgroup) q.uniqueResult();
wg.getMembers().size();
}
for (JobMapping jm : wg.getMembers())
{
if (jm.getRole().equals(nextRole) && jm.getMember().isPerson()) {
users.add((User) jm.getMember());
}
@ -248,4 +274,53 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
return wf;
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_READ')")
public List<T> getMy()
{
Query q = dao.getQuery("from " + dao.getEntityName() + " where ownedBy = :owner and state != :state");
q.setParameter("owner", getLoggedInUser());
q.setParameter("state", RequirementState.APPROVED);
return q.list();
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_SHOW_CENTRE_REQ')")
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_CENTRE_REQ')")
public List<T> getCentreReq()
{
List<Workgroup> wgList = workgroupService.getUserCentres(getLoggedInUser());
Query q = dao.getQuery("select tr from " + dao.getEntityName() + " tr join fetch tr.ownedBy join tr.centre c where tr.state != :state and c in (:wgList) order by tr.numser");
q.setParameterList("wgList", wgList);
q.setParameter("state", RequirementState.APPROVED);
return q.list();
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_SHOW_WORKGROUP_REQ')")
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_WORKGROUP_REQ')")
public List<T> getWorkgroupReq()
{
List<Workgroup> wgList = workgroupService.getUserWorkgroups(getLoggedInUser());
Query q = dao.getQuery("select tr from " + dao.getEntityName() + " tr join fetch tr.ownedBy join tr.workgroup w where tr.state != :state and w in (:wgList) order by tr.numser");
q.setParameterList("wgList", wgList);
q.setParameter("state", RequirementState.APPROVED);
return q.list();
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_SHOW_ALL_REQ')")
public List<T> getAll()
{
Query q = dao.getQuery("from " + dao.getEntityName() + " as tr join fetch tr.ownedBy order by tr.numser");
return q.list();
}
}

@ -1,8 +1,8 @@
package info.bukova.isspst.services.requirement;
import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.services.Service;
public interface RequirementService extends Service<Requirement> {
public interface RequirementService extends RequirementBaseService<Requirement>
{
}

@ -24,6 +24,7 @@ public class RequirementServiceImpl extends
entity.setReqDate(new Date());
entity.setType(reqTypeService.getTypeById(Constants.REQTYPE_ORDER));
entity.setState(RequirementState.NEW);
this.addWorkflow(entity);
return entity;
}

@ -1,15 +1,10 @@
package info.bukova.isspst.services.requirement;
import info.bukova.isspst.data.TripRequirement;
import info.bukova.isspst.services.Service;
import java.util.List;
public interface TripRequirementService extends RequirementBaseService<TripRequirement>
{
public interface TripRequirementService extends Service<TripRequirement> {
public List<TripRequirement> getCentreReq();
public List<TripRequirement> getWorkgroupReq();
public List<TripRequirement> getFromAll();
public void loadPassangers(TripRequirement entity);
}

@ -8,12 +8,9 @@ import info.bukova.isspst.services.LazyLoader;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import java.util.Date;
import java.util.List;
import org.hibernate.LazyInitializationException;
import org.hibernate.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PostFilter;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
@ -50,52 +47,6 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripR
super.add(entity);
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_READ')")
public List<TripRequirement> getAll() {
Query q = dao.getQuery("from TripRequirement where ownedBy = :owner and state != :state");
q.setParameter("owner", getLoggedInUser());
q.setParameter("state", RequirementState.APPROVED);
return q.list();
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_SHOW_CENTRE_REQ')")
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_CENTRE_REQ')")
public List<TripRequirement> getCentreReq() {
List<Workgroup> wgList = workgroupService.getUserCentres(getLoggedInUser());
Query q = dao.getQuery("select tr from TripRequirement tr join fetch tr.ownedBy join tr.centre c where tr.state != :state and c in (:wgList) order by tr.numser");
q.setParameterList("wgList", wgList);
q.setParameter("state", RequirementState.APPROVED);
return q.list();
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_SHOW_WORKGROUP_REQ')")
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_WORKGROUP_REQ')")
public List<TripRequirement> getWorkgroupReq() {
List<Workgroup> wgList = workgroupService.getUserWorkgroups(getLoggedInUser());
Query q = dao.getQuery("select tr from TripRequirement tr join fetch tr.ownedBy join tr.workgroup w where tr.state != :state and w in (:wgList) order by tr.numser");
q.setParameterList("wgList", wgList);
q.setParameter("state", RequirementState.APPROVED);
return q.list();
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_SHOW_ALL_REQ')")
public List<TripRequirement> getFromAll() {
Query q = dao.getQuery("from TripRequirement as tr join fetch tr.ownedBy order by tr.numser");
return q.list();
}
@Override
@Transactional
@LazyLoader("form")

@ -0,0 +1,56 @@
package info.bukova.isspst.ui.main;
import org.zkoss.bind.annotation.GlobalCommand;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
public class TabPanelsVM
{
private boolean showCentre;
private boolean showWorkgroup;
private boolean showAll;
@Init
public void init()
{
showCentre = true;
showWorkgroup = true;
showAll = true;
}
@GlobalCommand
@NotifyChange("showCentre")
public void disableCentre()
{
showCentre = false;
}
@GlobalCommand
@NotifyChange("showWorkgroup")
public void disableWorkgroup()
{
showWorkgroup = false;
}
@GlobalCommand
@NotifyChange("showAll")
public void disableAll()
{
showAll = false;
}
public boolean isShowCentre()
{
return showCentre;
}
public boolean isShowWorkgroup()
{
return showWorkgroup;
}
public boolean isShowAll()
{
return showAll;
}
}

@ -8,8 +8,11 @@ import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage;
import java.util.ArrayList;
import java.util.List;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable;
@ -43,6 +46,14 @@ public class ReqListMy extends RequirementSubpage<Requirement>
@Override
protected List<Requirement> getListFromService()
{
return super.getListFromService();
try
{
return requirementService.getMy();
}
catch (AccessDeniedException e)
{
BindUtils.postGlobalCommand(null, null, "disableAll", null);
return new ArrayList<Requirement>();
}
}
}

@ -8,8 +8,11 @@ import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage;
import java.util.ArrayList;
import java.util.List;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable;
@ -43,6 +46,14 @@ public class ReqListMyAll extends RequirementSubpage<Requirement>
@Override
protected List<Requirement> getListFromService()
{
return super.getListFromService();
try
{
return requirementService.getAll();
}
catch (AccessDeniedException e)
{
BindUtils.postGlobalCommand(null, null, "disableAll", null);
return new ArrayList<Requirement>();
}
}
}

@ -8,8 +8,11 @@ import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage;
import java.util.ArrayList;
import java.util.List;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable;
@ -43,6 +46,14 @@ public class ReqListMyCenters extends RequirementSubpage<Requirement>
@Override
protected List<Requirement> getListFromService()
{
return super.getListFromService();
try
{
return requirementService.getCentreReq();
}
catch (AccessDeniedException e)
{
BindUtils.postGlobalCommand(null, null, "disableCentre", null);
return new ArrayList<Requirement>();
}
}
}

@ -8,8 +8,11 @@ import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage;
import java.util.ArrayList;
import java.util.List;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable;
@ -43,6 +46,14 @@ public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
@Override
protected List<Requirement> getListFromService()
{
return super.getListFromService();
try
{
return requirementService.getWorkgroupReq();
}
catch (AccessDeniedException e)
{
BindUtils.postGlobalCommand(null, null, "disableWorkgroup", null);
return new ArrayList<Requirement>();
}
}
}

@ -8,8 +8,11 @@ import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.ListViewModel;
import java.util.ArrayList;
import java.util.List;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.GlobalCommand;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
@ -81,4 +84,18 @@ public class TripRequirementList extends ListViewModel<TripRequirement> {
tripRequirementService.loadPassangers(data);
}
@Override
protected List<TripRequirement> getListFromService()
{
try
{
return tripRequirementService.getMy();
}
catch (AccessDeniedException e)
{
BindUtils.postGlobalCommand(null, null, "disableAll", null);
return new ArrayList<TripRequirement>();
}
}
}

@ -39,7 +39,7 @@ public class TripRequirementListAll extends RequirementSubpage<TripRequirement>
@Override
protected List<TripRequirement> getListFromService() {
try {
return tripRequirementService.getFromAll();
return tripRequirementService.getAll();
} catch (AccessDeniedException e) {
BindUtils.postGlobalCommand(null, null, "disableAll", null);
return new ArrayList<TripRequirement>();

@ -21,8 +21,8 @@ public class RequirementFormValidator extends BaseValidator
@Override
public void validate(ValidationContext ctx)
{
Property propertyWorkgroup = ctx.getProperties("workgroup")[0];
Workgroup workgroup = (Workgroup) propertyWorkgroup.getValue();
Property propertyCentre = ctx.getProperties("centre")[0];
Workgroup workgroup = (Workgroup) propertyCentre.getValue();
if (workgroup == null)
{

@ -53,7 +53,7 @@
model="@load(vm.centres)"
readonly="true"
disabled="@load(vm.editRec)"
selectedItem="@bind(fx.workgroup)">
selectedItem="@bind(fx.centre)">
<template name="model">
<comboitem label="@load(each.fullName)" />
</template>
@ -94,7 +94,7 @@
</grid>
<hbox>
<button
disabled="@load(empty fx.workgroup)"
disabled="@load(empty fx.centre)"
image="/img/item-add.png"
label="${labels.AddItem}"
onClick="@command('addSelectedItem')"

@ -6,139 +6,145 @@
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.orders.requirements.ReqListMyAll')">
<include src="/main/toolbar.zul" />
<listbox
vflex="1"
selectedItem="@bind(vm.dataBean)"
model="@load(vm.dataList)">
<listhead menupopup="auto">
<listheader
label="${labels.RequirementsGridNumberSerie}"
sort="czech(numser)"
width="7%" />
<listheader
label="${labels.RequirementsGridReqDate}"
sort="auto(reqDate)"
width="13%" />
<listheader
label="${labels.RequirementsGridCenter}"
sort="czech(description)"
width="10%" />
<listheader
label="${labels.RequirementsGridDeliveryDate}"
sort="auto(reqDate)"
width="13%" />
<listheader
label="${labels.Amount}"
sort="auto(sumTotal)"
align="right"
width="10%" />
<listheader
label="${labels.RequirementsGridDescription}"
sort="czech(description)"
width="60%" />
</listhead>
<auxhead
sclass="category-center"
visible="@load(vm.filter)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.numser)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
<hbox vflex="1">
<listbox
vflex="1"
hflex="7"
selectedItem="@bind(vm.dataBean)"
model="@load(vm.dataList)">
<listhead menupopup="auto">
<listheader
label="${labels.RequirementsGridNumberSerie}"
sort="czech(numser)"
width="7%" />
<listheader
label="${labels.RequirementsGridReqDate}"
sort="auto(reqDate)"
width="13%" />
<listheader
label="${labels.RequirementsGridCenter}"
sort="czech(description)"
width="10%" />
<listheader
label="${labels.RequirementsGridDeliveryDate}"
sort="auto(reqDate)"
width="13%" />
<listheader
label="${labels.Amount}"
sort="auto(sumTotal)"
align="right"
width="10%" />
<listheader
label="${labels.RequirementsGridDescription}"
sort="czech(description)"
width="60%" />
</listhead>
<auxhead
sclass="category-center"
visible="@load(vm.filter)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.numser)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<datebox
value="@bind(vm.filterTemplate.reqDate)"
format="${labels.DateFormat}"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<datebox
value="@bind(vm.filterTemplate.reqDate)"
format="${labels.DateFormat}"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<combobox
model="@load(vm.centres)"
readonly="true"
width="100%"
selectedItem="@bind(vm.filterTemplate.workgroup)">
<template name="model">
<comboitem label="@load(each.fullName)" />
</template>
</combobox>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<datebox
value="@bind(vm.filterTemplate.deliveryDate)"
format="${labels.DateFormat}"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<combobox
model="@load(vm.centres)"
readonly="true"
width="100%"
selectedItem="@bind(vm.filterTemplate.workgroup)">
<template name="model">
<comboitem label="@load(each.fullName)" />
</template>
</combobox>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.sumTotal) @converter(vm.bigDecimalConverter)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<datebox
value="@bind(vm.filterTemplate.deliveryDate)"
format="${labels.DateFormat}"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.description)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.sumTotal) @converter(vm.bigDecimalConverter)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.description)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
</auxhead>
<template name="model">
<listitem>
<listcell label="@load(each.numser)" />
<listcell label="@load(each.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.workgroup.fullName)" />
<listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.sumTotal) @converter(vm.bigDecimalConverter)" />
<listcell label="@load(each.description)" />
</listitem>
</template>
</listbox>
</auxheader>
</auxhead>
<template name="model">
<listitem>
<listcell label="@load(each.numser)" />
<listcell label="@load(each.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.workgroup.fullName)" />
<listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.sumTotal) @converter(vm.bigDecimalConverter)" />
<listcell label="@load(each.description)" />
</listitem>
</template>
</listbox>
<div hflex="3">
<include src="/requirements/approveStatus.zul" />
</div>
</hbox>
</window>
</zk>

@ -6,139 +6,145 @@
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.orders.requirements.ReqListMyCenters')">
<include src="/main/toolbar.zul" />
<listbox
vflex="1"
selectedItem="@bind(vm.dataBean)"
model="@load(vm.dataList)">
<listhead menupopup="auto">
<listheader
label="${labels.RequirementsGridNumberSerie}"
sort="czech(numser)"
width="7%" />
<listheader
label="${labels.RequirementsGridReqDate}"
sort="auto(reqDate)"
width="13%" />
<listheader
label="${labels.RequirementsGridCenter}"
sort="czech(description)"
width="10%" />
<listheader
label="${labels.RequirementsGridDeliveryDate}"
sort="auto(reqDate)"
width="13%" />
<listheader
label="${labels.Amount}"
sort="auto(sumTotal)"
align="right"
width="10%" />
<listheader
label="${labels.RequirementsGridDescription}"
sort="czech(description)"
width="60%" />
</listhead>
<auxhead
sclass="category-center"
visible="@load(vm.filter)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.numser)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
<hbox vflex="1">
<listbox
vflex="1"
hflex="7"
selectedItem="@bind(vm.dataBean)"
model="@load(vm.dataList)">
<listhead menupopup="auto">
<listheader
label="${labels.RequirementsGridNumberSerie}"
sort="czech(numser)"
width="7%" />
<listheader
label="${labels.RequirementsGridReqDate}"
sort="auto(reqDate)"
width="13%" />
<listheader
label="${labels.RequirementsGridCenter}"
sort="czech(description)"
width="10%" />
<listheader
label="${labels.RequirementsGridDeliveryDate}"
sort="auto(reqDate)"
width="13%" />
<listheader
label="${labels.Amount}"
sort="auto(sumTotal)"
align="right"
width="10%" />
<listheader
label="${labels.RequirementsGridDescription}"
sort="czech(description)"
width="60%" />
</listhead>
<auxhead
sclass="category-center"
visible="@load(vm.filter)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.numser)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<datebox
value="@bind(vm.filterTemplate.reqDate)"
format="${labels.DateFormat}"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<datebox
value="@bind(vm.filterTemplate.reqDate)"
format="${labels.DateFormat}"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<combobox
model="@load(vm.centres)"
readonly="true"
width="100%"
selectedItem="@bind(vm.filterTemplate.workgroup)">
<template name="model">
<comboitem label="@load(each.fullName)" />
</template>
</combobox>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<datebox
value="@bind(vm.filterTemplate.deliveryDate)"
format="${labels.DateFormat}"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<combobox
model="@load(vm.centres)"
readonly="true"
width="100%"
selectedItem="@bind(vm.filterTemplate.workgroup)">
<template name="model">
<comboitem label="@load(each.fullName)" />
</template>
</combobox>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.sumTotal) @converter(vm.bigDecimalConverter)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<datebox
value="@bind(vm.filterTemplate.deliveryDate)"
format="${labels.DateFormat}"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.description)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.sumTotal) @converter(vm.bigDecimalConverter)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.description)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
</auxhead>
<template name="model">
<listitem>
<listcell label="@load(each.numser)" />
<listcell label="@load(each.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.workgroup.fullName)" />
<listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.sumTotal) @converter(vm.bigDecimalConverter)" />
<listcell label="@load(each.description)" />
</listitem>
</template>
</listbox>
</auxheader>
</auxhead>
<template name="model">
<listitem>
<listcell label="@load(each.numser)" />
<listcell label="@load(each.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.workgroup.fullName)" />
<listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.sumTotal) @converter(vm.bigDecimalConverter)" />
<listcell label="@load(each.description)" />
</listitem>
</template>
</listbox>
<div hflex="3">
<include src="/requirements/approveStatus.zul" />
</div>
</hbox>
</window>
</zk>

@ -6,139 +6,145 @@
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.orders.requirements.ReqListMyWorkgroups')">
<include src="/main/toolbar.zul" />
<listbox
vflex="1"
selectedItem="@bind(vm.dataBean)"
model="@load(vm.dataList)">
<listhead menupopup="auto">
<listheader
label="${labels.RequirementsGridNumberSerie}"
sort="czech(numser)"
width="7%" />
<listheader
label="${labels.RequirementsGridReqDate}"
sort="auto(reqDate)"
width="13%" />
<listheader
label="${labels.RequirementsGridCenter}"
sort="czech(description)"
width="10%" />
<listheader
label="${labels.RequirementsGridDeliveryDate}"
sort="auto(reqDate)"
width="13%" />
<listheader
label="${labels.Amount}"
sort="auto(sumTotal)"
align="right"
width="10%" />
<listheader
label="${labels.RequirementsGridDescription}"
sort="czech(description)"
width="60%" />
</listhead>
<auxhead
sclass="category-center"
visible="@load(vm.filter)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.numser)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
<hbox vflex="1">
<listbox
vflex="1"
hflex="7"
selectedItem="@bind(vm.dataBean)"
model="@load(vm.dataList)">
<listhead menupopup="auto">
<listheader
label="${labels.RequirementsGridNumberSerie}"
sort="czech(numser)"
width="7%" />
<listheader
label="${labels.RequirementsGridReqDate}"
sort="auto(reqDate)"
width="13%" />
<listheader
label="${labels.RequirementsGridCenter}"
sort="czech(description)"
width="10%" />
<listheader
label="${labels.RequirementsGridDeliveryDate}"
sort="auto(reqDate)"
width="13%" />
<listheader
label="${labels.Amount}"
sort="auto(sumTotal)"
align="right"
width="10%" />
<listheader
label="${labels.RequirementsGridDescription}"
sort="czech(description)"
width="60%" />
</listhead>
<auxhead
sclass="category-center"
visible="@load(vm.filter)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.numser)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<datebox
value="@bind(vm.filterTemplate.reqDate)"
format="${labels.DateFormat}"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<datebox
value="@bind(vm.filterTemplate.reqDate)"
format="${labels.DateFormat}"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<combobox
model="@load(vm.centres)"
readonly="true"
width="100%"
selectedItem="@bind(vm.filterTemplate.workgroup)">
<template name="model">
<comboitem label="@load(each.fullName)" />
</template>
</combobox>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<datebox
value="@bind(vm.filterTemplate.deliveryDate)"
format="${labels.DateFormat}"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<combobox
model="@load(vm.centres)"
readonly="true"
width="100%"
selectedItem="@bind(vm.filterTemplate.workgroup)">
<template name="model">
<comboitem label="@load(each.fullName)" />
</template>
</combobox>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.sumTotal) @converter(vm.bigDecimalConverter)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<datebox
value="@bind(vm.filterTemplate.deliveryDate)"
format="${labels.DateFormat}"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.description)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.sumTotal) @converter(vm.bigDecimalConverter)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.description)"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
</auxhead>
<template name="model">
<listitem>
<listcell label="@load(each.numser)" />
<listcell label="@load(each.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.workgroup.fullName)" />
<listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.sumTotal) @converter(vm.bigDecimalConverter)" />
<listcell label="@load(each.description)" />
</listitem>
</template>
</listbox>
</auxheader>
</auxhead>
<template name="model">
<listitem>
<listcell label="@load(each.numser)" />
<listcell label="@load(each.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.workgroup.fullName)" />
<listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.sumTotal) @converter(vm.bigDecimalConverter)" />
<listcell label="@load(each.description)" />
</listitem>
</template>
</listbox>
<div hflex="3">
<include src="/requirements/approveStatus.zul" />
</div>
</hbox>
</window>
</zk>

@ -1,9 +1,18 @@
<tabbox vflex="1">
<tabbox
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.TabPanelsVM')"
vflex="1">
<tabs>
<tab label="${labels.RequirementsGridMy}" />
<tab label="${labels.RequirementsGridMyCentres}" />
<tab label="${labels.RequirementsGridMyWorkgroups}" />
<tab label="${labels.RequirementsGridAll}" />
<tab
label="${labels.RequirementsGridMyCentres}"
disabled="@load(not vm.showCentre)" />
<tab
label="${labels.RequirementsGridMyWorkgroups}"
disabled="@load(not vm.showWorkgroup)" />
<tab
label="${labels.RequirementsGridAll}"
disabled="@load(not vm.showAll)" />
</tabs>
<tabpanels>
<tabpanel>

Loading…
Cancel
Save