[Koha-cvs] CVS: koha/acqui.simple addbiblio.pl,1.52.2.8,1.52.2.9 additem.pl,1.27.2.3,1.27.2.4

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


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

Modified Files:
      Tag: rel_2_2
	addbiblio.pl additem.pl 
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: addbiblio.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/addbiblio.pl,v
retrieving revision 1.52.2.8
retrieving revision 1.52.2.9
diff -C2 -r1.52.2.8 -r1.52.2.9
*** addbiblio.pl	25 May 2005 09:34:40 -0000	1.52.2.8
--- addbiblio.pl	28 Jul 2005 19:56:15 -0000	1.52.2.9
***************
*** 199,203 ****
  	} else {
  		if (length($value) >200) {
! 			$subfield_data{marc_value}="<textarea name=\"fieldvalue\" cols=\"50\" rows=\"5\" >$value</textarea>";
  		} else {
  			$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"50\">"; #"
--- 199,203 ----
  	} else {
  		if (length($value) >200) {
! 			$subfield_data{marc_value}="<textarea name=\"field_value\" cols=\"50\" rows=\"5\" >$value</textarea>";
  		} else {
  			$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"50\">"; #"
***************
*** 224,235 ****
  	# if MARC::Record is not empty => use it as master loop, then add missing subfields that should be in the tab.
  	# if MARC::Record is empty => use tab as master loop.
! 			if ($record ne -1 && $record->field($tag)) {
! 				my @fields = $record->field($tag);
  				foreach my $field (@fields)  {
  					my @subfields_data;
  					if ($tag<10) {
! 						my $value=$field->data();
! 						my $subfield="@";
  						next if ($tagslib->{$tag}->{$subfield}->{tab} ne $tabloop);
  						push(@subfields_data, &create_input($tag,$subfield,char_decode($value,$encoding),$i,$tabloop,$record,$authorised_values_sth));
  						$i++;
--- 224,247 ----
  	# if MARC::Record is not empty => use it as master loop, then add missing subfields that should be in the tab.
  	# if MARC::Record is empty => use tab as master loop.
! 			if ($record ne -1 && ($record->field($tag) || $tag eq '000')) {
! 				my @fields;
! 				if ($tag ne '000') {
! 					@fields = $record->field($tag);
! 				} else {
! 					push @fields,$record->leader();
! 				}
  				foreach my $field (@fields)  {
  					my @subfields_data;
  					if ($tag<10) {
! 						my ($value,$subfield);
! 						if ($tag ne '000') {
! 							$value=$field->data();
! 							$subfield="@";
! 						} else {
! 							$value = $field;
! 							$subfield='@';
! 						}
  						next if ($tagslib->{$tag}->{$subfield}->{tab} ne $tabloop);
+ 						next if ($tagslib->{$tag}->{$subfield}->{kohafield} eq 'biblio.biblionumber');
  						push(@subfields_data, &create_input($tag,$subfield,char_decode($value,$encoding),$i,$tabloop,$record,$authorised_values_sth));
  						$i++;

Index: additem.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/additem.pl,v
retrieving revision 1.27.2.3
retrieving revision 1.27.2.4
diff -C2 -r1.27.2.3 -r1.27.2.4
*** additem.pl	6 May 2005 08:26:28 -0000	1.27.2.3
--- additem.pl	28 Jul 2005 19:56:15 -0000	1.27.2.4
***************
*** 136,141 ****
  $indicators{995}='  ';
  # now, build existiing item list
! my $temp = MARCgetbiblio($dbh,$bibid);
! my @fields = $temp->fields();
  my %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code
  my @big_array;
--- 136,142 ----
  $indicators{995}='  ';
  # now, build existiing item list
! # my $temp = MARCgetbiblio($dbh,$bibid);
! # my @fields = $temp->fields();
! my @fields = $record->fields();
  my %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code
  my @big_array;





More information about the Koha-cvs mailing list