[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm loncreateuser.pm lonuserutils.pm

raeburn raeburn at source.lon-capa.org
Mon May 4 15:42:58 EDT 2026


raeburn		Mon May  4 19:42:58 2026 EDT

  Modified files:              
    /loncom/interface	loncommon.pm loncreateuser.pm lonuserutils.pm 
  Log:
  - WCAG 2 compliance.
    Include labels for form elements.
    Group form elements in fieldset with legend for screenreaders.
    Satisfy minimum spacing between touch targets.
    Replace use of <table> for layout with <div>.
  
  
-------------- next part --------------
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1519 loncom/interface/loncommon.pm:1.1520
--- loncom/interface/loncommon.pm:1.1519	Tue Apr 28 02:36:03 2026
+++ loncom/interface/loncommon.pm	Mon May  4 19:42:58 2026
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1519 2026/04/28 02:36:03 raeburn Exp $
+# $Id: loncommon.pm,v 1.1520 2026/05/04 19:42:58 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -9096,6 +9096,7 @@
 fieldset.LC_grace,
 fieldset.LC_wcag,
 fieldset.LC_autoaddsdrops,
+fieldset.LC_assignrole,
 fieldset#LC_additionalrecips {
   display:inline;
 }
@@ -9639,12 +9640,14 @@
 }
 
 table.LC_resourceList tr.LC_odd_row th,
+table.LC_createuser tr.LC_odd_row th.LC_rowheader,
 table.LC_paramDefault tr.LC_odd_row th.LC_rowheader,
 table#contentlist tr.LC_odd_row th {
   background-color: $data_table_light;
 }
 
 table.LC_resourceList tr.LC_even_row th,
+table.LC_createuser tr.LC_even_row th.LC_rowheader,
 table.LC_paramDefault tr.LC_even_row th.LC_rowheader,
 table#contentlist tr.LC_even_row th {
   background-color: $data_table_dark;
@@ -9657,6 +9660,8 @@
 table.LC_resourceList tr th.LC_rowheader,
 table.LC_paramDefault tr.LC_odd_row th.LC_rowheader,
 table.LC_paramDefault tr.LC_even_row th.LC_rowheader,
+table.LC_createuser tr.LC_odd_row th.LC_rowheader,
+table.LC_createuser tr.LC_even_row th.LC_rowheader,
 table#contentlist tr.LC_odd_row th.LC_rowheader,
 table#contentlist tr.LC_even_row th.LC_rowheader {
   font-weight: normal;
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.494 loncom/interface/loncreateuser.pm:1.495
--- loncom/interface/loncreateuser.pm:1.494	Wed Apr 29 16:59:22 2026
+++ loncom/interface/loncreateuser.pm	Mon May  4 19:42:58 2026
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.494 2026/04/29 16:59:22 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.495 2026/05/04 19:42:58 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -199,7 +199,7 @@
                    ' />'.$lt{'cust'}.':</label> '.
                    '<input type="text" name="'.$name.'quota" id="'.$name.'quota" size ="5" '.
                    'value="'.$showquota.'" onfocus="javascript:quota_changes('."'quota','$name'".');"'.
-                   ' /> '.&mt('MB').'</span></td>'."\n".
+                   ' aria-label="'.&mt('User-specific quota in MB').'" /> '.&mt('MB').'</span></td>'."\n".
                    &Apache::loncommon::end_data_table_row()."\n";
     }
     return $output;
@@ -305,6 +305,15 @@
                    'xml'        => 'Text editor (EditXML)',
                    'daxe'       => 'Daxe editor (Daxe)',
     );
+    my %legends = &Apache::lonlocal::texthash (
+                   'official'   => 'Custom options for creation of official courses',
+                   'unofficial' => 'Custom options for creation of unofficial courses',
+                   'community'  => 'Custom options for creation of communities',
+                   'textbook'   => 'Custom options for creation of textbook courses',
+                   'placement'  => 'Custom options for creation of placement tests',
+                   'lti'        => 'Custom options for creation of LTI courses',
+                   'editors'    => 'User-specific setting for available editors',
+    );
     $isadv = &Apache::lonnet::is_advanced_user($ccdomain,$ccuname);
     if ($context eq 'requestcourses') {
         %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,
@@ -537,7 +546,11 @@
             } else {
                 $currdisp = $reqdisplay{$curroption};
             }
