Diff for /loncom/interface/lonuserutils.pm between versions 1.94 and 1.95

version 1.94, 2009/06/05 12:49:50 version 1.95, 2009/08/03 15:57:25
Line 329  sub print_upload_manager_header { Line 329  sub print_upload_manager_header {
                                 $env{'request.role.domain'},$context,                                  $env{'request.role.domain'},$context,
                                 $groupslist);                                  $groupslist);
     my $checked=(($env{'form.noFirstLine'})?' checked="checked"':'');      my $checked=(($env{'form.noFirstLine'})?' checked="checked"':'');
     $r->print(&mt('Total number of records found in file: [_1]','<b>'.$distotal.'</b>').      $r->print('<p>'
               "<br />\n");               .&mt('Total number of records found in file: [_1]'
                    ,'<b>'.$distotal.'</b>')
                ."</p>\n");
     $r->print('<div class="LC_left_float"><h3>'.      $r->print('<div class="LC_left_float"><h3>'.
               &mt('Identify fields in uploaded list')."</h3>\n");                &mt('Identify fields in uploaded list')."</h3>\n");
     $r->print(&mt('Enter as many fields as you can.<br /> The system will inform you and bring you back to this page, <br /> if the data selected are insufficient to add users.')."<br />\n");      $r->print(&mt('Enter as many fields as you can.<br /> The system will inform you and bring you back to this page, <br /> if the data selected are insufficient to add users.')."<br />\n");
