aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-05-15 12:07:16 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-05-15 17:38:29 +0100
commit51b1b4f6a9e32165b7f4bed43b38415399ae3e59 (patch)
tree842d3e47e286fc1238e4e6f02a776371e28a7960
parentb0af941202cdc2d5c4675b3a8d5f5084b5ae202d (diff)
Move default problem state to cobrand function.
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm3
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm2
3 files changed, 5 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 574ef0390..331067c1a 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -979,8 +979,7 @@ sub process_report : Private {
}
# set defaults that make sense
- $report->state('unconfirmed');
- $report->state('submitted') if $c->cobrand->moniker eq 'zurich';
+ $report->state($c->cobrand->default_problem_state);
# save the cobrand and language related information
$report->cobrand( $c->cobrand->moniker );
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index 92494250e..816c5e315 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -1068,6 +1068,8 @@ sub show_unconfirmed_reports {
0;
}
+sub default_problem_state { 'unconfirmed' }
+
sub state_groups_admin {
my $rs = FixMyStreet::DB->resultset("State");
my @fixed = FixMyStreet::DB::Result::Problem->fixed_states;
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index 1acbdaf71..b2a0e331d 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -1278,6 +1278,8 @@ sub singleton_bodies_str { 1 }
sub contact_extra_fields { [ 'abbreviation' ] };
+sub default_problem_state { 'submitted' }
+
sub db_state_migration {
my $rs = FixMyStreet::DB->resultset('State');