Bugzilla – Attachment 145876 Details for
Bug 30719
ILL should provide the ability to create batch requests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30719: (QA Follow-up):
Bug-30719-QA-Follow-up.patch (text/plain), 10.02 KB, created by
Pedro Amorim
on 2023-01-31 14:30:11 UTC
(
hide
)
Description:
Bug 30719: (QA Follow-up):
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-01-31 14:30:11 UTC
Size:
10.02 KB
patch
obsolete
>From 8848ee26a6dae3885253299994a417f22816ecdd Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pjamorim91@gmail.com> >Date: Tue, 8 Nov 2022 14:53:07 -0100 >Subject: [PATCH] Bug 30719: (QA Follow-up): > >- Fix wrong link 'Create a new batch status message' in case there are no existing batch statuses >- Detail of batch update - View status of any request within a batch >- Fix typo to correctly display status code on batch statuses list page >- Fixed an issue with illrequest api definition that prevented the listing of any ILL requests if any request had a status_alias >- Updated "Add items to batch" css class to match new 22.11 style >- Fixed conflict issue where it prevented the creation of a single request in a backend that is using JS field validation utilizing the #cardnumber selector >- Added a check for metadata enrichment plugins and bail batches JS code if none are found, this prevents a console error >- Remove ysearch from patron auto complete in batch creation and use patron_autocomplete instead >- 'New batch' and 'list batches' buttons no longer show if no metadata plugin is installed > >Sponsored-by: UKHSA >--- > api/v1/swagger/definitions/illrequest.yaml | 2 +- > .../prog/en/includes/ill-batch-modal.inc | 7 +-- > .../prog/en/includes/ill-toolbar.inc | 2 +- > .../en/modules/admin/ill_batch_statuses.tt | 4 +- > .../intranet-tmpl/prog/js/ill-batch-modal.js | 43 +++++++++++-------- > 5 files changed, 33 insertions(+), 25 deletions(-) > >diff --git a/api/v1/swagger/definitions/illrequest.yaml b/api/v1/swagger/definitions/illrequest.yaml >index c37f7a30d3..78f9dc8385 100644 >--- a/api/v1/swagger/definitions/illrequest.yaml >+++ b/api/v1/swagger/definitions/illrequest.yaml >@@ -128,7 +128,7 @@ properties: > description: The request's current status > status_alias: > type: >- - string >+ - object > - "null" > description: The ID of a user defined status for this request > updated: >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-batch-modal.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-batch-modal.inc >index f0abfa8a64..b7587606e1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-batch-modal.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-batch-modal.inc >@@ -18,8 +18,8 @@ > value="" /> > </li> > <li id="batch_patron"> >- <label class="required" for="cardnumber">Card number, username or surname:</label> >- <input type="text" autocomplete="off" name="cardnumber" id="cardnumber" type="text" value="" /> >+ <label class="required" for="batchcardnumber">Card number, username or surname:</label> >+ <input type="text" autocomplete="off" name="batchcardnumber" id="batchcardnumber" type="text" value="" /> > <span id="patron_link"></span> > </li> > <li id="batch_branch"> >@@ -65,7 +65,7 @@ > </div> > </div> > <div id="create-requests" style="display:none"> >- <button id="create-requests-button" type="button" class="btn btn-xs btn-success">Add items to batch</button> >+ <button id="create-requests-button" type="button" class="btn btn-xs btn-primary">Add items to batch</button> > </div> > <table id="identifier-table" style="display:none"> > <thead> >@@ -74,6 +74,7 @@ > <th scope="col">Identifier value</th> > <th scope="col">Metadata</th> > <th scope="col">Request ID</th> >+ <th scope="col">Request Status</th> > <th scope="col"></th> > </tr> > </thead> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-toolbar.inc >index ffc6055071..cbb6bfd13e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-toolbar.inc >@@ -32,7 +32,7 @@ > <i class="fa fa-list"></i> List requests > </a> > [% END %] >- [% IF have_batch.size > 0 %] >+ [% IF have_batch.size > 0 && metadata_enrichment_services %] > <div id="ill-batch"> > <div class="dropdown btn-group"> > <button class="btn btn-default dropdown-toggle" type="button" id="ill-batch-backend-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/ill_batch_statuses.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/ill_batch_statuses.tt >index 0bf6e5f53d..c47cc27e2c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/ill_batch_statuses.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/ill_batch_statuses.tt >@@ -132,7 +132,7 @@ > [% FOREACH status IN statuses %] > <tr> > <td>[% status.name | html %]</td> >- <td>[% name.code | html %]</td> >+ <td>[% status.code | html %]</td> > <td>[% status.is_system ? "Yes" : "No" | html %]</td> > <td class="actions"> > <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/ill_batch_statuses.pl?op=add_form&code=[% status.code | uri %]"><i class="fa fa-pencil"></i> Edit</a> >@@ -146,7 +146,7 @@ > </table> > [% ELSE %] > <div class="dialog message"> >- There are no batch statuses defined. <a href="/cgi-bin/koha/admin/debit_types.pl?op=add_form">Create new batch status</a> >+ There are no batch statuses defined. <a href="/cgi-bin/koha/admin/ill_batch_statuses.pl?op=add_form">Create new batch status</a> > </div> > [% END %] > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-batch-modal.js b/koha-tmpl/intranet-tmpl/prog/js/ill-batch-modal.js >index 70f9e29c5a..469292d753 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/ill-batch-modal.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/ill-batch-modal.js >@@ -1,4 +1,10 @@ > (function () { >+ // Bail if there aren't any metadata enrichment plugins installed >+ if (typeof metadata_enrichment_services === 'undefined') { >+ console.log('No metadata enrichment plugins found.') >+ return; >+ } >+ > window.addEventListener('load', onload); > > // Delay between API requests >@@ -7,7 +13,7 @@ > // Elements we work frequently with > var textarea = document.getElementById("identifiers_input"); > var nameInput = document.getElementById("name"); >- var cardnumberInput = document.getElementById("cardnumber"); >+ var cardnumberInput = document.getElementById("batchcardnumber"); > var branchcodeSelect = document.getElementById("branchcode"); > var processButton = document.getElementById("process_button"); > var createButton = document.getElementById("button_create_batch"); >@@ -21,7 +27,6 @@ > var createRequestsButton = document.getElementById('create-requests-button'); > var statusesSelect = document.getElementById('statuscode'); > >- > // We need a data structure keyed on identifier type, which tells us how to parse that > // identifier type and what services can get its metadata. We receive an array of > // available services >@@ -299,6 +304,7 @@ > tableContent.data = tableContent.data.map(function (row) { > if (row.value === identifier) { > row.requestId = data.illrequest_id; >+ row.requestStatus = data.status; > } > return row; > }); >@@ -893,6 +899,10 @@ > return data.requestId || '-'; > } > >+ function createRequestStatus(x, y, data) { >+ return data.requestStatus || '-'; >+ } >+ > function buildTable(identifiers) { > table = KohaTable('identifier-table', { > processing: true, >@@ -918,9 +928,14 @@ > }, > { > data: 'requestId', >- width: '13%', >+ width: '6.5%', > render: createRequestId > }, >+ { >+ data: 'requestStatus', >+ width: '6.5%', >+ render: createRequestStatus >+ }, > { > width: '18%', > render: createActions, >@@ -1021,23 +1036,15 @@ > } > > function patronAutocomplete() { >- // Add autocomplete for patron selection >- $('#batch-form #cardnumber').autocomplete({ >- appendTo: '#batch-form', >- source: "/cgi-bin/koha/circ/ysearch.pl", >- minLength: 3, >- select: function (event, ui) { >- var field = ui.item.cardnumber; >- $('#batch-form #cardnumber').val(field) >+ patron_autocomplete( >+ $('#batch-form #batchcardnumber'), >+ { >+ 'on-select-callback': function( event, ui ) { >+ $("#batch-form #batchcardnumber").val( ui.item.cardnumber ); > return false; >+ } > } >- }) >- .data("ui-autocomplete")._renderItem = function (ul, item) { >- return $("<li></li>") >- .data("ui-autocomplete-item", item) >- .append("<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>") >- .appendTo(ul); >- }; >+ ); > }; > > function createPatronLink() { >-- >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 30719
:
144281
|
144285
|
144286
|
144287
|
144288
|
144289
|
144290
|
144291
|
144292
|
144293
|
144294
|
144295
|
144296
|
144297
|
144298
|
144299
|
144300
|
144301
|
144302
|
145760
|
145869
|
145870
|
145876
|
145934
|
146152
|
147658
|
147929
|
147930
|
147931
|
147932
|
147933
|
147934
|
147952
|
147953
|
147954
|
147955
|
147956
|
151152
|
151153
|
151154
|
151155
|
151156
|
151284
|
151285
|
151286
|
151287
|
151288
|
151303
|
151304
|
151305
|
151306
|
151307
|
151308
|
151309
|
151310
|
151311
|
151312
|
151513
|
151514
|
151515
|
151516
|
151517
|
151519
|
151520
|
151521
|
151522
|
151523
|
151571
|
151572
|
151573
|
151574
|
151575
|
151611
|
151612
|
151613
|
151614
|
151615
|
151804
|
151805
|
151806
|
151807
|
151808
|
151809
|
154046
|
154047
|
154048
|
154049
|
154050
|
154051
|
154052
|
155421
|
155422
|
155423
|
155424
|
155425
|
155426
|
155427
|
155428
|
155429
|
155430
|
155431
|
155432
|
155433
|
155434
|
155435
|
156556
|
156748
|
156749
|
156752
|
156783
|
156785
|
156811
|
156812
|
156827
|
156828