Diff for /loncom/interface/loncreateuser.pm between versions 1.371 and 1.372

version 1.371, 2012/12/31 15:28:36 version 1.372, 2013/01/01 19:53:26
Line 3062  sub display_userinfo { Line 3062  sub display_userinfo {
                    ref($newsetting) eq 'HASH' &&                     ref($newsetting) eq 'HASH' &&
                    ref($newsettingtext) eq 'HASH');                     ref($newsettingtext) eq 'HASH');
     my %lt=&Apache::lonlocal::texthash(      my %lt=&Apache::lonlocal::texthash(
          'ui'             => 'User Information (unchanged)',           'ui'             => 'User Information',
          'uic'            => 'User Information Changed',           'uic'            => 'User Information Changed',
          'firstname'      => 'First Name',           'firstname'      => 'First Name',
          'middlename'     => 'Middle Name',           'middlename'     => 'Middle Name',
Line 3083  sub display_userinfo { Line 3083  sub display_userinfo {
          'prvs'           => 'Previous Value:',           'prvs'           => 'Previous Value:',
          'chto'           => 'Changed To:'           'chto'           => 'Changed To:'
     );      );
     my $title = $lt{'ui'};   
     if ($changed) {      if ($changed) {
         $title = $lt{'uic'};          $r->print('<h3>'.$lt{'uic'}.'</h3>'.
         $r->print('<h4>'.$title.'</h4>'.  
                 &Apache::loncommon::start_data_table().                  &Apache::loncommon::start_data_table().
                 &Apache::loncommon::start_data_table_header_row());                  &Apache::loncommon::start_data_table_header_row());
         $r->print("<th>&nbsp;</th>\n");          $r->print("<th>&nbsp;</th>\n");
Line 3145  sub display_userinfo { Line 3143  sub display_userinfo {
             }              }
         }          }
         $r->print(&Apache::loncommon::end_data_table().'<br />');          $r->print(&Apache::loncommon::end_data_table().'<br />');
       } else {
           $r->print('<h3>'.$lt{'ui'}.'</h3>'.
                     '<p>'.&mt('No changes made to user information').'</p>');
     }      }
     return;      return;
 }  }
