View | Details | Raw Unified | Return to bug 30928
Collapse All | Expand All

(-)a/C4/Circulation.pm (-1 / +5 lines)
Lines 824-829 sub CanBookBeIssued { Link Here
824
                borrowernumber => $patron->borrowernumber,
824
                borrowernumber => $patron->borrowernumber,
825
                ccode          => $item_object->ccode,
825
                ccode          => $item_object->ccode,
826
                categorycode   => $patron->categorycode,
826
                categorycode   => $patron->categorycode,
827
                interface      => C4::Context->interface,
827
            }
828
            }
828
        );
829
        );
829
        ModDateLastSeen( $item_object->itemnumber ); # FIXME Move to Koha::Item
830
        ModDateLastSeen( $item_object->itemnumber ); # FIXME Move to Koha::Item
Lines 1753-1759 sub AddIssue { Link Here
1753
                    location       => $item_object->location,
1754
                    location       => $item_object->location,
1754
                    borrowernumber => $borrower->{'borrowernumber'},
1755
                    borrowernumber => $borrower->{'borrowernumber'},
1755
                    ccode          => $item_object->ccode,
1756
                    ccode          => $item_object->ccode,
1756
                    categorycode   => $borrower->{'categorycode'}
1757
                    categorycode   => $borrower->{'categorycode'},
1758
                    interface      => C4::Context->interface,
1757
                }
1759
                }
1758
            );
1760
            );
1759
1761
Lines 2379-2384 sub AddReturn { Link Here
2379
        borrowernumber => $borrowernumber,
2381
        borrowernumber => $borrowernumber,
2380
        ccode          => $item->ccode,
2382
        ccode          => $item->ccode,
2381
        categorycode   => $categorycode,
2383
        categorycode   => $categorycode,
2384
        interface      => C4::Context->interface,
2382
    });
2385
    });
2383
2386
2384
    # Send a check-in slip. # NOTE: borrower may be undef. Do not try to send messages then.
2387
    # Send a check-in slip. # NOTE: borrower may be undef. Do not try to send messages then.
Lines 3228-3233 sub AddRenewal { Link Here
3228
                borrowernumber => $borrowernumber,
3231
                borrowernumber => $borrowernumber,
3229
                ccode          => $item_object->ccode,
3232
                ccode          => $item_object->ccode,
3230
                categorycode   => $patron->categorycode,
3233
                categorycode   => $patron->categorycode,
3234
                interface      => C4::Context->interface,
3231
            }
3235
            }
3232
        );
3236
        );
3233
3237
(-)a/C4/Stats.pm (-2 / +5 lines)
Lines 65-71 C<$params> is an hashref whose expected keys are: Link Here
65
    other              : sipmode
65
    other              : sipmode
66
    itemtype           : the type of the item
66
    itemtype           : the type of the item
67
    ccode              : the collection code of the item
67
    ccode              : the collection code of the item
68
    categorycode           : the categorycode of the patron
68
    categorycode       : the categorycode of the patron
69
    interface          : the context this action was taken in
69
70
70
type key is mandatory.
71
type key is mandatory.
71
For types used in C4::Circulation (renew,issue,localuse,return), the following other keys are mandatory:
72
For types used in C4::Circulation (renew,issue,localuse,return), the following other keys are mandatory:
Lines 83-89 sub UpdateStats { Link Here
83
# make some controls
84
# make some controls
84
    return () if ! defined $params;
85
    return () if ! defined $params;
85
# change these arrays if new types of transaction or new parameters are allowed
86
# change these arrays if new types of transaction or new parameters are allowed
86
    my @allowed_keys = qw (type branch amount other itemnumber itemtype borrowernumber ccode location categorycode);
87
    my @allowed_keys = qw (type branch amount other itemnumber itemtype borrowernumber ccode location categorycode interface);
87
    my @allowed_circulation_types = qw (renew issue localuse return onsite_checkout recall);
88
    my @allowed_circulation_types = qw (renew issue localuse return onsite_checkout recall);
88
    my @allowed_accounts_types = qw (writeoff payment);
89
    my @allowed_accounts_types = qw (writeoff payment);
89
    my @circulation_mandatory_keys = qw (type branch borrowernumber itemnumber ccode itemtype);
90
    my @circulation_mandatory_keys = qw (type branch borrowernumber itemnumber ccode itemtype);
Lines 125-130 sub UpdateStats { Link Here
125
    my $location          = exists $params->{location}       ? $params->{location}       : undef;
126
    my $location          = exists $params->{location}       ? $params->{location}       : undef;
126
    my $ccode             = exists $params->{ccode}          ? $params->{ccode}          : '';
127
    my $ccode             = exists $params->{ccode}          ? $params->{ccode}          : '';
127
    my $categorycode      = exists $params->{categorycode}   ? $params->{categorycode}   : undef;
128
    my $categorycode      = exists $params->{categorycode}   ? $params->{categorycode}   : undef;
129
    my $interface         = exists $params->{interface}      ? $params->{interface}      : undef;
128
130
129
    my $dtf = Koha::Database->new->schema->storage->datetime_parser;
131
    my $dtf = Koha::Database->new->schema->storage->datetime_parser;
130
    my $statistic = Koha::Statistic->new(
132
    my $statistic = Koha::Statistic->new(
Lines 140-145 sub UpdateStats { Link Here
140
            borrowernumber => $borrowernumber,
142
            borrowernumber => $borrowernumber,
141
            ccode          => $ccode,
143
            ccode          => $ccode,
142
            categorycode   => $categorycode,
144
            categorycode   => $categorycode,
145
            interface      => $interface,
143
        }
146
        }
144
    )->store;
147
    )->store;
145
148
(-)a/Koha/Account.pm (+1 lines)
Lines 254-259 sub add_credit { Link Here
254
                        type           => lc($credit_type),
254
                        type           => lc($credit_type),
255
                        amount         => $amount,
255
                        amount         => $amount,
256
                        borrowernumber => $self->{patron_id},
256
                        borrowernumber => $self->{patron_id},
257
                        interface      => $interface,
257
                    }
258
                    }
