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

(-)a/catalogue/detail.pl (-1 / +1 lines)
Lines 298-304 foreach my $item (@items) { Link Here
298
    }
298
    }
299
	
299
	
300
    #count if item is used in analytical bibliorecords
300
    #count if item is used in analytical bibliorecords
301
    my $countanalytics= GetAnalyticsCount($item->{itemnumber});
301
    my $countanalytics = C4::Context->preference('EasyAnalyticalRecords') ? GetAnalyticsCount($item->{itemnumber}) : 0;
302
    if ($countanalytics > 0){
302
    if ($countanalytics > 0){
303
        $analytics_flag=1;
303
        $analytics_flag=1;
304
        $item->{countanalytics} = $countanalytics;
304
        $item->{countanalytics} = $countanalytics;
(-)a/cataloguing/additem.pl (-17 / +10 lines)
Lines 793-814 foreach my $field (@fields) { Link Here
793
        }
793
        }
794
        $this_row{itemnumber} = $subfieldvalue if ($field->tag() eq $itemtagfield && $subfieldcode eq $itemtagsubfield);
794
        $this_row{itemnumber} = $subfieldvalue if ($field->tag() eq $itemtagfield && $subfieldcode eq $itemtagsubfield);
795
795
796
	if ( C4::Context->preference('EasyAnalyticalRecords') ) {
796
        if ( C4::Context->preference('EasyAnalyticalRecords') ) {
797
	    foreach my $hostitemnumber (@hostitemnumbers){
797
            foreach my $hostitemnumber (@hostitemnumbers) {
798
            my $item = Koha::Items->find( $hostitemnumber );
798
                my $item = Koha::Items->find( $hostitemnumber );
799
		if ($this_row{itemnumber} eq $hostitemnumber){
799
                if ($this_row{itemnumber} eq $hostitemnumber) {
800
			$this_row{hostitemflag} = 1;
800
                    $this_row{hostitemflag} = 1;
801
            $this_row{hostbiblionumber}= $item->biblio->biblionumber;
801
                    $this_row{hostbiblionumber}= $item->biblio->biblionumber;
802
			last;
802
                    last;
803
		}
803
                }
804
	    }
804
            }
805
805
        }
806
#	    my $countanalytics=GetAnalyticsCount($this_row{itemnumber});
807
#           if ($countanalytics > 0){
808
#                $this_row{countanalytics} = $countanalytics;
809
#           }
810
	}
811
812
    }
806
    }
813
    if (%this_row) {
807
    if (%this_row) {
814
        push(@big_array, \%this_row);
808
        push(@big_array, \%this_row);
815
- 

Return to bug 20697