From 34c8fd7a6afc61806fe6bdb7e58779eeb1839604 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Tue, 16 Oct 2007 16:02:41 -0500 Subject: [PATCH] adding YUI tabs support to authority detail Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- authorities/detail.pl | 20 ++- .../prog/en/modules/authorities/detail.tmpl | 127 +++++++----------- 2 files changed, 61 insertions(+), 86 deletions(-) diff --git a/authorities/detail.pl b/authorities/detail.pl index 52df8dcba5..4c3b2f542f 100755 --- a/authorities/detail.pl +++ b/authorities/detail.pl @@ -367,16 +367,19 @@ sub build_tabs ($$$$$) { if ( $record ne -1 && ( $record->field($tag) || $tag eq '000' ) ) { my @fields; if ( $tag ne '000' ) { - @fields = $record->field($tag); + @fields = $record->field($tag); } else { push @fields, $record->leader(); # if tag == 000 } - # loop through each field + # loop through each field foreach my $field (@fields) { - my @subfields_data; if ($field->tag()<10) { + next + if ( + $tagslib->{ $field->tag() }->{ '@' }->{tab} + ne $tabloop ); next if ($tagslib->{$field->tag()}->{'@'}->{hidden}); my %subfield_data; $subfield_data{marc_lib}=$tagslib->{$field->tag()}->{'@'}->{lib}; @@ -389,7 +392,13 @@ sub build_tabs ($$$$$) { # loop through each subfield for my $i (0..$#subf) { $subf[$i][0] = "@" unless $subf[$i][0]; - next if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{hidden}); + next + if ( + $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{tab} + ne $tabloop ); + next + if ( $tagslib->{ $field->tag() }->{ $subf[$i][0] } + ->{hidden} ); my %subfield_data; $subfield_data{marc_lib}=$tagslib->{$field->tag()}->{$subf[$i][0]}->{lib}; if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{isurl}) { @@ -410,7 +419,7 @@ sub build_tabs ($$$$$) { } if ($#subfields_data>=0) { my %tag_data; - $tag_data{tag}=$field->tag().' -'. $tagslib->{$field->tag()}->{lib}; + $tag_data{tag}=$field->tag().' - '. $tagslib->{$field->tag()}->{lib}; $tag_data{subfield} = \@subfields_data; push (@loop_data, \%tag_data); } @@ -418,6 +427,7 @@ sub build_tabs ($$$$$) { } } if ( $#loop_data >= 0 ) { + warn "pushing : $tabloop = ".Data::Dumper::Dumper(@loop_data); push @BIG_LOOP, { number => $tabloop, innerloop => \@loop_data, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tmpl index 355e8a804e..27d8be04eb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tmpl @@ -3,6 +3,12 @@