Bug 37972 - Allow selection of tab in patron's summary table by query param
Summary: Allow selection of tab in patron's summary table by query param
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Paul Derscheid
QA Contact: Lucas Gass (lukeg)
URL:
Keywords:
Depends on:
Blocks: 33738
  Show dependency treegraph
 
Reported: 2024-09-20 13:35 UTC by Paul Derscheid
Modified: 2024-11-18 18:26 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement adds the ability to direct links to specific tabs of the OPAC patron summary with the following syntax: /cgi-bin/koha/opac-user.pl?tab=opac-user-holds
Version(s) released in:
24.11.00
Circulation function:


Attachments
Bug 37972: Allow selection of tab in patron's summary table by query param (2.18 KB, patch)
2024-09-20 13:48 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 37972: (follow-up) Correct syntax error in opac/opac-user.pl (1.01 KB, patch)
2024-09-23 10:20 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 37972: Allow selection of tab in patron's summary table by query param (2.23 KB, patch)
2024-09-23 18:53 UTC, David Nind
Details | Diff | Splinter Review
Bug 37972: (follow-up) Correct syntax error in opac/opac-user.pl (1.06 KB, patch)
2024-09-23 18:53 UTC, David Nind
Details | Diff | Splinter Review
Bug 37972: Allow selection of tab in patron's summary table by query param (2.29 KB, patch)
2024-09-23 22:11 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37972: (follow-up) Correct syntax error in opac/opac-user.pl (1.11 KB, patch)
2024-09-23 22:11 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37972: (QA follow-up) add missing filter (985 bytes, patch)
2024-09-23 22:11 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 Comment hidden (obsolete)
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 Comment hidden (obsolete)
Comment 5 David Nind 2024-09-23 18:53:37 UTC Comment hidden (obsolete)
Comment 6 David Nind 2024-09-23 18:53:40 UTC Comment hidden (obsolete)
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.