multitenant
Josef Rokos 10 years ago
commit b1664ca656

@ -116,4 +116,7 @@ public class Constants {
new RequirementType(REQTYPE_ORDER, "Objednávky materiálu a služeb"), new RequirementType(REQTYPE_ORDER, "Objednávky materiálu a služeb"),
new RequirementType(REQTYPE_BUSINESSTRIP, "Služební cesty") new RequirementType(REQTYPE_BUSINESSTRIP, "Služební cesty")
}; };
public final static long REQ_TYPE_MATERIAL = 1;
public final static long REQ_TYPE_SERVICES = 2;
} }

@ -27,6 +27,9 @@ public class Requirement extends RequirementBase
@Column(name = "SUMTOTAL") @Column(name = "SUMTOTAL")
private BigDecimal sumTotal; private BigDecimal sumTotal;
@Column(name = "KIND")
private Long kind;
public Requirement() public Requirement()
{ {
this.setItems(new ArrayList<RequirementItem>()); this.setItems(new ArrayList<RequirementItem>());
@ -61,4 +64,14 @@ public class Requirement extends RequirementBase
{ {
this.sumTotal = sumTotal; this.sumTotal = sumTotal;
} }
public Long getKind()
{
return kind;
}
public void setKind(Long kind)
{
this.kind = kind;
}
} }

@ -0,0 +1,90 @@
package info.bukova.isspst.services.requirement;
import info.bukova.isspst.Constants;
import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.data.RequirementState;
import info.bukova.isspst.data.Workgroup;
import java.util.Date;
import java.util.List;
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;
public class ReqMaterialServiceImpl 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);
entity.setKind(Constants.REQ_TYPE_MATERIAL);
return entity;
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_READ')")
public List<Requirement> getMy()
{
Query q = dao.getQuery("from " + dao.getEntityName() + " where ownedBy = :owner and state != :state and kind = :kind");
q.setParameter("owner", getLoggedInUser());
q.setParameter("state", RequirementState.APPROVED);
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
return q.list();
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_SHOW_CENTRE_REQ')")
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_CENTRE_REQ')")
public List<Requirement> 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) and kind = :kind order by tr.numser");
q.setParameterList("wgList", wgList);
q.setParameter("state", RequirementState.APPROVED);
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
return q.list();
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_SHOW_WORKGROUP_REQ')")
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_WORKGROUP_REQ')")
public List<Requirement> 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) and kind = :kind order by tr.numser");
q.setParameterList("wgList", wgList);
q.setParameter("state", RequirementState.APPROVED);
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
return q.list();
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_SHOW_ALL_REQ')")
public List<Requirement> getAll()
{
Query q = dao.getQuery("from " + dao.getEntityName() + " as tr join fetch tr.ownedBy where kind = :kind order by tr.numser");
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
return q.list();
}
}

@ -0,0 +1,90 @@
package info.bukova.isspst.services.requirement;
import info.bukova.isspst.Constants;
import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.data.RequirementState;
import info.bukova.isspst.data.Workgroup;
import java.util.Date;
import java.util.List;
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;
public class ReqServicesServiceImpl 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);
entity.setKind(Constants.REQ_TYPE_SERVICES);
return entity;
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_READ')")
public List<Requirement> getMy()
{
Query q = dao.getQuery("from " + dao.getEntityName() + " where ownedBy = :owner and state != :state and kind = :kind");
q.setParameter("owner", getLoggedInUser());
q.setParameter("state", RequirementState.APPROVED);
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
return q.list();
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_SHOW_CENTRE_REQ')")
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_CENTRE_REQ')")
public List<Requirement> 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) and kind = :kind order by tr.numser");
q.setParameterList("wgList", wgList);
q.setParameter("state", RequirementState.APPROVED);
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
return q.list();
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_SHOW_WORKGROUP_REQ')")
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_WORKGROUP_REQ')")
public List<Requirement> 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) and kind = :kind order by tr.numser");
q.setParameterList("wgList", wgList);
q.setParameter("state", RequirementState.APPROVED);
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
return q.list();
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_SHOW_ALL_REQ')")
public List<Requirement> getAll()
{
Query q = dao.getQuery("from " + dao.getEntityName() + " as tr join fetch tr.ownedBy where kind = :kind order by tr.numser");
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
return q.list();
}
}

@ -42,7 +42,7 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
@Autowired @Autowired
private UserService userService; private UserService userService;
@Autowired @Autowired
private WorkgroupService workgroupService; protected WorkgroupService workgroupService;
@Override @Override
@Transactional @Transactional

@ -0,0 +1,27 @@
package info.bukova.isspst.ui.main.orders.material;
import info.bukova.isspst.ui.main.orders.requirements.RequirementForm;
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 ReqMaterialForm extends RequirementForm
{
// private final static Logger log =
// LoggerFactory.getLogger(ReqServicesForm.class.getName());
@Init(superclass = true)
public void init()
{
super.init();
}
@Command
public void addSelectedItem()
{
Window window = (Window) Executions.createComponents("/main/orders/material/selectMaterial.zul", null, null);
window.doModal();
}
}

@ -0,0 +1,41 @@
package info.bukova.isspst.ui.main.orders.material;
import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.ui.main.orders.requirements.ReqListMy;
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;
public class ReqMaterialListMy extends ReqListMy
{
@WireVariable
protected RequirementService reqMaterialService;
@Init
public void init()
{
super.init();
service = reqMaterialService;
formZul = "/main/orders/material/reqHeadForm.zul";
}
@Override
protected List<Requirement> getListFromService()
{
try
{
return reqMaterialService.getMy();
}
catch (AccessDeniedException e)
{
BindUtils.postGlobalCommand(null, null, "disableAll", null);
return new ArrayList<Requirement>();
}
}
}

@ -0,0 +1,41 @@
package info.bukova.isspst.ui.main.orders.material;
import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.ui.main.orders.requirements.ReqListMyAll;
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;
public class ReqMaterialListMyAll extends ReqListMyAll
{
@WireVariable
protected RequirementService reqMaterialService;
@Init
public void init()
{
super.init();
service = reqMaterialService;
formZul = "/main/orders/material/reqHeadForm.zul";
}
@Override
protected List<Requirement> getListFromService()
{
try
{
return reqMaterialService.getAll();
}
catch (AccessDeniedException e)
{
BindUtils.postGlobalCommand(null, null, "disableAll", null);
return new ArrayList<Requirement>();
}
}
}

@ -0,0 +1,41 @@
package info.bukova.isspst.ui.main.orders.material;
import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.ui.main.orders.requirements.ReqListMyCenters;
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;
public class ReqMaterialListMyCenters extends ReqListMyCenters
{
@WireVariable
protected RequirementService reqMaterialService;
@Init
public void init()
{
super.init();
service = reqMaterialService;
formZul = "/main/orders/material/reqHeadForm.zul";
}
@Override
protected List<Requirement> getListFromService()
{
try
{
return reqMaterialService.getCentreReq();
}
catch (AccessDeniedException e)
{
BindUtils.postGlobalCommand(null, null, "disableCentre", null);
return new ArrayList<Requirement>();
}
}
}

@ -0,0 +1,41 @@
package info.bukova.isspst.ui.main.orders.material;
import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.ui.main.orders.requirements.ReqListMyWorkgroups;
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;
public class ReqMaterialListMyWorkgroups extends ReqListMyWorkgroups
{
@WireVariable
protected RequirementService reqMaterialService;
@Init
public void init()
{
super.init();
service = reqMaterialService;
formZul = "/main/orders/material/reqHeadForm.zul";
}
@Override
protected List<Requirement> getListFromService()
{
try
{
return reqMaterialService.getWorkgroupReq();
}
catch (AccessDeniedException e)
{
BindUtils.postGlobalCommand(null, null, "disableWorkgroup", null);
return new ArrayList<Requirement>();
}
}
}

