[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/opac opac-MARCdetail.pl,1.4.2.1,1.4.2.2
From: |
Paul POULAIN |
Subject: |
[Koha-cvs] CVS: koha/opac opac-MARCdetail.pl,1.4.2.1,1.4.2.2 |
Date: |
Thu, 10 Mar 2005 07:52:40 -0800 |
Update of /cvsroot/koha/koha/opac
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16975/opac
Modified Files:
Tag: rel_2_2
opac-MARCdetail.pl
Log Message:
* 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
Index: opac-MARCdetail.pl
===================================================================
RCS file: /cvsroot/koha/koha/opac/opac-MARCdetail.pl,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -C2 -r1.4.2.1 -r1.4.2.2
*** opac-MARCdetail.pl 3 Feb 2005 15:25:28 -0000 1.4.2.1
--- opac-MARCdetail.pl 10 Mar 2005 15:52:37 -0000 1.4.2.2
***************
*** 68,72 ****
$biblionumber = &MARCfind_oldbiblionumber_from_MARCbibid($dbh,$bibid) unless
$biblionumber;
my $itemtype = &MARCfind_frameworkcode($dbh,$bibid);
! my $tagslib = &MARCgettagslib($dbh,1,$itemtype);
my $record =MARCgetbiblio($dbh,$bibid);
--- 68,72 ----
$biblionumber = &MARCfind_oldbiblionumber_from_MARCbibid($dbh,$bibid) unless
$biblionumber;
my $itemtype = &MARCfind_frameworkcode($dbh,$bibid);
! my $tagslib = &MARCgettagslib($dbh,0,$itemtype);
my $record =MARCgetbiblio($dbh,$bibid);
***************
*** 88,119 ****
my @fields = $record->fields();
my @loop_data =();
! foreach my $field (@fields) {
! my @subfields_data;
# 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});
my %subfield_data;
!
$subfield_data{marc_lib}=$tagslib->{$field->tag()}->{'@'}->{lib};
! $subfield_data{marc_value}=$field->data();
$subfield_data{marc_subfield}='@';
! $subfield_data{marc_tag}=$field->tag();
push(@subfields_data, \%subfield_data);
} else {
! my @subf=$field->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});
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_value}="<a
href=\"$subf[$i][1]\">$subf[$i][1]</a>";
} else {
!
$subfield_data{marc_value}=get_authorised_value_desc($field->tag(),
$subf[$i][0], $subf[$i][1], '', $dbh);
}
$subfield_data{marc_subfield}=$subf[$i][0];
! $subfield_data{marc_tag}=$field->tag();
push(@subfields_data, \%subfield_data);
}
--- 88,125 ----
my @fields = $record->fields();
my @loop_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 ($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->{$fields[$x_i]->tag()}->{'@'}->{lib};
! $subfield_data{marc_value}=$fields[$x_i]->data();
$subfield_data{marc_subfield}='@';
! $subfield_data{marc_tag}=$fields[$x_i]->tag();
push(@subfields_data, \%subfield_data);
} else {
! 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->{$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->{$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}="<a
href=\"$subf[$i][1]\">$subf[$i][1]</a>";
} else {
! 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}=$fields[$x_i]->tag();
push(@subfields_data, \%subfield_data);
}
***************
*** 121,127 ****
if ($#subfields_data>=0) {
my %tag_data;
! $tag_data{tag}=$field->tag().' -'.
$tagslib->{$field->tag()}->{lib};
! $tag_data{subfield} = address@hidden;
push (@loop_data, \%tag_data);
}
}
--- 127,139 ----
if ($#subfields_data>=0) {
my %tag_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} = address@hidden;
push (@loop_data, \%tag_data);
+ undef @subfields_data;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/opac opac-MARCdetail.pl,1.4.2.1,1.4.2.2,
Paul POULAIN <=