diff options
author | Struan Donald <struan@exo.org.uk> | 2012-10-02 13:01:28 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-10-02 13:01:28 +0100 |
commit | 87cc39d560c5ec3d6ec6b44429b966210252fb19 (patch) | |
tree | 6600a284bdaa02e098b55eccdd685aff897eed32 | |
parent | ba53a2c2d8189ecaeca2c0e774c6dda54579dec9 (diff) |
do not used planned status but use new action scheduled instead
NB: planned still listed in some places to account for old reports
some test coverage improvements
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Dashboard.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 8 | ||||
-rw-r--r-- | t/app/controller/dashboard.t | 22 | ||||
-rw-r--r-- | t/app/controller/report_updates.t | 12 | ||||
-rw-r--r-- | t/app/model/problem.t | 28 | ||||
-rw-r--r-- | t/open311/getservicerequestupdates.t | 12 | ||||
-rw-r--r-- | templates/web/bromley/report/display.html | 10 | ||||
-rw-r--r-- | templates/web/default/dashboard/index.html | 16 | ||||
-rw-r--r-- | templates/web/default/report/display.html | 10 | ||||
-rw-r--r-- | templates/web/fixmystreet/report/display.html | 8 |
10 files changed, 68 insertions, 62 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm index e4266dc64..11792ed9f 100644 --- a/perllib/FixMyStreet/App/Controller/Dashboard.pm +++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm @@ -181,11 +181,11 @@ sub updates_search : Private { map { $_ => $counts{$_} || 0 } ('confirmed', 'investigating', 'in progress', 'closed', 'fixed - council', 'fixed - user', 'fixed', 'unconfirmed', 'hidden', - 'partial', 'planned'); + 'partial', 'action scheduled'); for my $vars ( [ 'time_to_fix', 'fixed - council' ], - [ 'time_to_mark', 'in progress', 'planned', 'investigating', 'closed' ], + [ 'time_to_mark', 'in progress', 'action scheduled', 'investigating', 'closed' ], ) { my $col = shift @$vars; my $substmt = "select min(id) from comment where me.problem_id=comment.problem_id and problem_state in ('" diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index 24d6d3966..7535646ab 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -188,8 +188,8 @@ sub open_states { my $states = { 'confirmed' => 1, 'investigating' => 1, - 'planned' => 1, 'in progress' => 1, + 'planned' => 1, 'action scheduled' => 1, }; @@ -251,9 +251,9 @@ HASHREF. sub visible_states { my $states = { 'confirmed' => 1, - 'planned' => 1, 'investigating' => 1, 'in progress' => 1, + 'planned' => 1, 'action scheduled' => 1, 'fixed' => 1, 'fixed - council' => 1, @@ -283,7 +283,6 @@ sub all_states { 'partial' => 1, 'unconfirmed' => 1, 'confirmed' => 1, - 'planned' => 1, 'investigating' => 1, 'in progress' => 1, 'action scheduled' => 1, @@ -311,10 +310,9 @@ HASHREF. sub council_states { my $states = { 'confirmed' => 1, - 'planned' => 1, 'investigating' => 1, - 'in progress' => 1, 'action scheduled' => 1, + 'in progress' => 1, 'fixed - council' => 1, 'unable to fix' => 1, 'not responsible' => 1, diff --git a/t/app/controller/dashboard.t b/t/app/controller/dashboard.t index 47d10ff5c..ffdc5e5b3 100644 --- a/t/app/controller/dashboard.t +++ b/t/app/controller/dashboard.t @@ -78,7 +78,7 @@ my $categories = scraper { process "tr[id=fixed_user] > td", 'user[]' => 'TEXT', process "tr[id=total_fixed] > td", 'total_fixed[]' => 'TEXT', process "tr[id=in_progress] > td", 'in_progress[]' => 'TEXT', - process "tr[id=planned] > td", 'planned[]' => 'TEXT', + process "tr[id=action_scheduled] > td", 'action_scheduled[]' => 'TEXT', process "tr[id=investigating] > td", 'investigating[]' => 'TEXT', process "tr[id=marked] > td", 'marked[]' => 'TEXT', process "tr[id=avg_marked] > td", 'avg_marked[]' => 'TEXT', @@ -212,10 +212,10 @@ foreach my $test ( } }, { - desc => 'marked as planned today', + desc => 'marked as action scheduled today', confirm_dt => DateTime->now->subtract( days => 1 ), mark_dt => DateTime->now, - state => 'planned', + state => 'action scheduled', counts => { totals => $is_monday ? [ 0,5,5,5] : [5,5,5,5], user => [1,1,1,1], @@ -224,15 +224,15 @@ foreach my $test ( avg_marked => [1,1,1,1], investigating => [1,1,1,1], in_progress => [1,1,1,1], - planned => [1,1,1,1], + action_scheduled => [1,1,1,1], marked => [3,3,3,3] } }, { - desc => 'marked as planned today, confirmed a week ago', + desc => 'marked as action scheduled today, confirmed a week ago', confirm_dt => DateTime->now->subtract( days => 8 ), mark_dt => DateTime->now, - state => 'planned', + state => 'action scheduled', counts => { totals => $is_monday ? [0,5,6,6] : [5,5,6,6], user => [1,1,1,1], @@ -241,7 +241,7 @@ foreach my $test ( avg_marked => [3,3,3,3], investigating => [1,1,1,1], in_progress => [1,1,1,1], - planned => [2,2,2,2], + action_scheduled => [2,2,2,2], marked => [4,4,4,4] } }, @@ -259,7 +259,7 @@ foreach my $test ( avg_marked => [3,3,3,3], investigating => [1,1,1,1], in_progress => [1,1,1,1], - planned => [2,2,2,2], + action_scheduled => [2,2,2,2], marked => [4,4,4,4] } }, @@ -277,7 +277,7 @@ foreach my $test ( avg_marked => [3,3,3,3], investigating => [1,1,1,1], in_progress => [1,1,1,1], - planned => [2,2,2,2], + action_scheduled => [2,2,2,2], marked => [4,4,4,4] } }, @@ -295,7 +295,7 @@ foreach my $test ( avg_marked => [3,3,3,3], investigating => [1,1,1,1], in_progress => [1,1,1,1], - planned => [2,2,2,2], + action_scheduled => [2,2,2,2], marked => [4,4,4,4] } }, @@ -313,7 +313,7 @@ foreach my $test ( avg_marked => [2,2,2,2], investigating => [1,1,1,1], in_progress => [1,1,1,1], - planned => [2,2,2,2], + action_scheduled => [2,2,2,2], closed => [1,1,1,1], marked => [5,5,5,5] } diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t index 4a2aea7ef..4c8a01cf1 100644 --- a/t/app/controller/report_updates.t +++ b/t/app/controller/report_updates.t @@ -477,18 +477,6 @@ for my $test ( state => 'investigating', }, { - desc => 'from authority user marks report as planned', - fields => { - name => $user->name, - may_show_name => 1, - add_alert => undef, - photo => '', - update => 'Set state to planned', - state => 'planned', - }, - state => 'planned', - }, - { desc => 'from authority user marks report as in progress', fields => { name => $user->name, diff --git a/t/app/model/problem.t b/t/app/model/problem.t index 8aabce4f7..c3913b79e 100644 --- a/t/app/model/problem.t +++ b/t/app/model/problem.t @@ -302,6 +302,13 @@ for my $test ( is_closed => 0, }, { + state => 'action scheduled', + is_visible => 1, + is_fixed => 0, + is_open => 1, + is_closed => 0, + }, + { state => 'in progress', is_visible => 1, is_fixed => 0, @@ -309,6 +316,27 @@ for my $test ( is_closed => 0, }, { + state => 'duplicate', + is_visible => 1, + is_fixed => 0, + is_open => 0, + is_closed => 1, + }, + { + state => 'not responsible', + is_visible => 1, + is_fixed => 0, + is_open => 0, + is_closed => 1, + }, + { + state => 'unable to fix', + is_visible => 1, + is_fixed => 0, + is_open => 0, + is_closed => 1, + }, + { state => 'fixed', is_visible => 1, is_fixed => 1, diff --git a/t/open311/getservicerequestupdates.t b/t/open311/getservicerequestupdates.t index 9f67633aa..c7d12391a 100644 --- a/t/open311/getservicerequestupdates.t +++ b/t/open311/getservicerequestupdates.t @@ -117,18 +117,6 @@ for my $test ( end_state => 'confirmed', }, { - desc => 'planned status changed problem status', - updated_datetime => sprintf( '<updated_datetime>%s</updated_datetime>', $dt ), - description => 'This is a note', - external_id => 638344, - start_state => 'confirmed', - comment_status => 'PLANNED', - mark_fixed=> 0, - mark_open => 0, - problem_state => 'planned', - end_state => 'planned', - }, - { desc => 'investigating status changes problem status', updated_datetime => sprintf( '<updated_datetime>%s</updated_datetime>', $dt ), description => 'This is a note', diff --git a/templates/web/bromley/report/display.html b/templates/web/bromley/report/display.html index 806ec5ae7..5288041f9 100644 --- a/templates/web/bromley/report/display.html +++ b/templates/web/bromley/report/display.html @@ -77,11 +77,11 @@ [% IF c.user && c.user.belongs_to_council( problem.council ) %] <label for="form_state">[% loc( 'State' ) %]</label> <select name="state" id="form_state"> - [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating', - loc('Investigating')], ['planned', loc('Planned')], ['in progress', - loc('In Progress')], ['action scheduled', loc('Action Scheduled')], - ['duplicate', loc('Duplicate')], ['unable to fix', loc('Unable to fix')], - ['not responsible', loc('Not Responsible')], ['fixed', loc('Fixed')] ] %] + [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating', + loc('Investigating')], ['action scheduled', loc('Action Scheduled')], + ['in progress', loc('In Progress')], ['duplicate', loc('Duplicate')], + ['unable to fix', loc('Unable to fix')], ['not responsible', loc('Not Responsible')], + ['fixed', loc('Fixed')] ] %] <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option> [% END %] </select> diff --git a/templates/web/default/dashboard/index.html b/templates/web/default/dashboard/index.html index c2bfa9ea3..e3695e5ec 100644 --- a/templates/web/default/dashboard/index.html +++ b/templates/web/default/dashboard/index.html @@ -79,7 +79,7 @@ [% rows = { '0' => [ "in progress", "Council has marked as in progress" ] - '1' => [ "planned", "Council has marked as planned" ] + '1' => [ "action scheduled", "Council has marked as planned" ] '2' => [ "investigating", "Council has marked as investigating" ] '3' => [ "closed", "Council has marked as closed" ] }; @@ -96,10 +96,14 @@ <tr class='subtotal' id="marked"> <th scope="row">Total marked</th> - <td>[% problems.wtd.${"in progress"} + problems.wtd.planned + problems.wtd.investigating + problems.wtd.closed %]</td> - <td>[% problems.week.${"in progress"} + problems.week.planned + problems.week.investigating + problems.wtd.closed %]</td> - <td>[% problems.weeks.${"in progress"} + problems.weeks.planned + problems.weeks.investigating + problems.wtd.closed %]</td> - <td>[% problems.ytd.${"in progress"} + problems.ytd.planned + problems.ytd.investigating + problems.wtd.closed %]</td> + <td>[% problems.wtd.${"in progress"} + problems.wtd.${"action scheduled"} + + problems.wtd.investigating + problems.wtd.closed %]</td> + <td>[% problems.week.${"in progress"} + problems.week.${"action scheduled"} + + problems.week.investigating + problems.wtd.closed %]</td> + <td>[% problems.weeks.${"in progress"} + problems.weeks.${"action scheduled"} + + problems.weeks.investigating + problems.wtd.closed %]</td> + <td>[% problems.ytd.${"in progress"} + problems.ytd.${"action scheduled"} + + problems.ytd.investigating + problems.wtd.closed %]</td> </tr> <tr id="avg_fixed"> @@ -134,7 +138,7 @@ <p>Report state: <select name="state"> <option value=''>All</option> [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating', - loc('Investigating')], ['planned', loc('Planned')], ['in progress', + loc('Investigating')], ['action scheduled', loc('Planned')], ['in progress', loc('In Progress')], ['closed', loc('Closed')], ['fixed', loc('Fixed')] ] %] <option [% 'selected ' IF state.0 == q_state %] value="[% state.0 %]">[% state.1 %]</option> [% END %] diff --git a/templates/web/default/report/display.html b/templates/web/default/report/display.html index db0e3fcb8..2ac58d9a9 100644 --- a/templates/web/default/report/display.html +++ b/templates/web/default/report/display.html @@ -76,11 +76,11 @@ <div class="form-field"> <label for="form_state">[% loc( 'State:' ) %]</label> <select name="state" id="form_state"> - [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating', - loc('Investigating')], ['planned', loc('Planned')], ['in progress', - loc('In Progress')], ['action scheduled', loc('Action Scheduled')], - ['duplicate', loc('Duplicate')], ['unable to fix', loc('Unable to fix')], - ['not responsible', loc('Not Responsible')], ['fixed', loc('Fixed')] ] %] + [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating', + loc('Investigating')], ['action scheduled', loc('Action Scheduled')], + ['in progress', loc('In Progress')], ['duplicate', loc('Duplicate')], + ['unable to fix', loc('Unable to fix')], ['not responsible', loc('Not Responsible')], + ['fixed', loc('Fixed')] ] %] <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option> [% END %] </select> diff --git a/templates/web/fixmystreet/report/display.html b/templates/web/fixmystreet/report/display.html index 8f28d795b..e9c8ee21d 100644 --- a/templates/web/fixmystreet/report/display.html +++ b/templates/web/fixmystreet/report/display.html @@ -72,10 +72,10 @@ <label for="form_state">[% loc( 'State' ) %]</label> <select name="state" id="form_state"> [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating', - loc('Investigating')], ['planned', loc('Planned')], ['in progress', - loc('In Progress')], ['action scheduled', loc('Action Scheduled')], - ['duplicate', loc('Duplicate')], ['unable to fix', loc('Unable to fix')], - ['not responsible', loc('Not Responsible')], ['fixed', loc('Fixed')] ] %] + loc('Investigating')], ['action scheduled', loc('Action Scheduled')], + ['in progress', loc('In Progress')], ['duplicate', loc('Duplicate')], + ['unable to fix', loc('Unable to fix')], ['not responsible', loc('Not Responsible')], + ['fixed', loc('Fixed')] ] %] <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option> [% END %] </select> |