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

(-)a/C4/Search.pm (-1 / +1 lines)
Lines 1865-1871 sub searchResults { Link Here
1865
      { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' } ) };
1865
      { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' } ) };
1866
1866
1867
    # get notforloan authorised value list (see $shelflocations  FIXME)
1867
    # get notforloan authorised value list (see $shelflocations  FIXME)
1868
    my $av = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan', authorised_value => { not => undef } });
1868
    my $av = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
1869
    my $notforloan_authorised_value = $av->count ? $av->next->authorised_value : undef;
1869
    my $notforloan_authorised_value = $av->count ? $av->next->authorised_value : undef;
1870
1870
1871
    #Get itemtype hash
1871
    #Get itemtype hash
(-)a/catalogue/detail.pl (-2 / +2 lines)
Lines 203-213 my $copynumbers = Link Here
203
my (@itemloop, @otheritemloop, %itemfields);
203
my (@itemloop, @otheritemloop, %itemfields);
204
my $norequests = 1;
204
my $norequests = 1;
205
205
206
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => { not => undef } });
206
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
207
if ( $mss->count ) {
207
if ( $mss->count ) {
208
    $template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorised_value ) );
208
    $template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorised_value ) );
209
}
209
}
210
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged', authorised_value => { not => undef } });
210
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
211
if ( $mss->count ) {
211
if ( $mss->count ) {
212
    $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorised_value ) );
212
    $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorised_value ) );
213
}
213
}
(-)a/catalogue/itemsearch.pl (-3 / +3 lines)
Lines 97-106 my ($template, $borrowernumber, $cookie) = get_template_and_user({ Link Here
97
    flagsrequired   => { catalogue => 1 },
97
    flagsrequired   => { catalogue => 1 },
98
});
98
});
99
99
100
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan', authorised_value => { not => undef } });
100
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
101
my $notforloan_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
101
my $notforloan_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
102
102
103
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.location', authorised_value => { not => undef } });
103
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.location', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
104
my $location_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
104
my $location_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
105
105
106
if (scalar keys %params > 0) {
106
if (scalar keys %params > 0) {
Lines 284-290 foreach my $itemtype ( Koha::ItemTypes->search ) { Link Here
284
    };
284
    };
285
}
285
}
286
286
287
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.ccode', authorised_value => { not => undef } });
287
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.ccode', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
288
my $ccode_avcode = $mss->count ? $mss->next->authorised_value : 'CCODE';
288
my $ccode_avcode = $mss->count ? $mss->next->authorised_value : 'CCODE';
289
my $ccodes = GetAuthorisedValues($ccode_avcode);
289
my $ccodes = GetAuthorisedValues($ccode_avcode);
290
my @ccodes;
290
my @ccodes;
(-)a/catalogue/moredetail.pl (-3 / +3 lines)
Lines 190-204 foreach my $item (@items){ Link Here
190
    }
190
    }
191
}
191
}
192
192
193
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => { not => undef } });
193
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
194
if ( $mss->count ) {
194
if ( $mss->count ) {
195
    $template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorised_value ) );
195
    $template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorised_value ) );
196
}
196
}
197
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged', authorised_value => { not => undef } });
197
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
198
if ( $mss->count ) {
198
if ( $mss->count ) {
199
    $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorised_value ) );
199
    $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorised_value ) );
200
}
200
}
201
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.withdrawn', authorised_value => { not => undef } });
201
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.withdrawn', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
202
if ( $mss->count ) {
202
if ( $mss->count ) {
203
    $template->param( itemwithdrawnloop => GetAuthorisedValues( $mss->next->authorised_value) );
203
    $template->param( itemwithdrawnloop => GetAuthorisedValues( $mss->next->authorised_value) );
204
}
204
}
(-)a/circ/circulation.pl (-1 / +1 lines)
Lines 350-356 if (@$barcodes) { Link Here
350
350
351
    if ( $item ) {
351
    if ( $item ) {
352
        $biblio = $item->biblio;
352
        $biblio = $item->biblio;
353
        my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $biblio->frameworkcode, kohafield => 'items.notforloan', authorised_value => { not => undef } });
353
        my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $biblio->frameworkcode, kohafield => 'items.notforloan', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
354
        $template_params->{authvalcode_notforloan} = $mss->count ? $mss->next->authorised_value : undef;
354
        $template_params->{authvalcode_notforloan} = $mss->count ? $mss->next->authorised_value : undef;
355
    }
355
    }
356
356
(-)a/tools/inventory.pl (-3 / +2 lines)
Lines 71-77 unshift @$frameworks, { frameworkcode => '' }; Link Here
71
71
72
for my $fwk ( @$frameworks ){
72
for my $fwk ( @$frameworks ){
73
  my $fwkcode = $fwk->{frameworkcode};
73
  my $fwkcode = $fwk->{frameworkcode};
74
  my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fwkcode, kohafield => 'items.location', authorised_value => { not => undef } });
74
  my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fwkcode, kohafield => 'items.location', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
75
  my $authcode = $mss->count ? $mss->next->authorised_value : undef;
75
  my $authcode = $mss->count ? $mss->next->authorised_value : undef;
76
    if ($authcode && $authorisedvalue_categories!~/\b$authcode\W/){
76
    if ($authcode && $authorisedvalue_categories!~/\b$authcode\W/){
77
      $authorisedvalue_categories.="$authcode ";
77
      $authorisedvalue_categories.="$authcode ";
Lines 88-94 my @notforloans; 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, authorised_value => { not => undef } });
91
    my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => $statfield, authorised_value => [ -and => {'!=' => 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 20067