Lines 58-68
the Koha database, which acts as an activity log.
Link Here
|
58 |
=item UpdateStats |
58 |
=item UpdateStats |
59 |
|
59 |
|
60 |
&UpdateStats($branch, $type, $value, $other, $itemnumber, |
60 |
&UpdateStats($branch, $type, $value, $other, $itemnumber, |
61 |
$itemtype, $borrowernumber); |
61 |
$itemtype, $borrowernumber, $usercode); |
62 |
|
62 |
|
63 |
Adds a line to the statistics table of the Koha database. In effect, |
63 |
Adds a line to the statistics table of the Koha database. In effect, |
64 |
it logs an event. |
64 |
it logs an event. |
65 |
|
65 |
|
|
|
66 |
C<$usercode> is borrowers.categorycode |
67 |
|
66 |
C<$branch>, C<$type>, C<$value>, C<$other>, C<$itemnumber>, |
68 |
C<$branch>, C<$type>, C<$value>, C<$other>, C<$itemnumber>, |
67 |
C<$itemtype>, and C<$borrowernumber> correspond to the fields of the |
69 |
C<$itemtype>, and C<$borrowernumber> correspond to the fields of the |
68 |
statistics table in the Koha database. |
70 |
statistics table in the Koha database. |
Lines 76-93
sub UpdateStats {
Link Here
|
76 |
my ( |
78 |
my ( |
77 |
$branch, $type, |
79 |
$branch, $type, |
78 |
$amount, $other, $itemnum, |
80 |
$amount, $other, $itemnum, |
79 |
$itemtype, $borrowernumber, $accountno, $ccode |
81 |
$itemtype, $borrowernumber, $accountno, $ccode, $usercode |
80 |
) |
82 |
) |
81 |
= @_; |
83 |
= @_; |
82 |
my $dbh = C4::Context->dbh; |
84 |
my $dbh = C4::Context->dbh; |
83 |
my $sth = $dbh->prepare( |
85 |
my $sth = $dbh->prepare( |
84 |
"INSERT INTO statistics |
86 |
"INSERT INTO statistics |
85 |
(datetime, branch, type, value, |
87 |
(datetime, branch, type, value, usercode, |
86 |
other, itemnumber, itemtype, borrowernumber, proccode, ccode) |
88 |
other, itemnumber, itemtype, borrowernumber, proccode, ccode) |
87 |
VALUES (now(),?,?,?,?,?,?,?,?,?)" |
89 |
VALUES (now(),?,?,?,?,?,?,?,?,?)" |
88 |
); |
90 |
); |
89 |
$sth->execute( |
91 |
$sth->execute( |
90 |
$branch, $type, $amount, |
92 |
$branch, $type, $amount, $usercode, |
91 |
$other, $itemnum, $itemtype, $borrowernumber, |
93 |
$other, $itemnum, $itemtype, $borrowernumber, |
92 |
$accountno, $ccode |
94 |
$accountno, $ccode |
93 |
); |
95 |
); |