Diff for /loncom/interface/lonsearchcat.pm between versions 1.331.4.10 and 1.336

version 1.331.4.10, 2014/02/23 22:16:20 version 1.336, 2013/09/01 22:39:39
Line 52  search (on a server basis) is displayed Line 52  search (on a server basis) is displayed
   
 =head1 Internals  =head1 Internals
   
   =over 4
   
 =cut  =cut
   
 ###############################################################################  ###############################################################################
Line 170  sub handler { Line 172  sub handler {
     &Apache::lonhtmlcommon::clear_breadcrumbs();      &Apache::lonhtmlcommon::clear_breadcrumbs();
   
     my @allowed_searches = ('portfolio');      my @allowed_searches = ('portfolio');
     if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'}) eq 'F') {      if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'})) {
         push(@allowed_searches,'res');          push(@allowed_searches,'res');
     }       } 
     my $crumb_text = 'Portfolio Search';      my $crumb_text = 'Portfolio Search';
Line 193  sub handler { Line 195  sub handler {
                 &Apache::lonnet::logthis('lonsearchcat:'.                  &Apache::lonnet::logthis('lonsearchcat:'.
                                          'Unable to recover data from '.                                           'Unable to recover data from '.
                                          $persistent_db_file);                                           $persistent_db_file);
                 my $msg =   my $msg =
                     &mt('We were unable to retrieve data describing your search.').      'We were unable to retrieve data describing your search. '.
                     ' '.&mt('This is a serious error and has been logged.').      'This is a serious error and has been logged. '.
                     '<br />'.      'Please alert your LON-CAPA administrator.';
                     &mt('Please alert your LON-CAPA administrator.');   &Apache::loncommon::simple_error_page($r,'Search Error',
                 &Apache::loncommon::simple_error_page(        $msg);
                     $r,'Search Error',  
                     $msg,  
                     {'no_auto_mt_msg' => 1});  
  return OK;   return OK;
             }              }
         }          }
Line 429  sub hidden_field { Line 428  sub hidden_field {
   
 ######################################################################  ######################################################################
   
 =pod  =pod 
   
 =over 4  
   
 =item &print_basic_search_form()   =item &print_basic_search_form() 
   
Line 449  sub print_basic_search_form { Line 446  sub print_basic_search_form {
     $env{'form.catalogmode'} ne 'import');      $env{'form.catalogmode'} ne 'import');
     my $scrout = &Apache::loncommon::start_page('Content Library').$bread_crumb;      my $scrout = &Apache::loncommon::start_page('Content Library').$bread_crumb;
 # Search form for resource space   # Search form for resource space 
     if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'}) eq 'F') {      if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'})) {
         $scrout .= &setup_basic_search($r,'res',$hidden_fields,$closebutton);          $scrout .= &setup_basic_search($r,'res',$hidden_fields,$closebutton);
         $scrout .= '<hr /><br />';          $scrout .= '<hr /><br />';
     }      }
Line 1018  This function is the reverse of &make_pe Line 1015  This function is the reverse of &make_pe
 Retrieve persistent data from %persistent_db.  Retrieved items will have their  Retrieve persistent data from %persistent_db.  Retrieved items will have their
 values unescaped.  If the item is 'domains; then the returned  values unescaped.  If the item is 'domains; then the returned
 value will be a hash pointer.  Otherwise, if the item contains  value will be a hash pointer.  Otherwise, if the item contains
 commas (before unescaping), the returned value will be an array pointer.  commas (before unescaping), the returned value will be an array pointer. 
   
 =cut  =cut
   
Line 1074  Store variables away to the %persistent_ Line 1071  Store variables away to the %persistent_
 Values will be escaped.  Values that are array pointers will have their  Values will be escaped.  Values that are array pointers will have their
 elements escaped and concatenated in a comma separated string. Values   elements escaped and concatenated in a comma separated string. Values 
 that are hash pointers will have their keys and values escaped and   that are hash pointers will have their keys and values escaped and 
 concatenated in a comma separated string.  concatenated in a comma separated string
   
 =cut  =cut
   
Line 2090  END Line 2087  END
 #    $result.="</select>\n";  #    $result.="</select>\n";
     my $revise = &revise_button();      my $revise = &revise_button();
     $result.='<p>'      $result.='<p>'
             .&mt('Total of [quant,_1,match,matches] to your query.',$total_results)              .&mt('There are [_1] matches to your query.',$total_results)
             .' '.$revise.'</p>'              .' '.$revise.'</p>'
             .'<p>'.&mt('Search: ').$pretty_query_string              .'<p>'.&mt('Search: ').$pretty_query_string
             .'</p></form>';              .'</p></form>';
Line 2362  END Line 2359  END
                 my $major = $1;                  my $major = $1;
                 my $minor = $2;                  my $minor = $2;
                 if (($major < 2) || (($major == 2) && ($minor < 11))) {                  if (($major < 2) || (($major == 2) && ($minor < 11))) {
                     map { $older_library_servers{$_} = 1; }                      map { $older_library_servers{$_} = 1; } 
                         &Apache::lonnet::machine_ids($library_servers{$key});                          &Apache::lonnet::machine_ids($library_servers{$key});
                 }                  }
             }              }
Line 2372  END Line 2369  END
         foreach my $server (@Servers_to_contact) {          foreach my $server (@Servers_to_contact) {
             my %possdoms;              my %possdoms;
             map { $possdoms{$_}=1;  } &Apache::lonnet::machine_domains($all_library_servers{$server});              map { $possdoms{$_}=1;  } &Apache::lonnet::machine_domains($all_library_servers{$server});
             $domains_by_server{$server} =              $domains_by_server{$server} = 
                 join(',',sort(&Apache::lonnet::machine_domains($all_library_servers{$server})));                  join(',',sort(&Apache::lonnet::machine_domains($all_library_servers{$server})));
         }          }
     }      }
Line 3151  SCRIPT Line 3148  SCRIPT
   
     my $start_page  = &Apache::loncommon::start_page(undef,$js,      my $start_page  = &Apache::loncommon::start_page(undef,$js,
      {'only_body' =>1,       {'only_body' =>1,
                                                       'add_wishlist' =>1,                                                        'add_wishlist' =>1});
                                                       'add_modal' =>1});  
     my $result=<<END;      my $result=<<END;
 $start_page  $start_page
 <form name="results" method="post" action="/adm/searchcat">  <form name="results" method="post" action="/adm/searchcat">

Removed from v.1.331.4.10  
changed lines
  Added in v.1.336


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