Bug 27005

Summary: Adding a filter in the datatable of opac-readingrecord page
Product: Koha Reporter: Alexis Ripetti <alexis.ripetti>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, david, fridolin.somers, martin.renvoize
Version: MainKeywords: Academy, Manual
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
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
Bug Depends on: 27543    
Bug Blocks:    
Attachments: Bug 27005: Adding a filter in the datatable of opac-readingrecord page
Bug 27005: Adding a filter in the datatable of opac-readingrecord page
Bug 27005: Adding a filter in the datatable of opac-readingrecord page
Bug 27005: (follow-up) Enable the exclusion of columns from export
Bug 27005: (follow-up) Exclude links column from sort and export
Bug 27005: Adding a filter in the datatable of opac-readingrecord page
Bug 27005: (follow-up) Enable the exclusion of columns from export
Bug 27005: (follow-up) Exclude links column from sort and export
Bug 27005: (follow-up) Add missing aria-hidden attributes
Bug 27005: Adding a filter in the datatable of opac-readingrecord page
Bug 27005: (follow-up) Enable the exclusion of columns from export
Bug 27005: (follow-up) Exclude links column from sort and export
Bug 27005: (follow-up) Add missing aria-hidden attributes

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