Author: jacopoc
Date: Tue Mar 2 15:31:03 2010
New Revision: 918077
URL: http://svn.apache.org/viewvc?rev=918077&view=rev
Log:
First step in the direction of making the calendar screens more reusable and
extensible: a screen is now used to generate the content of an event.
I have also added specific content for production run header and tasks but we
could further improve with each component overriding the screenlet.
Added:
ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/calendarEventContent.ftl
(with props)
Modified:
ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/day.ftl
ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/month.ftl
ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/week.ftl
ofbiz/trunk/applications/workeffort/widget/CalendarScreens.xml
Added:
ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/calendarEventContent.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/calendarEventContent.ftl?rev=918077&view=auto
==============================================================================
---
ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/calendarEventContent.ftl
(added)
+++
ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/calendarEventContent.ftl
Tue Mar 2 15:31:03 2010
@@ -0,0 +1,35 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<#if workEffort.workEffortTypeId == "PROD_ORDER_HEADER">
+ <a
href="/manufacturing/control/ShowProductionRun?productionRunId=${workEffort.workEffortId}"
class="event">
+ ${workEffort.workEffortId}
+ </a>
+ ${workEffort.workEffortName?default("Undefined")}
+<#elseif workEffort.workEffortTypeId == "PROD_ORDER_TASK">
+ <a
href="/manufacturing/control/ShowProductionRun?productionRunId=${workEffort.workEffortId}"
class="event">
+ ${workEffort.workEffortParentId} / ${workEffort.workEffortId}
+ </a>
+ ${workEffort.workEffortName?default("Undefined")}<#if
workEffort.reservPersons?exists> Persons:${workEffort.reservPersons}</#if>
+<#else>
+ <a
href="<@ofbizUrl>${parameters._LAST_VIEW_NAME_}?form=edit&parentTypeId=${parentTypeId?if_exists}&period=${periodType?if_exists}&start=${parameters.start?if_exists}&workEffortId=${workEffort.workEffortId}${addlParam?if_exists}${urlParam?if_exists}</@ofbizUrl>"
class="event">
+ ${workEffort.workEffortId}
+ </a>
+ ${workEffort.workEffortName?default("")}
+</#if>
Propchange:
ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/calendarEventContent.ftl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/calendarEventContent.ftl
------------------------------------------------------------------------------
svn:keywords = Date Rev Author URL Id
Propchange:
ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/calendarEventContent.ftl
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/day.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/day.ftl?rev=918077&r1=918076&r2=918077&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/day.ftl
(original)
+++ ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/day.ftl Tue
Mar 2 15:31:03 2010
@@ -68,7 +68,11 @@
<#else>
${startDate?time?string.short}-${completionDate?time?string.short}
</#if>
- <br/><a
href="<@ofbizUrl>${parameters._LAST_VIEW_NAME_}?form=edit&period=day&start=${parameters.start?if_exists}&workEffortId=${calEntry.workEffort.workEffortId}${urlParam?if_exists}${addlParam?if_exists}</@ofbizUrl>">${calEntry.workEffort.workEffortName?default("Undefined")}</a> </td>
+ <br/>
+ ${setRequestAttribute("periodType", "day")}
+ ${setRequestAttribute("workEffortId", calEntry.workEffort.workEffortId)}
+
${screens.render("component://workeffort/widget/CalendarScreens.xml#calendarEventContent")}
+ </td>
</#if>
</#list>
<#if (period.calendarEntries?size < maxConcurrentEntries)>
Modified:
ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/month.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/month.ftl?rev=918077&r1=918076&r2=918077&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/month.ftl
(original)
+++ ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/month.ftl
Tue Mar 2 15:31:03 2010
@@ -84,7 +84,9 @@
${startDate?time?string.short}-${completionDate?time?string.short}
</#if>
<br/>
- <a
href="<@ofbizUrl>${parameters._LAST_VIEW_NAME_}?form=edit&parentTypeId=${parentTypeId?if_exists}&period=month&start=${parameters.start?if_exists}&workEffortId=${calEntry.workEffort.workEffortId}${urlParam?if_exists}${addlParam?if_exists}</@ofbizUrl>"
class="event">${calEntry.workEffort.workEffortName?default("Undefined")}</a> ${calEntry.eventStatus?default(" ")}
+ ${setRequestAttribute("periodType", "month")}
+ ${setRequestAttribute("workEffortId",
calEntry.workEffort.workEffortId)}
+
${screens.render("component://workeffort/widget/CalendarScreens.xml#calendarEventContent")}
<br/>
</#list>
</td>
Modified:
ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/week.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/week.ftl?rev=918077&r1=918076&r2=918077&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/week.ftl
(original)
+++ ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/week.ftl Tue
Mar 2 15:31:03 2010
@@ -70,7 +70,11 @@
<#else>
${startDate?time?string.short}-${completionDate?time?string.short}
</#if>
- <br/><a
href="<@ofbizUrl>${parameters._LAST_VIEW_NAME_}?form=edit&parentTypeId=${parentTypeId?if_exists}&period=week&start=${parameters.start?if_exists}&workEffortId=${calEntry.workEffort.workEffortId}${addlParam?if_exists}${urlParam?if_exists}</@ofbizUrl>"
class="event">${calEntry.workEffort.workEffortName?default("Undefined")}</a> </td>
+ <br/>
+ ${setRequestAttribute("periodType", "week")}
+ ${setRequestAttribute("workEffortId", calEntry.workEffort.workEffortId)}
+
${screens.render("component://workeffort/widget/CalendarScreens.xml#calendarEventContent")}
+ </td>
</#if>
</#list>
<#if (period.calendarEntries?size < maxConcurrentEntries)>
Modified: ofbiz/trunk/applications/workeffort/widget/CalendarScreens.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/widget/CalendarScreens.xml?rev=918077&r1=918076&r2=918077&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/widget/CalendarScreens.xml (original)
+++ ofbiz/trunk/applications/workeffort/widget/CalendarScreens.xml Tue Mar 2
15:31:03 2010
@@ -223,6 +223,16 @@
</widgets>
</section>
</screen>
-
-
+ <screen name="calendarEventContent">
+ <section>
+ <actions>
+ <set field="periodType" value="${groovy:
request.getAttribute('periodType');}"/>
+ <set field="workEffortId" value="${groovy:
request.getAttribute('workEffortId');}"/>
+ <entity-one entity-name="WorkEffort" value-field="workEffort"/>
+ </actions>
+ <widgets>
+ <platform-specific><html><html-template
location="component://workeffort/webapp/workeffort/calendar/calendarEventContent.ftl"/></html></platform-specific>
+ </widgets>
+ </section>
+ </screen>
</screens>
\ No newline at end of file