details: https://code.openbravo.com/erp/devel/pi/rev/3927fda17b04 changeset: 19004:3927fda17b04 user: Martin Taal <martin.taal <at> openbravo.com> date: Tue Dec 11 11:40:07 2012 +0100 summary: Fixes issue 22505: Invalid date completing in date fields. Check that the javascript day number is the same as the entered one, do this for form fields as well as popup date filters
details: https://code.openbravo.com/erp/devel/pi/rev/b49b38d42d5f changeset: 19005:b49b38d42d5f user: Martin Taal <martin.taal <at> openbravo.com> date: Tue Dec 11 11:41:47 2012 +0100 summary: Fixes issue 22258: Summary Function in grid: Remove Summary Function clears all the grid Also copy summary functions from main grid fields to summary row, solve issue that current summary function was not found diffstat: modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js | 9 +++++- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js | 12 ++++++++- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-date.js | 6 +++++ 3 files changed, 23 insertions(+), 4 deletions(-) diffs (72 lines): diff -r ea2f64fca427 -r b49b38d42d5f modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js Tue Dec 11 09:58:51 2012 +0100 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js Tue Dec 11 11:41:47 2012 +0100 @@ -104,7 +104,7 @@ blur: function () { var blurValue = this.blurValue(), - newBlurValue = '', + newBlurValue = '', jsValue, digitRegExp = new RegExp('^\\d+$', 'gm'), newValue, i; @@ -124,7 +124,12 @@ if (digitRegExp.test(newBlurValue)) { newValue = this.parseValue(); if (newValue) { - this.setValue(OB.Utilities.Date.OBToJS(newValue, this.dateFormat)); + jsValue = OB.Utilities.Date.OBToJS(newValue, this.dateFormat); + // if jsValue == null then this is an illegal date, will be + // caught later + if (jsValue) { + this.setValue(jsValue); + } } } diff -r ea2f64fca427 -r b49b38d42d5f modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js Tue Dec 11 09:58:51 2012 +0100 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js Tue Dec 11 11:41:47 2012 +0100 @@ -335,8 +335,16 @@ getCellValue: function (record, recordNum, fieldNum, gridBody) { var field = this.getField(fieldNum), - func = this.getGridSummaryFunction(field), + gridField, func = this.parentElement.getGridSummaryFunction(field), value = record && field ? (field.displayField ? record[field.displayField] : record[field.name]) : null; + + // get the summary function from the main grid + if (!func) { + delete field.summaryFunction; + } else { + field.summaryFunction = func; + } + // handle count much simpler than smartclient does // so no extra titles or formatting if (record && func === 'count' && value >= 0) { @@ -573,7 +581,7 @@ } else if (this.showGridSummary) { noSummaryFunction = true; for (i = 0; i < this.getFields().length; i++) { - if (this.summaryFunction) { + if (this.getFields()[i].summaryFunction) { noSummaryFunction = false; break; } diff -r ea2f64fca427 -r b49b38d42d5f modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-date.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-date.js Tue Dec 11 09:58:51 2012 +0100 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-date.js Tue Dec 11 11:41:47 2012 +0100 @@ -151,6 +151,12 @@ fullYear = parseInt(fullYear, 10); JSDate.setFullYear(fullYear, month - 1, day); + + // https://issues.openbravo.com/view.php?id=22505 + if (day !== JSDate.getDate()) { + return null; + } + JSDate.setHours(hours); JSDate.setMinutes(minutes); JSDate.setSeconds(seconds); ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d _______________________________________________ Openbravo-commits mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbravo-commits
