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

(-)a/C4/Log.pm (-4 / +10 lines)
Lines 67-73 number is set to 0, which is the same as the superlibrarian's number. Link Here
67
67
68
#'
68
#'
69
sub logaction {
69
sub logaction {
70
    my ($modulename, $actionname, $objectnumber, $infos)=@_;
70
    my ($modulename, $actionname, $objectnumber, $infos, $interface)=@_;
71
71
72
    # Get ID of logged in user.  if called from a batch job,
72
    # Get ID of logged in user.  if called from a batch job,
73
    # no user session exists and C4::Context->userenv() returns
73
    # no user session exists and C4::Context->userenv() returns
Lines 75-84 sub logaction { Link Here
75
    my $userenv = C4::Context->userenv();
75
    my $userenv = C4::Context->userenv();
76
    my $usernumber = (ref($userenv) eq 'HASH') ? $userenv->{'number'} : 0;
76
    my $usernumber = (ref($userenv) eq 'HASH') ? $userenv->{'number'} : 0;
77
    $usernumber ||= 0;
77
    $usernumber ||= 0;
78
    $interface //= C4::Context->interface;
78
79
79
    my $dbh = C4::Context->dbh;
80
    my $dbh = C4::Context->dbh;
80
    my $sth=$dbh->prepare("Insert into action_logs (timestamp,user,module,action,object,info) values (now(),?,?,?,?,?)");
81
    my $sth=$dbh->prepare("Insert into action_logs (timestamp,user,module,action,object,info,interface) values (now(),?,?,?,?,?,?)");
81
    $sth->execute($usernumber,$modulename,$actionname,$objectnumber,$infos);
82
    $sth->execute($usernumber,$modulename,$actionname,$objectnumber,$infos,$interface);
82
    $sth->finish;
83
    $sth->finish;
83
84
84
    my $logger = Koha::Logger->get(
85
    my $logger = Koha::Logger->get(
Lines 240-245 sub GetLogs { Link Here
240
    my $action   = shift;
241
    my $action   = shift;
241
    my $object   = shift;
242
    my $object   = shift;
242
    my $info     = shift;
243
    my $info     = shift;
244
    my $interfaces = shift;
243
245
244
    my $iso_datefrom = $datefrom ? output_pref({ dt => dt_from_string( $datefrom ), dateformat => 'iso', dateonly => 1 }) : undef;
246
    my $iso_datefrom = $datefrom ? output_pref({ dt => dt_from_string( $datefrom ), dateformat => 'iso', dateonly => 1 }) : undef;
245
    my $iso_dateto = $dateto ? output_pref({ dt => dt_from_string( $dateto ), dateformat => 'iso', dateonly => 1 }) : undef;
247
    my $iso_dateto = $dateto ? output_pref({ dt => dt_from_string( $dateto ), dateformat => 'iso', dateonly => 1 }) : undef;
Lines 281-286 sub GetLogs { Link Here
281
        $query .= " AND info LIKE ? ";
283
        $query .= " AND info LIKE ? ";
282
        push( @parameters, "%" . $info . "%" );
284
        push( @parameters, "%" . $info . "%" );
283
    }
285
    }
286
    if ( $interfaces && scalar(@$interfaces) ) {
287
        $query .=
288
          " AND interface IN (" . join( ",", map { "?" } @$interfaces ) . ") ";
289
        push( @parameters, @$interfaces );
290
    }
284
291
285
    my $sth = $dbh->prepare($query);
292
    my $sth = $dbh->prepare($query);
286
    $sth->execute(@parameters);
293
    $sth->execute(@parameters);
287
- 

Return to bug 16829