Diff for /loncom/interface/lonsearchcat.pm between versions 1.93 and 1.97

version 1.93, 2001/04/02 21:18:35 version 1.97, 2001/08/16 02:20:01
Line 1 Line 1
 # The LearningOnline Network  # The LearningOnline Network
 # Search Catalog  # Search Catalog
 #  #
   # YEAR=2001
 # 03/08/2001 Scott Harrison  # 03/08/2001 Scott Harrison
 # Scott Harrison: 03/12/2001, 03/13/2001, 03/14/2001, 03/15/2001, 03/19/2001  # Scott Harrison: 03/12/2001, 03/13/2001, 03/14/2001, 03/15/2001, 03/19/2001
 # Scott Harrison: 03/20/2001, 03/21/2001, 03/22/2001, 03/26/2001, 03/27/2001  # Scott Harrison: 03/20/2001, 03/21/2001, 03/22/2001, 03/26/2001, 03/27/2001
 # Scott Harrison: 04/02/2001  # Scott Harrison: 04/02/2001, 08/15/2001
 #  #
 # Functions  # Functions
 #  #
Line 182  END Line 183  END
     $scrout.=&searchphrasefield('Limit by URL','url',      $scrout.=&searchphrasefield('Limit by URL','url',
  $ENV{'form.url'});   $ENV{'form.url'});
   
     $scrout.=&searchphrasefield('Limit by version','version',  #    $scrout.=&searchphrasefield('Limit by version','version',
  $ENV{'form.version'});  # $ENV{'form.version'});
   
     $scrout.=&searchphrasefield('Limit by notes','notes',      $scrout.=&searchphrasefield('Limit by notes','notes',
  $ENV{'form.notes'});   $ENV{'form.notes'});
Line 301  ENDDOCUMENT Line 302  ENDDOCUMENT
     $r->print(' ');      $r->print(' ');
     $r->print(&simplecheckbox('titleonly',$ENV{'form.titleonly'}));      $r->print(&simplecheckbox('titleonly',$ENV{'form.titleonly'}));
     $r->print('<font color="#800000">Title only</font> ');      $r->print('<font color="#800000">Title only</font> ');
     $r->print(&simplecheckbox('allversions',$ENV{'form.allversions'}));  #    $r->print(&simplecheckbox('allversions',$ENV{'form.allversions'}));
   # <font color="#800000">Search historic archives</font>
     $r->print(<<ENDDOCUMENT);      $r->print(<<ENDDOCUMENT);
 <font color="#800000">Search historic archives</font>  
 <br>  <br>
 <input type="submit" name="basicsubmit" value='SEARCH' />  <input type="submit" name="basicsubmit" value='SEARCH' />
 <input type="reset" name="reset" value='RESET' />  <input type="reset" name="reset" value='RESET' />
Line 658  sub basicsearch { Line 659  sub basicsearch {
     my $query='';      my $query='';
     my $concatarg=join(',"    ",',      my $concatarg=join(',"    ",',
        ('title', 'author', 'subject', 'notes', 'abstract'));         ('title', 'author', 'subject', 'notes', 'abstract'));
     $query='select * from metadata where concat(' . $concatarg . ') like %' .      $concatarg='title' if $ENV{'form.titleonly'};
    $ENV{'form.basicexp'} . '%';  
       $query=&build_SQL_query('concat('.$concatarg.')',$ENV{'form.'.'basicexp'});
   
   
     # Get reply (either a hash reference to filehandles or bad connection)      # Get reply (either a hash reference to filehandles or bad connection)
     my $reply=&Apache::lonnet::metadata_query($query);      my $reply=&Apache::lonnet::metadata_query('select * from metadata where '.$query);
   
     # Output search results      # Output search results
     &output_results('Basic',$r,$envhash,$query,$reply);      &output_results('Basic',$r,$envhash,$query,$reply);
Line 728  BEGINNING Line 731  BEGINNING
     function select_data(title,url) {      function select_data(title,url) {
  changeTitle(title);   changeTitle(title);
  changeURL(url);   changeURL(url);
    self.close();
     }      }
     function changeTitle(val) {      function changeTitle(val) {
  if (opener.inf.document.forms.resinfo.elements.t) {   if (opener.inf.document.forms.resinfo.elements.t) {
Line 991  sub recursive_SQL_query_build { Line 995  sub recursive_SQL_query_build {
  if ($key eq 'literal') {   if ($key eq 'literal') {
     $replacement="($dkey like \"\%$value\%\")";      $replacement="($dkey like \"\%$value\%\")";
  }   }
    elsif ($key eq 'not') {
       $value=~s/like/not like/;
   #    $replacement="($dkey not like $value)";
       $replacement="$value";
    }
  elsif ($key eq 'and') {   elsif ($key eq 'and') {
     $value=~/(.*[\"|\)]) ([|\(|\^].*)/;      $value=~/(.*[\"|\)]) ([|\(|\^].*)/;
     $replacement="($1 AND $2)";      $replacement="($1 AND $2)";

Removed from v.1.93  
changed lines
  Added in v.1.97


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>