Bug 21852

Summary: Add more columns and column configuration to overdues report
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: dcook, jose-mario.monteiro-santos, katrin.fischer, marjorie.barry-vila, maryse.simard, nick, testopia
Version: MainKeywords: Academy
Hardware: All   
OS: All   
URL: /cgi-bin/koha/circ/overdue.pl
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22276
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00
Bug Depends on: 21837, 23273    
Bug Blocks: 19282, 26362    
Attachments: Bug 21852: Add more columns and column configuration to overdues report
Bug 21852: Add more columns and column configuration to overdues report
Bug 21852: Add more columns and column configuration to overdues report
Bug 21852: (follow-up) Correct columns configuration YAML
Bug 21852: Add more columns and column configuration to overdues report
Bug 21852: (follow-up) Correct columns configuration YAML
Bug 21852: Add more columns and column configuration to overdues report
Bug 21852: (follow-up) Correct columns configuration YAML
Bug 21852: (follow up) Remove persistent DataTables user configuration
Bug 21852: Add more columns and column configuration to overdues report
Bug 21852: (follow-up) Correct columns configuration YAML
Bug 21852: (follow up) Remove persistent DataTables user configuration
Bug 21852: Add more columns and column configuration to overdues report
Bug 21852: (follow-up) Correct columns configuration YAML
Bug 21852: (follow up) Remove persistent DataTables user configuration
Bug 21852: Add more columns and column configuration to overdues report
Bug 21852: (follow-up) Correct columns configuration YAML
Bug 21852: (follow up) Remove persistent DataTables user configuration
Bug 21852: Add more columns and column configuration to overdues report
Bug 21852: Add more columns and column configuration to overdues report

Description Owen Leonard 2018-11-16 15:12:22 UTC
I propose to add more available columns to the overdues report and column configuration to hide the new columns by default.
Comment 1 Owen Leonard 2018-11-20 15:13:59 UTC Comment hidden (obsolete)
Comment 2 José-Mario Monteiro-Santos 2019-01-18 20:21:26 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2019-01-22 12:58:53 UTC Comment hidden (obsolete)
Comment 4 Maryse Simard 2019-01-25 21:12:31 UTC
I followed the test plan and everything works. But I ran into some troubles on the columns settings page (Administration > Configure columns).

First, the column names for the table circ-overdues don't appear. Also, on that same page, if I try to save a new column configuration for that table (randomly, because I cannot see the column names), my changes aren't kept.
Comment 5 Owen Leonard 2019-02-01 17:16:10 UTC Comment hidden (obsolete)
Comment 6 Owen Leonard 2019-02-01 17:16:14 UTC Comment hidden (obsolete)
Comment 7 Maryse Simard 2019-02-01 19:29:50 UTC Comment hidden (obsolete)
Comment 8 Maryse Simard 2019-02-01 19:30:29 UTC Comment hidden (obsolete)
Comment 9 Katrin Fischer 2019-02-02 14:07:08 UTC
Hi Owen, I am passing QA on this, but can I ask you to please complete the cookie documentation on the wiki according to coding guidelines?
https://wiki.koha-community.org/wiki/Use_of_Cookies
Comment 10 Katrin Fischer 2019-02-02 14:08:02 UTC
Created attachment 84663 [details] [review]
Bug 21852: Add more columns and column configuration to overdues report

This patch adds some new columns to the overdue report: Patron category,
item home library, item holding library, item type. Adding these columns
makes available columns better match the available filter fields in the
sidebar form.

Column configuration is added to this DataTable, with the new columns
defined as hidden by default in order to preserve current functionality.

New code has been added to the global DataTables configuration to allow
the locally-stored column visibility information to override the default
Koha configuration for that table. This lets us take advantage of the
"stateSave" option in DataTAbles.

This patch also fixes a bug where the home and holding branch template
variable names didn't match what was being used in the template for
pre-selecting the searched-for value in the sidebar filter menu.

