aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm6
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm13
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm10
3 files changed, 22 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index fbd50a973..a0d3e8643 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -121,6 +121,7 @@ sub timeline : Path( 'timeline' ) : Args(0) {
my %time;
$c->model('DB')->schema->storage->sql_maker->quote_char( '"' );
+ $c->model('DB')->schema->storage->sql_maker->name_sep( '.' );
my $probs = $c->cobrand->problems->timeline;
@@ -427,6 +428,7 @@ sub search_reports : Path('search_reports') {
# makes PostgreSQL unhappy elsewhere so we only want to do
# it for this query and then switch it off afterwards.
$c->model('DB')->schema->storage->sql_maker->quote_char( '"' );
+ $c->model('DB')->schema->storage->sql_maker->name_sep( '.' );
my $problems = $c->cobrand->problems->search(
{
@@ -744,6 +746,10 @@ sub update_edit : Path('update_edit') : Args(1) {
$update->user($user);
}
+ if ( $new_state eq 'confirmed' and $old_state eq 'unconfirmed' ) {
+ $update->confirmed( \'ms_current_timestamp()' );
+ }
+
$update->update;
$status_message = '<p><em>' . _('Updated!') . '</em></p>';
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 5cf634e14..2311b4aff 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -493,7 +493,7 @@ sub setup_categories_and_councils : Private {
next # TODO - move this to the cobrand
if $c->cobrand->moniker eq 'southampton'
- && $contact->category eq 'Street lighting';
+ && $contact->category =~ /Street lighting|Traffic lights/;
next if $contact->category eq _('Other');
@@ -617,6 +617,7 @@ sub process_report : Private {
map { $_ => scalar $c->req->param($_) } #
(
'title', 'detail', 'pc', #
+ 'detail_size', 'detail_depth',
'may_show_name', #
'category', #
'partial', #
@@ -635,8 +636,14 @@ sub process_report : Private {
# clean up text before setting
$report->title( Utils::cleanup_text( $params{title} ) );
- $report->detail(
- Utils::cleanup_text( $params{detail}, { allow_multiline => 1 } ) );
+
+ my $detail = Utils::cleanup_text( $params{detail}, { allow_multiline => 1 } );
+ for my $w ('depth', 'size') {
+ next unless $params{"detail_$w"};
+ next if $params{"detail_$w"} eq '-- Please select --';
+ $detail .= "\n\n\u$w: " . $params{"detail_$w"};
+ }
+ $report->detail( $detail );
# set these straight from the params
$report->category( _ $params{category} );
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index 61d7d5cb1..feafc4b77 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -124,7 +124,9 @@ sub ward : Path : Args(2) {
# List of wards
unless ($c->stash->{ward}) {
- my $children = mySociety::MaPit::call('area/children', $c->stash->{council}->{id} );
+ my $children = mySociety::MaPit::call('area/children', $c->stash->{council}->{id},
+ type => $mySociety::VotingArea::council_child_types,
+ );
foreach (values %$children) {
$_->{url} = $c->uri_for( $c->stash->{council_url}
. '/' . $c->cobrand->short_name( $_ )
@@ -269,9 +271,9 @@ sub ward_check : Private {
type => $mySociety::VotingArea::council_child_types,
min_generation => $c->cobrand->area_min_generation
);
- foreach my $id (sort keys %$qw) {
- if ($qw->{$id}->{parent_area} == $council->{id}) {
- $c->stash->{ward} = $qw->{$id};
+ foreach my $area (sort { $a->{name} cmp $b->{name} } values %$qw) {
+ if ($area->{parent_area} == $council->{id}) {
+ $c->stash->{ward} = $area;
return;
}
}