[Koha-cvs] CVS: koha/acqui.simple addbiblio.pl,1.55,1.56 isbnsearch.pl,1.16,1.17

Paul POULAIN tipaul at users.sourceforge.net
Mon Jun 20 15:16:13 CEST 2005


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

Modified Files:
	addbiblio.pl isbnsearch.pl 
Log Message:
synch'ing 2.2 and head

Index: addbiblio.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/addbiblio.pl,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -r1.55 -r1.56
*** addbiblio.pl	4 May 2005 08:45:22 -0000	1.55
--- addbiblio.pl	20 Jun 2005 13:16:10 -0000	1.56
***************
*** 186,190 ****
  			$cgidir = C4::Context->intranetdir."/value_builder";
  		} 
! 		my $plugin=$cgidir."/".$tagslib->{$tag}->{$subfield}->{'value_builder'};
  		require $plugin;
  		my $extended_param = plugin_parameters($dbh,$rec,$tagslib,$i,$tabloop);
--- 186,190 ----
  			$cgidir = C4::Context->intranetdir."/value_builder";
  		} 
! 		my $plugin=$cgidir."/".$tagslib->{$tag}->{$subfield}->{'value_builder'}; 
  		require $plugin;
  		my $extended_param = plugin_parameters($dbh,$rec,$tagslib,$i,$tabloop);
***************
*** 341,352 ****
  my $dbh = C4::Context->dbh;
  my $bibid;
  if ($oldbiblionumber) {
  	$bibid = &MARCfind_MARCbibid_from_oldbiblionumber($dbh,$oldbiblionumber);
  	# find framework type
! 	$frameworkcode = &MARCfind_frameworkcode($dbh,$bibid) if $bibid;
  }else {
  	$bibid = $input->param('bibid');
! 	$frameworkcode = &MARCfind_frameworkcode($dbh,$bibid) if $bibid;
  }
  my ($template, $loggedinuser, $cookie)
      = get_template_and_user({template_name => "acqui.simple/addbiblio.tmpl",
--- 341,355 ----
  my $dbh = C4::Context->dbh;
  my $bibid;
+ 
+ 
  if ($oldbiblionumber) {
  	$bibid = &MARCfind_MARCbibid_from_oldbiblionumber($dbh,$oldbiblionumber);
  	# find framework type
! 	$frameworkcode = &MARCfind_frameworkcode($dbh,$bibid) if ($bibid and not ($frameworkcode));
  }else {
  	$bibid = $input->param('bibid');
! 	$frameworkcode = &MARCfind_frameworkcode($dbh,$bibid) if ($bibid and not ($frameworkcode));
  }
+ $frameworkcode='' if ($frameworkcode eq 'Default');
  my ($template, $loggedinuser, $cookie)
      = get_template_and_user({template_name => "acqui.simple/addbiblio.tmpl",
***************
*** 358,361 ****
--- 361,387 ----
  			     });
  
+ #Getting the list of all frameworks
+ my $queryfwk =$dbh->prepare("select frameworktext, frameworkcode from biblio_framework");
+ $queryfwk->execute;
+ my %select_fwk;
+ my @select_fwk;
+ my $curfwk;
+ push @select_fwk,"Default";
+ $select_fwk{"Default"} = "Default";
+ while (my ($description, $fwk) =$queryfwk->fetchrow) {
+ 	push @select_fwk, $fwk;
+ 	$select_fwk{$fwk} = $description;
+ }
+ $curfwk=$frameworkcode;
+ my $framework=CGI::scrolling_list( -name     => 'Frameworks',
+ 			-id => 'Frameworks',
+ 			-default => $curfwk,
+ 			-OnChange => 'Changefwk(this);',
+ 			-values   => \@select_fwk,
+ 			-labels   => \%select_fwk,
+ 			-size     => 1,
+ 			-multiple => 0 );
+ $template->param( framework => $framework);
+ 
  $tagslib = &MARCgettagslib($dbh,1,$frameworkcode);
  my $record=-1;
***************
*** 401,404 ****
--- 427,431 ----
  		my $oldbibitemnum;
  		if ($is_a_modif) {
+ 			NEWmodbiblioframework($dbh,$bibid,$frameworkcode);
  			NEWmodbiblio($dbh,$record,$bibid,$frameworkcode);
  		} else {
***************
*** 435,468 ****
  	my @ind_tag = $input->param('ind_tag');
  	my @indicator = $input->param('indicator');
- 	splice(@tags,$addedfield,0,$tags[$addedfield]);
- 	splice(@subfields,$addedfield,0,$subfields[$addedfield]);
- 	splice(@values,$addedfield,0,$values[$addedfield]);
- 	splice(@ind_tag,$addedfield,0,$ind_tag[$addedfield]);
- 	my %indicators;
- 	for (my $i=0;$i<=$#ind_tag;$i++) {
- 		$indicators{$ind_tag[$i]} = $indicator[$i];
- 	}
- # search the part of the array to duplicate.
- 	my $start=0;
- 	my $end=0;
- 	my $started;
- 	for (my $i=$#tags;$i>0;$i--) {
- 		$end=$i if ($end eq 0 && $tags[$i] == $addedfield);
- 		$start=$i if ($end>0 && $tags[$i] eq $addedfield);
- 		last if ($end>0 && $tags[$i] ne $addedfield);
- 	}
- 	# add an empty line in all arrays. This forces a new field in MARC::Record.
- 	splice(@tags,$end+1,0,'');
- 	splice(@subfields,$end+1,0,'');
- 	splice(@values,$end+1,0,'');
- 	splice(@ind_tag,$end+1,0,'');
- 	splice(@indicator,$end+1,0,'');
- # then duplicate the field.
- 	splice(@tags,$end+2,0, at tags[$start..$end]);
- 	splice(@subfields,$end+2,0, at subfields[$start..$end]);
- 	splice(@values,$end+2,0, at values[$start..$end]);
- 	splice(@ind_tag,$end+2,0, at ind_tag[$start..$end]);
- 	splice(@indicator,$end+2,0, at indicator[$start..$end]);
- 
  	my %indicators;
  	for (my $i=0;$i<=$#ind_tag;$i++) {
--- 462,465 ----
***************
*** 470,473 ****
--- 467,473 ----
  	}
  	my $record = MARChtml2marc($dbh,\@tags,\@subfields,\@values,%indicators);
+ 	# adding an empty field
+ 	my $field = MARC::Field->new("$addedfield",'','','a'=> "");
+ 	$record->append_fields($field);
  	build_tabs ($template, $record, $dbh,$encoding);
  	build_hidden_data;
***************
*** 496,500 ****
  		$oldbiblionumber= "";
  	}
! 
  	build_tabs ($template, $record, $dbh,$encoding);
  	build_hidden_data;
--- 496,500 ----
  		$oldbiblionumber= "";
  	}
!  
  	build_tabs ($template, $record, $dbh,$encoding);
  	build_hidden_data;

Index: isbnsearch.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/isbnsearch.pl,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** isbnsearch.pl	4 May 2005 08:45:33 -0000	1.16
--- isbnsearch.pl	20 Jun 2005 13:16:10 -0000	1.17
***************
*** 125,195 ****
  	}
  
