Bugzilla – Attachment 150386 Details for
Bug 30928
Add interface to statistics table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30928: Add interface to statistics
Bug-30928-Add-interface-to-statistics.patch (text/plain), 4.99 KB, created by
Lucas Gass (lukeg)
on 2023-04-28 14:32:57 UTC
(
hide
)
Description:
Bug 30928: Add interface to statistics
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2023-04-28 14:32:57 UTC
Size:
4.99 KB
patch
obsolete
>From 71f6ece25034e5ac4faa221bb3d79ea8fbcc0524 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 28 Apr 2023 14:30:41 +0000 >Subject: [PATCH] Bug 30928: Add interface to statistics > >--- > C4/Circulation.pm | 6 +++++- > C4/Stats.pm | 7 +++++-- > Koha/Account.pm | 1 + > Koha/Recalls.pm | 3 ++- > 4 files changed, 13 insertions(+), 4 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 6bba369114..080ee3bc15 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -825,6 +825,7 @@ sub CanBookBeIssued { > ccode => $item_object->ccode, > categorycode => $patron->categorycode, > location => $item_object->location, >+ interface => C4::Context->interface, > } > ); > ModDateLastSeen( $item_object->itemnumber ); # FIXME Move to Koha::Item >@@ -1773,7 +1774,8 @@ sub AddIssue { > location => $item_object->location, > borrowernumber => $borrower->{'borrowernumber'}, > ccode => $item_object->ccode, >- categorycode => $borrower->{'categorycode'} >+ categorycode => $borrower->{'categorycode'}, >+ interface => C4::Context->interface, > } > ); > >@@ -2407,6 +2409,7 @@ sub AddReturn { > borrowernumber => $borrowernumber, > ccode => $item->ccode, > categorycode => $categorycode, >+ interface => C4::Context->interface, > }); > > # Send a check-in slip. # NOTE: borrower may be undef. Do not try to send messages then. >@@ -3265,6 +3268,7 @@ sub AddRenewal { > borrowernumber => $borrowernumber, > ccode => $item_object->ccode, > categorycode => $patron->categorycode, >+ interface => C4::Context->interface, > } > ); > >diff --git a/C4/Stats.pm b/C4/Stats.pm >index a833ba2e92..f8f1aa03a8 100644 >--- a/C4/Stats.pm >+++ b/C4/Stats.pm >@@ -65,7 +65,8 @@ C<$params> is an hashref whose expected keys are: > other : sipmode > itemtype : the type of the item > ccode : the collection code of the item >- categorycode : the categorycode of the patron >+ categorycode : the categorycode of the patron >+ interface : the context this action was taken in > > type key is mandatory. > For types used in C4::Circulation (renew,issue,localuse,return), the following other keys are mandatory: >@@ -83,7 +84,7 @@ sub UpdateStats { > # make some controls > return () if ! defined $params; > # change these arrays if new types of transaction or new parameters are allowed >- my @allowed_keys = qw (type branch amount other itemnumber itemtype borrowernumber ccode location categorycode); >+ my @allowed_keys = qw (type branch amount other itemnumber itemtype borrowernumber ccode location categorycode interface); > my @allowed_circulation_types = qw (renew issue localuse return onsite_checkout recall); > my @allowed_accounts_types = qw (writeoff payment); > my @circulation_mandatory_keys = qw (type branch borrowernumber itemnumber ccode itemtype); >@@ -125,6 +126,7 @@ sub UpdateStats { > my $location = exists $params->{location} ? $params->{location} : undef; > my $ccode = exists $params->{ccode} ? $params->{ccode} : ''; > my $categorycode = exists $params->{categorycode} ? $params->{categorycode} : undef; >+ my $interface = exists $params->{interface} ? $params->{interface} : undef; > > my $dtf = Koha::Database->new->schema->storage->datetime_parser; > my $statistic = Koha::Statistic->new( >@@ -140,6 +142,7 @@ sub UpdateStats { > borrowernumber => $borrowernumber, > ccode => $ccode, > categorycode => $categorycode, >+ interface => $interface, > } > )->store; > >diff --git a/Koha/Account.pm b/Koha/Account.pm >index e37e646596..b0f3dc5254 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -254,6 +254,7 @@ sub add_credit { > type => lc($credit_type), > amount => $amount, > borrowernumber => $self->{patron_id}, >+ interface => $interface, > } > ) if grep { $credit_type eq $_ } ( 'PAYMENT', 'WRITEOFF' ); > >diff --git a/Koha/Recalls.pm b/Koha/Recalls.pm >index e81802b191..5526f7d529 100644 >--- a/Koha/Recalls.pm >+++ b/Koha/Recalls.pm >@@ -173,7 +173,8 @@ sub add_recall { > borrowernumber => $recall->patron_id, > itemtype => $item->effective_itemtype, > ccode => $item->ccode, >- categorycode => $checkout->patron->categorycode >+ categorycode => $checkout->patron->categorycode, >+ interface => $interface, > } > ); > >-- >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 30928
:
145982
|
146042
|
146171
|
146172
|
146653
|
146654
|
147838
|
147839
|
150386
|
150387
|
150433
|
150434
|
150435
|
150436