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

(-)a/C4/Items.pm (-11 / +27 lines)
Lines 770-787 sub GetItemsInfo { Link Here
770
770
771
        my $descriptions;
771
        my $descriptions;
772
        # get notforloan complete status if applicable
772
        # get notforloan complete status if applicable
773
        $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode => $data->{frameworkcode}, kohafield => 'items.notforloan', authorised_value => $data->{itemnotforloan} });
773
        if (exists $av_cache->{$data->{frameworkcode}}->{'items.notforloan'}->{$data->{itemnotforloan}} ){
774
        $data->{notforloanvalue}     = $descriptions->{lib} // '';
774
            $data->{notforloanvalue} = $av_cache->{$data->{frameworkcode}}->{'items.notforloan'}->{$data->{itemnotforloan}}->{lib};
775
        $data->{notforloanvalueopac} = $descriptions->{opac_description} // '';
775
            $data->{notforloanvalueopac} = $av_cache->{$data->{frameworkcode}}->{'items.notforloan'}->{$data->{itemnotforloan}}->{opac_description};
776
776
        }else{  
777
            $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode => $data->{frameworkcode}, kohafield => 'items.notforloan', authorised_value => $data->{itemnotforloan} });
778
            $data->{notforloanvalue}     = $descriptions->{lib} // '';
779
            $data->{notforloanvalueopac} = $descriptions->{opac_description} // '';
780
            $av_cache->{$data->{frameworkcode}}->{'items.notforloan'}->{$data->{itemnotforloan}}->{lib} = $data->{notforloanvalue};
781
            $av_cache->{$data->{frameworkcode}}->{'items.notforloan'}->{$data->{itemnotforloan}}->{opac_description} = $data->{notforloanvalueopac};
782
        }
777
        # get restricted status and description if applicable
783
        # get restricted status and description if applicable
778
        $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode => $data->{frameworkcode}, kohafield => 'items.restricted', authorised_value => $data->{restricted} });
784
        if (exists $av_cache->{$data->{frameworkcode}}->{'items.restricted'}->{$data->{restricted}} ) {
779
        $data->{restrictedvalue}     = $descriptions->{lib} // '';
785
            $data->{restrictedvalue}     = $av_cache->{$data->{frameworkcode}}->{'items.restricted'}->{$data->{restricted}}->{lib};
780
        $data->{restrictedvalueopac} = $descriptions->{opac_description} // '';
786
            $data->{restrictedvalueopac} = $av_cache->{$data->{frameworkcode}}->{'items.restricted'}->{$data->{restricted}}->{opac_description};
781
787
        }else{
788
            $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode => $data->{frameworkcode}, kohafield => 'items.restricted', authorised_value => $data->{restricted} });
789
            $data->{restrictedvalue}     = $descriptions->{lib} // '';
790
            $data->{restrictedvalueopac} = $descriptions->{opac_description} // '';
791
            $av_cache->{$data->{frameworkcode}}->{'items.restricted'}->{$data->{restricted}}->{lib} = $data->{restrictedvalue} ;
792
            $av_cache->{$data->{frameworkcode}}->{'items.restricted'}->{$data->{restricted}}->{opac_description} = $data->{restrictedvalueopac};
793
        }
782
        # my stack procedures
794
        # my stack procedures
783
        $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode => $data->{frameworkcode}, kohafield => 'items.stack', authorised_value => $data->{stack} });
795
        if (exists $av_cache->{$data->{frameworkcode}}->{'items.stack'}->{$data->{stack}} ) {
784
        $data->{stack}          = $descriptions->{lib} // '';
796
            $data->{stack}  = $av_cache->{$data->{frameworkcode}}->{'items.stack'}->{$data->{stack}}->{lib};
797
        }else{
798
            $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode => $data->{frameworkcode}, kohafield => 'items.stack', authorised_value => $data->{stack} });
799
            $data->{stack}          = $descriptions->{lib} // '';
800
            $av_cache->{$data->{frameworkcode}}->{'items.stack'}->{$data->{stack}}->{lib} = $data->{stack};
801
        }
785
802
786
        # Find the last 3 people who borrowed this item.
803
        # Find the last 3 people who borrowed this item.
787
        my $sth2 = $dbh->prepare("SELECT * FROM old_issues,borrowers
804
        my $sth2 = $dbh->prepare("SELECT * FROM old_issues,borrowers
788
- 

Return to bug 26587