X-Git-Url: http://git.rot13.org/?p=koha-bibliografija;a=blobdiff_plain;f=html.pl;fp=html.pl;h=8467a5591c30bf55389836ce4701a9257162a7f0;hp=b6f4861b9da58ece73cfa35909bdaafc845e379c;hb=18d433ab44358cf0393da0f95754d3f17d669013;hpb=5457430c95ec95ca258f3bf977b533ae823dade5 diff --git a/html.pl b/html.pl index b6f4861..8467a55 100755 --- a/html.pl +++ b/html.pl @@ -601,7 +601,7 @@ debug 'department_category_author' => $department_category_author; sub department_html { - my ( $fh, $department, $type, $label ) = @_; + my ( $fh, $department, $type, $label, $csv_fh ) = @_; print $fh qq|

$label

\n|; @@ -614,10 +614,24 @@ sub department_html { next unless @biblionumber; - my $label = $category_label->{$category} || 'Bez kategorije'; - print $fh qq|

$label

\n
    \n|; + my $cat_label = $category_label->{$category} || 'Bez kategorije'; + print $fh qq|

    $cat_label

    \n
      \n|; + + foreach my $bib_num ( @biblionumber ) { + my @li = li_biblio( $bib_num ); + my $li_html = join('', @li); + $li_html =~ s{
      }{}g; + print $fh $li_html; - print $fh li_biblio( $_ ) foreach @biblionumber; + next unless $csv_fh; + + my $year = $li[1]; + my $html = $li[4]; + $html =~ s{
      }{\t}gs; +# $html =~ s{]*>}{}gs; + $html =~ s{\s+$}{}gs; + print $csv_fh "$bib_num\t$year\t$type\t$label\t$category\t$cat_label\t$html\n"; + } print $fh qq|
    |; } @@ -644,16 +658,24 @@ foreach my $department ( sort keys %$department_category_author ) { } html_year_selection $fh => @authids; + my $csv_fh; + if ( $department eq 'AAA_ukupno' ) { + open($csv_fh, '>:encoding(utf-8)', "html/departments/$department.csv"); + } + my $i = 0; while ( $i < $#toc_type_label ) { my $type = $toc_type_label[$i++] || die "type"; my $label = $toc_type_label[$i++] || die "label"; - department_html( $fh, $department, $type, $label ); + department_html( $fh, $department, $type, $label, $csv_fh ); } + close($csv_fh) if $csv_fh; + print $fh html_end; close($fh); rename "html/departments/$dep_file.new", "html/departments/$dep_file.html"; + } print $dep_fh qq|\n|, html_end; close($dep_fh);