From 393434630a3f493b7116d41463b719700c07c5f4 Mon Sep 17 00:00:00 2001 From: tipaul Date: Tue, 25 Oct 2005 12:41:13 +0000 Subject: [PATCH] using hide_marc systempreference to hide/show tag/subfields code --- MARCdetail.pl | 8 +++++++- .../default/en/catalogue/MARCdetail.tmpl | 20 +++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/MARCdetail.pl b/MARCdetail.pl index 982204d489..6c3dd59e11 100755 --- a/MARCdetail.pl +++ b/MARCdetail.pl @@ -141,6 +141,7 @@ for (my $tabloop = 0; $tabloop<=10;$tabloop++) { my %subfield_data; $subfield_data{marc_lib}=$tagslib->{$fields[$x_i]->tag()}->{$subf[$i][0]}->{lib}; $subfield_data{link}=$tagslib->{$fields[$x_i]->tag()}->{$subf[$i][0]}->{link}; + $subf[$i][1] =~ s/\n//g; if ($tagslib->{$fields[$x_i]->tag()}->{$subf[$i][0]}->{isurl}) { $subfield_data{marc_value}="$subf[$i][1]"; } elsif ($tagslib->{$fields[$x_i]->tag()}->{$subf[$i][0]}->{kohafield} eq "biblioitems.isbn") { @@ -166,7 +167,11 @@ for (my $tabloop = 0; $tabloop<=10;$tabloop++) { if ($fields[$x_i]->tag() eq $fields[$x_i-1]->tag()) { $tag_data{tag}=""; } else { - $tag_data{tag}=$fields[$x_i]->tag().' -'. $tagslib->{$fields[$x_i]->tag()}->{lib}; + if (C4::Context->preference('hide_marc')) { + $tag_data{tag}=$tagslib->{$fields[$x_i]->tag()}->{lib}; + } else { + $tag_data{tag}=$fields[$x_i]->tag().' -'. $tagslib->{$fields[$x_i]->tag()}->{lib}; + } } my @tmp = @subfields_data; $tag_data{subfield} = \@tmp; @@ -234,6 +239,7 @@ $template->param(item_loop => \@item_value_loop, biblionumber => $biblionumber, subscriptionsnumber => $subscriptionsnumber, popup => $popup, + hide_marc => C4::Context->preference('hide_marc'), ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl b/koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl index a2de3ae23f..d4b8559b21 100644 --- a/koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl @@ -94,7 +94,7 @@

@@ -122,7 +122,7 @@

@@ -150,7 +150,7 @@

@@ -178,7 +178,7 @@

@@ -206,7 +206,7 @@

@@ -234,7 +234,7 @@

@@ -262,7 +262,7 @@

@@ -290,7 +290,7 @@

@@ -318,7 +318,7 @@

@@ -346,7 +346,7 @@

-- 2.39.5