!     if ( $count < ( $offset + $num ) ) {
!         $total = $count;
!     }
!     else {
!         $total = $offset + $num;
!     }    # else
! 
!     my @loop_data = ();
!     my $toggle;
!     for ( my $i = $offset ; $i < $total ; $i++ ) {
!         if ( $i % 2 ) {
!             $toggle = 0;
!         } else {
!             $toggle = 1;
!         }
!         my %row_data;    # get a fresh hash for the row data
!         $row_data{toggle}        = $toggle;
!         $row_data{biblionumber}  = $results[$i]->{'biblionumber'};
!         $row_data{title}         = $results[$i]->{'title'};
!         $row_data{author}        = $results[$i]->{'author'};
!         $row_data{copyrightdate} = $results[$i]->{'copyrightdate'};
! 		$row_data{classification} = $results[$i]->{'classification'};
!         $row_data{NOTMARC}       = !$marc_p;	
!         push ( @loop_data, \%row_data );
!     }
!     $template->param( startfrom => $offset + 1 );
!     ( $offset + $num <= $count )
!       ? ( $template->param( endat => $offset + $num ) )
!       : ( $template->param( endat => $count ) );
!     $template->param( numrecords => $count );
!     my $nextstartfrom = ( $offset + $num < $count ) ? ( $offset + $num ) : (-1);
!     my $prevstartfrom = ( $offset - $num >= 0 ) ? ( $offset - $num ) : (-1);
!     $template->param( nextstartfrom => $nextstartfrom );
!     my $displaynext = 1;
!     my $displayprev = 0;
!     ( $nextstartfrom == -1 ) ? ( $displaynext = 0 ) : ( $displaynext = 1 );
!     ( $prevstartfrom == -1 ) ? ( $displayprev = 0 ) : ( $displayprev = 1 );
!     $template->param( displaynext => $displaynext );
!     $template->param( displayprev => $displayprev );
!     my @numbers = ();
!     my $term;
!     my $value;
! 
!     if ($isbn) {
!         $term  = "isbn";
!         $value = $isbn;
!     }
!     else {
!         $term  = "title";
!         $value = $title;
!     }
!     if ( $count > 10 ) {
!         for ( my $i = 1 ; $i < $count / 10 + 1 ; $i++ ) {
!             if ( $i < 16 ) {
!                 my $highlight = 0;
!                 ( $offset == ( $i - 1 ) * 10 ) && ( $highlight = 1 );
!                 push @numbers,
!                   {
!                     number    => $i,
!                     highlight => $highlight,
!                     term      => $term,
!                     value     => $value,
!                     startfrom => ( $i - 1 ) * 10
!                 };
!             }
!         }
!     }
  
      # fill with books in breeding farm
--- 125,151 ----
  	}
  
! 	my @numbers = ();
! 
! 	if ($total>$resultsperpage) {
! 		for (my $i=1; $i<$total/$resultsperpage+1; $i++) {
! 			if ($i<16) {
! 	    		my $highlight=0;
! 	    		($startfrom==($i-1)) && ($highlight=1);
! 	    		push @numbers, { number => $i,
! 					highlight => $highlight ,
! 					searchdata=> \@field_data,
! 					startfrom => ($i-1)};
! 			}
!     	}
! 	}
! 	my $from = $startfrom*$resultsperpage+1;
! 	my $to;
! 
! 	if($total < (($startfrom+1)*$resultsperpage))
! 	{
! 		$to = $total;
! 	} else {
! 		$to = (($startfrom+1)*$resultsperpage);
! 	}
  
      # fill with books in breeding farm





More information about the Koha-cvs mailing list