[Koha-cvs] CVS: koha/C4 Biblio.pm,1.115.2.15,1.115.2.16

Paul POULAIN tipaul at users.sourceforge.net
Thu Jul 28 21:56:19 CEST 2005


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

Modified Files:
      Tag: rel_2_2
	Biblio.pm 
Log Message:
* removing a useless & CPU consuming call to MARCgetbiblio
* Leader management.
If you create a MARC tag "000", with a subfield '@', it will be managed as the leader.
Seems to work correctly.

Now going to create a plugin for leader()

Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.115.2.15
retrieving revision 1.115.2.16
diff -C2 -r1.115.2.15 -r1.115.2.16
*** Biblio.pm	19 Jul 2005 15:25:40 -0000	1.115.2.15
--- Biblio.pm	28 Jul 2005 19:56:15 -0000	1.115.2.16
***************
*** 369,372 ****
--- 369,374 ----
          }
      }
+ 	# save leader
+ 	&MARCaddsubfield($dbh,$bibid,'000','',$fieldcount+1,'',1,$record->leader);
      $dbh->do("unlock tables");
      return $bibid;
***************
*** 479,484 ****
      my $record = MARC::Record->new();
  
-     #---- TODO : the leader is missing
-     $record->leader('                        ');
      my $sth =
        $dbh->prepare(
--- 481,484 ----
***************
*** 508,513 ****
              $previndicator .= "  ";
              if ( $prevtag < 10 ) {
!                 $record->add_fields( ( sprintf "%03s", $prevtag ), $prevvalue )
!                   unless $prevtag eq "XXX";    # ignore the 1st loop
              }
              else {
--- 508,516 ----
              $previndicator .= "  ";
              if ( $prevtag < 10 ) {
! 				if ($prevtag ne '000') {
!                 	$record->add_fields( ( sprintf "%03s", $prevtag ), $prevvalue ) unless $prevtag eq "XXX";    # ignore the 1st loop
! 				} else {
! 					$record->leader(sprintf("%24s",$prevvalue));
! 				}
              }
              else {
***************
*** 628,635 ****
  sub MARCmodbiblio {
  	my ($dbh,$bibid,$record,$frameworkcode,$delete)=@_;
- 	my $oldrecord=&MARCgetbiblio($dbh,$bibid);
- 	if ($oldrecord eq $record) {
- 		return;
- 	}
  # 1st delete the biblio,
  # 2nd recreate it
--- 631,634 ----
***************
*** 1034,1038 ****
  			if ($prevtag < 10) {
  				if ($prevvalue) {
! 					$record->add_fields((sprintf "%03s",$prevtag),$prevvalue);
  				}
  			} else {
--- 1033,1041 ----
  			if ($prevtag < 10) {
  				if ($prevvalue) {
! 					if ($prevtag ne '000') {
! 						$record->add_fields((sprintf "%03s",$prevtag),$prevvalue);
! 					} else {
! 						$record->leader($prevvalue);
! 					}
  				}
  			} else {
***************
*** 2430,2434 ****
      # 	$encoding = C4::Context->preference("marcflavour") unless $encoding;
      if ( $encoding eq "UNIMARC" ) {
!         s/\xe1/Æ/gm;
          s/\xe2/Ð/gm;
          s/\xe9/Ø/gm;
--- 2433,2437 ----
      # 	$encoding = C4::Context->preference("marcflavour") unless $encoding;
      if ( $encoding eq "UNIMARC" ) {
! #         s/\xe1/Æ/gm;
          s/\xe2/Ð/gm;
          s/\xe9/Ø/gm;
***************
*** 2722,2725 ****
--- 2725,2736 ----
  # $Id$
  # $Log$
+ # Revision 1.115.2.16  2005/07/28 19:56:15  tipaul
+ # * removing a useless & CPU consuming call to MARCgetbiblio
+ # * Leader management.
+ # If you create a MARC tag "000", with a subfield '@', it will be managed as the leader.
+ # Seems to work correctly.
+ #
+ # Now going to create a plugin for leader()
+ #
  # Revision 1.115.2.15  2005/07/19 15:25:40  tipaul
  # * fixing a bug in subfield order when MARCgetbiblio





More information about the Koha-cvs mailing list