[OFBiz] SVN: r7906 - in trunk/applications: ecommerce/widget order/webapp/ordermgr/request order/widget/ordermgr
jacopo@svn.ofbiz.org
jacopo at svn.ofbiz.org
Fri Jun 30 00:43:53 CDT 2006
Author: jacopo
Date: 2006-06-30 00:43:15 -0500 (Fri, 30 Jun 2006)
New Revision: 7906
Added:
trunk/applications/order/webapp/ordermgr/request/requestDate.ftl
trunk/applications/order/webapp/ordermgr/request/requestInfo.ftl
trunk/applications/order/webapp/ordermgr/request/requestRoles.ftl
Removed:
trunk/applications/order/webapp/ordermgr/request/ViewRequestInfo.ftl
Modified:
trunk/applications/ecommerce/widget/RequestScreens.xml
trunk/applications/order/widget/ordermgr/RequestScreens.xml
Log:
The CustRequest view report has been refactored into reusable screenlets.
This commit splits up the ViewRequestInfo.ftl file into 3 freemarker templates and also creates appropriate updates to RequestScreens.xml in the order application as well as the ecommerce application.
Thanks to Chris Howe for the patch (Apache OFBIZ-68), I've committed a slightly modified version of it.
Modified: trunk/applications/ecommerce/widget/RequestScreens.xml
===================================================================
--- trunk/applications/ecommerce/widget/RequestScreens.xml 2006-06-30 00:12:48 UTC (rev 7905)
+++ trunk/applications/ecommerce/widget/RequestScreens.xml 2006-06-30 05:43:15 UTC (rev 7906)
@@ -26,6 +26,17 @@
<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/widget-screen.xsd">
+ <screen name="CommonRequestDecorator">
+ <section>
+ <widgets>
+ <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+ <decorator-section name="body">
+ <decorator-section-include name="body"/>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
<screen name="ListRequests">
<section>
<actions>
@@ -73,14 +84,9 @@
</actions>
<widgets>
- <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonRequestDecorator">
<decorator-section name="body">
- <platform-specific>
- <html><html-template location="component://order/webapp/ordermgr/request/ViewRequestInfo.ftl"/></html>
- </platform-specific>
- <platform-specific>
- <html><html-template location="component://order/webapp/ordermgr/request/ViewRequestItemInfo.ftl"/></html>
- </platform-specific>
+ <include-screen name="ViewRequestTemplate" location="component://order/widget/ordermgr/RequestScreens.xml"/>
</decorator-section>
</decorator-screen>
</widgets>
Deleted: trunk/applications/order/webapp/ordermgr/request/ViewRequestInfo.ftl
===================================================================
--- trunk/applications/order/webapp/ordermgr/request/ViewRequestInfo.ftl 2006-06-30 00:12:48 UTC (rev 7905)
+++ trunk/applications/order/webapp/ordermgr/request/ViewRequestInfo.ftl 2006-06-30 05:43:15 UTC (rev 7906)
@@ -1,188 +0,0 @@
-<#--
- * Copyright (c) 2003 The Open For Business Project - www.ofbiz.org
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
- * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
- * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *@author Jacopo Cappellato (tiz at sastau.it)
- *@version $Rev$
--->
-
-<#if request?exists>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <#-- left side -->
- <td width="50%" valign="top" align="left">
-
- <div class="screenlet">
- <div class="screenlet-header">
- <div class="boxhead">${uiLabelMap.OrderRequest} ${custRequest.custRequestId} ${uiLabelMap.CommonInformation}</div>
- </div>
- <div class="screenlet-body">
- <table width="100%" border="0" cellpadding="1">
- <#-- request header information -->
- <tr>
- <td align="right" valign="top" width="15%">
- <div class="tabletext"> <b>${uiLabelMap.CommonType}</b></div>
- </td>
- <td width="5"> </td>
- <td align="left" valign="top" width="80%">
- <div class="tabletext">${(custRequestType.get("description",locale))?default(custRequest.custRequestTypeId?if_exists)}</div>
- </td>
- </tr>
- <tr><td colspan="7"><hr class="sepbar"/></td></tr>
- <#-- request status information -->
- <tr>
- <td align="right" valign="top" width="15%">
- <div class="tabletext"> <b>${uiLabelMap.CommonStatus}</b></div>
- </td>
- <td width="5"> </td>
- <td align="left" valign="top" width="80%">
- <div class="tabletext">${(statusItem.get("description", locale))?default(custRequest.statusId?if_exists)}</div>
- </td>
- </tr>
- <#-- party -->
- <tr><td colspan="7"><hr class="sepbar"/></td></tr>
- <tr>
- <td align="right" valign="top" width="15%">
- <div class="tabletext"> <b>${uiLabelMap.PartyPartyId}</b></div>
- </td>
- <td width="5"> </td>
- <td align="left" valign="top" width="80%">
- <div class="tabletext">${custRequest.fromPartyId?if_exists}</div>
- </td>
- </tr>
- <#-- request name -->
- <tr><td colspan="7"><hr class="sepbar"/></td></tr>
- <tr>
- <td align="right" valign="top" width="15%">
- <div class="tabletext"> <b>${uiLabelMap.CommonName}</b></div>
- </td>
- <td width="5"> </td>
- <td align="left" valign="top" width="80%">
- <div class="tabletext">${custRequest.custRequestName?if_exists}</div>
- </td>
- </tr>
- <#-- request description -->
- <tr><td colspan="7"><hr class="sepbar"/></td></tr>
- <tr>
- <td align="right" valign="top" width="15%">
- <div class="tabletext"> <b>${uiLabelMap.CommonDescription}</b></div>
- </td>
- <td width="5"> </td>
- <td align="left" valign="top" width="80%">
- <div class="tabletext">${custRequest.description?if_exists}</div>
- </td>
- </tr>
- <#-- request currency -->
- <tr><td colspan="7"><hr class="sepbar"/></td></tr>
- <tr>
- <td align="right" valign="top" width="15%">
- <div class="tabletext"> <b>${uiLabelMap.CommonCurrency}</b></div>
- </td>
- <td width="5"> </td>
- <td align="left" valign="top" width="80%">
- <div class="tabletext"><#if currency?exists>${currency.get("description", locale)?default(custRequest.maximumAmountUomId?if_exists)}</#if></div>
- </td>
- </tr>
- <#-- request currency -->
- <tr><td colspan="7"><hr class="sepbar"/></td></tr>
- <tr>
- <td align="right" valign="top" width="15%">
- <div class="tabletext"> <b>${uiLabelMap.ProductProductStore}</b></div>
- </td>
- <td width="5"> </td>
- <td align="left" valign="top" width="80%">
- <div class="tabletext"><#if store?exists>${store.storeName?default(custRequest.productStoreId?if_exists)}</#if></div>
- </td>
- </tr>
-
- </table>
- </div>
- </div>
- </td>
-
- <td bgcolor="white" width="1"> </td>
- <#-- right side -->
-
- <td width="50%" valign="top" align="left">
- <div class="screenlet">
- <div class="screenlet-header">
- <div class="boxhead"> ${uiLabelMap.CommonDate}</div>
- </div>
- <div class="screenlet-body">
- <table width="100%" border="0" cellpadding="1">
- <tr>
- <td align="right" valign="top" width="25%">
- <div class="tabletext"> <b>${uiLabelMap.OrderRequestDate}</b></div>
- </td>
- <td width="5"> </td>
- <td align="left" valign="top" width="70%">
- <div class="tabletext">${(custRequest.custRequestDate.toString())?if_exists}</div>
- </td>
- </tr>
- <tr><td colspan="7"><hr class="sepbar"/></td></tr>
- <tr>
- <td align="right" valign="top" width="25%">
- <div class="tabletext"> <b>${uiLabelMap.OrderRequestCreatedDate}</b></div>
- </td>
- <td width="5"> </td>
- <td align="left" valign="top" width="70%">
- <div class="tabletext">${(custRequest.createdDate.toString())?if_exists}</div>
- </td>
- </tr>
- <tr><td colspan="7"><hr class="sepbar"/></td></tr>
- <tr>
- <td align="right" valign="top" width="25%">
- <div class="tabletext"> <b>${uiLabelMap.OrderRequestLastModifiedDate}</b></div>
- </td>
- <td width="5"> </td>
- <td align="left" valign="top" width="70%">
- <div class="tabletext">${(custRequest.lastModifiedDate.toString())?if_exists}</div>
- </td>
- </tr>
- </table>
- </div>
- </div>
- <div class="screenlet">
- <div class="screenlet-header">
- <div class="boxhead"> ${uiLabelMap.OrderRequestRoles}</div>
- </div>
- <div class="screenlet-body">
- <table width="100%" border="0" cellpadding="1">
- <#list requestRoles as requestRole>
- <#assign roleType = requestRole.getRelatedOne("RoleType")>
- <#assign party = requestRole.getRelatedOne("Party")>
- <tr>
- <td align="right" valign="top" width="15%">
- <div class="tabletext"> <b>${roleType.get("description", locale)?if_exists}</b></div>
- </td>
- <td width="5"> </td>
- <td align="left" valign="top" width="80%">
- <div class="tabletext">${Static["org.ofbiz.party.party.PartyHelper"].getPartyName(party)}</div>
- </td>
- </tr>
- <tr><td colspan="7"><hr class="sepbar"/></td></tr>
- </#list>
- </table>
- </div>
- </div>
- </td>
- </tr>
-</table>
-</#if>
Added: trunk/applications/order/webapp/ordermgr/request/requestDate.ftl
===================================================================
--- trunk/applications/order/webapp/ordermgr/request/requestDate.ftl 2006-06-30 00:12:48 UTC (rev 7905)
+++ trunk/applications/order/webapp/ordermgr/request/requestDate.ftl 2006-06-30 05:43:15 UTC (rev 7906)
@@ -0,0 +1,55 @@
+<#--
+$Id: $
+
+Copyright 2001-2006 The Apache Software Foundation
+
+Licensed 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.
+-->
+<div class="screenlet">
+ <div class="screenlet-header">
+ <div class="boxhead"> ${uiLabelMap.CommonDate}</div>
+ </div>
+ <div class="screenlet-body">
+ <table width="100%" border="0" cellpadding="1">
+ <tr>
+ <td align="right" valign="top" width="25%">
+ <div class="tabletext"> <b>${uiLabelMap.OrderRequestDate}</b></div>
+ </td>
+ <td width="5"> </td>
+ <td align="left" valign="top" width="70%">
+ <div class="tabletext">${(custRequest.custRequestDate.toString())?if_exists}</div>
+ </td>
+ </tr>
+ <tr><td colspan="7"><hr class="sepbar"/></td></tr>
+ <tr>
+ <td align="right" valign="top" width="25%">
+ <div class="tabletext"> <b>${uiLabelMap.OrderRequestCreatedDate}</b></div>
+ </td>
+ <td width="5"> </td>
+ <td align="left" valign="top" width="70%">
+ <div class="tabletext">${(custRequest.createdDate.toString())?if_exists}</div>
+ </td>
+ </tr>
+ <tr><td colspan="7"><hr class="sepbar"/></td></tr>
+ <tr>
+ <td align="right" valign="top" width="25%">
+ <div class="tabletext"> <b>${uiLabelMap.OrderRequestLastModifiedDate}</b></div>
+ </td>
+ <td width="5"> </td>
+ <td align="left" valign="top" width="70%">
+ <div class="tabletext">${(custRequest.lastModifiedDate.toString())?if_exists}</div>
+ </td>
+ </tr>
+ </table>
+ </div>
+</div>
Property changes on: trunk/applications/order/webapp/ordermgr/request/requestDate.ftl
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: trunk/applications/order/webapp/ordermgr/request/requestInfo.ftl
===================================================================
--- trunk/applications/order/webapp/ordermgr/request/requestInfo.ftl 2006-06-30 00:12:48 UTC (rev 7905)
+++ trunk/applications/order/webapp/ordermgr/request/requestInfo.ftl 2006-06-30 05:43:15 UTC (rev 7906)
@@ -0,0 +1,102 @@
+<#--
+$Id: $
+
+Copyright 2001-2006 The Apache Software Foundation
+
+Licensed 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.
+-->
+<div class="screenlet">
+ <div class="screenlet-header">
+ <div class="boxhead">${uiLabelMap.OrderRequest} ${custRequest.custRequestId} ${uiLabelMap.CommonInformation}</div>
+ </div>
+ <div class="screenlet-body">
+ <table width="100%" border="0" cellpadding="1">
+ <#-- request header information -->
+ <tr>
+ <td align="right" valign="top" width="15%">
+ <div class="tabletext"> <b>${uiLabelMap.CommonType}</b></div>
+ </td>
+ <td width="5"> </td>
+ <td align="left" valign="top" width="80%">
+ <div class="tabletext">${(custRequestType.get("description",locale))?default(custRequest.custRequestTypeId?if_exists)}</div>
+ </td>
+ </tr>
+ <tr><td colspan="7"><hr class="sepbar"/></td></tr>
+ <#-- request status information -->
+ <tr>
+ <td align="right" valign="top" width="15%">
+ <div class="tabletext"> <b>${uiLabelMap.CommonStatus}</b></div>
+ </td>
+ <td width="5"> </td>
+ <td align="left" valign="top" width="80%">
+ <div class="tabletext">${(statusItem.get("description", locale))?default(custRequest.statusId?if_exists)}</div>
+ </td>
+ </tr>
+ <#-- party -->
+ <tr><td colspan="7"><hr class="sepbar"/></td></tr>
+ <tr>
+ <td align="right" valign="top" width="15%">
+ <div class="tabletext"> <b>${uiLabelMap.PartyPartyId}</b></div>
+ </td>
+ <td width="5"> </td>
+ <td align="left" valign="top" width="80%">
+ <div class="tabletext">${custRequest.fromPartyId?if_exists}</div>
+ </td>
+ </tr>
+ <#-- request name -->
+ <tr><td colspan="7"><hr class="sepbar"/></td></tr>
+ <tr>
+ <td align="right" valign="top" width="15%">
+ <div class="tabletext"> <b>${uiLabelMap.CommonName}</b></div>
+ </td>
+ <td width="5"> </td>
+ <td align="left" valign="top" width="80%">
+ <div class="tabletext">${custRequest.custRequestName?if_exists}</div>
+ </td>
+ </tr>
+ <#-- request description -->
+ <tr><td colspan="7"><hr class="sepbar"/></td></tr>
+ <tr>
+ <td align="right" valign="top" width="15%">
+ <div class="tabletext"> <b>${uiLabelMap.CommonDescription}</b></div>
+ </td>
+ <td width="5"> </td>
+ <td align="left" valign="top" width="80%">
+ <div class="tabletext">${custRequest.description?if_exists}</div>
+ </td>
+ </tr>
+ <#-- request currency -->
+ <tr><td colspan="7"><hr class="sepbar"/></td></tr>
+ <tr>
+ <td align="right" valign="top" width="15%">
+ <div class="tabletext"> <b>${uiLabelMap.CommonCurrency}</b></div>
+ </td>
+ <td width="5"> </td>
+ <td align="left" valign="top" width="80%">
+ <div class="tabletext"><#if currency?exists>${currency.get("description", locale)?default(custRequest.maximumAmountUomId?if_exists)}</#if></div>
+ </td>
+ </tr>
+ <#-- request currency -->
+ <tr><td colspan="7"><hr class="sepbar"/></td></tr>
+ <tr>
+ <td align="right" valign="top" width="15%">
+ <div class="tabletext"> <b>${uiLabelMap.ProductProductStore}</b></div>
+ </td>
+ <td width="5"> </td>
+ <td align="left" valign="top" width="80%">
+ <div class="tabletext"><#if store?exists>${store.storeName?default(custRequest.productStoreId?if_exists)}</#if></div>
+ </td>
+ </tr>
+ </table>
+ </div>
+</div>
Property changes on: trunk/applications/order/webapp/ordermgr/request/requestInfo.ftl
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: trunk/applications/order/webapp/ordermgr/request/requestRoles.ftl
===================================================================
--- trunk/applications/order/webapp/ordermgr/request/requestRoles.ftl 2006-06-30 00:12:48 UTC (rev 7905)
+++ trunk/applications/order/webapp/ordermgr/request/requestRoles.ftl 2006-06-30 05:43:15 UTC (rev 7906)
@@ -0,0 +1,40 @@
+<#--
+$Id: $
+
+Copyright 2001-2006 The Apache Software Foundation
+
+Licensed 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.
+-->
+<div class="screenlet">
+ <div class="screenlet-header">
+ <div class="boxhead"> ${uiLabelMap.OrderRequestRoles}</div>
+ </div>
+ <div class="screenlet-body">
+ <table width="100%" border="0" cellpadding="1">
+ <#list requestRoles as requestRole>
+ <#assign roleType = requestRole.getRelatedOne("RoleType")>
+ <#assign party = requestRole.getRelatedOne("Party")>
+ <tr>
+ <td align="right" valign="top" width="15%">
+ <div class="tabletext"> <b>${roleType.get("description", locale)?if_exists}</b></div>
+ </td>
+ <td width="5"> </td>
+ <td align="left" valign="top" width="80%">
+ <div class="tabletext">${Static["org.ofbiz.party.party.PartyHelper"].getPartyName(party)}</div>
+ </td>
+ </tr>
+ <tr><td colspan="7"><hr class="sepbar"/></td></tr>
+ </#list>
+ </table>
+ </div>
+</div>
Property changes on: trunk/applications/order/webapp/ordermgr/request/requestRoles.ftl
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Modified: trunk/applications/order/widget/ordermgr/RequestScreens.xml
===================================================================
--- trunk/applications/order/widget/ordermgr/RequestScreens.xml 2006-06-30 00:12:48 UTC (rev 7905)
+++ trunk/applications/order/widget/ordermgr/RequestScreens.xml 2006-06-30 05:43:15 UTC (rev 7906)
@@ -107,12 +107,7 @@
<link target="request" text="${uiLabelMap.OrderNewRequest}" style="buttontext"/>
<link target="createQuoteFromCustRequest?custRequestId=${custRequestId}" text="${uiLabelMap.OrderNewQuote}" style="buttontext"/>
</container>
- <platform-specific>
- <html><html-template location="component://order/webapp/ordermgr/request/ViewRequestInfo.ftl"/></html>
- </platform-specific>
- <platform-specific>
- <html><html-template location="component://order/webapp/ordermgr/request/ViewRequestItemInfo.ftl"/></html>
- </platform-specific>
+ <include-screen name="ViewRequestTemplate" location="component://order/widget/ordermgr/RequestScreens.xml"/>
</decorator-section>
</decorator-screen>
</widgets>
@@ -407,4 +402,66 @@
</widgets>
</section>
</screen>
+ <screen name="ViewRequestTemplate">
+ <section>
+ <condition>
+ <not><if-empty field-name="custRequest"/></not>
+ </condition>
+ <widgets>
+ <include-screen name="ViewRequestInfo"/>
+ <include-screen name="ViewRequestItemInfo"/>
+ </widgets>
+ <fail-widgets>
+ <label style="head3">${uiLabelMap.OrderErrorRequestNotFound}</label>
+ </fail-widgets>
+ </section>
+ </screen>
+ <screen name="ViewRequestInfo">
+ <section>
+ <widgets>
+ <include-screen name="requestInfo"/>
+ <include-screen name="requestDate"/>
+ <include-screen name="requestRoles"/>
+ </widgets>
+ </section>
+ </screen>
+ <screen name="requestInfo">
+ <section>
+ <widgets>
+ <platform-specific>
+ <html><html-template location="component://order/webapp/ordermgr/request/requestInfo.ftl"/></html>
+ </platform-specific>
+ </widgets>
+ </section>
+ </screen>
+ <screen name="requestDate">
+ <section>
+ <widgets>
+ <platform-specific>
+ <html><html-template location="component://order/webapp/ordermgr/request/requestDate.ftl"/></html>
+ </platform-specific>
+ </widgets>
+ </section>
+ </screen>
+ <screen name="requestRoles">
+ <section>
+ <widgets>
+ <platform-specific>
+ <html><html-template location="component://order/webapp/ordermgr/request/requestRoles.ftl"/></html>
+ </platform-specific>
+ </widgets>
+ </section>
+ </screen>
+ <screen name="ViewRequestItemInfo">
+ <section>
+ <condition>
+ <not><if-empty field-name="requestItems"/></not>
+ </condition>
+ <widgets>
+ <platform-specific>
+ <html><html-template location="component://order/webapp/ordermgr/request/ViewRequestItemInfo.ftl"/></html>
+ </platform-specific>
+ </widgets>
+ </section>
+ </screen>
</screens>
More information about the Svn
mailing list