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 146-151
while ( my $c = $sth->fetchrow_hashref() ) {
Link Here
|
146 |
GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} ); |
146 |
GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} ); |
147 |
|
147 |
|
148 |
my $itemtype = C4::Koha::getitemtypeinfo( $item_level_itypes ? $c->{itype} : $c->{itemtype} ); |
148 |
my $itemtype = C4::Koha::getitemtypeinfo( $item_level_itypes ? $c->{itype} : $c->{itemtype} ); |
|
|
149 |
my $location; |
150 |
if ( $c->{location} ) { |
151 |
my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $c->{location} }); |
152 |
$location = $av->count ? $av->next->lib : ''; |
153 |
} |
154 |
my $lost; |
155 |
if ( $c->{itemlost} ) { |
156 |
my $av = Koha::AuthorisedValues->search({ category => 'LOST', authorised_value => $c->{itemlost} }); |
157 |
$lost = $av->count ? $av->next->lib : ''; |
158 |
} |
159 |
my $damaged; |
160 |
if ( $c->{damaged} ) { |
161 |
my $av = Koha::AuthorisedValues->search({ category => 'DAMAGED', authorised_value => $c->{damaged} }); |
162 |
$damaged = $av->count ? $av->next->lib : ''; |
163 |
} |
149 |
my $checkout = { |
164 |
my $checkout = { |
150 |
DT_RowId => $c->{itemnumber} . '-' . $c->{borrowernumber}, |
165 |
DT_RowId => $c->{itemnumber} . '-' . $c->{borrowernumber}, |
151 |
title => $c->{title}, |
166 |
title => $c->{title}, |
Lines 153-159
while ( my $c = $sth->fetchrow_hashref() ) {
Link Here
|
153 |
barcode => $c->{barcode}, |
168 |
barcode => $c->{barcode}, |
154 |
itemtype => $item_level_itypes ? $c->{itype} : $c->{itemtype}, |
169 |
itemtype => $item_level_itypes ? $c->{itype} : $c->{itemtype}, |
155 |
itemtype_description => $itemtype->{translated_description}, |
170 |
itemtype_description => $itemtype->{translated_description}, |
156 |
location => $c->{location} ? GetAuthorisedValueByCode( 'LOC', $c->{location} ) : q{}, |
171 |
location => $location |
157 |
itemnotes => $c->{itemnotes}, |
172 |
itemnotes => $c->{itemnotes}, |
158 |
itemnotes_nonpublic => $c->{itemnotes_nonpublic}, |
173 |
itemnotes_nonpublic => $c->{itemnotes_nonpublic}, |
159 |
branchcode => $c->{branchcode}, |
174 |
branchcode => $c->{branchcode}, |
Lines 190-197
while ( my $c = $sth->fetchrow_hashref() ) {
Link Here
|
190 |
), |
205 |
), |
191 |
subtitle => |
206 |
subtitle => |
192 |
GetRecordValue( 'subtitle', GetMarcBiblio( $c->{biblionumber} ), GetFrameworkCode( $c->{biblionumber} ) ), |
207 |
GetRecordValue( 'subtitle', GetMarcBiblio( $c->{biblionumber} ), GetFrameworkCode( $c->{biblionumber} ) ), |
193 |
lost => $c->{itemlost} ? GetAuthorisedValueByCode( 'LOST', $c->{itemlost} ) : undef, |
208 |
lost => $lost, |
194 |
damaged => $c->{damaged} ? GetAuthorisedValueByCode( 'DAMAGED', $c->{damaged} ) : undef, |
209 |
damaged => $damaged, |
195 |
borrower => { |
210 |
borrower => { |
196 |
surname => $c->{surname}, |
211 |
surname => $c->{surname}, |
197 |
firstname => $c->{firstname}, |
212 |
firstname => $c->{firstname}, |