@ -0,0 +1,121 @@
package info.bukova.isspst.ui.main.orders.material;
import info.bukova.isspst.data.Material;
import info.bukova.isspst.filters.MaterialFilter;
import info.bukova.isspst.services.reqsubjects.MaterialService;
import info.bukova.isspst.ui.main.orders.requirements.SelectItems;
import java.util.List;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.select.annotation.WireVariable;
public class SelectMaterialItems extends SelectItems
{
@WireVariable
private MaterialService materialService;
private List<Material> materialList;
private List<Material> fullMaterialList;
private boolean activeFilterMaterial;
private Material filterTmpMaterial;
private MaterialFilter dataFilterMaterial;
@Init
public void init()
{
super.init();
this.setFullMaterialList(materialService.getAll());
this.setMaterialList(this.getFullMaterialList());
this.setActiveFilterMaterial(false);
this.setFilterTmpMaterial(new Material());
this.setDataFilterMaterial(new MaterialFilter(this.getFilterTmpMaterial()));
}
public List<Material> getMaterialList()
{
return materialList;
}
public void setMaterialList(List<Material> materialList)
{
this.materialList = materialList;
}
public List<Material> getFullMaterialList()
{
return fullMaterialList;
}
public void setFullMaterialList(List<Material> fullMaterialList)
{
this.fullMaterialList = fullMaterialList;
}
public boolean isActiveFilterMaterial()
{
return activeFilterMaterial;
}
public void setActiveFilterMaterial(boolean activeFilterMaterial)
{
this.activeFilterMaterial = activeFilterMaterial;
}
public Material getFilterTmpMaterial()
{
return this.filterTmpMaterial;
}
private void setFilterTmpMaterial(Material material)
{
this.filterTmpMaterial = material;
}
public MaterialFilter getDataFilterMaterial()
{
return dataFilterMaterial;
}
public void setDataFilterMaterial(MaterialFilter dataFilterMaterial)
{
this.dataFilterMaterial = dataFilterMaterial;
}
@Command
@NotifyChange({ "activeFilterMaterial", "materialList", "selectedItem" })
public void onFilterMaterial()
{
this.setSelectedItem(null);
this.setActiveFilterMaterial(!this.isActiveFilterMaterial());
if (this.isActiveFilterMaterial())
{
this.doFilterMaterial();
}
else
{
this.setMaterialList(this.getFullMaterialList());
}
}
@Command
@NotifyChange("materialList")
public void doFilterMaterial()
{
this.setSelectedItem(null);
List<Material> result = this.materialService.filterList(this.getFullMaterialList(), this.getDataFilterMaterial());
this.setMaterialList(result);
}
}

@ -18,15 +18,14 @@ import org.zkoss.zk.ui.select.annotation.WireVariable;
public class ReqListMy extends RequirementSubpage<Requirement> public class ReqListMy extends RequirementSubpage<Requirement>
{ {
@WireVariable @WireVariable
private RequirementService requirementService; protected RequirementService requirementService;
@WireVariable @WireVariable
private UserService userService; protected UserService userService;
@WireVariable @WireVariable
private WorkgroupService workgroupService; protected WorkgroupService workgroupService;
public List<Workgroup> getCentres() public List<Workgroup> getCentres()
{ {

@ -20,15 +20,14 @@ import org.zkoss.zk.ui.select.annotation.WireVariable;
public class ReqListMyAll extends RequirementSubpage<Requirement> public class ReqListMyAll extends RequirementSubpage<Requirement>
{ {
@WireVariable @WireVariable
private RequirementService requirementService; protected RequirementService requirementService;
@WireVariable @WireVariable
private UserService userService; protected UserService userService;
@WireVariable @WireVariable
private WorkgroupService workgroupService; protected WorkgroupService workgroupService;
public List<Workgroup> getCentres() public List<Workgroup> getCentres()
{ {
@ -58,10 +57,11 @@ public class ReqListMyAll extends RequirementSubpage<Requirement>
return new ArrayList<Requirement>(); return new ArrayList<Requirement>();
} }
} }
@GlobalCommand @GlobalCommand
@NotifyChange({ "dataList", "dataBean", "fullFill" }) @NotifyChange({ "dataList", "dataBean", "fullFill" })
public void reloadRelated() { public void reloadRelated()
{
this.reload(); this.reload();
} }
} }

@ -20,15 +20,14 @@ import org.zkoss.zk.ui.select.annotation.WireVariable;
public class ReqListMyCenters extends RequirementSubpage<Requirement> public class ReqListMyCenters extends RequirementSubpage<Requirement>
{ {
@WireVariable @WireVariable
private RequirementService requirementService; protected RequirementService requirementService;
@WireVariable @WireVariable
private UserService userService; protected UserService userService;
@WireVariable @WireVariable
private WorkgroupService workgroupService; protected WorkgroupService workgroupService;
public List<Workgroup> getCentres() public List<Workgroup> getCentres()
{ {
@ -58,10 +57,11 @@ public class ReqListMyCenters extends RequirementSubpage<Requirement>
return new ArrayList<Requirement>(); return new ArrayList<Requirement>();
} }
} }
@GlobalCommand @GlobalCommand
@NotifyChange({ "dataList", "dataBean", "fullFill" }) @NotifyChange({ "dataList", "dataBean", "fullFill" })
public void reloadRelated() { public void reloadRelated()
{
this.reload(); this.reload();
} }
} }

@ -20,15 +20,14 @@ import org.zkoss.zk.ui.select.annotation.WireVariable;
public class ReqListMyWorkgroups extends RequirementSubpage<Requirement> public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
{ {
@WireVariable @WireVariable
private RequirementService requirementService; protected RequirementService requirementService;
@WireVariable @WireVariable
private UserService userService; protected UserService userService;
@WireVariable @WireVariable
private WorkgroupService workgroupService; protected WorkgroupService workgroupService;
public List<Workgroup> getCentres() public List<Workgroup> getCentres()
{ {
@ -58,10 +57,11 @@ public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
return new ArrayList<Requirement>(); return new ArrayList<Requirement>();
} }
} }
@GlobalCommand @GlobalCommand
@NotifyChange({ "dataList", "dataBean", "fullFill" }) @NotifyChange({ "dataList", "dataBean", "fullFill" })
public void reloadRelated() { public void reloadRelated()
{
this.reload(); this.reload();
} }
} }

