aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-04-05 16:51:35 +0100
committerStruan Donald <struan@exo.org.uk>2012-04-05 16:51:35 +0100
commitbe55b3690d50cd84de0088b9d91d29e8a2e146ed (patch)
treef91fc06d08256e88dec52f089cd08f264fce0bb2
parent9fce2c6924567e420778162ad4c191273860eabb (diff)
Editing interface to set send method for council
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm11
-rw-r--r--templates/web/default/admin/council_contacts.html20
2 files changed, 31 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index 83f77f401..7fc6fe6a5 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -7,6 +7,8 @@ BEGIN { extends 'Catalyst::Controller'; }
use POSIX qw(strftime strcoll);
use Digest::MD5 qw(md5_hex);
+use FixMyStreet::SendReport;
+
=head1 NAME
FixMyStreet::App::Controller::Admin- Catalyst Controller
@@ -345,6 +347,9 @@ sub update_contacts : Private {
$conf->endpoint( $params{endpoint} );
$conf->jurisdiction( $params{jurisdiction} );
$conf->api_key( $params{api_key} );
+ $conf->send_method( $params{send_method} );
+ $conf->send_comments( $params{send_comments} );
+ $conf->comment_user_id( $params{comment_user_id} );
$conf->update();
@@ -355,6 +360,9 @@ sub update_contacts : Private {
$conf->endpoint( $params{endpoint} );
$conf->jurisdiction( $params{jurisdiction} );
$conf->api_key( $params{api_key} );
+ $conf->send_method( $params{send_method} );
+ $conf->send_comments( $params{send_comments} );
+ $conf->comment_user_id( $params{comment_user_id} );
$conf->insert();
@@ -377,6 +385,9 @@ sub display_contacts : Private {
$c->stash->{contacts} = $contacts;
+ my @methods = map { $_ =~ s/FixMyStreet::SendReport:://; $_ } keys %{ FixMyStreet::SendReport->get_senders };
+ $c->stash->{send_methods} = \@methods;
+
my $open311 = $c->model('DB::Open311Conf')->search(
{ area_id => $area_id }
);
diff --git a/templates/web/default/admin/council_contacts.html b/templates/web/default/admin/council_contacts.html
index acfec3ed4..e4bee707f 100644
--- a/templates/web/default/admin/council_contacts.html
+++ b/templates/web/default/admin/council_contacts.html
@@ -117,6 +117,26 @@
</p>
<p>
+ <label for="send_method">Send Method</label>:
+ <select name="send_method">
+ <option value=""> -- Select a method -- </option>
+ [% FOR method IN send_methods %]
+ <option value="[% method %]"[% ' selected' IF conf.send_method == method %]>[% method %]</option>
+ [% END %]
+ </select>
+ </p>
+
+ <p>
+ <label for="send_comments">Use Open311 comment sending extension</label>:
+ <input type="checkbox" name="send_comments"[% ' checked' IF conf.send_comments %]>
+ </p>
+
+ <p>
+ <label for"comment_user_id">User to attribute fetched comments to</label>:
+ <input type="textbox" name="comment_user_id" value="[% conf.comment_user_id %]">
+ </p>
+
+ <p>
<input type="hidden" name="open311_id" value="[% conf.id %]">
<input type="hidden" name="area_id" value="[% area_id %]">
<input type="hidden" name="posted" value="open311">