Diff for /loncom/interface/lonuserutils.pm between versions 1.24 and 1.25

version 1.24, 2007/12/22 03:38:26 version 1.25, 2007/12/22 04:23:05
Line 738  sub print_upload_manager_footer { Line 738  sub print_upload_manager_footer {
     }      }
     if ($context eq 'author') {      if ($context eq 'author') {
         $Str .= '<h3>'.&mt('Default role')."</h3>\n".          $Str .= '<h3>'.&mt('Default role')."</h3>\n".
                 &mt('Choose the role to assign to users without one specified in the uploaded file');                  &mt('Choose the role to assign to users without a value specified in the uploaded file');
     } elsif ($context eq 'course') {      } elsif ($context eq 'course') {
         $Str .= '<h3>'.&mt('Default role and section')."</h3>\n".          $Str .= '<h3>'.&mt('Default role and section')."</h3>\n".
                 &mt('Choose the role and/or section to assign to users without one specified in the uploaded file');                  &mt('Choose the role and/or section(s) to assign to users without values specified in the uploaded file');
     } else {      } else {
         $Str .= '<br /><br /><b>'.&mt('Default role and/or section')."</b><br />\n".          $Str .= '<br /><br /><b>'.&mt('Default role and/or section(s)')."</b><br />\n".
                 &mt('Role and/or section for users without one in the uploaded file.');                  &mt('Role and/or section(s) for users without values specified in the uploaded file.');
     }      }
     $Str .= '<br />';      $Str .= '<br />';
     if (($context eq 'domain') || ($context eq 'author')) {      if (($context eq 'domain') || ($context eq 'author')) {
Line 786  sub forceid_change { Line 786  sub forceid_change {
         "<p>\n".'<label><input type="checkbox" name="forceid" value="yes">'.          "<p>\n".'<label><input type="checkbox" name="forceid" value="yes">'.
         &mt('Disable ID/Student Number Safeguard and Force Change '.          &mt('Disable ID/Student Number Safeguard and Force Change '.
         'of Conflicting IDs').'</label><br />'."\n".          'of Conflicting IDs').'</label><br />'."\n".
         &mt('(only do if you know what you are doing.)')."</br><br />\n";          &mt('(only do if you know what you are doing.)')."\n";
     if ($context eq 'domain') {      if ($context eq 'domain') {
         $output .= '<label><input type="checkbox" name="recurseid"'.          $output .= '<br /><label><input type="checkbox" name="recurseid"'.
                    ' value="yes">'.                      ' value="yes">'. 
   &mt('Update ID/Student Number in courses in which user is Active/Future student,<br />(if forcing change).').    &mt('Update ID/Student Number in courses in which user is Active/Future student,<br />(if forcing change).').
                    '</label></p>'."\n";                     '</label>'."\n";
     }      }
       $output .= '</p>';
     return $output;      return $output;
 }  }
   
Line 962  sub date_setting_table { Line 963  sub date_setting_table {
             ($env{'form.action'} eq 'upload')) {              ($env{'form.action'} eq 'upload')) {
             if ($env{'request.course.sec'} eq '') {              if ($env{'request.course.sec'} eq '') {
                 $dateDefault = '<span class="LC_nobreak">'.                  $dateDefault = '<span class="LC_nobreak">'.
                     '<label><input type="checkbox" name="makedatesdefault" /> '.                      '<label><input type="checkbox" name="makedatesdefault" value="1" /> '.
                     &mt('make these dates the default access dates for future student enrollment').                      &mt('make these dates the default access dates for future student enrollment').
                     '</label></span>';                      '</label></span>';
             }              }
Line 1001  sub make_dates_default { Line 1002  sub make_dates_default {
                 {'default_enrollment_start_date'=>$startdate,                  {'default_enrollment_start_date'=>$startdate,
                  'default_enrollment_end_date'  =>$enddate},$cdom,$cnum);                   'default_enrollment_end_date'  =>$enddate},$cdom,$cnum);
         if ($put_result eq 'ok') {          if ($put_result eq 'ok') {
             $result .= &mt('Set default start and end dates for course').              $result .= &mt('Set default start and end access dates for course.').
                        '<br />'."\n";                         '<br />'."\n";
             #              #
             # Refresh the course environment              # Refresh the course environment
             &Apache::lonnet::coursedescription($env{'request.course.id'},              &Apache::lonnet::coursedescription($env{'request.course.id'},
                                                {'freshen_cache' => 1});                                                 {'freshen_cache' => 1});
         } else {          } else {
             $result .= &mt('Unable to set default dates for course').":".$put_result.              $result .= &mt('Unable to set default access dates for course.').":".$put_result.
                        '<br />';                         '<br />';
         }          }
     }      }
Line 1289  sub print_userlist { Line 1290  sub print_userlist {
         $r->print('<label>'.&mt('Role: [_1]',$role_select).'</label>');          $r->print('<label>'.&mt('Role: [_1]',$role_select).'</label>');
     }      }
     if (!(($context eq 'domain') && ($env{'form.roletype'} eq 'course'))) {      if (!(($context eq 'domain') && ($env{'form.roletype'} eq 'course'))) {
         $r->print(&list_submit_button(&mt('Update Display'))."\n</p>\n");          $r->print('&nbsp;'.&list_submit_button(&mt('Update Display')).
                     "\n</p>\n");
     }      }
     my ($indexhash,$keylist) = &make_keylist_array();      my ($indexhash,$keylist) = &make_keylist_array();
     my (%userlist,%userinfo);      my (%userlist,%userinfo);
Line 1506  sub gather_userinfo { Line 1508  sub gather_userinfo {
                         ($userdata{'start'},$userdata{'end'}) =                           ($userdata{'start'},$userdata{'end'}) = 
                             split(/:/,$rolehash->{$item}{$key});                              split(/:/,$rolehash->{$item}{$key});
                         my $uniqid = $key.':'.$item;                          my $uniqid = $key.':'.$item;
                         &build_user_record($context,\%userdata,$userinfo,$indexhash,                          &build_user_record($context,\%userdata,$userinfo,
                                            $uniqid,$userlist);                                             $indexhash,$uniqid,$userlist);
                     }                      }
                 }                  }
             } elsif ($env{'form.roletype'} eq 'course') {              } elsif ($env{'form.roletype'} eq 'course') {
Line 1525  sub gather_userinfo { Line 1527  sub gather_userinfo {
                                 # FIXME: actions on courses disabled for now                                  # FIXME: actions on courses disabled for now
 #                                if ($permission->{'cusr'}) {  #                                if ($permission->{'cusr'}) {
 #                                    if ($numcids > 1) {  #                                    if ($numcids > 1) {
 #                                        $spanstart .= '<input type="radio" name="'.$item.'" value="'.$cid.'" &nbsp; />';  #                                        $spanstart .= '<input type="radio" name="'.$item.'" value="'.$cid.'" />&nbsp;';
 #                                    } else {  #                                    } else {
 #                                        $spanstart .= '<input type="hidden" name="'.$item.'" value="'.$cid.'" &nbsp; />';  #                                        $spanstart .= '<input type="hidden" name="'.$item.'" value="'.$cid.'" />&nbsp;';
 #                                    }  #                                    }
 #                                }  #                                }
                                 $spanend = '</span><br />';                                  $spanend = '</span><br />';
Line 1537  sub gather_userinfo { Line 1539  sub gather_userinfo {
                                     $rolehash->{$item}{$cid}{'desc'}.$space;                                      $rolehash->{$item}{$cid}{'desc'}.$space;
                             if (ref($rolehash->{$item}{$cid}{'secs'}) eq 'HASH') {                               if (ref($rolehash->{$item}{$cid}{'secs'}) eq 'HASH') { 
                                 foreach my $sec (sort(keys(%{$rolehash->{$item}{$cid}{'secs'}}))) {                                  foreach my $sec (sort(keys(%{$rolehash->{$item}{$cid}{'secs'}}))) {
                                     $userdata{'extent'} .= $sec.$space.$rolehash->{$item}{$cid}{'secs'}{$sec}.$spanend;                                      if (($env{'form.Status'} eq 'Any') ||
                                           ($env{'form.Status'} eq $rolehash->{$item}{$cid}{'secs'}{$sec})) {
                                           $userdata{'extent'} .= $sec.$space.$rolehash->{$item}{$cid}{'secs'}{$sec}.$spanend;
                                           $userdata{'status'} = $rolehash->{$item}{$cid}{'secs'}{$sec};
                                       }
                                 }                                  }
                             }                              }
                         }                          }
                     }                      }
                 }                  }
                 &build_user_record($context,\%userdata,$userinfo,$indexhash,                  if ($userdata{'status'} ne '') {
                                    $item,$userlist);                      &build_user_record($context,\%userdata,$userinfo,
                                          $indexhash,$item,$userlist);
                   }
             }              }
         }          }
     }      }
Line 1850  END Line 1858  END
     if ($mode ne 'autoenroll') {      if ($mode ne 'autoenroll') {
         my $check_uncheck_js = &Apache::loncommon::check_uncheck_jscript();          my $check_uncheck_js = &Apache::loncommon::check_uncheck_jscript();
         my $alert = &mt("You must select at least one user by checking a user's 'Select' checkbox");          my $alert = &mt("You must select at least one user by checking a user's 'Select' checkbox");
         my $singconfirm = &mt(' for a single user');          my $singconfirm = &mt(' for a single user?');
         my $multconfirm = &mt(' for multiple users');          my $multconfirm = &mt(' for multiple users?');
         my $date_sec_selector = &date_section_javascript($context,$setting,$statusmode);           my $date_sec_selector = &date_section_javascript($context,$setting,$statusmode); 
         $r->print(<<END);          $r->print(<<END);
   

Removed from v.1.24  
changed lines
  Added in v.1.25


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