Author: ashish
Date: Mon Jun 27 08:15:12 2016
New Revision: 1750307
URL: http://svn.apache.org/viewvc?rev=1750307&view=rev
Log:
Applied patch from jira issue - OFBIZ-7568 - Remove HtmlFormWrapper
dependencies from Calendar Exception Day screen.
Thanks Ravi for the contribution.
Modified:
ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionDay.groovy
ofbiz/trunk/applications/manufacturing/template/routing/EditCalendarExceptionDay.ftl
ofbiz/trunk/applications/manufacturing/widget/manufacturing/CalendarScreens.xml
Modified:
ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionDay.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionDay.groovy?rev=1750307&r1=1750306&r2=1750307&view=diff
==============================================================================
---
ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionDay.groovy
(original)
+++
ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionDay.groovy
Mon Jun 27 08:15:12 2016
@@ -21,7 +21,6 @@
import java.util.*;
import org.ofbiz.base.util.*;
import org.ofbiz.entity.*;
-import org.ofbiz.widget.renderer.html.HtmlFormWrapper;
if (security.hasEntityPermission("MANUFACTURING", "_VIEW", session)) {
context.hasPermission = Boolean.TRUE;
@@ -34,19 +33,12 @@ calendarExceptionDays = [];
calendarId = parameters.calendarId ?: request.getAttribute("calendarId");
if (calendarId) {
techDataCalendar = from("TechDataCalendar").where("calendarId",
calendarId).queryOne();
+ context.techDataCalendar = techDataCalendar;
}
if (techDataCalendar) {
calendarExceptionDays =
techDataCalendar.getRelated("TechDataCalendarExcDay", null, null, false);
+ context.calendarExceptionDays = calendarExceptionDays;
}
-HtmlFormWrapper listCalendarExceptionDayWrapper = new
HtmlFormWrapper("component://manufacturing/widget/manufacturing/CalendarForms.xml",
"ListCalendarExceptionDay", request, response);
-listCalendarExceptionDayWrapper.putInContext("calendarExceptionDays",
calendarExceptionDays);
-
-HtmlFormWrapper addCalendarExceptionDayWrapper = new
HtmlFormWrapper("component://manufacturing/widget/manufacturing/CalendarForms.xml",
"AddCalendarExceptionDay", request, response);
-addCalendarExceptionDayWrapper.putInContext("techDataCalendar",
techDataCalendar);
-
-context.techDataCalendar = techDataCalendar;
-context.listCalendarExceptionDayWrapper = listCalendarExceptionDayWrapper;
-context.addCalendarExceptionDayWrapper = addCalendarExceptionDayWrapper;
exceptionDateStartTime = parameters.exceptionDateStartTime ?:
request.getAttribute("exceptionDateStartTime");
exceptionDateStartTime = ObjectType.simpleTypeConvert(exceptionDateStartTime,
"Timestamp", null, null);
@@ -54,9 +46,6 @@ exceptionDateStartTime = ObjectType.simp
if (exceptionDateStartTime) {
calendarExceptionDay = from("TechDataCalendarExcDay").where("calendarId",
calendarId , "exceptionDateStartTime", exceptionDateStartTime).queryOne();
if (calendarExceptionDay) {
- HtmlFormWrapper updateCalendarExceptionDayWrapper = new
HtmlFormWrapper("component://manufacturing/widget/manufacturing/CalendarForms.xml",
"UpdateCalendarExceptionDay", request, response);
- updateCalendarExceptionDayWrapper.putInContext("calendarExceptionDay",
calendarExceptionDay);
context.calendarExceptionDay = calendarExceptionDay;
- context.updateCalendarExceptionDayWrapper =
updateCalendarExceptionDayWrapper;
}
}
Modified:
ofbiz/trunk/applications/manufacturing/template/routing/EditCalendarExceptionDay.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/template/routing/EditCalendarExceptionDay.ftl?rev=1750307&r1=1750306&r2=1750307&view=diff
==============================================================================
---
ofbiz/trunk/applications/manufacturing/template/routing/EditCalendarExceptionDay.ftl
(original)
+++
ofbiz/trunk/applications/manufacturing/template/routing/EditCalendarExceptionDay.ftl
Mon Jun 27 08:15:12 2016
@@ -25,7 +25,8 @@ under the License.
[${uiLabelMap.CommonId} ${techDataCalendar.calendarId!}]</h3>
</div>
<div class="screenlet-body">
- ${listCalendarExceptionDayWrapper.renderFormString(context)}
+ ${setRequestAttribute("calendarExceptionDays", calendarExceptionDays)}
+
${screens.render("component://manufacturing/widget/manufacturing/CalendarScreens.xml#ListCalendarExceptionDay")}
</div>
</div>
<#if calendarExceptionDay?has_content>
@@ -34,7 +35,8 @@ under the License.
<h3>${uiLabelMap.PageTitleEditCalendarExceptionWeek}</h3>
</div>
<div class="screenlet-body">
- ${updateCalendarExceptionDayWrapper.renderFormString(context)}
+ ${setRequestAttribute("calendarExceptionDay", calendarExceptionDay)}
+
${screens.render("component://manufacturing/widget/manufacturing/CalendarScreens.xml#UpdateCalendarExceptionDay")}
</div>
</div>
</#if>
@@ -43,7 +45,8 @@ under the License.
<h3>${uiLabelMap.PageTitleAddCalendarExceptionWeek}</h3>
</div>
<div class="screenlet-body">
- ${addCalendarExceptionDayWrapper.renderFormString(context)}
+ ${setRequestAttribute("techDataCalendar", techDataCalendar)}
+
${screens.render("component://manufacturing/widget/manufacturing/CalendarScreens.xml#AddCalendarExceptionDay")}
</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=1750307&r1=1750306&r2=1750307&view=diff
==============================================================================
---
ofbiz/trunk/applications/manufacturing/widget/manufacturing/CalendarScreens.xml
(original)
+++
ofbiz/trunk/applications/manufacturing/widget/manufacturing/CalendarScreens.xml
Mon Jun 27 08:15:12 2016
@@ -216,4 +216,34 @@ under the License.
</widgets>
</section>
</screen>
+ <screen name="ListCalendarExceptionDay">
+ <section>
+ <actions>
+ <set field="calendarExceptionDays" value="${groovy:
request.getAttribute('calendarExceptionDays');}"/>
+ </actions>
+ <widgets>
+ <include-form name="ListCalendarExceptionDay"
location="component://manufacturing/widget/manufacturing/CalendarForms.xml"/>
+ </widgets>
+ </section>
+ </screen>
+ <screen name="AddCalendarExceptionDay">
+ <section>
+ <actions>
+ <set field="techDataCalendar" value="${groovy:
request.getAttribute('techDataCalendar');}"/>
+ </actions>
+ <widgets>
+ <include-form name="AddCalendarExceptionDay"
location="component://manufacturing/widget/manufacturing/CalendarForms.xml"/>
+ </widgets>
+ </section>
+ </screen>
+ <screen name="UpdateCalendarExceptionDay">
+ <section>
+ <actions>
+ <set field="calendarExceptionDay" value="${groovy:
request.getAttribute('calendarExceptionDay');}"/>
+ </actions>
+ <widgets>
+ <include-form name="UpdateCalendarExceptionDay"
location="component://manufacturing/widget/manufacturing/CalendarForms.xml"/>
+ </widgets>
+ </section>
+ </screen>
</screens>
\ No newline at end of file