--- loncom/interface/lonsearchcat.pm 2004/01/01 20:13:17 1.200 +++ loncom/interface/lonsearchcat.pm 2004/01/02 19:23:47 1.202 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.200 2004/01/01 20:13:17 www Exp $ +# $Id: lonsearchcat.pm,v 1.202 2004/01/02 19:23:47 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -485,7 +485,7 @@ $bodytag ENDDOCUMENT if (&Apache::lonnet::allowed('bre',$ENV{'request.role.domain'})) { my $CatalogSearch=&mt('Catalog Search'); - my $Statement=&mt('Enter terms or phrases separated by AND, OR, or NOT then press SEARCH below'); + my $Statement=&searchhelp(); $scrout.=(<$CatalogSearch
@@ -602,10 +602,8 @@ $closebutton

END - if (!defined($ENV{'form.viewselect'})) { - $ENV{'form.viewselect'} ="Detailed Citation View"; - } my $bodytag=&Apache::loncommon::bodytag('Advanced Catalog Search'); + my $searchhelp=&searchhelp(); my $scrout=<<"ENDHEADER"; @@ -619,8 +617,7 @@ END $bodytag -Enter terms or phrases separated by search operators -such as AND, OR, or NOT.
+$searchhelp $advanced_buttons $hidden_fields @@ -628,80 +625,40 @@ $hidden_fields ENDHEADER $scrout.=&viewoptions(); my %fields=&Apache::lonmeta::fieldnames(); -# set undefined to "any" - $ENV{'form.language'}='any' unless length($ENV{'form.language'}); - $ENV{'form.domains'} = 'any' if (! exists($ENV{'form.domains'})); - $ENV{'form.category'}='any' if (! defined($ENV{'form.category'})); - $scrout.=''; $scrout.="\n"; - foreach ('title','author','keywords','notes','abstract','standards', + foreach ('title','author','owner','authorspace','modifyinguser', + 'keywords','notes','abstract','standards', 'lowestgradelevel','highestgradelevel','mime') { - $scrout.=''; } - # Hack - an empty table row. - $scrout.="\n"; -# $scrout.=&searchphrasefield('file
extension','extension', -# $ENV{'form.extension'}); -# $scrout.="\n"; -# $scrout.=&searchphrasefield('publisher
owner','owner', - # $ENV{'form.owner'}); + $scrout.=''; + $scrout.=''; + my %dates=&Apache::lonlocal::texthash('creationdatestart' => 'Creation Date After', + 'creationdateend' => 'Creation Date Before', + 'lastrevisiondatestart' => 'Last Revision Date After', + 'lastrevisiondateend' => 'Last Revision Date Before'); + foreach (sort keys %dates) { + $scrout.=''; + } + $scrout.="
".&mt('Field').''.&mt('Value').'' .&mt('Related').'
'.&mt('Words')."
'.&titlefield($fields{$_}).''. + $scrout.='
'.&titlefield($fields{$_}).''. &Apache::lonmeta::prettyinput($_,$ENV{'form.'.$_},$_,'advsearch', 1,'',$ENV{'form.'.$_.'_related'}). '
   
   
'. + &titlefield(&mt('MIME Type Category')).''. + &Apache::loncommon::filecategoryselect('category', + $ENV{'form.category'}). + ' 
'. + &titlefield(&mt('Limit Search to Domains')).''. + &Apache::loncommon::domain_select('domains', + $ENV{'form.domains'},1). + ' 
'.&titlefield($dates{$_}).''. + &Apache::lonhtmlcommon::date_setter('advsearch',$_,0,'',1). + ' 
\n"; -# $scrout.=&Apache::lonmeta::selectbox('File Category','category', -# $ENV{'form.category'}, -# 'any','Any category', -# undef, -# (&Apache::loncommon::filecategories())); - #---------------------------------------------------------------- - # Allow restriction to multiple domains. - # I make the crazy assumption that there will never be a domain 'any'. - # - my @allowed_domains = (ref($ENV{'form.domains'}) ? @{$ENV{'form.domains'}} - : ($ENV{'form.domains'}) ); - my %domain_hash = (); - foreach (@allowed_domains) { - $domain_hash{$_}++; - } - my @domains =&Apache::loncommon::get_domains(); - # adjust the size of the select box - my $size = 4; - $size = (scalar @domains < ($size - 1) ? scalar @domains + 1 : $size); - $scrout.="\n".&titlefield(&mt('Domain to be searched')). - '\n"; - -# ------------------------------------------- Compute customized metadata field -# $scrout.=< -#LIMIT BY SPECIAL METADATA FIELDS: -# -#For resource-specific metadata, enter in an expression in the form of -#key=value separated by operators such as AND, OR or NOT.
-#Example: grandmother=75 OR grandfather=85 -#
-#CUSTOMMETADATA -# $scrout.=&simpletextfield('custommetadata',$ENV{'form.custommetadata'}); -# $scrout.=< -#SHOW SPECIAL METADATA FIELDS: -# -#Enter in a space-separated list of special metadata fields to show -#in a fielded listing for each record result. -#
-#CUSTOMSHOW -# $scrout.=&simpletextfield('customshow',$ENV{'form.customshow'}); + $scrout.=< @@ -789,6 +746,25 @@ sub viewoptions { } ###################################################################### + +=pod + +=item searchhelp + +Inputs: none + +Outputs: return little blurb on how to enter searches + +=cut + +###################################################################### +###################################################################### + +sub searchhelp { + return &mt('Enter terms or phrases separated by AND, OR, or NOT'); +} + +###################################################################### ###################################################################### =pod