Diff for /loncom/interface/lonsearchcat.pm between versions 1.337 and 1.343

version 1.337, 2013/09/02 00:00:49 version 1.343, 2014/02/23 22:15:27
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 172  sub handler { Line 170  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'})) {      if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'}) eq 'F') {
         push(@allowed_searches,'res');          push(@allowed_searches,'res');
     }       } 
     my $crumb_text = 'Portfolio Search';      my $crumb_text = 'Portfolio Search';
Line 195  sub handler { Line 193  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 =
     'We were unable to retrieve data describing your search. '.                      &mt('We were unable to retrieve data describing your search.').
     'This is a serious error and has been logged. '.                      ' '.&mt('This is a serious error and has been logged.').
     'Please alert your LON-CAPA administrator.';                      '<br />'.
  &Apache::loncommon::simple_error_page($r,'Search Error',                      &mt('Please alert your LON-CAPA administrator.');
       $msg);                  &Apache::loncommon::simple_error_page(
                       $r,'Search Error',
                       $msg,
                       {'no_auto_mt_msg' => 1});
  return OK;   return OK;
             }              }
         }          }
Line 428  sub hidden_field { Line 429  sub hidden_field {
   
 ######################################################################  ######################################################################
   
 =pod   =pod
   
   =over 4
    
 =item &print_basic_search_form()   =item &print_basic_search_form() 
   
 Prints the form for the basic search.  Sorry the name is so cryptic.  Prints the form for the basic search.  Sorry the name is so cryptic.
Line 446  sub print_basic_search_form { Line 449  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'})) {      if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'}) eq 'F') {
         $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 1015  This function is the reverse of &make_pe Line 1018  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 1071  Store variables away to the %persistent_ Line 1074  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 2359  END Line 2362  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 2369  END Line 2372  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 3148  SCRIPT Line 3151  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.337  
changed lines
  Added in v.1.343


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