@ -1,11 +1,10 @@
package info.bukova.isspst.ui.requirement; package info.bukova.isspst.ui.main.orders.requirements;
import info.bukova.isspst.data.Material; import info.bukova.isspst.data.Material;
import info.bukova.isspst.data.Requirement; import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.data.RequirementItem; import info.bukova.isspst.data.RequirementItem;
import info.bukova.isspst.data.RequirementSubject; import info.bukova.isspst.data.RequirementSubject;
import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.services.users.UserService; 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.BigDecimalConverter; import info.bukova.isspst.ui.BigDecimalConverter;
@ -24,7 +23,6 @@ import org.zkoss.bind.annotation.Command;
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;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.select.annotation.WireVariable; import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zul.Window; import org.zkoss.zul.Window;
import org.zkoss.zul.impl.InputElement; import org.zkoss.zul.impl.InputElement;
@ -39,15 +37,12 @@ public class RequirementForm extends FormViewModel<Requirement>
@WireVariable @WireVariable
private WorkgroupService workgroupService; private WorkgroupService workgroupService;
@WireVariable
private RequirementService requirementService;
private RequirementItem selectedItem; private RequirementItem selectedItem;
private int selItemIndex; private int selItemIndex;
private BigDecimalConverter bigDecimalConverter; private BigDecimalConverter bigDecimalConverter;
private RequirementFormValidator requirementFormValidator; private RequirementFormValidator requirementFormValidator;
private List<RequirementItem> syncItems; private List<RequirementItem> syncItems;
@ -119,8 +114,9 @@ public class RequirementForm extends FormViewModel<Requirement>
@Command @Command
public void addSelectedItem() public void addSelectedItem()
{ {
Window window = (Window) Executions.createComponents("/main/selectItems.zul", null, null); // Window window = (Window)
window.doModal(); // Executions.createComponents("/main/selectItems.zul", null, null);
// window.doModal();
} }
@Command @Command
@ -151,17 +147,17 @@ public class RequirementForm extends FormViewModel<Requirement>
{ {
RequirementItem item = new RequirementItem(); RequirementItem item = new RequirementItem();
boolean isMaterial = (selected instanceof Material); boolean isMaterial = (selected instanceof Material);
//boolean isServiceItem = (selected instanceof ServiceItem); // boolean isServiceItem = (selected instanceof ServiceItem);
item.setReqSubject(selected); item.setReqSubject(selected);
item.setCode(selected.getCode()); item.setCode(selected.getCode());
item.setName(selected.getName()); item.setName(selected.getName());
item.setQuantity(BigDecimal.valueOf(1)); item.setQuantity(BigDecimal.valueOf(1));
item.setUnitPrice(BigDecimal.valueOf(0)); item.setUnitPrice(BigDecimal.valueOf(0));
item.setTotal(BigDecimal.valueOf(0)); item.setTotal(BigDecimal.valueOf(0));
item.setDescription(selected.getDescription()); item.setDescription(selected.getDescription());
if (isMaterial) if (isMaterial)
{ {
Material materialItem = (Material) selected; Material materialItem = (Material) selected;
@ -188,8 +184,8 @@ public class RequirementForm extends FormViewModel<Requirement>
log.warn("Zavolat z formuláře onFocus pro nastavení vybrané položky!"); log.warn("Zavolat z formuláře onFocus pro nastavení vybrané položky!");
return; return;
} }
// Recalculate selecte item // Recalculate selected item
if ((source != null) && (source.equals("total"))) if ((source != null) && (source.equals("total")))
{ {
BigDecimal quantity = this.selectedItem.getQuantity(); BigDecimal quantity = this.selectedItem.getQuantity();
@ -207,7 +203,7 @@ public class RequirementForm extends FormViewModel<Requirement>
{ {
this.selectedItem.setTotal(this.selectedItem.getQuantity().multiply(this.selectedItem.getUnitPrice())); this.selectedItem.setTotal(this.selectedItem.getQuantity().multiply(this.selectedItem.getUnitPrice()));
} }
// Calculate total price at form // Calculate total price at form
if (form != null) if (form != null)
{ {
@ -217,7 +213,7 @@ public class RequirementForm extends FormViewModel<Requirement>
{ {
sumTotal = sumTotal.add(item.getTotal()); sumTotal = sumTotal.add(item.getTotal());
} }
form.setField("sumTotal", sumTotal); form.setField("sumTotal", sumTotal);
BindUtils.postNotifyChange(null, null, form, "*"); BindUtils.postNotifyChange(null, null, form, "*");
} }

@ -0,0 +1,47 @@
package info.bukova.isspst.ui.main.orders.requirements;
import info.bukova.isspst.data.MUnitEmb;
import info.bukova.isspst.data.RequirementSubject;
import info.bukova.isspst.services.munits.MUnitService;
import java.util.List;
import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable;
public class SelectItems
{
protected RequirementSubject selectedItem;
@WireVariable
protected MUnitService munitService;
protected List<MUnitEmb> munitList;
@Init
public void init()
{
this.setMunitList(munitService.getEmbAll());
}
public RequirementSubject getSelectedItem()
{
return selectedItem;
}
public void setSelectedItem(RequirementSubject selectedItem)
{
this.selectedItem = selectedItem;
}
public List<MUnitEmb> getMunitList()
{
return munitList;
}
public void setMunitList(List<MUnitEmb> munitList)
{
this.munitList = munitList;
}
}

@ -0,0 +1,27 @@
package info.bukova.isspst.ui.main.orders.services;
import info.bukova.isspst.ui.main.orders.requirements.RequirementForm;
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 ReqServicesForm extends RequirementForm
{
// private final static Logger log =
// LoggerFactory.getLogger(ReqServicesForm.class.getName());
@Init(superclass = true)
public void init()
{
super.init();
}
@Command
public void addSelectedItem()
{
Window window = (Window) Executions.createComponents("/main/orders/services/selectServices.zul", null, null);
window.doModal();
}
}

@ -0,0 +1,41 @@
package info.bukova.isspst.ui.main.orders.services;
import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.ui.main.orders.requirements.ReqListMy;
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;
public class ReqServicesListMy extends ReqListMy
{
@WireVariable
protected RequirementService reqServicesService;
@Init
public void init()
{
super.init();
service = reqServicesService;
formZul = "/main/orders/services/reqHeadForm.zul";
}
@Override
protected List<Requirement> getListFromService()
{
try
{
return reqServicesService.getMy();
}
catch (AccessDeniedException e)
{
BindUtils.postGlobalCommand(null, null, "disableAll", null);
return new ArrayList<Requirement>();
}
}
}

@ -0,0 +1,41 @@
package info.bukova.isspst.ui.main.orders.services;
import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.ui.main.orders.requirements.ReqListMyAll;
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;
public class ReqServicesListMyAll extends ReqListMyAll
{
@WireVariable
protected RequirementService reqServicesService;
@Init
public void init()
{
super.init();
service = reqServicesService;
formZul = "/main/orders/services/reqHeadForm.zul";
}
@Override
protected List<Requirement> getListFromService()
{
try
{
return reqServicesService.getAll();
}
catch (AccessDeniedException e)
{
BindUtils.postGlobalCommand(null, null, "disableAll", null);
return new ArrayList<Requirement>();
}
}
}

@ -0,0 +1,41 @@
package info.bukova.isspst.ui.main.orders.services;
import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.ui.main.orders.requirements.ReqListMyCenters;
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;
public class ReqServicesListMyCenters extends ReqListMyCenters
{
@WireVariable
protected RequirementService reqServicesService;
@Init
public void init()
{
super.init();
service = reqServicesService;
formZul = "/main/orders/services/reqHeadForm.zul";
}
@Override
protected List<Requirement> getListFromService()
{
try
{
return reqServicesService.getCentreReq();
}
catch (AccessDeniedException e)
{
BindUtils.postGlobalCommand(null, null, "disableCentre", null);
return new ArrayList<Requirement>();
}
}
}

@ -0,0 +1,41 @@
package info.bukova.isspst.ui.main.orders.services;
import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.ui.main.orders.requirements.ReqListMyWorkgroups;
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;
public class ReqServicesListMyWorkgroups extends ReqListMyWorkgroups
{
@WireVariable
protected RequirementService reqServicesService;
@Init
public void init()
{
super.init();
service = reqServicesService;
formZul = "/main/orders/services/reqHeadForm.zul";
}
@Override
protected List<Requirement> getListFromService()
{
try
{
return reqServicesService.getWorkgroupReq();
}
catch (AccessDeniedException e)
{
BindUtils.postGlobalCommand(null, null, "disableWorkgroup", null);
return new ArrayList<Requirement>();
}
}
}

@ -0,0 +1,121 @@
package info.bukova.isspst.ui.main.orders.services;
import info.bukova.isspst.data.ServiceItem;
import info.bukova.isspst.filters.ServiceItemFilter;
import info.bukova.isspst.services.reqsubjects.ServiceItemService;
import info.bukova.isspst.ui.main.orders.requirements.SelectItems;
import java.util.List;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.select.annotation.WireVariable;
public class SelectServicesItems extends SelectItems
{
@WireVariable
private ServiceItemService serviceItemService;
private List<ServiceItem> serviceItemList;
private List<ServiceItem> fullServiceItemList;
private boolean activeFilterService;
private ServiceItem filterTmpService;
private ServiceItemFilter dataFilterService;
@Init
public void init()
{
super.init();
this.setFullServiceItemList(serviceItemService.getAll());
this.setServiceItemList(this.getFullServiceItemList());
this.setActiveFilterService(false);
this.setFilterTmpService(new ServiceItem());
this.setDataFilterService(new ServiceItemFilter(this.getFilterTmpService()));
}
public List<ServiceItem> getServiceItemList()
{
return serviceItemList;
}
public void setServiceItemList(List<ServiceItem> serviceItemList)
{
this.serviceItemList = serviceItemList;
}
public List<ServiceItem> getFullServiceItemList()
{
return fullServiceItemList;
}
public void setFullServiceItemList(List<ServiceItem> fullServiceItemList)
{
this.fullServiceItemList = fullServiceItemList;
}
public boolean isActiveFilterService()
{
return activeFilterService;
}
public void setActiveFilterService(boolean activeFilterService)
{
this.activeFilterService = activeFilterService;
}
public ServiceItem getFilterTmpService()
{
return this.filterTmpService;
}
private void setFilterTmpService(ServiceItem serviceItem)
{
this.filterTmpService = serviceItem;
}
public ServiceItemFilter getDataFilterService()
{
return dataFilterService;
}
public void setDataFilterService(ServiceItemFilter dataFilterService)
{
this.dataFilterService = dataFilterService;
}
@Command
@NotifyChange({ "activeFilterService", "serviceItemList", "selectedItem" })
public void onFilterService()
{
this.setSelectedItem(null);
this.setActiveFilterService(!this.isActiveFilterService());
if (this.isActiveFilterService())
{
this.doFilterService();
}
else
{
this.setServiceItemList(this.getFullServiceItemList());
}
}
@Command
@NotifyChange("serviceItemList")
public void doFilterService()
{
this.setSelectedItem(null);
List<ServiceItem> result = this.serviceItemService.filterList(this.getFullServiceItemList(), this.getDataFilterService());
this.setServiceItemList(result);
}
}

@ -1,56 +0,0 @@
package info.bukova.isspst.ui.requirement;
import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.filters.RequirementFilter;
import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.BigDecimalConverter;
import info.bukova.isspst.ui.ListViewModel;
import java.util.List;
import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable;
public class RequirementList extends ListViewModel<Requirement> {
@WireVariable
private RequirementService requirementService;
@WireVariable
private UserService userService;
@WireVariable
private WorkgroupService workgroupService;
private BigDecimalConverter bigDecimalConverter;
public List<Workgroup> getCentres()
{
return workgroupService.getUserCentres(userService.getCurrent());
}
public BigDecimalConverter getBigDecimalConverter()
{
return bigDecimalConverter;
}
public void setBigDecimalConverter(BigDecimalConverter bigDecimalConverter)
{
this.bigDecimalConverter = bigDecimalConverter;
}
@Init
public void init()
{
service = requirementService;
dataClass = Requirement.class;
formZul = "requirementsForm.zul";
dataFilter = new RequirementFilter(getFilterTemplate());
this.bigDecimalConverter = new BigDecimalConverter();
}
}

@ -1,254 +0,0 @@
package info.bukova.isspst.ui.requirement;
import info.bukova.isspst.data.MUnitEmb;
import info.bukova.isspst.data.Material;
import info.bukova.isspst.data.RequirementSubject;
import info.bukova.isspst.data.ServiceItem;
import info.bukova.isspst.filters.MaterialFilter;
import info.bukova.isspst.filters.ServiceItemFilter;
import info.bukova.isspst.services.munits.MUnitService;
import info.bukova.isspst.services.reqsubjects.MaterialService;
import info.bukova.isspst.services.reqsubjects.ServiceItemService;
import java.util.List;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.select.annotation.WireVariable;
public class SelectItems
{
@WireVariable
private MaterialService materialService;
private List<Material> materialList;
private List<Material> fullMaterialList;
private boolean activeFilterMaterial;
private Material filterTmpMaterial;
private MaterialFilter dataFilterMaterial;
@WireVariable
private ServiceItemService serviceItemService;
private List<ServiceItem> serviceItemList;
private List<ServiceItem> fullServiceItemList;
private boolean activeFilterService;
private ServiceItem filterTmpService;
private ServiceItemFilter dataFilterService;
private RequirementSubject selectedItem;
@WireVariable
private MUnitService munitService;
private List<MUnitEmb> munitList;
@Init
public void init()
{
this.setFullMaterialList(materialService.getAll());
this.setMaterialList(this.getFullMaterialList());
this.setActiveFilterMaterial(false);
this.setFilterTmpMaterial(new Material());
this.setDataFilterMaterial(new MaterialFilter(this.getFilterTmpMaterial()));
this.setFullServiceItemList(serviceItemService.getAll());
this.setServiceItemList(this.getFullServiceItemList());
this.setActiveFilterService(false);
this.setFilterTmpService(new ServiceItem());
this.setDataFilterService(new ServiceItemFilter(this.getFilterTmpService()));
this.setMunitList(munitService.getEmbAll());
}
public List<Material> getMaterialList()
{
return materialList;
}
public void setMaterialList(List<Material> materialList)
{
this.materialList = materialList;
}
public List<Material> getFullMaterialList()
{
return fullMaterialList;
}
public void setFullMaterialList(List<Material> fullMaterialList)
{
this.fullMaterialList = fullMaterialList;
}
public boolean isActiveFilterMaterial()
{
return activeFilterMaterial;
}
public void setActiveFilterMaterial(boolean activeFilterMaterial)
{
this.activeFilterMaterial = activeFilterMaterial;
}
public Material getFilterTmpMaterial()
{
return this.filterTmpMaterial;
}
private void setFilterTmpMaterial(Material material)
{
this.filterTmpMaterial = material;
}
public MaterialFilter getDataFilterMaterial()
{
return dataFilterMaterial;
}
public void setDataFilterMaterial(MaterialFilter dataFilterMaterial)
{
this.dataFilterMaterial = dataFilterMaterial;
}
public List<ServiceItem> getServiceItemList()
{
return serviceItemList;
}
public void setServiceItemList(List<ServiceItem> serviceItemList)
{
this.serviceItemList = serviceItemList;
}
public List<ServiceItem> getFullServiceItemList()
{
return fullServiceItemList;
}
public void setFullServiceItemList(List<ServiceItem> fullServiceItemList)
{
this.fullServiceItemList = fullServiceItemList;
}
public boolean isActiveFilterService()
{
return activeFilterService;
}
public void setActiveFilterService(boolean activeFilterService)
{
this.activeFilterService = activeFilterService;
}
public ServiceItem getFilterTmpService()
{
return this.filterTmpService;
}
private void setFilterTmpService(ServiceItem serviceItem)
{
this.filterTmpService = serviceItem;
}
public ServiceItemFilter getDataFilterService()
{
return dataFilterService;
}
public void setDataFilterService(ServiceItemFilter dataFilterService)
{
this.dataFilterService = dataFilterService;
}
public RequirementSubject getSelectedItem()
{
return selectedItem;
}
public void setSelectedItem(RequirementSubject selectedItem)
{
this.selectedItem = selectedItem;
}
public List<MUnitEmb> getMunitList()
{
return munitList;
}
public void setMunitList(List<MUnitEmb> munitList)
{
this.munitList = munitList;
}
@Command
@NotifyChange({ "activeFilterMaterial", "materialList", "selectedItem" })
public void onFilterMaterial()
{
this.setSelectedItem(null);
this.setActiveFilterMaterial(!this.isActiveFilterMaterial());
if (this.isActiveFilterMaterial())
{
this.doFilterMaterial();
}
else
{
this.setMaterialList(this.getFullMaterialList());
}
}
@Command
@NotifyChange("materialList")
public void doFilterMaterial()
{
this.setSelectedItem(null);
List<Material> result = this.materialService.filterList(this.getFullMaterialList(), this.getDataFilterMaterial());
this.setMaterialList(result);
}
@Command
@NotifyChange({ "activeFilterService", "serviceItemList", "selectedItem" })
public void onFilterService()
{
this.setSelectedItem(null);
this.setActiveFilterService(!this.isActiveFilterService());
if (this.isActiveFilterService())
{
this.doFilterService();
}
else
{
this.setServiceItemList(this.getFullServiceItemList());
}
}
@Command
@NotifyChange("serviceItemList")
public void doFilterService()
{
this.setSelectedItem(null);
List<ServiceItem> result = this.serviceItemService.filterList(this.getFullServiceItemList(), this.getDataFilterService());
this.setServiceItemList(result);
}
}

@ -254,7 +254,9 @@ Information=Informace
Requirements=Požadavky Requirements=Požadavky
Orders=Objednávky Orders=Objednávky
MaterialRequirement=Požadavek na materiál
MaterialRequirements=Požadavky na materiál MaterialRequirements=Požadavky na materiál
ServiceRequirement=Požadavek na servis
ServiceRequirements=Požadavky na servis ServiceRequirements=Požadavky na servis
CurrentRequirements=Aktuální požadavky CurrentRequirements=Aktuální požadavky

@ -303,6 +303,18 @@
<property name="numberSeriesService" ref="numericSeriesService" /> <property name="numberSeriesService" ref="numericSeriesService" />
</bean> </bean>
<bean id="reqMaterialService" class="info.bukova.isspst.services.requirement.ReqMaterialServiceImpl">
<property name="dao" ref="requirementDao" />
<property name="validator" ref="validator" />
<property name="numberSeriesService" ref="numericSeriesService" />
</bean>
<bean id="reqServicesService" class="info.bukova.isspst.services.requirement.ReqServicesServiceImpl">
<property name="dao" ref="requirementDao" />
<property name="validator" ref="validator" />
<property name="numberSeriesService" ref="numericSeriesService" />
</bean>
<bean id="numericSeriesService" class="info.bukova.isspst.services.numberseries.NumberSeriesServiceImpl"> <bean id="numericSeriesService" class="info.bukova.isspst.services.numberseries.NumberSeriesServiceImpl">
<property name="dao" ref="numericSeriesDao" /> <property name="dao" ref="numericSeriesDao" />
<property name="validator" ref="validator" /> <property name="validator" ref="validator" />

@ -0,0 +1,17 @@
<?page title="${labels.MaterialRequirement}" contentType="text/html;charset=UTF-8"?>
<zk>
<window
id="editWin"
closable="true"
border="normal"
position="center"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.orders.material.ReqMaterialForm')"
validationMessages="@id('vmsg')">
<caption
image="/img/beam-032.png"
zclass="form-caption"
label="${labels.MaterialRequirement}" />
<include src="/main/orders/requirements/reqForm.zul" />
</window>
</zk>

@ -0,0 +1,13 @@
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window
vflex="1"
border="none"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.orders.material.ReqMaterialListMy')">
<include src="/app/toolbar.zul" />
<include
vflex="1"
src="/main/orders/requirements/reqListMy.zul" />
</window>
</zk>

@ -0,0 +1,13 @@
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window
vflex="1"
border="none"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.orders.material.ReqMaterialListMyAll')">
<include src="/main/toolbar.zul" />
<include
vflex="1"
src="/main/orders/requirements/reqListMyAll.zul" />
</window>
</zk>

@ -0,0 +1,13 @@
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window
vflex="1"
border="none"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.orders.material.ReqMaterialListMyCenters')">
<include src="/main/toolbar.zul" />
<include
vflex="1"
src="/main/orders/requirements/reqListMyCenters.zul" />
</window>
</zk>

@ -0,0 +1,13 @@
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window
vflex="1"
border="none"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.orders.material.ReqMaterialListMyWorkgroups')">
<include src="/main/toolbar.zul" />
<include
vflex="1"
src="/main/orders/requirements/reqListMyWorkgroups.zul" />
</window>
</zk>

@ -0,0 +1,136 @@
<?page title="${labels.AgendaMaterial}" contentType="text/html;charset=UTF-8"?>
<zk>
<window
id="selectItemsWnd"
closable="true"
border="normal"
position="center"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.orders.material.SelectMaterialItems')">
<caption
src="/img/palet-032.png"
zclass="form-caption"
label="${labels.AgendaMaterial}" />
<vlayout>
<toolbar>
<toolbarbutton
image="/img/funnel.png"
tooltiptext="${labels.ToolbarRecFilter}"
id="btnFilterMaterial"
onClick="@command('onFilterMaterial')" />
</toolbar>
<listbox
model="@load(vm.materialList)"
selectedItem="@bind(vm.selectedItem)">
<listhead menupopup="auto">
<listheader
label="${labels.code}"
sort="czech(code)"
width="10%" />
<listheader
label="${labels.name}"
sort="czech(name)"
width="25%" />
<listheader
label="${labels.munit}"
width="15%" />
<listheader
label="${labels.description}"
sort="czech(description)"
width="50%" />
</listhead>
<auxhead
sclass="category-center"
visible="@load(vm.activeFilterMaterial)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTmpMaterial.code)"
instant="true"
onChange="@command('doFilterMaterial')"
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.filterTmpMaterial.name)"
instant="true"
onChange="@command('doFilterMaterial')"
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">
<combobox
instant="true"
model="@load(vm.munitList)"
selectedItem="@bind(vm.filterTmpMaterial.munit)"
onChange="@command('doFilterMaterial')"
readonly="true"
sclass="find-grid-textbox">
<template name="model">
<comboitem label="@load(each.name)" />
</template>
</combobox>
</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.filterTmpMaterial.description)"
instant="true"
onChange="@command('doFilterMaterial')"
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.code)" />
<listcell label="@load(each.name)" />
<listcell label="@load(each.munit.name)" />
<listcell label="@load(each.description)" />
</listitem>
</template>
</listbox>
</vlayout>
<vlayout>
<div
hflex="max"
align="right">
<button
image="~./zul/img/misc/drag-disallow.png"
label="${labels.ButtonStorno}"
onClick="selectItemsWnd.detach()"
sclass="nicebutton" />
<button
image="/img/item-add.png"
label="${labels.AddItem}"
onClick="@global-command('insertSelectedItem', selected=vm.selectedItem, window=selectItemsWnd)"
disabled="@load(empty vm.selectedItem ? 'true' : 'false')"
sclass="nicebutton" />
</div>
</vlayout>
</window>
</zk>

@ -2,10 +2,10 @@
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?> <?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<zk> <zk>
<zscript> <zscript>
String gridMy = "/main/orders/requirements/reqListMy.zul"; String gridMy = "/main/orders/material/reqHeadListMy.zul";
String gridMyCenters = "/main/orders/requirements/reqListMyCenters.zul"; String gridMyCenters = "/main/orders/material/reqHeadListMyCenters.zul";
String gridMyWorkgroups = "/main/orders/requirements/reqListMyWorkgroups.zul"; String gridMyWorkgroups = "/main/orders/material/reqHeadListMyWorkgroups.zul";
String gridAll = "/main/orders/requirements/reqListMyAll.zul"; String gridAll = "/main/orders/material/reqHeadListMyAll.zul";
String selectItem = "/main/selectMaterial.zul"; String selectItem = "/main/selectMaterial.zul";
</zscript> </zscript>
<window <window

@ -1,206 +1,190 @@
<?page title="${labels.RequirementsFormTitle}" contentType="text/html;charset=UTF-8"?> <vlayout
<zk> form="@id('fx') @load(vm.dataBean) @save(vm.dataBean, before='save') @validator(vm.requirementFormValidator)"
<window hflex="1">
id="editWin" <grid hflex="min">
closable="true" <columns>
border="normal" <column
position="center" align="right"
apply="org.zkoss.bind.BindComposer" hflex="min" />
viewModel="@id('vm') @init('info.bukova.isspst.ui.requirement.RequirementForm')" <column />
validationMessages="@id('vmsg')"> </columns>
<caption <rows>
image="/img/req-order-032.png" <row>
zclass="form-caption" <cell sclass="row-title">${labels.RequirementsFormNumberSerie} :</cell>
label="${labels.RequirementsFormTitle}" /> <cell>
<vlayout <textbox
form="@id('fx') @load(vm.dataBean) @save(vm.dataBean, before='save') @validator(vm.requirementFormValidator)" id="numser"
hflex="1"> width="150px"
<grid hflex="min"> constraint="@load(vm.constriant)"
<columns> value="@bind(fx.numser)"
<column readonly="true" />
align="right" </cell>
hflex="min" /> </row>
<column /> <row>
</columns> <cell sclass="row-title">${labels.RequirementsFormReqDate} :</cell>
<rows> <cell>
<row> <datebox
<cell sclass="row-title">${labels.RequirementsFormNumberSerie} :</cell> id="reqDate"
<cell> width="150px"
<textbox value="@bind(fx.reqDate)"
id="numser" format="${labels.DateFormat}" />
width="150px" </cell>
constraint="@load(vm.constriant)" </row>
value="@bind(fx.numser)" <row>
readonly="true" /> <cell sclass="row-title">${labels.RequirementsFormCenter} :</cell>
</cell> <cell>
</row> <combobox
<row> id="idReqCenter"
<cell sclass="row-title">${labels.RequirementsFormReqDate} :</cell> width="150px"
<cell> model="@load(vm.centres)"
<datebox readonly="true"
id="reqDate" disabled="@load(vm.editRec)"
width="150px" selectedItem="@bind(fx.centre)">
value="@bind(fx.reqDate)" <template name="model">
format="${labels.DateFormat}" /> <comboitem label="@load(each.fullName)" />
</cell> </template>
</row> </combobox>
<row> </cell>
<cell sclass="row-title">${labels.RequirementsFormCenter} :</cell> </row>
<cell> <row>
<combobox <cell sclass="row-title">${labels.RequirementsFormDeliveryDate} :</cell>
id="idReqCenter" <cell>
width="150px" <datebox
model="@load(vm.centres)" id="deliveryDate"
readonly="true" width="150px"
disabled="@load(vm.editRec)" value="@bind(fx.deliveryDate)"
selectedItem="@bind(fx.centre)"> format="${labels.DateFormat}" />
<template name="model"> </cell>
<comboitem label="@load(each.fullName)" /> </row>
</template> <row>
</combobox> <cell sclass="row-title">${labels.Amount} :</cell>
</cell> <cell>
</row> <textbox
<row> id="idSumTotal"
<cell sclass="row-title">${labels.RequirementsFormDeliveryDate} :</cell> readonly="true"
<cell> width="150px"
<datebox value="@bind(fx.sumTotal) @converter(vm.bigDecimalConverter)" />
id="deliveryDate" </cell>
width="150px" </row>
value="@bind(fx.deliveryDate)" <row>
format="${labels.DateFormat}" /> <cell sclass="row-title">${labels.RequirementsFormDescription} :</cell>
</cell> <cell>
</row> <textbox
<row> id="description"
<cell sclass="row-title">${labels.Amount} :</cell> width="400px"
<cell> rows="5"
<textbox value="@bind(fx.description)" />
id="idSumTotal" </cell>
readonly="true" </row>
width="150px" </rows>
value="@bind(fx.sumTotal) @converter(vm.bigDecimalConverter)" /> </grid>
</cell> <hbox>
</row> <button
<row> disabled="@load(empty fx.centre)"
<cell sclass="row-title">${labels.RequirementsFormDescription} :</cell> image="/img/item-add.png"
<cell> label="${labels.AddItem}"
<textbox onClick="@command('addSelectedItem')"
id="description" sclass="nicebutton" />
width="400px" </hbox>
rows="5" <listbox
value="@bind(fx.description)" /> height="180px"
</cell> model="@load(vm.syncItems)"
</row> selectedItem="@bind(vm.selectedItem)"
</rows> selectedIndex="@bind(vm.selItemIndex)">
</grid> <listhead>
<hbox> <listheader
<button hflex="1"
disabled="@load(empty fx.centre)" label="${labels.RequirementItemCode}" />
image="/img/item-add.png" <listheader
label="${labels.AddItem}" hflex="3"
onClick="@command('addSelectedItem')" label="${labels.RequirementItemName}" />
sclass="nicebutton" /> <listheader
</hbox> hflex="1"
<listbox align="right"
height="180px" label="${labels.RequirementItemQuantity}" />
model="@load(vm.syncItems)" <listheader
selectedItem="@bind(vm.selectedItem)" hflex="1"
selectedIndex="@bind(vm.selItemIndex)"> label="${labels.RequirementItemMUnit}" />
<listhead> <listheader
<listheader hflex="1"
hflex="1" align="right"
label="${labels.RequirementItemCode}" /> label="${labels.RequirementItemUnitPrice}" />
<listheader <listheader
hflex="3" hflex="1"
label="${labels.RequirementItemName}" /> align="right"
<listheader label="${labels.RequirementItemTotal}" />
hflex="1" <listheader
align="right" hflex="3"
label="${labels.RequirementItemQuantity}" /> label="${labels.RequirementItemDescription}" />
<listheader <listheader hflex="1" />
hflex="1" </listhead>
label="${labels.RequirementItemMUnit}" /> <template name="model">
<listheader <listitem>
hflex="1" <listcell>
align="right" <textbox
label="${labels.RequirementItemUnitPrice}" /> inplace="true"
<listheader sclass="grid-textbox-max"
hflex="1" readonly="true"
align="right" onFocus="@command('onFocusItem', item=each, ctrl=self)"
label="${labels.RequirementItemTotal}" /> value="@bind(each.code)" />
<listheader </listcell>
hflex="3" <listcell>
label="${labels.RequirementItemDescription}" /> <textbox
<listheader hflex="1" /> inplace="true"
</listhead> sclass="grid-textbox-max"
<template name="model"> onFocus="@command('onFocusItem', item=each, ctrl=self)"
<listitem> value="@bind(each.name)" />
<listcell> </listcell>
<textbox <listcell>
inplace="true" <textbox
sclass="grid-textbox-max" inplace="true"
readonly="true" sclass="grid-textbox-max-right"
onFocus="@command('onFocusItem', item=each, ctrl=self)" onFocus="@command('onFocusItem', item=each, ctrl=self)"
value="@bind(each.code)" /> onChange="@command('recalculate', form=fx, changed='quantity')"
</listcell> value="@bind(each.quantity) @converter(vm.bigDecimalConverter)" />
<listcell> </listcell>
<textbox <listcell>
inplace="true" <textbox
sclass="grid-textbox-max" inplace="true"
onFocus="@command('onFocusItem', item=each, ctrl=self)" sclass="grid-textbox-max"
value="@bind(each.name)" /> readonly="true"
</listcell> onFocus="@command('onFocusItem', item=each, ctrl=self)"
<listcell> value="@bind(each.munit.name)" />
<textbox </listcell>
inplace="true" <listcell>
sclass="grid-textbox-max-right" <textbox
onFocus="@command('onFocusItem', item=each, ctrl=self)" inplace="true"
onChange="@command('recalculate', form=fx, changed='quantity')" sclass="grid-textbox-max-right"
value="@bind(each.quantity) @converter(vm.bigDecimalConverter)" /> onFocus="@command('onFocusItem', item=each, ctrl=self)"
</listcell> onChange="@command('recalculate', form=fx, changed='unitprice')"
<listcell> value="@bind(each.unitPrice) @converter(vm.bigDecimalConverter)" />
<textbox </listcell>
inplace="true" <listcell>
sclass="grid-textbox-max" <textbox
readonly="true" inplace="true"
onFocus="@command('onFocusItem', item=each, ctrl=self)" sclass="grid-textbox-max-right"
value="@bind(each.munit.name)" /> onFocus="@command('onFocusItem', item=each, ctrl=self)"
</listcell> onChange="@command('recalculate', form=fx, changed='total')"
<listcell> value="@bind(each.total) @converter(vm.bigDecimalConverter)" />
<textbox </listcell>
inplace="true" <listcell>
sclass="grid-textbox-max-right" <textbox
onFocus="@command('onFocusItem', item=each, ctrl=self)" inplace="true"
onChange="@command('recalculate', form=fx, changed='unitprice')" sclass="grid-textbox-max"
value="@bind(each.unitPrice) @converter(vm.bigDecimalConverter)" /> onFocus="@command('onFocusItem', item=each, ctrl=self)"
</listcell> value="@bind(each.description)" />
<listcell> </listcell>
<textbox <listcell
inplace="true" sclass="grid-textbox-max"
sclass="grid-textbox-max-right" style="text-align:center">
onFocus="@command('onFocusItem', item=each, ctrl=self)" <button
onChange="@command('recalculate', form=fx, changed='total')" image="~./zul/img/misc/drag-disallow.png"
value="@bind(each.total) @converter(vm.bigDecimalConverter)" /> label="${labels.RemoveItem}"
</listcell> onClick="@command('removeItem', item=each, ctrl=self)"
<listcell> sclass="nicebutton" />
<textbox </listcell>
inplace="true" </listitem>
sclass="grid-textbox-max" </template>
onFocus="@command('onFocusItem', item=each, ctrl=self)" </listbox>
value="@bind(each.description)" /> <include src="/app/formButtons.zul" />
</listcell> </vlayout>
<listcell
sclass="grid-textbox-max"
style="text-align:center">
<button
image="~./zul/img/misc/drag-disallow.png"
label="${labels.RemoveItem}"
onClick="@command('removeItem', item=each, ctrl=self)"
sclass="nicebutton" />
</listcell>
</listitem>
</template>
</listbox>
<include src="/app/formButtons.zul" />
</vlayout>
</window>
</zk>

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

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

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

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

@ -6,7 +6,7 @@
border="normal" border="normal"
position="center" position="center"
apply="org.zkoss.bind.BindComposer" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.requirement.SelectItems')"> viewModel="@id('vm') @init('info.bukova.isspst.ui.main.orders.requirements.SelectItems')">
<caption <caption
src="/img/item-add.png" src="/img/item-add.png"
zclass="form-caption" zclass="form-caption"

@ -0,0 +1,17 @@
<?page title="${labels.ServiceRequirement}" contentType="text/html;charset=UTF-8"?>
<zk>
<window
id="editWin"
closable="true"
border="normal"
position="center"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.orders.services.ReqServicesForm')"
validationMessages="@id('vmsg')">
<caption
image="/img/worker-032.png"
zclass="form-caption"
label="${labels.ServiceRequirement}" />
<include src="/main/orders/requirements/reqForm.zul" />
</window>
</zk>

@ -0,0 +1,13 @@
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window
vflex="1"
border="none"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.orders.services.ReqServicesListMy')">
<include src="/app/toolbar.zul" />
<include
vflex="1"
src="/main/orders/requirements/reqListMy.zul" />
</window>
</zk>

@ -0,0 +1,13 @@
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window
vflex="1"
border="none"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.orders.services.ReqServicesListMyAll')">
<include src="/main/toolbar.zul" />
<include
vflex="1"
src="/main/orders/requirements/reqListMyAll.zul" />
</window>
</zk>

@ -0,0 +1,13 @@
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window
vflex="1"
border="none"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.orders.services.ReqServicesListMyCenters')">
<include src="/main/toolbar.zul" />
<include
vflex="1"
src="/main/orders/requirements/reqListMyCenters.zul" />
</window>
</zk>

@ -0,0 +1,13 @@
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window
vflex="1"
border="none"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.orders.services.ReqServicesListMyWorkgroups')">
<include src="/main/toolbar.zul" />
<include
vflex="1"
src="/main/orders/requirements/reqListMyWorkgroups.zul" />
</window>
</zk>

@ -0,0 +1,112 @@
<?page title="${labels.AgendaServices}" contentType="text/html;charset=UTF-8"?>
<zk>
<window
id="selectItemsWnd"
closable="true"
border="normal"
position="center"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.orders.services.SelectServicesItems')">
<caption
src="/img/painting-032.png"
zclass="form-caption"
label="${labels.AgendaServices}" />
<vlayout>
<toolbar>
<toolbarbutton
image="/img/funnel.png"
tooltiptext="${labels.ToolbarRecFilter}"
id="btnFilterService"
onClick="@command('onFilterService')" />
</toolbar>
<listbox
model="@load(vm.serviceItemList)"
selectedItem="@bind(vm.selectedItem)">
<listhead menupopup="auto">
<listheader
label="${labels.code}"
sort="czech(code)"
width="10%" />
<listheader
label="${labels.name}"
sort="czech(name)"
width="30%" />
<listheader
label="${labels.description}"
sort="czech(description)"
width="60%" />
</listhead>
<auxhead
sclass="category-center"
visible="@load(vm.activeFilterService)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTmpService.code)"
instant="true"
onChange="@command('doFilterService')"
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.filterTmpService.name)"
instant="true"
onChange="@command('doFilterService')"
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.filterTmpService.description)"
instant="true"
onChange="@command('doFilterService')"
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.code)" />
<listcell label="@load(each.name)" />
<listcell label="@load(each.description)" />
</listitem>
</template>
</listbox>
</vlayout>
<vlayout>
<div
hflex="max"
align="right">
<button
image="~./zul/img/misc/drag-disallow.png"
label="${labels.ButtonStorno}"
onClick="selectItemsWnd.detach()"
sclass="nicebutton" />
<button
image="/img/item-add.png"
label="${labels.AddItem}"
onClick="@global-command('insertSelectedItem', selected=vm.selectedItem, window=selectItemsWnd)"
disabled="@load(empty vm.selectedItem ? 'true' : 'false')"
sclass="nicebutton" />
</div>
</vlayout>
</window>
</zk>

