From 5a35a5b386f65b098294d2fda674da9607a5264d Mon Sep 17 00:00:00 2001 From: hdl Date: Fri, 18 Mar 2005 15:52:27 +0000 Subject: [PATCH] Minor Bug Fixing --- .../en/value_builder/unimarc_field_4XX.tmpl | 10 +++---- value_builder/unimarc_field_4XX.pl | 30 +++---------------- 2 files changed, 9 insertions(+), 31 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/default/en/value_builder/unimarc_field_4XX.tmpl b/koha-tmpl/intranet-tmpl/default/en/value_builder/unimarc_field_4XX.tmpl index d046670dd0..c0d15fe70e 100644 --- a/koha-tmpl/intranet-tmpl/default/en/value_builder/unimarc_field_4XX.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/value_builder/unimarc_field_4XX.tmpl @@ -9,7 +9,7 @@ var whichfield = opener.opener.document.f.tag[index_start].value; i=index_start // go forward, until reaching the end of the field. - while (i<=opener.opener.document.f.field_value.length) { + while (i"; } @@ -26,7 +26,7 @@ } if (opener.opener.document.f.tag[i].value == whichfield && opener.opener.document.f.subfield[i].value == 'd') { - opener.opener.document.f.field_value[i].value = ""; + opener.opener.document.f.field_value[i].value = ""; } if (opener.opener.document.f.tag[i].value == whichfield && opener.opener.document.f.subfield[i].value == 'e') { @@ -73,10 +73,10 @@ i=index_start while (i>=0) { if (opener.opener.document.f.tag[i].value == whichfield && opener.opener.document.f.subfield[i].value == '0') { - opener.opener.document.f.field_value[i].value = ""; + opener.opener.document.f.field_value[i].value = ""; } if (opener.opener.document.f.tag[i].value == whichfield && opener.opener.document.f.subfield[i].value == 'e') { diff --git a/value_builder/unimarc_field_4XX.pl b/value_builder/unimarc_field_4XX.pl index e94e6bbd5c..055f7d6840 100755 --- a/value_builder/unimarc_field_4XX.pl +++ b/value_builder/unimarc_field_4XX.pl @@ -96,14 +96,10 @@ sub plugin { my $req= $dbh->prepare("SELECT distinctrow bibid,biblionumber FROM `marc_biblio` WHERE biblionumber= ?"); $req->execute($bibnum); ($bibid,$bibnum) = $req->fetchrow; -# warn "bibid :".$bibid; + #warn "bibid :".$bibid; #get marc record $marcrecord = MARCgetbiblio($dbh,$bibid); -# warn "record : ".$marcrecord->as_formatted; -# my @loop_data =(); -# my $tag; -# my @loop_data =(); -# my @subfields_data; + warn "record : ".$marcrecord->as_formatted; my $subfield_value_9=$bibid; my $subfield_value_0=$marcrecord->field('001')->data; @@ -119,7 +115,7 @@ sub plugin { my $subfield_value_d; if ($marcrecord->field('100')){ my $publicationdate; - warn "date de publication 1".substr($marcrecord->field('100')->subfield("a"),9,4)." date de publication 2 ".substr($marcrecord->field('100')->subfield("a"),12,4); + #warn "date de publication 1".substr($marcrecord->field('100')->subfield("a"),9,4)." date de publication 2 ".substr($marcrecord->field('100')->subfield("a"),12,4); $publicationdate = substr($marcrecord->field('100')->subfield("a"),9,4); if (substr($marcrecord->field('100')->subfield("a"),12,4)>$publicationdate){ $publicationdate=substr($marcrecord->field('100')->subfield("a"),12,4); @@ -168,26 +164,8 @@ sub plugin { my $subfield_value_x = $marcrecord->field('011')->subfield("a") if ($marcrecord->field('011') and not (($marcrecord->field('011')->subfield("y")) or ($marcrecord->field('011')->subfield("z")))); my $subfield_value_y = $marcrecord->field('013')->subfield("a") if ($marcrecord->field('013')); if ($marcrecord->field('010')){ - my $subfield_value_y = $marcrecord->field('010')->subfield("a"); + $subfield_value_y = $marcrecord->field('010')->subfield("a"); } -# my @subf; -# #=(a,c,d,e,h,i,p,t,u,v,x,y,0,9); -# # loop through each subfield -# for my $i (0..$#subf) { -# $subf[$i][0] = "@" unless $subf[$i][0]; -# my %subfield_data; -# $subfield_data{marc_value}=$subf[$i][1]; -# $subfield_data{marc_subfield}=$subf[$i][0]; -# $subfield_data{marc_tag}="";#$field->tag(); -# push(@subfields_data, \%subfield_data); -# } -# if ($#subfields_data>=0) { -# my %tag_data; -# $tag_data{tag}="";#$field->tag().' -'. ""; -# $tag_data{subfield} = \@subfields_data; -# push (@loop_data, \%tag_data); -# } -# $template->param("0XX" =>\@loop_data); $template->param(fillinput => 1, index => $query->param('index')."", bibid=>$bibid?$bibid:"", -- 2.39.5