Bug 37972

Summary: Allow selection of tab in patron's summary table by query param
Product: Koha Reporter: Paul Derscheid <paul.derscheid>
Component: OPACAssignee: Paul Derscheid <paul.derscheid>
Status: Pushed to main --- QA Contact: Lucas Gass (lukeg) <lucas>
Severity: enhancement    
Priority: P5 - low CC: david, lucas, oleonard
Version: MainKeywords: release-notes-needed
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:
Bug Depends on:    
Bug Blocks: 33738    
Attachments: Bug 37972: Allow selection of tab in patron's summary table by query param
Bug 37972: (follow-up) Correct syntax error in opac/opac-user.pl
Bug 37972: Allow selection of tab in patron's summary table by query param
Bug 37972: (follow-up) Correct syntax error in opac/opac-user.pl
Bug 37972: Allow selection of tab in patron's summary table by query param
Bug 37972: (follow-up) Correct syntax error in opac/opac-user.pl
Bug 37972: (QA follow-up) add missing filter

Description Paul Derscheid 2024-09-20 13:35:58 UTC
I think it would be very useful to be able to immediately pick a tab from the user summary table via a query param, especially for actions within the different tabs because we can then reroute to the specific tab in the controller.
Comment 1 Paul Derscheid 2024-09-20 13:48:32 UTC
Created attachment 171831 [details] [review]
Bug 37972: Allow selection of tab in patron's summary table by query param

To test:
1) Apply the patch
2) Place a hold on any biblio with the 'koha' patron for example
3) Authenticate in the OPAC with the patron you picked in step 1
4) Open opac-user.pl with the query param 'tab': /cgi-bin/koha/opac-user.pl?tab=opac-user-holds
5) Note that the holds tab in the patron's user summary is automatically selected
6) Sign-off

I'm totally open to renaming the query param, so if you have a suggestion that's more consistent
with the rest of koha, I'm all ears.
Comment 2 David Nind 2024-09-22 10:33:49 UTC
Get this error when attempting to access patron's account (maybe a common is required for the code change: tab    = > $query->param('tab'); ):

Could not compile /kohadevbox/koha/opac/opac-user.pl: syntax error at /kohadevbox/koha/opac/opac-user.pl line 409, near ");"
syntax error at /kohadevbox/koha/opac/opac-user.pl line 416, near ")"
BEGIN not safe after errors--compilation aborted at /kohadevbox/koha/opac/opac-user.pl line 453.
 at /usr/share/perl5/CGI/Compile.pm line 144
in CGI::Compile::compile at /usr/share/perl5/CGI/Compile.pm line 144
  141:         my $code = $self->_eval($eval);
  142:         my $exception = $@;
  143: 
  144:         die "Could not compile $script: $exception" if $exception;
  145:
Comment 3 Paul Derscheid 2024-09-23 09:29:04 UTC
Ah, thanks David. It's the old ';' instead of ','.
Comment 4 Paul Derscheid 2024-09-23 10:20:26 UTC
Created attachment 171874 [details] [review]
Bug 37972: (follow-up) Correct syntax error in opac/opac-user.pl
Comment 5 David Nind 2024-09-23 18:53:37 UTC
Created attachment 171885 [details] [review]
Bug 37972: Allow selection of tab in patron's summary table by query param

To test:
1) Apply the patch
2) Place a hold on any biblio with the 'koha' patron for example
3) Authenticate in the OPAC with the patron you picked in step 1
4) Open opac-user.pl with the query param 'tab': /cgi-bin/koha/opac-user.pl?tab=opac-user-holds
5) Note that the holds tab in the patron's user summary is automatically selected
6) Sign-off

I'm totally open to renaming the query param, so if you have a suggestion that's more consistent
with the rest of koha, I'm all ears.

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2024-09-23 18:53:40 UTC
Created attachment 171886 [details] [review]
Bug 37972: (follow-up) Correct syntax error in opac/opac-user.pl

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2024-09-23 18:56:09 UTC
Thanks for fixing!

I think I would prefer opac-patron-xxx, however opac-user-xxx exists already so we probably shouldn't change it.
Comment 8 Lucas Gass (lukeg) 2024-09-23 22:11:49 UTC
Created attachment 171900 [details] [review]
Bug 37972: Allow selection of tab in patron's summary table by query param

To test:
1) Apply the patch
2) Place a hold on any biblio with the 'koha' patron for example
3) Authenticate in the OPAC with the patron you picked in step 1
4) Open opac-user.pl with the query param 'tab': /cgi-bin/koha/opac-user.pl?tab=opac-user-holds
5) Note that the holds tab in the patron's user summary is automatically selected
6) Sign-off

I'm totally open to renaming the query param, so if you have a suggestion that's more consistent
with the rest of koha, I'm all ears.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 9 Lucas Gass (lukeg) 2024-09-23 22:11:52 UTC
Created attachment 171901 [details] [review]
Bug 37972: (follow-up) Correct syntax error in opac/opac-user.pl

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 10 Lucas Gass (lukeg) 2024-09-23 22:11:55 UTC
Created attachment 171902 [details] [review]
Bug 37972: (QA follow-up) add missing filter

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 11 Katrin Fischer 2024-10-21 10:27:24 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 12 Katrin Fischer 2024-10-21 11:12:57 UTC
Not going to block this, but I feel we have solved this in other spots already. Adding Owen for some additional insight.