--- loncom/interface/lonsearchcat.pm 2001/03/12 17:28:32 1.7 +++ loncom/interface/lonsearchcat.pm 2001/03/13 15:36:15 1.8 @@ -36,9 +36,15 @@ sub handler { %metadatafields=(); + my $hidden=''; + $hidden=< +END + # ------------------------------------------------ First, check out environment $metadatafields{'owner'}=$ENV{'user.name'}.'@'.$ENV{'user.domain'}; +# --------------------------------- Compute various listings of metadata values %language=(); $language{'any'}='Any language'; @@ -74,7 +80,7 @@ sub handler { return &basicsearch($r,$ENV{'form.basicexp'}); } - $scrout=""; + $scrout=''; # building a part of screen output $scrout.=&searchphrasefield('Limit by title','title', ''); @@ -96,276 +102,108 @@ sub handler { $scrout.=&selectbox('Limit by language','language', 'any',%language); - $scrout.=< LIMIT BY CREATION DATE RANGE:
-between: - - -and: - - -

+between: +CREATIONDATESTART + $scrout.=&dateboxes('creationdatestart'); + $scrout.=< LIMIT BY LAST REVISION DATE RANGE: -
between: + +Title only +
+ + + +

+
+

Advanced Search

+$scrout +

+ + + +

+ + + +ENDDOCUMENT + return OK; +} + +# --------------------------------------------------------- Various form fields + +sub textfield { + my ($title,$name,$value)=@_; + return "\n

$title:
". + ''; +} + +sub searchphrasefield { + my ($title,$name,$value)=@_; + my $instruction=<$uctitle:". + " $instruction
". + ''; +} + +sub dateboxes { + my ($name)=@_; + return< + @@ -379,8 +217,8 @@ CREATIONDATEEND - + @@ -413,7 +251,7 @@ CREATIONDATEEND - @@ -492,218 +330,7 @@ CREATIONDATEEND -and: - - -

-LASTREVISIONDATEEND - - $scrout.=&searchphrasefield('Limit by publisher/owner','owner', - $metadatafields{'owner'}); - - $scrout.=&selectbox('Limit by copyright/distribution','copyright', - 'any',%cprtag); - -# ---------------------------------------------------------------- Print screen - $r->print(< - -The LearningOnline Network with CAPA - - - - -

Search Catalog

-
-
-

Basic Search

-

- -

-

-Enter terms or phrases separated by search operators -such as AND or OR then press SEARCH below. Terms should be specific -to the title, author, subject, notes, or abstract information associated -with a resource. -
- - -Title only -
- -

-
-

Advanced Search

-$scrout -

- -

-
- - -ENDDOCUMENT - return OK; -} - -# --------------------------------------------------------- Various form fields - -sub textfield { - my ($title,$name,$value)=@_; - return "\n

$title:
". - ''; -} - -sub searchphrasefield { - my ($title,$name,$value)=@_; - my $instruction=<$uctitle:". - ": $instruction
". - ''; } sub selectbox { @@ -724,11 +351,8 @@ sub basicsearch { my ($r,$expression)=@_; my $query=$expression; -# $query="select * from metadata where concat(title,':\@:',author) like '\%Sci\%'"; $query="select * from metadata where concat(title,\" \",author) like '\%$expression\%'"; -# my $reply=&Apache::lonnet::reply("querysend:DESCRIBE metadata","msul3"); my $reply=&Apache::lonnet::reply("querysend:$query",'msul3'); -# my $reply=&Apache::lonnet::reply('querysend:select * from metadata','msul3'); my @results; @@ -758,8 +382,16 @@ sub basicsearch { )=map {&Apache::lonnet::unescape($_)} (split(/\,/,$result)); my $shortabstract=$abstract; $shortabstract=substr($abstract,0,200) if length($abstract)>200; - $compiledresult=< +END + $compiledresult.=< + +
+END + $compiledresult.=<Title: $title
Author(s): $author
Subject: $subject
@@ -783,19 +415,40 @@ END # Question... allow to ask question from this page, or click to # search again? - $r->print(<print(< The LearningOnline Network with CAPA +BEGINNING + $r->print(< + function select_data(title,url) { + changeTitle(title); + changeURL(url); + } + function changeTitle(val) { + if (opener.inf.document.forms.resinfo.elements.t) { + opener.inf.document.forms.resinfo.elements.t.value=val; + } + } + function changeURL(val) { + if (opener.inf.document.forms.resinfo.elements.u) { + opener.inf.document.forms.resinfo.elements.u.value=val; + } + } + +SCRIPT + $r->print(<

Search Catalog

+Revise search request

Search Query

-$expression +Basic search: $expression

Search Results

$compiledresult