diff options
author | Dave Whiteland <dave@mysociety.org> | 2012-10-03 17:47:25 +0100 |
---|---|---|
committer | Dave Whiteland <dave@mysociety.org> | 2012-10-03 17:47:25 +0100 |
commit | 272dba7ce6d59d81b52579dd4c5fc7d65e9bec20 (patch) | |
tree | cabbefec7823061781050ffb002a38ce53d68f56 /perllib/FixMyStreet/App/Controller/Report.pm | |
parent | 39c1b648b30e67ceb8912a35b386eb4ee23857b8 (diff) | |
parent | f16a3e96b65394089d10c46c1d67cf82c67e72dd (diff) |
Merge branch 'fmb-read-only'
Conflicts:
db/schema.sql
perllib/FixMyStreet/DB/Result/Contact.pm
perllib/FixMyStreet/DB/Result/Problem.pm
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report.pm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm index cda569860..a7e1e8a3a 100644 --- a/perllib/FixMyStreet/App/Controller/Report.pm +++ b/perllib/FixMyStreet/App/Controller/Report.pm @@ -56,6 +56,23 @@ sub display : Path('') : Args(1) { $c->forward( 'format_problem_for_display' ); } +sub support : Path('support') : Args(0) { + my ( $self, $c ) = @_; + + my $id = $c->req->param('id'); + + my $uri = + $id + ? $c->uri_for( '/report', $id ) + : $c->uri_for('/'); + + if ( $id && $c->cobrand->can_support_problems && $c->user && $c->user->from_council ) { + $c->forward( 'load_problem_or_display_error', [ $id ] ); + $c->stash->{problem}->update( { interest_count => \'interest_count +1' } ); + } + $c->res->redirect( $uri ); +} + sub load_problem_or_display_error : Private { my ( $self, $c, $id ) = @_; |