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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 062e04c9c3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
parent
7c37b128ac
commit
aa08e30cce
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,9 +139,10 @@ 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>`
|
||||
: __("Cronjob")
|
||||
const borrower = row.borrowernumber
|
||||
const importer = borrower
|
||||
? `<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=${borrower.patron_id}">${borrower.firstname} ${borrower.surname}</a>`
|
||||
: this.$__("Cronjob")
|
||||
return importer
|
||||
},
|
||||
searchable: true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue