Skip to content

Commit bf10e54

Browse files
admin: TaxZone2Zone
1 parent bba8271 commit bf10e54

File tree

6 files changed

+54
-4
lines changed

6 files changed

+54
-4
lines changed

src/main/java/org/woehlke/greenshop/admin/AdminLocationTaxesController.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ public String taxZone(@PathVariable long taxZoneId, Model model){
218218
thisZone = zones.iterator().next();
219219
}
220220
model.addAttribute("thisZone",thisZone);
221+
logger.info("zones: "+zones.toString());
222+
logger.info("thisZone: "+thisZone.toString());
221223
return "admin/taxZone";
222224
}
223225

@@ -234,6 +236,22 @@ public String taxZoneWithZoneId(@PathVariable long taxZoneId, @PathVariable long
234236
return "admin/taxZone";
235237
}
236238

239+
@RequestMapping(value = "/admin/taxZone/{taxZoneId}/insert", method = RequestMethod.GET)
240+
public String taxZoneInsertForm(@PathVariable long taxZoneId, Model model){
241+
int menuCategory = AdminMenuCategory.LOCATION_TAXES.ordinal();
242+
model.addAttribute("menuCategory",menuCategory);
243+
TaxZone thisTaxZone = adminService.findTaxZoneById(taxZoneId);
244+
model.addAttribute("thisTaxZone",thisTaxZone);
245+
List<TaxZone2Zone> zones = adminService.findZonesByTaxZone(thisTaxZone);
246+
model.addAttribute("zones",zones);
247+
TaxZone2Zone thisZone = null;
248+
if(zones.size()>0){
249+
thisZone = zones.iterator().next();
250+
}
251+
model.addAttribute("thisZone",thisZone);
252+
return "admin/taxZoneInsertForm";
253+
}
254+
237255
@RequestMapping(value = "/admin/taxClasses", method = RequestMethod.GET)
238256
public String taxClasses(Model model){
239257
int menuCategory = AdminMenuCategory.LOCATION_TAXES.ordinal();

src/main/webapp/WEB-INF/jsp/admin/admin-tiles.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,18 @@
8787
<put-attribute name="bodyContent" value="/WEB-INF/jsp/admin/taxZone.jsp" />
8888
</definition>
8989

90+
<definition name="admin/taxZoneInsertForm" extends="backend">
91+
<put-attribute name="bodyContent" value="/WEB-INF/jsp/admin/taxZoneInsertForm.jsp" />
92+
</definition>
93+
94+
<definition name="admin/taxZoneDeleteForm" extends="backend">
95+
<put-attribute name="bodyContent" value="/WEB-INF/jsp/admin/taxZoneDeleteForm.jsp" />
96+
</definition>
97+
98+
<definition name="admin/taxZoneEditForm" extends="backend">
99+
<put-attribute name="bodyContent" value="/WEB-INF/jsp/admin/taxZoneEditForm.jsp" />
100+
</definition>
101+
90102
<definition name="admin/taxClasses" extends="backend">
91103
<put-attribute name="bodyContent" value="/WEB-INF/jsp/admin/taxClasses.jsp" />
92104
</definition>

src/main/webapp/WEB-INF/jsp/admin/taxZone.jsp

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,28 @@
2222
<c:if test="${zone.zone.id == thisZone.zone.id}">
2323
<tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<c:url value="/admin/taxZone/${thisTaxZone.id}/zone/${zone.id}"/>'">
2424
<td class="dataTableContent">${zone.zoneCountry.name}</td>
25-
<td class="dataTableContent">${zone.zone.name}</td>
25+
<c:choose>
26+
<c:when test="${zone.zone == null}">
27+
<td class="dataTableContent">All Zones</td>
28+
</c:when>
29+
<c:otherwise>
30+
<td class="dataTableContent"><:out value="${zone.zone.name}"/></td>
31+
</c:otherwise>
32+
</c:choose>
2633
<td class="dataTableContent" align="right"><img src="resources/admin/images/icon_arrow_right.gif" border="0" alt="" />&nbsp;</td>
2734
</tr>
2835
</c:if>
2936
<c:if test="${zone.zone.id != thisZone.zone.id}">
3037
<tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<c:url value="/admin/taxZone/${thisTaxZone.id}/zone/${zone.id}"/>'">
3138
<td class="dataTableContent">${zone.zoneCountry.name}</td>
32-
<td class="dataTableContent">${zone.zone.name}</td>
39+
<c:choose>
40+
<c:when test="${zone.zone == null}">
41+
<td class="dataTableContent">All Zones</td>
42+
</c:when>
43+
<c:otherwise>
44+
<td class="dataTableContent"><:out value="${zone.zone.name}"/></td>
45+
</c:otherwise>
46+
</c:choose>
3347
<td class="dataTableContent" align="right"><a href="<c:url value="/admin/taxZone/${thisTaxZone.id}/zone/${zone.zone.id}"/>"><img src="resources/admin/images/icon_info.gif" border="0" alt="Info" title="Info" /></a>&nbsp;</td>
3448
</tr>
3549
</c:if>
@@ -43,15 +57,15 @@
4357
</table></td>
4458
</tr>
4559
<tr>
46-
<td class="smallText" align="right" colspan="3"><span class="tdbLink"><a id="tdb1" href="<c:url value="/admin/taxZones/${thisTaxZone.id}"/>">Back</a></span><script type="text/javascript">$("#tdb1").button({icons:{primary:"ui-icon-triangle-1-w"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><span class="tdbLink"><a id="tdb2" href="http://shadowfax/oscommerce2/admin/geo_zones.php?zpage=1&zID=2&action=list&spage=1&sID=2&saction=new&osCAdminID=r9ji9b4276mi3itiavgakf9lb5">Insert</a></span><script type="text/javascript">$("#tdb2").button({icons:{primary:"ui-icon-plus"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script></td>
60+
<td class="smallText" align="right" colspan="3"><span class="tdbLink"><a id="tdb1" href="<c:url value="/admin/taxZones/${thisTaxZone.id}"/>">Back</a></span><script type="text/javascript">$("#tdb1").button({icons:{primary:"ui-icon-triangle-1-w"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><span class="tdbLink"><a id="tdb2" href="<c:url value="/admin/taxZone/${thisTaxZone.id}/insert"/>">Insert</a></span><script type="text/javascript">$("#tdb2").button({icons:{primary:"ui-icon-plus"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script></td>
4761
</tr>
4862
</table>
4963
</td>
5064
<c:if test="${zones.size() > 0}">
5165
<td width="25%" valign="top">
5266
<table border="0" width="100%" cellspacing="0" cellpadding="2">
5367
<tr class="infoBoxHeading">
54-
<td class="infoBoxHeading"><strong>${thisZone.zone.name}</strong></td>
68+
<td class="infoBoxHeading"><strong>${thisZone.zoneCountry.name}</strong></td>
5569
</tr>
5670
</table>
5771
<table border="0" width="100%" cellspacing="0" cellpadding="2">
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<%@ include file="/WEB-INF/layout/taglibs.jsp"%>
2+
<h1>Delete</h1>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<%@ include file="/WEB-INF/layout/taglibs.jsp"%>
2+
<h1>Edit</h1>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<%@ include file="/WEB-INF/layout/taglibs.jsp"%>
2+
<h1>Insert</h1>

0 commit comments

Comments
 (0)