-            $custdisp = '<fieldset id="customtext_'.$item.'"'.$customsty.'>';
+            if ($customsty) {
+                $customsty =~ s/"$/ line-height: 185%;"/;
+            }
+            $custdisp = '<fieldset id="customtext_'.$item.'"'.$customsty.'>'.
+                        '<legend class="LC_visually_hidden">'.$legends{$item}.'</legend>';
             foreach my $option (@options) {
                 my $val = $option;
                 if ($option eq 'norequest') {
@@ -570,7 +583,8 @@
                 if ($option eq 'autolimit') {
                     $custdisp .= '<input type="text" name="'.$name.
                                  '_limit" size="1" '.
-                                 'value="'.$currlimit.'" /> '.
+                                 'value="'.$currlimit.'" '.
+                                 'aria-label="'.$reqtitles{'numlimit'}.'" /> '.
                                  $reqtitles{'unlimited'}.'</span>';
                 } else {
                     $custdisp .= '</span>';
@@ -584,15 +598,19 @@
                        &Apache::loncommon::end_data_table_row()."\n";
             unless (&Apache::lonnet::allowed('udp',$ccdomain)) {
                 $output .= &Apache::loncommon::start_data_table_row()."\n".
-                          '<td'.$colspan.'><span class="LC_nobreak">'.
-                          $lt{'chse'}.': <label>'.
+                          '<td'.$colspan.'>'.
+                          '<fieldset class="LC_borderless">'.
+                          '<legend class="LC_visually_hidden">'.$lt{'chse'}.'</legend>'.
+                          '<span class="LC_nobreak">'.
+                          '<span aria-hidden="true">'.$lt{'chse'}.': </span><label>'.
                           '<input type="radio" name="custom'.$item.'" value="0" '.
                           $cust_off.' onclick="toggleCustom(this.form,'."'customtext_$item','custom$item'".');" />'.
                           $lt{'usde'}.'</label>'.(' ' x3).
                           '<label><input type="radio" name="custom'.$item.'" value="1" '.
                           $cust_on.' onclick="toggleCustom(this.form,'."'customtext_$item','custom$item'".');" />'.
-                          $lt{'uscu'}.'</label></span><br />'.
-                          '<fieldset id="customtext_'.$item.'"'.$editorsty.'>';
+                          $lt{'uscu'}.'</label></span></fieldset><br />'.
+                          '<fieldset id="customtext_'.$item.'"'.$editorsty.'>'.
+                          '<legend class="LC_visually_hidden">'.$legends{'editors'}.'</legend>';
                 foreach my $editor ('edit','xml','daxe') {
                     my $checked;
                     if ($userenv{'author'.$item} eq '') {
@@ -646,8 +664,11 @@
                         ' value="1" '.$tool_on.$onclick.'/>'.&mt('On').'</label> <label>'.
                         '<input type="radio" name="'.$name.'" value="0" '.
                         $tool_off.$onclick.'/>'.&mt('Off').'</label></span>';
-            $custradio = '<span id="customtext_'.$item.'"'.$customsty.' class="LC_nobreak">'.
-                         '--'.$lt{'cusa'}.': '.$custdisp.'</span>';
+            $custradio = '<fieldset class="LC_borderless">'.
+                         '<legend class="LC_visually_hidden">'.
+                         &mt('Author-specific archiving availability').'</legend>'.
+                         '<span id="customtext_'.$item.'"'.$customsty.' class="LC_nobreak">'.
+                         '--'.$lt{'cusa'}.': '.$custdisp.'</span></fieldset>';
         }
         unless (($item eq 'editors') || ($item eq 'managers')) {
             $output .= '  <td'.$colspan.'>'.$custom_access.(' 'x4).
@@ -656,12 +677,15 @@
             unless (&Apache::lonnet::allowed('udp',$ccdomain)) {
                 $output .=
                    &Apache::loncommon::start_data_table_row()."\n".
-                   '<td><span class="LC_nobreak">'.
-                   $lt{'chse'}.': <label>'.
+                   '<td>'.
+                   '<fieldset class="LC_borderless">'.
+                   '<legend class="LC_visually_hidden">'.$lt{'chse'}.'</legend>'.
+                   '<span class="LC_nobreak">'.
+                   '<span aria-hidden="true">'.$lt{'chse'}.': </span><label>'.
                    '<input type="radio" name="custom'.$item.'" value="0" '.
                    $cust_off.$onclick.'/>'.$lt{'usde'}.'</label>'.(' ' x3).
                    '<label><input type="radio" name="custom'.$item.'" value="1" '.
-                   $cust_on.$onclick.'/>'.$lt{'uscu'}.'</label></span>';
+                   $cust_on.$onclick.'/>'.$lt{'uscu'}.'</label></span></fieldset>';
                 if ($colspan) {
                     $output .= '</td><td>';
                 }
@@ -788,6 +812,7 @@
                                    validate   => 'With validation',
                                    autolimit  => 'Numerical limit',
                                    unlimited  => '(blank for unlimited)',
+                                   numlimit   => 'Maximum number of requests allowed for each user',
                  );
     return %titles;
 }
@@ -2037,6 +2062,7 @@
 sub display_existing_roles {
     my ($r,$ccuname,$ccdomain,$inccourses,$context,$roledom,$crstype,
         $showcredits,$statuses) = @_;
+    my $rownum = 0;
     my $now=time;
     my $showall = 1;
     my ($showexpired,$showactive);
@@ -2252,7 +2278,7 @@
         if ($showall) {
             $row.= '<td>';
             if (($active) && ($allowed)) {
-                $row.= '<input type="checkbox" name="rev:'.$thisrole.'" />';
+                $row.= '<input type="checkbox" name="rev:'.$thisrole.'" aria-labelledby="'.$context.'_'.$role_code.'_'.$rownum.' '.$context.'_rev" />';
             } else {
                 if ($active) {
                     $row.=' ';
@@ -2262,13 +2288,13 @@
             }
             $row.='</td><td>';
             if ($allowed && !$active) {
-                $row.= '<input type="checkbox" name="ren:'.$thisrole.'" />';
+                $row.= '<input type="checkbox" name="ren:'.$thisrole.'" aria-labelledby="'.$context.'_'.$role_code.'_'.$rownum.' '.$context.'_ren" />';
             } else {
                 $row.=' ';
             }
             $row.='</td><td>';
             if ($delallowed) {
-                $row.= '<input type="checkbox" name="del:'.$thisrole.'" />';
+                $row.= '<input type="checkbox" name="del:'.$thisrole.'" aria-labelledby="'.$context.'_'.$role_code.'_'.$rownum.' '.$context.'_del" />';
             } else {
                 $row.=' ';
             }
@@ -2290,7 +2316,7 @@
                         '<br />',
                         $croleuname.':'.$croleudom);
         }
-        $row.= '<td>'.$plaintext.'</td>'.
+        $row.= '<th scope="row" id="'.$context.'_'.$role_code.'_'.$rownum.'" class="LC_rowheader">'.$plaintext.'</th>'.
                '<td>'.$area.'</td>'.
                '<td>'.($role_start_time?&Apache::lonlocal::locallocaltime($role_start_time)
                                             : ' ' ).'</td>'.
@@ -2299,6 +2325,7 @@
         $sortrole{$sortkey}=$envkey;
         $roletext{$envkey}=$row;
         $roleclass{$envkey}=$class;
+        $rownum ++;
         if ($allowed) {
             $rolepriv{$envkey}='edit';
         } else {
@@ -2365,11 +2392,12 @@
 &Apache::loncommon::start_data_table("LC_createuser").
 &Apache::loncommon::start_data_table_header_row());
         if ($showall) {
-            $r->print(
-'<th>'.$lt{'rev'}.'</th><th>'.$lt{'ren'}.'</th><th>'.$lt{'del'}.'</th>'
+            $r->print('<th id="'.$context.'_rev">'.$lt{'rev'}.'</th>'
+                     .'<th id="'.$context.'_ren">'.$lt{'ren'}.'</th>'
+                     .'<th id="'.$context.'_del">'.$lt{'del'}.'</th>'
             );
         } elsif ($showexpired) {
-            $r->print('<th>'.$lt{'rev'}.'</th>');
+            $r->print('<th id="'.$context.'_rev">'.$lt{'rev'}.'</th>');
         }
         $r->print(
 '<th>'.$lt{'rol'}.'</th><th>'.$lt{'ext'}.'</th>'.
@@ -2489,9 +2517,9 @@
     my $num_domain_level = 0;
     my $domaintext =
     '<h4>'.&mt('Domain Level').'</h4>'.
-    &Apache::loncommon::start_data_table().
+    &Apache::loncommon::start_data_table('LC_createuser').
     &Apache::loncommon::start_data_table_header_row().
-    '<th>'.&mt('Activate').'</th><th>'.&mt('Role').'</th><th>'.
+    '<th scope="column" id="domact">'.&mt('Activate').'</th><th>'.&mt('Role').'</th><th>'.
     &mt('Extent').'</th>'.
     '<th>'.&mt('Start').'</th><th>'.&mt('End').'</th>'.
     &Apache::loncommon::end_data_table_header_row();
@@ -2518,8 +2546,8 @@
                $num_domain_level ++;
                $domaintext .=
 &Apache::loncommon::start_data_table_row().
-'<td><input type="checkbox" name="act_'.$thisdomain.'_'.$role.'" /></td>
-<td>'.$plrole.'</td>
+'<td><input type="checkbox" name="act_'.$thisdomain.'_'.$role.'" aria-labelledby="domact domact_'.$role.'" /></td>
+<th class="LC_rowheader" id="domact_'.$role.'">'.$plrole.'</th>
 <td>'.$thisdomain.'</td>
 <td><input type="hidden" name="start_'.$thisdomain.'_'.$role.'" value="" />
 <a href=
@@ -2591,6 +2619,10 @@
                        '// ]]>'."\n".
                        '</script>'."\n".
                        '<h3>'.$lt{'ld'}.'</h3>'.
+                       '<fieldset class="LC_borderless">'.
+                       '<legend class="LC_visually_hidden">'.
+                       &mt('Set authentication').
+                       '</legend>'.
                        &Apache::loncommon::start_data_table().
                        &Apache::loncommon::start_data_table_row().
                        '<td>'.$authformnop;
@@ -2611,7 +2643,8 @@
                                 &Apache::loncommon::end_data_table_row()."\n";
                 }
             }
-            $outcome .= &Apache::loncommon::end_data_table();
+            $outcome .= &Apache::loncommon::end_data_table().
+                        '</fieldset>';
         } else {
             if (($currentauth =~ /^internal:/) &&
                 (&Apache::lonuserutils::can_change_internalpass($ccuname,$ccdomain,$crstype,$permission))) {
@@ -2851,7 +2884,11 @@
     }
 
     my $genhelp=&Apache::loncommon::help_open_topic('Generation');
-    $output = '<h3 class="LC_heading_3">'.$lt{'pd'}.'</h3>'.
+    my $css;
+    if ($context eq 'selfcreate') {
+        $css = ' class="LC_heading_3"';
+    }
+    $output = '<h3'.$css.'>'.$lt{'pd'}.'</h3>'.
               &Apache::lonhtmlcommon::start_pick_box();
     if (($context eq 'selfcreate') && ($newuser eq 'email')) {
         my $size = 25;
@@ -2981,7 +3018,8 @@
             if ($canmodify{$item}) {
                 $row .= '<input type="text" name="c'.$item.'" id="userinfo_'.$item.'" size="'.$textboxsize{$item}.'" value="'.$userenv{$item}.'" />';
                 if (($item eq 'id') && (!$newuser)) {
-                    $row .= '<br />'.&Apache::lonuserutils::forceid_change($context);
+                    $row .= '<br />'.
+                            &Apache::lonuserutils::forceid_change($context,'singleuser');
                 }
             } else {
                 if ($env{'request.role.domain'} ne $ccdomain) {
@@ -3005,9 +3043,16 @@
         my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($ccdomain);
         if (ref($types) eq 'ARRAY') {
             if (@{$types} > 0) {
-                my ($hiderow,$shown);
+                my ($hiderow,$shown,$start_fieldset,$end_fieldset);
                 if ($canmodify_status{'inststatus'}) {
-                    $shown = &pick_inst_statuses($userenv{'inststatus'},$usertypes,$types);
+                    if ((ref($types) eq 'ARRAY') && (@{$types})) {
+                        $start_fieldset = '<fieldset class="LC_borderless">'.
+                                          '<legend>'.&mt('Choose affiliations').'</legend>';
+                        $end_fieldset = '</fieldset>';
+                    }
+                    $shown = $start_fieldset
+                            .&pick_inst_statuses($userenv{'inststatus'},$usertypes,$types)
+                            .$end_fieldset;
                 } else {
                     if ($userenv{'inststatus'} eq '') {
                         $hiderow = 1;
@@ -7645,22 +7690,19 @@
                     $output .= '<br />'.&mt('(Set by Domain Coordinator)');
                     next;
                 }
-                my $arialabel = &mt('Existing sections');
                 my $sections_select = 
                     &Apache::lonuserutils::course_sections(\%sections_count,'st',$currsec,$disabled,
-                                                           $arialabel);
-                $output .= '<table class="LC_createuser">'."\n".
-                           '<tr class="LC_visually_hidden">'.
-                           '<th>'.&mt('Choose an existing section').'</th>'.
-                           '<th>'.&mt('Instantiate a new section').'</th>'."\n".
-                           '</tr>'."\n".
-                           '<tr class="LC_section_row">'."\n".
-                           '<td align="center">'.&mt('Existing sections')."\n".
-                           '<br />'.$sections_select.'</td><td align="center">'.
+                                                           '','currsec_st');
+                $output .= '<div role="grid" class="LC_grid">'."\n".
+                           '<div role="row" class="LC_grid_row">'."\n".
+                           '<div role="gridcell" class="LC_grid_cell">'."\n".
+                           '<label for="currsec_st">'.&mt('Existing sections')."</label>\n".
+                           '<br />'.$sections_select.'</div>'.
+                           '<div role="gridcell" class="LC_grid_cell">'."\n".
                            '<label>'.&mt('New section').'<br />'."\n".
                            '<input type="text" name="newsec" size="15" value="'.$newsecval.'"'.$disabled.' /></label>'."\n".
                            '<input type="hidden" name="sections" value="" />'."\n".
-                           '</td></tr></table>'."\n";
+                           '</div></div></div>'."\n";
             } elsif ($item eq 'approval') {
                 my ($currnotified,$currapproval,%appchecked);
                 my %selfdescs = &Apache::lonuserutils::selfenroll_default_descs();
@@ -10663,15 +10705,18 @@
     my $header = '<h4>'.&mt('Course/Community Level').'</h4>'.
                  &Apache::loncommon::start_data_table().
                  &Apache::loncommon::start_data_table_header_row().
-                 '<th>'.$lt{'scc'}.'</th><th>'.$lt{'rol'}.'</th>'."\n".
+                 '<th><label for="coursedesc">'.$lt{'scc'}.'</label></th>'.
+                 '<th><label for="role">'.$lt{'rol'}.'</label></th>'."\n".
                  '<th>'.$lt{'grs'}.'</th>'."\n";
-    $header .=   '<th>'.$lt{'crd'}.'</th>'."\n" if ($showcredits);
+    $header .=   '<th><label for="credits">'.$lt{'crd'}.'</label></th>'."\n" if ($showcredits);
     $header .=   '<th>'.$lt{'sta'}.'</th><th>'.$lt{'end'}.'</th>'."\n".
                  &Apache::loncommon::end_data_table_header_row();
-    my $otheritems = &Apache::loncommon::start_data_table_row()."\n".
-                     '<td><br /><span class="LC_nobreak"><input type="text" name="coursedesc" value="" onfocus="this.blur();opencrsbrowser('."'cu','dccourse','dcdomain','coursedesc','','','','crstype'".')" />'.
-                     $courseform.(' ' x4).'</span></td>'."\n".
-                     '<td valign="top"><br /><select name="role">'."\n";
+    my $otheritems = &Apache::loncommon::start_data_table_row()."\n"
+                    .'<td style="margin: 0 4px 0 4px;"><br />'
+                    .'<span class="LC_nobreak">'.$courseform.' '
+                    .'<input type="text" name="coursedesc" id="coursedesc" value="" readonly="readonly" />'
+                    .'</span></td>'."\n".
+                     '<td style="margin: 0 10px 0 10px;"><br /><select name="role" id="role">'."\n";
     foreach my $role (@roles) {
         my $plrole=&Apache::lonnet::plaintext($role);
         $otheritems .= '  <option value="'.$role.'">'.$plrole.'</option>';
@@ -10684,22 +10729,25 @@
         }
     }
     $otheritems .= '</select></td><td>'.
-                     '<table border="0" cellspacing="0" cellpadding="0">'.
-                     '<tr><td valign="top"><b>'.$lt{'exs'}.'</b><br /><select name="currsec">'.
-                     ' <option value=""><--'.&mt('Pick course first').'</option></select></td>'.
-                     '<td>  </td>'.
-                     '<td valign="top"> <b>'.$lt{'new'}.'</b><br />'.
-                     '<input type="text" name="newsec" value="" />'.
-                     '<input type="hidden" name="section" value="" />'.
-                     '<input type="hidden" name="groups" value="" />'.
-                     '<input type="hidden" name="crstype" value="" /></td>'.
-                     '</tr></table></td>'."\n";
+                   '<div role="grid" class="LC_grid" style="margin: -3px 4px 0px 4px;">'.
+                   '<div role="row" class="LC_grid_row">'.
+                   '<div role="gridcell" class="LC_grid_cell" style="text-align: center;">'.
+                   '<label for="currsec">'.$lt{'exs'}.'</label><br />'.
+                   '<select name="currsec" id="currsec">'.
+                   ' <option value=""><--'.&mt('Pick course first').'</option></select></div>'.
+                   '<div role="gridcell" class="LC_grid_cell" style="text-align: center;">'.
+                   '<label for="newsec">'.$lt{'new'}.'</label><br />'.
+                   '<input type="text" name="newsec" id="newsec" value="" />'.
+                   '<input type="hidden" name="section" value="" />'.
+                   '<input type="hidden" name="groups" value="" />'.
+                   '<input type="hidden" name="crstype" value="" /></td>'.
+                   '</div></div></div></td>'."\n";
     if ($showcredits) {
-        $otheritems .= '<td><br />'."\n".
-                       '<input type="text" size="3" name="credits" value="" /></td>'."\n";
+        $otheritems .= '<td style="margin: 0 10px 0 10px;"><br />'."\n".
+                       '<input type="text" size="3" name="credits" id="credits" value="" /></td>'."\n";
     }
     $otheritems .= <<ENDTIMEENTRY;
-<td><br /><input type="hidden" name="start" value='' />
+<td><br /><input type="hidden" name="start" value="" />
 <a href=
 "javascript:pjump('date_start','Start Date',document.cu.start.value,'start','cu.pres','dateset')">$lt{'ssd'}</a></td>
 <td><br /><input type="hidden" name="end" value='' />
Index: loncom/interface/lonuserutils.pm
diff -u loncom/interface/lonuserutils.pm:1.232 loncom/interface/lonuserutils.pm:1.233
--- loncom/interface/lonuserutils.pm:1.232	Thu Apr 30 00:27:07 2026
+++ loncom/interface/lonuserutils.pm	Mon May  4 19:42:58 2026
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Utility functions for managing LON-CAPA user accounts
 #
-# $Id: lonuserutils.pm,v 1.232 2026/04/30 00:27:07 raeburn Exp $
+# $Id: lonuserutils.pm,v 1.233 2026/05/04 19:42:58 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1502,7 +1502,8 @@
 
     $Str .= &Apache::lonhtmlcommon::row_title(&mt('Login Type'));
     if ($context eq 'domain') {
-        $Str .= '<p>'
+        $Str .= '<fieldset class="LC_borderless" style="line-height: 190%;"><legend class="LC_visually_hidden">'
+               .&mt('Existing authentication').'</legend>'
                .&mt('Change authentication for existing users in domain "[_1]" to these settings?'
                    ,$defdom)
                .' <span class="LC_nobreak"><label>'
@@ -1511,7 +1512,7 @@
                .'  <label>'
                .'<input type="radio" name="changeauth" value="Yes" />'
                .&mt('Yes').'</label>'
-               .'</span></p>'; 
+               .'</span>';
     } else {
         $Str .= '<p class="LC_info">'."\n".
             &mt('This will not take effect if the user already exists.').
@@ -1519,6 +1520,9 @@
             "</p>\n";
     }
     $Str .= &set_login($defdom,$krbform,$intform,$locform,$ltiform);
+    if ($context eq 'domain') {
+        $Str .= '</fieldset>';
+    }
 
     my ($home_server_pick,$numlib) =
         &Apache::loncommon::home_server_form_item($defdom,'lcserver',
@@ -1553,7 +1557,8 @@
     if ($context eq 'domain') {
         $Str .= &Apache::lonhtmlcommon::row_title(
                     &mt('Settings for assigning roles'))
-               .&mt('Pick the action to take on roles for these users:').'<br />'
+               .'<fieldset class="LC_assignrole" style="margin: 0;"><legend>'
+               .&mt('Pick the action to take on roles for these users:').'</legend>'
                .'<span class="LC_nobreak"><label>'
                .'<input type="radio" name="roleaction" value="norole" checked="checked" />'
                .' '.&mt('No role changes').'</label>'
@@ -1563,7 +1568,7 @@
                .'   <label>'
                .'<input type="radio" name="roleaction" value="course" />'
                .' '.&mt('Add a course/community role').'</label>'
-               .'</span>';
+               .'</span></fieldset>';
     } elsif ($context eq 'author') {
         $Str .= &Apache::lonhtmlcommon::row_title(
                     &mt('Default role'))
@@ -1589,7 +1594,7 @@
             &default_role_selector($context,1,'',$showcredits);
         if ($context eq 'domain') {
             $Str .= '<p>'
-                   .'<b>'.&mt('Domain Level').'</b><br />'
+                   .'<b><label for="defaultrole">'.&mt('Domain Level').'</label></b><br />'
                    .$options
                    .'</p><p>'
                    .'<b>'.&mt('Course Level').'</b>'
@@ -1697,10 +1702,14 @@
 }
 
 sub forceid_change {
-    my ($context) = @_;
+    my ($context,$action) = @_;
     my $output;
+    my $fieldsetsty = "line-height: 185%;";
+    if ($action eq 'singleuser') {
+        $fieldsetsty .= ' margin-top: 4px;';
+    }
     if ($context eq 'domain') {
-        $output = '<fieldset class="LC_borderless" style="line-height: 185%;">'
+        $output = '<fieldset class="LC_borderless" style="'.$fieldsetsty.'">'
                  .'<legend class="LC_visually_hidden">'
                  .&mt('Actions to take if student/employee ID changed')
                  .'</legend>';
@@ -1985,6 +1994,7 @@
     }
 
     my %lt=&Apache::lonlocal::texthash(
+                    'crs'  => "Course/Community",
                     'rol'  => "Role",
                     'grs'  => "Section",
                     'exs'  => "Existing sections",
@@ -2008,7 +2018,7 @@
            $options .= '  <option value="'.$role.'">'.$plrole.'</option>';
         }
         my $courseform = &Apache::loncommon::selectcourse_link
-            ('studentform','dccourse','dcdomain','coursedesc',"$env{'request.role.domain'}",undef,'Course/Community');
+            ('studentform','dccourse','dcdomain','coursedesc',"$env{'request.role.domain'}",undef,'Select','','coursedesc');
         my ($credit_elem,$creditsinput);
         if ($showcredits) {
             $credit_elem = 'credits';
@@ -2018,31 +2028,36 @@
             &Apache::loncommon::coursebrowser_javascript($env{'request.role.domain'},'currsec','studentform','courserole','Course/Community',$credit_elem);
         $coursepick = &Apache::loncommon::start_data_table().
                       &Apache::loncommon::start_data_table_header_row().
-                      '<th>'.$courseform.'</th><th>'.$lt{'rol'}.'</th>'.
-                      '<th>'.$lt{'grs'}.'</th>'.
-                      '<th>'.$lt{'crd'}.'</th>'.
-                      &Apache::loncommon::end_data_table_header_row().
-                      &Apache::loncommon::start_data_table_row()."\n".
-                      '<td><input type="text" name="coursedesc" value="" onfocus="this.blur();opencrsbrowser('."'studentform','dccourse','dcdomain','coursedesc','','','','crstype'".')" /></td>'."\n".
-                      '<td><select name="courserole">'."\n".
-                      &default_course_roles($context,$checkpriv,'Course',%customroles)."\n".
-                      '</select></td><td>'.
-                      '<table class="LC_createuser">'.
-                      '<tr class="LC_section_row"><td valign="top">'.
-                      $lt{'exs'}.'<br /><select name="currsec">'.
-                      ' <option value=""><--'.&mt('Pick course first').
-                      '</select></td>'.
-                      '<td>  </td>'.
-                      '<td valign="top">'.$lt{'new'}.'<br />'.
-                      '<input type="text" name="newsec" value="" size="5" />'.
-                      '<input type="hidden" name="groups" value="" />'.
-                      '<input type="hidden" name="sections" value="" />'.
-                      '<input type="hidden" name="origdom" value="'.
-                      $env{'request.role.domain'}.'" />'.
-                      '<input type="hidden" name="dccourse" value="" />'.
-                      '<input type="hidden" name="dcdomain" value="" />'.
-                      '<input type="hidden" name="crstype" value="" />'.
-                      '</td></tr></table></td>'.$creditsinput.
+                      '<th>'.$lt{'crs'}.'</th>'.
+                      '<th><label for="courserole">'.$lt{'rol'}.'</label></th>'.
+                      '<th>'.$lt{'grs'}.'</th>';
+        if ($showcredits) {
+            $coursepick .= '<th>'.$lt{'crd'}.'</th>';
+        }
+        $coursepick .= &Apache::loncommon::end_data_table_header_row().
+                       &Apache::loncommon::start_data_table_row()."\n".
+                       '<td><input type="text" name="coursedesc" id="coursedesc" value="" readonly="readonly" /><br />'.$courseform.'</td>'."\n".
+                       '<td><select name="courserole" id="courserole">'."\n".
+                       &default_course_roles($context,$checkpriv,'Course',%customroles)."\n".
+                       '</select></td><td>';
+        $coursepick .= '<div role="grid" class="LC_grid" style="margin: 0; vertical-align: top;">'.
+                       '<div role="row" class="LC_grid_row" style="margin: 0; vertical-align: top;">'.
+                       '<div role="gridcell" class="LC_grid_cell" style="vertical-align: top;">'.
+                       '<span class="LC_nobreak"><label for="currsec">'.$lt{'exs'}.'</label></span><br />'.
+                       '<select name="currsec" id="currsec">'.
+                       ' <option value=""><--'.&mt('Pick course first').'</option>'.
+                       '</select></div>'.
+                       '<div role="gridcell" class="LC_grid_cell">'.
+                       '<span class="LC_nobreak"><label for="newsec">'.$lt{'new'}.'</label></span><br />'.
+                       '<input type="text" name="newsec" id="newsec" value="" size="5" />'.
+                       '<input type="hidden" name="groups" value="" />'.
+                       '<input type="hidden" name="sections" value="" />'.
+                       '<input type="hidden" name="origdom" value="'.
+                       $env{'request.role.domain'}.'" />'.
+                       '<input type="hidden" name="dccourse" value="" />'.
+                       '<input type="hidden" name="dcdomain" value="" />'.
+                       '<input type="hidden" name="crstype" value="" />'.
+                       '</div></div></div></td>'.$creditsinput.
                       &Apache::loncommon::end_data_table_row().
                       &Apache::loncommon::end_data_table()."\n";
     }
@@ -6537,7 +6552,7 @@
 }
 
 sub course_sections {
-    my ($sections_count,$role,$current_sec,$disabled,$arialabel) = @_;
+    my ($sections_count,$role,$current_sec,$disabled,$arialabel,$id) = @_;
     my $output = '';
     my @sections = (sort {$a <=> $b} keys(%{$sections_count}));
     my $numsec = scalar(@sections);
@@ -6545,8 +6560,11 @@
     if ($arialabel ne '') {
         $arialabel = ' aria-label="'.$arialabel.'"';
     }
+    if ($id ne '') {
+        $id = ' id="'.$id.'"';
+    }
     if ($numsec <= 1) {
-        $output = '<select name="currsec_'.$role.'"'.$disabled.$arialabel.'>'."\n".
+        $output = '<select name="currsec_'.$role.'"'.$id.$disabled.$arialabel.'>'."\n".
                   '  <option value="">'.&mt('Select').'</option>'."\n";
         if ($current_sec eq 'none') {
             $output .=       


More information about the LON-CAPA-cvs mailing list