[Bug 10792] New: Amounts in funds table on acquisitions home page not sorting correctly
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 Bug ID: 10792 Summary: Amounts in funds table on acquisitions home page not sorting correctly Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org Created attachment 20674 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20674&action=edit funds table, showing wrong sorting The amounts in the fund table on the acquisitions home page are not sorting correctly. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 --- Comment #1 from Galen Charlton <gmcharlt@gmail.com> --- Created attachment 20805 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20805&action=edit Bug 10792: fix sorting of funds table on acquisitions home page This patch introduces a DataTables sorting plugin, title-numeric, for sorting cells based on a decimal number embedded in a span title attribute. This allows currency amounts to be formatted properly for display without having to writing a sorting plugin that's super-smart about removing the formatting, particularly for locales that use a comma as the decimal mark. The sorter plugin can be used like this: - In the DataTables config: "aoColumns": [ { "sType": "title-numeric" }, ] - In the table data <td><span title="[% decimal_number_that_JS_parseFloat_accepts %]"> [% formatted currency %] </span></td> To test: [1] Go to the acquisitions home page. Note that changing the sort order on the amount, ordered, spent, or avail columns results in incorrect sorting that is either ASCII-betical or which ignores any component of large numbers that occur after the thousands separator. [2] Apply the patch. [3] Verify that the sorting now works correctly and that no JavaScript errors appear in the JS debug console of your choice. Signed-off-by: Galen Charlton <gmc@esilibrary.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #20805|0 |1 is obsolete| | --- Comment #2 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 20839 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20839&action=edit Bug 10792: fix sorting of funds table on acquisitions home page This patch introduces a DataTables sorting plugin, title-numeric, for sorting cells based on a decimal number embedded in a span title attribute. This allows currency amounts to be formatted properly for display without having to writing a sorting plugin that's super-smart about removing the formatting, particularly for locales that use a comma as the decimal mark. The sorter plugin can be used like this: - In the DataTables config: "aoColumns": [ { "sType": "title-numeric" }, ] - In the table data <td><span title="[% decimal_number_that_JS_parseFloat_accepts %]"> [% formatted currency %] </span></td> To test: [1] Go to the acquisitions home page. Note that changing the sort order on the amount, ordered, spent, or avail columns results in incorrect sorting that is either ASCII-betical or which ignores any component of large numbers that occur after the thousands separator. [2] Apply the patch. [3] Verify that the sorting now works correctly and that no JavaScript errors appear in the JS debug console of your choice. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 20855 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20855&action=edit Screenshot of acquisiton funds table with non-working sort and patch applied Sadly, this doesn't work for me. I tested in 2 different browsers (Firefox and Chromium), reloading the Javascript files multiple times. Error shown in firebug: datatables.js, line 513 TypeError: a.match(...) is null var x = a.match(/title="*(-?[0-9\.]+)/)[1]; Screenshot of my acquisitions table attached. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 --- Comment #4 from Galen Charlton <gmcharlt@gmail.com> --- Created attachment 20858 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20858&action=edit Bug 10792: fix sorting of funds table on acquisitions home page This patch introduces a DataTables sorting plugin, title-numeric, for sorting cells based on a decimal number embedded in a span title attribute. This allows currency amounts to be formatted properly for display without having to writing a sorting plugin that's super-smart about removing the formatting, particularly for locales that use a comma as the decimal mark. The sorter plugin can be used like this: - In the DataTables config: "aoColumns": [ { "sType": "title-numeric" }, ] - In the table data <td><span title="[% decimal_number_that_JS_parseFloat_accepts %]"> [% formatted currency %] </span></td> To test: [1] Ensure that there is at least one active budget and at least one inactive one. [2] Go to the acquisitions home page. Note that changing the sort order on the amount, ordered, spent, or avail columns results in incorrect sorting that is either ASCII-betical or which ignores any component of large numbers that occur after the thousands separator. [3] Apply the patch. [4] Verify that the sorting now works correctly and that no JavaScript errors appear in the JS debug console of your choice. Signed-off-by: Galen Charlton <gmc@esilibrary.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #20839|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #20858|0 |1 is obsolete| | --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 20859 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20859&action=edit [SIGNED OFF] Bug 10792: fix sorting of funds table on acquisitions home page This patch introduces a DataTables sorting plugin, title-numeric, for sorting cells based on a decimal number embedded in a span title attribute. This allows currency amounts to be formatted properly for display without having to writing a sorting plugin that's super-smart about removing the formatting, particularly for locales that use a comma as the decimal mark. The sorter plugin can be used like this: - In the DataTables config: "aoColumns": [ { "sType": "title-numeric" }, ] - In the table data <td><span title="[% decimal_number_that_JS_parseFloat_accepts %]"> [% formatted currency %] </span></td> To test: [1] Ensure that there is at least one active budget and at least one inactive one. [2] Go to the acquisitions home page. Note that changing the sort order on the amount, ordered, spent, or avail columns results in incorrect sorting that is either ASCII-betical or which ignores any component of large numbers that occur after the thousands separator. [3] Apply the patch. [4] Verify that the sorting now works correctly and that no JavaScript errors appear in the JS debug console of your choice. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Sorting now works correctly, for active and inactive funds. Passes all tests and QA script. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #6 from Kyle M Hall <kyle@bywatersolutions.com> --- I'm afraid I cannot reproduce the correct behavior with the patch applied. Please let me know if I'm testing incorrectly: http://screencast.com/t/qX21hg9M -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #20859|0 |1 is obsolete| | --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 21046 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=21046&action=edit Bug 10792: fix sorting of funds table on acquisitions home page This patch introduces a DataTables sorting plugin, title-numeric, for sorting cells based on a decimal number embedded in a span title attribute. This allows currency amounts to be formatted properly for display without having to writing a sorting plugin that's super-smart about removing the formatting, particularly for locales that use a comma as the decimal mark. The sorter plugin can be used like this: - In the DataTables config: "aoColumns": [ { "sType": "title-numeric" }, ] - In the table data <td><span title="[% decimal_number_that_JS_parseFloat_accepts %]"> [% formatted currency %] </span></td> To test: [1] Ensure that there is at least one active budget and at least one inactive one. [2] Go to the acquisitions home page. Note that changing the sort order on the amount, ordered, spent, or avail columns results in incorrect sorting that is either ASCII-betical or which ignores any component of large numbers that occur after the thousands separator. [3] Apply the patch. [4] Verify that the sorting now works correctly and that no JavaScript errors appear in the JS debug console of your choice. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Sorting now works correctly, for active and inactive funds. Passes all tests and QA script. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |gmcharlt@gmail.com --- Comment #8 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10792 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Galen, this doesn't apply cleanly on 3.12.x. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org