aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/Result/Problem.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-08-22 16:22:42 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-08-29 09:52:03 +0100
commitb43dbace0f747897640920e4cf9adb55b84bc2c8 (patch)
treeeb94892223882330b37f1e38ddd90a9f90710082 /perllib/FixMyStreet/DB/Result/Problem.pm
parent4ca7c78c3a3edabbb7466bfd7d519be83d11a89a (diff)
Drop council_states and $visible_states.
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Problem.pm')
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm52
1 files changed, 4 insertions, 48 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index 0d1b396a9..a74a04828 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -323,75 +323,31 @@ my $hidden_states = {
'unconfirmed' => 1,
};
-my $visible_states = {
- map {
- $hidden_states->{$_} ? () : ($_ => 1)
- } all_states()
-};
- ## e.g.:
- # 'confirmed' => 1,
- # 'investigating' => 1,
- # 'in progress' => 1,
- # 'planned' => 1,
- # 'action scheduled' => 1,
- # 'fixed' => 1,
- # 'fixed - council' => 1,
- # 'fixed - user' => 1,
- # 'unable to fix' => 1,
- # 'not responsible' => 1,
- # 'duplicate' => 1,
- # 'closed' => 1,
- # 'internal referral' => 1,
-
sub hidden_states {
return wantarray ? keys %{$hidden_states} : $hidden_states;
}
sub visible_states {
- return wantarray ? keys %{$visible_states} : $visible_states;
+ my %visible_states = map {
+ $hidden_states->{$_} ? () : ($_ => 1)
+ } all_states();
+ return wantarray ? keys %visible_states : \%visible_states;
}
sub visible_states_add {
my ($self, @states) = @_;
for my $state (@states) {
delete $hidden_states->{$state};
- $visible_states->{$state} = 1;
}
}
sub visible_states_remove {
my ($self, @states) = @_;
for my $state (@states) {
- delete $visible_states->{$state};
$hidden_states->{$state} = 1;
}
}
-=head2
-
- @states = FixMyStreet::DB::Problem::council_states();
-
-Get a list of states that are availble to council users. If called in
-array context then returns an array of names, otherwise returns a
-HASHREF.
-
-=cut
-sub council_states {
- my $states = {
- 'confirmed' => 1,
- 'investigating' => 1,
- 'action scheduled' => 1,
- 'in progress' => 1,
- 'fixed - council' => 1,
- 'unable to fix' => 1,
- 'not responsible' => 1,
- 'duplicate' => 1,
- 'internal referral' => 1,
- };
-
- return wantarray ? keys %{$states} : $states;
-}
-
my $stz = sub {
my ( $orig, $self ) = ( shift, shift );
my $s = $self->$orig(@_);