Bug 35488: Open holds tab by default on opac-user.pl after placing a hold

1 - Place a hold on the opac
2 - Note after placing the hold the URL is:
    http://localhost:8080/cgi-bin/koha/opac-user.pl?#opac-user-holds
3 - Note the holds tab is not active
4 - APPLY PATCH and restart_all
5 - Try steps 1 - 3 again, this time the holds tab should be opened.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Lucas Gass 2023-12-05 16:40:15 +00:00 committed by Katrin Fischer
parent a2005cd32c
commit d8bd46d0d7
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
3 changed files with 5 additions and 1 deletions

View File

@ -1084,6 +1084,9 @@
}
}
$(document).ready(function(){
[% IF ( opac_user_holds ) %]
$("#opac-user-views a[href='#opac-user-holds_panel']").tab("show");
[% END %]
$('#opac-user-article-requests caption .count').html(AR_CAPTION_COUNT.format('[% current_article_requests.size | html %]'));
$(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");

View File

@ -330,7 +330,7 @@ if ( $query->param('place_reserve') ) {
}
}
print $query->redirect("/cgi-bin/koha/opac-user.pl?" . ( @failed_holds ? "failed_holds=" . join('|',@failed_holds) : q|| ) . "#opac-user-holds");
print $query->redirect("/cgi-bin/koha/opac-user.pl?" . ( @failed_holds ? "failed_holds=" . join('|',@failed_holds) : q|| ) . "&opac-user-holds=1");
exit;
}

View File

@ -418,6 +418,7 @@ $template->param(
AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
OpacHoldNotes => C4::Context->preference('OpacHoldNotes'),
failed_holds => scalar $query->param('failed_holds'),
opac_user_holds => scalar $query->param('opac-user-holds') || 0,
);
# if not an empty string this indicates to return