[Koha-cvs] CVS: koha/C4 Acquisition.pm,1.17,1.18 AuthoritiesMarc.pm,1.19,1.20 Auth.pm,1.44,1.45 Biblio.pm,1.121,1.122

Paul POULAIN tipaul at users.sourceforge.net
Thu Aug 4 15:27:52 CEST 2005


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

Modified Files:
	Acquisition.pm AuthoritiesMarc.pm Auth.pm Biblio.pm 
Log Message:
synch'ing 2.2 and head

Index: Acquisition.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Acquisition.pm,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** Acquisition.pm	28 Jul 2005 15:40:52 -0000	1.17
--- Acquisition.pm	4 Aug 2005 13:27:47 -0000	1.18
***************
*** 392,412 ****
  	my ($supplierid)=@_;
  	my $dbh = C4::Context->dbh;
! 	
! 	my $strsth ="Select count(*),authorisedby,creationdate,aqbasket.basketno,
! closedate,surname,firstname,aqorders.title 
! from aqorders 
! left join aqbasket on aqbasket.basketno=aqorders.basketno 
! left join borrowers on aqbasket.authorisedby=borrowers.borrowernumber
! where booksellerid=? and (quantity > quantityreceived or
! quantityreceived is NULL) and datecancellationprinted is NULL ";
! 		
! 	if (C4::Context->preference("IndependantBranches")) {
! 		my $userenv = C4::Context->userenv;
! 		unless ($userenv->{flags} == 1){
! 			$strsth .= " and (borrowers.branchcode = '".$userenv->{branch}."' or borrowers.branchcode ='')";
! 		}
! 	}
! 	$strsth.=" group by basketno order by aqbasket.basketno";
! 	my $sth=$dbh->prepare($strsth);
  	$sth->execute($supplierid);
  	my @results = ();
