diff --git a/C4/Biblio.pm b/C4/Biblio.pm index c023c4ec3e..6c22bcabc8 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -241,13 +241,13 @@ sub MARCgettagslib { $frameworkcode = "" unless ( $total > 0 ); $sth = $dbh->prepare( -"select tagfield,$libfield as lib,mandatory,repeatable from marc_tag_structure where frameworkcode=? order by tagfield" +"select tagfield,liblibrarian,libopac,mandatory,repeatable from marc_tag_structure where frameworkcode=? order by tagfield" ); $sth->execute($frameworkcode); - my ( $lib, $tag, $res, $tab, $mandatory, $repeatable ); + my ( $liblibrarian, $libopac, $tag, $res, $tab, $mandatory, $repeatable ); - while ( ( $tag, $lib, $mandatory, $repeatable ) = $sth->fetchrow ) { - $res->{$tag}->{lib} = $lib; + while ( ( $tag, $liblibrarian, $libopac, $mandatory, $repeatable ) = $sth->fetchrow ) { + $res->{$tag}->{lib} = ($forlibrarian or !$libopac)?$liblibrarian:$libopac; $res->{$tab}->{tab} = ""; # XXX $res->{$tag}->{mandatory} = $mandatory; $res->{$tag}->{repeatable} = $repeatable; @@ -255,7 +255,7 @@ sub MARCgettagslib { $sth = $dbh->prepare( -"select tagfield,tagsubfield,$libfield as lib,tab, mandatory, repeatable,authorised_value,authtypecode,value_builder,kohafield,seealso,hidden,isurl,link from marc_subfield_structure where frameworkcode=? order by tagfield,tagsubfield" +"select tagfield,tagsubfield,liblibrarian,libopac,tab, mandatory, repeatable,authorised_value,authtypecode,value_builder,kohafield,seealso,hidden,isurl,link from marc_subfield_structure where frameworkcode=? order by tagfield,tagsubfield" ); $sth->execute($frameworkcode); @@ -270,14 +270,14 @@ sub MARCgettagslib { my $link; while ( - ( $tag, $subfield, $lib, $tab, + ( $tag, $subfield, $liblibrarian, , $libopac, $tab, $mandatory, $repeatable, $authorised_value, $authtypecode, $value_builder, $kohafield, $seealso, $hidden, $isurl, $link ) = $sth->fetchrow ) { - $res->{$tag}->{$subfield}->{lib} = $lib; + $res->{$tag}->{$subfield}->{lib} = ($forlibrarian or !$libopac)?$liblibrarian:$libopac; $res->{$tag}->{$subfield}->{tab} = $tab; $res->{$tag}->{$subfield}->{mandatory} = $mandatory; $res->{$tag}->{$subfield}->{repeatable} = $repeatable; @@ -2618,6 +2618,11 @@ Paul POULAIN paul.poulain@free.fr # $Id$ # $Log$ +# Revision 1.115.2.7 2005/03/10 15:52:28 tipaul +# * adding glass to opac marc detail. +# * changing glasses behaviour : It now appears only on subfields that have a "link" value. Avoid useless glasses and removes nothing. **** WARNING **** : if you don't change you MARC parameters, glasses DISAPPEAR, because no subfields have a link value. So you MUST "reactivate" them manually. If you want to enable the search glass on field 225$a (collection in UNIMARC), just put 225a to "link" field (Koha >> parameters >> framework >> 225 field >> subfield >> modify $a >> enter 225a in link input field (without quotes or anything else) +# * fixing bug with libopac +# # Revision 1.115.2.6 2005/03/09 15:56:01 tipaul # Changing MARCmoditem to be like MARCmodbiblio : a modif is a delete & create. # Longer, but solves problems with repeated subfields. diff --git a/MARCdetail.pl b/MARCdetail.pl index 37866b0a2b..d6a3627ea2 100755 --- a/MARCdetail.pl +++ b/MARCdetail.pl @@ -73,6 +73,7 @@ my $itemtype = &MARCfind_frameworkcode($dbh,$bibid); my $tagslib = &MARCgettagslib($dbh,1,$itemtype); my $record =MARCgetbiblio($dbh,$bibid); +warn "".$record->as_formatted."\n"; # open template my ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "catalogue/MARCdetail.tmpl", diff --git a/koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl b/koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl index 67c150cc59..6c14100258 100644 --- a/koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl @@ -6,6 +6,9 @@ " class="button catalogue"> Edit biblio + &op=duplicate" class="button catalogue"> + Duplicate + " class="button catalogue"> Edit item @@ -82,16 +85,14 @@

+ + &operator==&type=intranet&value="> + //images/filefind.png" height="15" title="Search on "> + + " class="button catalogue">Auth @@ -112,16 +113,14 @@

+ + &operator==&type=intranet&value="> + //images/filefind.png" height="15" title="Search on "> + + " class="button catalogue">Auth @@ -142,16 +141,14 @@

+ + &operator==&type=intranet&value="> + //images/filefind.png" height="15" title="Search on "> + + " class="button catalogue">Auth @@ -172,16 +169,14 @@

+ + &operator==&type=intranet&value="> + //images/filefind.png" height="15" title="Search on "> + + " class="button catalogue">Auth @@ -202,16 +197,14 @@

+ + &operator==&type=intranet&value="> + //images/filefind.png" height="15" title="Search on "> + + " class="button catalogue">Auth @@ -232,16 +225,14 @@

+ + &operator==&type=intranet&value="> + //images/filefind.png" height="15" title="Search on "> + + " class="button catalogue">Auth @@ -262,16 +253,14 @@

+ + &operator==&type=intranet&value="> + //images/filefind.png" height="15" title="Search on "> + + " class="button catalogue">Auth @@ -292,16 +281,14 @@

+ + &operator==&type=intranet&value="> + //images/filefind.png" height="15" title="Search on "> + + " class="button catalogue">Auth @@ -322,16 +309,14 @@

+ + &operator==&type=intranet&value="> + //images/filefind.png" height="15" title="Search on "> + + " class="button catalogue">Auth @@ -352,16 +337,14 @@

+ + &operator==&type=intranet&value="> + //images/filefind.png" height="15" title="Search on "> + + " class="button catalogue">Auth diff --git a/koha-tmpl/opac-tmpl/css/en/opac-MARCdetail.tmpl b/koha-tmpl/opac-tmpl/css/en/opac-MARCdetail.tmpl index f978da80b5..e724f7d08f 100644 --- a/koha-tmpl/opac-tmpl/css/en/opac-MARCdetail.tmpl +++ b/koha-tmpl/opac-tmpl/css/en/opac-MARCdetail.tmpl @@ -64,9 +64,11 @@

+

+

+ + &operator==&type=intranet&value="> + ///images/filefind.png" height="15" title="Search on "> + +

@@ -81,9 +88,11 @@
+

+

+ + &operator==&type=intranet&value="> + ///images/filefind.png" height="15" title="Search on "> + +

@@ -98,9 +112,11 @@
+

+

+ + &operator==&type=intranet&value="> + ///images/filefind.png" height="15" title="Search on "> + +

@@ -115,9 +136,11 @@
+

+

+ + &operator==&type=intranet&value="> + ///images/filefind.png" height="15" title="Search on "> + +

@@ -132,9 +160,11 @@
+

+

+ + &operator==&type=intranet&value="> + ///images/filefind.png" height="15" title="Search on "> + +

@@ -149,9 +184,11 @@
+

+

+ + &operator==&type=intranet&value="> + ///images/filefind.png" height="15" title="Search on "> + +

@@ -166,9 +208,11 @@
+

+

+ + &operator==&type=intranet&value="> + ///images/filefind.png" height="15" title="Search on "> + +

@@ -183,9 +232,11 @@
+

+

+ + &operator==&type=intranet&value="> + ///images/filefind.png" height="15" title="Search on "> + +

@@ -200,9 +256,11 @@
+

+

+ + &operator==&type=intranet&value="> + ///images/filefind.png" height="15" title="Search on "> + +

@@ -217,9 +280,11 @@
+

+

+ + &operator==&type=intranet&value="> + ///images/filefind.png" height="15" title="Search on "> + +

diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index 231e78764d..3df6dd5779 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -67,7 +67,7 @@ my $bibid = $query->param('bibid'); $bibid = &MARCfind_MARCbibid_from_oldbiblionumber($dbh,$biblionumber) unless $bibid; $biblionumber = &MARCfind_oldbiblionumber_from_MARCbibid($dbh,$bibid) unless $biblionumber; my $itemtype = &MARCfind_frameworkcode($dbh,$bibid); -my $tagslib = &MARCgettagslib($dbh,1,$itemtype); +my $tagslib = &MARCgettagslib($dbh,0,$itemtype); my $record =MARCgetbiblio($dbh,$bibid); # open template @@ -87,42 +87,54 @@ for (my $tabloop = 0; $tabloop<=10;$tabloop++) { # loop through each tag my @fields = $record->fields(); my @loop_data =(); - foreach my $field (@fields) { - my @subfields_data; +# foreach my $field (@fields) { + my @subfields_data; + for (my $x_i=0;$x_i<=$#fields;$x_i++) { +# warn "$tabloop => $x_i"; # if tag <10, there's no subfield, use the "@" trick - if ($field->tag()<10) { - next if ($tagslib->{$field->tag()}->{'@'}->{tab} ne $tabloop); - next if ($tagslib->{$field->tag()}->{'@'}->{hidden}); + if ($fields[$x_i]->tag()<10) { + next if ($tagslib->{$fields[$x_i]->tag()}->{'@'}->{tab} ne $tabloop); + next if ($tagslib->{$fields[$x_i]->tag()}->{'@'}->{hidden}); my %subfield_data; - $subfield_data{marc_lib}=$tagslib->{$field->tag()}->{'@'}->{lib}; - $subfield_data{marc_value}=$field->data(); + $subfield_data{marc_lib}=$tagslib->{$fields[$x_i]->tag()}->{'@'}->{lib}; + $subfield_data{marc_value}=$fields[$x_i]->data(); $subfield_data{marc_subfield}='@'; - $subfield_data{marc_tag}=$field->tag(); + $subfield_data{marc_tag}=$fields[$x_i]->tag(); push(@subfields_data, \%subfield_data); } else { - my @subf=$field->subfields; + my @subf=$fields[$x_i]->subfields; # loop through each subfield for my $i (0..$#subf) { $subf[$i][0] = "@" unless $subf[$i][0]; - next if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{tab} ne $tabloop); - next if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{hidden}); + next if ($tagslib->{$fields[$x_i]->tag()}->{$subf[$i][0]}->{tab} ne $tabloop); + next if ($tagslib->{$fields[$x_i]->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}) { + $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}; + if ($tagslib->{$fields[$x_i]->tag()}->{$subf[$i][0]}->{isurl}) { $subfield_data{marc_value}="$subf[$i][1]"; } else { - $subfield_data{marc_value}=get_authorised_value_desc($field->tag(), $subf[$i][0], $subf[$i][1], '', $dbh); + if ($tagslib->{$fields[$x_i]->tag()}->{$subf[$i][0]}->{authtypecode}) { + $subfield_data{authority}=$fields[$x_i]->subfield(9); + } + $subfield_data{marc_value}=get_authorised_value_desc($fields[$x_i]->tag(), $subf[$i][0], $subf[$i][1], '', $dbh); } $subfield_data{marc_subfield}=$subf[$i][0]; - $subfield_data{marc_tag}=$field->tag(); + $subfield_data{marc_tag}=$fields[$x_i]->tag(); push(@subfields_data, \%subfield_data); } } if ($#subfields_data>=0) { my %tag_data; - $tag_data{tag}=$field->tag().' -'. $tagslib->{$field->tag()}->{lib}; - $tag_data{subfield} = \@subfields_data; + 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}; + } + my @tmp = @subfields_data; + $tag_data{subfield} = \@tmp; push (@loop_data, \%tag_data); + undef @subfields_data; } } $template->param($tabloop."XX" =>\@loop_data);