Line 757  sub print_upload_manager_footer { Line 759  sub print_upload_manager_footer {
     my $locform = &Apache::loncommon::authform_local(%param);      my $locform = &Apache::loncommon::authform_local(%param);
     my $date_table = &date_setting_table(undef,undef,$context,undef,      my $date_table = &date_setting_table(undef,undef,$context,undef,
                                          $formname,$permission);                                           $formname,$permission);
   
     my $Str = "\n".'<div class="LC_left_float">';      my $Str = "\n".'<div class="LC_left_float">';
     $Str .= &hidden_input('nfields',$i);      $Str .= &hidden_input('nfields',$i);
     $Str .= &hidden_input('keyfields',$keyfields);      $Str .= &hidden_input('keyfields',$keyfields);
     $Str .= "<h3>".&mt('Login Type')."</h3>\n";  
       $Str .= '<h3>'.&mt('Options').'</h3>'
              .&Apache::lonhtmlcommon::start_pick_box();
   
       $Str .= &Apache::lonhtmlcommon::row_title(&mt('Login Type'));
     if ($context eq 'domain') {      if ($context eq 'domain') {
         $Str .= '<p>'.&mt('Change authentication for existing users in domain "[_1]" to these settings?',$defdom).'&nbsp;<span class="LC_nobreak"><label><input type="radio" name="changeauth" value="No" checked="checked" />'.&mt('No').'</label>&nbsp;&nbsp;<label><input type="radio" name="changeauth" value="Yes" />'.&mt('Yes').'</label></span></p>';           $Str .= '<p>'
                  .&mt('Change authentication for existing users in domain "[_1]" to these settings?'
                      ,$defdom)
                  .'&nbsp;<span class="LC_nobreak"><label>'
                  .'<input type="radio" name="changeauth" value="No" checked="checked" />'
                  .&mt('No').'</label>'
                  .'&nbsp;&nbsp;<label>'
                  .'<input type="radio" name="changeauth" value="Yes" />'
                  .&mt('Yes').'</label>'
                  .'</span></p>'; 
     } else {      } else {
         $Str .= "<p>\n".          $Str .= '<p class="LC_info">'."\n".
             &mt('Note: This will not take effect if the user already exists.').              &mt('This will not take effect if the user already exists.').
             &Apache::loncommon::help_open_topic('Auth_Options').              &Apache::loncommon::help_open_topic('Auth_Options').
             "</p>\n";              "</p>\n";
     }      }
     $Str .= &set_login($defdom,$krbform,$intform,$locform);      $Str .= &set_login($defdom,$krbform,$intform,$locform)
              .&Apache::lonhtmlcommon::row_closure();
   
     my ($home_server_pick,$numlib) =      my ($home_server_pick,$numlib) =
         &Apache::loncommon::home_server_form_item($defdom,'lcserver',          &Apache::loncommon::home_server_form_item($defdom,'lcserver',
                                                   'default','hide');                                                    'default','hide');
   #FIXME: Broken?!? $home_server_pick returns empty value on prod (2.8.1) and on dev server. SB 2009-08-03
     if ($numlib > 1) {      if ($numlib > 1) {
         $Str .= '<h3>'.&mt('LON-CAPA Home Server for New Users')."</h3>\n".          $Str .= &Apache::lonhtmlcommon::row_title(
                 &mt('LON-CAPA domain: [_1] with home server: [_2]',$defdom,                      &mt('LON-CAPA Home Server for New Users'))
                 $home_server_pick).'<br />';                 .&mt('LON-CAPA domain: [_1] with home server:','"'.$defdom.'"')
     } else {                 .$home_server_pick
         $Str .= $home_server_pick;                 .&Apache::lonhtmlcommon::row_closure();
     }      } else {
     $Str .= '<h3>'.&mt('Default domain').'</h3>'."\n".          $Str .= &Apache::lonhtmlcommon::row_title(&mt('Home Server'))
             &Apache::loncommon::select_dom_form($defdom,'defaultdomain',undef,1);                 .$home_server_pick
     $Str .= '<h3>'.&mt('Starting and Ending Dates').                 .&Apache::lonhtmlcommon::row_closure();
             "</h3>\n";      }
     $Str .= "<p>\n".$date_table."</p>\n";  
       $Str .= &Apache::lonhtmlcommon::row_title(&mt('Default domain'))
              .&Apache::loncommon::select_dom_form($defdom,'defaultdomain',undef,1)
              .&Apache::lonhtmlcommon::row_closure();
   
       $Str .= &Apache::lonhtmlcommon::row_title(&mt('Starting and Ending Dates'))
              ."<p>\n".$date_table."</p>\n"
              .&Apache::lonhtmlcommon::row_closure();
   
     if ($context eq 'domain') {      if ($context eq 'domain') {
         $Str .= '<h3>'.&mt('Settings for assigning roles:').'</h3>'."\n".          $Str .= &Apache::lonhtmlcommon::row_title(
                 &mt('Pick the action to take on roles for these users:').'<br /><span class="LC_nobreak"><label><input type="radio" name="roleaction" value="norole" checked="checked" />&nbsp;'.&mt('No role changes').'</label>&nbsp;&nbsp;&nbsp;<label><input type="radio" name="roleaction" value="domain" />&nbsp;'.&mt('Add a domain role').'</label>&nbsp;&nbsp;&nbsp;<label><input type="radio" name="roleaction" value="course" />&nbsp;'.&mt('Add a course role').'</label></span>';                      &mt('Settings for assigning roles'))
     }                 .&mt('Pick the action to take on roles for these users:').'<br />'
     if ($context eq 'author') {                 .'<span class="LC_nobreak"><label>'
         $Str .= '<h3>'.&mt('Default role')."</h3>\n".                 .'<input type="radio" name="roleaction" value="norole" checked="checked" />'
                 &mt('Choose the role to assign to users without a value specified in the uploaded file');                 .'&nbsp;'.&mt('No role changes').'</label>'
                  .'&nbsp;&nbsp;&nbsp;<label>'
                  .'<input type="radio" name="roleaction" value="domain" />'
                  .'&nbsp;'.&mt('Add a domain role').'</label>'
                  .'&nbsp;&nbsp;&nbsp;<label>'
                  .'<input type="radio" name="roleaction" value="course" />'
                  .'&nbsp;'.&mt('Add a course role').'</label>'
                  .'</span>';
       } elsif ($context eq 'author') {
           $Str .= &Apache::lonhtmlcommon::row_title(
                       &mt('Default role'))
                  .&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 .= &Apache::lonhtmlcommon::row_title(
                 &mt('Choose the role and/or section(s) to assign to users without values specified in the uploaded file');                      &mt('Default role and section'))
     } else {                 .&mt('Choose the role and/or section(s) to assign to users without values specified in the uploaded file.');
         $Str .= '<br /><br /><b>'.&mt('Default role and/or section(s)')."</b><br />\n".      } else {
                 &mt('Role and/or section(s) for users without values specified in the uploaded file.');          $Str .= &Apache::lonhtmlcommon::row_title(
                       &mt('Default role and/or section(s)'))
                  .&mt('Role and/or section(s) for users without values specified in the uploaded file.');
     }      }
     $Str .= '<br />';  
     if (($context eq 'domain') || ($context eq 'author')) {      if (($context eq 'domain') || ($context eq 'author')) {
           $Str .= '<br />';
         my ($options,$cb_script,$coursepick) = &default_role_selector($context,1);          my ($options,$cb_script,$coursepick) = &default_role_selector($context,1);
         if ($context eq 'domain') {          if ($context eq 'domain') {
             $Str .= '<span class="LC_role_level">'.&mt('Domain Level').'</span><br />'.$options.'<br /><br /><span class="LC_role_level">'.&mt('Course Level').'</span><br />'.$cb_script.$coursepick;              $Str .= '<p>'
                      .'<b>'.&mt('Domain Level').'</b><br />'
                      .$options
                      .'</p><p>'
                      .'<b>'.&mt('Course Level').'</b>'
                      .'</p>'
                      .$cb_script.$coursepick
                      .&Apache::lonhtmlcommon::row_closure();
         } elsif ($context eq 'author') {          } elsif ($context eq 'author') {
             $Str .= $options;              $Str .= $options
                      .&Apache::lonhtmlcommon::row_closure(1); # last row in pick_box
         }          }
     } else {      } else {
         my ($cnum,$cdom) = &get_course_identity();          my ($cnum,$cdom) = &get_course_identity();
         my $rowtitle = &mt('section');          my $rowtitle = &mt('section');
         my $secbox = &section_picker($cdom,$cnum,'Any',$rowtitle,          my $secbox = &section_picker($cdom,$cnum,'Any',$rowtitle,
                                      $permission,$context,'upload');                                       $permission,$context,'upload');
         $Str .= $secbox."<h3>".&mt('Full Update')."</h3>\n".          $Str .= $secbox
                 '<p><label><input type="checkbox" name="fullup" value="yes" />'.                 .&Apache::lonhtmlcommon::row_closure();
                 ' '.&mt('Display students with current/future access who are not in the uploaded file.').'</label><br />'.&mt('Students selected from this list can be dropped.').'</p>'."\n";  
           $Str .= &Apache::lonhtmlcommon::row_title(&mt('Full Update'))
                  .'<label><input type="checkbox" name="fullup" value="yes" />'.
                   ' '.&mt('Display students with current/future access who are not in the uploaded file.')
                  .'</label><br />'
                  .&mt('Students selected from this list can be dropped.')
                  .&Apache::lonhtmlcommon::row_closure();
     }      }
     if ($context eq 'course' || $context eq 'domain') {      if ($context eq 'course' || $context eq 'domain') {
         $Str .= &forceid_change($context);          $Str .= &forceid_change($context);
     }      }
   
       $Str .= &Apache::lonhtmlcommon::end_pick_box();
     $Str .= '</div>';      $Str .= '</div>';
     $Str .= '<div class="LC_clear_float_footer">';  
       # Footer
       $Str .= '<div class="LC_clear_float_footer">'
              .'<hr />';
     if ($context eq 'course') {      if ($context eq 'course') {
         $Str .= '<div class="LC_info">'          $Str .= '<p class="LC_info">'
                .&mt('Note: For large courses, this operation may be time consuming.')                 .&mt('Note: For large courses, this operation may be time consuming.')
                .'</div>';                 .'</p>';
     }      }
     $Str .= '<input type="button"'      $Str .= '<p><input type="button"'
            .'onClick="javascript:verify(this.form,this.form.csec)" '             .'onClick="javascript:verify(this.form,this.form.csec)" '
            .'value="'.&mt('Update Users').'" />'."\n"             .'value="'.&mt('Update Users').'" />'
              .'</p>'."\n"
            .'</div>';             .'</div>';
     $r->print($Str);      $r->print($Str);
     return;      return;
Line 837  sub print_upload_manager_footer { Line 897  sub print_upload_manager_footer {
 sub forceid_change {  sub forceid_change {
     my ($context) = @_;      my ($context) = @_;
     my $output =       my $output = 
         "<h3>".&mt('Student/Employee ID')."</h3>\n".          &Apache::lonhtmlcommon::row_title(&mt('Student/Employee ID'))
         "<p>\n".'<label><input type="checkbox" name="forceid" value="yes" />'.         .'<label><input type="checkbox" name="forceid" value="yes" />'
         &mt('Disable Student/Employee ID Safeguard and force change of conflicting IDs').         .&mt('Disable Student/Employee ID Safeguard and force change of conflicting IDs')
         '</label><br />'."\n".         .'</label><br />'."\n"
         &mt('(only do if you know what you are doing.)')."\n";         .&mt('(only do if you know what you are doing.)')."\n";
     if ($context eq 'domain') {      if ($context eq 'domain') {
         $output .= '<br /><label><input type="checkbox" name="recurseid"'.          $output .= '<br /><label><input type="checkbox" name="recurseid"'.
                    ' value="yes" />'.                      ' value="yes" />'. 
   &mt('Update student/employee ID in courses in which user is active/future student,[_1](if forcing change).','<br />').    &mt('Update student/employee ID in courses in which user is active/future student,[_1](if forcing change).','<br />').
                    '</label>'."\n";                     '</label>'."\n";
     }      }
     $output .= '</p>';      $output .= &Apache::lonhtmlcommon::row_closure(1); # last row in pick_box
     return $output;      return $output;
 }  }
   
Line 3417  sub print_first_users_upload_form { Line 3477  sub print_first_users_upload_form {
     $str  = '<input type="hidden" name="phase" value="two" />';      $str  = '<input type="hidden" name="phase" value="two" />';
     $str .= '<input type="hidden" name="action" value="upload" />';      $str .= '<input type="hidden" name="action" value="upload" />';
     $str .= '<input type="hidden"   name="state"  value="got_file" />';      $str .= '<input type="hidden"   name="state"  value="got_file" />';
   
     $str .= '<h2>'.&mt('Upload a file containing information about users').'</h2>'."\n";      $str .= '<h2>'.&mt('Upload a file containing information about users').'</h2>'."\n";
     $str .= '<p class="LC_info">'  
            .&mt('Please upload an UTF8 encoded file to ensure a correct character encoding in your classlist.')      # Excel and CSV Help
            .'</p>'."\n";      $str .= '<p>'
     $str .= &Apache::loncommon::upfile_select_html();             .&Apache::loncommon::help_open_topic("Course_Create_Class_List",
     $str .= '<p>';                  &mt("How do I create a users list from a spreadsheet"))
     $str .= &Apache::loncommon::help_open_topic("Course_Create_Class_List",             ."<br />\n"
                          &mt("How do I create a users list from a spreadsheet")).             .&Apache::loncommon::help_open_topic("Course_Convert_To_CSV",
                              "<br />\n";                  &mt("How do I create a CSV file from a spreadsheet"))
     $str .= &Apache::loncommon::help_open_topic("Course_Convert_To_CSV",             ."</p>\n";
                            &mt("How do I create a CSV file from a spreadsheet"));  
     $str .= "</p>\n";      $str .= &Apache::lonhtmlcommon::start_pick_box()
     $str .= "<p>\n";             .&Apache::lonhtmlcommon::row_title(&mt('File'))
     $str .= '<label><input type="checkbox" name="noFirstLine" /> '.             .'<p class="LC_info">'."\n"
         &mt('Ignore First Line')."</label></p>\n";             .&mt('Please upload an UTF8 encoded file to ensure a correct character encoding in your classlist.')."\n"
     $str .= '<input type="submit" name="fileupload" value="'.             .'</p>'."\n"
         &mt('Next').'" />'."<br />\n";             .&Apache::loncommon::upfile_select_html()
              .&Apache::lonhtmlcommon::row_closure()
              .&Apache::lonhtmlcommon::row_title(
                   '<label for="noFirstLine">'
                  .&mt('Ignore First Line')
                  .'</label>')
              .'<input type="checkbox" name="noFirstLine" id="noFirstLine" />'
              .&Apache::lonhtmlcommon::row_closure(1)
              .&Apache::lonhtmlcommon::end_pick_box();
   
       $str .= '<p>'
              .'<input type="submit" name="fileupload" value="'.&mt('Next').'" />'
              .'</p>';
   
     $str .= &Apache::loncommon::end_page();      $str .= &Apache::loncommon::end_page();
   
     $r->print($str);      $r->print($str);
     return;      return;
 }  }

Removed from v.1.94  
changed lines
  Added in v.1.95


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