Bug 27005 - Adding a filter in the datatable of opac-readingrecord page
Summary: Adding a filter in the datatable of opac-readingrecord page
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords: Academy, Manual
Depends on: 27543
Blocks:
  Show dependency treegraph
 
Reported: 2020-11-12 16:36 UTC by Alexis Ripetti
Modified: 2021-06-14 21:35 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Text to go in the release notes:
This patch adds a search field and export options to the OPAC for a patron's checkout history table.
Version(s) released in:
21.05.00


Attachments
Bug 27005: Adding a filter in the datatable of opac-readingrecord page (1.93 KB, patch)
2020-11-12 16:43 UTC, Alexis Ripetti
Details | Diff | Splinter Review
Bug 27005: Adding a filter in the datatable of opac-readingrecord page (4.50 KB, patch)
2021-01-22 12:48 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27005: Adding a filter in the datatable of opac-readingrecord page (4.55 KB, patch)
2021-01-25 04:28 UTC, David Nind
Details | Diff | Splinter Review
Bug 27005: (follow-up) Enable the exclusion of columns from export (7.88 KB, patch)
2021-01-27 12:14 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27005: (follow-up) Exclude links column from sort and export (1.40 KB, patch)
2021-01-27 12:14 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27005: Adding a filter in the datatable of opac-readingrecord page (4.60 KB, patch)
2021-01-28 10:49 UTC, David Nind
Details | Diff | Splinter Review
Bug 27005: (follow-up) Enable the exclusion of columns from export (7.93 KB, patch)
2021-01-28 10:49 UTC, David Nind
Details | Diff | Splinter Review
Bug 27005: (follow-up) Exclude links column from sort and export (1.45 KB, patch)
2021-01-28 10:49 UTC, David Nind
Details | Diff | Splinter Review
Bug 27005: (follow-up) Add missing aria-hidden attributes (1.81 KB, patch)
2021-01-29 12:06 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27005: Adding a filter in the datatable of opac-readingrecord page (4.64 KB, patch)
2021-02-02 11:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 27005: (follow-up) Enable the exclusion of columns from export (7.98 KB, patch)
2021-02-02 11:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 27005: (follow-up) Exclude links column from sort and export (1.51 KB, patch)
2021-02-02 11:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 27005: (follow-up) Add missing aria-hidden attributes (1.87 KB, patch)
2021-02-02 11:05 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alexis Ripetti 2020-11-12 16:36:56 UTC
Adding a filter to the datatable in order to facilitate research in the opac-readingrecord page.
Comment 1 Alexis Ripetti 2020-11-12 16:43:23 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2021-01-22 01:13:19 UTC
This patch adds a DataTable initialization but the old one is still there. The configuration options from the old dataTable() call should be added to the KohaTable() one.
Comment 3 Owen Leonard 2021-01-22 12:48:48 UTC
Created attachment 115683 [details] [review]
Bug 27005: Adding a filter in the datatable of opac-readingrecord page

This patch adds a search field and export options to the
patron's checkout history table in the OPAC.

This patch also adds some showing/hiding classes to controls which
should only be seen by users with or without JavaScript: The <select>
for resorting the table is hidden when JS is enabled. The tabs for
filtering checkouts from on-site checkouts are hidden when JS is
disabled.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

 - Log in to the OPAC as a user who has both regular and on-site
   checkouts.
 - Go to "Your checkout history."
 - The table of checkouts should have controls at the top: A search
   field, "Clear filter," "Copy," "CSV," and "Print."
 - Confirm that the search filter works: Enter some text which will
   return results among regular or on-site checkouts.
   - It should work correctly to filter the results.
   - If you switch tabs, the filter should persist, and correctly filter
     the results under "Checkouts" and "On-site checkouts."
   - The "Clear filter" button should work correctly to clear your
     search.
  - Test the export and print button to confirm that they work for each
    table.
Comment 4 David Nind 2021-01-25 04:28:57 UTC
Created attachment 115737 [details] [review]
Bug 27005: Adding a filter in the datatable of opac-readingrecord page

This patch adds a search field and export options to the
patron's checkout history table in the OPAC.

This patch also adds some showing/hiding classes to controls which
should only be seen by users with or without JavaScript: The <select>
for resorting the table is hidden when JS is enabled. The tabs for
filtering checkouts from on-site checkouts are hidden when JS is
disabled.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

 - Log in to the OPAC as a user who has both regular and on-site
   checkouts.
 - Go to "Your checkout history."
 - The table of checkouts should have controls at the top: A search
   field, "Clear filter," "Copy," "CSV," and "Print."
 - Confirm that the search filter works: Enter some text which will
   return results among regular or on-site checkouts.
   - It should work correctly to filter the results.
   - If you switch tabs, the filter should persist, and correctly filter
     the results under "Checkouts" and "On-site checkouts."
   - The "Clear filter" button should work correctly to clear your
     search.
  - Test the export and print button to confirm that they work for each
    table.

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2021-01-25 04:34:30 UTC
I have one minor suggestion, if it is possible.

For the export and print lists, in the type column the value is shown as standard_checkout and onsite_checkout. Ideally these should be shown as "normal" human readable information, such as Standard checkout or On-site checkout, instead of the name used by Koha.

Testing notes: 
- To enable the on-site checkout feature, enable the OnSiteCheckouts system preference.
Comment 6 Owen Leonard 2021-01-27 12:14:55 UTC
Created attachment 115877 [details] [review]
Bug 27005: (follow-up) Enable the exclusion of columns from export

This patch copies code from the staff interface which allows us to add a
class to table columns which should not be included in print or export
operations. The hidden column which facilitates the "Checkouts" and
"On-site checkouts" tabs can now be hidden in prints and exports.

