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 798-819 foreach my $field (@fields) { Link Here
798
        }
798
        }
799
        $this_row{itemnumber} = $subfieldvalue if ($field->tag() eq $itemtagfield && $subfieldcode eq $itemtagsubfield);
799
        $this_row{itemnumber} = $subfieldvalue if ($field->tag() eq $itemtagfield && $subfieldcode eq $itemtagsubfield);
800
800
801
	if ( C4::Context->preference('EasyAnalyticalRecords') ) {
801
        if ( C4::Context->preference('EasyAnalyticalRecords') ) {
802
	    foreach my $hostitemnumber (@hostitemnumbers){
802
            foreach my $hostitemnumber (@hostitemnumbers) {
803
            my $item = Koha::Items->find( $hostitemnumber );
803
                my $item = Koha::Items->find( $hostitemnumber );
804
		if ($this_row{itemnumber} eq $hostitemnumber){
804
                if ($this_row{itemnumber} eq $hostitemnumber) {
805
			$this_row{hostitemflag} = 1;
805
                    $this_row{hostitemflag} = 1;
806
            $this_row{hostbiblionumber}= $item->biblio->biblionumber;
806
                    $this_row{hostbiblionumber}= $item->biblio->biblionumber;
807
			last;
807
                    last;
808
		}
808
                }
809
	    }
809
            }
810
810
        }
811
#	    my $countanalytics=GetAnalyticsCount($this_row{itemnumber});
812
#           if ($countanalytics > 0){
813
#                $this_row{countanalytics} = $countanalytics;
814
#           }
815
	}
816
817
    }
811
    }
818
    if (%this_row) {
812
    if (%this_row) {
819
        push(@big_array, \%this_row);
813
        push(@big_array, \%this_row);
820
- 

Return to bug 20697