diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-12-13 12:27:38 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-12-15 00:11:06 +0000 |
commit | b715f69fc0a92e25761f124a3a05b7116a73c598 (patch) | |
tree | 1c5c9c2324953a24cd8982f5eadbf74411dbfdcb /perllib/FixMyStreet/SendReport.pm | |
parent | 0bcae44e9b9837f25f9b8f96988c71929f4bd43b (diff) |
Convert report sending code to use bodies rather than areas/councils.
Diffstat (limited to 'perllib/FixMyStreet/SendReport.pm')
-rw-r--r-- | perllib/FixMyStreet/SendReport.pm | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/SendReport.pm b/perllib/FixMyStreet/SendReport.pm index 9ba507862..f8901c6f8 100644 --- a/perllib/FixMyStreet/SendReport.pm +++ b/perllib/FixMyStreet/SendReport.pm @@ -7,7 +7,8 @@ use Module::Pluggable search_path => __PACKAGE__, require => 1; -has 'councils' => ( is => 'rw', isa => 'HashRef', default => sub { {} } ); +has 'body_config' => ( is => 'rw', isa => 'HashRef', default => sub { {} } ); +has 'bodies' => ( is => 'rw', isa => 'ArrayRef', default => sub { [] } ); has 'to' => ( is => 'rw', isa => 'ArrayRef', default => sub { [] } ); has 'success' => ( is => 'rw', isa => 'Bool', default => 0 ); has 'error' => ( is => 'rw', isa => 'Str', default => '' ); @@ -31,18 +32,18 @@ sub get_senders { sub reset { my $self = shift; - $self->councils( {} ); + $self->bodies( [] ); + $self->body_config( {} ); $self->to( [] ); } -sub add_council { +sub add_body { my $self = shift; - my $council = shift; - my $info = shift; + my $body = shift; my $config = shift; - $self->councils->{ $council } = { info => $info, config => $config }; + push @{$self->bodies}, $body; + $self->body_config->{ $body->id } = $config; } - 1; |