Hi Vikas,
The property used in ordershippinginfo.ftl (OrderAddShippingAddress -
doesn't exits) doesn't match with the new property (OrderNewShippingAddress)
defined in OrderUiLabels.xml. I think this needs correction.
--
Thanks & Regards
Mridul Pathak
Hotwax Media
http://www.hotwaxmedia.com
[email protected]
On Thu, May 21, 2009 at 8:00 PM, <[email protected]> wrote:
> Author: mor
> Date: Thu May 21 14:30:45 2009
> New Revision: 777130
>
> URL: http://svn.apache.org/viewvc?rev=777130&view=rev
> Log:
> Added an option to add a new shipping address from Order detail page. New
> shipping address cannot be added for orders that are completed as well as
> canceled.
> Applied patch from Anurag Singh Senger, part of OFBIZ-2478 (
> https://issues.apache.org/jira/browse/OFBIZ-2478)
>
> Added:
>
> ofbiz/trunk/applications/order/webapp/ordermgr/images/js/OrderShippingInfo.js
> (with props)
> Modified:
> ofbiz/trunk/applications/order/config/OrderUiLabels.xml
> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
>
> ofbiz/trunk/applications/order/webapp/ordermgr/order/ordershippinginfo.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=777130&r1=777129&r2=777130&view=diff
>
> ==============================================================================
> --- ofbiz/trunk/applications/order/config/OrderUiLabels.xml (original)
> +++ ofbiz/trunk/applications/order/config/OrderUiLabels.xml Thu May 21
> 14:30:45 2009
> @@ -1196,6 +1196,9 @@
> <value xml:lang="en">to Order</value>
> <value xml:lang="it">all'ordine</value>
> </property>
> + <property key="OrderNewShippingAddress">
> + <value xml:lang="en">New Shipping Address</value>
> + </property>
> <property key="OrderAddToCart">
> <value xml:lang="cs">pÅ™idat do koÅ¡Ãku</value>
> <value xml:lang="de">In den Warenkorb legen</value>
>
> 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=777130&r1=777129&r2=777130&view=diff
>
> ==============================================================================
> --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
> (original)
> +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
> Thu May 21 14:30:45 2009
> @@ -1476,6 +1476,19 @@
> <response name="error" type="none"/>
> </request-map>
>
> + <request-map uri="addShippingAddress">
> + <security https="true" auth="true"/>
> + <event type="service" invoke="createUpdateShippingAddress"/>
> + <response name="success" type="request"
> value="updateOrderItemShipGroup"/>
> + <response name="error" type="view" value="orderview"/>
> + </request-map>
> + <request-map uri="getAssociatedStateList">
> + <security https="true" auth="false"/>
> + <event type="jsonservice" invoke="getAssociatedStateList"/>
> + <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/OrderShippingInfo.js
> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/images/js/OrderShippingInfo.js?rev=777130&view=auto
>
> ==============================================================================
> ---
> ofbiz/trunk/applications/order/webapp/ordermgr/images/js/OrderShippingInfo.js
> (added)
> +++
> ofbiz/trunk/applications/order/webapp/ordermgr/images/js/OrderShippingInfo.js
> Thu May 21 14:30:45 2009
> @@ -0,0 +1,37 @@
> +/*
> +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.
> +*/
> +
> +var validateNewShippingAdd = null;
> +Event.observe(window, 'load', function() {
> + if ($('addShippingAddress')) {
> + validateNewShippingAdd = new Validation('addShippingAddress',
> {immediate: true, onSubmit: false});
> + Event.observe($('countryGeoId'), 'change', function() {
> + getAssociatedStateList('countryGeoId', 'stateProvinceGeoId',
> 'advice-required-stateProvinceGeoId', 'states');
> + });
> + getAssociatedStateList('countryGeoId', 'stateProvinceGeoId',
> 'advice-required-stateProvinceGeoId', 'states');
> + }
> + if ($('submitAddShippingAddress')) {
> + Event.observe($('submitAddShippingAddress'), 'click',
> submitValidNewShippingAddressForm);
> + }
> +})
> +function submitValidNewShippingAddressForm() {
> + if (validateNewShippingAdd.validate()) {
> + $('addShippingAddress').submit();
> + }
> +}
>
> Propchange:
> ofbiz/trunk/applications/order/webapp/ordermgr/images/js/OrderShippingInfo.js
>
> ------------------------------------------------------------------------------
> svn:eol-style = native
>
> Propchange:
> ofbiz/trunk/applications/order/webapp/ordermgr/images/js/OrderShippingInfo.js
>
> ------------------------------------------------------------------------------
> svn:keywords = "Date Rev Author URL Id"
>
> Propchange:
> ofbiz/trunk/applications/order/webapp/ordermgr/images/js/OrderShippingInfo.js
>
> ------------------------------------------------------------------------------
> svn:mime-type = text/plain
>
> Modified:
> ofbiz/trunk/applications/order/webapp/ordermgr/order/ordershippinginfo.ftl
> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/ordershippinginfo.ftl?rev=777130&r1=777129&r2=777130&view=diff
>
> ==============================================================================
> ---
> ofbiz/trunk/applications/order/webapp/ordermgr/order/ordershippinginfo.ftl
> (original)
> +++
> ofbiz/trunk/applications/order/webapp/ordermgr/order/ordershippinginfo.ftl
> Thu May 21 14:30:45 2009
> @@ -192,6 +192,7 @@
> <td width="5"> </td>
> <td valign="top" width="80%">
> <input type="submit"
> value="${uiLabelMap.CommonUpdate}" class="smallSubmit"/>
> + <a class="buttontext" id="newShippingAddress"
> href="javascript:void(0);">${uiLabelMap.OrderAddShippingAddress}</a>
> </td>
> </tr>
> </#if>
> @@ -203,6 +204,63 @@
> </#if>
> </table>
> </form>
> + <div id="newShippingAddressForm" class="popup" style="display:
> none;">
> + <form id="addShippingAddress" name="addShippingAddress"
> method="post" action="addShippingAddress">
> + <input type="hidden" name="orderId"
> value="${orderId?if_exists}"/>
> + <input type="hidden" name="partyId"
> value="${partyId?if_exists}"/>
> + <input type="hidden" name="oldContactMechId"
> value="${shipGroup.contactMechId?if_exists}"/>
> + <input type="hidden" name="shipGroupSeqId"
> value="${shipGroup.shipGroupSeqId?if_exists}"/>
> + <input type="hidden" name="contactMechPurposeTypeId"
> value="SHIPPING_LOCATION"/>
> + <div class="form-row">
> + <label for="address1">${uiLabelMap.PartyAddressLine1}* <span
> id="advice-required-address1" style="display: none"
> class="custom-advice">(required)</span></label>
> + <div class="form-field"><input type="text" class="required"
> name="shipToAddress1" id="address1" value="" size="30" maxlength="30"></div>
> + </div>
> + <div class="form-row">
> + <label for="address2">${uiLabelMap.PartyAddressLine2}</label>
> + <div class="form-field"><input type="text"
> name="shipToAddress2" value="" size="30" maxlength="30"></div>
> + </div>
> + <div class="form-row">
> + <label for="city">${uiLabelMap.PartyCity}* <span
> id="advice-required-city" style="display: none"
> class="custom-advice">(required)</span></label>
> + <div class="form-field"><input type="text" class="required"
> name="shipToCity" id="city" value="" size="30" maxlength="30"></div>
> + </div>
> + <div class="form-row">
> + <label for="postalCode">${uiLabelMap.PartyZipCode}* <span
> id="advice-required-postalCode" style="display: none"
> class="custom-advice">(required)</span></label>
> + <div class="form-field"><input type="text" class="required"
> name="shipToPostalCode" id="postalCode" value="" size="30"
> maxlength="10"></div>
> + </div>
> + <div class="form-row">
> + <label for="country">${uiLabelMap.PartyCountry}* <span
> id="advice-required-countryGeoId" style="display: none"
> class="custom-advice">(required)</span></label>
> + <div class="form-field">
> + <select name="shipToCountryGeoId" id="countryGeoId"
> class="required" style="width: 70%">
> + <#if countryGeoId??>
> + <option value="${countryGeoId}">${countryGeoId}</option>
> + </#if>
> +
> ${screens.render("component://common/widget/CommonScreens.xml#countries")}
> + </select>
> + </div>
> + </div>
> + <div id="states" class="form-row">
> + <label for="state">${uiLabelMap.PartyState}* <span
> id="advice-required-stateProvinceGeoId" style="display: none"
> class="custom-advice">(required)</span></label>
> + <div class="form-field">
> + <select name="shipToStateProvinceGeoId"
> id="stateProvinceGeoId" style="width: 70%">
> + <#if stateProvinceGeoId?has_content>
> + <option
> value="${stateProvinceGeoId}">${stateProvinceGeoId}</option>
> + <#else>
> + <option value="_NA_">${uiLabelMap.PartyNoState}</option>
> + </#if>
> + </select>
> + </div>
> + </div>
> + <div class="form-row">
> + <input id="submitAddShippingAddress" type="button"
> value="${uiLabelMap.CommonSubmit}"/>
> + <form action="">
> + <input class="popup_closebox buttontext" type="button"
> value="${uiLabelMap.CommonClose}"/>
> + </form>
> + </div>
> + </form>
> + </div>
> + <script language="JavaScript" type="text/javascript">
> + new Popup('newShippingAddressForm', 'newShippingAddress', {modal:
> true, position: 'center', trigger: 'click'})
> + </script>
> <table width="100%" border="0" cellpadding="1" cellspacing="0">
> <#if shipGroup.supplierPartyId?has_content>
> <#assign supplier = delegator.findByPrimaryKey("PartyGroup",
> Static["org.ofbiz.base.util.UtilMisc"].toMap("partyId",
> shipGroup.supplierPartyId))?if_exists />
>
> Modified:
> ofbiz/trunk/applications/order/widget/ordermgr/OrderViewScreens.xml
> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/OrderViewScreens.xml?rev=777130&r1=777129&r2=777130&view=diff
>
> ==============================================================================
> --- ofbiz/trunk/applications/order/widget/ordermgr/OrderViewScreens.xml
> (original)
> +++ ofbiz/trunk/applications/order/widget/ordermgr/OrderViewScreens.xml Thu
> May 21 14:30:45 2009
> @@ -38,7 +38,12 @@
> <actions>
> <set field="titleProperty" value="OrderViewOrder"/>
> <set field="headerItem" value="findorders"/>
> + <set field="layoutSettings.styleSheets[+0]"
> value="/images/prototypejs/popup.css" global="true"/>
> + <set field="layoutSettings.javaScripts[]"
> value="/images/prototypejs/popup.js" global="true"/>
> + <set field="layoutSettings.javaScripts[+0]"
> value="/images/prototypejs/validation.js" global="true"/>
> <set field="layoutSettings.javaScripts[]"
> value="/ordermgr/images/js/order.js" global="true"/>
> + <set field="layoutSettings.javaScripts[]"
> value="/ordermgr/images/js/OrderShippingInfo.js" global="true"/>
> + <set field="layoutSettings.javaScripts[]"
> value="/ecommerce/images/geoAutoCompleter.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>
>
>
>