aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/Cobrand/Bexley.pm27
-rw-r--r--perllib/FixMyStreet/Cobrand/Oxfordshire.pm1
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Contact.pm9
3 files changed, 37 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bexley.pm b/perllib/FixMyStreet/Cobrand/Bexley.pm
index 1f16b817e..26470617a 100644
--- a/perllib/FixMyStreet/Cobrand/Bexley.pm
+++ b/perllib/FixMyStreet/Cobrand/Bexley.pm
@@ -131,4 +131,31 @@ sub open311_post_send {
$sender->send($row, $h);
}
+sub dashboard_export_problems_add_columns {
+ my $self = shift;
+ my $c = $self->{c};
+
+ my %groups;
+ if ($c->stash->{body}) {
+ %groups = FixMyStreet::DB->resultset('Contact')->active->search({
+ body_id => $c->stash->{body}->id,
+ })->group_lookup;
+ }
+
+ splice @{$c->stash->{csv}->{headers}}, 5, 0, 'Subcategory';
+ splice @{$c->stash->{csv}->{columns}}, 5, 0, 'subcategory';
+
+ $c->stash->{csv}->{extra_data} = sub {
+ my $report = shift;
+
+ if ($groups{$report->category}) {
+ return {
+ category => $groups{$report->category},
+ subcategory => $report->category,
+ };
+ }
+ return {};
+ };
+}
+
1;
diff --git a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
index 72a56f46c..ea6f14904 100644
--- a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
+++ b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
@@ -128,6 +128,7 @@ sub open311_config {
}
$row->set_extra_fields( @$extra );
+ $params->{multi_photos} = 1;
$params->{extended_description} = 'oxfordshire';
}
diff --git a/perllib/FixMyStreet/DB/ResultSet/Contact.pm b/perllib/FixMyStreet/DB/ResultSet/Contact.pm
index 8ef6d1ac5..7b3258262 100644
--- a/perllib/FixMyStreet/DB/ResultSet/Contact.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/Contact.pm
@@ -37,4 +37,13 @@ sub summary_count {
);
}
+sub group_lookup {
+ my $rs = shift;
+ map {
+ my $group = $_->get_extra_metadata('group') || '';
+ $group = join(',', ref $group ? @$group : $group);
+ $_->category => $group
+ } $rs->all;
+}
+
1;