Bug 35496: Open article requests tab by default on opac-user.pl after placing an article request

To test:
1 - Turn on ArticleRequests
2 - Place an  Article Requests on the opac
3 - Note after placing the request the URL is:
    http://localhost:8080/cgi-bin/koha/opac-user.pl#opac-user-article-requests
4 - Note the article request tab is not active
5 - APPLY PATCH and restart_all
6. Try steps 2 - 4 again, this time the article request tab should be open by default.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 33ba9c2701)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Lucas Gass 2023-12-05 18:04:47 +00:00 committed by Fridolin Somers
parent d4c0bd27f7
commit 7ad7038936
3 changed files with 5 additions and 1 deletions

View file

@ -1087,6 +1087,9 @@
[% IF ( opac_user_holds ) %]
$("#opac-user-views a[href='#opac-user-holds_panel']").tab("show");
[% END %]
[% IF ( opac_user_article_requests ) %]
$("#opac-user-views a[href='#opac-user-article-requests_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

@ -102,7 +102,7 @@ if ( $action eq 'create' ) {
};
if ( $success ) {
print $cgi->redirect("/cgi-bin/koha/opac-user.pl#opac-user-article-requests");
print $cgi->redirect("/cgi-bin/koha/opac-user.pl?opac-user-article-requests=1");
exit;
}
# Should we redirect?

View file

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