Diff for /loncom/interface/loncoursegroups.pm between versions 1.78 and 1.80.2.2

version 1.78, 2008/08/24 12:54:55 version 1.80.2.2, 2008/12/16 23:19:19
Line 111  sub handler { Line 111  sub handler {
         $crstype);          $crstype);
             }              }
         } else {          } else {
             $r->print(&mt('You do not have [_1] administration '.              $r->print('<div class="LC_warning">'
                           'privileges in this [_2]',$gpterm,lc($crstype)));                       .&mt('You do not have '.$gpterm.' administration '
                            .'privileges in this '.lc($crstype).'.')
                        .'</div>');
         }          }
     } else {      } else {
         &print_main_menu($r,$cdom,$cnum,\%functions,\%idx,$view_permission,          &print_main_menu($r,$cdom,$cnum,\%functions,\%idx,$view_permission,
Line 346  END Line 348  END
       '<td>'.$functionality.'</td>'.        '<td>'.$functionality.'</td>'.
       '<td align="right">'.$quota.'</td>'.        '<td align="right">'.$quota.'</td>'.
       '<td align="right">'.$totalmembers.'</td>'.        '<td align="right">'.$totalmembers.'</td>'.
       '<td align="right"><nobr>'.&mt('Files: ').$totalfiles.'</nobr><br /><nobr>'.&mt('Folders: ').$totaldirs.'</nobr></td>'.        '<td align="right">'.
                                     '<div class="LC_nobreak">'.&mt('Files: [_1]',$totalfiles).'</div>'.
                                     '<div class="LC_nobreak">'.&mt('Folders: [_1]',$totaldirs).'</div>'.
                                     '</td>'.
       '<td align="right">'.$boards.'</td>'.        '<td align="right">'.$boards.'</td>'.
       '<td align="right">'.$diskuse.'</td>'.        '<td align="right">'.$diskuse.'</td>'.
       &Apache::loncommon::end_data_table_row());        &Apache::loncommon::end_data_table_row());
Line 390  END Line 395  END
                 }                  }
             }              }
         } else {          } else {
             $r->print(&mt('You are not currently a member of any '.              $r->print(&mt('You are not currently a member of any active '.$gpterm.'s in this '.lc($crstype).'.'));
                           'active [_1]s in this [_2]',$gpterm,  
                           lc($crstype)));  
         }          }
     }      }
     return;      return;