258
                ) if grep { $credit_type eq $_ } ( 'PAYMENT', 'WRITEOFF' );
259
                ) if grep { $credit_type eq $_ } ( 'PAYMENT', 'WRITEOFF' );
259
260
(-)a/Koha/Recalls.pm (-1 / +2 lines)
Lines 173-179 sub add_recall { Link Here
173
                borrowernumber => $recall->patron_id,
173
                borrowernumber => $recall->patron_id,
174
                itemtype       => $item->effective_itemtype,
174
                itemtype       => $item->effective_itemtype,
175
                ccode          => $item->ccode,
175
                ccode          => $item->ccode,
176
                categorycode   => $checkout->patron->categorycode
176
                categorycode   => $checkout->patron->categorycode,
177
                interface      => $interface,
177
            }
178
            }
178
        );
179
        );
179
180
(-)a/Koha/Schema/Result/Statistic.pm (+10 lines)
Lines 108-113 foreign key from the items table, links transaction to a specific collection cod Link Here
108
108
109
foreign key from the borrowers table, links transaction to a specific borrower category
109
foreign key from the borrowers table, links transaction to a specific borrower category
110
110
111
=head2 interface
112
113
  data_type: 'varchar'
114
  is_nullable: 1
115
  size: 30
116
117
interface acted upon
118
111
=cut
119
=cut
112
120
113
__PACKAGE__->add_columns(
121
__PACKAGE__->add_columns(
Lines 137-142 __PACKAGE__->add_columns( Link Here
137
  { data_type => "varchar", is_nullable => 1, size => 80 },
145
  { data_type => "varchar", is_nullable => 1, size => 80 },
138
  "categorycode",
146
  "categorycode",
139
  { data_type => "varchar", is_nullable => 1, size => 10 },
147
  { data_type => "varchar", is_nullable => 1, size => 10 },
148
  "interface",
149
  { data_type => "varchar", is_nullable => 1, size => 30 },
140
);
150
);
141
151
142
152
(-)a/installer/data/mysql/atomicupdate/bug_30928.pl (+18 lines)
Line 0 Link Here
1
use Modern::Perl;
2
return {
3
    bug_number => "30928",
4
    description => "Add interface field to statistics table",
5
    up => sub {
6
        my ($args) = @_;
7
        my ($dbh, $out) = @$args{qw(dbh out)};
8
        if( !column_exists( 'statistics', 'interface' ) ) {
9
            $dbh->do(q{
10
                ALTER TABLE statistics
11
                ADD COLUMN interface varchar(30) NULL DEFAULT NULL
12
                COMMENT "interface"
13
                AFTER categorycode
14
            });
15
            say $out "Added column 'statistics.interface'";
16
        }
17
    },
18
}
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 5338-5343 CREATE TABLE `statistics` ( Link Here
5338
  `borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key from the borrowers table, links transaction to a specific borrower',
5338
  `borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key from the borrowers table, links transaction to a specific borrower',
5339
  `ccode` varchar(80) DEFAULT NULL COMMENT 'foreign key from the items table, links transaction to a specific collection code',
5339
  `ccode` varchar(80) DEFAULT NULL COMMENT 'foreign key from the items table, links transaction to a specific collection code',
5340
  `categorycode` varchar(10) DEFAULT NULL COMMENT 'foreign key from the borrowers table, links transaction to a specific borrower category',
5340
  `categorycode` varchar(10) DEFAULT NULL COMMENT 'foreign key from the borrowers table, links transaction to a specific borrower category',
5341
  `interface` varchar(30) DEFAULT NULL COMMENT 'the context this action was taken in',
5341
  KEY `timeidx` (`datetime`),
5342
  KEY `timeidx` (`datetime`),
5342
  KEY `branch_idx` (`branch`),
5343
  KEY `branch_idx` (`branch`),
5343
  KEY `type_idx` (`type`),
5344
  KEY `type_idx` (`type`),
5344
- 

Return to bug 30928