From b7f3084b2cd63da890e825752a50f8c214b653d1 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Mon, 23 Oct 2023 10:00:01 -1000 Subject: [PATCH] Bug 35139: Filter holds to pull on current library and add 'View all libraries' link When branches are really separated, in 'Holds to pull' it would be great to filter by default on current library, like in 'Holds awaiting pickup' page. Also for big libraries with many branches, page can be very long to load if they want to see a big time period. I propose to change 'Holds to pull' : filter on current library and add 'View all libraries' link. I bet it makes sens to have the same display between 'Holds to pull' and 'Holds awaiting pickup'. If needed I'll add a system preference to manage the default behavior. Test plan : 1) 1.0) Set system preference 'IndependentBranches' = 'No' 1.1) Create some holds in different libraries 1.2) Go to 'Circulation' > 'Holds to pull' 1.3) Check you see holds of current library 1.4) Change start and end dates and submit 1.5) Click on 'View all libraries' 1.6) You see all holds + start and end dates are unchanged 1.7) Change start and end dates and submit 1.8) You still see all holds + no link 'View all libraries' 2) 2.0) Set system preference 'IndependentBranches' = 'Yes' 2.1) Go to 'Circulation' > 'Holds to pull' 2.2) Check you see holds of current library + no link 'View all libraries' --- circ/pendingreserves.pl | 13 ++++++++++++- .../prog/en/modules/circ/pendingreserves.tt | 8 ++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 21016bc354..b3ec83de70 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -42,6 +42,7 @@ my $theme = $input->param('theme'); # only used if allowthemeoverride is set my $op = $input->param('op') || ''; my $borrowernumber = $input->param('borrowernumber'); my $reserve_id = $input->param('reserve_id'); +my $all_branches = $input->param('allbranches') || ''; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { @@ -181,7 +182,17 @@ if ( !C4::Context->preference('AllowHoldsOnDamagedItems') ){ $where{'itembib.damaged'} = 0; } -if ( C4::Context->only_my_library() ){ +if ( C4::Context->preference('IndependentBranches') ) { + undef $all_branches; +} else { + my $all_branches_link = '/cgi-bin/koha/circ/pendingreserves.pl?allbranches=1'; + $all_branches_link .= '&from=' . $startdate if $startdate; + $all_branches_link .= '&to=' . $enddate if $enddate; + $template->param( all_branches_link => $all_branches_link ) unless $all_branches; +} +if ($all_branches) { + $template->param( allbranches => 1 ); +} else { $where{'me.branchcode'} = C4::Context->userenv->{'branch'}; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt index 8c47fe74f2..8d723d0d55 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt @@ -58,6 +58,11 @@ [% END %]

Holds to pull placed between [% from | $KohaDates %] and [% to | $KohaDates %]

+

+ [% IF all_branches_link %] + View all libraries + [% END %] +

Reported on [% todaysdate | $KohaDates %]

The following holds have not been filled. Please retrieve them and check them in.

@@ -207,6 +212,7 @@
+ [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %] [% IF hold_cancellation.count %] @@ -232,6 +238,7 @@ [% IF hold.itemnumber %] + [% IF Koha.Preference('CanMarkHoldsToPullAsLost') == 'allow' %] @@ -285,6 +292,7 @@
+

Refine results

    -- 2.42.0