Bugzilla – Attachment 143018 Details for
Bug 31907
Show items as On hold when in processing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31907: Show items as On hold when in processing
Bug-31907-Show-items-as-On-hold-when-in-processing.patch (text/plain), 4.62 KB, created by
Martin Renvoize (ashimema)
on 2022-11-02 17:06:19 UTC
(
hide
)
Description:
Bug 31907: Show items as On hold when in processing
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-11-02 17:06:19 UTC
Size:
4.62 KB
patch
obsolete
>From ee65e322387d5a6e6bbf0eaa9f0ed25a4b947a37 Mon Sep 17 00:00:00 2001 >From: Stefan Berndtsson <stefan.berndtsson@gmail.com> >Date: Fri, 21 Oct 2022 14:10:42 +0200 >Subject: [PATCH] Bug 31907: Show items as On hold when in processing > >Test plan: >1. Make sure syspref "opacbookbag" is set to "Allow". >2. Make sure syspref "HoldsNeedProcessingSIP" is set to "Don't fulfill". >3. Place a hold on an item. >4. Return item via SIP at the pickup library. >5. View biblio in Opac. >6. Note that it says "Available" as status. >7. Add biblio to Cart. >8. Open Cart. >9. Note that it says "Available" as status. >10. Apply patch. >11. Reload Opac page. >12. It should now say "On hold". >13. Reload Card page. >14. It should also say "On hold". > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Holds.pm | 7 +++ > .../bootstrap/en/includes/item-status.inc | 2 +- > opac/opac-basket.pl | 1 + > t/db_dependent/Koha/Holds.t | 52 ++++++++++++++++++- > 4 files changed, 60 insertions(+), 2 deletions(-) > >diff --git a/Koha/Holds.pm b/Koha/Holds.pm >index c5bfc55df3..1f7443d23f 100644 >--- a/Koha/Holds.pm >+++ b/Koha/Holds.pm >@@ -48,6 +48,13 @@ sub waiting { > return $self->search( { found => 'W' } ); > } > >+ >+sub processing { >+ my ( $self ) = @_; >+ >+ return $self->search( { found => 'P' } ); >+} >+ > =head3 unfilled > > returns a set of holds that are unfilled from an existing set >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >index 0a5077bb58..ca13bac71c 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >@@ -61,7 +61,7 @@ > to [% Branches.GetName( transfertto ) | html %] since [% transfertwhen | $KohaDates %]</span> > [% END %] > >-[% IF (item.isa('Koha::Item') AND item.holds.waiting.count) OR (NOT item.isa('Koha::Item') AND item.waiting) %] >+[% IF (item.isa('Koha::Item') AND item.holds.waiting.count) OR (item.isa('Koha::Item') AND item.holds.processing.count) OR (NOT item.isa('Koha::Item') AND item.waiting) OR (NOT item.isa('Koha::Item') AND item.processing) %] > [% SET itemavailable = 0 %] > <span class="item-status onhold">On hold</span> > [% END %] >diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl >index eb4ac974d2..411ae6444c 100755 >--- a/opac/opac-basket.pl >+++ b/opac/opac-basket.pl >@@ -98,6 +98,7 @@ foreach my $biblionumber ( @bibs ) { > foreach my $item (@$items) { > my $reserve_status = C4::Reserves::GetReserveStatus($item->{itemnumber}); > if( $reserve_status eq "Waiting"){ $item->{'waiting'} = 1; } >+ if( $reserve_status eq "Processing"){ $item->{'processing'} = 1; } > } > > my $hasauthors = 0; >diff --git a/t/db_dependent/Koha/Holds.t b/t/db_dependent/Koha/Holds.t >index aec261dd1f..a6b3170ff9 100755 >--- a/t/db_dependent/Koha/Holds.t >+++ b/t/db_dependent/Koha/Holds.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 8; >+use Test::More tests => 9; > use Test::Warn; > > use C4::Circulation qw( AddIssue ); >@@ -717,3 +717,53 @@ subtest 'filter_by_has_cancellation_requests() and filter_out_has_cancellation_r > > $schema->storage->txn_rollback; > }; >+ >+subtest 'get holds in processing' => sub { >+ >+ plan tests => 1; >+ >+ $schema->storage->txn_begin; >+ >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ >+ my $item = $builder->build_sample_item; >+ >+ my $hold_1 = $builder->build_object( >+ { >+ class => 'Koha::Holds', >+ value => { >+ found => 'P', >+ itemnumber => $item->id, >+ biblionumber => $item->biblionumber, >+ borrowernumber => $patron->id >+ } >+ } >+ ); >+ my $hold_2 = $builder->build_object( >+ { >+ class => 'Koha::Holds', >+ value => { >+ found => undef, >+ itemnumber => $item->id, >+ biblionumber => $item->biblionumber, >+ borrowernumber => $patron->id >+ } >+ } >+ ); >+ my $hold_3 = $builder->build_object( >+ { >+ class => 'Koha::Holds', >+ value => { >+ found => undef, >+ itemnumber => $item->id, >+ biblionumber => $item->biblionumber, >+ borrowernumber => $patron->id >+ } >+ } >+ ); >+ >+ my $processing_holds = $item->holds->processing; >+ is( $processing_holds->count, 1 ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.20.1
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 31907
:
142339
|
142567
|
142821
| 143018 |
143019
|
143296