--- 392,403 ----
  	my ($supplierid)=@_;
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("Select count(*),authorisedby,creationdate,aqbasket.basketno,
! 		closedate,surname,firstname 
! 		from aqorders 
! 		left join aqbasket on aqbasket.basketno=aqorders.basketno 
! 		left join borrowers on aqbasket.authorisedby=borrowers.borrowernumber
! 		where booksellerid=? and (quantity > quantityreceived or
! 		quantityreceived is NULL) and datecancellationprinted is NULL
! 		group by basketno order by aqbasket.basketno");
  	$sth->execute($supplierid);
  	my @results = ();
***************
*** 579,583 ****
  	map { push(@searchterms,"$_%","% $_%") } @data;
  	push(@searchterms,$search,$search,$biblio);
! 	my $sth=$dbh->prepare("Select biblio.*,biblioitems.*,aqorders.*,aqbasket.* from aqorders,biblioitems,biblio,aqbasket
  		where aqorders.biblioitemnumber = biblioitems.biblioitemnumber and
  		aqorders.basketno = aqbasket.basketno
--- 570,574 ----
  	map { push(@searchterms,"$_%","% $_%") } @data;
  	push(@searchterms,$search,$search,$biblio);
! 	my $sth=$dbh->prepare("Select biblio.*,biblioitems.*,aqorders.*,aqbasket.*,biblio.title from aqorders,biblioitems,biblio,aqbasket
  		where aqorders.biblioitemnumber = biblioitems.biblioitemnumber and
  		aqorders.basketno = aqbasket.basketno
***************
*** 616,624 ****
  	my ($title,$author,$name,$from_placed_on,$to_placed_on)=@_;
  	my $dbh= C4::Context->dbh;
! 	my $query = "select biblio.title,aqorders.basketno,name,aqbasket.creationdate,aqorders.datereceived, aqorders.quantity, aqorders.ecost from aqorders,aqbasket,aqbooksellers,biblio";
! 	
! 	$query .= ",borrowers " if (C4::Context->preference("IndependantBranches")); 
! 	$query .=" where aqorders.basketno=aqbasket.basketno and aqbasket.booksellerid=aqbooksellers.id and biblio.biblionumber=aqorders.biblionumber ";
! 	$query .= " and aqbasket.authorisedby=borrowers.borrowernumber" if (C4::Context->preference("IndependantBranches"));
  	$query .= " and biblio.title like ".$dbh->quote("%".$title."%") if $title;
  	$query .= " and biblio.author like ".$dbh->quote("%".$author."%") if $author;
--- 607,613 ----
  	my ($title,$author,$name,$from_placed_on,$to_placed_on)=@_;
  	my $dbh= C4::Context->dbh;
! 	my $query = "select biblio.title,aqorders.basketno,name,aqbasket.creationdate,aqorders.datereceived, aqorders.quantity, aqorders.ecost from aqorders,aqbasket,aqbooksellers,biblio 
! where aqorders.basketno=aqbasket.basketno and aqbasket.booksellerid=aqbooksellers.id and
! biblio.biblionumber=aqorders.biblionumber";
  	$query .= " and biblio.title like ".$dbh->quote("%".$title."%") if $title;
  	$query .= " and biblio.author like ".$dbh->quote("%".$author."%") if $author;
***************
*** 626,640 ****
  	$query .= " and creationdate >" .$dbh->quote($from_placed_on) if $from_placed_on;
  	$query .= " and creationdate<".$dbh->quote($to_placed_on) if $to_placed_on;
! 	if (C4::Context->preference("IndependantBranches")) {
! 		my $userenv = C4::Context->userenv;
! 		unless ($userenv->{flags} == 1){
! 			$query .= " and (borrowers.branchcode = '".$userenv->{branch}."' or borrowers.branchcode ='')";
! 		}
! 	}
! #	warn "C4:Acquisition : ".$query;
  	my $sth = $dbh->prepare($query);
  	$sth->execute;
  	my @order_loop;
  	while (my $line = $sth->fetchrow_hashref) {
  		push @order_loop, $line;
  	}
--- 615,625 ----
  	$query .= " and creationdate >" .$dbh->quote($from_placed_on) if $from_placed_on;
  	$query .= " and creationdate<".$dbh->quote($to_placed_on) if $to_placed_on;
! 	warn "C4:Acquisition : ".$query;
  	my $sth = $dbh->prepare($query);
  	$sth->execute;
  	my @order_loop;
+ 	my $cnt=1;
  	while (my $line = $sth->fetchrow_hashref) {
+ 		$line->{count}=$cnt++;
  		push @order_loop, $line;
  	}

Index: AuthoritiesMarc.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/AuthoritiesMarc.pm,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** AuthoritiesMarc.pm	20 Jun 2005 14:10:00 -0000	1.19
--- AuthoritiesMarc.pm	4 Aug 2005 13:27:47 -0000	1.20
***************
*** 159,163 ****
  					my $subfieldvalue = $subf[$i][1];
  					my $tagsubf = $tag.$subfieldcode;
! 					$summary =~ s/\[(.?.?.?)$tagsubf(.*?)]/$1$subfieldvalue$2\[$1$tagsubf$2]/g;
  				}
  			}
--- 159,163 ----
  					my $subfieldvalue = $subf[$i][1];
  					my $tagsubf = $tag.$subfieldcode;
! 					$summary =~ s/\[(.?.?.?.?)$tagsubf(.*?)]/$1$subfieldvalue\[$1$tagsubf$2]$2/g;
  				}
  			}
***************
*** 542,546 ****
  	&AUTHaddauthority($dbh,$record,$authid,AUTHfind_authtypecode($dbh,$authid));
  	# save the file in localfile/modified_authorities
! 	my $filename = C4::Context->config("intranetdir")."/localfile/modified_authorities/$authid.authid";
  	open AUTH, "> $filename";
  	print AUTH $authid;
--- 542,551 ----
  	&AUTHaddauthority($dbh,$record,$authid,AUTHfind_authtypecode($dbh,$authid));
  	# save the file in localfile/modified_authorities
! 	my $cgidir = C4::Context->intranetdir ."/cgi-bin";
! 	unless (opendir(DIR, "$cgidir")) {
! 			$cgidir = C4::Context->intranetdir."/";
! 	} 
! 
! 	my $filename = $cgidir."/localfile/modified_authorities/$authid.authid";
  	open AUTH, "> $filename";
  	print AUTH $authid;
***************
*** 923,937 ****
  # $Id$
  # $Log$
! # Revision 1.19  2005/06/20 14:10:00  tipaul
  # synch'ing 2.2 and head
  #
! # Revision 1.18  2005/06/07 10:00:47  tipaul
! # adding $b to mainentry (in UNIMARC, for personal names, $a is the surname, $b is the firstname)
  #
! # Revision 1.17  2005/06/01 12:51:02  tipaul
! # some fixes & improvements for dictionnary search in librarian interface
  #
! # Revision 1.16  2005/05/04 15:43:43  tipaul
! # synch'ing 2.2 and head
  #
  # Revision 1.9.2.3  2005/04/28 08:45:33  tipaul
--- 928,945 ----
  # $Id$
  # $Log$
! # Revision 1.20  2005/08/04 13:27:47  tipaul
  # synch'ing 2.2 and head
  #
! # Revision 1.9.2.7  2005/08/01 15:14:50  tipaul
! # minor change in summary handling (accepting 4 digits before the field)
  #
! # Revision 1.9.2.6  2005/06/07 10:02:00  tipaul
! # porting dictionnary search from head to 2.2. there is now a ... facing titles, author & subject, to search in biblio & authorities existing values.
  #
! # Revision 1.9.2.5  2005/05/31 14:50:46  tipaul
! # fix for authority merging. There was a bug on official installs
! #
! # Revision 1.9.2.4  2005/05/30 11:24:15  tipaul
! # fixing a bug : when a field was repeated, the last field was also repeated. (Was due to the "empty" field in html between fields : to separate fields, in html, an empty field is automatically added. in AUTHhtml2marc, this empty field was not discarded correctly)
  #
  # Revision 1.9.2.3  2005/04/28 08:45:33  tipaul

Index: Auth.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Auth.pm,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -r1.44 -r1.45
*** Auth.pm	29 Jul 2005 16:14:37 -0000	1.44
--- Auth.pm	4 Aug 2005 13:27:47 -0000	1.45
***************
*** 479,482 ****
--- 479,483 ----
  		my ($md5password,$cardnumber) = $sth->fetchrow;
  		if (md5_base64($password) eq $md5password) {
+ 			C4::Context->set_userenv("$bornum",$userid,$cardnumber,$firstname,$surname,$branchcode,$userflags);
  			return 1,$cardnumber;
  		}
***************
*** 487,494 ****
--- 488,498 ----
  		my ($md5password) = $sth->fetchrow;
  		if (md5_base64($password) eq $md5password) {
+ 			C4::Context->set_userenv($bornum,$userid,$cardnumber,$firstname,$surname,$branchcode,$userflags);
  			return 1,$userid;
  		}
  	}
  	if ($userid eq C4::Context->config('user') && $password eq C4::Context->config('pass')) {
+ 		# Koha superuser account
+ 		C4::Context->set_userenv(0,0,C4::Context->config('user'),C4::Context->config('user'),C4::Context->config('user'),"",1);
  		return 2;
  	}

Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.121
retrieving revision 1.122
diff -C2 -r1.121 -r1.122
*** Biblio.pm	20 Jun 2005 14:10:00 -0000	1.121
--- Biblio.pm	4 Aug 2005 13:27:48 -0000	1.122
***************
*** 369,372 ****
--- 369,374 ----
          }
      }
+ 	# save leader
+ 	&MARCaddsubfield($dbh,$bibid,'000','',$fieldcount+1,'',1,$record->leader);
      $dbh->do("unlock tables");
      return $bibid;
***************
*** 480,490 ****
  #	warn "". $bidid;
  
-     #---- TODO : the leader is missing
-     $record->leader('                        ');
      my $sth =
        $dbh->prepare(
  "select bibid,subfieldid,tag,tagorder,tag_indicator,subfieldcode,subfieldorder,subfieldvalue,valuebloblink
  		 		 from marc_subfield_table
! 		 		 where bibid=? order by tag,tagorder,subfieldcode
  		 	 "
      );
--- 482,490 ----
  #	warn "". $bidid;
  
      my $sth =
        $dbh->prepare(
  "select bibid,subfieldid,tag,tagorder,tag_indicator,subfieldcode,subfieldorder,subfieldvalue,valuebloblink
  		 		 from marc_subfield_table
! 		 		 where bibid=? order by tag,tagorder,subfieldorder
  		 	 "
      );
