Bugzilla – Attachment 156827 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: Updating remaining naming
Bug-30719-QA-follow-up-Updating-remaining-naming.patch (text/plain), 13.87 KB, created by
Pedro Amorim
on 2023-10-11 14:53:28 UTC
(
hide
)
Description:
Bug 30719: QA follow-up: Updating remaining naming
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-10-11 14:53:28 UTC
Size:
13.87 KB
patch
obsolete
>From 0bd80414352a2867f11675ff726f3455a94dc181 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Wed, 11 Oct 2023 08:38:57 +0000 >Subject: [PATCH] Bug 30719: QA follow-up: Updating remaining naming > >Update statuscode -> status_code on the js files >Update remaining batch_id -> ill_batch_id >Update batch object in Illrequest.pm strings_map >--- > Koha/IllbatchStatus.pm | 4 +-- > Koha/Illrequest.pm | 9 +++--- > api/v1/swagger/definitions/ill_request.yaml | 2 +- > .../prog/en/includes/ill-batch-modal.inc | 6 ++-- > .../prog/en/modules/ill/ill-requests.tt | 2 +- > .../intranet-tmpl/prog/js/ill-batch-modal.js | 28 +++++++++---------- > .../intranet-tmpl/prog/js/ill-batch-table.js | 14 +++++----- > .../intranet-tmpl/prog/js/ill-list-table.js | 2 +- > t/db_dependent/IllbatchStatuses.t | 6 ++-- > 9 files changed, 37 insertions(+), 36 deletions(-) > >diff --git a/Koha/IllbatchStatus.pm b/Koha/IllbatchStatus.pm >index acd2a7ed64..e098762f90 100644 >--- a/Koha/IllbatchStatus.pm >+++ b/Koha/IllbatchStatus.pm >@@ -124,8 +124,8 @@ sub delete_and_log { > } > > # Update all batches that use this status to have status UNKNOWN >- my $affected = Koha::Illbatches->search( { statuscode => $self->code } ); >- $affected->update( { statuscode => 'UNKNOWN' } ); >+ my $affected = Koha::Illbatches->search( { status_code => $self->code } ); >+ $affected->update( { status_code => 'UNKNOWN' } ); > > my $logger = Koha::Illrequest::Logger->new; > >diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm >index 6662b445a6..5db6762a76 100644 >--- a/Koha/Illrequest.pm >+++ b/Koha/Illrequest.pm >@@ -1909,6 +1909,7 @@ sub TO_JSON { > sub to_api_mapping { > return { > accessurl => 'access_url', >+ batch_id => 'ill_batch_id', > backend => 'ill_backend_id', > borrowernumber => 'patron_id', > branchcode => 'library_id', >@@ -1997,12 +1998,12 @@ sub strings_map { > my $batch = $self->batch; > if ($batch) { > $strings->{"batch"} = { >- id => $batch->id, >+ ill_batch_id => $batch->ill_batch_id, > name => $batch->name, > backend => $batch->backend, >- borrowernumber => $batch->borrowernumber, >- branchcode => $batch->branchcode, >- statuscode => $batch->statuscode >+ patron_id => $batch->patron_id, >+ library_id => $batch->library_id, >+ status_code => $batch->status_code > }; > } > >diff --git a/api/v1/swagger/definitions/ill_request.yaml b/api/v1/swagger/definitions/ill_request.yaml >index 80f7e13b21..e25fc6f416 100644 >--- a/api/v1/swagger/definitions/ill_request.yaml >+++ b/api/v1/swagger/definitions/ill_request.yaml >@@ -9,7 +9,7 @@ properties: > - integer > - "null" > description: Internal bibliographic record identifier >- batch_id: >+ ill_batch_id: > type: > - integer > - "null" >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 15d104e277..8494005f50 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 >@@ -28,9 +28,9 @@ > [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %] > </select> > </li> >- <li id="batch_statuscode" style="display:none"> >- <label class="required" for="statuscode">Status:</label> >- <select id="statuscode" name="statuscode"></select> >+ <li id="batch_status_code" style="display:none"> >+ <label class="required" for="status_code">Status:</label> >+ <select id="status_code" name="status_code"></select> > </li> > </ol> > </fieldset> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >index 18de16803f..e9fe937b87 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >@@ -669,7 +669,7 @@ > [% IF request.batch > 0 %] > <li class="batch"> > <span class="label batch">Batch:</span> >- <a href="/cgi-bin/koha/ill/ill-requests.pl?batch_id=[% request.batch.id | uri %]"> >+ <a href="/cgi-bin/koha/ill/ill-requests.pl?batch_id=[% request.batch.ill_batch_id | uri %]"> > [% request.batch.name | html %] > </a> > </li> >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 c7c302b1aa..0d229c77d0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/ill-batch-modal.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/ill-batch-modal.js >@@ -25,7 +25,7 @@ > var createProgressBar = document.getElementById("processed_progress_bar"); > var identifierTable = document.getElementById('identifier-table'); > var createRequestsButton = document.getElementById('create-requests-button'); >- var statusesSelect = document.getElementById('statuscode'); >+ var statusesSelect = document.getElementById('status_code'); > var cancelButton = document.getElementById('lhs').querySelector('button'); > var cancelButtonOriginalText = cancelButton.innerHTML; > >@@ -49,7 +49,7 @@ > backend: null, > cardnumber: '', > branchcode: '', >- statuscode: 'NEW' >+ status_code: 'NEW' > }; > > // The object that holds the batch we're working with >@@ -307,7 +307,7 @@ > } > > var payload = { >- batch_id: batchId, >+ ill_batch_id: batchId, > ill_backend_id: batch.data.backend, > patron_id: batch.data.patron.patron_id, > library_id: batch.data.library_id, >@@ -378,7 +378,7 @@ > var option = document.createElement('option') > option.value = status.code; > option.text = status.name; >- if (batch.data.batch_id && batch.data.statuscode === status.code) { >+ if (batch.data.ill_batch_id && batch.data.status_code === status.code) { > option.selected = true; > } > statusesSelect.add(option); >@@ -479,7 +479,7 @@ > updateBatch() > .then(function () { > $('#ill-batch-modal').modal({ show: false }); >- location.href = '/cgi-bin/koha/ill/ill-requests.pl?batch_id=' + batch.data.batch_id; >+ location.href = '/cgi-bin/koha/ill/ill-requests.pl?batch_id=' + batch.data.ill_batch_id; > }); > }; > >@@ -509,12 +509,12 @@ > }) > .then(function (jsoned) { > batch.data = { >- batch_id: jsoned.batch_id, >+ ill_batch_id: jsoned.ill_batch_id, > name: jsoned.name, > backend: jsoned.backend, > cardnumber: jsoned.cardnumber, > library_id: jsoned.library_id, >- statuscode: jsoned.statuscode >+ status_code: jsoned.status_code > } > return jsoned; > }) >@@ -540,7 +540,7 @@ > backend: backend, > cardnumber: cardnumberInput.value, > library_id: selectedBranchcode, >- statuscode: selectedStatuscode >+ status_code: selectedStatuscode > }) > }) > .then(function (response) { >@@ -550,14 +550,14 @@ > return Promise.reject(response); > }) > .then(function (body) { >- batchId = body.batch_id; >+ batchId = body.ill_batch_id; > batch.data = { >- batch_id: body.batch_id, >+ ill_batch_id: body.ill_batch_id, > name: body.name, > backend: body.backend, > cardnumber: body.patron.cardnumber, > library_id: body.library_id, >- statuscode: body.statuscode, >+ status_code: body.status_code, > patron: body.patron, > status: body.status > }; >@@ -578,7 +578,7 @@ > var selectedBranchcode = branchcodeSelect.selectedOptions[0].value; > var selectedStatuscode = statusesSelect.selectedOptions[0].value; > >- return doBatchApiRequest('/' + batch.data.batch_id, { >+ return doBatchApiRequest('/' + batch.data.ill_batch_id, { > method: 'PUT', > headers: { > 'Content-type': 'application/json' >@@ -588,7 +588,7 @@ > backend: batch.data.backend, > cardnumber: batch.data.patron.cardnumber, > library_id: selectedBranchcode, >- statuscode: selectedStatuscode >+ status_code: selectedStatuscode > }) > }) > .catch(function () { >@@ -1045,7 +1045,7 @@ > } > > function manageBatchItemsDisplay() { >- batchItemsDisplay.style.display = batch.data.batch_id ? 'block' : 'none' >+ batchItemsDisplay.style.display = batch.data.ill_batch_id ? 'block' : 'none' > }; > > function updateBatchInputs() { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-batch-table.js b/koha-tmpl/intranet-tmpl/prog/js/ill-batch-table.js >index dd2d400771..fe535ff16e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/ill-batch-table.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/ill-batch-table.js >@@ -50,7 +50,7 @@ > data: batchesProxy.data, > columns: [ > { >- data: 'batch_id', >+ data: 'ill_batch_id', > width: '10%' > }, > { >@@ -92,13 +92,13 @@ > > // A render function for branch name > var createBranch = function (x, y, data) { >- return data._strings.branchname; >+ return data._strings.library_id.str; > }; > > // A render function for batch name > var createName = function (x, y, data) { > var a = document.createElement('a'); >- a.setAttribute('href', '/cgi-bin/koha/ill/ill-requests.pl?batch_id=' + data.batch_id); >+ a.setAttribute('href', '/cgi-bin/koha/ill/ill-requests.pl?batch_id=' + data.ill_batch_id); > a.setAttribute('title', data.name); > a.textContent = data.name; > return a.outerHTML; >@@ -106,7 +106,7 @@ > > // A render function for batch status > var createStatus = function (x, y, data) { >- return data._strings.status.name; >+ return data._strings.status_code.str; > }; > > // A render function for our patron link >@@ -122,13 +122,13 @@ > var editButton = document.createElement('button'); > editButton.setAttribute('type', 'button'); > editButton.setAttribute('class', 'editButton btn btn-xs btn-default'); >- editButton.setAttribute('data-batch-id', row.batch_id); >+ editButton.setAttribute('data-batch-id', row.ill_batch_id); > editButton.appendChild(document.createTextNode(ill_batch_edit)); > > var deleteButton = document.createElement('button'); > deleteButton.setAttribute('type', 'button'); > deleteButton.setAttribute('class', 'deleteButton btn btn-xs btn-danger'); >- deleteButton.setAttribute('data-batch-id', row.batch_id); >+ deleteButton.setAttribute('data-batch-id', row.ill_batch_id); > deleteButton.appendChild(document.createTextNode(ill_batch_delete)); > > div.appendChild(editButton); >@@ -200,7 +200,7 @@ > // Remove a batch from our proxy data > var removeBatch = function(id) { > batchesProxy.data = batchesProxy.data.filter(function (batch) { >- return batch.batch_id != id; >+ return batch.ill_batch_id != id; > }); > }; > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js >index fa3ceb223f..f6255f74e7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js >@@ -220,7 +220,7 @@ $(document).ready(function() { > "render": function(data, type, row, meta) { > return row.batch ? > '<a href="/cgi-bin/koha/ill/ill-requests.pl?batch_id=' + >- row.batch_id + >+ row.ill_batch_id + > '">' + > row.batch.name + > '</a>' >diff --git a/t/db_dependent/IllbatchStatuses.t b/t/db_dependent/IllbatchStatuses.t >index c03e81a426..8748d73b56 100755 >--- a/t/db_dependent/IllbatchStatuses.t >+++ b/t/db_dependent/IllbatchStatuses.t >@@ -197,7 +197,7 @@ my $batch = Koha::Illbatch->new( > patron_id => $patron->borrowernumber, > library_id => $library->branchcode, > backend => "TEST", >- statuscode => $status5->code >+ status_code => $status5->code > } > ); > $batch->create_and_log; >@@ -205,7 +205,7 @@ $batch->create_and_log; > # Delete the batch status and ensure the batch's status has been changed > # to UNKNOWN > $status5->delete_and_log; >-my $updated_code = Koha::Illbatches->find( { statuscode => "UNKNOWN" } ); >-is( $updated_code->statuscode, "UNKNOWN", "batches attached to deleted status have status changed to UNKNOWN" ); >+my $updated_code = Koha::Illbatches->find( { status_code => "UNKNOWN" } ); >+is( $updated_code->status_code, "UNKNOWN", "batches attached to deleted status have status changed to UNKNOWN" ); > > $schema->storage->txn_rollback; >-- >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