chiark / gitweb /
Break out code for dbw_lookup_string; support capacity adjustments in terms of commod...
[ypp-sc-tools.db-test.git] / yarrg / web / query_route
index 0f9447ac307df6c4f583fb5aed18b1f0221e04f7..8b491d93a99aca47c41b8a77306648c10975acf1 100644 (file)
@@ -81,10 +81,12 @@ Enter route (islands, or archipelagoes, separated by |s or commas;
 
 <&| qtextstring, qa => $qa, dbh => $dbh,
     thingstring => 'routestring', emsgstore => \$emsg,
-    perresult => sub {
-       my ($canonname, $island, $arch) = @_;
-       push @islandids, $island;
-       push @archipelagoes, defined $island ? undef : $arch;
+    onresults => sub {
+       foreach (@_) {
+       my ($canonname, $island, $arch) = @$_;
+               push @islandids, $island;
+               push @archipelagoes, defined $island ? undef : $arch;
+       }
     }
  &>
  size=80
@@ -100,9 +102,7 @@ Vessel or capacity:
 <&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'cs',
     thingstring => 'capacitystring', emsgstore => \$emsg,
     helpref => 'capacity',
-    perresult => sub {
-        ($max_mass,$max_volume) = @_;
-    }
+    onresults => sub { ($max_mass,$max_volume) = @_; }
  &>
  size=40
 </&>
@@ -117,7 +117,7 @@ Expected losses:
 <&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'll',
     thingstring => 'lossperleague', emsgstore => \$emsg,
     helpref => 'losses',
-    perresult => sub { ($lossperleaguepct)= @_; }
+    onresults => sub { ($lossperleaguepct)= @_; }
  &>
  size=9
 </&>
@@ -129,7 +129,7 @@ Expected losses:
 <&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'ac',
     thingstring => 'capitalstring', emsgstore => \$emsg,
     helpref => 'capital',
-    perresult => sub { ($capital)= @_; }
+    onresults => sub { ($capital)= @_; }
  &>
  size=9
 </&>