Bug 24156 - Basket - Make sort order and number of items to display configurable
Summary: Basket - Make sort order and number of items to display configurable
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Alex Arnaud
URL:
Keywords:
Depends on:
Blocks: 25974 27292
  Show dependency treegraph
 
Reported: 2019-12-03 19:33 UTC by Jonathan Druart
Modified: 2021-12-13 21:09 UTC (History)
4 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This patch adds new options in the Table settings section to make the sort order and number of results per page in the basket table configurable.
Version(s) released in:
20.11.00


Attachments
Bug 24156: DB changes (2.38 KB, patch)
2019-12-12 17:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: DBIC changes (3.00 KB, patch)
2019-12-12 17:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: move ColumnsSettings to TablesSettings (49.42 KB, patch)
2019-12-12 17:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Add columns_settings.yml changes (3.14 KB, patch)
2019-12-12 17:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Add missing columns to yml (1.00 KB, patch)
2019-12-12 17:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Make sort order and number of items to display configurable (basket page) (31.98 KB, patch)
2019-12-12 17:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Adjust other tables in the yml file (51.02 KB, patch)
2019-12-12 17:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Make sort order and number of items to display configurable (basket page) (32.02 KB, patch)
2019-12-12 17:12 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: DB changes (2.38 KB, patch)
2020-02-05 12:01 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: DBIC changes (3.00 KB, patch)
2020-02-05 12:01 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: move ColumnsSettings to TablesSettings (49.28 KB, patch)
2020-02-05 12:01 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Add columns_settings.yml changes (3.12 KB, patch)
2020-02-05 12:02 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Add missing columns to yml (1.00 KB, patch)
2020-02-05 12:02 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Adjust other tables in the yml file (52.61 KB, patch)
2020-02-05 12:02 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Make sort order and number of items to display configurable (basket page) (32.02 KB, patch)
2020-02-05 12:02 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Fix set sort order to the first column (1.21 KB, patch)
2020-02-05 12:02 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: move ColumnsSettings to TablesSettings (49.27 KB, patch)
2020-02-13 14:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Add columns_settings.yml changes (3.12 KB, patch)
2020-02-13 14:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Add missing columns to yml (1.00 KB, patch)
2020-02-13 14:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Adjust other tables in the yml file (52.70 KB, patch)
2020-02-13 14:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Make sort order and number of items to display configurable (basket page) (32.02 KB, patch)
2020-02-13 14:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Fix set sort order to the first column (1.21 KB, patch)
2020-02-13 14:42 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: DB changes (2.42 KB, patch)
2020-02-14 18:41 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 24156: DBIC changes (3.05 KB, patch)
2020-02-14 18:41 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 24156: move ColumnsSettings to TablesSettings (49.31 KB, patch)
2020-02-14 18:41 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 24156: Add columns_settings.yml changes (3.16 KB, patch)
2020-02-14 18:41 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 24156: Add missing columns to yml (1.05 KB, patch)
2020-02-14 18:41 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 24156: Adjust other tables in the yml file (52.75 KB, patch)
2020-02-14 18:41 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 24156: Make sort order and number of items to display configurable (basket page) (32.11 KB, patch)
2020-02-14 18:41 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 24156: Fix set sort order to the first column (1.30 KB, patch)
2020-02-14 18:41 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 24156: DB changes (2.50 KB, patch)
2020-06-12 14:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: DBIC changes (3.04 KB, patch)
2020-06-12 14:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: move ColumnsSettings to TablesSettings (57.18 KB, patch)
2020-06-12 14:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Add columns_settings.yml changes (3.44 KB, patch)
2020-06-12 14:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Adjust other tables in the yml file (63.55 KB, patch)
2020-06-12 14:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Make sort order and number of items to display configurable (basket page) (31.86 KB, patch)
2020-06-12 14:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Fix set sort order to the first column (1.30 KB, patch)
2020-06-12 14:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: DB changes (2.50 KB, patch)
2020-06-23 09:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: DBIC changes (3.04 KB, patch)
2020-06-23 09:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: move ColumnsSettings to TablesSettings (57.29 KB, patch)
2020-06-23 09:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Add columns_settings.yml changes (3.44 KB, patch)
2020-06-23 09:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Adjust other tables in the yml file (63.55 KB, patch)
2020-06-23 09:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Make sort order and number of items to display configurable (basket page) (31.86 KB, patch)
2020-06-23 09:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Fix set sort order to the first column (1.30 KB, patch)
2020-06-23 09:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Fix soem QA failures (3.50 KB, patch)
2020-06-23 09:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Rename 'Columns settings' with 'Tables settings' on the UI (2.77 KB, patch)
2020-06-23 09:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: Rename 'Columns settings' with 'Tables settings' on the UI (3.90 KB, patch)
2020-06-24 07:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24156: DB changes (2.48 KB, patch)
2020-06-24 07:58 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 24156: DBIC changes (3.10 KB, patch)
2020-06-24 07:58 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 24156: move ColumnsSettings to TablesSettings (57.59 KB, patch)
2020-06-24 07:58 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 24156: Add columns_settings.yml changes (3.50 KB, patch)
2020-06-24 07:58 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 24156: Adjust other tables in the yml file (63.61 KB, patch)
2020-06-24 07:58 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 24156: Make sort order and number of items to display configurable (basket page) (31.95 KB, patch)
2020-06-24 07:58 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 24156: Fix set sort order to the first column (1.35 KB, patch)
2020-06-24 07:58 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 24156: Fix soem QA failures (3.58 KB, patch)
2020-06-24 07:59 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 24156: Rename 'Columns settings' with 'Tables settings' on the UI (3.97 KB, patch)
2020-06-24 07:59 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 24156: (follow-up) UI - Use "Table settings" (3.77 KB, patch)
2020-06-24 12:22 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2019-12-03 19:33:43 UTC
Add a mechanism so users can determine:
 * The default sort order of items in basket view
 * The default number of items to display in basket view

To achieve this we will add new options to "Additional Parameters > Column Settings".
Comment 1 Jonathan Druart 2019-12-12 17:10:10 UTC
Created attachment 96223 [details] [review]
Bug 24156: DB changes

Add a new table tables_settings to store default_display_length and
default_sort_order.
Comment 2 Jonathan Druart 2019-12-12 17:10:13 UTC
Created attachment 96224 [details] [review]
Bug 24156: DBIC changes
Comment 3 Jonathan Druart 2019-12-12 17:10:16 UTC
Created attachment 96225 [details] [review]
Bug 24156: move ColumnsSettings to TablesSettings

We are preparing the ground with this patch. As the "Columns settings"
page will now add the ability to modify settings for the whole table, it
makes sense to rename the file and the variables.

Note that the controller script (admin/columns_settings.pl) and the yml
(admin/columns_settings.yml) files have not been moved to not break
shortcuts and abits people could have. But if QA decides, it could be
easy to do.
Comment 4 Jonathan Druart 2019-12-12 17:10:20 UTC
Created attachment 96226 [details] [review]
Bug 24156: Add columns_settings.yml changes

Modification of the structure of the yml file.
It was
  table:
    - column list
It now becomes
    table:
      default_display_length: X
      default_sort_order: Y
      columns:
        - column list
Comment 5 Jonathan Druart 2019-12-12 17:10:23 UTC
Created attachment 96227 [details] [review]
Bug 24156: Add missing columns to yml

There were 2 columns missing
Comment 6 Jonathan Druart 2019-12-12 17:10:26 UTC
Created attachment 96228 [details] [review]
Bug 24156: Make sort order and number of items to display configurable (basket page)

This patch is the main patch of this patchset, you will find the
description and the test plan.

The idea of this new enhancement is to add the ability to define the
default sort order and the default number of rows displayed on the
acquisition basket page.
The existing "columns settings" feature was replaced by a
"tables settings" feature. To prepare the ground, there were some
works that were needed:
  * rename variables and files
  * Modify the structure of the yml files
  * Create a new DB table to store the tables settings

Test plan:
0)
  a. Execute the update DB entry to create the new table
  b. Restart all (to get a new version of the yml file, that is cached by
   memcached)
  c. Create several orders for a given basket
1) Go to the basket view page
=> The default values are the same than without this patchset, the
number of entries to display is set to "20" and the table is sorted by
basket number (first column)
2) Go to the "Columns settings" page
3) Unfold the "Acquisition" tab
=> Notice the 2 dropdown lists at the bottom of the basket table
4) Select different values for "Default display length" and "Default
sort order"
5) Refresh the basket view page
=> Notice that the default settings are now effective on the table

QA note: We can decide to replace the different occurrences of "Columns settings"
by "Tables settings" if needed.
Comment 7 Jonathan Druart 2019-12-12 17:10:29 UTC
Created attachment 96229 [details] [review]
Bug 24156: Adjust other tables in the yml file

To match the new structure, we adjust the other tables.
Comment 8 Jonathan Druart 2019-12-12 17:12:30 UTC
Created attachment 96230 [details] [review]
Bug 24156: Make sort order and number of items to display configurable (basket page)

This patch is the main patch of this patchset, you will find the
description and the test plan.

The idea of this new enhancement is to add the ability to define the
default sort order and the default number of rows displayed on the
acquisition basket page.
The existing "columns settings" feature was replaced by a
"tables settings" feature. To prepare the ground, there were some
works that were needed:
  * rename variables and files
  * Modify the structure of the yml files
  * Create a new DB table to store the tables settings

Test plan:
0)
  a. Execute the update DB entry to create the new table
  b. Restart all (to get a new version of the yml file, that is cached by
   memcached)
  c. Create several orders for a given basket
1) Go to the basket view page
=> The default values are the same than without this patchset, the
number of entries to display is set to "20" and the table is sorted by
basket number (first column)
2) Go to the "Columns settings" page
3) Unfold the "Acquisition" tab
=> Notice the 2 dropdown lists at the bottom of the basket table
4) Select different values for "Default display length" and "Default
sort order"
5) Refresh the basket view page
=> Notice that the default settings are now effective on the table

QA note: We can decide to replace the different occurrences of "Columns settings"
by "Tables settings" if needed.

Sponsored-by: Institute of Technology Tallaght
Comment 9 Owen Leonard 2019-12-19 01:16:39 UTC
I notice the choices offered under "Default sort order" include columns which are configured in the individual DataTable configuration to be unsortable. I wonder if we need to move those settings into columns_settings.yml too?
Comment 10 Jonathan Druart 2019-12-19 06:27:38 UTC
(In reply to Owen Leonard from comment #9)
> I notice the choices offered under "Default sort order" include columns
> which are configured in the individual DataTable configuration to be
> unsortable. I wonder if we need to move those settings into
> columns_settings.yml too?

Hi Owen,

Thanks for taking a look at this.
The "default sort order" dropdown list includes all the columns of the table, indeed. That could lead to inconsistencies but dealing with that on this page will add much more complexity.
Moving the sortable bit to this config page is a good idea, if we agree on such move I think it should be done for all the tables in one go, which can be quite hard to do.
I keep that in mind and will think about it to see what could be possible.
Comment 11 Jonathan Druart 2020-02-05 12:01:51 UTC
Created attachment 98449 [details] [review]
Bug 24156: DB changes

Add a new table tables_settings to store default_display_length and
default_sort_order.
Comment 12 Jonathan Druart 2020-02-05 12:01:55 UTC
Created attachment 98450 [details] [review]
Bug 24156: DBIC changes
Comment 13 Jonathan Druart 2020-02-05 12:01:58 UTC
Created attachment 98451 [details] [review]
Bug 24156: move ColumnsSettings to TablesSettings

We are preparing the ground with this patch. As the "Columns settings"
page will now add the ability to modify settings for the whole table, it
makes sense to rename the file and the variables.

Note that the controller script (admin/columns_settings.pl) and the yml
(admin/columns_settings.yml) files have not been moved to not break
shortcuts and abits people could have. But if QA decides, it could be
easy to do.
Comment 14 Jonathan Druart 2020-02-05 12:02:02 UTC
Created attachment 98452 [details] [review]
Bug 24156: Add columns_settings.yml changes

Modification of the structure of the yml file.
It was
  table:
    - column list
It now becomes
    table:
      default_display_length: X
      default_sort_order: Y
      columns:
        - column list
Comment 15 Jonathan Druart 2020-02-05 12:02:05 UTC
Created attachment 98453 [details] [review]
Bug 24156: Add missing columns to yml

There were 2 columns missing
Comment 16 Jonathan Druart 2020-02-05 12:02:09 UTC
Created attachment 98454 [details] [review]
Bug 24156: Adjust other tables in the yml file

To match the new structure, we adjust the other tables.
Comment 17 Jonathan Druart 2020-02-05 12:02:12 UTC
Created attachment 98455 [details] [review]
Bug 24156: Make sort order and number of items to display configurable (basket page)

This patch is the main patch of this patchset, you will find the
description and the test plan.

The idea of this new enhancement is to add the ability to define the
default sort order and the default number of rows displayed on the
acquisition basket page.
The existing "columns settings" feature was replaced by a
"tables settings" feature. To prepare the ground, there were some
works that were needed:
  * rename variables and files
  * Modify the structure of the yml files
  * Create a new DB table to store the tables settings

Test plan:
0)
  a. Execute the update DB entry to create the new table
  b. Restart all (to get a new version of the yml file, that is cached by
   memcached)
  c. Create several orders for a given basket
1) Go to the basket view page
=> The default values are the same than without this patchset, the
number of entries to display is set to "20" and the table is sorted by
basket number (first column)
2) Go to the "Columns settings" page
3) Unfold the "Acquisition" tab
=> Notice the 2 dropdown lists at the bottom of the basket table
4) Select different values for "Default display length" and "Default
sort order"
5) Refresh the basket view page
=> Notice that the default settings are now effective on the table

QA note: We can decide to replace the different occurrences of "Columns settings"
by "Tables settings" if needed.

Sponsored-by: Institute of Technology Tallaght
Comment 18 Jonathan Druart 2020-02-05 12:02:16 UTC
Created attachment 98456 [details] [review]
Bug 24156: Fix set sort order to the first column

In that case it's equal to 0 and we need to adjust the test condition.
Comment 19 Jonathan Druart 2020-02-13 14:41:46 UTC
Created attachment 98843 [details] [review]
Bug 24156: move ColumnsSettings to TablesSettings

We are preparing the ground with this patch. As the "Columns settings"
page will now add the ability to modify settings for the whole table, it
makes sense to rename the file and the variables.

Note that the controller script (admin/columns_settings.pl) and the yml
(admin/columns_settings.yml) files have not been moved to not break
shortcuts and abits people could have. But if QA decides, it could be
easy to do.
Comment 20 Jonathan Druart 2020-02-13 14:41:49 UTC
Created attachment 98844 [details] [review]
Bug 24156: Add columns_settings.yml changes

Modification of the structure of the yml file.
It was
  table:
    - column list
It now becomes
    table:
      default_display_length: X
      default_sort_order: Y
      columns:
        - column list
Comment 21 Jonathan Druart 2020-02-13 14:41:52 UTC
Created attachment 98845 [details] [review]
Bug 24156: Add missing columns to yml

There were 2 columns missing
Comment 22 Jonathan Druart 2020-02-13 14:41:55 UTC
Created attachment 98846 [details] [review]
Bug 24156: Adjust other tables in the yml file

To match the new structure, we adjust the other tables.
Comment 23 Jonathan Druart 2020-02-13 14:41:58 UTC
Created attachment 98847 [details] [review]
Bug 24156: Make sort order and number of items to display configurable (basket page)

This patch is the main patch of this patchset, you will find the
description and the test plan.

The idea of this new enhancement is to add the ability to define the
default sort order and the default number of rows displayed on the
acquisition basket page.
The existing "columns settings" feature was replaced by a
"tables settings" feature. To prepare the ground, there were some
works that were needed:
  * rename variables and files
  * Modify the structure of the yml files
  * Create a new DB table to store the tables settings

Test plan:
0)
  a. Execute the update DB entry to create the new table
  b. Restart all (to get a new version of the yml file, that is cached by
   memcached)
  c. Create several orders for a given basket
1) Go to the basket view page
=> The default values are the same than without this patchset, the
number of entries to display is set to "20" and the table is sorted by
basket number (first column)
2) Go to the "Columns settings" page
3) Unfold the "Acquisition" tab
=> Notice the 2 dropdown lists at the bottom of the basket table
4) Select different values for "Default display length" and "Default
sort order"
5) Refresh the basket view page
=> Notice that the default settings are now effective on the table

QA note: We can decide to replace the different occurrences of "Columns settings"
by "Tables settings" if needed.

Sponsored-by: Institute of Technology Tallaght
Comment 24 Jonathan Druart 2020-02-13 14:42:02 UTC
Created attachment 98848 [details] [review]
Bug 24156: Fix set sort order to the first column

In that case it's equal to 0 and we need to adjust the test condition.
Comment 25 Jonathan Druart 2020-02-13 14:44:17 UTC
Patches rebased against master.
Comment 26 Liz Rea 2020-02-14 18:41:02 UTC
Created attachment 99007 [details] [review]
Bug 24156: DB changes

Add a new table tables_settings to store default_display_length and
default_sort_order.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 27 Liz Rea 2020-02-14 18:41:34 UTC
Created attachment 99008 [details] [review]
Bug 24156: DBIC changes

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 28 Liz Rea 2020-02-14 18:41:37 UTC
Created attachment 99009 [details] [review]
Bug 24156: move ColumnsSettings to TablesSettings

We are preparing the ground with this patch. As the "Columns settings"
page will now add the ability to modify settings for the whole table, it
makes sense to rename the file and the variables.

Note that the controller script (admin/columns_settings.pl) and the yml
(admin/columns_settings.yml) files have not been moved to not break
shortcuts and abits people could have. But if QA decides, it could be
easy to do.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 29 Liz Rea 2020-02-14 18:41:40 UTC
Created attachment 99010 [details] [review]
Bug 24156: Add columns_settings.yml changes

Modification of the structure of the yml file.
It was
  table:
    - column list
It now becomes
    table:
      default_display_length: X
      default_sort_order: Y
      columns:
        - column list

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 30 Liz Rea 2020-02-14 18:41:42 UTC
Created attachment 99011 [details] [review]
Bug 24156: Add missing columns to yml

There were 2 columns missing

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 31 Liz Rea 2020-02-14 18:41:45 UTC
Created attachment 99012 [details] [review]
Bug 24156: Adjust other tables in the yml file

To match the new structure, we adjust the other tables.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 32 Liz Rea 2020-02-14 18:41:48 UTC
Created attachment 99013 [details] [review]
Bug 24156: Make sort order and number of items to display configurable (basket page)

This patch is the main patch of this patchset, you will find the
description and the test plan.

The idea of this new enhancement is to add the ability to define the
default sort order and the default number of rows displayed on the
acquisition basket page.
The existing "columns settings" feature was replaced by a
"tables settings" feature. To prepare the ground, there were some
works that were needed:
  * rename variables and files
  * Modify the structure of the yml files
  * Create a new DB table to store the tables settings

Test plan:
0)
  a. Execute the update DB entry to create the new table
  b. Restart all (to get a new version of the yml file, that is cached by
   memcached)
  c. Create several orders for a given basket
1) Go to the basket view page
=> The default values are the same than without this patchset, the
number of entries to display is set to "20" and the table is sorted by
basket number (first column)
2) Go to the "Columns settings" page
3) Unfold the "Acquisition" tab
=> Notice the 2 dropdown lists at the bottom of the basket table
4) Select different values for "Default display length" and "Default
sort order"
5) Refresh the basket view page
=> Notice that the default settings are now effective on the table

QA note: We can decide to replace the different occurrences of "Columns settings"
by "Tables settings" if needed.

Sponsored-by: Institute of Technology Tallaght

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 33 Liz Rea 2020-02-14 18:41:51 UTC
Created attachment 99014 [details] [review]
Bug 24156: Fix set sort order to the first column

In that case it's equal to 0 and we need to adjust the test condition.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 34 Alex Arnaud 2020-06-12 13:46:11 UTC
Jonathan, can you rebase please ?
Comment 35 Jonathan Druart 2020-06-12 14:52:58 UTC
Created attachment 105823 [details] [review]
Bug 24156: DB changes

Add a new table tables_settings to store default_display_length and
default_sort_order.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 36 Jonathan Druart 2020-06-12 14:53:02 UTC
Created attachment 105824 [details] [review]
Bug 24156: DBIC changes

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 37 Jonathan Druart 2020-06-12 14:53:06 UTC
Created attachment 105825 [details] [review]
Bug 24156: move ColumnsSettings to TablesSettings

We are preparing the ground with this patch. As the "Columns settings"
page will now add the ability to modify settings for the whole table, it
makes sense to rename the file and the variables.

Note that the controller script (admin/columns_settings.pl) and the yml
(admin/columns_settings.yml) files have not been moved to not break
shortcuts and abits people could have. But if QA decides, it could be
easy to do.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 38 Jonathan Druart 2020-06-12 14:53:11 UTC
Created attachment 105826 [details] [review]
Bug 24156: Add columns_settings.yml changes

Modification of the structure of the yml file.
It was
  table:
    - column list
It now becomes
    table:
      default_display_length: X
      default_sort_order: Y
      columns:
        - column list

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 39 Jonathan Druart 2020-06-12 14:53:16 UTC
Created attachment 105827 [details] [review]
Bug 24156: Adjust other tables in the yml file

To match the new structure, we adjust the other tables.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 40 Jonathan Druart 2020-06-12 14:53:19 UTC
Created attachment 105828 [details] [review]
Bug 24156: Make sort order and number of items to display configurable (basket page)

This patch is the main patch of this patchset, you will find the
description and the test plan.

The idea of this new enhancement is to add the ability to define the
default sort order and the default number of rows displayed on the
acquisition basket page.
The existing "columns settings" feature was replaced by a
"tables settings" feature. To prepare the ground, there were some
works that were needed:
  * rename variables and files
  * Modify the structure of the yml files
  * Create a new DB table to store the tables settings

Test plan:
0)
  a. Execute the update DB entry to create the new table
  b. Restart all (to get a new version of the yml file, that is cached by
   memcached)
  c. Create several orders for a given basket
1) Go to the basket view page
=> The default values are the same than without this patchset, the
number of entries to display is set to "20" and the table is sorted by
basket number (first column)
2) Go to the "Columns settings" page
3) Unfold the "Acquisition" tab
=> Notice the 2 dropdown lists at the bottom of the basket table
4) Select different values for "Default display length" and "Default
sort order"
5) Refresh the basket view page
=> Notice that the default settings are now effective on the table

QA note: We can decide to replace the different occurrences of "Columns settings"
by "Tables settings" if needed.

Sponsored-by: Institute of Technology Tallaght

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 41 Jonathan Druart 2020-06-12 14:53:23 UTC
Created attachment 105829 [details] [review]
Bug 24156: Fix set sort order to the first column

In that case it's equal to 0 and we need to adjust the test condition.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 42 Alex Arnaud 2020-06-19 09:05:17 UTC
Comment on attachment 105828 [details] [review]
Bug 24156: Make sort order and number of items to display configurable (basket page)

Review of attachment 105828 [details] [review]:
-----------------------------------------------------------------

::: C4/Utils/DataTables/TablesSettings.pm
@@ +59,4 @@
>      return $columns;
>  }
>  
> +sub get_table_settings {

No pod covering

::: koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt
@@ +4,3 @@
>  [% SET footerjs = 1 %]
>  [% SET panel_id = 0 %]
> +[% USE Dumper %]

Debug thing ?

@@ +100,5 @@
> +                                        <select name="[% table_id | html %]_default_display_length">
> +                                            [% IF table_settings.default_display_length == 10 %]
> +                                                <option value="10" selected="selected">10</option>
> +                                            [% ELSE %]
> +                                            [% END %]

This makes the "10" option never visible
Comment 43 Alex Arnaud 2020-06-19 09:06:00 UTC
t/db_dependent/Koha/Template/Plugin/ColumnsSettings.t fail
Comment 44 Alex Arnaud 2020-06-19 09:10:12 UTC
(In reply to Jonathan Druart from comment #6)
> QA note: We can decide to replace the different occurrences of "Columns
> settings"
> by "Tables settings" if needed.

Since default display length is not column related, i agree. At least the visible string (Admin columns settings title). Not a blocker
Comment 45 Jonathan Druart 2020-06-23 09:33:06 UTC
Created attachment 106183 [details] [review]
Bug 24156: DB changes

Add a new table tables_settings to store default_display_length and
default_sort_order.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 46 Jonathan Druart 2020-06-23 09:33:10 UTC
Created attachment 106184 [details] [review]
Bug 24156: DBIC changes

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 47 Jonathan Druart 2020-06-23 09:33:14 UTC
Created attachment 106185 [details] [review]
Bug 24156: move ColumnsSettings to TablesSettings

We are preparing the ground with this patch. As the "Columns settings"
page will now add the ability to modify settings for the whole table, it
makes sense to rename the file and the variables.

Note that the controller script (admin/columns_settings.pl) and the yml
(admin/columns_settings.yml) files have not been moved to not break
shortcuts and abits people could have. But if QA decides, it could be
easy to do.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 48 Jonathan Druart 2020-06-23 09:33:18 UTC
Created attachment 106186 [details] [review]
Bug 24156: Add columns_settings.yml changes

Modification of the structure of the yml file.
It was
  table:
    - column list
It now becomes
    table:
      default_display_length: X
      default_sort_order: Y
      columns:
        - column list

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 49 Jonathan Druart 2020-06-23 09:33:22 UTC
Created attachment 106187 [details] [review]
Bug 24156: Adjust other tables in the yml file

To match the new structure, we adjust the other tables.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 50 Jonathan Druart 2020-06-23 09:33:26 UTC
Created attachment 106188 [details] [review]
Bug 24156: Make sort order and number of items to display configurable (basket page)

This patch is the main patch of this patchset, you will find the
description and the test plan.

The idea of this new enhancement is to add the ability to define the
default sort order and the default number of rows displayed on the
acquisition basket page.
The existing "columns settings" feature was replaced by a
"tables settings" feature. To prepare the ground, there were some
works that were needed:
  * rename variables and files
  * Modify the structure of the yml files
  * Create a new DB table to store the tables settings

Test plan:
0)
  a. Execute the update DB entry to create the new table
  b. Restart all (to get a new version of the yml file, that is cached by
   memcached)
  c. Create several orders for a given basket
1) Go to the basket view page
=> The default values are the same than without this patchset, the
number of entries to display is set to "20" and the table is sorted by
basket number (first column)
2) Go to the "Columns settings" page
3) Unfold the "Acquisition" tab
=> Notice the 2 dropdown lists at the bottom of the basket table
4) Select different values for "Default display length" and "Default
sort order"
5) Refresh the basket view page
=> Notice that the default settings are now effective on the table

QA note: We can decide to replace the different occurrences of "Columns settings"
by "Tables settings" if needed.

Sponsored-by: Institute of Technology Tallaght

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 51 Jonathan Druart 2020-06-23 09:33:30 UTC
Created attachment 106189 [details] [review]
Bug 24156: Fix set sort order to the first column

In that case it's equal to 0 and we need to adjust the test condition.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 52 Jonathan Druart 2020-06-23 09:33:34 UTC
Created attachment 106190 [details] [review]
Bug 24156: Fix soem QA failures

* Add POD to get_table_settings
* Remove USE Dumper debug statement
* Add missing "10" entry
* Fix newly created test file (and renamed)
Comment 53 Jonathan Druart 2020-06-23 09:33:38 UTC
Created attachment 106191 [details] [review]
Bug 24156: Rename 'Columns settings' with 'Tables settings' on the UI
Comment 54 Jonathan Druart 2020-06-23 09:33:55 UTC
All fixed, Alex. Thanks!
Comment 55 Jonathan Druart 2020-06-24 07:49:23 UTC
Created attachment 106219 [details] [review]
Bug 24156: Rename 'Columns settings' with 'Tables settings' on the UI
Comment 56 Alex Arnaud 2020-06-24 07:58:26 UTC
Created attachment 106220 [details] [review]
Bug 24156: DB changes

Add a new table tables_settings to store default_display_length and
default_sort_order.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Comment 57 Alex Arnaud 2020-06-24 07:58:31 UTC
Created attachment 106221 [details] [review]
Bug 24156: DBIC changes

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Comment 58 Alex Arnaud 2020-06-24 07:58:36 UTC
Created attachment 106222 [details] [review]
Bug 24156: move ColumnsSettings to TablesSettings

We are preparing the ground with this patch. As the "Columns settings"
page will now add the ability to modify settings for the whole table, it
makes sense to rename the file and the variables.

Note that the controller script (admin/columns_settings.pl) and the yml
(admin/columns_settings.yml) files have not been moved to not break
shortcuts and abits people could have. But if QA decides, it could be
easy to do.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Comment 59 Alex Arnaud 2020-06-24 07:58:41 UTC
Created attachment 106223 [details] [review]
Bug 24156: Add columns_settings.yml changes

Modification of the structure of the yml file.
It was
  table:
    - column list
It now becomes
    table:
      default_display_length: X
      default_sort_order: Y
      columns:
        - column list

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Comment 60 Alex Arnaud 2020-06-24 07:58:46 UTC
Created attachment 106224 [details] [review]
Bug 24156: Adjust other tables in the yml file

To match the new structure, we adjust the other tables.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Comment 61 Alex Arnaud 2020-06-24 07:58:51 UTC
Created attachment 106225 [details] [review]
Bug 24156: Make sort order and number of items to display configurable (basket page)

This patch is the main patch of this patchset, you will find the
description and the test plan.

The idea of this new enhancement is to add the ability to define the
default sort order and the default number of rows displayed on the
acquisition basket page.
The existing "columns settings" feature was replaced by a
"tables settings" feature. To prepare the ground, there were some
works that were needed:
  * rename variables and files
  * Modify the structure of the yml files
  * Create a new DB table to store the tables settings

Test plan:
0)
  a. Execute the update DB entry to create the new table
  b. Restart all (to get a new version of the yml file, that is cached by
   memcached)
  c. Create several orders for a given basket
1) Go to the basket view page
=> The default values are the same than without this patchset, the
number of entries to display is set to "20" and the table is sorted by
basket number (first column)
2) Go to the "Columns settings" page
3) Unfold the "Acquisition" tab
=> Notice the 2 dropdown lists at the bottom of the basket table
4) Select different values for "Default display length" and "Default
sort order"
5) Refresh the basket view page
=> Notice that the default settings are now effective on the table

QA note: We can decide to replace the different occurrences of "Columns settings"
by "Tables settings" if needed.

Sponsored-by: Institute of Technology Tallaght

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Comment 62 Alex Arnaud 2020-06-24 07:58:56 UTC
Created attachment 106226 [details] [review]
Bug 24156: Fix set sort order to the first column

In that case it's equal to 0 and we need to adjust the test condition.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Comment 63 Alex Arnaud 2020-06-24 07:59:01 UTC
Created attachment 106227 [details] [review]
Bug 24156: Fix soem QA failures

* Add POD to get_table_settings
* Remove USE Dumper debug statement
* Add missing "10" entry
* Fix newly created test file (and renamed)

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Comment 64 Alex Arnaud 2020-06-24 07:59:05 UTC
Created attachment 106228 [details] [review]
Bug 24156: Rename 'Columns settings' with 'Tables settings' on the UI

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Comment 65 Jonathan Druart 2020-06-24 12:22:38 UTC
Created attachment 106245 [details] [review]
Bug 24156: (follow-up) UI - Use "Table settings"

After a discussion with Owen we ended up with this decision.
Comment 66 Jonathan Druart 2020-06-25 09:12:24 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 67 Lucas Gass 2020-07-13 15:49:39 UTC
not backporting this enhancement to the 20.05.x series