***************
*** 509,514 ****
              $previndicator .= "  ";
              if ( $prevtag < 10 ) {
!                 $record->add_fields( ( sprintf "%03s", $prevtag ), $prevvalue )
!                   unless $prevtag eq "XXX";    # ignore the 1st loop
              }
              else {
--- 509,517 ----
              $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 {
***************
*** 629,636 ****
  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
--- 632,635 ----
***************
*** 1035,1039 ****
  			if ($prevtag < 10) {
  				if ($prevvalue) {
! 					$record->add_fields((sprintf "%03s",$prevtag),$prevvalue);
  				}
  			} else {
--- 1034,1042 ----
  			if ($prevtag < 10) {
  				if ($prevvalue) {
! 					if ($prevtag ne '000') {
! 						$record->add_fields((sprintf "%03s",$prevtag),$prevvalue);
! 					} else {
! 						$record->leader($prevvalue);
! 					}
  				}
  			} else {
***************
*** 1125,1141 ****
      ( $tagfield, $subfield ) = MARCfind_marc_from_kohafield("",$kohatable.".".$kohafield,$frameworkcode);
      foreach my $field ( $record->field($tagfield) ) {
!         if ( $field->subfields ) {
!             my @subfields = $field->subfields();
!             foreach my $subfieldcount ( 0 .. $#subfields ) {
! 				if ($subfields[$subfieldcount][0] eq $subfield) {
! 					if ( $result->{$kohafield} ) {
! 						$result->{$kohafield} .= " | " . $subfields[$subfieldcount][1];
! 					}
! 					else {
! 						$result->{$kohafield} = $subfields[$subfieldcount][1];
  					}
  				}
  			}
!         }
      }
  # 	warn "OneField for $kohatable.$kohafield and $frameworkcode=> $tagfield, $subfield";
--- 1128,1152 ----
      ( $tagfield, $subfield ) = MARCfind_marc_from_kohafield("",$kohatable.".".$kohafield,$frameworkcode);
      foreach my $field ( $record->field($tagfield) ) {
! 		if ($field->tag()<10) {
! 			if ($result->{$kohafield}) {
! 				$result->{$kohafield} .= " | ".$field->data();
! 			} else {
! 				$result->{$kohafield} = $field->data();
! 			}
! 		} else {
! 			if ( $field->subfields ) {
! 				my @subfields = $field->subfields();
! 				foreach my $subfieldcount ( 0 .. $#subfields ) {
! 					if ($subfields[$subfieldcount][0] eq $subfield) {
! 						if ( $result->{$kohafield} ) {
! 							$result->{$kohafield} .= " | " . $subfields[$subfieldcount][1];
! 						}
! 						else {
! 							$result->{$kohafield} = $subfields[$subfieldcount][1];
! 						}
  					}
  				}
  			}
! 		}
      }
  # 	warn "OneField for $kohatable.$kohafield and $frameworkcode=> $tagfield, $subfield";
***************
*** 1208,1212 ****
      my $olddata = MARCmarc2koha( $dbh, $record,$frameworkcode );
      $oldbibnum = OLDnewbiblio( $dbh, $olddata );
!     $olddata->{'biblionumber'} = $oldbibnum;
      $oldbibitemnum = OLDnewbiblioitem( $dbh, $olddata );
  
--- 1219,1223 ----
      my $olddata = MARCmarc2koha( $dbh, $record,$frameworkcode );
      $oldbibnum = OLDnewbiblio( $dbh, $olddata );
! 	$olddata->{'biblionumber'} = $oldbibnum;
      $oldbibitemnum = OLDnewbiblioitem( $dbh, $olddata );
  
***************
*** 1258,1277 ****
      $sth->execute("biblioitems.biblioitemnumber");
      ( my $tagfield2, my $tagsubfield2 ) = $sth->fetchrow;
      if ( $tagfield1 != $tagfield2 ) {
!         warn
! "Error in NEWnewbiblio : biblio.biblionumber and biblioitems.biblioitemnumber MUST have the same field number";
!         print
! "Content-Type: text/html\n\nError in NEWnewbiblio : biblio.biblionumber and biblioitems.biblioitemnumber MUST have the same field number";
!         die;
!     }
!     my $newfield = MARC::Field->new(
!         $tagfield1, '', '', "$tagsubfield1" => $oldbibnum,
!         "$tagsubfield2" => $oldbibitemnum
!     );
! 
!     # drop old field and create new one...
!     my $old_field = $record->field($tagfield1);
!     $record->delete_field($old_field);
!     $record->add_fields($newfield);
      my $bibid = MARCaddbiblio( $dbh, $record, $oldbibnum, $frameworkcode );
      return ( $bibid, $oldbibnum, $oldbibitemnum );
--- 1269,1315 ----
      $sth->execute("biblioitems.biblioitemnumber");
      ( my $tagfield2, my $tagsubfield2 ) = $sth->fetchrow;
+ 	my $newfield;
+ 	# biblionumber & biblioitemnumber are in different fields
      if ( $tagfield1 != $tagfield2 ) {
! 		# deal with biblionumber
! 		if ($tagfield1<10) {
! 			$newfield = MARC::Field->new(
! 				$tagfield1, $oldbibnum,
! 			);
! 		} else {
! 			$newfield = MARC::Field->new(
! 				$tagfield1, '', '', "$tagsubfield1" => $oldbibnum,
! 			);
! 		}
! 		# drop old field and create new one...
! 		my $old_field = $record->field($tagfield1);
! 		$record->delete_field($old_field);
! 		$record->add_fields($newfield);
! 		# deal with biblioitemnumber
! 		if ($tagfield2<10) {
! 			$newfield = MARC::Field->new(
! 				$tagfield2, $oldbibitemnum,
! 			);
! 		} else {
! 			$newfield = MARC::Field->new(
! 				$tagfield2, '', '', "$tagsubfield2" => $oldbibitemnum,
! 			);
! 		}
! 		# drop old field and create new one...
! 		$old_field = $record->field($tagfield2);
! 		$record->delete_field($old_field);
! 		$record->add_fields($newfield);
! 	# biblionumber & biblioitemnumber are in the same field (can't be <10 as fields <10 have only 1 value)
! 	} else {
! 		my $newfield = MARC::Field->new(
! 			$tagfield1, '', '', "$tagsubfield1" => $oldbibnum,
! 			"$tagsubfield2" => $oldbibitemnum
! 		);
! 		# drop old field and create new one...
! 		my $old_field = $record->field($tagfield1);
! 		$record->delete_field($old_field);
! 		$record->add_fields($newfield);
! 	}
! # 	warn "REC : ".$record->as_formatted;
      my $bibid = MARCaddbiblio( $dbh, $record, $oldbibnum, $frameworkcode );
      return ( $bibid, $oldbibnum, $oldbibitemnum );
***************
*** 1750,1759 ****
      if ( $item->{'dateaccessioned'} ) {
          $sth = $dbh->prepare( "Insert into items set
! 							itemnumber           = ?,				biblionumber         = ?,
! 							biblioitemnumber     = ?,				barcode              = ?,
! 							booksellerid         = ?,					dateaccessioned      = ?,
! 							homebranch           = ?,				holdingbranch        = ?,
! 							price                = ?,						replacementprice     = ?,
! 							replacementpricedate = NOW(),	itemnotes            = ?,
  							itemcallnumber	=?, 							notforloan = ?,
  							location = ?
--- 1788,1801 ----
      if ( $item->{'dateaccessioned'} ) {
          $sth = $dbh->prepare( "Insert into items set
! 							itemnumber           = ?,			biblionumber         = ?,
! 							multivolumepart      = ?,
! 							biblioitemnumber     = ?,			barcode              = ?,
! 							booksellerid         = ?,			dateaccessioned      = ?,
! 							homebranch           = ?,			holdingbranch        = ?,
! 							price                = ?,			replacementprice     = ?,
! 							replacementpricedate = NOW(),		datelastseen		= NOW(),
! 							multivolume			= ?,			stack				= ?,
! 							itemlost			= ?,			wthdrawn			= ?,
! 							paidfor				= ?,			itemnotes            = ?,
  							itemcallnumber	=?, 							notforloan = ?,
  							location = ?
***************
*** 1761,1792 ****
          );
          $sth->execute(
!             $itemnumber,                 $item->{'biblionumber'},
!             $item->{'biblioitemnumber'}, $barcode,
!             $item->{'booksellerid'},     $item->{'dateaccessioned'},
!             $item->{'homebranch'},       $item->{'holdingbranch'},
!             $item->{'price'},            $item->{'replacementprice'},
!             $item->{'itemnotes'},        $item->{'itemcallnumber'},
!             $item->{'notforloan'},		$item->{'location'}
          );
      }
      else {
          $sth = $dbh->prepare( "Insert into items set
! 							itemnumber           = ?,				biblionumber         = ?,
! 							biblioitemnumber     = ?,				barcode              = ?,
! 							booksellerid         = ?,					dateaccessioned      = NOW(),
! 							homebranch           = ?,				holdingbranch        = ?,
! 							price                = ?,						replacementprice     = ?,
! 							replacementpricedate = NOW(),	itemnotes            = ?,
! 							itemcallnumber = ? , notforloan = ?,
  							location = ?
  							"
          );
          $sth->execute(
!             $itemnumber,                 $item->{'biblionumber'},
!             $item->{'biblioitemnumber'}, $barcode,
!             $item->{'booksellerid'},     $item->{'homebranch'},
!             $item->{'holdingbranch'},    $item->{'price'},
!             $item->{'replacementprice'}, $item->{'itemnotes'},
!             $item->{'itemcallnumber'},   $item->{'notforloan'},
  			$item->{'location'}
          );
--- 1803,1846 ----
          );
          $sth->execute(
! 			$itemnumber,				$item->{'biblionumber'},
! 			$item->{'multivolumepart'},
! 			$item->{'biblioitemnumber'},$barcode,
! 			$item->{'booksellerid'},	$item->{'dateaccessioned'},
! 			$item->{'homebranch'},		$item->{'holdingbranch'},
! 			$item->{'price'},			$item->{'replacementprice'},
! 			$item->{multivolume},		$item->{stack},
! 			$item->{itemlost},			$item->{wthdrawn},
! 			$item->{paidfor},			$item->{'itemnotes'},
! 			$item->{'itemcallnumber'},	$item->{'notforloan'},
! 			$item->{'location'}
          );
      }
      else {
          $sth = $dbh->prepare( "Insert into items set
! 							itemnumber           = ?,			biblionumber         = ?,
! 							multivolumepart      = ?,
! 							biblioitemnumber     = ?,			barcode              = ?,
! 							booksellerid         = ?,			dateaccessioned      = NOW(),
! 							homebranch           = ?,			holdingbranch        = ?,
! 							price                = ?,			replacementprice     = ?,
! 							replacementpricedate = NOW(),		datelastseen		= NOW(),
! 							multivolume			= ?,			stack				= ?,
! 							itemlost			= ?,			wthdrawn			= ?,
! 							paidfor				= ?,			itemnotes            = ?,
! 							itemcallnumber	=?, 							notforloan = ?,
  							location = ?
  							"
          );
          $sth->execute(
! 			$itemnumber,				$item->{'biblionumber'},
! 			$item->{'multivolumepart'},
! 			$item->{'biblioitemnumber'},$barcode,
! 			$item->{'booksellerid'},
! 			$item->{'homebranch'},		$item->{'holdingbranch'},
! 			$item->{'price'},			$item->{'replacementprice'},
! 			$item->{multivolume},		$item->{stack},
! 			$item->{itemlost},			$item->{wthdrawn},
! 			$item->{paidfor},			$item->{'itemnotes'},
! 			$item->{'itemcallnumber'},	$item->{'notforloan'},
  			$item->{'location'}
          );
***************
*** 1801,1824 ****
  sub OLDmoditem {
      my ( $dbh, $item ) = @_;
- 
- #  my ($dbh,$loan,$itemnum,$bibitemnum,$barcode,$notes,$homebranch,$lost,$wthdrawn,$replacement)=@_;
-     #  my $dbh=C4Connect;
      $item->{'itemnum'} = $item->{'itemnumber'} unless $item->{'itemnum'};
!     my $query = "update items set  barcode=?,itemnotes=?,itemcallnumber=?,notforloan=?,location=? where itemnumber=?";
      my @bind = (
!         $item->{'barcode'},        $item->{'notes'},
!         $item->{'itemcallnumber'}, $item->{'notforloan'},
!         $item->{'location'},	   $item->{'itemnum'}
      );
      if ( $item->{'lost'} ne '' ) {
!         $query = "update items set biblioitemnumber=?,
!                              barcode=?,
!                              itemnotes=?,
!                              homebranch=?,
!                              itemlost=?,
!                              wthdrawn=?,
! 			     itemcallnumber=?,
! 			     notforloan=?,
! 				 location=?";
          @bind = (
              $item->{'bibitemnum'},     $item->{'barcode'},
--- 1855,1871 ----
  sub OLDmoditem {
      my ( $dbh, $item ) = @_;
      $item->{'itemnum'} = $item->{'itemnumber'} unless $item->{'itemnum'};
!     my $query = "update items set  barcode=?,itemnotes=?,itemcallnumber=?,notforloan=?,location=?,multivolumepart=?,multivolume=?,stack=?,wthdrawn=?";
      my @bind = (
!         $item->{'barcode'},			$item->{'notes'},
!         $item->{'itemcallnumber'},	$item->{'notforloan'},
!         $item->{'location'},		$item->{multivolumepart},
! 		$item->{multivolume},		$item->{stack},
! 		$item->{wthdrawn},
      );
      if ( $item->{'lost'} ne '' ) {
!         $query = "update items set biblioitemnumber=?,barcode=?,itemnotes=?,homebranch=?,
! 							itemlost=?,wthdrawn=?,itemcallnumber=?,notforloan=?,
! 				 			location=?,multivolumepart=?,multivolume=?,stack=?,wthdrawn=?";
          @bind = (
              $item->{'bibitemnum'},     $item->{'barcode'},
***************
*** 1826,1830 ****
              $item->{'lost'},           $item->{'wthdrawn'},
              $item->{'itemcallnumber'}, $item->{'notforloan'},
!             $item->{'location'},		$item->{'itemnum'}
          );
  		if ($item->{homebranch}) {
--- 1873,1879 ----
              $item->{'lost'},           $item->{'wthdrawn'},
              $item->{'itemcallnumber'}, $item->{'notforloan'},
!             $item->{'location'},		$item->{multivolumepart},
! 			$item->{multivolume},		$item->{stack},
! 			$item->{wthdrawn},
          );
  		if ($item->{homebranch}) {
***************
*** 1836,1842 ****
  			push @bind, $item->{holdingbranch};
  		}
- 		$query.=" where itemnumber=?";
      }
!     if ( $item->{'replacement'} ne '' ) {
          $query =~ s/ where/,replacementprice='$item->{'replacement'}' where/;
      }
--- 1885,1892 ----
  			push @bind, $item->{holdingbranch};
  		}
      }
! 	$query.=" where itemnumber=?";
! 	push @bind,$item->{'itemnum'};
!    if ( $item->{'replacement'} ne '' ) {
          $query =~ s/ where/,replacementprice='$item->{'replacement'}' where/;
      }
***************
*** 2069,2085 ****
      my $dbh = C4::Context->dbh;
      my $error = &OLDmodsubject( $dbh, $bibnum, $force, @subject );
!         if ($error eq ''){
!     # When MARC is off, ensures that the MARC biblio table gets updated with new
!     # subjects, of course, it deletes the biblio in marc, and then recreates.
!     # This check is to ensure that no MARC data exists to lose.
! 
!         if (C4::Context->preference("MARC") eq '0'){
!             my $MARCRecord = &MARCkoha2marcBiblio($dbh,$bibnum);
!             my $bibid = &MARCfind_MARCbibid_from_oldbiblionumber($dbh,$bibnum);
!             &MARCmodbiblio($dbh,$bibid, $MARCRecord);
!         }
! 
!     }
!     return ($error);
  }    # sub modsubject
  
--- 2119,2133 ----
      my $dbh = C4::Context->dbh;
      my $error = &OLDmodsubject( $dbh, $bibnum, $force, @subject );
!     if ($error eq ''){
! 		# When MARC is off, ensures that the MARC biblio table gets updated with new
! 		# subjects, of course, it deletes the biblio in marc, and then recreates.
! 		# This check is to ensure that no MARC data exists to lose.
! 		if (C4::Context->preference("MARC") eq '0'){
! 			my $MARCRecord = &MARCkoha2marcBiblio($dbh,$bibnum);
! 			my $bibid = &MARCfind_MARCbibid_from_oldbiblionumber($dbh,$bibnum);
! 			&MARCmodbiblio($dbh,$bibid, $MARCRecord);
! 		}
! 	}
! 	return ($error);
  }    # sub modsubject
  
***************
*** 2398,2402 ****
      # 	$encoding = C4::Context->preference("marcflavour") unless $encoding;
      if ( $encoding eq "UNIMARC" ) {
!         s/\xe1/Æ/gm;
          s/\xe2/Ð/gm;
          s/\xe9/Ø/gm;
--- 2446,2450 ----
      # 	$encoding = C4::Context->preference("marcflavour") unless $encoding;
      if ( $encoding eq "UNIMARC" ) {
! #         s/\xe1/Æ/gm;
          s/\xe2/Ð/gm;
          s/\xe9/Ø/gm;
***************
*** 2444,2453 ****
--- 2492,2507 ----
          s/\xc4\x6e/ñ/gm;
          s/\xc4\x6f/õ/gm;
+         s/\xc8\x41/Ä/gm;
          s/\xc8\x45/Ë/gm;
          s/\xc8\x49/Ï/gm;
+         s/\xc8\x61/ä/gm;
          s/\xc8\x65/ë/gm;
          s/\xc8\x69/ï/gm;
+         s/\xc8\x6F/ö/gm;
+         s/\xc8\x75/ü/gm;
          s/\xc8\x76/ÿ/gm;
          s/\xc9\x41/Ä/gm;
+         s/\xc9\x45/Ë/gm;
+         s/\xc9\x49/Ï/gm;
          s/\xc9\x4f/Ö/gm;
          s/\xc9\x55/Ü/gm;
***************
*** 2633,2636 ****
--- 2687,2691 ----
  	return;
  }
+ 
  sub DisplayISBN {
  	my ($isbn)=@_;
***************
*** 2668,2671 ****
--- 2723,2728 ----
  	return "$seg1-$seg2-$seg3-$seg4";
  }
+ 
+ 
  END { }    # module clean-up code here (global destructor)
  
***************
*** 2682,2696 ****
  # $Id$
  # $Log$
! # Revision 1.121  2005/06/20 14:10:00  tipaul
  # synch'ing 2.2 and head
  #
! # Revision 1.120  2005/06/15 16:09:43  hdl
! # Displaying dashed isbn.
  #
! # Revision 1.119  2005/06/01 20:43:58  genjimoto
  # patch from Genji (Waylon R.) to update subjects in MARC tables when systempref has MARC=OFF
  #
! # Revision 1.118  2005/05/04 15:40:01  tipaul
! # synch'ing 2.2 and head
  #
  # Revision 1.115.2.9  2005/04/07 10:05:25  tipaul
--- 2739,2781 ----
  # $Id$
  # $Log$
! # Revision 1.122  2005/08/04 13:27:48  tipaul
  # synch'ing 2.2 and head
  #
! # Revision 1.115.2.18  2005/08/02 07:45:44  tipaul
! # fix for bug http://bugs.koha.org/cgi-bin/bugzilla/show_bug.cgi?id=1009
! # (Not all items fields mapped to MARC)
! #
! # Revision 1.115.2.17  2005/08/01 15:15:43  tipaul
! # adding decoder for Ä string
! #
! # 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
! # * getting rid with the limit "biblionumber & biblioitemnumber must be in the same tag". So, we can put biblionumber in 001 (field that has no subfields, so we can't put biblioitemnumber in this field), and use biblionumber as identifier in the MARC biblio too. Still to be deeply tested.
! # * adding some diacritic decoding (Ä, Ü...)
! #
! # Revision 1.115.2.14  2005/06/27 23:24:06  hdl
! # Display dashed ISBN
  #
! # Revision 1.115.2.13  2005/05/31 12:44:26  tipaul
  # patch from Genji (Waylon R.) to update subjects in MARC tables when systempref has MARC=OFF
  #
! # Revision 1.115.2.12  2005/05/30 11:22:41  tipaul
! # fixing a bug : when a field was repeated, the last field was also repeated. (Was due to the "empty" field in html between fields : to separate fields, in html, an empty field is automatically added. in MARChtml2marc, this empty field was not discarded correctly)
! #
! # Revision 1.115.2.11  2005/05/25 15:48:43  tipaul
! # * removing my for variables already declared
! # * updating biblio.unititle  field as well as other fields in biblio table
! #
! # Revision 1.115.2.10  2005/05/25 09:30:50  hdl
! # Adding NEWmodbiblioframework feature
! # Used by addbiblio.pl when modifying a framework selection.
  #
  # Revision 1.115.2.9  2005/04/07 10:05:25  tipaul





More information about the Koha-cvs mailing list