@ -2,10 +2,10 @@
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?> <?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<zk> <zk>
<zscript> <zscript>
String gridMy = "/main/orders/requirements/reqListMy.zul"; String gridMy = "/main/orders/services/reqHeadListMy.zul";
String gridMyCenters = "/main/orders/requirements/reqListMyCenters.zul"; String gridMyCenters = "/main/orders/services/reqHeadListMyCenters.zul";
String gridMyWorkgroups = "/main/orders/requirements/reqListMyWorkgroups.zul"; String gridMyWorkgroups = "/main/orders/services/reqHeadListMyWorkgroups.zul";
String gridAll = "/main/orders/requirements/reqListMyAll.zul"; String gridAll = "/main/orders/services/reqHeadListMyAll.zul";
String selectItem = "/main/selectServices.zul"; String selectItem = "/main/selectServices.zul";
</zscript> </zscript>
<window <window

@ -1,234 +0,0 @@
<?page title="${labels.AddItem}" contentType="text/html;charset=UTF-8"?>
<zk>
<window
id="selectItemsWnd"
closable="true"
border="normal"
position="center"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.requirement.SelectItems')">
<caption
src="/img/item-add.png"
zclass="form-caption"
label="${labels.AddItem}" />
<vlayout>
<tabbox
id="tabboxItems"
hflex="1">
<tabs>
<tab
id="tabMaterial"
label="${labels.AgendaMaterial}"
image="/img/palet-032.png" />
<tab
id="tabService"
label="${labels.AgendaServices}"
image="/img/painting-032.png" />
</tabs>
<tabpanels>
<tabpanel>
<toolbar>
<toolbarbutton
image="/img/funnel.png"
tooltiptext="${labels.ToolbarRecFilter}"
id="btnFilterMaterial"
onClick="@command('onFilterMaterial')" />
</toolbar>
<listbox
model="@load(vm.materialList)"
selectedItem="@bind(vm.selectedItem)">
<listhead menupopup="auto">
<listheader
label="${labels.code}"
sort="czech(code)"
width="10%" />
<listheader
label="${labels.name}"
sort="czech(name)"
width="25%" />
<listheader
label="${labels.munit}"
width="15%" />
<listheader
label="${labels.description}"
sort="czech(description)"
width="50%" />
</listhead>
<auxhead
sclass="category-center"
visible="@load(vm.activeFilterMaterial)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTmpMaterial.code)"
instant="true"
onChange="@command('doFilterMaterial')"
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.filterTmpMaterial.name)"
instant="true"
onChange="@command('doFilterMaterial')"
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">
<combobox
instant="true"
model="@load(vm.munitList)"
selectedItem="@bind(vm.filterTmpMaterial.munit)"
onChange="@command('doFilterMaterial')"
readonly="true"
sclass="find-grid-textbox">
<template name="model">
<comboitem label="@load(each.name)" />
</template>
</combobox>
</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.filterTmpMaterial.description)"
instant="true"
onChange="@command('doFilterMaterial')"
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.code)" />
<listcell label="@load(each.name)" />
<listcell label="@load(each.munit.name)" />
<listcell label="@load(each.description)" />
</listitem>
</template>
</listbox>
</tabpanel>
<tabpanel>
<toolbar>
<toolbarbutton
image="/img/funnel.png"
tooltiptext="${labels.ToolbarRecFilter}"
id="btnFilterService"
onClick="@command('onFilterService')" />
</toolbar>
<listbox
model="@load(vm.serviceItemList)"
selectedItem="@bind(vm.selectedItem)">
<listhead menupopup="auto">
<listheader
label="${labels.code}"
sort="czech(code)"
width="10%" />
<listheader
label="${labels.name}"
sort="czech(name)"
width="30%" />
<listheader
label="${labels.description}"
sort="czech(description)"
width="60%" />
</listhead>
<auxhead
sclass="category-center"
visible="@load(vm.activeFilterService)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTmpService.code)"
instant="true"
onChange="@command('doFilterService')"
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.filterTmpService.name)"
instant="true"
onChange="@command('doFilterService')"
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.filterTmpService.description)"
instant="true"
onChange="@command('doFilterService')"
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.code)" />
<listcell label="@load(each.name)" />
<listcell label="@load(each.description)" />
</listitem>
</template>
</listbox>
</tabpanel>
</tabpanels>
</tabbox>
</vlayout>
<vlayout>
<div
hflex="max"
align="right">
<button
image="~./zul/img/misc/drag-disallow.png"
label="${labels.ButtonStorno}"
onClick="selectItemsWnd.detach()"
sclass="nicebutton" />
<button
image="/img/item-add.png"
label="${labels.AddItem}"
onClick="@global-command('insertSelectedItem', selected=vm.selectedItem, window=selectItemsWnd)"
disabled="@load(empty vm.selectedItem ? 'true' : 'false')"
sclass="nicebutton" />
</div>
</vlayout>
</window>
</zk>

