Bugzilla – Attachment 104433 Details for
Bug 25279
Make the cities list use the API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25279: Use another var name for the filter
Bug-25279-Use-another-var-name-for-the-filter.patch (text/plain), 2.79 KB, created by
Jonathan Druart
on 2020-05-06 14:13:07 UTC
(
hide
)
Description:
Bug 25279: Use another var name for the filter
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-05-06 14:13:07 UTC
Size:
2.79 KB
patch
obsolete
>From e82bfddad4406dee3bb53272d55a4091005d0e31 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 6 May 2020 14:59:47 +0200 >Subject: [PATCH] Bug 25279: Use another var name for the filter > >It prevents: >* The screen to display "no city, create one" if we are >searching for a string that does not return any results. >* The list to display only the city we have just created > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > admin/cities.pl | 10 +++------- > .../prog/en/includes/cities-admin-search.inc | 2 +- > 2 files changed, 4 insertions(+), 8 deletions(-) > >diff --git a/admin/cities.pl b/admin/cities.pl >index 03bce54d24..0688852246 100755 >--- a/admin/cities.pl >+++ b/admin/cities.pl >@@ -27,7 +27,7 @@ use C4::Output; > use Koha::Cities; > > my $input = new CGI; >-my $city_name = $input->param('city_name') // q||; >+my $city_name_filter = $input->param('city_name_filter') // q||; > my $cityid = $input->param('cityid'); > my $op = $input->param('op') || 'list'; > my @messages; >@@ -51,7 +51,6 @@ if ( $op eq 'add_form' ) { > > $template->param( city => $city, ); > } elsif ( $op eq 'add_validate' ) { >- my $cityid = $input->param('cityid'); > my $city_name = $input->param('city_name'); > my $city_state = $input->param('city_state'); > my $city_zipcode = $input->param('city_zipcode'); >@@ -102,15 +101,12 @@ if ( $op eq 'add_form' ) { > } > > if ( $op eq 'list' ) { >- my $filter = {}; >- $filter->{city_name} = { -like => '%'.$city_name.'%' } >- if $city_name; >- $template->param( cities_count => Koha::Cities->search($filter)->count ); >+ $template->param( cities_count => Koha::Cities->search->count ); > } > > $template->param( > cityid => $cityid, >- city_name_filter => $city_name, >+ city_name_filter => $city_name_filter, > messages => \@messages, > op => $op, > ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cities-admin-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cities-admin-search.inc >index 16a35088ff..ffde9faf85 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cities-admin-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cities-admin-search.inc >@@ -5,7 +5,7 @@ > <div id="city_search" class="residentsearch"> > <p class="tip">City search:</p> > <form action="[% script_name | html %]" method="post"> >- <input class="head-searchbox" type="text" name="city_name" value="[% searchfield | html %]" size="40" /> >+ <input class="head-searchbox" type="text" name="city_name_filter" value="[% city_name_filter | html %]" size="40" /> > <input type="submit" name="submit" value="OK" class="submit" /> > </form> > </div> >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25279
:
103693
|
103694
|
103802
|
103803
|
103804
|
104065
|
104072
|
104359
|
104387
|
104416
|
104417
|
104420
|
104421
|
104423
|
104427
|
104428
|
104429
|
104430
|
104431
|
104432
| 104433 |
104434
|
104435
|
104510