Bugzilla – Attachment 147801 Details for
Bug 8367
How long is a hold waiting for pickup at a more granular level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8367: (follow-up) Fix pickup delay text on OPAC and other bits
Bug-8367-follow-up-Fix-pickup-delay-text-on-OPAC-a.patch (text/plain), 5.66 KB, created by
Nick Clemens (kidclamp)
on 2023-03-06 20:06:32 UTC
(
hide
)
Description:
Bug 8367: (follow-up) Fix pickup delay text on OPAC and other bits
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-03-06 20:06:32 UTC
Size:
5.66 KB
patch
obsolete
>From e7acbfdab6c65f5bb37da72685ea7ef24dcfdebb Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Thu, 3 Mar 2022 10:03:28 +1300 >Subject: [PATCH] Bug 8367: (follow-up) Fix pickup delay text on OPAC and other > bits > >Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/Hold.pm | 4 ++-- > admin/smart-rules.pl | 2 +- > .../bootstrap/en/modules/opac-reserve.tt | 24 +++++++++++-------- > opac/opac-reserve.pl | 8 +++++-- > 4 files changed, 23 insertions(+), 15 deletions(-) > >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index 85ee28d92a..03dc03a993 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -231,8 +231,6 @@ sub set_waiting { > my $max_pickup_delay = C4::Context->preference("ReservesMaxPickUpDelay"); > my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); > >- my $new_expiration_date = $today->clone->add(days => $max_pickup_delay); >- > my $rule = Koha::CirculationRules->get_effective_rule({ > categorycode => $self->borrower->categorycode, > itemtype => $self->item->effective_itemtype, >@@ -244,6 +242,8 @@ sub set_waiting { > $max_pickup_delay = $rule->rule_value; > } > >+ my $new_expiration_date = $today->clone->add(days => $max_pickup_delay); >+ > if ( C4::Context->preference("ExcludeHolidaysFromMaxPickUpDelay") ) { > my $itemtype = $self->item ? $self->item->effective_itemtype : $self->biblio->itemtype; > my $daysmode = Koha::CirculationRules->get_effective_daysmode( >diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl >index 8526db1c2b..0763d96957 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -294,7 +294,7 @@ elsif ($op eq 'add') { > my $recall_due_date_interval = $input->param('recall_due_date_interval'); > my $recall_overdue_fine = $input->param('recall_overdue_fine'); > my $recall_shelf_time = $input->param('recall_shelf_time'); >- my $holds_pickup_period = strip_non_numeric($input->param('holds_pickup_period')); >+ my $holds_pickup_period = strip_non_numeric( scalar $input->param('holds_pickup_period') ); > > my $rules = { > maxissueqty => $maxissueqty, >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >index 833b49b681..e5454c0abd 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >@@ -284,7 +284,7 @@ > </ul> > > [% IF pickup_delays %] >- <p id="pickup_delay" style="display:none;">When your item is ready for pickup, you will have <span id="pickup_delay_days"></span> days to pick it up from this library.</p> >+ <p class="pickup_delay" style="display:none;">When your item is ready for pickup, you will have <span id="pickup_delay_days_[% bibitemloo.biblionumber | html %]"></span> days to pick it up from this library.</p> > [% END %] > > <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber | html %]" style="display:none;" href="#">Show more options</a> >@@ -509,13 +509,17 @@ > var MSG_EMPTY_END_DATE = _("Hold expiration date should be filled."); > > function calculate_delay_days(){ >- var selected_branch = $("#branch_1").val(); >- [% FOREACH branchcode IN pickup_delays.keys %] >- var branchcode = "[% branchcode | html %]"; >- if ( branchcode == selected_branch ) { >- $("#pickup_delay_days").text([% pickup_delays.$branchcode | html %]); >- } >- [% END %] >+ $(".branch > select").each(function(){ >+ var selected_branch = $(this).val(); >+ var branch_biblionumber = $(this).attr('id'); >+ var biblionumber = branch_biblionumber.slice( branch_biblionumber.indexOf('_')+1 ); >+ [% FOREACH branchcode IN pickup_delays.keys %] >+ var branchcode = "[% branchcode | html %]"; >+ if ( branchcode == selected_branch ) { >+ $("#pickup_delay_days_" + biblionumber).text([% pickup_delays.$branchcode | html %]); >+ } >+ [% END %] >+ }); > } > > $(document).ready(function() { >@@ -526,8 +530,8 @@ > }); > > calculate_delay_days(); >- $("#pickup_delay").show(); >- $("#branch_1").change(function(){ >+ $(".pickup_delay").show(); >+ $(".branch > select").change(function(){ > calculate_delay_days(); > }); > >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index 93080f8cfd..d5146b0325 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -614,7 +614,7 @@ if ( > ); > } > >-my @branches = Koha::Libraries->search(); >+my @branches = Koha::Libraries->search->as_list; > my %hold_pickup_delay_by_branch = (); > > foreach my $branch ( @branches ) { >@@ -624,7 +624,11 @@ foreach my $branch ( @branches ) { > itemtype => undef, > rule_name => 'holds_pickup_period', > }); >- $hold_pickup_delay_by_branch{$branch->branchcode} = $rule->rule_value if ( $rule and $rule->rule_value ); >+ if ( $rule and $rule->rule_value ) { >+ $hold_pickup_delay_by_branch{$branch->branchcode} = $rule->rule_value; >+ } else { >+ $hold_pickup_delay_by_branch{$branch->branchcode} = C4::Context->preference('ReservesMaxPickUpDelay'); >+ } > } > > $template->param( pickup_delays => \%hold_pickup_delay_by_branch ); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8367
:
12130
|
13139
|
13602
|
13603
|
13604
|
13624
|
15334
|
15335
|
15369
|
15498
|
15613
|
15658
|
15659
|
19093
|
19094
|
19095
|
19096
|
19104
|
19105
|
19107
|
19108
|
19116
|
19180
|
19181
|
19182
|
19360
|
19361
|
19362
|
20300
|
20301
|
20302
|
20303
|
20304
|
32786
|
32826
|
32884
|
32885
|
32916
|
32930
|
42706
|
42754
|
79790
|
79791
|
79798
|
79799
|
79800
|
79853
|
79854
|
79855
|
79859
|
92412
|
92413
|
92414
|
92415
|
92416
|
92417
|
92418
|
92419
|
92420
|
92421
|
92422
|
92423
|
92424
|
92425
|
92426
|
92427
|
92428
|
92958
|
92959
|
92960
|
92961
|
103425
|
113211
|
117284
|
118017
|
118021
|
124568
|
125087
|
131299
|
131300
|
131301
|
131302
|
131646
|
131647
|
131718
|
131719
|
131720
|
131722
|
131723
|
131724
|
133089
|
133090
|
133091
|
133092
|
133093
|
133094
|
142897
|
142898
|
142899
|
142900
|
142901
|
142902
|
142903
|
144097
|
144098
|
144099
|
144100
|
144101
|
144102
|
144103
|
144146
|
145644
|
145657
|
147798
|
147799
|
147800
|
147801
|
147802
|
147803
|
147804
|
147805
|
147806
|
147807
|
148536
|
148537
|
148538
|
148539
|
148540
|
148541
|
148542
|
148543
|
148544
|
148545
|
150437
|
150438
|
150439
|
153235
|
153237
|
153238
|
153239
|
153240
|
153241
|
153242
|
153243
|
153244
|
153245
|
153246
|
157138
|
157139
|
157140
|
157141
|
157142
|
157143
|
157144
|
157145
|
157146
|
157147
|
157148
|
157149
|
157150
|
157298
|
157343
|
157344
|
157345
|
157346
|
157347
|
157348
|
157349
|
157350
|
157351
|
157352
|
157354
|
157355
|
157356
|
157697
|
157698
|
157699
|
157700
|
157701
|
157702
|
157703
|
157704
|
157705
|
157706
|
157707
|
157708
|
157709
|
157715
|
158023
|
158024
|
158025
|
158026
|
158027
|
158028
|
158029
|
158030
|
158031
|
158032
|
158033
|
158034
|
158035
|
158254
|
158255