From 6e07118353e515b3a923202eed6130bec3b587b7 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 22 Apr 2024 16:10:46 +0000 Subject: [PATCH 3/3] Bug 31671: Add print slip button to transfer page This patch reimplements/rebases Lucas' patch and adds a style modification to the button. To test: 1. Apply patch 2. Go to Circulation / Transfer 3. Try transfering some items and notice the 'Print slip' button 4. Try clicking on it and make sure it generates correctly and with the correct information on the slip --- .../prog/en/modules/circ/branchtransfers.tt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt index d48f85d5b8..da4b63c849 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt @@ -4,6 +4,7 @@ [% USE ItemTypes %] [% USE AuthorisedValues %] [% PROCESS 'i18n.inc' %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] [% FILTER collapse %] [% t("Transfers") | html %] › @@ -217,6 +218,7 @@ <th class="tf-ccode">Collection</th> <th class="tf-origin">Origin</th> <th class="tf-destination">Destination</th> + <th class="tf-printslip">Actions</th> </tr> [% FOREACH trsfitemloo IN trsfitemloop %] <tr> @@ -232,6 +234,9 @@ <td class="tf-ccode">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => trsfitemloo.item.ccode ) | html %]</td> <td class="tf-origin">[% Branches.GetName( trsfitemloo.frombrcd ) | html %]</td> <td class="tf-destination">[% Branches.GetName( trsfitemloo.tobrcd ) | html %]</td> + <td class="tf-printslip"> + <button type="button" class="btn btn-default btn-sm printtransferslip" data-itemnumber="[% trsfitemloo.item.itemnumber | html %]" data-tobranch="[% trsfitemloo.tobrcd | html %]"><i class="fa fa-print"></i> Print slip</button> + </td> </tr> [% END # /FOREACH trsfitemloo %] </table> @@ -250,4 +255,15 @@ [% END %] </div> <!-- /.row --> +[% MACRO jsinclude BLOCK %] + <script> + $(".printtransferslip").on("click", function(e){ + e.preventDefault(); + var itemnumber = $(this).attr('data-itemnumber'); + var to_branch = $(this).attr('data-tobranch'); + window.open("/cgi-bin/koha/circ/transfer-slip.pl?transferitem=" + itemnumber + "&branchcode=" + to_branch); + }); + </script> +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] -- 2.39.2