[Koha-cvs] CVS: koha/acqui.simple addbiblio-nomarc.pl,1.2,1.3 addbiblio.pl,1.54,1.55 addbooks.pl,1.22,1.23 additem-nomarc.pl,1.4,1.5 additem.pl,1.27,1.28 isbnsearch.pl,1.15,1.16

Paul POULAIN tipaul at users.sourceforge.net
Wed May 4 10:45:35 CEST 2005


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

Modified Files:
	addbiblio-nomarc.pl addbiblio.pl addbooks.pl additem-nomarc.pl 
	additem.pl isbnsearch.pl 
Log Message:
synch'ing 2.2 and head

Index: addbiblio-nomarc.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/addbiblio-nomarc.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** addbiblio-nomarc.pl	9 May 2003 23:47:22 -0000	1.2
--- addbiblio-nomarc.pl	4 May 2005 08:45:22 -0000	1.3
***************
*** 27,30 ****
--- 27,36 ----
  
  # $Log$
+ # Revision 1.3  2005/05/04 08:45:22  tipaul
+ # synch'ing 2.2 and head
+ #
+ # Revision 1.2.4.1  2005/03/25 12:52:42  tipaul
+ # needs "editcatalogue" flag, not "catalogue"
+ #
  # Revision 1.2  2003/05/09 23:47:22  rangi
  # This script is now templated
***************
*** 46,50 ****
          type            => "intranet",
          authnotrequired => 0,
!         flagsrequired   => { catalogue => 1 },
          debug           => 1,
      }
--- 52,56 ----
          type            => "intranet",
          authnotrequired => 0,
!         flagsrequired   => { editcatalogue => 1 },
          debug           => 1,
      }

Index: addbiblio.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/addbiblio.pl,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -r1.54 -r1.55
*** addbiblio.pl	1 Mar 2005 16:35:09 -0000	1.54
--- addbiblio.pl	4 May 2005 08:45:22 -0000	1.55
***************
*** 198,202 ****
  	# it's a standard field
  	} else {
! 		$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"50\" maxlength=\"255\">"; #"
  	}
  	return \%subfield_data;
--- 198,206 ----
  	# it's a standard field
  	} 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\">"; #"
! 		}
  	}
  	return \%subfield_data;
***************
*** 205,209 ****
  sub build_tabs ($$$$) {
      my($template, $record, $dbh,$encoding) = @_;
- 
      # fill arrays
      my @loop_data =();
--- 209,212 ----
***************
*** 261,265 ****
  					}
  # If there is more than 1 field, add an empty hidden field as separator.
! 					if ($#fields >=1) {
  						my @subfields_data;
  						my %tag_data;
--- 264,268 ----
  					}
  # If there is more than 1 field, add an empty hidden field as separator.
! 					if ($#fields >1) {
  						my @subfields_data;
  						my %tag_data;

Index: addbooks.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/addbooks.pl,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** addbooks.pl	13 Aug 2004 16:37:25 -0000	1.22
--- addbooks.pl	4 May 2005 08:45:32 -0000	1.23
***************
*** 53,57 ****
          type            => "intranet",
          authnotrequired => 0,
!         flagsrequired   => { catalogue => 1 },
          debug           => 1,
      }
--- 53,57 ----
          type            => "intranet",
          authnotrequired => 0,
!         flagsrequired   => { editcatalogue => 1 },
          debug           => 1,
      }

Index: additem-nomarc.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/additem-nomarc.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** additem-nomarc.pl	19 Nov 2004 16:41:49 -0000	1.4
--- additem-nomarc.pl	4 May 2005 08:45:33 -0000	1.5
***************
*** 21,24 ****
--- 21,30 ----
  
  # $Log$
+ # Revision 1.5  2005/05/04 08:45:33  tipaul
+ # synch'ing 2.2 and head
+ #
+ # Revision 1.4.2.1  2005/03/25 12:52:44  tipaul
+ # needs "editcatalogue" flag, not "catalogue"
+ #
  # Revision 1.4  2004/11/19 16:41:49  tipaul
  # improving behaviour when MARC=OFF
***************
*** 96,100 ****
                  type            => "intranet",
                  authnotrequired => 0,
!                 flagsrequired   => { catalogue => 1 },
                  debug           => 1,
              }
--- 102,106 ----
                  type            => "intranet",
                  authnotrequired => 0,
!                 flagsrequired   => { editcatalogue => 1 },
                  debug           => 1,
              }

