Bug 35402: (follow-up) Remove form from returns.tt

If you have AllowReturnToBranch enabled and you check in an item which
is disallowed by the preference (returned at the wrong branch, for
instance) You get a "Cannot check in" modal.

Previously clicking the "OK" button in this form triggered JS which is
supposed to submit a form. However, all the button needs to do is
dismiss the modal. The form and the "approve" class on the button are
removed by this patch.

NOTE: This patch contains indentation changes.

To test, apply the patch and set the AllowReturnToBranch system
preference to "only at the library that the item is from."

- Locate an item belonging to another library and check it out to a
  patron.
- Check in the item.
- You should see a modal confirmation, "Cannot check in".
- Clicking the "OK" button should dismiss the modal window without
  triggering a reload of the page.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Owen Leonard 2024-08-23 15:29:39 +00:00 committed by Katrin Fischer
parent 8f834c4bd3
commit d30f87b697
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 27 additions and 29 deletions

View File

@ -540,35 +540,33 @@
<div id="wrong-branch-modal" tabindex="-1" class="modal modal-lg block audio-alert-action block" data-bs-backdrop="static" data-bs-keyboard="false">
<div class="modal-dialog">
<div class="modal-content">
<form method="post" action="returns.pl" name="mainform" id="mainform">
<div class="modal-header">
<h1 class="modal-title">
Cannot check in
</h1>
</div>
<div class="modal-body">
<p>
<a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
[% item.barcode | html %]: [% title | html %]
</a>
</p>
<p>
<strong>
NOT CHECKED IN
</strong>
</p>
<p>
This item must be checked in at following library:
<strong>
[% Branches.GetName( rightbranch ) | html %]
</strong>
</p>
[% INCLUDE all_checkin_messages %]
</div> <!-- /.modal-body -->
<div class="modal-footer">
<button type="button" data-bs-dismiss="modal" class="btn btn-default approve"><i class="fa fa-check"></i> OK</button>
</div>
</form> <!-- /#mainform -->
<div class="modal-header">
<h1 class="modal-title">
Cannot check in
</h1>
</div>
<div class="modal-body">
<p>
<a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
[% item.barcode | html %]: [% title | html %]
</a>
</p>
<p>
<strong>
NOT CHECKED IN
</strong>
</p>
<p>
This item must be checked in at following library:
<strong>
[% Branches.GetName( rightbranch ) | html %]
</strong>
</p>
[% INCLUDE all_checkin_messages %]
</div> <!-- /.modal-body -->
<div class="modal-footer">
<button type="button" data-bs-dismiss="modal" class="btn btn-primary"><i class="fa fa-check"></i> OK</button>
</div>
</div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog -->
</div> <!-- /#wrong-branch-modal -->