Bugzilla – Attachment 179426 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), 6.33 KB, created by
Baptiste Wojtkowski (bwoj)
on 2025-03-18 09:56:35 UTC
(
hide
)
Description:
Bug 34756: (follow-up) Rework the transfer cancellation modal
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2025-03-18 09:56:35 UTC
Size:
6.33 KB
patch
obsolete
>From 652a31dc269a6f48fab6bf6cfb64dd39c1bf0ea9 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 | 3 ++- > .../prog/en/modules/reserve/request.tt | 16 +++++++++++++--- > reserve/request.pl | 7 +++++++ > 3 files changed, 22 insertions(+), 4 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..ccc09ba0 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,7 @@ > [%- 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..2bc72ae8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -1406,6 +1406,7 @@ > </select> > [% END %] > </fieldset> >+ </br> > <div id=transfer-cancellation></div> > </div> > >@@ -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..05d2d278 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -116,6 +116,7 @@ if ( $op eq 'cud-move' ) { > my $hold = Koha::Holds->find($reserve_id); > > if( $transfer ) { >+ warn "Cancelling Transfer"; > warn($hold->item()->get_transfer); > $hold->item()->get_transfer->cancel( { reason => 'Manual', 'force' => '1' } ); > } >@@ -648,6 +649,12 @@ 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