X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FBreeding.pm;h=9003f9acb3dd7c2a25d8850ee43ad2aca2efa3e5;hb=5f8923acbf2a13a0f697a7bd80f6af9953bcba8f;hp=2b737290ef508e667d91e7ad384acf2bd17d1fe0;hpb=7279f55b60e02780df6b65c4c92ade9f413d5c01;p=koha_fer diff --git a/C4/Breeding.pm b/C4/Breeding.pm index 2b737290ef..9003f9acb3 100644 --- a/C4/Breeding.pm +++ b/C4/Breeding.pm @@ -169,7 +169,7 @@ C tables of the Koha database. =cut sub BreedingSearch { - my ($title,$isbn,$z3950random) = @_; + my ($search,$isbn,$z3950random) = @_; my $dbh = C4::Context->dbh; my $count = 0; my ($query,@bind); @@ -185,12 +185,13 @@ sub BreedingSearch { $query .= "z3950random = ?"; @bind=($z3950random); } else { + $search =~ s/(\s+)/\%/g; @bind=(); - if ($title) { - $query .= "title like ?"; - push(@bind,"$title%"); + if ($search) { + $query .= "title like ? OR author like ?"; + push(@bind,"%$search%", "%$search%"); } - if ($title && $isbn) { + if ($search && $isbn) { $query .= " and "; } if ($isbn) {