Diff for /loncom/interface/lonsearchcat.pm between versions 1.317 and 1.323

version 1.317, 2009/10/22 13:48:55 version 1.323, 2010/05/04 17:16:34
Line 118  sub handler { Line 118  sub handler {
                       # This is set and used in &handler() and is also used in                         # This is set and used in &handler() and is also used in 
                       # &output_results().                        # &output_results().
   
     my $loaderror=&Apache::lonnet::overloaderror($r);  
     if ($loaderror) { return $loaderror; }  
     #      #
     my $closebutton;  # button that closes the search window       my $closebutton;  # button that closes the search window 
                       # This button is different for the RAT compared to                        # This button is different for the RAT compared to
Line 324  END Line 322  END
         &Apache::lonhtmlcommon::add_breadcrumb          &Apache::lonhtmlcommon::add_breadcrumb
             ({href=>'/adm/searchcat?'.&Apache::loncommon::inhibit_menu_check().              ({href=>'/adm/searchcat?'.&Apache::loncommon::inhibit_menu_check().
                   '&phase=disp_adv'.                    '&phase=disp_adv'.
                   'catalogmode='.$env{'form.catalogmode'}.                    '&catalogmode='.$env{'form.catalogmode'}.
                   '&launch='.$env{'form.launch'}.                    '&launch='.$env{'form.launch'}.
                   '&mode='.$env{'form.mode'},                    '&mode='.$env{'form.mode'},
                   text=>"Course Search",                    text=>"Course Search",
Line 492  sub course_search { Line 490  sub course_search {
     &Apache::lonhtmlcommon::add_breadcrumb      &Apache::lonhtmlcommon::add_breadcrumb
         ({href=>'/adm/searchcat?'.&Apache::loncommon::inhibit_menu_check().          ({href=>'/adm/searchcat?'.&Apache::loncommon::inhibit_menu_check().
               '&phase=disp_adv'.                '&phase=disp_adv'.
               'catalogmode='.$env{'form.catalogmode'}.                '&catalogmode='.$env{'form.catalogmode'}.
               '&launch='.$env{'form.launch'}.                '&launch='.$env{'form.launch'}.
               '&mode='.$env{'form.mode'},                '&mode='.$env{'form.mode'},
               text=>"Course Search",                text=>"Course Search",
Line 770  sub setup_basic_search { Line 768  sub setup_basic_search {
                               portfolio => 'Portfolio Search',                                portfolio => 'Portfolio Search',
     );      );
     my ($userelatedwords,$onlysearchdomain,$inclext,$adv_search_link,$scrout);      my ($userelatedwords,$onlysearchdomain,$inclext,$adv_search_link,$scrout);
     $userelatedwords = '<label>'.&mt('[_1] use related words',  
       &Apache::lonhtmlcommon::checkbox('related',$env{'form.related'},'related')).      $userelatedwords = '<label>'
                        '</label>';                        .&Apache::lonhtmlcommon::checkbox(
     $onlysearchdomain = '<label>'.&mt('[_1] only search domain [_2]',                             'related',
       &Apache::lonhtmlcommon::checkbox('domains',$env{'form.domains'},                             $env{'form.related'},
                                        $r->dir_config('lonDefDomain')),                             'related')
       $r->dir_config('lonDefDomain')).                        .' '
                         '</label>';                       .&mt('use related words')
                        .'</label>';
   
       $onlysearchdomain = '<label>'
                          .&Apache::lonhtmlcommon::checkbox(
                              'domains',
                              $env{'form.domains'},
                              $r->dir_config('lonDefDomain'))
                          .' '
                          .&mt('only search domain [_1]'
                                  ,'<b>'.$r->dir_config('lonDefDomain').'</b>')
                          .'</label>';
   
     $adv_search_link = '<a href="/adm/searchcat?'.      $adv_search_link = '<a href="/adm/searchcat?'.
                &Apache::loncommon::inhibit_menu_check().                 &Apache::loncommon::inhibit_menu_check().
        '&amp;phase=disp_adv'.         '&amp;phase=disp_adv'.
Line 1723  sub parse_domain_restrictions { Line 1733  sub parse_domain_restrictions {
         foreach (sort @allowed_domains) {          foreach (sort @allowed_domains) {
             $pretty_domains_string .= "<b>".$_."</b> ";              $pretty_domains_string .= "<b>".$_."</b> ";
         }          }
  my %servers = &Apache::lonnet::get_servers(\@allowed_domains,   my %servers = &Apache::lonnet::get_unique_servers(\@allowed_domains,
    'library');     'library');
  $libraries_to_query = [keys(%servers)];   $libraries_to_query = [keys(%servers)];
     }      }
Line 2286  sub print_sort_form { Line 2296  sub print_sort_form {
 // <![CDATA[  // <![CDATA[
     function change_sort() {      function change_sort() {
         var newloc = "/adm/searchcat?phase=results";          var newloc = "/adm/searchcat?phase=results";
         newloc += "&amp;persistent_db_id=$env{'form.persistent_db_id'}";          newloc += "&persistent_db_id=$env{'form.persistent_db_id'}";
         newloc += "&amp;sortby=";          newloc += "&sortby=";
         newloc += document.forms.statusform.elements.sortby.value;          newloc += document.forms.statusform.elements.sortby.value;
         parent.resultsframe.location= newloc;          parent.resultsframe.location= newloc;
     }      }
Line 2581  END Line 2591  END
             @Servers_to_contact = ($serverlist);              @Servers_to_contact = ($serverlist);
         }          }
     } else {      } else {
  my %all_library_servers = &Apache::lonnet::all_library();   my %all_library_servers = &Apache::lonnet::unique_library();
         @Servers_to_contact = sort(keys(%all_library_servers));          @Servers_to_contact = sort(keys(%all_library_servers));
     }      }
     my %Server_status;      my %Server_status;
Line 3347  SCRIPT Line 3357  SCRIPT
     }      }
     function select_group() {      function select_group() {
  parent.window.location=   parent.window.location=
     "/adm/groupsort?mode=$env{'form.mode'}&amp;catalogmode=import$inhibit_menu&amp;acts="+      "/adm/groupsort?mode=$env{'form.mode'}&catalogmode=import$inhibit_menu&acts="+
     parent.statusframe.document.forms.statusform.elements.acts.value;      parent.statusframe.document.forms.statusform.elements.acts.value;
     }      }
 // ]]>  // ]]>
Line 3541  sub detailed_citation_view { Line 3551  sub detailed_citation_view {
             $result .= '<b>'.&mt($field->{'translate'}).'</b>';              $result .= '<b>'.&mt($field->{'translate'}).'</b>';
             foreach my $item (split(',',$values{$field->{'name'}})){              foreach my $item (split(',',$values{$field->{'name'}})){
                 $item = &Apache::lonnet::clutter($item);                  $item = &Apache::lonnet::clutter($item);
                 $result .= &display_url($item,[2,0,1]);                  $result .= '<br />'.&display_url($item,1).'<br />';
             }              }
         } elsif (exists($field->{'format'}) && $field->{'format'} ne ''){          } elsif (exists($field->{'format'}) && $field->{'format'} ne ''){
             $result.= &mt($field->{'translate'},              $result.= &mt($field->{'translate'},
Line 3549  sub detailed_citation_view { Line 3559  sub detailed_citation_view {
                                   $values{$field->{'name'}}))."<br />\n";                                    $values{$field->{'name'}}))."<br />\n";
         } else {          } else {
             if ($field->{'special'} eq 'url link') {              if ($field->{'special'} eq 'url link') {
                 $result .= &display_url($jumpurl,[3,0,1]);                  $result .= '<br />'.&display_url($jumpurl,1).'<br />';
             } else {              } else {
                 $result.= &mt($field->{'translate'},                  $result.= &mt($field->{'translate'},
                               $values{$field->{'name'}});                                $values{$field->{'name'}});
Line 3603  sub summary_view { Line 3613  sub summary_view {
     }      }
     my $jumpurl=$values{'url'};      my $jumpurl=$values{'url'};
     $jumpurl=~s|^/ext/|http://|;      $jumpurl=~s|^/ext/|http://|;
     my $link = &display_url($jumpurl,[2,0,1]);      my $link = '<br />'.&display_url($jumpurl,1).'<br />';
   
     $result.=<<END;      $result.=<<END;
 <a href="$jumpurl?inhibitmenu=yes"   <a href="$jumpurl?inhibitmenu=yes" 
Line 3639  sub compact_view { Line 3649  sub compact_view {
     my $jumpurl=$values{'url'};      my $jumpurl=$values{'url'};
     $jumpurl=~s|^/ext/|http://|;      $jumpurl=~s|^/ext/|http://|;
   
     my $link = &display_url($jumpurl,[1,1,1]);      my $link = &display_url($jumpurl,1);
           
     my $result =       my $result = 
         $prefix.'<img src="'.&Apache::loncommon::icon($values{'url'}).'" alt="" />';          $prefix.'<img src="'.&Apache::loncommon::icon($values{'url'}).'" alt="" />';
Line 3658  sub compact_view { Line 3668  sub compact_view {
 }  }
   
 sub display_url {  sub display_url {
     my ($url,$crumb_args) = @_;      my ($url,$skiplast) = @_;
     my $link;      my $link;
     if ($url=~m|^/ext/|) {      if ($url=~m|^/ext/|) {
  $url=~s|^/ext/|http://|;   $url=~s|^/ext/|http://|;
Line 3666  sub display_url { Line 3676  sub display_url {
     } elsif ($url=~m{^(http://|/uploaded/)}) {      } elsif ($url=~m{^(http://|/uploaded/)}) {
  $link='<span class="LC_filename">'.$url.'</span>';   $link='<span class="LC_filename">'.$url.'</span>';
     } else {      } else {
         $link=&Apache::lonhtmlcommon::crumbs($url,          $link=&Apache::lonhtmlcommon::crumbs(
   'preview',                    $url,
   '',                    'preview',
   (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),@{$crumb_args}).' ';                    '',
                     (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),
                     $skiplast).' ';
     }      }
     return $link;      return $link;
 }  }

Removed from v.1.317  
changed lines
  Added in v.1.323


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