X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=svc%2Fcheckouts;h=9a1b3a5648c23df43c2237a871847d111090e1c0;hb=refs%2Fheads%2Fkoha_ffzg;hp=d8d615694249445935b1a804934a8508bb9e038c;hpb=091d6c513bcbee224ff06477e79be48cea7fe825;p=koha.git diff --git a/svc/checkouts b/svc/checkouts index d8d6156942..9a1b3a5648 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -17,8 +17,7 @@ # with Koha; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -use strict; -use warnings; +use Modern::Perl; use CGI; use JSON qw(to_json); @@ -42,7 +41,7 @@ my $session = get_session($sessionID); my $userid = $session->param('id'); unless (haspermission($userid, { circulate => 'circulate_remaining_permissions' }) - || haspermission($userid, { borrowers => '*' })) { + || haspermission($userid, { borrowers => 'edit_borrowers' })) { exit 0; } @@ -91,6 +90,8 @@ my $sql = ' items.itype, biblioitems.itemtype, + items.ccode AS collection, + borrowernumber, surname, firstname, @@ -155,6 +156,11 @@ while ( my $c = $sth->fetchrow_hashref() ) { my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $c->{location} }); $location = $av->count ? $av->next->lib : ''; } + my $collection; + if ( $c->{collection} ) { + my $av = Koha::AuthorisedValues->search({ category => 'CCODE', authorised_value => $c->{collection} }); + $collection = $av->count ? $av->next->lib : ''; + } my $lost; if ( $c->{itemlost} ) { my $av = Koha::AuthorisedValues->search({ category => 'LOST', authorised_value => $c->{itemlost} }); @@ -171,7 +177,8 @@ while ( my $c = $sth->fetchrow_hashref() ) { author => $c->{author}, barcode => $c->{barcode}, itemtype => $item_level_itypes ? $c->{itype} : $c->{itemtype}, - itemtype_description => $itemtype->translated_description, + itemtype_description => $itemtype ? $itemtype->translated_description : q{}, + collection => $collection, location => $location, homebranch => $c->{homebranch}, itemnotes => $c->{itemnotes}, @@ -209,8 +216,10 @@ while ( my $c = $sth->fetchrow_hashref() ) { as_due_date => 1 } ), - subtitle => - GetRecordValue( 'subtitle', GetMarcBiblio( $c->{biblionumber} ), GetFrameworkCode( $c->{biblionumber} ) ), + subtitle => GetRecordValue( + 'subtitle', + GetMarcBiblio({ biblionumber => $c->{biblionumber} }), + GetFrameworkCode( $c->{biblionumber} ) ), lost => $lost, damaged => $damaged, borrower => {