Bugzilla – Attachment 189817 Details for
Bug 9750
Bring routing lists into notices & slips
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9750: Add customizable ROUTING_LIST slip
Bug-9750-Add-customizable-ROUTINGLIST-slip.patch (text/plain), 8.30 KB, created by
Lucas Gass (lukeg)
on 2025-11-20 22:02:45 UTC
(
hide
)
Description:
Bug 9750: Add customizable ROUTING_LIST slip
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-11-20 22:02:45 UTC
Size:
8.30 KB
patch
obsolete
>From ea0fd706c492b90d3a15b4008fd5e225c2074efe Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 20 Nov 2025 22:01:52 +0000 >Subject: [PATCH] Bug 9750: Add customizable ROUTING_LIST slip > >--- > .../modules/serials/routing-preview-slip.tt | 24 +------- > .../prog/en/modules/serials/routing.tt | 4 +- > .../en/modules/serials/serials-collection.tt | 2 +- > serials/routing-preview.pl | 57 ++++++++++++------- > 4 files changed, 41 insertions(+), 46 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tt >index 3f95a1ba75b..2c07aaea000 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tt >@@ -22,27 +22,7 @@ > <body id="ser_routing-preview-slip" class="ser"> > <div class="container-fluid"> > <h1>[% tx("Routing slip for {title}", { title = title }) | html %]</h1> >- <div class="page-section"> >- <table> >- <tr> >- <td colspan="2"><h3>[% libraryname | html %]</h3></td> >- </tr> >- <tr> >- <td colspan="2"><strong>Title:</strong> [% title | html %]<br />[% issue | html %]</td> >- </tr> >- <tr> >- <td><strong>Name</strong></td> >- <td><strong>Date due</strong></td> >- </tr> >- [% FOREACH memberloo IN memberloop %] >- <tr> >- <td>[% memberloo.name | html %]</td> >- <td> </td> >- </tr> >- [% END %] >- </table> >- </div> >- <!-- /.page-section --> >+ <div class="page-section"> [% letter_content | $raw %] </div> > > <div id="routingnotes"> > [%- SET RoutingListNote = AdditionalContents.get( location => "RoutingListNote", lang => lang, library => logged_in_user.branchcode ) -%] >@@ -56,8 +36,6 @@ > [% END %] > </div> > [% END %] >- >- <p id="routingnote">[% routingnotes | html %]</p> > </div> > > <nav class="navbar navbar-default fixed-bottom"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt >index 75b52d9b032..a26cceb52fc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt >@@ -56,9 +56,9 @@ > <select name="date_selected_top" id="date_selected_top" class="date_selected_top"> > [% FOREACH date IN dates %] > [% IF ( date.selected ) %] >- <option value="[% date.serialseq | html %] ([% date.publisheddate | html %])" selected="selected">[% date.serialseq | html %] ([% date.publisheddate | $KohaDates %])</option> >+ <option value="[% date.serialid | html %]" selected="selected">[% date.serialseq | html %] ([% date.publisheddate | $KohaDates %])</option> > [% ELSE %] >- <option value="[% date.serialseq | html %] ([% date.publisheddate | html %])">[% date.serialseq | html %] ([% date.publisheddate | $KohaDates %])</option> >+ <option value="[% date.serialid | html %]">[% date.serialseq | html %] ([% date.publisheddate | $KohaDates %])</option> > [% END %] > [% END %] > </select> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >index ae63fadc809..c18b186c903 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >@@ -315,7 +315,7 @@ > [% IF ( routing ) %] > <td class="actions"> > <a >- href="/cgi-bin/koha/serials/routing-preview.pl?op=print&subscriptionid=[% serial.subscriptionid | uri %]&issue=[% serial.serialseq.replace("'", "\\'") | uri %]%20([% serial.publisheddate | $KohaDates %])" >+ href="/cgi-bin/koha/serials/routing-preview.pl?op=print&subscriptionid=[% serial.subscriptionid | uri %]&issue=[% serial.serialid | uri %]" > class="btn btn-default btn-xs print_list" > ><i class="fa fa-print"></i> Print list</a > > >diff --git a/serials/routing-preview.pl b/serials/routing-preview.pl >index 6c65ec9a7e3..c9a93bbdde9 100755 >--- a/serials/routing-preview.pl >+++ b/serials/routing-preview.pl >@@ -26,11 +26,13 @@ use C4::Output qw( output_html_with_http_headers ); > use C4::Reserves qw( AddReserve ModReserve ); > use C4::Context; > use C4::Serials qw( delroutingmember getroutinglist GetSubscription GetSerials check_routing ); >+use C4::Letters qw( GetPreparedLetter ); > use URI::Escape; > > use Koha::Biblios; > use Koha::Libraries; > use Koha::Patrons; >+use Koha::Serials; > > my $query = CGI->new; > my $subscriptionid = $query->param('subscriptionid'); >@@ -55,19 +57,19 @@ my $subs = GetSubscription($subscriptionid); > my ( $tmp, @serials ) = GetSerials($subscriptionid); > my ( $template, $loggedinuser, $cookie ); > >-my $library; >-if ( $op eq 'cud-save_and_preview' ) { >+# get biblio information.... >+my $biblionumber = $subs->{'bibnum'}; > >- # get biblio information.... >- my $biblionumber = $subs->{'bibnum'}; >+my $library; >+my $biblio = Koha::Biblios->find($biblionumber); >+my $items = $biblio->items->search_ordered; >+my $branch = >+ $items->count >+ ? $items->next->holding_branch->branchcode >+ : $subs->{branchcode}; >+$library = Koha::Libraries->find($branch); > >- my $biblio = Koha::Biblios->find($biblionumber); >- my $items = $biblio->items->search_ordered; >- my $branch = >- $items->count >- ? $items->next->holding_branch->branchcode >- : $subs->{branchcode}; >- $library = Koha::Libraries->find($branch); >+if ( $op eq 'cud-save_and_preview' ) { > > if ( C4::Context->preference('RoutingListAddReserves') ) { > >@@ -127,23 +129,38 @@ if ( $op eq 'cud-save_and_preview' ) { > > $template->param( libraryname => $library->branchname ) if $library; > >-my $memberloop = []; >-for my $routing (@routinglist) { >- my $member = Koha::Patrons->find( $routing->{borrowernumber} )->unblessed; >- $member->{name} = "$member->{firstname} $member->{surname}"; >- push @{$memberloop}, $member; >+my @borrowernumbers = map { $_->{borrowernumber} } @routinglist; >+ >+my $matching_serial; >+if ($issue) { >+ my $serial_obj = Koha::Serials->find($issue); >+ $matching_serial = $serial_obj->unblessed if $serial_obj; > } > >-my $routingnotes = $serials[0]->{'routingnotes'}; >-$routingnotes =~ s/\n/\<br \/\>/g; >+my $letter = GetPreparedLetter( >+ module => 'serial', >+ letter_code => 'ROUTING_LIST', >+ message_transport_type => 'print', >+ lang => 'default', >+ tables => { >+ subscription => $subscriptionid, >+ biblio => $subs->{bibnum}, >+ biblioitems => $subs->{bibnum}, >+ branches => $branch, >+ serial => $matching_serial ? $matching_serial->{serialid} : $serials[0]->{serialid}, >+ >+ }, >+ loops => { >+ borrowers => \@borrowernumbers, >+ }, >+); > > $template->param( >+ letter_content => $letter->{content}, > title => $subs->{'bibliotitle'}, > issue => $issue, > issue_escaped => URI::Escape::uri_escape_utf8($issue), > subscriptionid => $subscriptionid, >- memberloop => $memberloop, >- routingnotes => $routingnotes, > hasRouting => check_routing($subscriptionid), > ( uc( C4::Context->preference("marcflavour") ) ) => 1 > ); >-- >2.39.5
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 9750
:
189816
|
189817
|
189871
|
189872
|
189873
|
189874