To test, apply the patch and follow the previous test plan. When testing
the export and print buttons, confirm that the column with
"standard_checkout" data is not included.
Comment 7 Owen Leonard 2021-01-27 12:14:58 UTC
Created attachment 115878 [details] [review]
Bug 27005: (follow-up) Exclude links column from sort and export

I'm adding this as an additional follow-up in case anyone disagrees that
the "Links" column (defined in the OPACMySummaryHTML preference) should
be excluded from print and export.
Comment 8 David Nind 2021-01-28 10:49:17 UTC
Created attachment 115928 [details] [review]
Bug 27005: Adding a filter in the datatable of opac-readingrecord page

This patch adds a search field and export options to the
patron's checkout history table in the OPAC.

This patch also adds some showing/hiding classes to controls which
should only be seen by users with or without JavaScript: The <select>
for resorting the table is hidden when JS is enabled. The tabs for
filtering checkouts from on-site checkouts are hidden when JS is
disabled.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

 - Log in to the OPAC as a user who has both regular and on-site
   checkouts.
 - Go to "Your checkout history."
 - The table of checkouts should have controls at the top: A search
   field, "Clear filter," "Copy," "CSV," and "Print."
 - Confirm that the search filter works: Enter some text which will
   return results among regular or on-site checkouts.
   - It should work correctly to filter the results.
   - If you switch tabs, the filter should persist, and correctly filter
     the results under "Checkouts" and "On-site checkouts."
   - The "Clear filter" button should work correctly to clear your
     search.
  - Test the export and print button to confirm that they work for each
    table.

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 David Nind 2021-01-28 10:49:20 UTC
Created attachment 115929 [details] [review]
Bug 27005: (follow-up) Enable the exclusion of columns from export

This patch copies code from the staff interface which allows us to add a
class to table columns which should not be included in print or export
operations. The hidden column which facilitates the "Checkouts" and
"On-site checkouts" tabs can now be hidden in prints and exports.

To test, apply the patch and follow the previous test plan. When testing
the export and print buttons, confirm that the column with
"standard_checkout" data is not included.

Signed-off-by: David Nind <david@davidnind.com>
Comment 10 David Nind 2021-01-28 10:49:24 UTC
Created attachment 115930 [details] [review]
Bug 27005: (follow-up) Exclude links column from sort and export

I'm adding this as an additional follow-up in case anyone disagrees that
the "Links" column (defined in the OPACMySummaryHTML preference) should
be excluded from print and export.

Signed-off-by: David Nind <david@davidnind.com>
Comment 11 Katrin Fischer 2021-01-28 22:19:47 UTC
Hi Owen, I am a little confused by the following 2 warnings, can you please check?
 FAIL	koha-tmpl/opac-tmpl/bootstrap/en/includes/columns_settings.inc
   OK	  filters
   FAIL	  forbidden patterns
		forbidden pattern: Font Awesome icons need the aria-hidden attribute for accessibility purpose (see bug 25166)  (line 50)
		forbidden pattern: Font Awesome icons need the aria-hidden attribute for accessibility purpose (see bug 25166)  (line 90)
Comment 12 Owen Leonard 2021-01-29 12:06:55 UTC
Created attachment 116020 [details] [review]
Bug 27005: (follow-up) Add missing aria-hidden attributes
Comment 13 Martin Renvoize 2021-02-02 11:05:38 UTC
Created attachment 116199 [details] [review]
Bug 27005: Adding a filter in the datatable of opac-readingrecord page

This patch adds a search field and export options to the
patron's checkout history table in the OPAC.

This patch also adds some showing/hiding classes to controls which
should only be seen by users with or without JavaScript: The <select>
for resorting the table is hidden when JS is enabled. The tabs for
filtering checkouts from on-site checkouts are hidden when JS is
disabled.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

 - Log in to the OPAC as a user who has both regular and on-site
   checkouts.
 - Go to "Your checkout history."
 - The table of checkouts should have controls at the top: A search
   field, "Clear filter," "Copy," "CSV," and "Print."
 - Confirm that the search filter works: Enter some text which will
   return results among regular or on-site checkouts.
   - It should work correctly to filter the results.
   - If you switch tabs, the filter should persist, and correctly filter
     the results under "Checkouts" and "On-site checkouts."
   - The "Clear filter" button should work correctly to clear your
     search.
  - Test the export and print button to confirm that they work for each
    table.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Martin Renvoize 2021-02-02 11:05:41 UTC
Created attachment 116200 [details] [review]
Bug 27005: (follow-up) Enable the exclusion of columns from export

This patch copies code from the staff interface which allows us to add a
class to table columns which should not be included in print or export
operations. The hidden column which facilitates the "Checkouts" and
"On-site checkouts" tabs can now be hidden in prints and exports.

To test, apply the patch and follow the previous test plan. When testing
the export and print buttons, confirm that the column with
"standard_checkout" data is not included.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 15 Martin Renvoize 2021-02-02 11:05:45 UTC
Created attachment 116201 [details] [review]
Bug 27005: (follow-up) Exclude links column from sort and export

I'm adding this as an additional follow-up in case anyone disagrees that
the "Links" column (defined in the OPACMySummaryHTML preference) should
be excluded from print and export.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 16 Martin Renvoize 2021-02-02 11:05:48 UTC
Created attachment 116202 [details] [review]
Bug 27005: (follow-up) Add missing aria-hidden attributes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 17 Martin Renvoize 2021-02-02 11:06:34 UTC
Nice enhancement, works well.

No regressions found and QA scripts are happy.

Passing QA
Comment 18 Jonathan Druart 2021-02-08 16:04:52 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 19 Fridolin Somers 2021-02-12 14:20:30 UTC
Enhancement not pushed to 20.11.x