[Koha-cvs] CVS: koha/authorities authorities.pl,1.5,1.6 blinddetail-biblio-search.pl,1.2,1.3

Paul POULAIN tipaul at users.sourceforge.net
Mon Sep 13 17:21:03 CEST 2004


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

Modified Files:
	authorities.pl blinddetail-biblio-search.pl 
Log Message:
fixes for authorities

Index: authorities.pl
===================================================================
RCS file: /cvsroot/koha/koha/authorities/authorities.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** authorities.pl	18 Aug 2004 16:05:42 -0000	1.5
--- authorities.pl	13 Sep 2004 15:21:00 -0000	1.6
***************
*** 161,165 ****
  sub build_tabs ($$$$) {
      my($template, $record, $dbh,$encoding) = @_;
! warn "=>".$record->as_formatted;
      # fill arrays
      my @loop_data =();
--- 161,165 ----
  sub build_tabs ($$$$) {
      my($template, $record, $dbh,$encoding) = @_;
! # warn "=>".$record->as_formatted;
      # fill arrays
      my @loop_data =();
***************
*** 335,339 ****
  	my $record = AUTHhtml2marc($dbh,\@tags,\@subfields,\@values,%indicators);
  # MARC::Record built => now, record in DB
- 	warn "IN ADD : ".$record->as_formatted();
  	if ($is_a_modif) {
  		 AUTHmodauthority($dbh,$authid,$record,$authtypecode);
--- 335,338 ----

Index: blinddetail-biblio-search.pl
===================================================================
RCS file: /cvsroot/koha/koha/authorities/blinddetail-biblio-search.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** blinddetail-biblio-search.pl	18 Aug 2004 16:05:42 -0000	1.2
--- blinddetail-biblio-search.pl	13 Sep 2004 15:21:00 -0000	1.3
***************
*** 62,66 ****
  
  my $auth_type = AUTHgetauth_type($authtypecode);
! warn "XX = ".$auth_type->{auth_tag_to_report};
  
  my $record =AUTHgetauthority($dbh,$authid);
--- 62,66 ----
  
  my $auth_type = AUTHgetauth_type($authtypecode);
! # warn "XX = ".$auth_type->{auth_tag_to_report};
  
  my $record =AUTHgetauthority($dbh,$authid);
***************
*** 79,101 ****
  my $tag;
  my @loop_data =();
! foreach my $field ($record->fields($auth_type->{auth_tag_to_report})) {
! 		my @subfields_data;
! 		my @subf=$field->subfields;
! 	# 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().' -'. $tagslib->{$field->tag()}->{lib};
  		$tag_data{subfield} = \@subfields_data;
  		push (@loop_data, \%tag_data);
! 	}
  }
  $template->param("0XX" =>\@loop_data);
  
--- 79,119 ----
  my $tag;
  my @loop_data =();
! if ($authid) {
! 	foreach my $field ($record->fields($auth_type->{auth_tag_to_report})) {
! 			my @subfields_data;
! 			my @subf=$field->subfields;
! 		# 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().' -'. $tagslib->{$field->tag()}->{lib};
! 			$tag_data{subfield} = \@subfields_data;
! 			push (@loop_data, \%tag_data);
! 		}
  	}
! } else {
! # authid is empty => the user want to empty the entry.
! 	my @subfields_data;
! 	foreach my $subfield ('a'..'z') {
! 			my %subfield_data;
! 			$subfield_data{marc_value}='';
! 			$subfield_data{marc_subfield}=$subfield;
! 			push(@subfields_data, \%subfield_data);
! 		}
! # 	if ($#subfields_data>=0) {
  		my %tag_data;
! # 			$tag_data{tag}=$field->tag().' -'. $tagslib->{$field->tag()}->{lib};
  		$tag_data{subfield} = \@subfields_data;
  		push (@loop_data, \%tag_data);
! # 	}
  }
+ 
  $template->param("0XX" =>\@loop_data);
  
***************
*** 111,115 ****
  # }
  
! $template->param(authid => $authid,
  # 				authtypesloop => \@authtypesloop,
  				index => $index);
--- 129,133 ----
  # }
  
! $template->param(authid => $authid?$authid:"",
  # 				authtypesloop => \@authtypesloop,
  				index => $index);





More information about the Koha-cvs mailing list