svn commit: r816498 - in /ofbiz/trunk/specialpurpose/ebay: config/EbayUiLabels.xml src/org/ofbiz/ebay/EbayOrderServices.java widget/EbayForms.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r816498 - in /ofbiz/trunk/specialpurpose/ebay: config/EbayUiLabels.xml src/org/ofbiz/ebay/EbayOrderServices.java widget/EbayForms.xml

ashish-18
Author: ashish
Date: Fri Sep 18 07:09:27 2009
New Revision: 816498

URL: http://svn.apache.org/viewvc?rev=816498&view=rev
Log:
Here comes more improvement on the new eBay order screen.
The checkbox will not be visible for the imported orders.
Tooltip is provided for the eBay Transactions and Orders.

PS: Jacopo -> The resultant screen will look like: http://farm3.static.flickr.com/2465/3931094976_fe6e785e3b_b.jpg

Modified:
    ofbiz/trunk/specialpurpose/ebay/config/EbayUiLabels.xml
    ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java
    ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml

Modified: ofbiz/trunk/specialpurpose/ebay/config/EbayUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/config/EbayUiLabels.xml?rev=816498&r1=816497&r2=816498&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/config/EbayUiLabels.xml (original)
+++ ofbiz/trunk/specialpurpose/ebay/config/EbayUiLabels.xml Fri Sep 18 07:09:27 2009
@@ -44,6 +44,9 @@
     <property key="EbayEBayOrders">
         <value xml:lang="en">eBay Orders Import</value>
     </property>
+    <property key="EbayEbayOrderIdOrTransactionId">
+        <value xml:lang="en">OrderID / TransactionID</value>
+    </property>
     <property key="EbayExportToEbay">
         <value xml:lang="de">zu eBay exportieren</value>
         <value xml:lang="en">Export To eBay</value>

Modified: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java?rev=816498&r1=816497&r2=816498&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java (original)
+++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java Fri Sep 18 07:09:27 2009
@@ -399,9 +399,13 @@
                             Map<String, Object> orderCtx = FastMap.newInstance();    
                             Element ordersElement = (Element) ordersElemIter.next();
                             String externalOrderId = UtilXml.childElementValue(ordersElement, "OrderID");
-                            if (externalOrderExists(delegator, externalOrderId) != null) {
-                                continue;
+                            GenericValue orderExist = externalOrderExists(delegator, externalOrderId);
+                            if (orderExist != null) {
+                                orderCtx.put("orderId", (String) orderExist.get("orderId"));
+                            } else {
+                                orderCtx.put("orderId", "");
                             }
+                            
                             orderCtx.put("externalId", externalOrderId);
                             orderCtx.put("amountPaid", UtilXml.childElementValue(ordersElement, "Total", "0"));
                             orderCtx.put("createdDate", UtilXml.childElementValue(ordersElement, "CreatedTime"));
@@ -548,6 +552,9 @@
                                 orderCtx.put("emailBuyer", buyersEmailId);
                             }
                             orderCtx.put("userLogin", userLogin);
+                            orderCtx.put("isEbayOrder", "Y");
+                            orderCtx.put("isEbayTransaction", "");
+                            
                             //Map<String, Object> result = dispatcher.runSync("importEbayOrders", orderCtx);
                             fetchedOrders.add(orderCtx);
                         }
@@ -803,7 +810,9 @@
                             GenericValue orderExist = externalOrderExists(delegator, itemId);
                             if (orderExist != null) {
                                 orderCtx.put("orderId", (String) orderExist.get("orderId"));
-                            }
+                            } else {
+                                orderCtx.put("orderId", "");
+                            }
 
                             // retrieve transaction price
                             orderCtx.put("transactionPrice", UtilXml.childElementValue(transactionElement, "TransactionPrice", "0"));
@@ -817,8 +826,11 @@
                             orderCtx.put("emailBuyer", buyerCtx.get("emailBuyer").toString());
                             orderCtx.put("ebayUserIdBuyer", buyerCtx.get("ebayUserIdBuyer").toString());
                             
-                            // Now finally put the root map in the fetched orders list.
                             orderCtx.put("userLogin", userLogin);
+                            orderCtx.put("isEbayTransaction", "Y");
+                            orderCtx.put("isEbayOrder", "");
+                            
+                            // Now finally put the root map in the fetched orders list.
                             fetchedOrders.add(orderCtx);
                         }
                     }

Modified: ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml?rev=816498&r1=816497&r2=816498&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml (original)
+++ ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml Fri Sep 18 07:09:27 2009
@@ -104,8 +104,14 @@
     
     <form name="ListEbayOrders" type="multi" use-row-submit="true" list-name="orderList" target="importEbayOrders"
         odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
+        <row-actions>
+            <set field="canImportOrder" value="${bsh: org.ofbiz.base.util.UtilValidate.isEmpty(orderId)}" type="Boolean"/>
+            <set field="isEbayOrder" value="${bsh: org.ofbiz.base.util.UtilValidate.isNotEmpty(isEbayOrder)}" type="Boolean"/>
+            <set field="isEbayTransaction" value="${bsh: org.ofbiz.base.util.UtilValidate.isNotEmpty(isEbayTransaction)}" type="Boolean"/>
+        </row-actions>
         <field name="productStoreId"><hidden/></field>
-       <field name="externalId" title="${uiLabelMap.EbayEbayOrderId}"><display/></field>
+       <field name="externalId" title="${uiLabelMap.EbayEbayOrderIdOrTransactionId}" use-when="${isEbayOrder}" tooltip="eBay Order"><display/></field>
+       <field name="externalId" title="${uiLabelMap.EbayEbayOrderIdOrTransactionId}" use-when="${isEbayTransaction}" tooltip="eBay Transaction"><display/></field>
         <field name="orderId">
             <hyperlink target="orderview" description="${orderId}">
                 <parameter param-name="orderId"/>
@@ -118,7 +124,8 @@
        <field name="paidTime"><hidden/></field>
        <field name="shippedTime"><hidden/></field>
        <field name="ebayUserIdBuyer"><hidden/></field>
-       <field name="_rowSubmit" title="${uiLabelMap.CommonSelect}"><check/></field>
+        <field name="_rowSubmit" title="${uiLabelMap.CommonSelect}" use-when="${canImportOrder}"><check/></field>
+        <field name="_rowSubmit" title="${uiLabelMap.CommonSelect}" use-when="!${canImportOrder}"><display/></field>
         <field name="submitButton" title="${uiLabelMap.EbayImportOrdersFromEbay}" widget-style="smallSubmit"><submit/></field>
     </form>