From 933f5e784bc94a2968197242b09d45ee84e55a50 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Wed, 6 May 2015 15:22:07 +0200 Subject: [PATCH] =?UTF-8?q?V=20dialogu=20pro=20zobrazen=C3=AD=20vy=C3=BA?= =?UTF-8?q?=C4=8Dtov=C3=A1n=C3=AD=20slu=C5=BEebn=C3=AD=20cesty=20se=20po?= =?UTF-8?q?=20otev=C5=99en=C3=AD=20p=C5=99epne=20z=C3=A1lo=C5=BEka=20na=20?= =?UTF-8?q?prvn=C3=AD=20neschv=C3=A1len=C3=A9=20vy=C3=BA=C4=8Dtov=C3=A1n?= =?UTF-8?q?=C3=AD.=20refs=20#212?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../isspst/ui/tripbill/TripBillSummaryVM.java | 33 +++++++++++++++++++ .../requirements/tripBillSummaryMaster.zul | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/main/java/info/bukova/isspst/ui/tripbill/TripBillSummaryVM.java b/src/main/java/info/bukova/isspst/ui/tripbill/TripBillSummaryVM.java index c2a01d9d..12aca4c8 100644 --- a/src/main/java/info/bukova/isspst/ui/tripbill/TripBillSummaryVM.java +++ b/src/main/java/info/bukova/isspst/ui/tripbill/TripBillSummaryVM.java @@ -1,5 +1,6 @@ package info.bukova.isspst.ui.tripbill; +import info.bukova.isspst.data.RequirementState; import info.bukova.isspst.data.TripBill; import info.bukova.isspst.data.TripBillApproval; import info.bukova.isspst.services.requirement.TripRequirementService; @@ -33,10 +34,12 @@ public class TripBillSummaryVM extends RequirementSubpage { @WireVariable private TripRequirementService tripRequirementService; private TripBill bill; + private Map selTab; @Init(superclass = true) public void initBillSummary(@ExecutionArgParam("bill") TripBill bill) { service = tripBillApprovalService; + selTab = new HashMap(); if (bill.getApproval() != null) { setDataBean(bill.getApproval()); @@ -54,19 +57,45 @@ public class TripBillSummaryVM extends RequirementSubpage { public void setBill(@BindingParam("bill") TripBill bill) { this.bill = bill; setDataBean(bill.getApproval()); + + for (Integer i : selTab.keySet()) { + selTab.put(i, false); + } + + selTab.put(bill.getId(), true); } public List getBills() { List bills = new ArrayList(); + boolean isSelectedTad = false; bills.add(this.bill); + + if (bill.getApproval().getState() != RequirementState.APPROVED) { + isSelectedTad = true; + selTab.put(bill.getId(), true); + } else { + selTab.put(bill.getId(), false); + } + for (TripBill b : tripRequirementService.getBills(bill.getRequirement())) { if (b.getId() != bill.getId()) { tripBillService.loadLazyData(b); bills.add(b); + + if (!isSelectedTad && b.getApproval().getState() != RequirementState.APPROVED) { + setBill(b); + isSelectedTad = true; + } else { + selTab.put(b.getId(), false); + } } } + if (!isSelectedTad) { + selTab.put(bill.getId(), true); + } + return bills; } @@ -84,4 +113,8 @@ public class TripBillSummaryVM extends RequirementSubpage { public void reload() { setDataBean(tripBillApprovalService.getById(bill.getApproval().getId())); } + + public Map getSelTab() { + return selTab; + } } diff --git a/src/main/webapp/main/trips/requirements/tripBillSummaryMaster.zul b/src/main/webapp/main/trips/requirements/tripBillSummaryMaster.zul index 5534ce2f..109c6eca 100644 --- a/src/main/webapp/main/trips/requirements/tripBillSummaryMaster.zul +++ b/src/main/webapp/main/trips/requirements/tripBillSummaryMaster.zul @@ -21,7 +21,7 @@