diff --git a/perllib/FixMyStreet/App/Controller/Waste/Bulky.pm b/perllib/FixMyStreet/App/Controller/Waste/Bulky.pm index 68df563f91c..b955d40b223 100644 --- a/perllib/FixMyStreet/App/Controller/Waste/Bulky.pm +++ b/perllib/FixMyStreet/App/Controller/Waste/Bulky.pm @@ -99,7 +99,8 @@ sub item_list : Private { sub index : PathPart('') : Chained('setup') : Args(0) { my ($self, $c) = @_; - if ($c->stash->{property}{pending_bulky_collection}) { + # TODO Remove when allowing more than one booking + if ($c->stash->{pending_bulky_collections}) { $c->detach('/waste/property_redirect'); } diff --git a/perllib/FixMyStreet/Cobrand/Peterborough.pm b/perllib/FixMyStreet/Cobrand/Peterborough.pm index 73f838ca257..59cf3c796f4 100644 --- a/perllib/FixMyStreet/Cobrand/Peterborough.pm +++ b/perllib/FixMyStreet/Cobrand/Peterborough.pm @@ -552,8 +552,9 @@ sub look_up_property { my %premises = map { $_->{uprn} => $_ } @$premises; - $premises{$uprn}{pending_bulky_collection} - = $self->find_pending_bulky_collection( $premises{$uprn} ); + my @pending = $self->find_pending_bulky_collections($uprn)->all; + $self->{c}->stash->{pending_bulky_collections} + = @pending ? \@pending : undef; return $premises{$uprn}; } diff --git a/perllib/FixMyStreet/Roles/CobrandBulkyWaste.pm b/perllib/FixMyStreet/Roles/CobrandBulkyWaste.pm index 3f587d7fd1b..6d2120b15c8 100644 --- a/perllib/FixMyStreet/Roles/CobrandBulkyWaste.pm +++ b/perllib/FixMyStreet/Roles/CobrandBulkyWaste.pm @@ -162,14 +162,6 @@ sub find_pending_bulky_collections { }); } -# Originally was only a single open collection for a given property, -# so this returns the most recent -sub find_pending_bulky_collection { - my ( $self, $property ) = @_; - - return $self->find_pending_bulky_collections($property->{uprn})->first; -} - sub _bulky_collection_window { my ($self, $last_earlier_date_str) = @_; my $fmt = '%F'; diff --git a/templates/web/base/waste/bulky/_bin_days_list.html b/templates/web/base/waste/bulky/_bin_days_list.html index 186486bb6dc..7e080f0bcdf 100644 --- a/templates/web/base/waste/bulky/_bin_days_list.html +++ b/templates/web/base/waste/bulky/_bin_days_list.html @@ -1,5 +1,5 @@ -[% IF property.pending_bulky_collection AND NOT c.user_exists %] - [% TRY %][% PROCESS waste/_bulky_not_signed_user.html %][% CATCH file %][% END %] +[% IF pending_bulky_collections AND NOT c.user_exists %] + [% PROCESS waste/_bulky_not_signed_user.html %] [% END %]
[% c.cobrand.bulky_nice_item_list(property.pending_bulky_collection).size %]
+[% c.cobrand.bulky_nice_item_list(booking).size %]