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>
This commit is contained in:
parent
bf630b1974
commit
b5d6a1885e
|
|
@ -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'},
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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…
Reference in New Issue