Lines 27-33
use C4::Output;
Link Here
|
27 |
use Koha::Cities; |
27 |
use Koha::Cities; |
28 |
|
28 |
|
29 |
my $input = new CGI; |
29 |
my $input = new CGI; |
30 |
my $city_name = $input->param('city_name') // q||; |
30 |
my $city_name_filter = $input->param('city_name_filter') // q||; |
31 |
my $cityid = $input->param('cityid'); |
31 |
my $cityid = $input->param('cityid'); |
32 |
my $op = $input->param('op') || 'list'; |
32 |
my $op = $input->param('op') || 'list'; |
33 |
my @messages; |
33 |
my @messages; |
Lines 51-57
if ( $op eq 'add_form' ) {
Link Here
|
51 |
|
51 |
|
52 |
$template->param( city => $city, ); |
52 |
$template->param( city => $city, ); |
53 |
} elsif ( $op eq 'add_validate' ) { |
53 |
} elsif ( $op eq 'add_validate' ) { |
54 |
my $cityid = $input->param('cityid'); |
|
|
55 |
my $city_name = $input->param('city_name'); |
54 |
my $city_name = $input->param('city_name'); |
56 |
my $city_state = $input->param('city_state'); |
55 |
my $city_state = $input->param('city_state'); |
57 |
my $city_zipcode = $input->param('city_zipcode'); |
56 |
my $city_zipcode = $input->param('city_zipcode'); |
Lines 102-116
if ( $op eq 'add_form' ) {
Link Here
|
102 |
} |
101 |
} |
103 |
|
102 |
|
104 |
if ( $op eq 'list' ) { |
103 |
if ( $op eq 'list' ) { |
105 |
my $filter = {}; |
104 |
$template->param( cities_count => Koha::Cities->search->count ); |
106 |
$filter->{city_name} = { -like => '%'.$city_name.'%' } |
|
|
107 |
if $city_name; |
108 |
$template->param( cities_count => Koha::Cities->search($filter)->count ); |
109 |
} |
105 |
} |
110 |
|
106 |
|
111 |
$template->param( |
107 |
$template->param( |
112 |
cityid => $cityid, |
108 |
cityid => $cityid, |
113 |
city_name_filter => $city_name, |
109 |
city_name_filter => $city_name_filter, |
114 |
messages => \@messages, |
110 |
messages => \@messages, |
115 |
op => $op, |
111 |
op => $op, |
116 |
); |
112 |
); |