Line 1134  sub display_control { Line 1137  sub display_control {
 sub verify_delete {  sub verify_delete {
     my ($r,$groupname,$formname,$action,$page,$states,$stored) = @_;      my ($r,$groupname,$formname,$action,$page,$states,$stored) = @_;
     $r->print(&Apache::lonhtmlcommon::echo_form_input([]));      $r->print(&Apache::lonhtmlcommon::echo_form_input([]));
     $r->print(&mt("You have requested deletion of the following group: ").'<i>'.      $r->print(&mt('You have requested deletion of the group [_1].'
               $stored->{'description'}.'</i>'.                   ,'<i>'.$stored->{'description'}.'</i>').
               '<br /><br />'.&mt('When a group is deleted the following occurs:').'<ul>'.                '<br /><br />'.&mt('When a group is deleted the following occurs:').'<ul>'.
               '<li>'.&mt('All group membership is terminated.').'</li>'.                '<li>'.&mt('All group membership is terminated.').'</li>'.
               '<li>'.&mt('The group ceases to be available either for viewing or for modification of group settings and membership.').'</li>'.                '<li>'.&mt('The group ceases to be available either for viewing or for modification of group settings and membership.').'</li>'.
Line 1191  sub delete_group { Line 1194  sub delete_group {
                                                            \%usersettings);                                                             \%usersettings);
     }      }
     if ($num_fail > 0) {      if ($num_fail > 0) {
         $r->print(&mt('Group deletion failed because deletion of [_1] out of [_2] members failed.',$num_fail,$num_users));          $r->print('<div class="LC_error">'
                    .&mt('Group deletion failed because deletion of [_1] out of [_2] members failed.'
                        ,$num_fail,$num_users)
                    .'</div>');
                   
     } else {      } else {
         my ($result,$message) =           my ($result,$message) = 
Line 1200  sub delete_group { Line 1206  sub delete_group {
         if ($result eq 'ok') {          if ($result eq 'ok') {
             my $outcome = &modify_folders($cdom,$cnum,$groupname);              my $outcome = &modify_folders($cdom,$cnum,$groupname);
             if ($outcome eq '') {              if ($outcome eq '') {
                 $r->print(&mt('Group successfully deleted.'));                  $r->print('<div class="LC_success">'
                            .&mt('Group successfully deleted.')
                            .'</div>');
             } else {              } else {
                 $r->print(&mt("Although the group was deleted, an error ([_1]) occurred when removing the group's folder from the 'Course Groups' folder.",$outcome));                  $r->print('<div class="LC_error">'
                            .&mt("Although the group was deleted, an error occurred when removing"
                                ." the group's folder from the 'Course Groups' folder: [_1]",$outcome)
                            .'</div>');
             }              }
         } else {          } else {
             $r->print(&mt('Group deletion failed.'));              $r->print('<div class="LC_error">'
                        .&mt('Group deletion failed.')
                        .'</div>');
         }          }
     }      }
     return;      return;
Line 1216  sub reenable_folder { Line 1229  sub reenable_folder {
     my $outcome;      my $outcome;
     my $crspath = '/uploaded/'.$cdom.'/'.$cnum.'/';      my $crspath = '/uploaded/'.$cdom.'/'.$cnum.'/';
     my $allgrpsmap = $crspath.'group_allfolders.sequence';      my $allgrpsmap = $crspath.'group_allfolders.sequence';
     my $foldertitle = &mt('Course Folder -').$description;      my $foldertitle = &mt('Course Folder -[_1]',$description);
     my $mapurl = $crspath.'group_folder_'.      my $mapurl = $crspath.'group_folder_'.
                    $groupname.'.sequence';                     $groupname.'.sequence';
     my ($errtext,$fatal)=&LONCAPA::map::mapread($allgrpsmap);      my ($errtext,$fatal)=&LONCAPA::map::mapread($allgrpsmap);
     if ($fatal) {      if ($fatal) {
         $outcome=&mt('Error reading contents of parent folder to group').          $outcome='<div class="LC_error">'
                      " ($allgrpsmap): $errtext".'<br />';                  .&mt('An error occurred when reading contents of parent folder to group:')
                   ."<br />($allgrpsmap): $errtext"
                   .'</div>';
     } else {      } else {
         my $idx=&LONCAPA::map::getresidx($mapurl);          my $idx=&LONCAPA::map::getresidx($mapurl);
         $LONCAPA::map::resources[$idx] = $foldertitle.':'.$mapurl.          $LONCAPA::map::resources[$idx] = $foldertitle.':'.$mapurl.
Line 1230  sub reenable_folder { Line 1245  sub reenable_folder {
         $LONCAPA::map::order[1+$#LONCAPA::map::order]=$idx;          $LONCAPA::map::order[1+$#LONCAPA::map::order]=$idx;
         my ($outtext,$errtext) = &LONCAPA::map::storemap($allgrpsmap,1);          my ($outtext,$errtext) = &LONCAPA::map::storemap($allgrpsmap,1);
         if ($errtext) {          if ($errtext) {
             $outcome = &mt('Error saving updated parent folder to group').              $outcome='<div class="LC_error">'
                            "- $allgrpsmap - $errtext".'<br />';                      .&mt('An error occurred when saving updated parent folder to group:'
                           ,"<br />$allgrpsmap - $errtext")
                       .'</div>';
         } else {          } else {
             my ($furl,$ferr) =              my ($furl,$ferr) =
                      &Apache::lonuserstate::readmap($cdom.'/'.$cnum);                       &Apache::lonuserstate::readmap($cdom.'/'.$cnum);
Line 1256  sub modify_folders { Line 1273  sub modify_folders {
         $map = '/'.$map;          $map = '/'.$map;
         my ($errtext,$fatal) = &LONCAPA::map::mapread($map);          my ($errtext,$fatal) = &LONCAPA::map::mapread($map);
         if ($fatal) {          if ($fatal) {
             $outcome=&mt('Error reading contents of parent folder to group').              $outcome='<div class="LC_error">'
                          " ($map): $errtext".'<br />';                      .&mt('An error occurred when reading contents of parent folder to group:')
                       ."<br />($map): $errtext"
                       .'</div>';
         } else {          } else {
             my $idx = 0;              my $idx = 0;
             my $grpidx;              my $grpidx;
Line 1280  sub modify_folders { Line 1299  sub modify_folders {
                 $#LONCAPA::map::order--;                  $#LONCAPA::map::order--;
                 my ($outtext,$errtext) = &LONCAPA::map::storemap($map,1);                  my ($outtext,$errtext) = &LONCAPA::map::storemap($map,1);
                 if ($errtext) {                  if ($errtext) {
                     $outcome = &mt('Error saving updated parent folder to group'). "- $map - $errtext".'<br />';                      $outcome='<div class="LC_error">'
                               .&mt('An error occurred when saving updated parent folder to group:')
                               ."<br />$map - $errtext"
                               .'</div>';
                 } else {                  } else {
                     my ($furl,$ferr) =                      my ($furl,$ferr) =
                         &Apache::lonuserstate::readmap($cdom.'/'.$cnum);                          &Apache::lonuserstate::readmap($cdom.'/'.$cnum);
Line 1294  sub modify_folders { Line 1316  sub modify_folders {
 sub verify_reenable {  sub verify_reenable {
     my ($r,$groupname,$formname,$action,$page,$states,$stored) = @_;      my ($r,$groupname,$formname,$action,$page,$states,$stored) = @_;
     $r->print(&Apache::lonhtmlcommon::echo_form_input([]));      $r->print(&Apache::lonhtmlcommon::echo_form_input([]));
     $r->print(&mt("You have requested enabling the following previously deleted group: ").'<i>'.      $r->print(&mt('You have requested enabling the previously deleted group [_1].'
               $stored->{'description'}.'</i>'.                   ,'<i>'.$stored->{'description'}.'</i>').
               '<br /><br />'.&mt('When a deleted group is re-enabled the following occurs:').'<ul>'.                '<br /><br />'.&mt('When a deleted group is re-enabled the following occurs:').'<ul>'.
               '<li>'.&mt('Group settings and membership at the time the group was deleted are reinstated.').'</li>'.                '<li>'.&mt('Group settings and membership at the time the group was deleted are reinstated.').'</li>'.
               '<li>'.&mt('A group folder is added to the "Course Groups" folder which contains folders for all groups in the course.').'</li></ul>');                '<li>'.&mt('A group folder is added to the "Course Groups" folder which contains folders for all groups in the course.').'</li></ul>');
Line 1316  sub reenable_group { Line 1338  sub reenable_group {
         &Apache::longroup::coursegroups($cdom,$cnum,$groupname,          &Apache::longroup::coursegroups($cdom,$cnum,$groupname,
                                         'deleted_groups');                                          'deleted_groups');
     if (keys(%groups) == 0) {      if (keys(%groups) == 0) {
         $r->print(&mt('The group ([_1]) was not re-enabled, because it is not a deleted group.<br />Perhaps it has already been re-enabled?',$groupname));          $r->print(&mt('The group [_1] was not re-enabled, because it is not a deleted group.[_2]Perhaps it has already been re-enabled?','<i>'.$groupname.'</i>'),'<br />');
         return;          return;
     }      }
     my %groupinfo =       my %groupinfo = 
Line 1371  $context) eq 'ok') { Line 1393  $context) eq 'ok') {
         &Apache::lonnet::modify_coursegroup_membership($cdom,$cnum,          &Apache::lonnet::modify_coursegroup_membership($cdom,$cnum,
                                                        \%usersettings);                                                         \%usersettings);
                 if ($roster_result eq 'ok') {                  if ($roster_result eq 'ok') {
                     $r->print(&mt('Membership reinstated for [_1] users, each with start and end dates for group access set to defaults: [_2] and [_3]',$num_ok,$showstart,$showend).'<br />');                      $r->print('<div class="LC_success">'
                                .&mt('Membership reinstated for [quant,_1,user], each with start and end dates for group access set to defaults: [_2] and [_3]',$num_ok,$showstart,$showend)
                                .'</div>');
                 }                  }
             } else {              } else {
                 $r->print(&mt('A problem occurred when trying to reinstate [_1] of the [_2] members of the pre-existing group.',$num_fail,$num_users).'<br />');                  $r->print('<div class="LC_error">'
                            .&mt('A problem occurred when trying to reinstate [_1] of the [_2] members of the pre-existing group.',$num_fail,$num_users)
                            .'</div>');
             }              }
         } else {          } else {
             $r->print(&mt('There were no group members to reinstate, as none were removed when the group was deleted.').'<br />');              $r->print('<div class="LC_info">'
                        .&mt('There were no group members to reinstate, as none were removed when the group was deleted.')
                        .'</div>');
         }          }
         my $outcome = &reenable_folder($cdom,$cnum,$groupname,$description);          my $outcome = &reenable_folder($cdom,$cnum,$groupname,$description);
         if ($outcome eq '') {          if ($outcome eq '') {
             $r->print(&mt('Group successfully re-enabled.'));              $r->print('<div class="LC_success">'
         } else {                       .&mt('Group successfully re-enabled.')
             $r->print(&mt("Although the group was re-enabled, an error ([_1]) occurred when adding the group's folder to the 'Course Groups' folder.",$outcome));                       .'</div>');
           } else {
               $r->print('<div class="LC_error">'
                        .&mt("Although the group was re-enabled, an error occurred when adding the group's folder to the 'Course Groups' folder: [_1]",$outcome)
                        .'</div>');
         }          }
     } else {      } else {
         $r->print(&mt('Re-enabling group failed'));          $r->print('<div class="LC_error">'
                    .&mt('Re-enabling group failed.')
                    .'</div>');
     }      }
     return;      return;
 }  }
Line 1519  sub open_list_window { Line 1553  sub open_list_window {
     my ($group,$status,$count,$text) = @_;      my ($group,$status,$count,$text) = @_;
     my $entry;      my $entry;
     if ($count > 0) {      if ($count > 0) {
         $entry = '<nobr><a href="javascript:openGroupRoster('.          $entry = '<span class="LC_nobreak"><a href="javascript:openGroupRoster('.
                  "'$group','$status'".')">'.$text.'</a>&nbsp;-&nbsp;'.$count.                   "'$group','$status'".')">'.$text.'</a>&nbsp;-&nbsp;'.$count.
                  '</nobr><br />';                   '</span><br />';
     } else {      } else {
         $entry = '<nobr>'.$text.'&nbsp;-&nbsp;'.$count.'</nobr><br />';          $entry = '<span class="LC_nobreak">'.$text.'&nbsp;-&nbsp;'.$count.'</span><br />';
     }      }
     return $entry;      return $entry;
 }  }
Line 1612  END Line 1646  END
                    $$functions{$allfunctions[$i]}.'</label></td>                     $$functions{$allfunctions[$i]}.'</label></td>
                    <td>&nbsp;</td><td>&nbsp;</td>');                     <td>&nbsp;</td><td>&nbsp;</td>');
     }      }
     $r->print('<td><input type="button" value="check all" '.      $r->print('<td><input type="button" value="'.&mt('check all').'" '.
               'onclick="javascript:checkAll(document.'.$formname.'.tool)" />'.                'onclick="javascript:checkAll(document.'.$formname.'.tool)" />'.
               '</td></tr><tr><td>&nbsp;</td>');                '</td></tr><tr><td>&nbsp;</td>');
     for (my $j=$halfnum; $j<@allfunctions; $j++) {      for (my $j=$halfnum; $j<@allfunctions; $j++) {
Line 1626  END Line 1660  END
     }      }
     $r->print('      $r->print('
        <td>         <td>
         <input type="button" value="uncheck all"          <input type="button" value="'.&mt('uncheck all').'"
           onclick="javascript:uncheckAll(document.'.$formname.'.tool)" />            onclick="javascript:uncheckAll(document.'.$formname.'.tool)" />
        </td>         </td>
       </tr>        </tr>
Line 1635  END Line 1669  END
        <td colspan="10">'.$lt{'doyo'}.'&nbsp;<label><input type="radio" name="granularity" value="Yes" />'.&mt('Yes').'</label>&nbsp;<label><input type="radio" name="granularity" value="No" checked="checked" />'.&mt('No').'</label>');         <td colspan="10">'.$lt{'doyo'}.'&nbsp;<label><input type="radio" name="granularity" value="Yes" />'.&mt('Yes').'</label>&nbsp;<label><input type="radio" name="granularity" value="No" checked="checked" />'.&mt('No').'</label>');
     if ($action eq 'modify') {      if ($action eq 'modify') {
         $r->print('&nbsp;&nbsp;('.&mt('Currently set to "[_1]"',          $r->print('&nbsp;&nbsp;('.&mt('Currently set to "[_1]"',
                                       $$stored{'granularity'}).')');                                        &mt($$stored{'granularity'})).')');
     }      }
     $r->print('      $r->print('
        </td>         </td>
Line 1643  END Line 1677  END
       <tr>        <tr>
        <td class="LC_description">'.&mt('Disk quota: ').'</td><td colspan="10">');         <td class="LC_description">'.&mt('Disk quota: ').'</td><td colspan="10">');
     if ($action eq 'create') {      if ($action eq 'create') {
         $r->print(&mt('If you enable the file repository for the [_1], allocate a disk quota.',$gpterm));          $r->print(&mt('If you enable the file repository for the '.$gpterm.', allocate a disk quota.'));
     } else {      } else {
         $r->print(&mt('Quota allocated to file repository:'));          $r->print(&mt('Quota allocated to file repository:'));
     }       } 
     $r->print('&nbsp;<input type="text" name="quota" size="4" />Mb');      $r->print('&nbsp;'.&mt('[_1] Mb','<input type="text" name="quota" size="4" />'));
     if ($action eq 'create') {      if ($action eq 'create') {
         $r->print('<br />'.          $r->print('<br />'
                   &mt('A total of [_1] Mb can be divided amongst all [_2]s in the '.                   .&mt('A total of [_1] Mb can be divided amongst all '.$gpterm.'s in the '
                   '[_3], and [_4] Mb are currently unallocated.',$crsquota,                       .lc($crstype).', and [_2] Mb are currently unallocated.'
                   $gpterm,lc($crstype),sprintf("%.2f",$freespace)));                       ,$crsquota,sprintf("%.2f",$freespace))
                    );
     } else {      } else {
         $r->print('&nbsp;&nbsp;('.&mt('The quota is currently [_1] Mb',          $r->print('&nbsp;&nbsp;('.&mt('The quota is currently [_1] Mb',
                                       $$stored{'quota'}).').');                                        $$stored{'quota'}).').');
   
         $r->print('<br />'.&mt('The quota can be increased to [_1] Mb, '.          $r->print('<br />'
                   'by adding all unallocated space for [_2]s in the [_3].',                   .&mt('The quota can be increased to [_1] Mb, '
                   sprintf("%.2f",$maxposs),$gpterm,lc($crstype)));                   .'by adding all unallocated space for '.$gpterm.'s in the '.lc($crstype).'.'
                     ,sprintf("%.2f",$maxposs)));
     }      }
     $r->print('      $r->print('
        </td>         </td>
Line 1770  sub sections_selection { Line 1806  sub sections_selection {
   
 sub access_date_settings {  sub access_date_settings {
     my ($r,$action,$formname,$stored,$image,$gpterm,$ucgpterm) = @_;      my ($r,$action,$formname,$stored,$image,$gpterm,$ucgpterm) = @_;
     my %lt = &Apache::lonlocal::texthash(      my $sten = &mt("Default start and end dates for $gpterm access");
                 'sten' => "Default start and end dates for $gpterm access",  
              );  
     my $starttime = time;      my $starttime = time;
     my $endtime = time+(6*30*24*60*60); # 6 months from now, approx      my $endtime = time+(6*30*24*60*60); # 6 months from now, approx
     if ($action eq 'modify') {      if ($action eq 'modify') {
Line 1782  sub access_date_settings { Line 1816  sub access_date_settings {
         }          }
     }      }
     my ($table) = &date_setting_table($starttime,$endtime,$formname);      my ($table) = &date_setting_table($starttime,$endtime,$formname);
     $r->print(&Apache::lonhtmlcommon::topic_bar($image,$lt{'sten'}).'      $r->print(&Apache::lonhtmlcommon::topic_bar($image,$sten).'
     '.$table.'      '.$table.'
     ');      ');
     return;      return;
Line 1899  sub print_current_settings { Line 1933  sub print_current_settings {
         ygrs => "Your group selections - ",          ygrs => "Your group selections - ",
         tfwa => "The following settings will apply to the group:",          tfwa => "The following settings will apply to the group:",
         difn => 'Different collaborative tools<br />for different members:',          difn => 'Different collaborative tools<br />for different members:',
         stda => 'Start date',          stda => 'Start date:',
         enda => 'End date:',          enda => 'End date:',
     );      );
     my $showstart = &Apache::lonlocal::locallocaltime($startdate);      my $showstart = &Apache::lonlocal::locallocaltime($startdate);
Line 1933  sub print_current_settings { Line 1967  sub print_current_settings {
   <td>    <td>
 ');  ');
     if (@{$available} > 0) {      if (@{$available} > 0) {
         $r->print(&mt('<b>Available for assignment to members:</b>').          $r->print('<b>'.&mt('Available for assignment to members:').'</b>'.
                     '<table class="LC_group_priv"><tr>');                      '<table class="LC_group_priv"><tr>');
         my $rowcell = int(@{$available}/2) + @{$available}%2;          my $rowcell = int(@{$available}/2) + @{$available}%2;
         for (my $i=0; $i<@{$available}; $i++) {          for (my $i=0; $i<@{$available}; $i++) {
Line 1951  sub print_current_settings { Line 1985  sub print_current_settings {
         $r->print('</tr></table><br />');          $r->print('</tr></table><br />');
     }      }
     if (@{$unavailable} > 0) {      if (@{$unavailable} > 0) {
         $r->print(&mt('<b>Unavailable for assignment:</b>').          $r->print('<b>'.&mt('Unavailable for assignment:').'</b>'.
                     '<table class="LC_group_priv"><tr>');                      '<table class="LC_group_priv"><tr>');
         my $rowcell = int(@{$unavailable}/2) + @{$unavailable}%2;          my $rowcell = int(@{$unavailable}/2) + @{$unavailable}%2;
         for (my $j=0; $j<@{$unavailable}; $j++) {          for (my $j=0; $j<@{$unavailable}; $j++) {
Line 1968  sub print_current_settings { Line 2002  sub print_current_settings {
         }          }
         $r->print('</tr></table>');          $r->print('</tr></table>');
     }      }
       my $quota_text=&mt('[_1] Mb',$quota);
       my $granu_text=&mt($granularity);
     $r->print(<<"END");      $r->print(<<"END");
   </td>    </td>
   <td valign="top"><b>$lt{'difn'}</b> $granularity</td>    <td valign="top"><b>$lt{'difn'}</b> $granu_text</td>
   <td valign="top">$quota Mb</td>     <td valign="top">$quota_text</td> 
   <td valign="top"><b>$lt{'stda'}</b> $showstart<br />    <td valign="top"><b>$lt{'stda'}</b> $showstart<br />
       <b>$lt{'enda'}</b> $showend        <b>$lt{'enda'}</b> $showend
   </td>    </td>
Line 1994  sub pick_new_members { Line 2030  sub pick_new_members {
           'nnew' => "There are no users to add as new members, as all users".            'nnew' => "There are no users to add as new members, as all users".
                     " matching the specified type(s), role(s), and ".                      " matching the specified type(s), role(s), and ".
                     "section(s) are already affiliated with this group.",                      "section(s) are already affiliated with this group.",
           'yoma' =>  'You may need to use the '."'".'modify existing, past or '.            'yoma' =>  "You may need to use the 'modify existing, past or ".
                      'future members'."'".' page if you need to re-enable '.                       "future members' page if you need to re-enable ".
                      'or activate access for previous or future members.',                       "or activate access for previous or future members.",
     );      );
     my %members;      my %members;
     my $totalusers = 0;      my $totalusers = 0;
Line 2029  sub pick_new_members { Line 2065  sub pick_new_members {
         if (@{$available} > 0 && $granularity eq 'Yes') {          if (@{$available} > 0 && $granularity eq 'Yes') {
             $r->print('<td>              $r->print('<td>
      <fieldset><legend><b>'.$lt{'setf'}.'</b></legend>       <fieldset><legend><b>'.$lt{'setf'}.'</b></legend>
       <nobr>        <span class="LC_nobreak">
       <input type="button" value="check all"        <input type="button" value="'.&mt('check all').'"
         onclick="javascript:checkAllTools(document.'.$formname.')" />          onclick="javascript:checkAllTools(document.'.$formname.')" />
         &nbsp;&nbsp;          &nbsp;&nbsp;
       <input type="button" value="uncheck all"        <input type="button" value="'.&mt('uncheck all').'"
         onclick="javascript:uncheckAllTools(document.'.$formname.')" />          onclick="javascript:uncheckAllTools(document.'.$formname.')" />
       </nobr>        </span>
      </fieldset></td>');       </fieldset></td>');
         }          }
         $r->print('</tr></table>          $r->print('</tr></table>
Line 2058  sub pick_new_members { Line 2094  sub pick_new_members {
             if ($granularity eq 'Yes') {              if ($granularity eq 'Yes') {
                 $r->print(&Apache::loncommon::start_data_table_row('LC_data_table_dense LC_data_table_highlight').'                  $r->print(&Apache::loncommon::start_data_table_row('LC_data_table_dense LC_data_table_highlight').'
  <td colspan="6">&nbsp;</td>   <td colspan="6">&nbsp;</td>
  <td align="center"><nobr><b>'.&mt('All:').'</b>&nbsp;');   <td align="center"><span class="LC_nobreak"><b>'.&mt('All:').'</b>&nbsp;');
                 foreach my $tool (@{$available}) {                  foreach my $tool (@{$available}) {
                     $r->print('<label><input type="checkbox" name="togglefunc" '.                      $r->print('<label><input type="checkbox" name="togglefunc" '.
    'onclick="javascript:toggleTools(document.'.$formname.'.user_'.$tool.',this);"'.     'onclick="javascript:toggleTools(document.'.$formname.'.user_'.$tool.',this);"'.
    ' value="'.$tool.'">'.'<b>'.$tool.'</b></label>&nbsp;&nbsp;&nbsp;');     ' value="'.$tool.'">'.'<b>'.$tool.'</b></label>&nbsp;&nbsp;&nbsp;');
                 }                  }
                 $r->print('</nobr></td></tr>');                  $r->print('</span></td></tr>');
             }              }
         }          }
         my %Sortby = ();          my %Sortby = ();
Line 2098  sub pick_new_members { Line 2134  sub pick_new_members {
   '<td>'.$id.'</td>'.    '<td>'.$id.'</td>'.
   '<td>'.$section.'</td>');    '<td>'.$section.'</td>');
                 if (@{$available} > 0) {                  if (@{$available} > 0) {
                     $r->print('<td align="center"><nobr>'.                      $r->print('<td align="center"><span class="LC_nobreak">'.
                               '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');                                '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
                     foreach my $tool (@{$available}) {                      foreach my $tool (@{$available}) {
                         if ($granularity eq 'Yes') {                          if ($granularity eq 'Yes') {
Line 2109  sub pick_new_members { Line 2145  sub pick_new_members {
                           $tool.'" value="'.$user.'" />'.$tool.'&nbsp;&nbsp;&nbsp;');                            $tool.'" value="'.$user.'" />'.$tool.'&nbsp;&nbsp;&nbsp;');
                         }                          }
                     }                      }
                     $r->print('</nobr></td>');                      $r->print('</span></td>');
                 }                  }
                 $r->print(&Apache::loncommon::end_data_table_row()."\n");                  $r->print(&Apache::loncommon::end_data_table_row()."\n");
             }              }
Line 2196  sub privilege_specificity { Line 2232  sub privilege_specificity {
         if ($totaloptionalprivs) {          if ($totaloptionalprivs) {
             $r->print('              $r->print('
 <br />  <br />
 <label><nobr><input type="radio" name="specificity" value="No" '.$specific{'No'}.' />&nbsp;'.$lt{'algm'}.'</nobr></label><br />  <label><span class="LC_nobreak"><input type="radio" name="specificity" value="No" '.$specific{'No'}.' />&nbsp;'.$lt{'algm'}.'</span></label><br />
 <label><nobr><input type="radio" name="specificity" value="Yes" '.$specific{'Yes'}.' />&nbsp;'.$lt{'smgp'}.'</nobr></label><br /><br />');  <label><span class="LC_nobreak"><input type="radio" name="specificity" value="Yes" '.$specific{'Yes'}.' />&nbsp;'.$lt{'smgp'}.'</span></label><br /><br />');
         } else {          } else {
             $r->print('<input type="hidden" name="specificity" value="No" />');              $r->print('<input type="hidden" name="specificity" value="No" />');
         }          }
Line 2273  sub default_privileges { Line 2309  sub default_privileges {
  if ($fixed ne '') {   if ($fixed ne '') {
     $fixed .= '</td><td class="LC_groups_fixed">';      $fixed .= '</td><td class="LC_groups_fixed">';
  }   }
                 $fixed .= '<input type="hidden" name="defpriv" value="'.$priv.'" /><nobr>'.$$toolprivs{$tool}{$priv}.'&nbsp;';                  $fixed .= '<input type="hidden" name="defpriv" value="'.$priv.'" />'
                            .'<span class="LC_nobreak">'.$$toolprivs{$tool}{$priv}.'&nbsp;';
                 if ($action eq 'modify') {                  if ($action eq 'modify') {
                     if (grep(/^$tool$/,@{$available})) {                      if (grep(/^$tool$/,@{$available})) {
                         $fixed .= '<small>'.&mt('(on)').'<small>&nbsp;';                          $fixed .= '<small>'.&mt('(on)').'<small>&nbsp;';
Line 2281  sub default_privileges { Line 2318  sub default_privileges {
                         $fixed .= '<small>'.&mt('(off)').'<small>&nbsp;';                          $fixed .= '<small>'.&mt('(off)').'<small>&nbsp;';
                     }                      }
                 }                  }
                 $fixed .= '</nobr>';                  $fixed .= '</span>';
             } else {              } else {
                 $privcount++;                  $privcount++;
                 if ($privcount == 3) {                  if ($privcount == 3) {
                     $dynamic .= '</tr>                      $dynamic .= '</tr>
                                  <tr>'."\n";                                   <tr>'."\n";
                 }                  }
                 $dynamic .= '<td><nobr><label><input type="checkbox" name="defpriv" value="'.$priv.'" />'.$$toolprivs{$tool}{$priv}.'</label></nobr></td>'."\n";                  $dynamic .= '<td><span class="LC_nobreak"><label><input type="checkbox" name="defpriv" value="'.$priv.'" />'.$$toolprivs{$tool}{$priv}.'</label></span></td>'."\n";
             }              }
         }          }
         if ($privcount == 0) {          if ($privcount == 0) {
             $dynamic .= '<td>None</td>'."\n";              $dynamic .= '<td>'.&mt('None').'</td>'."\n";
         }          }
         if ($privcount < 3) {          if ($privcount < 3) {
             $dynamic .= '<td>&nbsp;</td>'."\n";              $dynamic .= '<td>&nbsp;</td>'."\n";
Line 2472  sub current_membership { Line 2509  sub current_membership {
                 $r->print(&check_uncheck_tools($r,$available));                  $r->print(&check_uncheck_tools($r,$available));
                 $r->print('                  $r->print('
      <td>       <td>
       <nobr>        <span class="LC_nobreak">
        <fieldset><legend><b>'.$lt{'curf'}.'</b></legend>         <fieldset><legend><b>'.$lt{'curf'}.'</b></legend>
        <input type="button" value="check all"         <input type="button" value="'.&mt('check all').'"
        onclick="javascript:checkAllTools(document.'.$formname.')" />         onclick="javascript:checkAllTools(document.'.$formname.')" />
        &nbsp;&nbsp;         &nbsp;&nbsp;
        <input type="button" value="uncheck all"         <input type="button" value="'.&mt('uncheck all').'"
         onclick="javascript:uncheckAllTools(document.'.$formname.')" />          onclick="javascript:uncheckAllTools(document.'.$formname.')" />
       </fieldset>        </fieldset>
      </nobr>       </span>
     </td>      </td>
 ');  ');
             }              }
Line 2515  END Line 2552  END
             if ($granularity eq 'Yes') {              if ($granularity eq 'Yes') {
                 $r->print(&Apache::loncommon::start_data_table_row('LC_data_table_dense LC_data_table_highlight').'                  $r->print(&Apache::loncommon::start_data_table_row('LC_data_table_dense LC_data_table_highlight').'
  <td colspan="7">&nbsp;</td>   <td colspan="7">&nbsp;</td>
  <td colspan="'.$colspan.'" align="center"><nobr><b>'.&mt('All:').   <td colspan="'.$colspan.'" align="center"><span class="LC_nobreak"><b>'.&mt('All:').
   '</b>&nbsp;');    '</b>&nbsp;');
                 foreach my $tool (@{$available}) {                  foreach my $tool (@{$available}) {
                     $r->print('<label><input type="checkbox" name="togglefunc"'.                      $r->print('<label><input type="checkbox" name="togglefunc"'.
    ' onclick="javascript:toggleTools(document.'.$formname.'.user_'.$tool.',this);"'.     ' onclick="javascript:toggleTools(document.'.$formname.'.user_'.$tool.',this);"'.
    ' value="'.$tool.'" />'.'<b>'.$tool.'</b></label>&nbsp;&nbsp;&nbsp;');     ' value="'.$tool.'" />'.'<b>'.$tool.'</b></label>&nbsp;&nbsp;&nbsp;');
                 }                  }
                 $r->print('</nobr></td></tr>');                  $r->print('</span></td></tr>');
             }              }
         }          }
         my %Sortby = ();          my %Sortby = ();
Line 2550  END Line 2587  END
                 $r->print(&Apache::loncommon::start_data_table_row('LC_data_table_dense').'                  $r->print(&Apache::loncommon::start_data_table_row('LC_data_table_dense').'
                             <td>');                              <td>');
                 if ($$current{$user}{changestate} eq 'reenable') {                  if ($$current{$user}{changestate} eq 'reenable') {
                     $r->print('<nobr><label>'.                       $r->print('<span class="LC_nobreak"><label>'. 
    '<input type="checkbox" name="reenable" value="'.$user.'" />'.     '<input type="checkbox" name="reenable" value="'.$user.'" />'.
    $lt{'reen'}.'</label></nobr><br />');     $lt{'reen'}.'</label></span><br />');
                 } elsif ($$current{$user}{changestate} eq 'expire') {                  } elsif ($$current{$user}{changestate} eq 'expire') {
                     $r->print('<nobr><label>'.                      $r->print('<span class="LC_nobreak"><label>'.
    '<input type="checkbox" name="expire" value="'.$user.'" />'.     '<input type="checkbox" name="expire" value="'.$user.'" />'.
    $lt{'expi'}.'</label></nobr><br />');     $lt{'expi'}.'</label></span><br />');
                 } elsif ($$current{$user}{changestate} eq 'activate') {                  } elsif ($$current{$user}{changestate} eq 'activate') {
                     $r->print('<nobr><label>'.                      $r->print('<span class="LC_nobreak"><label>'.
    '<input type="checkbox" name="activate" value="'.$user.'" />'.     '<input type="checkbox" name="activate" value="'.$user.'" />'.
    $lt{'acti'}.'</label></nobr><br />');     $lt{'acti'}.'</label></span><br />');
                 }                  }
                 $r->print('<nobr><label>'.                  $r->print('<span class="LC_nobreak"><label>'.
    '<input type="checkbox" name="deletion" value="'.$user.'" />'.     '<input type="checkbox" name="deletion" value="'.$user.'" />'.
    $lt{'dele'}.'</label></nobr>');     $lt{'dele'}.'</label></span>');
                 if ($specificity eq 'Yes') {                  if ($specificity eq 'Yes') {
                     $r->print('<br /><nobr><label>'.                      $r->print('<br /><span class="LC_nobreak"><label>'.
    '<input type="checkbox" name="changepriv" value="'.$user.'" />'.$lt{'chpr'}.     '<input type="checkbox" name="changepriv" value="'.$user.'" />'.$lt{'chpr'}.
    '</label></nobr>');     '</label></span>');
                 }                  }
                 $r->print('                  $r->print('
    </td>'.     </td>'.
Line 2579  END Line 2616  END
    '<td>'.$start.'</td>'.     '<td>'.$start.'</td>'.
    '<td>'.$end.'</td>');     '<td>'.$end.'</td>');
                 if ($hastools) {                  if ($hastools) {
                     $r->print('<td align="left"><nobr>'.                      $r->print('<td align="left"><span class="LC_nobreak">'.
                                   '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');                                    '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
                     foreach my $tool (@{$$current{$user}{currtools}}) {                      foreach my $tool (@{$$current{$user}{currtools}}) {
                         if ($granularity eq 'Yes') {                          if ($granularity eq 'Yes') {
Line 2595  END Line 2632  END
                          }                           }
                          $r->print('&nbsp;&nbsp;&nbsp;');                           $r->print('&nbsp;&nbsp;&nbsp;');
                     }                      }
                     $r->print('</nobr></td>');                      $r->print('</span></td>');
                 }                  }
                 if ($addtools) {                  if ($addtools) {
                     $r->print('<td align="left">');                      $r->print('<td align="left">');
                     if ($granularity eq 'Yes') {                      if ($granularity eq 'Yes') {
                         foreach my $tool (@{$$current{$user}{newtools}}) {                          foreach my $tool (@{$$current{$user}{newtools}}) {
                             $r->print('<nobr><label><input type="checkbox"                              $r->print('<span class="LC_nobreak"><label><input type="checkbox"
                                           name="user_'.$tool.'" value="'.                                            name="user_'.$tool.'" value="'.
                                           $user.'" />'.$tool.                                            $user.'" />'.$tool.
                                           '</label></nobr>&nbsp;&nbsp;&nbsp;');                                            '</label></span>&nbsp;&nbsp;&nbsp;');
                         }                          }
                     } else {                      } else {
                         foreach my $tool (@{$$current{$user}{newtools}}) {                          foreach my $tool (@{$$current{$user}{newtools}}) {
                             $r->print('<nobr><input type="hidden"                               $r->print('<span class="LC_nobreak"><input type="hidden" 
                                           name="user_'. $tool.'" value="'.                                            name="user_'. $tool.'" value="'.
                                           $user.'" />'.$tool.                                            $user.'" />'.$tool.
                                           '</nobr>&nbsp;&nbsp;&nbsp;');                                            '</span>&nbsp;&nbsp;&nbsp;');
                         }                          }
                     }                      }
                     $r->print('</td>');                      $r->print('</td>');
Line 2632  sub check_uncheck_buttons { Line 2669  sub check_uncheck_buttons {
      <td '.$colspan.'>       <td '.$colspan.'>
        <fieldset>         <fieldset>
        <legend><b>'.$title.'</b></legend>         <legend><b>'.$title.'</b></legend>
       <nobr>        <span class="LC_nobreak">
        <input type="button" value="check all"         <input type="button" value="'.&mt('check all').'"
        onclick="javascript:checkAll(document.'.$formname.'.'.$field.')" />         onclick="javascript:checkAll(document.'.$formname.'.'.$field.')" />
        &nbsp;&nbsp;         &nbsp;&nbsp;
        <input type="button" value="uncheck all"         <input type="button" value="'.&mt('uncheck all').'"
        onclick="javascript:uncheckAll(document.'.$formname.'.'.$field.')" />         onclick="javascript:uncheckAll(document.'.$formname.'.'.$field.')" />
       </nobr>        </span>
        </fieldset>         </fieldset>
      </td>       </td>
 ');  ');
Line 2838  sub member_privileges_form { Line 2875  sub member_privileges_form {
                       'members being added or modified, '.                         'members being added or modified, '. 
                       'there are no optional privileges to set '.                        'there are no optional privileges to set '.
                       'for specific members.',                        'for specific members.',
             'algr' => 'All new group members will receive the same privileges.',            'ifex' => 'If previously expired members are being re-enabled, or '.              'algr' => 'All new group members will receive the same privileges.',
               'ifex' => 'If previously expired members are being re-enabled, or '.
                       'if access for future members is being activated now, '.                        'if access for future members is being activated now, '.
                       'previously set privileges will be preserved.',                        'previously set privileges will be preserved.',
             'asno' => 'As no group members are being added, '.              'asno' => 'As no group members are being added, '.
Line 2916  sub member_privileges_form { Line 2954  sub member_privileges_form {
                             $r->print('<td valign="top">');                              $r->print('<td valign="top">');
                             $r->print('<table class="thinborder"><tr>'.                              $r->print('<table class="thinborder"><tr>'.
       '<th colspan="'.$colspan.'">'.        '<th colspan="'.$colspan.'">'.
                                       $tool.'</th></tr><tr>');                                        &mt($tool).'</th></tr><tr>');
                             my $privcount = 0;                              my $privcount = 0;
                             foreach my $priv (@{$showboxes{$tool}}) {                              foreach my $priv (@{$showboxes{$tool}}) {
                                 $privcount ++;                                  $privcount ++;
Line 2930  sub member_privileges_form { Line 2968  sub member_privileges_form {
                                 } else {                                  } else {
                                     $r->print('<td>');                                      $r->print('<td>');
                                 }                                  }
                                 $r->print(qq|                                  $r->print(
        <fieldset><legend><b>$$toolprivs{$tool}{$priv}</b></legend>   '<fieldset><legend><b>'.&mt($$toolprivs{$tool}{$priv}).'</b></legend>'
        <nobr>  .'<span class="LC_nobreak">'
        <input type="button" value="check all"  .' <input type="button" value="'.&mt('check all').'"'
          onclick="javascript:checkAll(document.$formname.userpriv_$priv)" />  .' onclick="javascript:checkAll(document.'.$formname.'.userpriv_'.$priv.')" />'
        &nbsp;  .'&nbsp;'
        <input type="button" value="uncheck all"  .'<input type="button" value="'.&mt('uncheck all').'"'
         onclick="javascript:uncheckAll(document.$formname.userpriv_$priv)" />  .' onclick="javascript:uncheckAll(document.'.$formname.'.userpriv_'.$priv.')" />'
       </nobr></fieldset><br />|);  .'</span></fieldset><br />'
                                   );
                                 $r->print('</td>');                                  $r->print('</td>');
                                 if ($privcount < @{$showboxes{$tool}}) {                                  if ($privcount < @{$showboxes{$tool}}) {
                                     if (@{$showboxes{$tool}} > 2) {                                      if (@{$showboxes{$tool}} > 2) {
Line 3082  sub write_group_data { Line 3121  sub write_group_data {
     }      }
     if ($quota !~ /^\d*\.?\d*$/) {      if ($quota !~ /^\d*\.?\d*$/) {
         $quota = 0;          $quota = 0;
         $r->print(&mt('The value you entered for the quota for the file repository in this [_1] contained invalid characters, so it has been set to 0 Mb. You can change this by modifying the [_1] settings.<br />',$gpterm));          $r->print('<div class="LC_warning">'
                    .&mt('The value you entered for the quota for the file repository in this '.$gpterm
                    .' contained invalid characters, so it has been set to 0 Mb. You can change this by'
                    .' modifying the '.$gpterm.' settings.')
                    .'</div>');
     }      }
     if ($quota > $maxposs) {      if ($quota > $maxposs) {
         $quota = $maxposs;          $quota = $maxposs;
         $r->print(&mt('The value you entered for the quota for the file repository in this [_1] exceeded the maximum possible value, so it has been set to [_2] Mb (the maximum possible value).<br />',$gpterm,sprintf("%.2f",$maxposs)));          $r->print('<div class="LC_warning">'
                    .&mt('The value you entered for the quota for the file repository in this '.$gpterm
                    .' exceeded the maximum possible value, so it has been set to [_1] Mb '
                    .'(the maximum possible value).',sprintf("%.2f",$maxposs))
                    .'</div>');
     }      }
     my %groupinfo = (      my %groupinfo = (
                      description => $esc_description,                       description => $esc_description,
Line 3151  sub write_group_data { Line 3198  sub write_group_data {
             my $result = &add_group_folder($cdom,$cnum,$now,$groupname,$action,              my $result = &add_group_folder($cdom,$cnum,$now,$groupname,$action,
                                            $description,$tools,\%groupinfo,                                             $description,$tools,\%groupinfo,
                                            $gpterm,$ucgpterm,$crstype);                                             $gpterm,$ucgpterm,$crstype);
             if ($result ne 'ok') {              if ($result eq 'ok') {
                 $r->print(&mt('A problem occurred when creating folders for the new [_1].<br />[_2]<br />',$gpterm,$result));                  $r->print('<div class="LC_success">'
                            .&mt($ucgpterm.' [_1] was created.','<i>'.$groupname.'</i>')
                            .'</div>');
               } else {
                   $r->print('<div class="LC_error">'
                            .&mt('A problem occurred when creating folders for the new '.$gpterm.' [_1]:'
                                ,'<i>'.$groupname.'</i>')
                            .'<br />'.$result
                            .'</div>');
             }              }
             $r->print(&mt('[_1] [_2] was created.<br />',$ucgpterm,$groupname));  
         } elsif ($action eq 'modify') {          } elsif ($action eq 'modify') {
             my (@oldtools,@newtools);               my (@oldtools,@newtools); 
             if (ref($$stored{'tool'}) eq 'ARRAY') {              if (ref($$stored{'tool'}) eq 'ARRAY') {
Line 3184  sub write_group_data { Line 3238  sub write_group_data {
                         my $parm_result = &parm_setter($navmap,$cdom,$boardsmap,                          my $parm_result = &parm_setter($navmap,$cdom,$boardsmap,
                                                        $groupname);                                                         $groupname);
                         if ($parm_result) {                          if ($parm_result) {
                             $r->print(&mt('Error while setting parameters '.                              $r->print('<div class="LC_error">'
                                           'for Discussion Boards folder: '.                                       .&mt('An error occurred while setting parameters '
                                           '[_1]<br />.',$parm_result));                                           .'for Discussion Boards folder: '
                                            .'[_1]',$parm_result)
                                        .'</div>');
                         } else {                          } else {
                             $r->print(&mt('Discussion Boards Folder created.<br />'));                              $r->print('<div class="LC_success">'
                                        .&mt('Discussion Boards Folder created.')
                                        .'</div>');
                         }                          }
                     } else {                      } else {
                         $r->print($outcome);                          $r->print($outcome);
Line 3196  sub write_group_data { Line 3254  sub write_group_data {
                     undef($navmap);                      undef($navmap);
                 }                  }
             }              }
             $r->print(&mt('[_1] [_2] was updated.<br />',$ucgpterm,$groupname));              $r->print('<div class="LC_success">'
                        .&mt($ucgpterm.' [_1] was updated.','<i>'.$groupname.'</i>')
                        .'</div>');
         }          }
     } else {      } else {
         my %actiontype = (          my %actiontype = (
Line 3206  sub write_group_data { Line 3266  sub write_group_data {
         &Apache::lonnet::logthis("Failed to store $gpterm $groupname ".          &Apache::lonnet::logthis("Failed to store $gpterm $groupname ".
                                  'in '.lc($crstype).': '.$cnum.                                   'in '.lc($crstype).': '.$cnum.
                                  ' in domain: '.$cdom);                                   ' in domain: '.$cdom);
         $r->print(&mt('An error occurred when [_1] the [_2]. '.          $r->print('<div class="LC_error">'
                       'Please try again.',$actiontype{$action},$gpterm));                   .&mt('An error occurred when [_1] the '.$gpterm.'. '
                    .'Please try again.',$actiontype{$action})
                    .'</div>');
     }      }
     return $result;      return $result;
 }  }
Line 3400  sub process_membership { Line 3462  sub process_membership {
     }      }
     if ($num_fail) {      if ($num_fail) {
         foreach my $type (sort(keys(%failed))) {          foreach my $type (sort(keys(%failed))) {
             $r->print(&mt('The following users could not be [_1], because an error occurred:<br />',$type));              $r->print('<div class="LC_error">'
                        .&mt("The following users could not be $type, because an error occurred:")
                        .'</div>');
             foreach my $user (@{$failed{$type}}) {              foreach my $user (@{$failed{$type}}) {
                 $r->print($$userdata{$user}[$$idx{fullname}].' - '.$user.'<br />');                  $r->print($$userdata{$user}[$$idx{fullname}].' - '.$user.'<br />');
             }              }
Line 3408  sub process_membership { Line 3472  sub process_membership {
         $r->print('<br />');          $r->print('<br />');
     }      }
     if (@unchanged > 0) {      if (@unchanged > 0) {
         $r->print(&mt('No change occurred for the following users:<br />'));          $r->print(&mt('No change occurred for the following users:').'<br />');
         foreach my $user (sort(@unchanged)) {          foreach my $user (sort(@unchanged)) {
             $r->print($$userdata{$user}[$$idx{fullname}].' - '.$user.'<br />');              $r->print($$userdata{$user}[$$idx{fullname}].' - '.$user.'<br />');
         }          }
         $r->print('<br />');          $r->print('<br />');
     }      }
     if ($roster_result eq 'ok') {      if ($roster_result eq 'ok') {
         $r->print('<br />'.&mt('[_1] membership list updated.',$ucgpterm));          $r->print('<div class="LC_success">'
  $r->print('<p>'.&mt("Any currently logged in course users affected by the changes you made to group membership or privileges for the [_1] group will need to log out and log back in for their LON-CAPA sessions to reflect these changes.",$groupname).'</p>');                   .&mt($ucgpterm.' membership list updated.')
     } else {                   .'</div>');
         $r->print('<br />'.&mt('An error occurred while updating the [_1] membership list -',$gpterm).$roster_result.'<br />');   $r->print('<p class="LC_info">'
                    .&mt('Any currently logged in course users affected by the changes you made'
                        .' to group membership or privileges for the [_1] group will need to log out'
                        .' and log back in for their LON-CAPA sessions to reflect these changes.'
                        ,'<i>'.$groupname.'</i>')
                    .'</p>'
           );
       } else {
           $r->print('<div class="LC_error">'
                    .&mt("An error occurred while updating the $gpterm membership list:")
                    .'<br />'.$roster_result
                    .'</div>');
     }      }
     return;      return;
 }  }
Line 3459  sub automapping { Line 3534  sub automapping {
     }      }
     $r->print(&Apache::lonhtmlcommon::topic_bar($image,$$lt{'endi'}).'      $r->print(&Apache::lonhtmlcommon::topic_bar($image,$$lt{'endi'}).'
     <b>'.$$lt{'gmma'}.':</b><br />'.$$lt{'adds'}.'<br />'.$$lt{'drops'}.'<br /><br />      <b>'.$$lt{'gmma'}.':</b><br />'.$$lt{'adds'}.'<br />'.$$lt{'drops'}.'<br /><br />
    <nobr>'.$$lt{'auad'}.':&nbsp;     <span class="LC_nobreak">'.$$lt{'auad'}.':&nbsp;
     <label><input type="radio" name="autoadd" value="on" />on&nbsp;&nbsp;</label><label><input type="radio" name="autoadd" value="off" checked="checked" />off</label>');      <label><input type="radio" name="autoadd" value="on" />'.&mt('on').'&nbsp;&nbsp;</label><label><input type="radio" name="autoadd" value="off" checked="checked" />'.&mt('off').'</label>');
     if ($action eq 'modify') {      if ($action eq 'modify') {
         $r->print('&nbsp;&nbsp;&nbsp;&nbsp;('.$$lt{'curr'}.' <b>'.$$lt{$add}.'</b>)');          $r->print('&nbsp;&nbsp;&nbsp;&nbsp;('.$$lt{'curr'}.' <b>'.$$lt{$add}.'</b>)');
     }      }
     $r->print('      $r->print('
     </nobr><br />      </span><br />
     <nobr>'.$$lt{'auex'}.':&nbsp;      <span class="LC_nobreak">'.$$lt{'auex'}.':&nbsp;
     <label><input type="radio" name="autodrop" value="on" />on&nbsp;&nbsp;</label><label><input type="radio" name="autodrop" value="off" checked="checked" />off</label>');      <label><input type="radio" name="autodrop" value="on" />'.&mt('on').'&nbsp;&nbsp;</label><label><input type="radio" name="autodrop" value="off" checked="checked" />'.&mt('off').'</label>');
     if ($action eq 'modify') {      if ($action eq 'modify') {
         $r->print('&nbsp;&nbsp;&nbsp;&nbsp;('.$$lt{'curr'}.' <b>'.$$lt{$drop}.'</b>)');          $r->print('&nbsp;&nbsp;&nbsp;&nbsp;('.$$lt{'curr'}.' <b>'.$$lt{$drop}.'</b>)');
     }      }
     $r->print('</nobr><br /><br />'.$$lt{'mapr'});      $r->print('</span><br /><br />'.$$lt{'mapr'});
 }  }
   
 sub mapping_settings {  sub mapping_settings {
Line 3631  sub member_privs_entries { Line 3706  sub member_privs_entries {
                         if ($privcount == 3) {                          if ($privcount == 3) {
                             $dynamic .= '</tr><tr>';                              $dynamic .= '</tr><tr>';
                         }                          }
                         $dynamic .='<td><nobr><label><input type="checkbox" '.                          $dynamic .='<td><span class="LC_nobreak"><label><input type="checkbox" '.
                                'name="userpriv_'.$priv.'" value="'.$user.'"';                                 'name="userpriv_'.$priv.'" value="'.$user.'"';
                         if (grep/^\Q$priv\E$/,@{$defprivs}) {                          if (grep/^\Q$priv\E$/,@{$defprivs}) {
                             $dynamic .= ' checked="checked" ';                              $dynamic .= ' checked="checked" ';
                         }                          }
                         $dynamic .= ' />'.$$toolprivs{$tool}{$priv}.                          $dynamic .= ' />'.$$toolprivs{$tool}{$priv}.
                                     '</label></nobr></td>';                                      '</label></span></td>';
                     }                      }
                 }                  }
                 $r->print('<tr><td colspan="2"><nobr>'.$fixed.'</nobr></td></tr><tr>'.$dynamic.'</tr></table></td>');                  $r->print('<tr><td colspan="2"><span class="LC_nobreak">'.$fixed.'</span></td></tr><tr>'.$dynamic.'</tr></table></td>');
             } else {              } else {
                 $r->print('<td valign="top"><table width="100%"><tr><th colspan="2">'.$tool.'</th></tr><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr></table></td>');                  $r->print('<td valign="top"><table width="100%"><tr><th colspan="2">'.$tool.'</th></tr><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr></table></td>');
             }              }
Line 3667  sub date_setting_table { Line 3742  sub date_setting_table {
     my $endform = &Apache::lonhtmlcommon::date_setter($formname,      my $endform = &Apache::lonhtmlcommon::date_setter($formname,
                                                       'enddate',$endtime);                                                        'enddate',$endtime);
     my $perpetual =       my $perpetual = 
  '<nobr><label><input type="checkbox" name="no_end_date" />'.   '<span class="LC_nobreak"><label><input type="checkbox" name="no_end_date" />'.
  &mt('None').'</label></nobr>';   &mt('None').'</label></span>';
     my $table = "<table class=\"LC_descriptive_input\">\n".      my $table = "<table class=\"LC_descriptive_input\">\n".
  '<tr><td class="LC_description">'.&mt('Start:').'</td>'.   '<tr><td class="LC_description">'.&mt('Start:').'</td>'.
         '<td>'.$startform.'</td>'.          '<td>'.$startform.'</td>'.
Line 3684  sub add_group_folder { Line 3759  sub add_group_folder {
     my ($cdom,$cnum,$now,$groupname,$action,$description,$tools,$groupinfo,      my ($cdom,$cnum,$now,$groupname,$action,$description,$tools,$groupinfo,
         $gpterm,$ucgpterm,$crstype) = @_;          $gpterm,$ucgpterm,$crstype) = @_;
     if ($cdom eq '' || $cnum eq '') {      if ($cdom eq '' || $cnum eq '') {
         return &mt('Error: invalid course domain or number - group folder creation failed');            return '<span class="LC_error">'
                 .&mt('Error: invalid course domain or number - group folder creation failed.')
                 .'</span>';
     }      }
     my ($outcome,$allgrpsmap,$grpmap,$boardsmap,$grppage,$warning);      my ($outcome,$allgrpsmap,$grpmap,$boardsmap,$grppage,$warning);
     my $crspath = '/uploaded/'.$cdom.'/'.$cnum.'/';      my $crspath = '/uploaded/'.$cdom.'/'.$cnum.'/';
Line 3694  sub add_group_folder { Line 3771  sub add_group_folder {
             # check if group_allfolders.sequence exists.              # check if group_allfolders.sequence exists.
             my $mapcontents = &Apache::lonnet::getfile($allgrpsmap);              my $mapcontents = &Apache::lonnet::getfile($allgrpsmap);
             if ($mapcontents eq '-1') { #file does not exist;              if ($mapcontents eq '-1') { #file does not exist;
                 my $grpstitle = &mt('[_1] [_2]s',$crstype,$ucgpterm);                  my $grpstitle = &mt("$crstype $ucgpterm".'s');
                 my $topmap_url = '/'.$env{'course.'.$env{'request.course.id'}.'.url'};                  my $topmap_url = '/'.$env{'course.'.$env{'request.course.id'}.'.url'};
                 $topmap_url =~ s|/+|/|g;                  $topmap_url =~ s|/+|/|g;
                 if ($topmap_url =~ m|^/uploaded|) {                  if ($topmap_url =~ m|^/uploaded|) {
                     $outcome = &map_updater($cdom,$cnum,'group_allfolders.sequence',                      $outcome = &map_updater($cdom,$cnum,'group_allfolders.sequence',
                                             'toplevelgroup',$grpstitle,$topmap_url);                                              'toplevelgroup',$grpstitle,$topmap_url);
                 } else {                  } else {
                     $outcome = &mt('Non-standard course - folder for all groups not added.');                      $outcome = '<span class="LC_warning">'
                                 .&mt('Non-standard course - folder for all groups not added.')
                                 .'</span>';
                 }                  }
                 if ($outcome ne 'ok') {                  if ($outcome ne 'ok') {
                     my $delresult = &release_folder_lock($cdom,$cnum,'group_allfolders');                      my $delresult = &release_folder_lock($cdom,$cnum,'group_allfolders');
                     if ($delresult ne 'ok') {                      if ($delresult ne 'ok') {
                         $warning = $delresult;                          $warning = $delresult;
                     }                      }
                     return $outcome;                      return $outcome.$warning;
                 }                  }
             }              }
             my $delresult = &release_folder_lock($cdom,$cnum,'group_allfolders');              my $delresult = &release_folder_lock($cdom,$cnum,'group_allfolders');
Line 3716  sub add_group_folder { Line 3795  sub add_group_folder {
                 $warning = $delresult ;                  $warning = $delresult ;
             }              }
         } else {          } else {
             $outcome = &mt('Could not obtain exclusive lock to check status of the folder for all groups. No group folder added.');              $outcome = '<span class="LC_error">'
                         .&mt('Could not obtain exclusive lock to check status of the folder for all groups. No group folder added.')
                         .'</span>';
             return $outcome;              return $outcome;
         }          }
         my $grpfolder = &mt($ucgpterm.' Folder - [_1]',$description);          my $grpfolder = &mt($ucgpterm.' Folder - [_1]',$description);
Line 3792  sub release_folder_lock { Line 3873  sub release_folder_lock {
     my @del_lock = ($folder_name."\0".'locked_folder');      my @del_lock = ($folder_name."\0".'locked_folder');
     my $dellockoutcome=&Apache::lonnet::del('coursegroups',\@del_lock,$cdom,$cnum);      my $dellockoutcome=&Apache::lonnet::del('coursegroups',\@del_lock,$cdom,$cnum);
     if ($dellockoutcome ne 'ok') {      if ($dellockoutcome ne 'ok') {
         return ('<br />'.&mt('Warning: failed to release lock for folder: [_1].',$folder_name).'<br />');           return ('<div class="LC_error">'
                  .&mt('Warning: failed to release lock for folder: [_1].','<tt>'.$folder_name.'</tt>')
                  .'</div>'
                  );
     } else {      } else {
         return 'ok';          return 'ok';
     }      }
Line 3807  sub map_updater { Line 3891  sub map_updater {
     my $newmapurl=&Apache::lonnet::finishuserfileupload($cnum,$cdom,$itemname,      my $newmapurl=&Apache::lonnet::finishuserfileupload($cnum,$cdom,$itemname,
                                                         $newfile);                                                          $newfile);
     if ($newmapurl !~ m|^/uploaded|) {      if ($newmapurl !~ m|^/uploaded|) {
         $outcome = &mt('Error uploading new folder.')." ($newfile): $newmapurl".'<br />';          $outcome = '<div class="LC_error">'
                     .&mt('Error uploading new folder.')." ($newfile): $newmapurl"
                     .'</div>';
         return $outcome;          return $outcome;
     }      }
     my ($errtext,$fatal)=&LONCAPA::map::mapread($parentmap);      my ($errtext,$fatal)=&LONCAPA::map::mapread($parentmap);
     if ($fatal) {      if ($fatal) {
         $outcome = &mt('Error reading contents of parent folder')." ($parentmap): $errtext".'<br />';          $outcome = '<div class="LC_error">'
                     .&mt('Error reading contents of parent folder.')." ($parentmap): $errtext"
                     .'</div>';
         return $outcome;          return $outcome;
     } else {      } else {
         my $newidx=&LONCAPA::map::getresidx($newmapurl);          my $newidx=&LONCAPA::map::getresidx($newmapurl);
Line 3821  sub map_updater { Line 3909  sub map_updater {
         $LONCAPA::map::order[1+$#LONCAPA::map::order]=$newidx;          $LONCAPA::map::order[1+$#LONCAPA::map::order]=$newidx;
         my ($outtext,$errtext) = &LONCAPA::map::storemap($parentmap,1);          my ($outtext,$errtext) = &LONCAPA::map::storemap($parentmap,1);
         if ($errtext) {          if ($errtext) {
             $outcome = &mt('Error saving updated parent folder')." ($parentmap):  $errtext".'<br />';              $outcome = '<div class="LC_error">'
                         .&mt('Error saving updated parent folder.')." ($parentmap):  $errtext"
                         .'</div>';
             return $outcome;              return $outcome;
         }          }
     }      }
Line 3871  sub parm_setter { Line 3961  sub parm_setter {
             }              }
         }          }
     } else {      } else {
         $allresults = &mt('Parameters not set for [_1] because the resource was not recognized as part of the course',$url).'<br />';          $allresults = '<div class="LC_warning">' 
                        .&mt('Parameters not set for [_1] because the resource was not recognized'
                            .' as part of the course.','<tt>'.$url.'</tt>')
                        .'</div>';
     }      }
     return $allresults;      return $allresults;
 }  }

Removed from v.1.78  
changed lines
  Added in v.1.80.2.2


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