@ -1,234 +0,0 @@
<?page title="${labels.AddItem}" contentType="text/html;charset=UTF-8"?>
<zk>
<window
id="selectItemsWnd"
closable="true"
border="normal"
position="center"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.requirement.SelectItems')">
<caption
src="/img/item-add.png"
zclass="form-caption"
label="${labels.AddItem}" />
<vlayout>
<tabbox
id="tabboxItems"
hflex="1">
<tabs>
<tab
id="tabMaterial"
label="${labels.AgendaMaterial}"
image="/img/palet-032.png" />
<tab
id="tabService"
label="${labels.AgendaServices}"
image="/img/painting-032.png" />
</tabs>
<tabpanels>
<tabpanel>
<toolbar>
<toolbarbutton
image="/img/funnel.png"
tooltiptext="${labels.ToolbarRecFilter}"
id="btnFilterMaterial"
onClick="@command('onFilterMaterial')" />
</toolbar>
<listbox
model="@load(vm.materialList)"
selectedItem="@bind(vm.selectedItem)">
<listhead menupopup="auto">
<listheader
label="${labels.code}"
sort="czech(code)"
width="10%" />
<listheader
label="${labels.name}"
sort="czech(name)"
width="25%" />
<listheader
label="${labels.munit}"
width="15%" />
<listheader
label="${labels.description}"
sort="czech(description)"
width="50%" />
</listhead>
<auxhead
sclass="category-center"
visible="@load(vm.activeFilterMaterial)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTmpMaterial.code)"
instant="true"
onChange="@command('doFilterMaterial')"
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.filterTmpMaterial.name)"
instant="true"
onChange="@command('doFilterMaterial')"
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">
<combobox
instant="true"
model="@load(vm.munitList)"
selectedItem="@bind(vm.filterTmpMaterial.munit)"
onChange="@command('doFilterMaterial')"
readonly="true"
sclass="find-grid-textbox">
<template name="model">
<comboitem label="@load(each.name)" />
</template>
</combobox>
</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.filterTmpMaterial.description)"
instant="true"
onChange="@command('doFilterMaterial')"
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.code)" />
<listcell label="@load(each.name)" />
<listcell label="@load(each.munit.name)" />
<listcell label="@load(each.description)" />
</listitem>
</template>
</listbox>
</tabpanel>
<tabpanel>
<toolbar>
<toolbarbutton
image="/img/funnel.png"
tooltiptext="${labels.ToolbarRecFilter}"
id="btnFilterService"
onClick="@command('onFilterService')" />
</toolbar>
<listbox
model="@load(vm.serviceItemList)"
selectedItem="@bind(vm.selectedItem)">
<listhead menupopup="auto">
<listheader
label="${labels.code}"
sort="czech(code)"
width="10%" />
<listheader
label="${labels.name}"
sort="czech(name)"
width="30%" />
<listheader
label="${labels.description}"
sort="czech(description)"
width="60%" />
</listhead>
<auxhead
sclass="category-center"
visible="@load(vm.activeFilterService)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTmpService.code)"
instant="true"
onChange="@command('doFilterService')"
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.filterTmpService.name)"
instant="true"
onChange="@command('doFilterService')"
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.filterTmpService.description)"
instant="true"
onChange="@command('doFilterService')"
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.code)" />
<listcell label="@load(each.name)" />
<listcell label="@load(each.description)" />
</listitem>
</template>
</listbox>
</tabpanel>
</tabpanels>
</tabbox>
</vlayout>
<vlayout>
<div
hflex="max"
align="right">
<button
image="~./zul/img/misc/drag-disallow.png"
label="${labels.ButtonStorno}"
onClick="selectItemsWnd.detach()"
sclass="nicebutton" />
<button
image="/img/item-add.png"
label="${labels.AddItem}"
onClick="@global-command('insertSelectedItem', selected=vm.selectedItem, window=selectItemsWnd)"
disabled="@load(empty vm.selectedItem ? 'true' : 'false')"
sclass="nicebutton" />
</div>
</vlayout>
</window>
</zk>
Loading…
Cancel
Save