Bugzilla – Attachment 170940 Details for
Bug 29490
Preview for more notices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29490: Add preview for HOLD
Bug-29490-Add-preview-for-HOLD.patch (text/plain), 3.16 KB, created by
Jonathan Druart
on 2024-09-02 13:07:41 UTC
(
hide
)
Description:
Bug 29490: Add preview for HOLD
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-09-02 13:07:41 UTC
Size:
3.16 KB
patch
obsolete
>From c1b600e0f7fa3124af60cd2d2ee27f36c0c853b5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 2 Sep 2024 15:06:03 +0200 >Subject: [PATCH] Bug 29490: Add preview for HOLD > >--- > .../prog/en/modules/tools/letter.tt | 2 ++ > svc/letters/preview | 21 +++++++++++++++++++ > tools/letter.pl | 2 +- > 3 files changed, 24 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >index c8fea2b3787..022725ed0f2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -493,6 +493,8 @@ > <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode" /> > [% CASE 'CHECKOUT' %] > <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode|borrowernumber" /> >+ [% CASE 'HOLD' %] >+ <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode" /> > [% CASE 'HOLD_SLIP' %] > <input type="text" id="data_preview" name="data_preview" value="" placeholder="biblionumber|borrowernumber" /> > [% CASE %] >diff --git a/svc/letters/preview b/svc/letters/preview >index 8b7f5ac1a47..d2e66e843e2 100755 >--- a/svc/letters/preview >+++ b/svc/letters/preview >@@ -193,6 +193,27 @@ elsif ( $code eq 'CHECKOUT' ) { > $letter_params = {}; > } > } >+elsif ( $code eq 'HOLD' ) { >+ my ($barcode) = $data_preview; >+ >+ my $item = Koha::Items->find( { barcode => $barcode } ); >+ my $hold = $item->current_holds->search( { found => 'W' } )->next; >+ if ($hold) { >+ $letter_params = { >+ tables => { >+ reserves => $hold->unblessed, >+ branches => $hold->branchcode, >+ borrowers => $hold->borrowernumber, >+ biblio => $hold->biblionumber, >+ biblioitems => $hold->biblionumber, >+ items => $hold->itemnumber, >+ } >+ }; >+ } else { >+ push @messages, { code => 'no_hold', type => 'alert' }; >+ $letter_params = {}; >+ } >+} > elsif ( $code eq 'HOLD_SLIP' ) { > my ( $biblionumber, $borrowernumber ) = split '\|', $data_preview; > my $hold = Koha::Holds->find( { borrowernumber => $borrowernumber, biblionumber => $biblionumber } ); >diff --git a/tools/letter.pl b/tools/letter.pl >index 8a9a6301db3..4ffceb21a7e 100755 >--- a/tools/letter.pl >+++ b/tools/letter.pl >@@ -302,7 +302,7 @@ sub add_form { > my $preview_is_available = 0; > > if ($code) { >- $preview_is_available = grep {$_ eq $code } qw( CHECKIN CHECKOUT HOLD_SLIP ); >+ $preview_is_available = grep {$_ eq $code } qw( CHECKIN CHECKOUT HOLD HOLD_SLIP ); > } > > $template->param( >-- >2.34.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 29490
: 170940