To test, apply the patch and go to Circulation -> Overdues.

 - The list of overdues should look correct, with no new columns shown.
 - Test the column visibility button, showing the columns which are
   hidden by default. Confirm that the data in these columns displays
   correctly.
 - Show or hide columns in such a way that it doesn't match the default
   configuration.
   - Navigate away from this page.
   - Return to the page. The same set of columns should be visible.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2019-02-02 14:08:06 UTC
Created attachment 84664 [details] [review]
Bug 21852: (follow-up) Correct columns configuration YAML

This patch corrects a parameter name in the columns configuration file.
"columnname" was misspelled "columname."

To test, apply the patch and restart Plack (or restart_all on
kohadevbox). Follow the test plan in the original patch.

Important testing note: This patch adds persistence to the column
visibility which you select. This means that updating the default column
visibility won't necessarily be reflected automatically in the table in
question.

To confirm that defaults are being loaded one must delete the browser's
Local Storage data for that table.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Owen Leonard 2019-02-04 13:42:22 UTC
(In reply to Katrin Fischer from comment #9)
> Hi Owen, I am passing QA on this, but can I ask you to please complete the
> cookie documentation on the wiki according to coding guidelines?

Done. Let me know if I need to provide more information.
Comment 13 Katrin Fischer 2019-02-04 17:04:27 UTC
(In reply to Owen Leonard from comment #12)
> (In reply to Katrin Fischer from comment #9)
> > Hi Owen, I am passing QA on this, but can I ask you to please complete the
> > cookie documentation on the wiki according to coding guidelines?
> 
> Done. Let me know if I need to provide more information.

Thx!
Comment 14 Nick Clemens 2019-02-04 17:10:14 UTC
I really really like this, but I kind of want to see the state save on its own bug for highlighting in the release and so we have an example of hwo to do this for many tables - we may also want to add it more broadly upon adding so one table is not inconsistent with others.
Comment 15 Owen Leonard 2019-02-04 18:58:52 UTC
Created attachment 84735 [details] [review]
Bug 21852: (follow up) Remove persistent DataTables user configuration

This patch removes the DataTables function for restoring a user's
previous configuration.
Comment 16 Maryse Simard 2019-05-31 21:03:03 UTC
Patch doesn't apply

Applying: Bug 21852: Add more columns and column configuration to overdues report
Using index info to reconstruct a base tree...
M	admin/columns_settings.yml
M	koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt
M	koha-tmpl/intranet-tmpl/prog/js/datatables.js
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/js/datatables.js
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/js/datatables.js
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt
Auto-merging admin/columns_settings.yml
error: Failed to merge in the changes.
Patch failed at 0001 Bug 21852: Add more columns and column configuration to overdues report
Comment 17 Owen Leonard 2019-06-03 14:33:47 UTC
Created attachment 90269 [details] [review]
Bug 21852: Add more columns and column configuration to overdues report

This patch adds some new columns to the overdue report: Patron category,
item home library, item holding library, item type. Adding these columns
makes available columns better match the available filter fields in the
sidebar form.

Column configuration is added to this DataTable, with the new columns
defined as hidden by default in order to preserve current functionality.

New code has been added to the global DataTables configuration to allow
the locally-stored column visibility information to override the default
Koha configuration for that table. This lets us take advantage of the
"stateSave" option in DataTAbles.

This patch also fixes a bug where the home and holding branch template
variable names didn't match what was being used in the template for
pre-selecting the searched-for value in the sidebar filter menu.

To test, apply the patch and go to Circulation -> Overdues.

 - The list of overdues should look correct, with no new columns shown.
 - Test the column visibility button, showing the columns which are
   hidden by default. Confirm that the data in these columns displays
   correctly.
 - Show or hide columns in such a way that it doesn't match the default
   configuration.
   - Navigate away from this page.
   - Return to the page. The same set of columns should be visible.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 18 Owen Leonard 2019-06-03 14:33:51 UTC
Created attachment 90270 [details] [review]
Bug 21852: (follow-up) Correct columns configuration YAML

This patch corrects a parameter name in the columns configuration file.
"columnname" was misspelled "columname."

To test, apply the patch and restart Plack (or restart_all on
kohadevbox). Follow the test plan in the original patch.

Important testing note: This patch adds persistence to the column
visibility which you select. This means that updating the default column
visibility won't necessarily be reflected automatically in the table in
question.

To confirm that defaults are being loaded one must delete the browser's
Local Storage data for that table.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 19 Owen Leonard 2019-06-03 14:33:54 UTC
Created attachment 90271 [details] [review]
Bug 21852: (follow up) Remove persistent DataTables user configuration

This patch removes the DataTables function for restoring a user's
previous configuration.
Comment 20 Katrin Fischer 2019-08-18 10:17:03 UTC
Owen, could you please rebase?
Comment 21 Owen Leonard 2019-08-20 00:04:05 UTC
Created attachment 92369 [details] [review]
Bug 21852: Add more columns and column configuration to overdues report

This patch adds some new columns to the overdue report: Patron category,
item home library, item holding library, item type. Adding these columns
makes available columns better match the available filter fields in the
sidebar form.

Column configuration is added to this DataTable, with the new columns
defined as hidden by default in order to preserve current functionality.

New code has been added to the global DataTables configuration to allow
the locally-stored column visibility information to override the default
Koha configuration for that table. This lets us take advantage of the
"stateSave" option in DataTAbles.

This patch also fixes a bug where the home and holding branch template
variable names didn't match what was being used in the template for
pre-selecting the searched-for value in the sidebar filter menu.

To test, apply the patch and go to Circulation -> Overdues.

 - The list of overdues should look correct, with no new columns shown.
 - Test the column visibility button, showing the columns which are
   hidden by default. Confirm that the data in these columns displays
   correctly.
 - Show or hide columns in such a way that it doesn't match the default
   configuration.
   - Navigate away from this page.
   - Return to the page. The same set of columns should be visible.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 22 Owen Leonard 2019-08-20 00:04:09 UTC
Created attachment 92370 [details] [review]
Bug 21852: (follow-up) Correct columns configuration YAML

This patch corrects a parameter name in the columns configuration file.
"columnname" was misspelled "columname."

To test, apply the patch and restart Plack (or restart_all on
kohadevbox). Follow the test plan in the original patch.

Important testing note: This patch adds persistence to the column
visibility which you select. This means that updating the default column
visibility won't necessarily be reflected automatically in the table in
question.

To confirm that defaults are being loaded one must delete the browser's
Local Storage data for that table.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 23 Owen Leonard 2019-08-20 00:04:13 UTC
Created attachment 92371 [details] [review]
Bug 21852: (follow up) Remove persistent DataTables user configuration

This patch removes the DataTables function for restoring a user's
previous configuration.
Comment 24 Katrin Fischer 2019-08-20 06:01:01 UTC
Sorry to ask, but do the test plans of the first 2 patches still apply with the last patch removing persistent DataTables? (By the way...I'd like that)
Comment 25 Katrin Fischer 2019-08-20 06:09:14 UTC
Created attachment 92373 [details] [review]
Bug 21852: Add more columns and column configuration to overdues report

This patch adds some new columns to the overdue report: Patron category,
item home library, item holding library, item type. Adding these columns
makes available columns better match the available filter fields in the
sidebar form.

Column configuration is added to this DataTable, with the new columns
defined as hidden by default in order to preserve current functionality.

New code has been added to the global DataTables configuration to allow
the locally-stored column visibility information to override the default
Koha configuration for that table. This lets us take advantage of the
"stateSave" option in DataTAbles.

This patch also fixes a bug where the home and holding branch template
variable names didn't match what was being used in the template for
pre-selecting the searched-for value in the sidebar filter menu.

To test, apply the patch and go to Circulation -> Overdues.

 - The list of overdues should look correct, with no new columns shown.
 - Test the column visibility button, showing the columns which are
   hidden by default. Confirm that the data in these columns displays
   correctly.
 - Show or hide columns in such a way that it doesn't match the default
   configuration.
   - Navigate away from this page.
   - Return to the page. The same set of columns should be visible.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 26 Katrin Fischer 2019-08-20 06:09:18 UTC
Created attachment 92374 [details] [review]
Bug 21852: (follow-up) Correct columns configuration YAML

This patch corrects a parameter name in the columns configuration file.
"columnname" was misspelled "columname."

To test, apply the patch and restart Plack (or restart_all on
kohadevbox). Follow the test plan in the original patch.

Important testing note: This patch adds persistence to the column
visibility which you select. This means that updating the default column
visibility won't necessarily be reflected automatically in the table in
question.

To confirm that defaults are being loaded one must delete the browser's
Local Storage data for that table.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 27 Katrin Fischer 2019-08-20 06:09:22 UTC
Created attachment 92375 [details] [review]
Bug 21852: (follow up) Remove persistent DataTables user configuration

This patch removes the DataTables function for restoring a user's
previous configuration.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 28 Katrin Fischer 2019-08-20 06:11:52 UTC
Hi Owen,
before pushing this I tihnk it would be nice to clarify the commit messages to not give a false impression.

I'd also love to see persistency added on a follow-up bug as it's especially annoying here to lose your selection everytime you change your search/filters.

Note: Atm this suffers from the same missing filter as the dependency.
Comment 29 Owen Leonard 2019-08-20 10:52:10 UTC
(In reply to Katrin Fischer from comment #28)

> before pushing this I tihnk it would be nice to clarify the commit messages
> to not give a false impression.

Would it be useful for me to squash the patches and revise the commit message?
Comment 30 Katrin Fischer 2019-08-20 11:38:17 UTC
Hi Owen, I think that would help to clear up the confusion.

Should we file a new bug for adding persistance?
Comment 31 Katrin Fischer 2019-09-02 06:08:07 UTC
I wanted to go ahead and squash, but there is a slight conflict with the datatables update I think. I tried to fix it, but failed - can you have a look please?
Comment 32 Owen Leonard 2019-09-03 14:55:33 UTC
Created attachment 92575 [details] [review]
Bug 21852: Add more columns and column configuration to overdues report

This patch adds some new columns to the overdue report: Patron category,
item home library, item holding library, item type. Adding these columns
makes available columns better match the available filter fields in the
sidebar form.

Column configuration is added to this DataTable, with the new columns
defined as hidden by default in order to preserve current functionality.

This patch also fixes a bug where the home and holding branch template
variable names didn't match what was being used in the template for
pre-selecting the searched-for value in the sidebar filter menu.

To test, apply the patch and go to Circulation -> Overdues.

 - The list of overdues should look correct, with no new columns shown.
 - Test the column visibility button, showing the columns which are
   hidden by default. Confirm that the data in these columns displays
   correctly.
 - Update the default configuration for this table in Administration
   -> Configure columns. Confirm that your changes are applied to the
   overdues report.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 33 Katrin Fischer 2019-09-15 20:35:46 UTC
Created attachment 92823 [details] [review]
Bug 21852: Add more columns and column configuration to overdues report

This patch adds some new columns to the overdue report: Patron category,
item home library, item holding library, item type. Adding these columns
makes available columns better match the available filter fields in the
sidebar form.

Column configuration is added to this DataTable, with the new columns
defined as hidden by default in order to preserve current functionality.

This patch also fixes a bug where the home and holding branch template
variable names didn't match what was being used in the template for
pre-selecting the searched-for value in the sidebar filter menu.

To test, apply the patch and go to Circulation -> Overdues.

 - The list of overdues should look correct, with no new columns shown.
 - Test the column visibility button, showing the columns which are
   hidden by default. Confirm that the data in these columns displays
   correctly.
 - Update the default configuration for this table in Administration
   -> Configure columns. Confirm that your changes are applied to the
   overdues report.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 34 Katrin Fischer 2019-09-15 20:36:06 UTC
Thx for your patience!
Comment 35 Martin Renvoize 2019-09-17 13:52:29 UTC
Nice work!

Pushed to master for 19.11.00
Comment 36 Katrin Fischer 2020-01-06 15:35:18 UTC
*** Bug 13710 has been marked as a duplicate of this bug. ***
Comment 37 David Cook 2020-09-03 04:53:30 UTC
Sorry to say it but this patch actually makes the overdues report (potentially) inaccurate in terms of libraries. 

See Bug 26362 for the explanation and upcoming patch.