Browse Source

Bug 19130: (followup) Controller scripts should preserve behaviour

This patch is a followup to making
Koha::Acquisition::Booksellers->search work as any other Koha::Objects
(DBIC) query instead of having a different behaviour hardcoded.

To achieve it, this patch makes the controller scripts add
wildcard/truncation chars as prefix and sufix for searches, and make the
default sorting for results be by 'name', ascending.

To test:
- Just verify the behaviour remains unchanged by this patchset on the
controller scripts (re. searching).

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
17.11.x
Tomás Cohen Arazi 7 years ago
committed by Jonathan Druart
parent
commit
b5d6a1885e
  1. 5
      acqui/basketheader.pl
  2. 4
      acqui/booksellers.pl
  3. 2
      acqui/invoices.pl
  4. 4
      acqui/transferorder.pl
  5. 4
      serials/acqui-search-result.pl

5
acqui/basketheader.pl

@ -110,7 +110,10 @@ if ( $op eq 'add_form' ) {
$template->param(contractloop => \@contractloop,
basketcontractnumber => $basket->{'contractnumber'});
}
my @booksellers = Koha::Acquisition::Booksellers->search;
my @booksellers = Koha::Acquisition::Booksellers->search(
undef,
{ order_by => { -asc => 'name' } } );
$template->param( add_form => 1,
basketname => $basket->{'basketname'},
basketnote => $basket->{'note'},

4
acqui/booksellers.pl

@ -85,7 +85,9 @@ my @suppliers;
if ($booksellerid) {
push @suppliers, scalar Koha::Acquisition::Booksellers->find( $booksellerid );
} else {
@suppliers = Koha::Acquisition::Booksellers->search({ name => $supplier });
@suppliers = Koha::Acquisition::Booksellers->search(
{ name => { -like => "%$supplier%" } },
{ order_by => { -asc => 'name' } } );
}
my $supplier_count = @suppliers;

2
acqui/invoices.pl

@ -90,7 +90,7 @@ if ( $op and $op eq 'do_search' ) {
}
# Build suppliers list
my @suppliers = Koha::Acquisition::Booksellers->search;
my @suppliers = Koha::Acquisition::Booksellers->search( undef, { order_by => { -asc => 'name' } } );
my $suppliers_loop = [];
my $suppliername;
foreach (@suppliers) {

4
acqui/transferorder.pl

@ -117,7 +117,9 @@ if( $basketno && $ordernumber) {
# Search for booksellers to transfer from/to
$op = '' unless $op;
if( $op eq "do_search" ) {
my @booksellers = Koha::Acquisition::Booksellers->search({ name => $query });
my @booksellers = Koha::Acquisition::Booksellers->search(
{ name => { -like => "%$query%" } },
{ order_by => { -asc => 'name' } } );
$template->param(
query => $query,
do_search => 1,

4
serials/acqui-search-result.pl

@ -62,7 +62,9 @@ my ($template, $loggedinuser, $cookie)
});
my $supplier=$query->param('supplier');
my @suppliers = Koha::Acquisition::Booksellers->search({ name => $supplier });
my @suppliers = Koha::Acquisition::Booksellers->search(
{ name => { -like => "%$supplier%" } },
{ order_by => { -asc => 'name' } } );
#build result page
my $loop_suppliers = [];

Loading…
Cancel
Save