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_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")
private BigDecimal sumTotal;
@Column(name = "KIND")
private Long kind;
public Requirement()
{
this.setItems(new ArrayList<RequirementItem>());
@ -61,4 +64,14 @@ public class Requirement extends RequirementBase
{
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
private UserService userService;
@Autowired
private WorkgroupService workgroupService;
protected WorkgroupService workgroupService;
@Override
@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>
{
@WireVariable
private RequirementService requirementService;
protected RequirementService requirementService;
@WireVariable
private UserService userService;
protected UserService userService;
@WireVariable
private WorkgroupService workgroupService;
protected WorkgroupService workgroupService;
public List<Workgroup> getCentres()
{

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

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

@ -20,15 +20,14 @@ import org.zkoss.zk.ui.select.annotation.WireVariable;
public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
{
@WireVariable
private RequirementService requirementService;
protected RequirementService requirementService;
@WireVariable
private UserService userService;
protected UserService userService;
@WireVariable
private WorkgroupService workgroupService;
protected WorkgroupService workgroupService;
public List<Workgroup> getCentres()
{
@ -61,7 +60,8 @@ public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
@GlobalCommand
@NotifyChange({ "dataList", "dataBean", "fullFill" })
public void reloadRelated() {
public void reloadRelated()
{
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.Requirement;
import info.bukova.isspst.data.RequirementItem;
import info.bukova.isspst.data.RequirementSubject;
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.workgroups.WorkgroupService;
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.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zul.Window;
import org.zkoss.zul.impl.InputElement;
@ -39,9 +37,6 @@ public class RequirementForm extends FormViewModel<Requirement>
@WireVariable
private WorkgroupService workgroupService;
@WireVariable
private RequirementService requirementService;
private RequirementItem selectedItem;
private int selItemIndex;
@ -119,8 +114,9 @@ public class RequirementForm extends FormViewModel<Requirement>
@Command
public void addSelectedItem()
{
Window window = (Window) Executions.createComponents("/main/selectItems.zul", null, null);
window.doModal();
// Window window = (Window)
// Executions.createComponents("/main/selectItems.zul", null, null);
// window.doModal();
}
@Command
@ -151,7 +147,7 @@ public class RequirementForm extends FormViewModel<Requirement>
{
RequirementItem item = new RequirementItem();
boolean isMaterial = (selected instanceof Material);
//boolean isServiceItem = (selected instanceof ServiceItem);
// boolean isServiceItem = (selected instanceof ServiceItem);
item.setReqSubject(selected);
@ -189,7 +185,7 @@ public class RequirementForm extends FormViewModel<Requirement>
return;
}
// Recalculate selecte item
// Recalculate selected item
if ((source != null) && (source.equals("total")))
{
BigDecimal quantity = this.selectedItem.getQuantity();

@ -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
Orders=Objednávky
MaterialRequirement=Požadavek na materiál
MaterialRequirements=Požadavky na materiál
ServiceRequirement=Požadavek na servis
ServiceRequirements=Požadavky na servis
CurrentRequirements=Aktuální požadavky

@ -303,6 +303,18 @@
<property name="numberSeriesService" ref="numericSeriesService" />
</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">
<property name="dao" ref="numericSeriesDao" />
<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"?>
<zk>
<zscript>
String gridMy = "/main/orders/requirements/reqListMy.zul";
String gridMyCenters = "/main/orders/requirements/reqListMyCenters.zul";
String gridMyWorkgroups = "/main/orders/requirements/reqListMyWorkgroups.zul";
String gridAll = "/main/orders/requirements/reqListMyAll.zul";
String gridMy = "/main/orders/material/reqHeadListMy.zul";
String gridMyCenters = "/main/orders/material/reqHeadListMyCenters.zul";
String gridMyWorkgroups = "/main/orders/material/reqHeadListMyWorkgroups.zul";
String gridAll = "/main/orders/material/reqHeadListMyAll.zul";
String selectItem = "/main/selectMaterial.zul";
</zscript>
<window

@ -1,18 +1,4 @@
<?page title="${labels.RequirementsFormTitle}" 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.requirement.RequirementForm')"
validationMessages="@id('vmsg')">
<caption
image="/img/req-order-032.png"
zclass="form-caption"
label="${labels.RequirementsFormTitle}" />
<vlayout
<vlayout
form="@id('fx') @load(vm.dataBean) @save(vm.dataBean, before='save') @validator(vm.requirementFormValidator)"
hflex="1">
<grid hflex="min">
@ -201,6 +187,4 @@
</template>
</listbox>
<include src="/app/formButtons.zul" />
</vlayout>
</window>
</zk>
</vlayout>

@ -1,12 +1,4 @@
<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.requirements.ReqListMy')">
<include src="/app/toolbar.zul" />
<listbox
<listbox
vflex="1"
selectedItem="@bind(vm.dataBean)"
model="@load(vm.dataList)"
@ -141,6 +133,4 @@
<listcell label="@load(each.description)" />
</listitem>
</template>
</listbox>
</window>
</zk>
</listbox>

@ -1,12 +1,4 @@
<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.requirements.ReqListMyAll')">
<include src="/main/toolbar.zul" />
<hbox vflex="1">
<hbox vflex="1">
<listbox
vflex="1"
hflex="7"
@ -147,6 +139,4 @@
<div hflex="3">
<include src="/main/approveStatus.zul" />
</div>
</hbox>
</window>
</zk>
</hbox>

@ -1,12 +1,4 @@
<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.requirements.ReqListMyCenters')">
<include src="/main/toolbar.zul" />
<hbox vflex="1">
<hbox vflex="1">
<listbox
vflex="1"
hflex="7"
@ -147,6 +139,4 @@
<div hflex="3">
<include src="/main/approveStatus.zul" />
</div>
</hbox>
</window>
</zk>
</hbox>

@ -1,12 +1,4 @@
<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.requirements.ReqListMyWorkgroups')">
<include src="/main/toolbar.zul" />
<hbox vflex="1">
<hbox vflex="1">
<listbox
vflex="1"
hflex="7"
@ -147,6 +139,4 @@
<div hflex="3">
<include src="/main/approveStatus.zul" />
</div>
</hbox>
</window>
</zk>
</hbox>

@ -6,7 +6,7 @@
border="normal"
position="center"
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
src="/img/item-add.png"
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"?>
<zk>
<zscript>
String gridMy = "/main/orders/requirements/reqListMy.zul";
String gridMyCenters = "/main/orders/requirements/reqListMyCenters.zul";
String gridMyWorkgroups = "/main/orders/requirements/reqListMyWorkgroups.zul";
String gridAll = "/main/orders/requirements/reqListMyAll.zul";
String gridMy = "/main/orders/services/reqHeadListMy.zul";
String gridMyCenters = "/main/orders/services/reqHeadListMyCenters.zul";
String gridMyWorkgroups = "/main/orders/services/reqHeadListMyWorkgroups.zul";
String gridAll = "/main/orders/services/reqHeadListMyAll.zul";
String selectItem = "/main/selectServices.zul";
</zscript>
<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