Bugzilla – Attachment 165064 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: Record who is importing sushi data
Bug-36627-Record-who-is-importing-sushi-data.patch (text/plain), 4.06 KB, created by
Pedro Amorim
on 2024-04-18 10:21:11 UTC
(
hide
)
Description:
Bug 36627: Record who is importing sushi data
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-04-18 10:21:11 UTC
Size:
4.06 KB
patch
obsolete
>From c170e1f012ce790f6aeab307ada223af5a5a61da Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Wed, 17 Apr 2024 16:23:33 +0000 >Subject: [PATCH] Bug 36627: Record who is importing sushi data > >This patch adds functionality for storing the patron (or cronjob) that triggers a harvest. Currently every counter log is stored as being imported by the cronjob > >Test plan: >1) In the usage statistics module in ERM, create a data provider (the details in the provider are not important) >2) Click into the provider and click into manual upload >3) Upload the file attached to this bug >4) Once the background job is completed click into the counter logs tab in the provider. The imported by columns should show a user with a clickable link > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > Koha/ERM/EUsage/CounterFile.pm | 5 ++++- > .../ERM/UsageStatisticsDataProvidersCounterLogs.vue | 9 ++++++--- > misc/cronjobs/erm_run_harvester.pl | 2 +- > 3 files changed, 11 insertions(+), 5 deletions(-) > >diff --git a/Koha/ERM/EUsage/CounterFile.pm b/Koha/ERM/EUsage/CounterFile.pm >index 0836455251b..2d5d80f15cd 100644 >--- a/Koha/ERM/EUsage/CounterFile.pm >+++ b/Koha/ERM/EUsage/CounterFile.pm >@@ -35,6 +35,8 @@ use Koha::ERM::EUsage::UsageDataProvider; > use Koha::ERM::EUsage::SushiCounter; > use Koha::Exceptions::ERM::EUsage::CounterFile; > >+use C4::Context; >+ > use base qw(Koha::Object); > > use Koha::ERM::EUsage::CounterLogs; >@@ -558,10 +560,11 @@ Adds a erm_counter_logs database entry > sub _add_counter_log_entry { > my ($self) = @_; > >+ my $user = C4::Context->userenv()->{'number'}; > Koha::ERM::EUsage::CounterLog->new( > { > #TODO: borrowernumber only required for manual uploads or "harvest now" button clicks >- borrowernumber => undef, >+ borrowernumber => $user, > counter_files_id => $self->erm_counter_files_id, > importdate => $self->date_uploaded, > filename => $self->filename, >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 105a0a1ccab..dffe7a8342b 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 >@@ -40,7 +40,9 @@ export default { > building_table: false, > tableOptions: { > columns: this.getTableColumns(), >- options: {}, >+ options: { >+ embed: "borrowernumber", >+ }, > url: () => this.table_url(), > table_settings: this.counter_log_table_settings, > add_filters: true, >@@ -137,8 +139,9 @@ export default { > { > title: __("Imported by"), > render: function (data, type, row, meta) { >- const importer = row.borrowernumber >- ? `<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=${row.borrowernumber}">Borrowernumber ${row.borrowernumber}</a>` >+ const borrower = row.borrowernumber >+ const importer = borrower >+ ? `<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=${borrower.patron_id}">${borrower.firstname} ${borrower.surname}</a>` > : "Cronjob" > return importer > }, >diff --git a/misc/cronjobs/erm_run_harvester.pl b/misc/cronjobs/erm_run_harvester.pl >index fa8f0b3828d..6a76281cd36 100755 >--- a/misc/cronjobs/erm_run_harvester.pl >+++ b/misc/cronjobs/erm_run_harvester.pl >@@ -22,7 +22,7 @@ use Getopt::Long qw( GetOptions ); > use Koha::DateUtils qw( dt_from_string ); > use POSIX; > >-use Koha::Script; >+use Koha::Script -cron; > use Koha::ERM::EUsage::UsageDataProviders; > > # Command line option values >-- >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 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