From 86d3a42a1cb0332b432c40bc27d30c81e9a76ead Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 22 Apr 2024 16:10:46 +0000 Subject: [PATCH] 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 Signed-off-by: Lucas Gass Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- .../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 ae6ab4ad29..aef7032444 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> @@ -231,6 +233,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> @@ -249,4 +254,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.5