Diff for /loncom/interface/loncreateuser.pm between versions 1.329.2.1 and 1.331

version 1.329.2.1, 2009/12/15 05:14:13 version 1.331, 2009/12/29 20:00:26
Line 935  sub print_user_modification_page { Line 935  sub print_user_modification_page {
             );              );
             my $response;              my $response;
             if ($env{'form.origform'} eq 'crtusername') {              if ($env{'form.origform'} eq 'crtusername') {
                 $response =  '<span class="LC_warning">'.&mt('No match was found for the username ([_1]) in LON-CAPA domain: [_2]',$ccuname,$ccdomain).                  $response =  '<span class="LC_warning">'.&mt('No match found for the username [_1] in LON-CAPA domain: [_2]','<b>'.$ccuname.'</b>',$ccdomain).
                             '</span><br />';                              '</span><br />';
             }              }
             $response .= '<p class="LC_warning">'              $response .= '<p class="LC_warning">'
Line 2680  sub update_user_data { Line 2680  sub update_user_data {
                                 $newenvhash{'environment.requestcourses.'.$key} =                                  $newenvhash{'environment.requestcourses.'.$key} =
                                     $changeHash{'requestcourses.'.$key};                                      $changeHash{'requestcourses.'.$key};
                                 if ($changeHash{'requestcourses.'.$key} ne '') {                                  if ($changeHash{'requestcourses.'.$key} ne '') {
                                     $newenvhash{'environment.canrequest.'.$key} =                                      $newenvhash{'environment.canrequest.'.$key} = 1
                                         $changeHash{'requestcourses.'.$key};  
                                 } else {                                  } else {
                                     $newenvhash{'environment.canrequest.'.$key} =                                      $newenvhash{'environment.canrequest.'.$key} =
           &Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},            &Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},
Line 4318  END Line 4317  END
 #  Menu Phase One  #  Menu Phase One
 sub print_main_menu {  sub print_main_menu {
     my ($permission,$context,$crstype) = @_;      my ($permission,$context,$crstype) = @_;
     if (($context eq 'course') && (&Apache::loncommon::needs_gci_custom())) {  
         return &print_gci_main_menu($permission,$context,$crstype)  
     }  
     my $linkcontext = $context;      my $linkcontext = $context;
     my $stuterm = lc(&Apache::lonnet::plaintext('st',$crstype));      my $stuterm = lc(&Apache::lonnet::plaintext('st',$crstype));
     if (($context eq 'course') && ($crstype eq 'Community')) {      if (($context eq 'course') && ($crstype eq 'Community')) {
Line 4542  return Apache::lonhtmlcommon::generate_m Line 4538  return Apache::lonhtmlcommon::generate_m
 #               });  #               });
 }  }
   
 sub print_gci_main_menu {  
     my ($permission,$context,$crstype) = @_;  
     my $stuterm = lc(&Apache::lonnet::plaintext('st',$crstype));  
     my ($cnum,$cdom) = &Apache::lonuserutils::get_course_identity();  
     my %links = (  
         course => {  
                     single     => 'Add/Modify a Student',  
                     drop       => 'Drop Students',  
                     upload     => 'Upload a File of Course Users',  
                     singleuser => 'Add/Modify a Course User',  
                     listusers  => 'Manage Course Users',  
                   },  
      );  
      my %linktitles = (  
         course => {  
                     singleuser => 'Add a user with a certain role to this course.',  
                     listusers  => 'Show and manage users in this course.',  
                     single     => 'Add a user with the role of student to this course',  
                     drop       => 'Remove a student from this course.',  
                     upload     => 'Upload a CSV or a text file containing users.',   
                   },  
     );  
     my @menu = ( {categorytitle => 'Manage Users',  
          items =>  
          [  
             {  
              linktext => $links{$context}{'single'},  
              #help => 'Course_Add_Student',  
              icon => 'list-add.png',  
              url => '/adm/createuser?action=singlestudent',  
              permission => $permission->{'cusr'},  
              linktitle => $linktitles{$context}{'single'},  
   
             },  
             {  
              linktext => $links{$context}{'drop'},  
              icon => 'edit-undo.png',  
              #help => 'Course_Drop_Student',  
              url => '/adm/createuser?action=drop',  
              permission => $permission->{'cusr'},  
              linktitle => $linktitles{$context}{'drop'},  
             },  
             {  
              linktext => $links{$context}{'upload'},  
              icon => 'sctr.png',  
              #help => 'Course_Create_Class_List',  
              url => '/adm/createuser?action=upload',  
              permission => $permission->{'cusr'},  
              linktitle => $linktitles{$context}{'upload'},  
             },  
             {  
              linktext => $links{$context}{'listusers'},  
              icon => 'edit-find.png',  
              #help => 'Course_View_Class_List',  
              url => '/adm/createuser?action=listusers',  
              permission => ($permission->{'view'} || $permission->{'cusr'}),  
              linktitle => $linktitles{$context}{'listusers'},  
             },  
          ]},  
          {categorytitle => 'Administration',  
          items => [ ]},  
     );  
   
     push(@{ $menu[1]->{items} }, #Category: Administration  
         {  
            linktext => 'Change Log',  
            icon => 'document-properties.png',  
            #help => 'Course_User_Logs',  
            url => '/adm/createuser?action=changelogs',  
            permission => $permission->{'cusr'},  
            linktitle => 'View change log.',  
          },  
     );  
     return Apache::lonhtmlcommon::generate_menu(@menu);  
 }  
   
 sub restore_prev_selections {  sub restore_prev_selections {
     my %saveable_parameters = ('srchby'   => 'scalar',      my %saveable_parameters = ('srchby'   => 'scalar',
        'srchin'   => 'scalar',         'srchin'   => 'scalar',
Line 5940  sub build_search_response { Line 5860  sub build_search_response {
     my ($context,$srch,%srch_results) = @_;      my ($context,$srch,%srch_results) = @_;
     my ($currstate,$response,$forcenewuser);      my ($currstate,$response,$forcenewuser);
     my %names = (      my %names = (
           'uname' => 'username',            'uname'     => 'username',
           'lastname' => 'last name',            'lastname'  => 'last name',
           'lastfirst' => 'last name, first name',            'lastfirst' => 'last name, first name',
           'crs' => 'this course',            'crs'       => 'this course',
           'dom' => 'LON-CAPA domain: ',            'dom'       => 'LON-CAPA domain',
           'instd' => 'the institutional directory for domain: ',            'instd'     => 'the institutional directory for domain',
     );      );
   
     my %single = (      my %single = (
Line 5965  sub build_search_response { Line 5885  sub build_search_response {
             $currstate = 'modify';              $currstate = 'modify';
             $response = &mt("$single{$srch->{'srchtype'}} was found for the $names{$srch->{'srchby'}} ([_1]) in $names{$srch->{'srchin'}}.",$srch->{'srchterm'});              $response = &mt("$single{$srch->{'srchtype'}} was found for the $names{$srch->{'srchby'}} ([_1]) in $names{$srch->{'srchin'}}.",$srch->{'srchterm'});
             if ($srch->{'srchin'} eq 'dom' || $srch->{'srchin'} eq 'instd') {              if ($srch->{'srchin'} eq 'dom' || $srch->{'srchin'} eq 'instd') {
                 $response .= &display_domain_info($srch->{'srchdomain'});                  $response .= ': '.&display_domain_info($srch->{'srchdomain'});
             }              }
         } else {          } else { # Search has nothing found. Prepare message to user.
             $response = '<span class="LC_warning">'.&mt("$nomatch{$srch->{'srchtype'}} found for the $names{$srch->{'srchby'}} ([_1]) in $names{$srch->{'srchin'}}",$srch->{'srchterm'});              $response = '<span class="LC_warning">';
             if ($srch->{'srchin'} eq 'dom' || $srch->{'srchin'} eq 'instd') {              if ($srch->{'srchin'} eq 'dom' || $srch->{'srchin'} eq 'instd') {
                 $response .= &display_domain_info($srch->{'srchdomain'});                  $response .= &mt("$nomatch{$srch->{'srchtype'}} found for the $names{$srch->{'srchby'}} [_1] in $names{$srch->{'srchin'}}: [_2]",
                                    '<b>'.$srch->{'srchterm'}.'</b>',
                                    &display_domain_info($srch->{'srchdomain'}));
               } else {
                   $response .= &mt("$nomatch{$srch->{'srchtype'}} found for the $names{$srch->{'srchby'}} [_1] in $names{$srch->{'srchin'}}.",
                                    '<b>'.$srch->{'srchterm'}.'</b>');
             }              }
             $response .= '</span>';              $response .= '</span>';
   
             if ($srch->{'srchin'} ne 'alc') {              if ($srch->{'srchin'} ne 'alc') {
                 $forcenewuser = 1;                  $forcenewuser = 1;
                 my $cansrchinst = 0;                   my $cansrchinst = 0; 

Removed from v.1.329.2.1  
changed lines
  Added in v.1.331


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