Line 3345  sub update_roles { Line 3346  sub update_roles {
                 $r->print(&Apache::lonhtmlcommon::confirm_success(                  $r->print(&Apache::lonhtmlcommon::confirm_success(
                             &mt('Revoking [_1] in [_2]',                              &mt('Revoking [_1] in [_2]',
                                 &Apache::lonnet::plaintext($role),                                  &Apache::lonnet::plaintext($role),
                                 '"'.&cid_to_cname($scope).'"'),                                  &Apache::loncommon::show_role_extent($scope,$context,$role)),
                                 $result ne "ok").'<br />');                                  $result ne "ok").'<br />');
                 if ($result ne "ok") {                  if ($result ne "ok") {
                     $r->print(&mt('Error: [_1]',$result).'<br />');                      $r->print(&mt('Error: [_1]',$result).'<br />');
Line 3367  sub update_roles { Line 3368  sub update_roles {
                     $env{'form.ccdomain'},$env{'form.ccuname'},$1,$2,$3,$4,'','',$context);                      $env{'form.ccdomain'},$env{'form.ccuname'},$1,$2,$3,$4,'','',$context);
                 $r->print(&Apache::lonhtmlcommon::confirm_success(                  $r->print(&Apache::lonhtmlcommon::confirm_success(
                             &mt('Revoking custom role [_1] by [_2] in [_3]',                              &mt('Revoking custom role [_1] by [_2] in [_3]',
                                 $4,$3.':'.$2,'"'.&cid_to_cname($1).'"'),                                  $4,$3.':'.$2,&Apache::loncommon::show_role_extent($1,$context,'cr')),
                             $result ne 'ok').'<br />');                              $result ne 'ok').'<br />');
                 if ($result ne "ok") {                  if ($result ne "ok") {
                     $r->print(&mt('Error: [_1]',$result).'<br />');                      $r->print(&mt('Error: [_1]',$result).'<br />');
Line 3388  sub update_roles { Line 3389  sub update_roles {
                 $r->print(&Apache::lonhtmlcommon::confirm_success(                  $r->print(&Apache::lonhtmlcommon::confirm_success(
                             &mt('Deleting [_1] in [_2]',                              &mt('Deleting [_1] in [_2]',
                                 &Apache::lonnet::plaintext($role),                                  &Apache::lonnet::plaintext($role),
                                 '"'.&cid_to_cname($scope).'"'),                                  &Apache::loncommon::show_role_extent($scope,$context,$role)),
                             $result ne 'ok').'<br />');                              $result ne 'ok').'<br />');
                 if ($result ne "ok") {                  if ($result ne "ok") {
                     $r->print(&mt('Error: [_1]',$result).'<br />');                      $r->print(&mt('Error: [_1]',$result).'<br />');
Line 3413  sub update_roles { Line 3414  sub update_roles {
                         $env{'form.ccuname'},$url,$rdom,$rnam,$rolename,$now,                          $env{'form.ccuname'},$url,$rdom,$rnam,$rolename,$now,
                         0,1,$context);                          0,1,$context);
                 $r->print(&Apache::lonhtmlcommon::confirm_success(&mt('Deleting custom role [_1] by [_2] in [_3]',                  $r->print(&Apache::lonhtmlcommon::confirm_success(&mt('Deleting custom role [_1] by [_2] in [_3]',
                       $rolename,$rnam.':'.$rdom,'"'.&cid_to_cname($1).'"'),                        $rolename,$rnam.':'.$rdom,&Apache::loncommon::show_role_extent($1,$context,'cr')),
                       $result ne "ok").'<br />');                        $result ne "ok").'<br />');
                 if ($result ne "ok") {                  if ($result ne "ok") {
                     $r->print(&mt('Error: [_1]',$result).'<br />');                      $r->print(&mt('Error: [_1]',$result).'<br />');
Line 3442  sub update_roles { Line 3443  sub update_roles {
                                 $output = &mt('Error: [_1]',$result)."\n";                                  $output = &mt('Error: [_1]',$result)."\n";
                             }                              }
                         } else {                          } else {
                             $output = &Apache::lonhtmlcommon::confirm_success(&mt('Assigning [_1] in [_2] starting [_3]',&Apache::lonnet::plaintext($role),                              $output = &Apache::lonhtmlcommon::confirm_success(&mt('Assigning [_1] in [_2] starting [_3]',
                                         '"'.&cid_to_cname($url).'"',&Apache::lonlocal::locallocaltime($now))).'<br />'.$logmsg.'<br />';                                          &Apache::lonnet::plaintext($role),
                                           &Apache::loncommon::show_role_extent($url,$context,'st'),
                                           &Apache::lonlocal::locallocaltime($now))).'<br />'.$logmsg.'<br />';
                         }                          }
                     }                      }
                 } else {                  } else {
Line 3451  sub update_roles { Line 3454  sub update_roles {
                                $env{'form.ccuname'},$url,$role,0,$now,'','',                                 $env{'form.ccuname'},$url,$role,0,$now,'','',
                                $context);                                 $context);
                         $output = &Apache::lonhtmlcommon::confirm_success(&mt('Re-enabling [_1] in [_2]',                          $output = &Apache::lonhtmlcommon::confirm_success(&mt('Re-enabling [_1] in [_2]',
                                         &Apache::lonnet::plaintext($role),'"'.&cid_to_cname($url).'"'),$result ne "ok").'<br />';                                          &Apache::lonnet::plaintext($role),
                                           &Apache::loncommon::show_role_extent($url,$context,$role)),$result ne "ok").'<br />';
                     if ($result ne "ok") {                      if ($result ne "ok") {
                         $output .= &mt('Error: [_1]',$result).'<br />';                          $output .= &mt('Error: [_1]',$result).'<br />';
                     }                      }
Line 3469  sub update_roles { Line 3473  sub update_roles {
                                $url,$rdom,$rnam,$rolename,0,$now,undef,$context);                                 $url,$rdom,$rnam,$rolename,0,$now,undef,$context);
                 $r->print(&Apache::lonhtmlcommon::confirm_success(                  $r->print(&Apache::lonhtmlcommon::confirm_success(
                     &mt('Re-enabling custom role [_1] by [_2] in [_3]',                      &mt('Re-enabling custom role [_1] by [_2] in [_3]',
                         $rolename,$rnam.':'.$rdom,'"'.&cid_to_cname($1).'"'),                          $rolename,$rnam.':'.$rdom,&Apache::loncommon::show_role_extent($1,$context,'cr')),
                     $result ne "ok").'<br />');                      $result ne "ok").'<br />');
                 if ($result ne "ok") {                  if ($result ne "ok") {
                     $r->print(&mt('Error: [_1]',$result).'<br />');                      $r->print(&mt('Error: [_1]',$result).'<br />');
Line 3613  sub update_roles { Line 3617  sub update_roles {
 # Flush the course logs so reverse user roles immediately updated  # Flush the course logs so reverse user roles immediately updated
     $r->register_cleanup(\&Apache::lonnet::flushcourselogs);      $r->register_cleanup(\&Apache::lonnet::flushcourselogs);
     if (@rolechanges == 0) {      if (@rolechanges == 0) {
         $r->print(&mt('No roles to modify'));          $r->print('<p>'.&mt('No roles to modify').'</p>');
     }      }
     return @rolechanges;      return @rolechanges;
 }  }
Line 6976  sub get_selfenroll_titles { Line 6980  sub get_selfenroll_titles {
 #--------------------------------- functions for &phase_two and &phase_three  #--------------------------------- functions for &phase_two and &phase_three
   
 #--------------------------end of functions for &phase_two and &phase_three  #--------------------------end of functions for &phase_two and &phase_three
 sub cid_to_cname(){  
     my $courseid = shift;  
     $courseid =~ s/^\///;  
     $courseid =~ s/\//_/;  
     return $env{'course.'.$courseid.'.description'};  
 }  
 1;  1;
 __END__  __END__
   

Removed from v.1.371  
changed lines
  Added in v.1.372


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