You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mo...@apache.org on 2009/05/12 13:08:24 UTC

svn commit: r773854 - in /ofbiz/trunk/applications/order: config/OrderUiLabels.xml entitydef/entitymodel.xml webapp/ordermgr/WEB-INF/controller.xml webapp/ordermgr/images/js/order.js webapp/ordermgr/order/orderinfo.ftl widget/ordermgr/OrderViewScreens.xml

Author: mor
Date: Tue May 12 11:08:24 2009
New Revision: 773854

URL: http://svn.apache.org/viewvc?rev=773854&view=rev
Log:
New feature to mark order as viewed.
Patch from Anurag Singh Senger, part of OFBIZ-2446 (https://issues.apache.org/jira/browse/OFBIZ-2446) 

Added:
    ofbiz/trunk/applications/order/webapp/ordermgr/images/js/order.js   (with props)
Modified:
    ofbiz/trunk/applications/order/config/OrderUiLabels.xml
    ofbiz/trunk/applications/order/entitydef/entitymodel.xml
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
    ofbiz/trunk/applications/order/webapp/ordermgr/order/orderinfo.ftl
    ofbiz/trunk/applications/order/widget/ordermgr/OrderViewScreens.xml

Modified: ofbiz/trunk/applications/order/config/OrderUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderUiLabels.xml?rev=773854&r1=773853&r2=773854&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/config/OrderUiLabels.xml (original)
+++ ofbiz/trunk/applications/order/config/OrderUiLabels.xml Tue May 12 11:08:24 2009
@@ -3770,6 +3770,9 @@
         <value xml:lang="zh">手工促销</value>
         <value xml:lang="zh_CN">人工促销</value>
     </property>
+    <property key="OrderMarkViewed">
+        <value xml:lang="en">Mark Viewed</value>
+    </property>
     <property key="OrderMethod">
         <value xml:lang="cs">Způsob</value>
         <value xml:lang="de">Methode</value>
@@ -9492,6 +9495,9 @@
         <value xml:lang="zh">浏览/编辑交货计划信息</value>
         <value xml:lang="zh_CN">查看编辑发货计划</value>
     </property>
+    <property key="OrderViewed">
+        <value xml:lang="en">Viewed</value>
+    </property>
     <property key="OrderViewImage">
         <value xml:lang="de">Bild anzeigen</value>
         <value xml:lang="en">View Image</value>

Modified: ofbiz/trunk/applications/order/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/entitydef/entitymodel.xml?rev=773854&r1=773853&r2=773854&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/order/entitydef/entitymodel.xml Tue May 12 11:08:24 2009
@@ -358,6 +358,7 @@
       <field name="internalCode" type="id-long"></field>
       <field name="remainingSubTotal" type="currency-amount"></field>
       <field name="grandTotal" type="currency-amount"></field>
+      <field name="isViewed" type="indicator"></field>
       <prim-key field="orderId"/>
       <relation type="one" fk-name="ORDER_HDR_TYPE" rel-entity-name="OrderType">
         <key-map field-name="orderTypeId"/>

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?rev=773854&r1=773853&r2=773854&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Tue May 12 11:08:24 2009
@@ -1468,6 +1468,14 @@
         <response name="success" type="view" value="orderview"/>
         <response name="error" type="view" value="orderview"/>
     </request-map>
+
+    <request-map uri="markOrderViewed">
+        <security https="true" auth="true"/>
+        <event type="jsonservice" invoke="updateOrderHeader"/>
+        <response name="success" type="none"/>
+        <response name="error" type="none"/>
+    </request-map>
+
     <!-- Lookup request mappings -->
     <request-map uri="LookupPerson"><security https="true" auth="true"/><response name="success" type="view" value="LookupPerson"/></request-map>
     <request-map uri="LookupPartyGroup"><security https="true" auth="true"/><response name="success" type="view" value="LookupPartyGroup"/></request-map>

Added: ofbiz/trunk/applications/order/webapp/ordermgr/images/js/order.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/images/js/order.js?rev=773854&view=auto
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/images/js/order.js (added)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/images/js/order.js Tue May 12 11:08:24 2009
@@ -0,0 +1,27 @@
+/*
+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.
+*/
+
+function markOrderViewed() {
+    new Ajax.Request('markOrderViewed',{parameters: $('orderViewed').serialize(), requestHeaders: {Accept: 'application/json'},
+        onSuccess: function() {
+            Effect.Fade('isViewed', {duration: 0.0});
+            Effect.Appear('viewed', {duration: 0.3});
+        }
+    });
+}

Propchange: ofbiz/trunk/applications/order/webapp/ordermgr/images/js/order.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/order/webapp/ordermgr/images/js/order.js
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/order/webapp/ordermgr/images/js/order.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/order/orderinfo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderinfo.ftl?rev=773854&r1=773853&r2=773854&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/order/orderinfo.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/order/orderinfo.ftl Tue May 12 11:08:24 2009
@@ -236,8 +236,37 @@
                     <input type="submit" class="smallSubmit" value="${uiLabelMap.FormFieldTitle_reserveInventory}"/>
                   </td>
                 </tr>
+                <tr><td colspan="3"><hr/></td></tr>
               </form>
             </#if>
+            <#if orderHeader.isViewed?has_content && orderHeader.isViewed == "Y">
+            <tr>
+              <td class="label">${uiLabelMap.OrderViewed}</td>
+              <td width="5%"></td>
+              <td valign="top" width="80%">
+                ${uiLabelMap.CommonYes}
+              </td>
+            </tr>
+            <#else>
+            <tr id="isViewed">
+              <td class="label">${uiLabelMap.OrderMarkViewed}</td>
+              <td width="5%"></td>
+              <td valign="top" width="80%">
+                <form id="orderViewed">
+                  <input type="checkbox" name="checkViewed" onclick="javascript:markOrderViewed();"/>
+                  <input type="hidden" name="orderId" value="${orderId?if_exists}"/>
+                  <input type="hidden" name="isViewed" value="Y"/>
+                </form>
+              </td>
+            </tr>
+            <tr id="viewed" style="display: none;">
+              <td class="label">${uiLabelMap.OrderViewed}</td>
+              <td width="5%"></td>
+              <td valign="top" width="80%">
+                ${uiLabelMap.CommonYes}
+              </td>
+            </tr>
+            </#if>
         </table>
     </div>
 </div>
\ No newline at end of file

Modified: ofbiz/trunk/applications/order/widget/ordermgr/OrderViewScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/OrderViewScreens.xml?rev=773854&r1=773853&r2=773854&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/OrderViewScreens.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/OrderViewScreens.xml Tue May 12 11:08:24 2009
@@ -38,6 +38,7 @@
             <actions>
                 <set field="titleProperty" value="OrderViewOrder"/>
                 <set field="headerItem" value="findorders"/>
+                <set field="layoutSettings.javaScripts[]" value="/ordermgr/images/js/order.js" global="true"/>
                 <script location="component://order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy"/>
                 <script location="component://order/webapp/ordermgr/WEB-INF/actions/order/OrderViewWebSecure.groovy"/>
             </actions>