Skip to content
This repository has been archived by the owner on May 9, 2020. It is now read-only.

Commit

Permalink
Applied patch from jira issue - OFBIZ-7568 - Remove HtmlFormWrapper d…
Browse files Browse the repository at this point in the history
…ependencies from Calendar Exception Day screen.

Thanks Ravi for the contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1750307 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
ashishvijaywargiya committed Jun 27, 2016
1 parent 545fa94 commit 9f598d9
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -34,29 +33,19 @@ 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);

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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -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>

0 comments on commit 9f598d9

Please sign in to comment.