my $shelflocations =GetKohaAuthorisedValues('items.location','');
# get notforloan authorised value list (see $shelflocations FIXME)
- my $av = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan' });
+ my $av = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan', authorised_value => { not => undef } });
my $notforloan_authorised_value = $av->count ? $av->next->authorised_value : undef;
#Get itemtype hash
my (@itemloop, @otheritemloop, %itemfields);
my $norequests = 1;
-my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost' });
+my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => { not => undef } });
if ( $mss->count ) {
$template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorised_value ) );
}
-$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged' });
+$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged', authorised_value => { not => undef } });
if ( $mss->count ) {
$template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorised_value ) );
}
-$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.materials' });
+$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.materials', authorised_value => { not => undef } });
my %materials_map;
if ($mss->count) {
my $materials_authvals = GetAuthorisedValues($mss->next->authorised_value);
flagsrequired => { catalogue => 1 },
});
-my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan' });
+my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan', authorised_value => { not => undef } });
my $notforloan_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
-$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.location' });
+$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.location', authorised_value => { not => undef } });
my $location_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
if (scalar keys %params > 0) {
};
}
- my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.ccode' });
+ my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.ccode', authorised_value => { not => undef } });
my $ccode_avcode = $mss->count ? $mss->next->authorised_value : 'CCODE';
my $ccodes = GetAuthorisedValues($ccode_avcode);
my @ccodes;
}
-my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost' });
+my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => { not => undef } });
if ( $mss->count ) {
- $template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorisedvalue ) );
+ $template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorised_value ) );
}
-$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged' });
+$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged', authorised_value => { not => undef } });
if ( $mss->count ) {
- $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorisedvalue ) );
+ $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorised_value ) );
}
-$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.withdrawn' });
+$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.withdrawn', authorised_value => { not => undef } });
if ( $mss->count ) {
- $template->param( itemwithdrawnloop => GetAuthorisedValues( $mss->next->authorisedvalue) );
+ $template->param( itemwithdrawnloop => GetAuthorisedValues( $mss->next->authorised_value) );
}
$template->param(count => $data->{'count'},
# Get the item title for more information
my $getmessageiteminfo = GetBiblioFromItemNumber(undef,$barcode);
- my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $getmessageiteminfo->{frameworkcode}, kohafield => 'items.notforloan' });
- $template_params->{authvalcode_notforloan} = $mss->count ? $mss->next->authorisedvalue : undef;
+ my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $getmessageiteminfo->{frameworkcode}, kohafield => 'items.notforloan', authorised_value => { not => undef } });
+ $template_params->{authvalcode_notforloan} = $mss->count ? $mss->next->authorised_value : undef;
# Fix for bug 7494: optional checkout-time fallback search for a book
for my $fwk (keys %$frameworks){
my $fwkcode = $frameworks->{$fwk}->{'frameworkcode'};
- my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fwkcode, kohafield => 'items.location' });
+ my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fwkcode, kohafield => 'items.location', authorised_value => { not => undef } });
my $authcode = $mss->count ? $mss->next->authorised_value : undef;
if ($authcode && $authorisedvalue_categories!~/\b$authcode\W/){
$authorisedvalue_categories.="$authcode ";
for my $statfield (qw/items.notforloan items.itemlost items.withdrawn items.damaged/){
my $hash = {};
$hash->{fieldname} = $statfield;
- my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => $statfield });
+ my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => $statfield, authorised_value => { not => undef } });
$hash->{authcode} = $mss->count ? $mss->next->authorised_value : undef;
if ($hash->{authcode}){
my $arr = GetAuthorisedValues($hash->{authcode});