details: https://code.openbravo.com/erp/devel/pi/rev/57d7ed05f9b6
changeset: 21179:57d7ed05f9b6
user: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
date: Sun Sep 22 15:14:43 2013 +0530
summary: Fixes Issue 0024726: Problems with Selectors if you migrate from
Openbravo 2.22
* The isUUID method supports ID's of length up to 10 characters, but should
contain only numbers.
* The changed method of the selector has been modified to accomodate this
change.
For eg., if a business partner name is 112ABC then when typing 1, it was
removed with empty string.
Now it compares with the value map and before replacing, checks whether the
fullidentifier has been entered.
Only then it is replaced with the value.
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
| 11 +++++++--
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
| 8 ++++++-
2 files changed, 15 insertions(+), 4 deletions(-)
diffs (46 lines):
diff -r 761d230637fe -r 57d7ed05f9b6
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
Sat Sep 21 14:35:23 2013 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
Sun Sep 22 15:14:43 2013 +0530
@@ -1025,16 +1025,21 @@
/* This function will return true if it receives a string parameter, and
* which complies with the OB UUID format (that is, its a
- * hexadecimal number of length 32)
+ * hexadecimal number of length 32 or numeric numbers of length less than or
equal to 10)
*/
OB.Utilities.isUUID = function (object) {
if (typeof object !== 'string') {
return false;
}
- if (object.length !== 32) {
+ if (object.length > 10 && object.length !== 32) {
return false;
}
- return (/[A-Fa-f0-9]{32,32}/).test(object);
+ if (object.length === 32) {
+ return (/[A-Fa-f0-9]{32,32}/).test(object);
+ } else if (object.length <= 10) {
+ //return true if uuid contains only numbers
+ return (/^\d+$/).test(object);
+ }
};
//** {{{ OB.Utilities.clientClassSplitProps }}} **
diff -r 761d230637fe -r 57d7ed05f9b6
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
---
a/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
Sat Sep 21 14:35:23 2013 +0200
+++
b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
Sun Sep 22 15:14:43 2013 +0530
@@ -522,7 +522,13 @@
}
//Setting the element value again to align the cursor position correctly.
- this.setElementValue(identifier);
+ //Before setting the value check if the identifier is part of the value
map or the full identifier is entered.
+ //If it fails set newValue as value.
+ if ((this.valueMap && this.valueMap[newValue] === identifier &&
identifier.trim() !== '') || this.fullIdentifierEntered) {
+ this.setElementValue(identifier);
+ } else {
+ this.setElementValue(newValue);
+ }
},
setPickListWidth: function () {
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits