diff options
author | Struan Donald <struan@exo.org.uk> | 2011-06-28 18:02:52 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-06-28 18:02:52 +0100 |
commit | 3773cf3459d023ed3515afbd4ff7b3e1253dc4d0 (patch) | |
tree | ab4d4f6e1b99b93f9b916b64a99aa198e2ece20b /perllib/FixMyStreet/DB/Result/Problem.pm | |
parent | e2414d30dd673ecea38e2a40d187b835bd076ac3 (diff) | |
parent | 70cbebec7bb2fd412c6a9fbfb694357401916372 (diff) |
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into new_statuses
Conflicts:
perllib/FixMyStreet/App/Controller/Report/Update.pm
templates/web/default/report/display.html
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Problem.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index 1c8487ae7..d5d4b8102 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -274,7 +274,7 @@ sub check_for_errors { unless $self->council && $self->council =~ m/^(?:-1|[\d,]+(?:\|[\d,]+)?)$/; - if ( $self->name !~ m/\S/ ) { + if ( !$self->name || $self->name !~ m/\S/ ) { $errors{name} = _('Please enter your name'); } elsif (length( $self->name ) < 5 @@ -499,8 +499,7 @@ sub meta_line { return $meta; } -# TODO Some/much of this could be moved to the template -sub duration_string { +sub body { my ( $problem, $c ) = @_; my $body; if ($problem->external_body) { @@ -522,6 +521,13 @@ sub duration_string { } @councils ); } + return $body; +} + +# TODO Some/much of this could be moved to the template +sub duration_string { + my ( $problem, $c ) = @_; + my $body = $problem->body( $c ); return sprintf(_('Sent to %s %s later'), $body, Utils::prettify_duration($problem->whensent_local->epoch - $problem->confirmed_local->epoch, 'minute') ); |