From: Mike Taylor Date: Wed, 18 Oct 2006 12:36:05 +0000 (+0000) Subject: If _query parameter is set, use that verbatim rather than assembling a X-Git-Tag: CPAN-v1.02~54^2~895 X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=commitdiff_plain;h=d8692d0e56ed88b5fdb6224d69b2b3a11cbeb2b8;hp=23feb2706011194d767f28c40307aacd4c56eee1 If _query parameter is set, use that verbatim rather than assembling a query from other form components. The heading containing the query is now a resubmission box, allowing the query to be edited. --- diff --git a/web/htdocs/details/found.mc b/web/htdocs/details/found.mc index ecb4d70..84f8514 100644 --- a/web/htdocs/details/found.mc +++ b/web/htdocs/details/found.mc @@ -1,4 +1,4 @@ -%# $Id: found.mc,v 1.12 2006-10-17 14:49:58 mike Exp $ +%# $Id: found.mc,v 1.13 2006-10-18 12:36:05 mike Exp $ <%once> use XML::LibXML; use XML::LibXML::XPathContext; @@ -28,13 +28,18 @@ our $conn = undef; <%perl> my %params = map { ( $_, $r->param($_)) } grep { $r->param($_) } $r->param(); -my $query = ""; -foreach my $key (keys %params) { - next if $key =~ /^_/; - my $val = $params{$key}; - next if $val eq ""; - $query .= " and " if $query ne ""; - $query .= "$key = ($val)"; +my $query; +if ($params{_query}) { + $query = $params{_query}; +} else { + $query = ""; + foreach my $key (keys %params) { + next if $key =~ /^_/; + my $val = $params{$key}; + next if $val eq ""; + $query .= " and " if $query ne ""; + $query .= "$key = ($val)"; + } } $query = 'cql.allRecords=x' if $query eq ""; @@ -66,7 +71,10 @@ my $first = $skip+1; my $last = $first+$count-1; $last = $n if $last > $n; -

<% xml_encode($query) %>

+
+ + +

% if ($n == 0) { No matches