X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=blobdiff_plain;f=yarrg%2Fweb%2Fquery_route;h=fb32bcdd705017d6ad82f7da4a3344c55b44b47e;hp=66dee1dd08135de011871b15d71d963f7db235af;hb=c9225ff45ee5e69855cb24cfb648d903dbba54a7;hpb=72587d0d7358ca77ecd0ede859abba7f89b1d9d2
diff --git a/yarrg/web/query_route b/yarrg/web/query_route
index 66dee1d..fb32bcd 100644
--- a/yarrg/web/query_route
+++ b/yarrg/web/query_route
@@ -35,176 +35,91 @@
%doc>
<%args>
$quri
+$dbh
+$prselector
$routestring => '';
+$capacitystring => '';
+$lossperleague => '';
+$capitalstring => '';
$someresults
$emsgokorprint
%args>
<%perl>
my $emsg;
+my @warningfs;
my @archipelagoes;
my @islandids;
-my %islandid2;
my $qa= \%ARGS;
-%perl>
-
-%#---------- textbox, user enters route as string ----------
-% if (!$qa->{Dropdowns}) {
-
-
Specify route
-
-Enter route (islands, or archipelagoes, separated by |s or commas;
- abbreviations are OK):
-
-
<%perl>
#========== results ==========
$emsgokorprint->($emsg) or @islandids=();
-my $argorundef= sub {
- my ($dd,$base) = @_;
- my $thing= $ARGS{"${base}${dd}"};
- $thing= undef if defined $thing and $thing eq 'none';
- return $thing;
-};
-
-for my $dd (0..$qa->{Dropdowns}-1) {
- my $arch= $argorundef->($dd,'archipelago');
- my $island= $argorundef->($dd,'islandid');
- next unless defined $arch or defined $island;
- if (defined $island and defined $arch) {
- my $ii= $islandid2{$island};
- my $iarch= $ii->{Arch};
- if ($iarch ne $arch) {
- $someresults->();
-%perl>
- Specified archipelago <% $arch %> but
- island <% $ii->{Name} %>
- which is in <% $iarch %>; using the island.
-<%perl>
- }
- $arch= undef;
- }
- push @archipelagoes, $arch;
- push @islandids, $island;
+foreach my $warningf (@warningfs) {
+ $someresults->();
+ $warningf->();
}
%perl>
% if (@islandids) {
% $someresults->();
-<& routetrade, islandids => \@islandids, archipelagoes => \@archipelagoes &>
+<& routetrade,
+ dbh => $dbh,
+ islandids => \@islandids,
+ archipelagoes => \@archipelagoes,
+ qa => $qa,
+ routeparams => $routeparams
+ &>
% }
+