Index: additem.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/additem.pl,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** additem.pl	13 Aug 2004 16:37:25 -0000	1.27
--- additem.pl	4 May 2005 08:45:33 -0000	1.28
***************
*** 121,124 ****
--- 121,125 ----
  	my $record = MARChtml2marc($dbh,\@tags,\@subfields,\@values,%indicators);
  # MARC::Record builded => now, record in DB
+ # warn "R: ".$record->as_formatted;
  	my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = NEWmoditem($dbh,$record,$bibid,$itemnum,0);
  	$itemnum="";
***************
*** 270,274 ****
  			     type => "intranet",
  			     authnotrequired => 0,
! 			     flagsrequired => {parameters => 1},
  			     debug => 1,
  			     });
--- 271,275 ----
  			     type => "intranet",
  			     authnotrequired => 0,
! 			     flagsrequired => {editcatalogue => 1},
  			     debug => 1,
  			     });

Index: isbnsearch.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/isbnsearch.pl,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** isbnsearch.pl	15 Feb 2005 20:34:26 -0000	1.15
--- isbnsearch.pl	4 May 2005 08:45:33 -0000	1.16
***************
*** 22,26 ****
  use C4::Auth;
  use C4::Biblio;
! use C4::Search;
  use C4::Output;
  use C4::Interface::CGI::Output;
--- 22,28 ----
  use C4::Auth;
  use C4::Biblio;
! # use C4::Search;
! use C4::Breeding;
! use C4::SearchMarc;
  use C4::Output;
  use C4::Interface::CGI::Output;
***************
*** 29,46 ****
  
  my $input      = new CGI;
- my $isbn       = $input->param('isbn');
- my $title      = $input->param('title');
  my $offset     = $input->param('offset');
  my $num        = $input->param('num');
! my $showoffset = $offset + 1;
! my $total;
! my $count;
! my @results;
  my $marc_p = C4::Context->boolean_preference("marc");
  
