Bugzilla – Attachment 177967 Details for
Bug 36135
Add tool to batch modify holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36135: Report errors to a modal
Bug-36135-Report-errors-to-a-modal.patch (text/plain), 4.60 KB, created by
Lucas Gass (lukeg)
on 2025-02-12 18:29:14 UTC
(
hide
)
Description:
Bug 36135: Report errors to a modal
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-02-12 18:29:14 UTC
Size:
4.60 KB
patch
obsolete
>From dc83a2ecdd2770fd045d9e9002ac2545c6d453b2 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 4 Feb 2025 20:39:51 +0000 >Subject: [PATCH] Bug 36135: Report errors to a modal > >--- > .../modals/batch_modify_hold_errors.inc | 17 +++++++++++++++++ > .../en/modules/tools/batch_modify_holds.tt | 18 +++++++++++++----- > 2 files changed, 30 insertions(+), 5 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/modals/batch_modify_hold_errors.inc > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/batch_modify_hold_errors.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/batch_modify_hold_errors.inc >new file mode 100644 >index 00000000000..ed9d1526228 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/batch_modify_hold_errors.inc >@@ -0,0 +1,17 @@ >+<!-- Batch modify hold error modal --> >+<div class="modal fade" id="errorModal" tabindex="-1" role="dialog" aria-labelledby="errorModalLabel"> >+ <div class="modal-dialog"> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <h1 class="modal-title" id="errorModalLabel">Errors</h1> >+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> >+ </div> >+ <div class="modal-body"> >+ <ul id="errorList"></ul> >+ </div> >+ <div class="modal-footer"> >+ <button type="button" class="btn btn-primary" data-bs-dismiss="modal">OK</button> >+ </div> >+ </div> >+ </div> >+</div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt >index f8829ca8c55..e90921785b9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt >@@ -16,6 +16,7 @@ > <body id="tools_batch_extend_due_dates" class="tools"> > [% WRAPPER 'header.inc' %] > [% INCLUDE 'cat-search.inc' %] >+ [% INCLUDE modals/batch_modify_hold_errors.inc %] > [% END %] > > [% WRAPPER 'sub-header.inc' %] >@@ -251,7 +252,6 @@ > </aside> > </div> <!-- /.col-sm-2 col-sm-pull-10 --> > </div> <!-- /.row --> >- > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/tools-menu.js") | $raw %] > [% INCLUDE 'calendar.inc' %] >@@ -286,6 +286,7 @@ > })); > > $("#process").on('submit', function(e) { >+ var errors = []; > var reserve_ids = $("input[type=checkbox][name='hold_id']:checked"); > > var new_pickup_loc = $("#new_pickup_loc").val(); >@@ -294,7 +295,7 @@ > > if ( reserve_ids.length == 0 ) { > e.preventDefault(); >- alert(_("Please select at least one hold to process.")); >+ errors.push(_("Please select at least one hold to process.")); > return false; > } > if( new_pickup_loc || new_suspend_status ){ >@@ -302,10 +303,10 @@ > if($(this).parents("tr").children(".found_status").data("found") != ""){ > e.preventDefault(); > if( new_suspend_status ){ >- alert(_("One or more holds have found status and can't be suspended.")); >+ errors.push(_("One or more holds have found status and can't be suspended.")); > } > if( new_pickup_loc ){ >- alert(_("One or more holds have found status and their pick up location can't be changed.")); >+ errors.push(_("One or more holds have found status and their pick up location can't be changed.")); > } > return false; > } >@@ -313,7 +314,14 @@ > } > if( ( !new_suspend_status || new_suspend_status == "not_suspended") && new_suspend_date ){ > e.preventDefault(); >- alert(_("You have to suspend holds if new suspend until date is set.")); >+ errors.push(_("You have to suspend holds if new suspend until date is set.")); >+ return false; >+ } >+ >+ if (errors.length > 0) { >+ e.preventDefault(); >+ $("#errorList").html(errors.map(error => `<li>${error}</li>`).join("")); >+ $("#errorModal").modal('show'); > return false; > } > >-- >2.39.5
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 36135
:
163021
|
163022
|
163023
|
163024
|
163529
|
163530
|
163540
|
163541
|
163542
|
163543
|
163544
|
163796
|
164037
|
164051
|
164057
|
164058
|
164059
|
164060
|
164061
|
164062
|
164063
|
177518
|
177519
|
177959
|
177960
|
177961
|
177962
|
177963
|
177964
|
177965
|
177966
|
177967
|
177968
|
177969
|
177975
|
177976
|
177981
|
177982
|
178154
|
178155
|
178156
|
178157
|
178158
|
178159
|
178160
|
178161
|
178162
|
178163
|
178164
|
178165
|
178166
|
178167