aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SendReport.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-04-03 14:39:45 +0100
committerStruan Donald <struan@exo.org.uk>2012-04-03 14:39:45 +0100
commit1923dc99b708511570fe5bf207ff63362c55ca9b (patch)
tree3d63276f897bc0183d98aa98f315dec25fe317af /perllib/FixMyStreet/SendReport.pm
parentd3e033d5426144dcc7bf0da3170fbf2361d22ba6 (diff)
parenta16e71730cf86cd48773ffbd8390c65e1dc2fc6a (diff)
Merge branch 'send-report-rewrite' into bromley-new-send-reports
Conflicts: bin/send-reports perllib/FixMyStreet/Geocode/Bing.pm web/js/map-OpenLayers.js
Diffstat (limited to 'perllib/FixMyStreet/SendReport.pm')
-rw-r--r--perllib/FixMyStreet/SendReport.pm37
1 files changed, 37 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/SendReport.pm b/perllib/FixMyStreet/SendReport.pm
new file mode 100644
index 000000000..84a89f877
--- /dev/null
+++ b/perllib/FixMyStreet/SendReport.pm
@@ -0,0 +1,37 @@
+package FixMyStreet::SendReport;
+
+use Moose;
+
+use Module::Pluggable
+ sub_name => 'senders',
+ search_path => __PACKAGE__,
+ require => 1;
+
+has 'councils' => (is => 'rw', isa => 'HashRef', default => sub { {} } );
+has 'to' => (is => 'rw', isa => 'ArrayRef', default => sub { [] } );
+
+sub get_senders {
+ my $self = shift;
+
+ my %senders = map { $_ => 1 } $self->senders;
+
+ return \%senders;
+}
+
+sub reset {
+ my $self = shift;
+
+ $self->councils( {} );
+ $self->to( [] );
+}
+
+sub add_council {
+ my $self = shift;
+ my $council = shift;
+ my $name = shift;
+
+ $self->councils->{ $council } = $name;
+}
+
+
+1;