[Vtigercrm-commits] [vtiger-commits] r10985 - in /vtigercrm/branches/5.0.3: include/js/Inventory.js modules/Contacts/Contacts.js

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Wed May 23 10:34:15 EDT 2007


Author: richie
Date: Wed May 23 08:34:04 2007
New Revision: 10985

Log:
fix for could not copy billing address to shipping address and vice versa. Fixes #3935 --minnie

Modified:
    vtigercrm/branches/5.0.3/include/js/Inventory.js
    vtigercrm/branches/5.0.3/modules/Contacts/Contacts.js

Modified: vtigercrm/branches/5.0.3/include/js/Inventory.js
==============================================================================
--- vtigercrm/branches/5.0.3/include/js/Inventory.js (original)
+++ vtigercrm/branches/5.0.3/include/js/Inventory.js Wed May 23 08:34:04 2007
@@ -10,17 +10,23 @@
 
 function copyAddressRight(form) {
 
-	form.ship_street.value = form.bill_street.value;
-
-	form.ship_city.value = form.bill_city.value;
-
-	form.ship_state.value = form.bill_state.value;
-
-	form.ship_code.value = form.bill_code.value;
-
-	form.ship_country.value = form.bill_country.value;
-
-	form.ship_pobox.value = form.bill_pobox.value;
+	if(typeof(form.bill_street) != 'undefined' && typeof(form.ship_street) != 'undefined')
+		form.ship_street.value = form.bill_street.value;
+
+	if(typeof(form.bill_city) != 'undefined' && typeof(form.ship_city) != 'undefined')
+		form.ship_city.value = form.bill_city.value;
+
+	if(typeof(form.bill_state) != 'undefined' && typeof(form.ship_state) != 'undefined')
+		form.ship_state.value = form.bill_state.value;
+
+	if(typeof(form.bill_code) != 'undefined' && typeof(form.ship_code) != 'undefined')
+		form.ship_code.value = form.bill_code.value;
+
+	if(typeof(form.bill_country) != 'undefined' && typeof(form.ship_country) != 'undefined')
+		form.ship_country.value = form.bill_country.value;
+
+	if(typeof(form.bill_pobox) != 'undefined' && typeof(form.ship_pobox) != 'undefined')
+		form.ship_pobox.value = form.bill_pobox.value;
 	
 	return true;
 
@@ -28,17 +34,23 @@
 
 function copyAddressLeft(form) {
 
-	form.bill_street.value = form.ship_street.value;
-
-	form.bill_city.value = form.ship_city.value;
-
-	form.bill_state.value = form.ship_state.value;
-
-	form.bill_code.value =	form.ship_code.value;
-
-	form.bill_country.value = form.ship_country.value;
-
-	form.bill_pobox.value = form.ship_pobox.value;
+	if(typeof(form.bill_street) != 'undefined' && typeof(form.ship_street) != 'undefined')
+		form.bill_street.value = form.ship_street.value;
+	
+	if(typeof(form.bill_city) != 'undefined' && typeof(form.ship_city) != 'undefined')
+		form.bill_city.value = form.ship_city.value;
+
+	if(typeof(form.bill_state) != 'undefined' && typeof(form.ship_state) != 'undefined')
+		form.bill_state.value = form.ship_state.value;
+
+	if(typeof(form.bill_code) != 'undefined' && typeof(form.ship_code) != 'undefined')
+		form.bill_code.value =	form.ship_code.value;
+
+	if(typeof(form.bill_country) != 'undefined' && typeof(form.ship_country) != 'undefined')
+		form.bill_country.value = form.ship_country.value;
+
+	if(typeof(form.bill_pobox) != 'undefined' && typeof(form.ship_pobox) != 'undefined')
+		form.bill_pobox.value = form.ship_pobox.value;
 
 	return true;
 

Modified: vtigercrm/branches/5.0.3/modules/Contacts/Contacts.js
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Contacts/Contacts.js (original)
+++ vtigercrm/branches/5.0.3/modules/Contacts/Contacts.js Wed May 23 08:34:04 2007
@@ -13,17 +13,23 @@
 
 function copyAddressRight(form) {
 
-	form.otherstreet.value = form.mailingstreet.value;
+	if(typeof(form.otherstreet) != 'undefined' && typeof(form.mailingstreet) != 'undefined')
+		form.otherstreet.value = form.mailingstreet.value;
 
-	form.othercity.value = form.mailingcity.value;
+	if(typeof(form.othercity) != 'undefined' && typeof(form.mailingcity) != 'undefined')
+		form.othercity.value = form.mailingcity.value;
 
-	form.otherstate.value = form.mailingstate.value;
+	if(typeof(form.otherstate) != 'undefined' && typeof(form.mailingstate) != 'undefined')
+		form.otherstate.value = form.mailingstate.value;
 
-	form.otherzip.value = form.mailingzip.value;
+	if(typeof(form.otherzip) != 'undefined' && typeof(form.mailingzip) != 'undefined')
+		form.otherzip.value = form.mailingzip.value;
 
-	form.othercountry.value = form.mailingcountry.value;
+	if(typeof(form.othercountry) != 'undefined' && typeof(form.mailingcountry) != 'undefined')
+		form.othercountry.value = form.mailingcountry.value;
 
-	form.otherpobox.value = form.mailingpobox.value;
+	if(typeof(form.otherpobox) != 'undefined' && typeof(form.mailingpobox) != 'undefined')
+		form.otherpobox.value = form.mailingpobox.value;
 	
 	return true;
 
@@ -31,17 +37,23 @@
 
 function copyAddressLeft(form) {
 
-	form.mailingstreet.value = form.otherstreet.value;
+	if(typeof(form.otherstreet) != 'undefined' && typeof(form.mailingstreet) != 'undefined')
+		form.mailingstreet.value = form.otherstreet.value;
 
-	form.mailingcity.value = form.othercity.value;
+	if(typeof(form.othercity) != 'undefined' && typeof(form.mailingcity) != 'undefined')
+		form.mailingcity.value = form.othercity.value;
 
-	form.mailingstate.value = form.otherstate.value;
+	if(typeof(form.otherstate) != 'undefined' && typeof(form.mailingstate) != 'undefined')
+		form.mailingstate.value = form.otherstate.value;
 
-	form.mailingzip.value =	form.otherzip.value;
+	if(typeof(form.otherzip) != 'undefined' && typeof(form.mailingzip) != 'undefined')
+		form.mailingzip.value =	form.otherzip.value;
 
-	form.mailingcountry.value = form.othercountry.value;
+	if(typeof(form.othercountry) != 'undefined' && typeof(form.mailingcountry) != 'undefined')
+		form.mailingcountry.value = form.othercountry.value;
 
-	form.mailingpobox.value = form.otherpobox.value;
+	if(typeof(form.otherpobox) != 'undefined' && typeof(form.mailingpobox) != 'undefined')
+		form.mailingpobox.value = form.otherpobox.value;
 	
 	return true;
 





More information about the vtigercrm-commits mailing list