%# BEGIN LICENSE BLOCK
%# 
%#  Copyright (c) 2002-2003 Jesse Vincent <jesse@bestpractical.com>
%#  
%#  This program is free software; you can redistribute it and/or modify
%#  it under the terms of version 2 of the GNU General Public License 
%#  as published by the Free Software Foundation.
%# 
%#  A copy of that license should have arrived with this
%#  software, but in any event can be snarfed from www.gnu.org.
%# 
%#  This program is distributed in the hope that it will be useful,
%#  but WITHOUT ANY WARRANTY; without even the implied warranty of
%#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%#  GNU General Public License for more details.
%# 
%# END LICENSE BLOCK

% if ($ARGS{'HideOptions'} == 1) {
% my $qs = $ENV{'QUERY_STRING'};
% $qs =~ s/HideOptions=1//gi;
<a href="Search.html?<%$qs%>"><&|/l&>Show advanced search options...</&></a>
% }  else { 
<& /Elements/TitleBoxStart, title => loc('Advanced Search Criteria')&>
<form action="Search.html" method="GET">
<br>
<table>
<tr valign="middle">
<td>
<&|/l&>Class is</&>
</td>
<td>
<& /RTFM/Elements/SelectClass, Name => 'Class', Multiple =>1, Size => 5 , ShowNullOption => undef,  Default => $ARGS{'Class'} &> 
</td>
<td>
<&|/l&>and is not</&>
</td>
<td>
<& /RTFM/Elements/SelectClass, Name => 'Class!', Multiple =>1, Size => 5 , ShowNullOption => undef, Default => $ARGS{'Class!'} &> 
</td>
</tr>
</table>
<br><&|/l&>Name matches</&>
<input name="Name~" value="<%$ARGS{'Name~'}%>">
<&|/l&>and not</&>
<input name="Name!~" value="<%$ARGS{'Name!~'}%>">
<br><&|/l&>Summary matches</&>
<input Summary="Summary~" value="<%$ARGS{'Summary~'}%>">
<&|/l&>and not</&>
<input Summary="Summary!~" value="<%$ARGS{'Summary!~'}%>">

<br><&|/l&>Created during</&>
<& /Elements/SelectDate, Name=>"Created>", Default => ($dates->{'Created>'} ? $dates->{'Created>'}->ISO : '') &>
<&|/l&>till</&>
<& /Elements/SelectDate, Name=>"Created<", Default => ($dates->{'Created<'} ? $dates->{'Created<'}->ISO:'')&>

<br><&|/l&>Created during</&>
<& /Elements/SelectDate, Name=>"LastUpdated>", Default =>
($dates->{'LastUpdated>'} ? $dates->{'LastUpdated>'}->AsString:'')&>
<&|/l&>till</&>
<& /Elements/SelectDate, Name=>"LastUpdated<", Default => 
($dates->{'LastUpdated<'} ? $dates->{'LastUpdated<'}->AsString:'')&>
<br>
<&|/l&>Which refer to</&> <input type=text size=50 name="RefersTo" value="<%$RefersTo%>">
<i><&|/l&>Seperate multiple URLs with spaces</&></i>
<br>
<&|/l&>Which are referred to by </&> <input type=text size=50 name="ReferredToBy" value="<%$ReferredToBy%>">
<i><&|/l&>Seperate multiple URLs with spaces</&></i>


<table>
%# for each custom field 
% while (my $field = $customfields->Next ) {

<tr>
<td><&|/l, $field->Name &>[_1] matches</&></td><td valign=top>
% my $matches = $field->Name."~";
% my $nomatches = $field->Name."!~";
<& /RTFM/Article/Elements/SearchByCustomField, 
    Field => $field, 
    Name => $matches,
    Values => $ARGS{$matches} &>
    </td>
    <td><&|/l&>and not</&></td>
    <td valign="top">
<& /RTFM/Article/Elements/SearchByCustomField, 
    Field => $field, 
    Name => $nomatches,
    Values => $ARGS{$nomatches}
    &>
    </td>
    </tr>

% }
</table>

<div align="right"><input type="submit"></div>
<&/Elements/TitleBoxEnd&>
% }
</form>


</%init>
<%ARGS>
$dates =>undef
$RefersTo => undef
$ReferredToBy => undef
$customfields => undef
</%ARGS>
