Diff for /loncom/interface/lonuserutils.pm between versions 1.66 and 1.72

version 1.66, 2008/09/12 00:55:37 version 1.72, 2008/10/15 13:00:24
Line 1009  sub date_setting_table { Line 1009  sub date_setting_table {
     }      }
     my $perpetual = '<span class="LC_nobreak"><label><input type="checkbox" name="no_end_date"';      my $perpetual = '<span class="LC_nobreak"><label><input type="checkbox" name="no_end_date"';
     if (defined($endtime) && $endtime == 0) {      if (defined($endtime) && $endtime == 0) {
         $perpetual .= ' checked';          $perpetual .= ' checked="checked"';
     }      }
     $perpetual.= ' /> '.&mt('no ending date').'</label></span>';      $perpetual.= ' /> '.&mt('no ending date').'</label></span>';
     if ($mode eq 'create_enrolldates') {      if ($mode eq 'create_enrolldates') {
Line 1295  sub print_userlist { Line 1295  sub print_userlist {
             $output_selector .= "\n".$option;              $output_selector .= "\n".$option;
         }          }
         $output_selector .= '</select>';          $output_selector .= '</select>';
         $r->print('<label>'.&mt('Output Format: [_1]',$output_selector).'</label>'.('&nbsp;'x3));          $r->print('<label><span class="LC_nobreak">'
     }                   .&mt('Output Format: [_1]',$output_selector)
     $r->print('<label>'.&mt('User Status: [_1]',$status_select).'</label>'.('&nbsp;'x3)."\n");                   .'</span></label>'.('&nbsp;'x3));
       }
       $r->print('<label><span class="LC_nobreak">'
                .&mt('User Status: [_1]',$status_select)
                .'</span></label>'.('&nbsp;'x3)."\n");
     my $roleselected = '';      my $roleselected = '';
     if ($env{'form.showrole'} eq 'Any') {      if ($env{'form.showrole'} eq 'Any') {
        $roleselected = ' selected="selected" ';          $roleselected = ' selected="selected" '; 
Line 1473  sub print_userlist { Line 1477  sub print_userlist {
                                $permission,$env{'form.Status'},\%userlist,$keylist);                                 $permission,$env{'form.Status'},\%userlist,$keylist);
         }          }
         if (!$usercount) {          if (!$usercount) {
             $r->print('<br />'.&mt('There are no users matching the search criteria.'));               $r->print('<br /><span class="LC_warning">'
                        .&mt('There are no users matching the search criteria.')
                        .'</span>'
               ); 
         }          }
     }      }
     $r->print('<input type="hidden" name="phase" value="'.      $r->print('<input type="hidden" name="phase" value="'.
Line 1490  sub role_filter { Line 1497  sub role_filter {
     my ($role_select);      my ($role_select);
     if ($context eq 'domain') {      if ($context eq 'domain') {
         $role_select = &domain_roles_select();          $role_select = &domain_roles_select();
         $output = '<label>'.&mt('Role Type: [_1]',$role_select).'</label>';          $output = '<label><span class="LC_nobreak">'
                    .&mt('Role Type: [_1]',$role_select)
                    .'</span></label>';
     } else {      } else {
         $role_select = '<select name="showrole">'."\n".          $role_select = '<select name="showrole">'."\n".
                        '<option value="Any" '.$roleselected.'>'.                         '<option value="Any" '.$roleselected.'>'.
Line 1510  sub role_filter { Line 1519  sub role_filter {
             $role_select .= '<option value="'.$role.'"'.$roleselected.'>'.$plrole.'</option>';              $role_select .= '<option value="'.$role.'"'.$roleselected.'>'.$plrole.'</option>';
         }          }
         $role_select .= '</select>';          $role_select .= '</select>';
         $output = '<label>'.&mt('Role: [_1]',$role_select).'</label>';          $output = '<label><span class="LC_nobreak">'
                    .&mt('Role: [_1]',$role_select)
                    .'</span></label>';
     }      }
     return $output;      return $output;
 }  }
Line 1893  sub aggregate_user_info { Line 1904  sub aggregate_user_info {
 sub process_date_info {  sub process_date_info {
     my ($userdata) = @_;      my ($userdata) = @_;
     my $now = time;      my $now = time;
     $userdata->{'status'} = 'Active';      $userdata->{'status'} = &mt('Active');
     if ($userdata->{'start'} > 0) {      if ($userdata->{'start'} > 0) {
         if ($now < $userdata->{'start'}) {          if ($now < $userdata->{'start'}) {
             $userdata->{'status'} = 'Future';              $userdata->{'status'} = &mt('Future');
         }          }
     }      }
     if ($userdata->{'end'} > 0) {      if ($userdata->{'end'} > 0) {
         if ($now > $userdata->{'end'}) {          if ($now > $userdata->{'end'}) {
             $userdata->{'status'} = 'Expired';              $userdata->{'status'} = &mt('Expired');
         }          }
     }      }
     return;      return;
Line 2046  END Line 2057  END
                        'aboutme'    => "Display a user's personal page",                         'aboutme'    => "Display a user's personal page",
                        'owin'       => "Open in a new window",                         'owin'       => "Open in a new window",
                        'modify'     => "Modify a user's information",                         'modify'     => "Modify a user's information",
                          'clicker'    => "Clicker-ID",
                       );                        );
     if ($context eq 'domain' && $env{'form.roletype'} eq 'course') {      if ($context eq 'domain' && $env{'form.roletype'} eq 'course') {
         $lt{'extent'} = &mt('Course(s): description, section(s), status');          $lt{'extent'} = &mt('Course(s): description, section(s), status');
Line 2243  END Line 2255  END
                        time.'_'.rand(1000000000).'.csv';                         time.'_'.rand(1000000000).'.csv';
         unless ($CSVfile = Apache::File->new('>/home/httpd'.$CSVfilename)) {          unless ($CSVfile = Apache::File->new('>/home/httpd'.$CSVfilename)) {
             $r->log_error("Couldn't open $CSVfilename for output $!");              $r->log_error("Couldn't open $CSVfilename for output $!");
             $r->print(&mt('Problems occurred in writing the csv file. '              $r->print(&mt('Problems occurred in writing the CSV file. '
                          .'This error has been logged. '                           .'This error has been logged. '
                          .'Please alert your LON-CAPA administrator.'));                           .'Please alert your LON-CAPA administrator.'));
             $CSVfile = undef;              $CSVfile = undef;
         }          }
         #          #
           push @cols,'clicker';
         # Write headers and data to file          # Write headers and data to file
         print $CSVfile '"'.$results_description.'"'."\n";           print $CSVfile '"'.$results_description.'"'."\n"; 
         print $CSVfile '"'.join('","',map {          print $CSVfile '"'.join('","',map {
             &Apache::loncommon::csv_translate($lt{$_})              &Apache::loncommon::csv_translate($lt{$_})
             } (@cols)).'"'."\n";              } (@cols))."\"\n";
     } elsif ($mode eq 'excel') {      } elsif ($mode eq 'excel') {
           push @cols,'clicker';
         # Create the excel spreadsheet          # Create the excel spreadsheet
         ($excel_workbook,$excel_filename,$format) =          ($excel_workbook,$excel_filename,$format) =
             &Apache::loncommon::create_workbook($r);              &Apache::loncommon::create_workbook($r);
Line 2263  END Line 2277  END
         $excel_sheet->write($row++,0,$results_description,$format->{'h2'});          $excel_sheet->write($row++,0,$results_description,$format->{'h2'});
         #          #
         my @colnames = map {$lt{$_}} (@cols);          my @colnames = map {$lt{$_}} (@cols);
   
         $excel_sheet->write($row++,0,\@colnames,$format->{'bold'});          $excel_sheet->write($row++,0,\@colnames,$format->{'bold'});
     }      }
   
Line 2414  END Line 2429  END
         foreach my $item (@{$keylist}) {          foreach my $item (@{$keylist}) {
             $in{$item} = $sdata->[$index{$item}];              $in{$item} = $sdata->[$index{$item}];
         }          }
         my $role = $in{'role'};          my $clickers = (&Apache::lonnet::userenvironment($in{'domain'},$in{'username'},'clickers'))[1];
           if ($clickers!~/\w/) { $clickers='-'; }
           $in{'clicker'} = $clickers; 
    my $role = $in{'role'};
         $in{'role'}=&Apache::lonnet::plaintext($sdata->[$index{'role'}]);           $in{'role'}=&Apache::lonnet::plaintext($sdata->[$index{'role'}]); 
         if (! defined($in{'start'}) || $in{'start'} == 0) {          if (! defined($in{'start'}) || $in{'start'} == 0) {
             $in{'start'} = &mt('none');              $in{'start'} = &mt('none');
Line 2534  END Line 2552  END
             foreach my $item (@cols) {              foreach my $item (@cols) {
                 push @line,&Apache::loncommon::csv_translate($in{$item});                  push @line,&Apache::loncommon::csv_translate($in{$item});
             }              }
             print $CSVfile '"'.join('","',@line).'"'."\n";              print $CSVfile '"'.join('","',@line)."\"\n";
         } elsif ($mode eq 'excel') {          } elsif ($mode eq 'excel') {
             my $col = 0;              my $col = 0;
             foreach my $item (@cols) {              foreach my $item (@cols) {
Line 2557  END Line 2575  END
             $r->print(&Apache::loncommon::end_data_table().'<br />');              $r->print(&Apache::loncommon::end_data_table().'<br />');
     } elsif ($mode eq 'excel') {      } elsif ($mode eq 'excel') {
         $excel_workbook->close();          $excel_workbook->close();
         $r->print('<p><a href="'.$excel_filename.'">'.   $r->print(&mt('[_1]Your Excel spreadsheet[_2] is ready for download.', '<p><a href="'.$excel_filename.'">','</a>')."</p>\n");
                   &mt('Your Excel spreadsheet').'</a> '.&mt('is ready for download').'.</p>'."\n");  
     } elsif ($mode eq 'csv') {      } elsif ($mode eq 'csv') {
         close($CSVfile);          close($CSVfile);
         $r->print('<p><a href="'.$CSVfilename.'">'.   $r->print(&mt('[_1]Your CSV file[_2] is ready for download.', '<p><a href="'.$CSVfilename.'">','</a>')."</p>\n");
                   &mt('Your CSV file').'</a> '.&mt('is ready for download').'.</p>'."\n");  
         $r->rflush();          $r->rflush();
     }      }
     if ($mode eq 'autoenroll') {      if ($mode eq 'autoenroll') {
Line 3617  sub upfile_drop_add { Line 3633  sub upfile_drop_add {
                               '</b>');                                '</b>');
                     next;                      next;
                 } else {                  } else {
                     if ($entries{$fields{'dom'}}                       if ($entries{$fields{'domain'}} 
                         ne &LONCAPA::clean_domain($entries{$fields{'domain'}})) {                          ne &LONCAPA::clean_domain($entries{$fields{'domain'}})) {
                         $r->print('<br />'. '<b>'.$entries{$fields{'domain'}}.                          $r->print('<br />'. '<b>'.$entries{$fields{'domain'}}.
                                   '</b>: '.&mt('Unacceptable domain for user [_2] [_3] [_4] [_5]',$fname,$mname,$lname,$gen).'</b>');                                    '</b>: '.&mt('Unacceptable domain for user [_2] [_3] [_4] [_5]',$fname,$mname,$lname,$gen).'</b>');

Removed from v.1.66  
changed lines
  Added in v.1.72


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