[Koha-cvs] CVS: koha/opac opac-detail.pl,1.21,1.22

Waylon Robertson genjimoto at users.sourceforge.net
Tue Jun 28 00:26:31 CEST 2005


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

Modified Files:
	opac-detail.pl 
Log Message:
Moved the title words splitting, changed the authorwords routine abit. added a check for author and additionalauthors. No use having checkboxes for non-existant data.

Index: opac-detail.pl
===================================================================
RCS file: /cvsroot/koha/koha/opac/opac-detail.pl,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** opac-detail.pl	25 Jun 2005 05:22:00 -0000	1.21
--- opac-detail.pl	27 Jun 2005 22:26:16 -0000	1.22
***************
*** 32,42 ****
  my $subscriptionsnumber = getsubscriptionfrombiblionumber($biblionumber);
  
  $dat->{'count'}=@items;
  my @author;
  $dat->{'additional'}=$addauthor->[0]->{'author'};
  for (my $i = 1; $i < $authorcount; $i++) {
          $dat->{'additional'} .= " ; " . $addauthor->[$i]->{'author'};
          my %authorpush;
!         $authorpush{author} =$addauthor->[$i]->{'author'};
          push @author, \%authorpush
  } # for
--- 32,66 ----
  my $subscriptionsnumber = getsubscriptionfrombiblionumber($biblionumber);
  
+ my @title;
  $dat->{'count'}=@items;
  my @author;
+ if ($dat->{'author'}){
+ 	my %authorpush; 
+ 	$authorpush{author}=$dat->{'author'};
+ 	push @author, \%authorpush
+ }
  $dat->{'additional'}=$addauthor->[0]->{'author'};
+ if ($dat->{'additional'}){
+ 	my %authorpush;
+ 	$authorpush{author} =$addauthor->[0]->{'author'};
+ 	push @author, \%authorpush
+ }
+ 
+ foreach my $word (split(" ", $dat->{'title'})){
+         unless (length($word) == 4){
+                 $word =~s/\%//g
+         }
+         unless (C4::Context->stopwords->{uc($word)} or length($word)==1) {
+         my %titlepush;
+         $titlepush{title} =$word;
+                 push @title, \%titlepush;
+         }#it's NOT a stopword => use it. Otherwise, ignore
+ }
+ 
  for (my $i = 1; $i < $authorcount; $i++) {
          $dat->{'additional'} .= " ; " . $addauthor->[$i]->{'author'};
+     
          my %authorpush;
!         $authorpush{author}=$addauthor->[$i]->{'author'};
          push @author, \%authorpush
  } # for
***************
*** 64,90 ****
  
  my @results = ($dat,);
- my @title;
  
  
! foreach my $word (split(" ", $dat->{'title'})){
!         unless (length($word) == 4){
!                 $word =~s/\%//g
!         }
!         unless (C4::Context->stopwords->{uc($word)} or length($word)==1) {
!         my %titlepush;
!         $titlepush{title} =$word;
!                 push @title, \%titlepush;
!         }#it's NOT a stopword => use it. Otherwise, ignore
! }
! foreach my $word (split(" ", $dat->{'author'})){
!         unless (length($word) == 4){
!                 $word =~s/\%//g
!         }
!         unless (C4::Context->stopwords->{uc($word)} or length($word)==1) {
!         my %authorpush;
!         $authorpush{author}=$word;
!                 push @author, \%authorpush;
!         }#it's NOT a stopword => use it. Otherwise, ignore
! }
  
  my $resultsarray=\@results;
--- 88,96 ----
  
  my @results = ($dat,);
  
  
! 
! 
! 
  
  my $resultsarray=\@results;





More information about the Koha-cvs mailing list