koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha ISBDdetail.pl,1.2,1.3


From: Paul POULAIN
Subject: [Koha-cvs] CVS: koha ISBDdetail.pl,1.2,1.3
Date: Mon, 25 Oct 2004 06:28:26 -0700

Update of /cvsroot/koha/koha
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18291

Modified Files:
        ISBDdetail.pl 
Log Message:
rewritting ISBD (doc coming soon...)

Index: ISBDdetail.pl
===================================================================
RCS file: /cvsroot/koha/koha/ISBDdetail.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** ISBDdetail.pl       13 Jul 2004 12:55:01 -0000      1.2
--- ISBDdetail.pl       25 Oct 2004 13:28:23 -0000      1.3
***************
*** 72,92 ****
  
  my $ISBD = C4::Context->preference('ISBD');
! my @fields = $record->fields();
! foreach my $field (@fields) {
!       my $tag = $field->tag();
!       if ($tag<10) {
!       } else {
!               my @subf = $field->subfields;
!               for my $i (0..$#subf) {
!                       my $subfieldcode = $subf[$i][0];
!                       my $subfieldvalue = $subf[$i][1];
!                       my $tagsubf = $tag.$subfieldcode;
!                       $ISBD =~ 
s/\[(.?.?.?)$tagsubf(.*?)]/$1$subfieldvalue\[$1$tagsubf$2]$2$3/g;
                }
        }
! }
! $ISBD =~ s/\[(.*?)]//g;
! $ISBD =~ s/\n/<br>/g;
! $template->param(ISBD => $ISBD,
                                biblionumber => $biblionumber);
  
--- 72,131 ----
  
  my $ISBD = C4::Context->preference('ISBD');
! # my @blocs = split /\@/,$ISBD;
! # my @fields = $record->fields();
! my $res;
! # foreach my $bloc (@blocs) {
! #     $bloc =~ s/\n//g;
!       my $bloc = $ISBD;
!       my $blocres;
!       foreach my $isbdfield (split /#/,$bloc) {
!       warn "ISBDFIELD : $isbdfield";
! #             $isbdfield= /(.?.?.?)/;
!               $isbdfield =~ /(\d\d\d)\|(.*)\|(.*)\|(.*)/;
!               my $fieldvalue=$1;
!               my $textbefore=$2;
!               my $analysestring=$3;
!               my $textafter=$4;
! #             warn "==> $1 / $2 / $3 / $4";
! #             my $fieldvalue=substr($isbdfield,0,3);
!               if ($fieldvalue>0) {
!       #               warn "ERROR IN ISBD DEFINITION at : $isbdfield" unless 
$fieldvalue;
! #                     warn "FV : $fieldvalue";
!                       my $hasputtextbefore=0;
!                       foreach my $field ($record->field($fieldvalue)) {
!                               my $calculated = $analysestring;
!                               my $tag = $field->tag();
!                               if ($tag<10) {
!                               } else {
!                                       my @subf = $field->subfields;
!                                       for my $i (0..$#subf) {
!                                               my $subfieldcode = $subf[$i][0];
!                                               my $subfieldvalue = 
$subf[$i][1];
!                                               my $tagsubf = 
$tag.$subfieldcode;
!                                               $calculated =~ 
s/\{(.?.?.?)$tagsubf(.*?)\}/$1$subfieldvalue\{$1$tagsubf$2\}$2/g;
!                                       }
!                                       # field builded, store the result
!                                       if ($calculated && !$hasputtextbefore) 
{ # put textbefore if not done
!                                               $blocres .=$textbefore;
!                                               $hasputtextbefore=1
!                                       }
!                                       # remove punctuation at start
!                                       $calculated =~ s/^( |;|:|\.|-)*//g;
!                                       $blocres.=$calculated;
!                               }
!                       }
!                       $blocres .=$textafter if $hasputtextbefore;
!               } else {
!                       $blocres.=$isbdfield;
                }
        }
!       $res.=$blocres;
! # }
! $res =~ s/\{(.*?)\}//g;
! $res =~ s/\\n/\n/g;
! $res =~ s/\n/<br\/>/g;
! # remove empty ()
! $res =~ s/\(\)//g;
! $template->param(ISBD => $res,
                                biblionumber => $biblionumber);
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]