diff options
author | Struan Donald <struan@exo.org.uk> | 2012-03-23 14:52:19 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-03-23 14:52:19 +0000 |
commit | fe7ea6cdb3d8dd64d7d644870476b9cc33c9cf86 (patch) | |
tree | 48cfadd31e98d10fff889584d74d072bf2d4ce52 | |
parent | 3567a4899d2ae84a4f3f8e49eb424731045b3f86 (diff) |
save extra comment details for bromley
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/Update.pm | 7 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Comment.pm | 27 | ||||
-rw-r--r-- | templates/web/fixmystreet/report/display.html | 4 |
3 files changed, 36 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm index 15444f556..772a0b8ee 100644 --- a/perllib/FixMyStreet/App/Controller/Report/Update.pm +++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm @@ -185,6 +185,13 @@ sub process_update : Private { $update->problem_state( $params{state} ); } + if ( $c->req->param('fms_extra_title') ) { + my %extras = (); + $extras{title} = $c->req->param('fms_extra_title'); + $extras{email_alerts_required} = $c->req->param('add_alert'); + $update->extra( \%extras ); + } + $c->stash->{update} = $update; $c->stash->{add_alert} = $c->req->param('add_alert'); diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index d3aecc091..1775521d3 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -56,6 +56,8 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 1 }, "external_id", { data_type => "text", is_nullable => 1 }, + "extra", + { data_type => "text", is_nullable => 1 }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to( @@ -72,13 +74,34 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-19 17:32:28 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2N8KFSUsilae7mWkyHchhQ +# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-23 14:36:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QUnX6SvdgvK/4GlCzoMU6Q + +__PACKAGE__->filter_column( + extra => { + filter_from_storage => sub { + my $self = shift; + my $ser = shift; + return undef unless defined $ser; + my $h = new IO::String($ser); + return RABX::wire_rd($h); + }, + filter_to_storage => sub { + my $self = shift; + my $data = shift; + my $ser = ''; + my $h = new IO::String($ser); + RABX::wire_wr( $data, $h ); + return $ser; + }, + } +); use DateTime::TimeZone; use Image::Size; use Moose; use namespace::clean -except => [ 'meta' ]; +use RABX; with 'FixMyStreet::Roles::Abuser'; diff --git a/templates/web/fixmystreet/report/display.html b/templates/web/fixmystreet/report/display.html index 42b9dbdb0..8a1625d88 100644 --- a/templates/web/fixmystreet/report/display.html +++ b/templates/web/fixmystreet/report/display.html @@ -178,6 +178,10 @@ [% INCLUDE 'footer.html' %] [% BLOCK name %] + [% IF problem.council == '2482' %] + [% extra_name_info = 1 %] + [% INCLUDE 'report/new/extra_name.html' %] + [% END %] <label for="form_name">[% loc('Name') %]</label> [% IF field_errors.name %] <p class='form-error'>[% field_errors.name %]</p> |