diff options
Diffstat (limited to 'perllib/FixMyStreet/DB')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 30 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/User.pm | 5 |
2 files changed, 3 insertions, 32 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index 12dad073e..5b853134e 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -662,36 +662,6 @@ sub can_display_external_id { return 0; } -# TODO Some/much of this could be moved to the template - -# either: -# "sent to council 3 mins later" -# "[Council name] ref: XYZ" -# or -# "sent to council 3 mins later, their ref: XYZ" -# -# Note: some silliness with pronouns and the adjacent comma mean this is -# being presented as a single string rather than two -sub processed_summary_string { - my ( $problem, $c ) = @_; - my ($duration_clause, $external_ref_clause); - if ($problem->whensent) { - $duration_clause = $problem->duration_string($c); - } - if ($problem->can_display_external_id) { - if ($duration_clause) { - $external_ref_clause = '<strong>' . sprintf(_('Council ref: %s'), $problem->external_id) . '.</strong>'; - } else { - $external_ref_clause = '<strong>' . sprintf(_('%s ref: %s'), $problem->external_body, $problem->external_id) . '.</strong>'; - } - } - if ($duration_clause and $external_ref_clause) { - return "$duration_clause. $external_ref_clause" - } else { - return $duration_clause || $external_ref_clause - } -} - sub duration_string { my ( $problem, $c ) = @_; my $body = $problem->body( $c ); diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm index 6bce415a6..054be3644 100644 --- a/perllib/FixMyStreet/DB/Result/User.pm +++ b/perllib/FixMyStreet/DB/Result/User.pm @@ -201,10 +201,11 @@ sub belongs_to_body { my $self = shift; my $bodies = shift; - my %bodies = map { $_ => 1 } split ',', $bodies; + return 0 unless $bodies && $self->from_body; - return 1 if $self->from_body && $bodies{ $self->from_body->id }; + my %bodies = map { $_ => 1 } split ',', $bodies; + return 1 if $bodies{ $self->from_body->id }; return 0; } |