From d1622dc20c1623e3f7fb54d72d99370af796c197 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 17 Apr 2020 14:07:32 +0100 Subject: Extend assigned_*_only to report lists. Shortlist buttons and extended print information will not appear where not allowed. --- perllib/FixMyStreet/App/Controller/Around.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'perllib/FixMyStreet/App/Controller/Around.pm') diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index af50f1883..0e87d1e70 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -262,6 +262,8 @@ sub check_and_stash_category : Private { my %valid_categories = map { $_ => 1 } grep { $_ && $categories_mapped{$_} } @$categories; $c->stash->{filter_category} = \%valid_categories; $c->cobrand->call_hook('munge_around_filter_category_list'); + + $c->forward('/report/assigned_users_only', [ \@categories ]); } sub map_features : Private { -- cgit v1.2.3 From 615ddb00265386849f32405426c5232b9127669a Mon Sep 17 00:00:00 2001 From: M Somerville Date: Wed, 5 Aug 2020 17:36:18 +0100 Subject: Remove use of $c from various functions. This means these functions can more easily be used in a non-web context. --- perllib/FixMyStreet/App/Controller/Around.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perllib/FixMyStreet/App/Controller/Around.pm') diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index 0e87d1e70..4c5c36106 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -295,7 +295,7 @@ sub map_features : Private { @pins = map { # Here we might have a DB::Problem or a DB::Result::Nearby, we always want the problem. my $p = (ref $_ eq 'FixMyStreet::DB::Result::Nearby') ? $_->problem : $_; - $p->pin_data($c, 'around'); + $p->pin_data('around'); } @$on_map, @$nearby; } -- cgit v1.2.3 From f784713cbebb8e9026544ab969a5a3404f736429 Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Tue, 25 Aug 2020 17:04:01 +0100 Subject: =?UTF-8?q?Don=E2=80=99t=20display=20duplicate=20categories=20in?= =?UTF-8?q?=20filter=20on=20/around=20and=20/my?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- perllib/FixMyStreet/App/Controller/Around.pm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'perllib/FixMyStreet/App/Controller/Around.pm') diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index 4c5c36106..7b98f01f8 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -254,6 +254,9 @@ sub check_and_stash_category : Private { distinct => 1 } )->all_sorted; + # Ensure only uniquely named categories are shown + my %seen; + @categories = grep { !$seen{$_->category_display}++ } @categories; $c->stash->{filter_categories} = \@categories; my %categories_mapped = map { $_->category => 1 } @categories; $c->forward('/report/stash_category_groups', [ \@categories ]) if $c->cobrand->enable_category_groups; -- cgit v1.2.3 From 4f96bd558e0b915adef325f27ac5ccd65e9b310f Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 4 Jun 2020 16:53:59 +0100 Subject: [IoW] Small refactor of munging functions. --- perllib/FixMyStreet/App/Controller/Around.pm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'perllib/FixMyStreet/App/Controller/Around.pm') diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index 7b98f01f8..803bfad58 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -240,12 +240,8 @@ sub check_and_stash_category : Private { $c->stash->{bodies_ids} = [ map { $_->id } @bodies]; $c->{stash}->{list_of_names_as_string} = $csv->string; - my $where = { body_id => [ keys %bodies ], }; - - my $cobrand_where = $c->cobrand->call_hook('munge_around_category_where', $where ); - if ( $cobrand_where ) { - $where = $cobrand_where; - } + my $where = { body_id => [ keys %bodies ], }; + $c->cobrand->call_hook('munge_around_category_where', $where); my @categories = $c->model('DB::Contact')->not_deleted->search( $where, -- cgit v1.2.3