- if ( !$isbn && !$title ) {
-     print $input->redirect('addbooks.pl');
- }
- else {
      my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
          {
--- 31,42 ----
  
  my $input      = new CGI;
  my $offset     = $input->param('offset');
  my $num        = $input->param('num');
! # my $total;
! # my $count;
! # my @results;
  my $marc_p = C4::Context->boolean_preference("marc");
+ my $dbh = C4::Context->dbh;
  
      my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
          {
***************
*** 49,53 ****
              type            => "intranet",
              authnotrequired => 0,
!             flagsrequired   => { catalogue => 1 },
              debug           => 1,
          }
--- 45,49 ----
              type            => "intranet",
              authnotrequired => 0,
!             flagsrequired   => { editcatalogue => 1 },
              debug           => 1,
          }
***************
*** 57,64 ****
      if ( !$offset ) {
          $offset     = 0;
-         $showoffset = 1;
      }
      if ( !$num ) { $num = 10 }
!     ( $count, @results ) = isbnsearch( $isbn, $title );
  
      if ( $count < ( $offset + $num ) ) {
--- 53,127 ----
      if ( !$offset ) {
          $offset     = 0;
      }
      if ( !$num ) { $num = 10 }
! 	my @marclist = $input->param('marclist');
! 	my @and_or = $input->param('and_or');
! 	my @excluding = $input->param('excluding');
! 	my @operator = $input->param('operator');
! 	my @value = $input->param('value');
! 	my $title= @value[0];
! 	my $isbn = @value[1];
! 	my $resultsperpage= $input->param('resultsperpage');
! 	$resultsperpage = 5 if(!defined $resultsperpage);
! 	my $startfrom=$input->param('startfrom');
! 	$startfrom=0 if(!defined $startfrom);
! 	my $orderby = $input->param('orderby');
! 	my $desc_or_asc = $input->param('desc_or_asc');
! 
! 	# builds tag and subfield arrays
! 	my @tags;
! 
! 	foreach my $marc (@marclist) {
! 		if ($marc) {
! 			my ($tag,$subfield) = MARCfind_marc_from_kohafield($dbh,$marc,'');
! 			if ($tag) {
! 				push @tags,$dbh->quote("$tag$subfield");
! 			} else {
! 				push @tags, $dbh->quote(substr($marc,0,4));
! 			}
! 		} else {
! 			push @tags, "";
! 		}
! 	}
! 	findseealso($dbh,\@tags);
! 	my ($results,$total) = catalogsearch($dbh, \@tags,\@and_or,
! 										\@excluding, \@operator, \@value,
! 										$startfrom, $resultsperpage,'biblio.title','ASC');
! # 	@results = @$resultsref;
! 
! #     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 );
! #     }
! 	# multi page display gestion
! 	my $displaynext=0;
! 	my $displayprev=$startfrom;
! 	if(($total - (($startfrom+1)*($resultsperpage))) > 0 ) {
! 		$displaynext = 1;
! 	}
! 
! 	my @field_data = ();
! 
! 	for(my $i = 0 ; $i <= $#marclist ; $i++) {
! 		push @field_data, { term => "marclist", val=>$marclist[$i] };
! 		push @field_data, { term => "and_or", val=>$and_or[$i] };
! 		push @field_data, { term => "excluding", val=>$excluding[$i] };
! 		push @field_data, { term => "operator", val=>$operator[$i] };
! 		push @field_data, { term => "value", val=>$value[$i] };
! 	}
  
      if ( $count < ( $offset + $num ) ) {
***************
*** 131,137 ****
  
      # fill with books in breeding farm
!     ( $count, @results ) = breedingsearch( $title, $isbn );
      my @breeding_loop = ();
!     for ( my $i = 0 ; $i <= $#results ; $i++ ) {
          my %row_data;
          if ( $i % 2 ) {
--- 194,201 ----
  
      # fill with books in breeding farm
! 	my $toggle=0;
!     my ( $countbr, @resultsbr ) = BreedingSearch( @value[0], @value[1] );
      my @breeding_loop = ();
!     for ( my $i = 0 ; $i <= $#resultsbr ; $i++ ) {
          my %row_data;
          if ( $i % 2 ) {
***************
*** 142,155 ****
          }
          $row_data{toggle} = $toggle;
!         $row_data{id}     = $results[$i]->{'id'};
!         $row_data{isbn}   = $results[$i]->{'isbn'};
!         $row_data{file}   = $results[$i]->{'file'};
!         $row_data{title}  = $results[$i]->{'title'};
!         $row_data{author} = $results[$i]->{'author'};
          $row_data{NOTMARC}= !$marc_p;	
          push ( @breeding_loop, \%row_data );
      }
  
- 
  	# get framework list
  	my $frameworks = getframeworks;
--- 206,218 ----
          }
          $row_data{toggle} = $toggle;
!         $row_data{id}     = $resultsbr[$i]->{'id'};
!         $row_data{isbn}   = $resultsbr[$i]->{'isbn'};
!         $row_data{file}   = $resultsbr[$i]->{'file'};
!         $row_data{title}  = $resultsbr[$i]->{'title'};
!         $row_data{author} = $resultsbr[$i]->{'author'};
          $row_data{NOTMARC}= !$marc_p;	
          push ( @breeding_loop, \%row_data );
      }
  
  	# get framework list
  	my $frameworks = getframeworks;
***************
*** 163,176 ****
  
      $template->param(
!         isbn          => $isbn,
!         title         => $title,
!         showoffset    => $showoffset,
          total         => $total,
!         offset        => $offset,
!         loop          => \@loop_data,
          breeding_loop => \@breeding_loop,
-         numbers       => \@numbers,
-         term          => $term,
-         value         => $value,
          NOTMARC       => !$marc_p,
  		frameworkcodeloop => \@frameworkcodeloop,
--- 226,245 ----
  
      $template->param(
! 		title		  => $title,
! 		isbn		  => $isbn,
! 							startfrom=> $startfrom,
! 							displaynext=> $displaynext,
! 							displayprev=> $displayprev,
! 							resultsperpage => $resultsperpage,
! 							startfromnext => $startfrom+1,
! 							startfromprev => $startfrom-1,
! 							searchdata=>\@field_data,
! 							numbers=>\@numbers,
! 							from => $from,
! 							to => $to,
          total         => $total,
! #         offset        => $offset,
!         loop          => $results,
          breeding_loop => \@breeding_loop,
          NOTMARC       => !$marc_p,
  		frameworkcodeloop => \@frameworkcodeloop,
***************
*** 181,184 ****
          -cookie => $cookie
        ),
!       $template->output;
! }    # else
--- 250,252 ----
          -cookie => $cookie
        ),
!       $template->output;
\ No newline at end of file





More information about the Koha-cvs mailing list