From 7ad7038936af4adf3cd57f1f2339f5a6adf850ce Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 5 Dec 2023 18:04:47 +0000 Subject: [PATCH] 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 Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Katrin Fischer (cherry picked from commit 33ba9c270173703181e4c7f6e03656eea29c0b27) Signed-off-by: Fridolin Somers --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 3 +++ opac/opac-request-article.pl | 2 +- opac/opac-user.pl | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 76f69b76c2..996e466fc7 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -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"); diff --git a/opac/opac-request-article.pl b/opac/opac-request-article.pl index dcf9f214a5..88e2a228ab 100755 --- a/opac/opac-request-article.pl +++ b/opac/opac-request-article.pl @@ -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? diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 72637f03ce..563fe2f1d2 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -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