# 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);
my $userid = $session->param('id');
unless (haspermission($userid, { circulate => 'circulate_remaining_permissions' })
- || haspermission($userid, { borrowers => '*' })) {
+ || haspermission($userid, { borrowers => 'edit_borrowers' })) {
exit 0;
}
items.itype,
biblioitems.itemtype,
+ items.ccode AS collection,
+
borrowernumber,
surname,
firstname,
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} });
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},