From d8692d0e56ed88b5fdb6224d69b2b3a11cbeb2b8 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 18 Oct 2006 12:36:05 +0000 Subject: [PATCH] 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. --- web/htdocs/details/found.mc | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) 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 -- 1.7.10.4