Lines 26-35
use JSON qw(to_json);
Link Here
|
26 |
use C4::Auth qw(check_cookie_auth haspermission get_session); |
26 |
use C4::Auth qw(check_cookie_auth haspermission get_session); |
27 |
use C4::Biblio qw(GetMarcBiblio GetFrameworkCode GetRecordValue ); |
27 |
use C4::Biblio qw(GetMarcBiblio GetFrameworkCode GetRecordValue ); |
28 |
use C4::Circulation qw(GetIssuingCharges CanBookBeRenewed GetRenewCount GetSoonestRenewDate); |
28 |
use C4::Circulation qw(GetIssuingCharges CanBookBeRenewed GetRenewCount GetSoonestRenewDate); |
29 |
use C4::Koha qw(GetAuthorisedValueByCode); |
|
|
30 |
use C4::Overdues qw(GetFine); |
29 |
use C4::Overdues qw(GetFine); |
31 |
use C4::Context; |
30 |
use C4::Context; |
32 |
|
31 |
|
|
|
32 |
use Koha::AuthorisedValues; |
33 |
use Koha::DateUtils; |
33 |
use Koha::DateUtils; |
34 |
|
34 |
|
35 |
my $input = new CGI; |
35 |
my $input = new CGI; |
Lines 149-154
while ( my $c = $sth->fetchrow_hashref() ) {
Link Here
|
149 |
GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} ); |
149 |
GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} ); |
150 |
|
150 |
|
151 |
my $itemtype = C4::Koha::getitemtypeinfo( $item_level_itypes ? $c->{itype} : $c->{itemtype} ); |
151 |
my $itemtype = C4::Koha::getitemtypeinfo( $item_level_itypes ? $c->{itype} : $c->{itemtype} ); |
|
|
152 |
my $location; |
153 |
if ( $c->{location} ) { |
154 |
my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $c->{location} }); |
155 |
$location = $av->count ? $av->next->lib : ''; |
156 |
} |
157 |
my $lost; |
158 |
if ( $c->{itemlost} ) { |
159 |
my $av = Koha::AuthorisedValues->search({ category => 'LOST', authorised_value => $c->{itemlost} }); |
160 |
$lost = $av->count ? $av->next->lib : ''; |
161 |
} |
162 |
my $damaged; |
163 |
if ( $c->{damaged} ) { |
164 |
my $av = Koha::AuthorisedValues->search({ category => 'DAMAGED', authorised_value => $c->{damaged} }); |
165 |
$damaged = $av->count ? $av->next->lib : ''; |
166 |
} |
152 |
my $checkout = { |
167 |
my $checkout = { |
153 |
DT_RowId => $c->{itemnumber} . '-' . $c->{borrowernumber}, |
168 |
DT_RowId => $c->{itemnumber} . '-' . $c->{borrowernumber}, |
154 |
title => $c->{title}, |
169 |
title => $c->{title}, |
Lines 156-162
while ( my $c = $sth->fetchrow_hashref() ) {
Link Here
|
156 |
barcode => $c->{barcode}, |
171 |
barcode => $c->{barcode}, |
157 |
itemtype => $item_level_itypes ? $c->{itype} : $c->{itemtype}, |
172 |
itemtype => $item_level_itypes ? $c->{itype} : $c->{itemtype}, |
158 |
itemtype_description => $itemtype->{translated_description}, |
173 |
itemtype_description => $itemtype->{translated_description}, |
159 |
location => $c->{location} ? GetAuthorisedValueByCode( 'LOC', $c->{location} ) : q{}, |
174 |
location => $location |
160 |
homebranch => $c->{homebranch}, |
175 |
homebranch => $c->{homebranch}, |
161 |
itemnotes => $c->{itemnotes}, |
176 |
itemnotes => $c->{itemnotes}, |
162 |
itemnotes_nonpublic => $c->{itemnotes_nonpublic}, |
177 |
itemnotes_nonpublic => $c->{itemnotes_nonpublic}, |
Lines 195-202
while ( my $c = $sth->fetchrow_hashref() ) {
Link Here
|
195 |
), |
210 |
), |
196 |
subtitle => |
211 |
subtitle => |
197 |
GetRecordValue( 'subtitle', GetMarcBiblio( $c->{biblionumber} ), GetFrameworkCode( $c->{biblionumber} ) ), |
212 |
GetRecordValue( 'subtitle', GetMarcBiblio( $c->{biblionumber} ), GetFrameworkCode( $c->{biblionumber} ) ), |
198 |
lost => $c->{itemlost} ? GetAuthorisedValueByCode( 'LOST', $c->{itemlost} ) : undef, |
213 |
lost => $lost, |
199 |
damaged => $c->{damaged} ? GetAuthorisedValueByCode( 'DAMAGED', $c->{damaged} ) : undef, |
214 |
damaged => $damaged, |
200 |
borrower => { |
215 |
borrower => { |
201 |
surname => $c->{surname}, |
216 |
surname => $c->{surname}, |
202 |
firstname => $c->{firstname}, |
217 |
firstname => $c->{firstname}, |