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 @Override
public MailMessage buildMessage(MailMessage template, Object data) { public MailMessage buildMessage(MailMessage template, Object data) {
MailMessage msg = new MailMessage(template); MailMessage msg = new MailMessage(template);
msg.setSubject(replacaProperties(msg.getSubject(), data)); msg.setSubject(replaceProperties(msg.getSubject(), data));
msg.setText(replacaProperties(msg.getText(), data)); msg.setText(replaceProperties(msg.getText(), data));
msg.setHtml(html); msg.setHtml(html);
return msg; return msg;
} }
private String replacaProperties(String src, Object data) { private String replaceProperties(String src, Object data) {
int current = 0; int current = 0;
List<String> properties = new ArrayList<String>(); List<String> properties = new ArrayList<String>();
boolean found = false; boolean found = false;

@ -2,10 +2,12 @@ package info.bukova.isspst.services.requirement;
import info.bukova.isspst.data.RequirementBase; import info.bukova.isspst.data.RequirementBase;
import info.bukova.isspst.data.User; import info.bukova.isspst.data.User;
import info.bukova.isspst.services.Service;
import java.util.List; 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 loadAuthItems(T data);
public void loadType(T data); public void loadType(T data);
@ -14,4 +16,9 @@ public interface RequirementBaseService<T extends RequirementBase> {
public boolean canApprove(T entity); public boolean canApprove(T entity);
public List<User> getNextApprover(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.LazyLoader;
import info.bukova.isspst.services.settings.GlobalSettingsService; import info.bukova.isspst.services.settings.GlobalSettingsService;
import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import org.hibernate.LazyInitializationException; import org.hibernate.LazyInitializationException;
import org.hibernate.Query;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PostFilter;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -37,7 +40,9 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
private GlobalSettingsService settingsService; private GlobalSettingsService settingsService;
@Autowired @Autowired
private UserService userService; private UserService userService;
@Autowired
private WorkgroupService workgroupService;
@Override @Override
@Transactional @Transactional
public void add(T entity) { public void add(T entity) {
@ -95,7 +100,28 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
wg = e.getWorkgroup(); 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()) { if (jm.getRole().equals(nextRole) && jm.getMember().isPerson()) {
users.add((User) jm.getMember()); users.add((User) jm.getMember());
} }
@ -248,4 +274,53 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
return wf; 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; package info.bukova.isspst.services.requirement;
import info.bukova.isspst.data.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.setReqDate(new Date());
entity.setType(reqTypeService.getTypeById(Constants.REQTYPE_ORDER)); entity.setType(reqTypeService.getTypeById(Constants.REQTYPE_ORDER));
entity.setState(RequirementState.NEW); entity.setState(RequirementState.NEW);
this.addWorkflow(entity);
return entity; return entity;
} }

@ -1,15 +1,10 @@
package info.bukova.isspst.services.requirement; package info.bukova.isspst.services.requirement;
import info.bukova.isspst.data.TripRequirement; 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); public void loadPassangers(TripRequirement entity);
} }

@ -8,12 +8,9 @@ import info.bukova.isspst.services.LazyLoader;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
import java.util.Date; import java.util.Date;
import java.util.List;
import org.hibernate.LazyInitializationException; import org.hibernate.LazyInitializationException;
import org.hibernate.Query;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PostFilter;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -50,52 +47,6 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripR
super.add(entity); 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 @Override
@Transactional @Transactional
@LazyLoader("form") @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.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage; import info.bukova.isspst.ui.requirement.RequirementSubpage;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable; import org.zkoss.zk.ui.select.annotation.WireVariable;
@ -43,6 +46,14 @@ public class ReqListMy extends RequirementSubpage<Requirement>
@Override @Override
protected List<Requirement> getListFromService() 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.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage; import info.bukova.isspst.ui.requirement.RequirementSubpage;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable; import org.zkoss.zk.ui.select.annotation.WireVariable;
@ -43,6 +46,14 @@ public class ReqListMyAll extends RequirementSubpage<Requirement>
@Override @Override
protected List<Requirement> getListFromService() 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.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage; import info.bukova.isspst.ui.requirement.RequirementSubpage;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable; import org.zkoss.zk.ui.select.annotation.WireVariable;
@ -43,6 +46,14 @@ public class ReqListMyCenters extends RequirementSubpage<Requirement>
@Override @Override
protected List<Requirement> getListFromService() 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.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage; import info.bukova.isspst.ui.requirement.RequirementSubpage;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable; import org.zkoss.zk.ui.select.annotation.WireVariable;
@ -43,6 +46,14 @@ public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
@Override @Override
protected List<Requirement> getListFromService() 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.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.ListViewModel; import info.bukova.isspst.ui.ListViewModel;
import java.util.ArrayList;
import java.util.List; 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.GlobalCommand;
import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange; import org.zkoss.bind.annotation.NotifyChange;
@ -81,4 +84,18 @@ public class TripRequirementList extends ListViewModel<TripRequirement> {
tripRequirementService.loadPassangers(data); 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 @Override
protected List<TripRequirement> getListFromService() { protected List<TripRequirement> getListFromService() {
try { try {
return tripRequirementService.getFromAll(); return tripRequirementService.getAll();
} catch (AccessDeniedException e) { } catch (AccessDeniedException e) {
BindUtils.postGlobalCommand(null, null, "disableAll", null); BindUtils.postGlobalCommand(null, null, "disableAll", null);
return new ArrayList<TripRequirement>(); return new ArrayList<TripRequirement>();

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

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

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

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

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

Loading…
Cancel
Save