|
Lines 22-27
use Modern::Perl;
Link Here
|
| 22 |
|
22 |
|
| 23 |
use C4::Auth qw( get_template_and_user ); |
23 |
use C4::Auth qw( get_template_and_user ); |
| 24 |
use CGI qw ( -utf8 ); |
24 |
use CGI qw ( -utf8 ); |
|
|
25 |
use JSON; |
| 25 |
use Text::CSV::Encoded; |
26 |
use Text::CSV::Encoded; |
| 26 |
use C4::Context; |
27 |
use C4::Context; |
| 27 |
use C4::Output qw( output_html_with_http_headers ); |
28 |
use C4::Output qw( output_html_with_http_headers ); |
|
Lines 152-162
if ($do_it) {
Link Here
|
| 152 |
$result->{'biblioitemnumber'} = q{}; |
153 |
$result->{'biblioitemnumber'} = q{}; |
| 153 |
$result->{'barcode'} = q{}; |
154 |
$result->{'barcode'} = q{}; |
| 154 |
|
155 |
|
| 155 |
if ( substr( $log->info, 0, 4 ) eq 'item' || $log->module eq "CIRCULATION" ) { |
156 |
if ( substr( $log->info, 0, 4 ) eq 'item' ) { |
| 156 |
|
157 |
|
| 157 |
# get item information so we can create a working link |
158 |
# get item information so we can create a working link |
| 158 |
my $itemnumber = $log->object; |
159 |
my $itemnumber = $log->object; |
| 159 |
$itemnumber = $log->info if ( $log->module eq "CIRCULATION" ); |
|
|
| 160 |
my $item = Koha::Items->find($itemnumber); |
160 |
my $item = Koha::Items->find($itemnumber); |
| 161 |
if ($item) { |
161 |
if ($item) { |
| 162 |
$result->{'object_found'} = 1; |
162 |
$result->{'object_found'} = 1; |
|
Lines 166-171
if ($do_it) {
Link Here
|
| 166 |
} |
166 |
} |
| 167 |
} |
167 |
} |
| 168 |
|
168 |
|
|
|
169 |
if ( $log->module eq "CIRCULATION" ) { |
| 170 |
my $info = $log->info; |
| 171 |
my $decoded; |
| 172 |
my $is_json = eval { |
| 173 |
$decoded = decode_json($info); |
| 174 |
1; |
| 175 |
}; |
| 176 |
|
| 177 |
if ( !$is_json || !ref($decoded) ) { |
| 178 |
my $item = Koha::Items->find($info); |
| 179 |
if ($item) { |
| 180 |
$result->{'object_found'} = 1; |
| 181 |
$result->{'biblionumber'} = $item->biblionumber; |
| 182 |
$result->{'biblioitemnumber'} = $item->biblionumber; |
| 183 |
$result->{'barcode'} = $item->barcode; |
| 184 |
} |
| 185 |
} |
| 186 |
} |
| 187 |
|
| 169 |
#always add firstname and surname for librarian/user |
188 |
#always add firstname and surname for librarian/user |
| 170 |
if ( $log->user ) { |
189 |
if ( $log->user ) { |
| 171 |
my $patron = Koha::Patrons->find( $log->user ); |
190 |
my $patron = Koha::Patrons->find( $log->user ); |
| 172 |
- |
|
|