Bugzilla – Attachment 165057 Details for
Bug 36627
Display importer for manually harvested SUSHI data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36627: Rename embed method to patron
Bug-36627-Rename-embed-method-to-patron.patch (text/plain), 5.00 KB, created by
Matt Blenkinsop
on 2024-04-18 09:24:58 UTC
(
hide
)
Description:
Bug 36627: Rename embed method to patron
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-04-18 09:24:58 UTC
Size:
5.00 KB
patch
obsolete
>From 42ff46645a4fcb97e9fc8f61a39d86197789fa31 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Thu, 18 Apr 2024 09:22:31 +0000 >Subject: [PATCH] Bug 36627: Rename embed method to patron > >This patch renames the embed method from borrowernumber to patron to fit with the use of 'patron' in the API >--- > Koha/ERM/EUsage/CounterLog.pm | 12 ++++++------ > Koha/Schema/Result/ErmCounterLog.pm | 11 +++++++++++ > api/v1/swagger/definitions/erm_counter_log.yaml | 10 +++++++--- > api/v1/swagger/paths/erm_counter_logs.yaml | 2 +- > .../ERM/UsageStatisticsDataProvidersCounterLogs.vue | 8 ++++---- > 5 files changed, 29 insertions(+), 14 deletions(-) > >diff --git a/Koha/ERM/EUsage/CounterLog.pm b/Koha/ERM/EUsage/CounterLog.pm >index c494fda0e0..4743a028bd 100644 >--- a/Koha/ERM/EUsage/CounterLog.pm >+++ b/Koha/ERM/EUsage/CounterLog.pm >@@ -32,17 +32,17 @@ Koha::ERM::EUsage::CounterLog - Koha ErmCounterLog Object class > =cut > > >-=head3 borrowernumber >+=head3 patron > >-Return the borrower for this counter_file >+Return the patron for this counter_file > > =cut > >-sub borrowernumber { >+sub patron { > my ($self) = @_; >- my $borrowers_rs = $self->_result->borrowernumber; >- return unless $borrowers_rs; >- return Koha::Patron->_new_from_dbic($borrowers_rs); >+ my $patrons_rs = $self->_result->patron; >+ return unless $patrons_rs; >+ return Koha::Patron->_new_from_dbic($patrons_rs); > } > > >diff --git a/Koha/Schema/Result/ErmCounterLog.pm b/Koha/Schema/Result/ErmCounterLog.pm >index 4927a96aea..2e7fa31f1f 100644 >--- a/Koha/Schema/Result/ErmCounterLog.pm >+++ b/Koha/Schema/Result/ErmCounterLog.pm >@@ -181,6 +181,17 @@ __PACKAGE__->belongs_to( > # Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-11-30 17:43:57 > # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fEB6HZDsjTTJVWlnW+y/Ng > >+__PACKAGE__->belongs_to( >+ "patron", >+ "Koha::Schema::Result::Borrower", >+ { borrowernumber => "borrowernumber" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "CASCADE", >+ on_update => "CASCADE", >+ }, >+); > > sub koha_object_class { > 'Koha::ERM::EUsage::CounterLog'; >diff --git a/api/v1/swagger/definitions/erm_counter_log.yaml b/api/v1/swagger/definitions/erm_counter_log.yaml >index 097b08d934..899df453b2 100644 >--- a/api/v1/swagger/definitions/erm_counter_log.yaml >+++ b/api/v1/swagger/definitions/erm_counter_log.yaml >@@ -11,10 +11,9 @@ properties: > - integer > - "null" > borrowernumber: >- type: object >- description: patron object >+ description: borrowernumber of the counter log > type: >- - object >+ - integer > - "null" > importdate: > type: string >@@ -35,6 +34,11 @@ properties: > type: > - integer > - "null" >+ patron: >+ description: patron object for the importer >+ type: >+ - object >+ - "null" > > additionalProperties: false > required: >diff --git a/api/v1/swagger/paths/erm_counter_logs.yaml b/api/v1/swagger/paths/erm_counter_logs.yaml >index cb9a9f3b8d..ebfa8e6d5e 100644 >--- a/api/v1/swagger/paths/erm_counter_logs.yaml >+++ b/api/v1/swagger/paths/erm_counter_logs.yaml >@@ -21,7 +21,7 @@ > items: > type: string > enum: >- - borrowernumber >+ - patron > - $ref: "../swagger.yaml#/parameters/match" > - $ref: "../swagger.yaml#/parameters/order_by" > - $ref: "../swagger.yaml#/parameters/page" >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersCounterLogs.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersCounterLogs.vue >index dffe7a8342..8e8ce7be7e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersCounterLogs.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersCounterLogs.vue >@@ -41,7 +41,7 @@ export default { > tableOptions: { > columns: this.getTableColumns(), > options: { >- embed: "borrowernumber", >+ embed: "patron", > }, > url: () => this.table_url(), > table_settings: this.counter_log_table_settings, >@@ -139,9 +139,9 @@ export default { > { > title: __("Imported by"), > render: function (data, type, row, meta) { >- const borrower = row.borrowernumber >- const importer = borrower >- ? `<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=${borrower.patron_id}">${borrower.firstname} ${borrower.surname}</a>` >+ const { patron } = row >+ const importer = patron >+ ? `<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=${patron.patron_id}">${patron.firstname} ${patron.surname}</a>` > : "Cronjob" > return importer > }, >-- >2.37.1 (Apple Git-137.1)
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 36627
:
165029
|
165030
|
165031
|
165054
|
165055
|
165056
|
165057
|
165064
|
165065
|
165066
|
165067
|
165068
|
165070
|
165071
|
165072
|
165073
|
165074
|
165127
|
165128
|
165129
|
165130
|
165131
|
169217
|
169218
|
169219
|
169220
|
169221
|
174066
|
174067
|
174068
|
174069
|
174070
|
174402
|
174706
|
174707
|
174708
|
174709
|
174710
|
174711
|
174712