diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/EastSussex.pm | 41 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Oxfordshire.pm | 15 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/Problem.pm | 2 |
4 files changed, 58 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Cobrand/EastSussex.pm b/perllib/FixMyStreet/Cobrand/EastSussex.pm new file mode 100644 index 000000000..c113a0986 --- /dev/null +++ b/perllib/FixMyStreet/Cobrand/EastSussex.pm @@ -0,0 +1,41 @@ +package FixMyStreet::Cobrand::EastSussex; +use parent 'FixMyStreet::Cobrand::UK'; + +use strict; +use warnings; + +sub council_area_id { return 2224; } + +sub open311_pre_send { + my ($self, $row, $open311) = @_; + + my $contact = $row->category_row; + my $fields = $contact->get_extra_fields; + for my $field ( @$fields ) { + if ($field->{variable} && !$field->{automated}) { + my $text = $row->detail; + my $q = $row->get_extra_field_value( $field->{code} ) || ''; + $text .= "\n\n" . $field->{description} . "\n" . $q; + $row->detail($text); + } + } +} + +sub open311_post_send { + my ($self, $row, $h, $contact) = @_; + + my $fields = $contact->get_extra_fields; + my $text = $row->detail; + my $added = ''; + for my $field ( @$fields ) { + if ($field->{variable} && !$field->{automated}) { + my $q = $row->get_extra_field_value( $field->{code} ) || ''; + $added .= "\n\n" . $field->{description} . "\n" . $q; + } + } + + $text =~ s/\Q$added\E//; + $row->detail($text); +} + +1; diff --git a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm index d81ecea74..b110731e6 100644 --- a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm +++ b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm @@ -202,4 +202,19 @@ sub available_permissions { return $perms; } +sub dashboard_export_problems_add_columns { + my $self = shift; + my $c = $self->{c}; + + push @{$c->stash->{csv}->{headers}}, "HIAMS Ref"; + push @{$c->stash->{csv}->{columns}}, "customer_reference"; + + $c->stash->{csv}->{extra_data} = sub { + my $ref = shift->get_extra_metadata('customer_reference') || ''; + return { + customer_reference => $ref, + }; + }; +} + 1; diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index 489c43090..37563d327 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -800,7 +800,7 @@ sub defect_types { # Note: this only makes sense when called on a problem that has been sent! sub can_display_external_id { my $self = shift; - if ($self->external_id && $self->to_body_named('Oxfordshire|Lincolnshire|Isle of Wight')) { + if ($self->external_id && $self->to_body_named('Oxfordshire|Lincolnshire|Isle of Wight|East Sussex')) { return 1; } return 0; diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm index 3e48170d8..359d5224a 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm @@ -159,7 +159,7 @@ sub _recent { $probs = [ $rs->search({ id => [ map { $_->id } @$probs ], %$query, - })->all ]; + }, $attrs)->all ]; } else { $probs = [ $rs->search( $query, $attrs )->all ]; Memcached::set($key, $probs, _cache_timeout()); |