Bugzilla – Attachment 165435 Details for
Bug 36120
Add pickup locations to bookings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36120: (QA follow-up) Tidy
Bug-36120-QA-follow-up-Tidy.patch (text/plain), 4.88 KB, created by
Nick Clemens (kidclamp)
on 2024-04-23 17:42:59 UTC
(
hide
)
Description:
Bug 36120: (QA follow-up) Tidy
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-04-23 17:42:59 UTC
Size:
4.88 KB
patch
obsolete
>From 5d49969d0f7111504c2dcdc6ba375c182296b7a6 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 23 Apr 2024 17:39:06 +0000 >Subject: [PATCH] Bug 36120: (QA follow-up) Tidy > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > .../data/mysql/atomicupdate/bug_36120.pl | 24 +++++++++++-------- > .../prog/js/modals/place_booking.js | 24 ++++++++++--------- > 2 files changed, 27 insertions(+), 21 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_36120.pl b/installer/data/mysql/atomicupdate/bug_36120.pl >index a425df17032..9ed97b8ec44 100755 >--- a/installer/data/mysql/atomicupdate/bug_36120.pl >+++ b/installer/data/mysql/atomicupdate/bug_36120.pl >@@ -8,26 +8,30 @@ return { > my ( $dbh, $out ) = @$args{qw(dbh out)}; > > unless ( column_exists( 'bookings', 'pickup_library_id' ) ) { >- $dbh->do(q{ >+ $dbh->do( >+ q{ > ALTER TABLE bookings > ADD COLUMN `pickup_library_id` varchar(10) DEFAULT NULL COMMENT 'Identifier for booking pickup library' AFTER `item_id`, > ADD CONSTRAINT `bookings_ibfk_4` FOREIGN KEY (`pickup_library_id`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE >- }); >+ } >+ ); > >- say $out "Added column 'bookings.pickup_library_id'"; >+ say $out "Added column 'bookings.pickup_library_id'"; > >- $dbh->do( >- q{UPDATE bookings JOIN items ON bookings.item_id = items.itemnumber SET bookings.pickup_library_id = items.homebranch } >- ); >+ $dbh->do( >+ q{UPDATE bookings JOIN items ON bookings.item_id = items.itemnumber SET bookings.pickup_library_id = items.homebranch } >+ ); > >- say $out "Set existing bookings pickup location to item homebranch"; >+ say $out "Set existing bookings pickup location to item homebranch"; > >- $dbh->do(q{ >+ $dbh->do( >+ q{ > ALTER TABLE bookings > MODIFY pickup_library_id varchar(10) NOT NULL COMMENT 'Identifier for booking pickup library' >- }); >+ } >+ ); > >- say $out "Set pickup_library_id to NOT NULL"; >+ say $out "Set pickup_library_id to NOT NULL"; > } > }, > }; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js b/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js >index 51ced2a8a17..bd09384fb9b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js >@@ -140,17 +140,21 @@ $("#placeBookingModal").on("show.bs.modal", function (e) { > }); > function setLocationsPicker(response) { > let $pickupSelect = $("#pickup_library_id"); >- let bookableItemnumbers = bookable_items.map(function(object) { return object.item_id; }); >+ let bookableItemnumbers = bookable_items.map(function (object) { >+ return object.item_id; >+ }); > $pickupSelect.empty(); > >- $.each(response, function(index, pickup_location) { >- if (containsAny(pickup_location.pickup_items, bookableItemnumbers)) { >+ $.each(response, function (index, pickup_location) { >+ if ( >+ containsAny(pickup_location.pickup_items, bookableItemnumbers) >+ ) { > let option = $( > '<option value="' + >- pickup_location.library_id + >- '">' + >- pickup_location.name + >- "</option>" >+ pickup_location.library_id + >+ '">' + >+ pickup_location.name + >+ "</option>" > ); > > option.attr( >@@ -202,16 +206,15 @@ $("#placeBookingModal").on("show.bs.modal", function (e) { > success: function (response) { > if (dataFetched === true) { > setLocationsPicker(response); >- > } else { >- var interval = setInterval(function() { >+ var interval = setInterval(function () { > if (dataFetched === true) { > // Data is fetched, execute the callback and stop the interval > setLocationsPicker(response); > clearInterval(interval); > } > }, 100); >- }; >+ } > }, > error: function (xhr, status, error) { > console.log("Pickup location fetch failed: ", error); >@@ -861,7 +864,6 @@ $("#placeBookingForm").on("submit", function (e) { > }); > > $("#placeBookingModal").on("hidden.bs.modal", function (e) { >- > // Reset patron select > $("#booking_patron_id").val(null).trigger("change"); > $("#booking_patron_id").empty(); >-- >2.39.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 36120
:
162911
|
162912
|
162914
|
162915
|
162916
|
162917
|
162918
|
162919
|
162920
|
162921
|
162922
|
162923
|
162924
|
162925
|
162926
|
162927
|
162928
|
162976
|
163218
|
163219
|
163220
|
163221
|
163222
|
163223
|
163224
|
163435
|
163436
|
163437
|
163438
|
163439
|
163440
|
163441
|
163442
|
163443
|
163444
|
163445
|
163446
|
163447
|
163448
|
163565
|
163566
|
163567
|
163568
|
163569
|
163570
|
163571
|
163603
|
163604
|
163605
|
163606
|
163607
|
163608
|
163609
|
163610
|
163611
|
163612
|
163613
|
163635
|
163636
|
165140
|
165175
|
165176
|
165177
|
165178
|
165179
|
165180
|
165181
|
165182
|
165183
|
165184
|
165185
|
165186
|
165187
|
165188
|
165214
|
165215
|
165216
|
165419
|
165420
|
165421
|
165422
|
165423
|
165424
|
165425
|
165426
|
165427
|
165428
|
165429
|
165430
|
165431
|
165432
|
165433
|
165434
|
165435
|
165984
|
165985
|
165986
|
165987
|
165988
|
165989
|
165990
|
165991
|
165992
|
165993
|
165994
|
165995
|
165996
|
165997
|
165998
|
165999
|
166000
|
166001
|
166002