Bugzilla – Attachment 179428 Details for
Bug 34756
Cancelling a hold does not cancel the related transfer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34756: (follow-up) Rework the transfer cancellation modal
Bug-34756-follow-up-Rework-the-transfer-cancellati.patch (text/plain), 7.08 KB, created by
Baptiste Wojtkowski (bwoj)
on 2025-03-18 10:12:07 UTC
(
hide
)
Description:
Bug 34756: (follow-up) Rework the transfer cancellation modal
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2025-03-18 10:12:07 UTC
Size:
7.08 KB
patch
obsolete
>From 380c830891e60f050cb6b04e6a6fa47b94dec7f5 Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Tue, 18 Mar 2025 10:53:18 +0100 >Subject: [PATCH] Bug 34756: (follow-up) Rework the transfer cancellation modal > >--- > .../prog/en/includes/holds_table.inc | 14 +++++++++++++- > .../prog/en/modules/reserve/request.tt | 18 ++++++++++++++---- > reserve/request.pl | 12 +++++++++--- > 3 files changed, 36 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >index c671eb1e..f1f492c6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >@@ -186,6 +186,7 @@ > [%- IF ( hold.atdestination ) -%] > Item waiting at <strong> [% hold.wbrname | html %]</strong>[% IF hold.desk_name %], [% hold.desk_name | html %],[% END %] since [% hold.waiting_date | $KohaDates %] > [%- ELSIF (hold.intransit) -%] >+ <input type="hidden" name="transfer-destination" value="[% hold.wbrname | html %]" /> > Item being transferred to <strong> [% hold.wbrname | html %]</strong> > [%- ELSIF (hold.inprocessing) -%] > Item being processed at <strong> [% hold.wbrname | html %]</strong> >@@ -299,7 +300,18 @@ > [%- END -%] > [%- END -%] > <td> >- <a class="cancel-hold" title="Cancel hold" data-borrowernumber="[% hold.borrowernumber | html %]" data-biblionumber="[% hold.biblionumber | html %]" data-id="[% hold.reserve_id | html %]" data-transfer="[% hold.transfer | html %]" href="#"> >+ <a >+ class="cancel-hold" >+ title="Cancel hold" >+ data-borrowernumber="[% hold.borrowernumber | html %]" >+ data-biblionumber="[% hold.biblionumber | html %]" >+ data-id="[% hold.reserve_id | html %]" >+ data-transfer="[% hold.transfer | html %]" >+ data-transfer-date="[% hold.transferdate %]" >+ data-transfer-from="[% Branches.GetName( hold.transferfrom) %]" >+ data-transfer-to="[% Branches.GetName(hold.transferto) %]" >+ href="#" >+ > > <i class="fa fa-trash" aria-label="Cancel hold"></i> > </a> > </td> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index f54b32da..fa3731d4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -1406,7 +1406,8 @@ > </select> > [% END %] > </fieldset> >- <div id=transfer-cancellation></div> >+ <br /> >+ <div id="transfer-cancellation"></div> > </div> > > <div class="modal-footer"> >@@ -1796,13 +1797,22 @@ > let reserve_id = cancel_link.data('id'); > let biblionumber = cancel_link.data('biblionumber'); > let transfer = cancel_link.data('transfer'); >+ let transferTo = cancel_link.data('transfer-to'); >+ let transferFrom = cancel_link.data('transfer-from'); >+ let transferDate = cancel_link.data('transfer-date'); > $("#cancel_modal_form #inputs").append('<input type="hidden" name="reserve_id" value="' + reserve_id + '">'); > $("#cancel_modal_form #inputs").append('<input type="hidden" name="biblionumber" value="' + biblionumber + '">'); > $("#cancel_modal_form #inputs").append('<input type="hidden" name="op" value="cud-cancel">'); > if(transfer){ >- $("#transfer-cancellation").empty() >- $("#transfer-cancellation").append('<label for="transfer-cancel">A transfer related to this hold has been detected, do you want to cancel it ?</label>'); >- $("#transfer-cancellation").append('<input type="checkbox" id="transfer-cancel" name="transfer-cancel"> </input>'); >+ let transferElement = $("#transfer-cancellation"); >+ transferElement.empty(); >+ transferElement[0].classList.add("alert", "alert-warning", "audio-alert-warning"); >+ transferElement.append('<h3>A transfer related to this hold has been detected</h3>'); >+ transferElement.append('<b> Date: </b>' + transferDate + '<br />'); >+ transferElement.append('<b>From: </b>' + transferFrom + '<br />'); >+ transferElement.append('<b>To: </b>' + transferTo + '<br />'); >+ transferElement.append('<label for="transfer-cancel"><b>Delete this transfer: </b></label>'); >+ transferElement.append('<input type="checkbox" id="transfer-cancel" name="transfer-cancel"> </input>'); > } > $('#cancelModal').modal('show'); > return false; >diff --git a/reserve/request.pl b/reserve/request.pl >index 158e4c94..1fc19b03 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -112,11 +112,10 @@ if ( $op eq 'cud-move' ) { > } elsif ( $op eq 'cud-cancel' ) { > my $reserve_id = $input->param('reserve_id'); > my $cancellation_reason = $input->param("cancellation-reason"); >- my $transfer = $input->param("transfer-cancel") ? "1" : "0"; >+ my $transfer = $input->param("transfer-cancel") ? "1" : "0"; > my $hold = Koha::Holds->find($reserve_id); > >- if( $transfer ) { >- warn($hold->item()->get_transfer); >+ if ($transfer) { > $hold->item()->get_transfer->cancel( { reason => 'Manual', 'force' => '1' } ); > } > $hold->cancel( { cancellation_reason => $cancellation_reason } ) if $hold; >@@ -648,6 +647,13 @@ if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) > $reserve{'inprocessing'} = $res->is_in_processing(); > $reserve{'intransit'} = $res->is_in_transit(); > $reserve{'transfer'} = $res->item()->get_transfer() ? '1' : '0'; >+ my $transfer = $res->item()->get_transfer(); >+ >+ if ($transfer) { >+ $reserve{'transferdate'} = $transfer->datesent; >+ $reserve{'transferfrom'} = $transfer->frombranch; >+ $reserve{'transferto'} = $transfer->tobranch; >+ } > } elsif ( $res->priority() > 0 ) { > if ( my $item = $res->item() ) { > $reserve{'itemnumber'} = $item->id(); >-- >2.30.2
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 34756
:
168198
|
168313
|
173138
|
179425
|
179426
|
179428
|
179429
|
179430