|
Lines 64-70
number is set to 0, which is the same as the superlibrarian's number.
Link Here
|
| 64 |
|
64 |
|
| 65 |
#' |
65 |
#' |
| 66 |
sub logaction { |
66 |
sub logaction { |
| 67 |
my ($modulename, $actionname, $objectnumber, $infos)=@_; |
67 |
my ($modulename, $actionname, $objectnumber, $infos, $interface)=@_; |
| 68 |
|
68 |
|
| 69 |
# Get ID of logged in user. if called from a batch job, |
69 |
# Get ID of logged in user. if called from a batch job, |
| 70 |
# no user session exists and C4::Context->userenv() returns |
70 |
# no user session exists and C4::Context->userenv() returns |
|
Lines 72-81
sub logaction {
Link Here
|
| 72 |
my $userenv = C4::Context->userenv(); |
72 |
my $userenv = C4::Context->userenv(); |
| 73 |
my $usernumber = (ref($userenv) eq 'HASH') ? $userenv->{'number'} : 0; |
73 |
my $usernumber = (ref($userenv) eq 'HASH') ? $userenv->{'number'} : 0; |
| 74 |
$usernumber ||= 0; |
74 |
$usernumber ||= 0; |
|
|
75 |
$interface //= C4::Context->interface; |
| 75 |
|
76 |
|
| 76 |
my $dbh = C4::Context->dbh; |
77 |
my $dbh = C4::Context->dbh; |
| 77 |
my $sth=$dbh->prepare("Insert into action_logs (timestamp,user,module,action,object,info) values (now(),?,?,?,?,?)"); |
78 |
my $sth=$dbh->prepare("Insert into action_logs (timestamp,user,module,action,object,info,interface) values (now(),?,?,?,?,?,?)"); |
| 78 |
$sth->execute($usernumber,$modulename,$actionname,$objectnumber,$infos); |
79 |
$sth->execute($usernumber,$modulename,$actionname,$objectnumber,$infos,$interface); |
| 79 |
$sth->finish; |
80 |
$sth->finish; |
| 80 |
} |
81 |
} |
| 81 |
|
82 |
|
|
Lines 217-222
sub GetLogs {
Link Here
|
| 217 |
my $action = shift; |
218 |
my $action = shift; |
| 218 |
my $object = shift; |
219 |
my $object = shift; |
| 219 |
my $info = shift; |
220 |
my $info = shift; |
|
|
221 |
my $interfaces = shift; |
| 220 |
|
222 |
|
| 221 |
my $iso_datefrom = $datefrom ? output_pref({ dt => dt_from_string( $datefrom ), dateformat => 'iso', dateonly => 1 }) : undef; |
223 |
my $iso_datefrom = $datefrom ? output_pref({ dt => dt_from_string( $datefrom ), dateformat => 'iso', dateonly => 1 }) : undef; |
| 222 |
my $iso_dateto = $dateto ? output_pref({ dt => dt_from_string( $dateto ), dateformat => 'iso', dateonly => 1 }) : undef; |
224 |
my $iso_dateto = $dateto ? output_pref({ dt => dt_from_string( $dateto ), dateformat => 'iso', dateonly => 1 }) : undef; |
|
Lines 258-263
sub GetLogs {
Link Here
|
| 258 |
$query .= " AND info LIKE ? "; |
260 |
$query .= " AND info LIKE ? "; |
| 259 |
push( @parameters, "%" . $info . "%" ); |
261 |
push( @parameters, "%" . $info . "%" ); |
| 260 |
} |
262 |
} |
|
|
263 |
if ( $interfaces && scalar(@$interfaces) ) { |
| 264 |
$query .= |
| 265 |
" AND interface IN (" . join( ",", map { "?" } @$interfaces ) . ") "; |
| 266 |
push( @parameters, @$interfaces ); |
| 267 |
} |
| 261 |
|
268 |
|
| 262 |
my $sth = $dbh->prepare($query); |
269 |
my $sth = $dbh->prepare($query); |
| 263 |
$sth->execute(@parameters); |
270 |
$sth->execute(@parameters); |
| 264 |
- |
|
|