View | Details | Raw Unified | Return to bug 17250
Collapse All | Expand All

(-)a/C4/Search.pm (-1 / +1 lines)
Lines 1852-1858 sub searchResults { Link Here
1852
    my $shelflocations =GetKohaAuthorisedValues('items.location','');
1852
    my $shelflocations =GetKohaAuthorisedValues('items.location','');
1853
1853
1854
    # get notforloan authorised value list (see $shelflocations  FIXME)
1854
    # get notforloan authorised value list (see $shelflocations  FIXME)
1855
    my $av = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan' });
1855
    my $av = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan', authorised_value => { not => undef } });
1856
    my $notforloan_authorised_value = $av->count ? $av->next->authorised_value : undef;
1856
    my $notforloan_authorised_value = $av->count ? $av->next->authorised_value : undef;
1857
1857
1858
    #Get itemtype hash
1858
    #Get itemtype hash
(-)a/catalogue/detail.pl (-3 / +3 lines)
Lines 195-210 my $copynumbers = GetKohaAuthorisedValues('items.copynumber', $fw); Link Here
195
my (@itemloop, @otheritemloop, %itemfields);
195
my (@itemloop, @otheritemloop, %itemfields);
196
my $norequests = 1;
196
my $norequests = 1;
197
197
198
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost' });
198
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => { not => undef } });
199
if ( $mss->count ) {
199
if ( $mss->count ) {
200
    $template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorised_value ) );
200
    $template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorised_value ) );
201
}
201
}
202
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged' });
202
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged', authorised_value => { not => undef } });
203
if ( $mss->count ) {
203
if ( $mss->count ) {
204
    $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorised_value ) );
204
    $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorised_value ) );
205
}
205
}
206
206
207
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.materials' });
207
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.materials', authorised_value => { not => undef } });
208
my %materials_map;
208
my %materials_map;
209
if ($mss->count) {
209
if ($mss->count) {
210
    my $materials_authvals = GetAuthorisedValues($mss->next->authorised_value);
210
    my $materials_authvals = GetAuthorisedValues($mss->next->authorised_value);
(-)a/catalogue/itemsearch.pl (-3 / +3 lines)
Lines 88-97 my ($template, $borrowernumber, $cookie) = get_template_and_user({ Link Here
88
    flagsrequired   => { catalogue => 1 },
88
    flagsrequired   => { catalogue => 1 },
89
});
89
});
90
90
91
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan' });
91
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan', authorised_value => { not => undef } });
92
my $notforloan_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
92
my $notforloan_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
93
93
94
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.location' });
94
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.location', authorised_value => { not => undef } });
95
my $location_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
95
my $location_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
96
96
97
if (scalar keys %params > 0) {
97
if (scalar keys %params > 0) {
Lines 264-270 if ($format eq 'html') { Link Here
264
        };
264
        };
265
    }
265
    }
266
266
267
    my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.ccode' });
267
    my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.ccode', authorised_value => { not => undef } });
268
    my $ccode_avcode = $mss->count ? $mss->next->authorised_value : 'CCODE';
268
    my $ccode_avcode = $mss->count ? $mss->next->authorised_value : 'CCODE';
269
    my $ccodes = GetAuthorisedValues($ccode_avcode);
269
    my $ccodes = GetAuthorisedValues($ccode_avcode);
270
    my @ccodes;
270
    my @ccodes;
(-)a/catalogue/moredetail.pl (-6 / +6 lines)
Lines 194-210 foreach my $item (@items){ Link Here
194
194
195
}
195
}
196
196
197
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost' });
197
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => { not => undef } });
198
if ( $mss->count ) {
198
if ( $mss->count ) {
199
    $template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorisedvalue ) );
199
    $template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorised_value ) );
200
}
200
}
201
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged' });
201
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged', authorised_value => { not => undef } });
202
if ( $mss->count ) {
202
if ( $mss->count ) {
203
    $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorisedvalue ) );
203
    $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorised_value ) );
204
}
204
}
205
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.withdrawn' });
205
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.withdrawn', authorised_value => { not => undef } });
206
if ( $mss->count ) {
206
if ( $mss->count ) {
207
    $template->param( itemwithdrawnloop => GetAuthorisedValues( $mss->next->authorisedvalue) );
207
    $template->param( itemwithdrawnloop => GetAuthorisedValues( $mss->next->authorised_value) );
208
}
208
}
209
209
210
$template->param(count => $data->{'count'},
210
$template->param(count => $data->{'count'},
(-)a/circ/circulation.pl (-2 / +2 lines)
Lines 341-348 if (@$barcodes) { Link Here
341
    #  Get the item title for more information
341
    #  Get the item title for more information
342
    my $getmessageiteminfo = GetBiblioFromItemNumber(undef,$barcode);
342
    my $getmessageiteminfo = GetBiblioFromItemNumber(undef,$barcode);
343
343
344
    my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $getmessageiteminfo->{frameworkcode}, kohafield => 'items.notforloan' });
344
    my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $getmessageiteminfo->{frameworkcode}, kohafield => 'items.notforloan', authorised_value => { not => undef } });
345
    $template_params->{authvalcode_notforloan} = $mss->count ? $mss->next->authorisedvalue : undef;
345
    $template_params->{authvalcode_notforloan} = $mss->count ? $mss->next->authorised_value : undef;
346
346
347
    # Fix for bug 7494: optional checkout-time fallback search for a book
347
    # Fix for bug 7494: optional checkout-time fallback search for a book
348
348
(-)a/tools/inventory.pl (-3 / +2 lines)
Lines 72-78 $frameworks->{''} = {frameworkcode => ''}; # Add the default framework Link Here
72
72
73
for my $fwk (keys %$frameworks){
73
for my $fwk (keys %$frameworks){
74
  my $fwkcode = $frameworks->{$fwk}->{'frameworkcode'};
74
  my $fwkcode = $frameworks->{$fwk}->{'frameworkcode'};
75
  my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fwkcode, kohafield => 'items.location' });
75
  my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fwkcode, kohafield => 'items.location', authorised_value => { not => undef } });
76
  my $authcode = $mss->count ? $mss->next->authorised_value : undef;
76
  my $authcode = $mss->count ? $mss->next->authorised_value : undef;
77
    if ($authcode && $authorisedvalue_categories!~/\b$authcode\W/){
77
    if ($authcode && $authorisedvalue_categories!~/\b$authcode\W/){
78
      $authorisedvalue_categories.="$authcode ";
78
      $authorisedvalue_categories.="$authcode ";
Lines 88-94 my $statuses = []; Link Here
88
for my $statfield (qw/items.notforloan items.itemlost items.withdrawn items.damaged/){
88
for my $statfield (qw/items.notforloan items.itemlost items.withdrawn items.damaged/){
89
    my $hash = {};
89
    my $hash = {};
90
    $hash->{fieldname} = $statfield;
90
    $hash->{fieldname} = $statfield;
91
    my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => $statfield });
91
    my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => $statfield, authorised_value => { not => undef } });
92
    $hash->{authcode} = $mss->count ? $mss->next->authorised_value : undef;
92
    $hash->{authcode} = $mss->count ? $mss->next->authorised_value : undef;
93
    if ($hash->{authcode}){
93
    if ($hash->{authcode}){
94
        my $arr = GetAuthorisedValues($hash->{authcode});
94
        my $arr = GetAuthorisedValues($hash->{authcode});
95
- 

Return to bug 17250