Author: ashish
Date: Mon Jun 27 08:00:28 2016 New Revision: 1750300 URL: http://svn.apache.org/viewvc?rev=1750300&view=rev Log: Applied patch from jira issue - OFBIZ-7569 - Remove HtmlFormWrapper dependencies from Calendar Exception Week screen. Thanks Ravi for the contribution. Modified: ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionWeek.groovy ofbiz/trunk/applications/manufacturing/template/routing/EditCalendarExceptionWeek.ftl ofbiz/trunk/applications/manufacturing/widget/manufacturing/CalendarScreens.xml Modified: ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionWeek.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionWeek.groovy?rev=1750300&r1=1750299&r2=1750300&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionWeek.groovy (original) +++ ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionWeek.groovy Mon Jun 27 08:00:28 2016 @@ -18,7 +18,6 @@ */ -import org.ofbiz.widget.renderer.html.HtmlFormWrapper; import org.ofbiz.base.util.*; if (security.hasEntityPermission("MANUFACTURING", "_VIEW", session)) { @@ -32,6 +31,7 @@ calendarExceptionWeeks = []; calendarId = parameters.calendarId ?: request.getAttribute("calendarId");; if (calendarId) { techDataCalendar = from("TechDataCalendar").where("calendarId", calendarId).queryOne(); + context.techDataCalendar = techDataCalendar; } if (techDataCalendar) { calendarExceptionWeeks = techDataCalendar.getRelated("TechDataCalendarExcWeek", null, null, false); @@ -40,27 +40,15 @@ calendarExceptionWeeksDatas = []; calendarExceptionWeeks.each { calendarExceptionWeek -> calendarWeek = calendarExceptionWeek.getRelatedOne("TechDataCalendarWeek", false); calendarExceptionWeeksDatas.add([calendarExceptionWeek : calendarExceptionWeek , calendarWeek : calendarWeek]); + context.calendarExceptionWeeksDatas = calendarExceptionWeeksDatas; } -HtmlFormWrapper listCalendarExceptionWeekWrapper = new HtmlFormWrapper("component://manufacturing/widget/manufacturing/CalendarForms.xml", "ListCalendarExceptionWeek", request, response); -listCalendarExceptionWeekWrapper.putInContext("calendarExceptionWeeksDatas", calendarExceptionWeeksDatas); - -HtmlFormWrapper addCalendarExceptionWeekWrapper = new HtmlFormWrapper("component://manufacturing/widget/manufacturing/CalendarForms.xml", "AddCalendarExceptionWeek", request, response); -addCalendarExceptionWeekWrapper.putInContext("techDatacalendar", techDataCalendar); - -context.techDataCalendar = techDataCalendar; -context.listCalendarExceptionWeekWrapper = listCalendarExceptionWeekWrapper; -context.addCalendarExceptionWeekWrapper = addCalendarExceptionWeekWrapper; - exceptionDateStart = parameters.exceptionDateStart ?: request.getAttribute("exceptionDateStart"); exceptionDateStart = ObjectType.simpleTypeConvert(exceptionDateStart, "java.sql.Date", null, null); if (exceptionDateStart) { calendarExceptionWeek = from("TechDataCalendarExcWeek").where("calendarId", calendarId , "exceptionDateStart", exceptionDateStart).queryOne(); if (calendarExceptionWeek) { - HtmlFormWrapper updateCalendarExceptionWeekWrapper = new HtmlFormWrapper("component://manufacturing/widget/manufacturing/CalendarForms.xml", "UpdateCalendarExceptionWeek", request, response); - updateCalendarExceptionWeekWrapper.putInContext("calendarExceptionWeek", calendarExceptionWeek); context.calendarExceptionWeek = calendarExceptionWeek; - context.updateCalendarExceptionWeekWrapper = updateCalendarExceptionWeekWrapper; } -} +} \ No newline at end of file Modified: ofbiz/trunk/applications/manufacturing/template/routing/EditCalendarExceptionWeek.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/template/routing/EditCalendarExceptionWeek.ftl?rev=1750300&r1=1750299&r2=1750300&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/template/routing/EditCalendarExceptionWeek.ftl (original) +++ ofbiz/trunk/applications/manufacturing/template/routing/EditCalendarExceptionWeek.ftl Mon Jun 27 08:00:28 2016 @@ -25,7 +25,8 @@ under the License. [${uiLabelMap.CommonId} ${techDataCalendar.calendarId!}]</h3> </div> <div class="screenlet-body"> - ${listCalendarExceptionWeekWrapper.renderFormString(context)} + ${setRequestAttribute("calendarExceptionWeeksDatas", calendarExceptionWeeksDatas)} + ${screens.render("component://manufacturing/widget/manufacturing/CalendarScreens.xml#ListCalendarExceptionWeek")} </div> </div> <#if calendarExceptionWeek?has_content> @@ -34,7 +35,8 @@ under the License. <h3>${uiLabelMap.PageTitleEditCalendarExceptionWeek}</h3> </div> <div class="screenlet-body"> - ${updateCalendarExceptionWeekWrapper.renderFormString(context)} + ${setRequestAttribute("calendarExceptionWeek", calendarExceptionWeek)} + ${screens.render("component://manufacturing/widget/manufacturing/CalendarScreens.xml#UpdateCalendarExceptionWeek")} </div> </div> </#if> @@ -43,7 +45,8 @@ under the License. <h3>${uiLabelMap.PageTitleAddCalendarExceptionWeek}</h3> </div> <div class="screenlet-body"> - ${addCalendarExceptionWeekWrapper.renderFormString(context)} + ${setRequestAttribute("techDataCalendar", techDataCalendar)} + ${screens.render("component://manufacturing/widget/manufacturing/CalendarScreens.xml#AddCalendarExceptionWeek")} </div> </div> </#if> \ No newline at end of file Modified: ofbiz/trunk/applications/manufacturing/widget/manufacturing/CalendarScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/widget/manufacturing/CalendarScreens.xml?rev=1750300&r1=1750299&r2=1750300&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/widget/manufacturing/CalendarScreens.xml (original) +++ ofbiz/trunk/applications/manufacturing/widget/manufacturing/CalendarScreens.xml Mon Jun 27 08:00:28 2016 @@ -186,4 +186,34 @@ under the License. </widgets> </section> </screen> -</screens> + <screen name="ListCalendarExceptionWeek"> + <section> + <actions> + <set field="calendarExceptionWeeksDatas" value="${groovy: request.getAttribute('calendarExceptionWeeksDatas');}"/> + </actions> + <widgets> + <include-form name="ListCalendarExceptionWeek" location="component://manufacturing/widget/manufacturing/CalendarForms.xml"/> + </widgets> + </section> + </screen> + <screen name="AddCalendarExceptionWeek"> + <section> + <actions> + <set field="techDataCalendar" value="${groovy: request.getAttribute('techDataCalendar');}"/> + </actions> + <widgets> + <include-form name="AddCalendarExceptionWeek" location="component://manufacturing/widget/manufacturing/CalendarForms.xml"/> + </widgets> + </section> + </screen> + <screen name="UpdateCalendarExceptionWeek"> + <section> + <actions> + <set field="calendarExceptionWeek" value="${groovy: request.getAttribute('calendarExceptionWeek');}"/> + </actions> + <widgets> + <include-form name="UpdateCalendarExceptionWeek" location="component://manufacturing/widget/manufacturing/CalendarForms.xml"/> + </widgets> + </section> + </screen> +</screens> \ No newline at end of file |
Free forum by Nabble | Edit this page |