Bug 41360 - Transport cost matrix assumes all transfers are disabled upon first use
Summary: Transport cost matrix assumes all transfers are disabled upon first use
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Kyle M Hall (khall)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-02 20:11 UTC by Nick Clemens (kidclamp)
Modified: 2025-12-05 23:05 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This adds three new toolbar buttons to make batch modifications to the transport cost matrix table easier (when UseTransportCostMatrix is enabeld): * Enable all cells * Disable empty cells * Populate empty cells, with selectable values from 0 to 100
Version(s) released in:
Circulation function:


Attachments
Bug 41360: Add toolbar of buttons for batch modifications to transport cost matrix (5.66 KB, patch)
2025-12-03 15:55 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Post-patch editor (223.56 KB, image/png)
2025-12-05 12:16 UTC, Kyle M Hall (khall)
Details
Pre-patch editor (224.90 KB, image/png)
2025-12-05 12:17 UTC, Kyle M Hall (khall)
Details
Bug 41360: Add toolbar of buttons for batch modifications to transport cost matrix (5.69 KB, patch)
2025-12-05 22:58 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2025-12-02 20:11:17 UTC
On a system not using transport cost matrix enable the preference 
UseTransportCostMatrix

(if your test system has a matrix setup, back it up then DELETE FROM transport_cost;)

 and then go to Administration->Transport Cost Matrix

(almost) All squares are red
Click on one, enable and enter a cost
Save

In the DB:
SELECT * FROM transport_cost;

Note that all transfers are now forbidden.

It should be possible to set the matrix without defaulting to no transfers allowed
Comment 1 Kyle M Hall (khall) 2025-12-03 15:55:31 UTC
Created attachment 190121 [details] [review]
Bug 41360: Add toolbar of buttons for batch modifications to transport cost matrix

We can add a toolbar of buttons to
A) batch enable all cells
B) batch populate empty cells with a value
C) batch disable empty cells

Test plan:
1) Apply this patch
2) Visit the TCM editor
3) Try out the 3 new buttons, verify they behave correctly
Comment 2 David Nind 2025-12-03 23:05:53 UTC
I've not used the transport cost matrix before, so am reluctant to sign off - it appears to work as expected: the new actions work, I can add values, and can also edit individually.

One thing I noted is that there is the text above the table saying "Red cells signify no transfer allowed.", which is still correct. 

However, the transfer for the same library (for example, Centerville to Centerville) is either white or grey, where previously it was red.
Comment 3 David Nind 2025-12-03 23:09:39 UTC
Testing notes (using KTD):

1. Enable the UseTransportCostMatrix system preference.

2. Go to Administration > Patrons and circulation > Transport cost matrix.
Comment 4 Kyle M Hall (khall) 2025-12-05 12:16:55 UTC
Created attachment 190204 [details]
Post-patch editor
Comment 5 Kyle M Hall (khall) 2025-12-05 12:17:30 UTC
Created attachment 190205 [details]
Pre-patch editor
Comment 6 Kyle M Hall (khall) 2025-12-05 12:18:12 UTC
(In reply to David Nind from comment #2)
> I've not used the transport cost matrix before, so am reluctant to sign off
> - it appears to work as expected: the new actions work, I can add values,
> and can also edit individually.
> 
> One thing I noted is that there is the text above the table saying "Red
> cells signify no transfer allowed.", which is still correct. 
> 
> However, the transfer for the same library (for example, Centerville to
> Centerville) is either white or grey, where previously it was red.

I'm not sure I'm seeing what you are seeing. Can you have a look at the two screenshots I've added and let me know if I'm looking in the wrong place?

Thanks!
Comment 7 David Nind 2025-12-05 22:58:07 UTC
Created attachment 190259 [details] [review]
Bug 41360: Add toolbar of buttons for batch modifications to transport cost matrix

We can add a toolbar of buttons to
A) batch enable all cells
B) batch populate empty cells with a value
C) batch disable empty cells

Test plan:
1) Apply this patch
2) Visit the TCM editor
3) Try out the 3 new buttons, verify they behave correctly

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2025-12-05 22:59:30 UTC
(In reply to Kyle M Hall (khall) from comment #6)
> (In reply to David Nind from comment #2)
> > I've not used the transport cost matrix before, so am reluctant to sign off
> > - it appears to work as expected: the new actions work, I can add values,
> > and can also edit individually.
> > 
> > One thing I noted is that there is the text above the table saying "Red
> > cells signify no transfer allowed.", which is still correct. 
> > 
> > However, the transfer for the same library (for example, Centerville to
> > Centerville) is either white or grey, where previously it was red.
> 
> I'm not sure I'm seeing what you are seeing. Can you have a look at the two
> screenshots I've added and let me know if I'm looking in the wrong place?
> 
> Thanks!

I'm not sure now what I was thinking/seeing - I don't see it now, so must have been imaging it! Apologies for creating extra work 8-(...