aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Admin.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Admin.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index ef299d224..b53b6ab06 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -7,6 +7,7 @@ BEGIN { extends 'Catalyst::Controller'; }
use POSIX qw(strftime strcoll);
use Digest::MD5 qw(md5_hex);
use mySociety::EmailUtil qw(is_valid_email);
+use if !$ENV{TRAVIS}, 'Image::Magick';
use FixMyStreet::SendReport;
@@ -305,6 +306,10 @@ sub update_contacts : Private {
$contact->note( $c->req->param('note') );
$contact->whenedited( \'ms_current_timestamp()' );
$contact->editor( $editor );
+ $contact->endpoint( $c->req->param('endpoint') );
+ $contact->jurisdiction( $c->req->param('jurisdiction') );
+ $contact->api_key( $c->req->param('api_key') );
+ $contact->send_method( $c->req->param('send_method') );
if ( $contact->in_storage ) {
$c->stash->{updated} = _('Values updated');
@@ -341,7 +346,7 @@ sub update_contacts : Private {
} elsif ( $posted eq 'open311' ) {
$c->forward('check_token');
- my %params = map { $_ => $c->req->param($_) || '' } qw/open311_id endpoint jurisdiction api_key area_id send_method send_comments suppress_alerts comment_user_id/;
+ my %params = map { $_ => $c->req->param($_) || '' } qw/open311_id endpoint jurisdiction api_key area_id send_method send_comments suppress_alerts comment_user_id devolved/;
if ( $params{open311_id} ) {
my $conf = $c->model('DB::Open311Conf')->find( { id => $params{open311_id} } );
@@ -353,6 +358,7 @@ sub update_contacts : Private {
$conf->send_comments( $params{send_comments} || 0);
$conf->suppress_alerts( $params{suppress_alerts} || 0);
$conf->comment_user_id( $params{comment_user_id} || undef );
+ $conf->can_be_devolved( $params{devolved} || 0 );
$conf->update();
@@ -367,6 +373,7 @@ sub update_contacts : Private {
$conf->send_comments( $params{send_comments} || 0);
$conf->suppress_alerts( $params{suppress_alerts} || 0);
$conf->comment_user_id( $params{comment_user_id} || undef );
+ $conf->can_be_devolved( $params{devolved} || 0 );
$conf->insert();
@@ -462,6 +469,9 @@ sub council_edit : Path('council_edit') : Args(2) {
$c->stash->{history} = $history;
+ my @methods = map { $_ =~ s/FixMyStreet::SendReport:://; $_ } keys %{ FixMyStreet::SendReport->get_senders };
+ $c->stash->{send_methods} = \@methods;
+
return 1;
}
@@ -652,7 +662,6 @@ sub report_edit : Path('report_edit') : Args(1) {
|| $flagged != $problem->flagged
|| $non_public != $problem->non_public )
{
- warn "edited";
$edited = 1;
}
@@ -1281,7 +1290,6 @@ sub trim {
sub _rotate_image {
my ($photo, $direction) = @_;
- use Image::Magick;
my $image = Image::Magick->new;
$image->BlobToImage($photo);
my $err = $image->Rotate($direction);