Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bexley][WW] Allow user to request new containers #5111

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
1dbd227
[Bexley][WW] Add a skeleton Form::Waste::Request for Bexley
nephila-nacrea Oct 23, 2024
ae377c2
[Bexley][WW] Display links for new container & removal requests
nephila-nacrea Oct 14, 2024
893c663
[Bexley][WW] Display container options for delivery and removal requests
nephila-nacrea Oct 14, 2024
e249410
[Bexley][WW] Make a basic request for a new container
nephila-nacrea Oct 21, 2024
24f0de1
[Bexley][WW] Add quantity option for certain containers
nephila-nacrea Oct 21, 2024
74b79ac
[Bexley][WW] Add household size check if property can order Green Whe…
nephila-nacrea Oct 22, 2024
319c801
[Bexley][WW] Add reason selection for container request
nephila-nacrea Oct 24, 2024
4d22ffd
[Bexley][WW] Pass 'assisted_yn' flag through for delivery requests
nephila-nacrea Oct 24, 2024
c5da5e9
[Bexley] Add communal/no service container request form.
dracos Oct 25, 2024
0ad7539
[Bexley] Rename missed_collection_reports to open_reports->missed
dracos Oct 29, 2024
c430e6e
[Bexley][WW] Implement removal requests
nephila-nacrea Oct 28, 2024
0626b21
[Bexley][WW] Fix bug where delivery requests always raised for wheeli…
nephila-nacrea Oct 29, 2024
3287fa0
[Bexley][WW] Add request summary
nephila-nacrea Oct 29, 2024
16192f0
[Bexley][WW] Container requests - confirmation email changes
nephila-nacrea Oct 31, 2024
6c1ef4d
[Bexley][WW] Container requests - alert email changes
nephila-nacrea Oct 31, 2024
27cc598
[Bexley] Spot open container requests.
dracos Oct 29, 2024
f7c822b
[Bexley] Spot updates on container requests.
dracos Nov 1, 2024
5bb8860
[Waste] Allow enquiry notice to use HTML.
dracos Nov 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions perllib/FixMyStreet/App/Controller/Waste.pm
Original file line number Diff line number Diff line change
Expand Up @@ -772,24 +772,35 @@ sub construct_bin_request_form {

sub request : Chained('property') : Args(0) {
my ($self, $c) = @_;
my $field_list = construct_bin_request_form($c);

$c->stash->{first_page} = 'request';
my $next = $c->cobrand->call_hook('waste_request_form_first_next');
my $title = $c->cobrand->call_hook('waste_request_form_first_title') || 'Which containers do you need?';
my %form_settings
= $c->cobrand->call_hook( 'construct_bin_request_form', $c );

my $field_list = $form_settings{field_list}
|| construct_bin_request_form($c);

$c->stash->{first_page} = $form_settings{first_page} || 'request';

my $cls = ucfirst $c->cobrand->council_url;
$c->stash->{form_class} = "FixMyStreet::App::Form::Waste::Request::$cls";

$c->stash->{page_list} = [
request => {
fields => [ grep { ! ref $_ } @$field_list, 'submit' ],
title => $title,
intro => 'request/intro.html',
check_unique_id => 0,
next => $next,
},
];
if ( $form_settings{page_list} ) {
$c->stash->{page_list} = $form_settings{page_list};
} else {
my $next = $c->cobrand->call_hook('waste_request_form_first_next');
my $title = $c->cobrand->call_hook('waste_request_form_first_title')
|| 'Which containers do you need?';

$c->stash->{page_list} = [
request => {
fields => [ grep { ! ref $_ } @$field_list, 'submit' ],
title => $title,
intro => 'request/intro.html',
check_unique_id => 0,
next => $next,
},
];
}

$c->cobrand->call_hook("waste_munge_request_form_pages", $c->stash->{page_list}, $field_list);
$c->stash->{field_list} = $field_list;
Expand Down
2 changes: 2 additions & 0 deletions perllib/FixMyStreet/App/Form/Waste/Request.pm
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ sub validate {
$any = 1 if $_->name =~ /^container-/ && ($_->value || $self->saved_data->{$_->name});
# Kingston special case for change-size-first-page
$any = 1 if $_->name eq 'how_many_exchange' && ($_->value || $self->saved_data->{$_->name});
# Bexley special case for household_size first page
$any = 1 if $_->name eq 'household_size' && ($_->value || $self->saved_data->{$_->name});
}
$self->add_form_error('Please specify what you need')
unless $any;
Expand Down
62 changes: 62 additions & 0 deletions perllib/FixMyStreet/App/Form/Waste/Request/Bexley.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package FixMyStreet::App::Form::Waste::Request::Bexley;

use utf8;
use HTML::FormHandler::Moose;
extends 'FixMyStreet::App::Form::Waste::Request';

has_field category_delivery => (
type => 'Hidden',
default => 'Request new container',
);

has_field category_removal => (
type => 'Hidden',
default => 'Request container removal',
);

# Shown as first page if property able to order Green Wheelie Bins
has_page household_size => (
title => 'Household size',
fields => [ 'household_size', 'continue' ],
next => 'request',
);

has_field household_size => (
type => 'Select',
widget => 'RadioGroup',
label => 'How many people live at the property?',
options => [
map {
label => $_,
value => $_,
},
( 1..4, '5 or more' )
],
);

has_page request_reason => (
fields => ['request_reason', 'continue'],
title => 'Reason for request',
next => 'about_you',
);

has_field request_reason => (
type => 'Select',
widget => 'RadioGroup',
required => 1,
label => 'Why do you need new containers?',
);

sub options_request_reason {
my $form = shift;

my @options = (
'My existing bin is too small or big',
'My existing bin is damaged',
'My existing bin has gone missing',
'I have moved into a new development',
);
return map { { label => $_, value => $_ } } @options;
}

1;
4 changes: 3 additions & 1 deletion perllib/FixMyStreet/Cobrand/Bexley.pm
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,9 @@ Missed collection reports are automatically confirmed

sub waste_auto_confirm_report {
my ($self, $report) = @_;
return $report->category eq 'Report missed collection';
return $report->category eq 'Report missed collection'
|| $report->category eq 'Request new container'
|| $report->category eq 'Request container removal';
}

1;
Loading
Loading