Diff for /loncom/interface/loncreateuser.pm between versions 1.301 and 1.304

version 1.301, 2009/08/04 18:02:30 version 1.304, 2009/08/06 05:48:56
Line 248  sub build_tools_display { Line 248  sub build_tools_display {
             &Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef,              &Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef,
                                               $context);                                                $context);
         if ($userenv{$context.'.'.$item} eq '') {          if ($userenv{$context.'.'.$item} eq '') {
             $custom_access = 'default';              $custom_access = 
                   &mt('Availability determined currently from default setting.');
             if (!$curr_access) {              if (!$curr_access) {
                 $tool_off = 'checked="checked" ';                  $tool_off = 'checked="checked" ';
                 $tool_on = '';                  $tool_on = '';
             }              }
         } else {          } else {
             $custom_access = 'custom';              $custom_access = 
                   &mt('Availability determined currently from custom setting.');
             $cust_on = ' checked="checked" ';              $cust_on = ' checked="checked" ';
             $cust_off = '';              $cust_off = '';
             if ($userenv{$context.'.'.$item} == 0) {              if ($userenv{$context.'.'.$item} == 0) {
Line 266  sub build_tools_display { Line 268  sub build_tools_display {
                    '   <td>'.$lt{$item}.'</td>'."\n".                     '   <td>'.$lt{$item}.'</td>'."\n".
                    '  </tr>'."\n".                     '  </tr>'."\n".
                    &Apache::loncommon::start_data_table_row()."\n".                     &Apache::loncommon::start_data_table_row()."\n".
                    '  <td>'.&mt('Availability determined currently from [_1] setting.',$custom_access).                     '  <td>'.$custom_access.('&nbsp;'x5).$lt{'avai'}.': '.
                    '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$lt{'avai'}.': '.  
                    ($curr_access?&mt('Yes'):&mt('No')).'</td>'."\n".                     ($curr_access?&mt('Yes'):&mt('No')).'</td>'."\n".
                    &Apache::loncommon::end_data_table_row()."\n".                     &Apache::loncommon::end_data_table_row()."\n".
                    &Apache::loncommon::start_data_table_row()."\n".                     &Apache::loncommon::start_data_table_row()."\n".
Line 530  END Line 531  END
   
 # =================================================================== Phase two  # =================================================================== Phase two
 sub print_user_selection_page {  sub print_user_selection_page {
     my ($r,$response,$srch,$srch_results,$srcharray,$context) = @_;      my ($r,$response,$srch,$srch_results,$srcharray,$context,$opener_elements) = @_;
     my @fields = ('username','domain','lastname','firstname','permanentemail');      my @fields = ('username','domain','lastname','firstname','permanentemail');
     my $sortby = $env{'form.sortby'};      my $sortby = $env{'form.sortby'};
   
Line 566  ENDSCRIPT Line 567  ENDSCRIPT
                                        'firstname'      => "first name",                                         'firstname'      => "first name",
                                        'permanentemail' => "permanent e-mail",                                         'permanentemail' => "permanent e-mail",
                                       );                                        );
     $r->print(&Apache::loncommon::start_page('User Management',$jscript));      if ($context eq 'requestcrs') {
           $r->print('<div>');
       } else {
           $r->print(&Apache::loncommon::start_page('User Management',$jscript));
   
     my %breadcrumb_text = &singleuser_breadcrumb();          my %breadcrumb_text = &singleuser_breadcrumb();
     &Apache::lonhtmlcommon::add_breadcrumb          &Apache::lonhtmlcommon::add_breadcrumb
         ({href=>"javascript:backPage(document.usersrchform,'','')",              ({href=>"javascript:backPage(document.usersrchform,'','')",
           text=>$breadcrumb_text{'search'},                text=>$breadcrumb_text{'search'},
           faq=>282,bug=>'Instructor Interface',},                faq=>282,bug=>'Instructor Interface',},
          {href=>"javascript:backPage(document.usersrchform,'get_user_info','select')",               {href=>"javascript:backPage(document.usersrchform,'get_user_info','select')",
           text=>$breadcrumb_text{'userpicked'},                text=>$breadcrumb_text{'userpicked'},
           faq=>282,bug=>'Instructor Interface',});                faq=>282,bug=>'Instructor Interface',});
     if ($env{'form.action'} eq 'singleuser') {          if ($env{'form.action'} eq 'singleuser') {
         $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management',              $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management',
                                                       'Course_Change_Privileges'));                                                            'Course_Change_Privileges'));
         $r->print("<b>$lt{'usrch'}</b><br />");              $r->print("<b>$lt{'usrch'}</b><br />");
         $r->print(&entry_form($srch->{'srchdomain'},$srch,undef,$context));              $r->print(&entry_form($srch->{'srchdomain'},$srch,undef,$context));
         $r->print('<h3>'.$lt{'usel'}.'</h3>');              $r->print('<h3>'.$lt{'usel'}.'</h3>');
     } elsif ($env{'form.action'} eq 'singlestudent') {          } elsif ($env{'form.action'} eq 'singlestudent') {
         $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management',              $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management',
                                                       'Course_Add_Student'));                                                            'Course_Add_Student'));
         $r->print($jscript."<b>$lt{'stusrch'}</b><br />");              $r->print($jscript."<b>$lt{'stusrch'}</b><br />");
         $r->print(&entry_form($srch->{'srchdomain'},$srch,undef,$context));              $r->print(&entry_form($srch->{'srchdomain'},$srch,undef,$context));
         $r->print('</form><h3>'.$lt{'stusel'}.'</h3>');              $r->print('</form><h3>'.$lt{'stusel'}.'</h3>');
           }
     }      }
     $r->print('<form name="usersrchform" method="post">'.      $r->print('<form name="usersrchform" method="post">'.
               &Apache::loncommon::start_data_table()."\n".                &Apache::loncommon::start_data_table()."\n".
Line 612  ENDSCRIPT Line 617  ENDSCRIPT
   
     foreach my $user (@sorted_users) {      foreach my $user (@sorted_users) {
         my ($uname,$udom) = split(/:/,$user);          my ($uname,$udom) = split(/:/,$user);
           my $onclick;
           if ($context eq 'requestcrs') {
               $onclick = 
                   'onclick="javascript:gochoose('."'$uname','$udom',".
                                                  "'$srch_results->{$user}->{firstname}',".
                                                  "'$srch_results->{$user}->{lastname}',".
                                                  "'$srch_results->{$user}->{permanentemail}'".');"';
           } else {
               $onclick = 
                   ' onclick="javascript:pickuser('."'".$uname."'".','."'".$udom."'".');"';
           }
         $r->print(&Apache::loncommon::start_data_table_row().          $r->print(&Apache::loncommon::start_data_table_row().
                   '<td><input type="button" name="seluser" value="'.&mt('Select').'" onclick="javascript:pickuser('."'".$uname."'".','."'".$udom."'".')" /></td>'.                    '<td><input type="button" name="seluser" value="'.&mt('Select').'" '.
                     $onclick.' /></td>'.
                   '<td><tt>'.$uname.'</tt></td>'.                    '<td><tt>'.$uname.'</tt></td>'.
                   '<td><tt>'.$udom.'</tt></td>');                    '<td><tt>'.$udom.'</tt></td>');
         foreach my $field ('lastname','firstname','permanentemail') {          foreach my $field ('lastname','firstname','permanentemail') {
Line 633  ENDSCRIPT Line 650  ENDSCRIPT
               ' <input type="hidden" name="currstate" value="select" />'."\n".                ' <input type="hidden" name="currstate" value="select" />'."\n".
               ' <input type="hidden" name="phase" value="get_user_info" />'."\n".                ' <input type="hidden" name="phase" value="get_user_info" />'."\n".
               ' <input type="hidden" name="action" value="'.$env{'form.action'}.'" />'."\n");                ' <input type="hidden" name="action" value="'.$env{'form.action'}.'" />'."\n");
     $r->print($response.'</form>'.&Apache::loncommon::end_page());      if ($context eq 'requestcrs') {
           $r->print($opener_elements.'</form></div>');
       } else {
           $r->print($response.'</form>'.&Apache::loncommon::end_page());
       }
 }  }
   
 sub print_user_query_page {  sub print_user_query_page {
Line 815  ENDTITLE Line 836  ENDTITLE
             &personal_data_display($ccuname,$ccdomain,$newuser,$context,              &personal_data_display($ccuname,$ccdomain,$newuser,$context,
                                    $inst_results{$ccuname.':'.$ccdomain});                                     $inst_results{$ccuname.':'.$ccdomain});
         $r->print($personal_table);          $r->print($personal_table);
   #FIXME
         my ($home_server_pick,$numlib) =           my ($home_server_pick,$numlib) = 
             &Apache::loncommon::home_server_form_item($ccdomain,'hserver',              &Apache::loncommon::home_server_form_item($ccdomain,'hserver',
                                                       'default','hide');                                                        'default','hide');
Line 826  $lt{'hs'}: $home_server_pick Line 848  $lt{'hs'}: $home_server_pick
         } else {          } else {
             $r->print($home_server_pick);              $r->print($home_server_pick);
         }          }
           if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) {
               $r->print('<br /><h3>'.&mt('User Can Request Creation of Courses in this Domain?').'</h3>'.
                         &Apache::loncommon::start_data_table().
                         &build_tools_display($ccuname,$ccdomain,
                                              'requestcourses').
                         &Apache::loncommon::end_data_table());
           }
         $r->print('</div>'."\n".'<div class="LC_left_float"><h3>'.          $r->print('</div>'."\n".'<div class="LC_left_float"><h3>'.
                   $lt{'lg'}.'</h3>');                    $lt{'lg'}.'</h3>');
         my ($fixedauth,$varauth,$authmsg);           my ($fixedauth,$varauth,$authmsg); 
Line 5114  ENDSCRIPT Line 5143  ENDSCRIPT
   
     # Table Header      # Table Header
     my $tableheader =      my $tableheader =
         &Apache::loncommon::start_data_table()          &Apache::loncommon::start_data_table_header_row()
        .&Apache::loncommon::start_data_table_header_row()  
        .'<th>&nbsp;</th>'         .'<th>&nbsp;</th>'
        .'<th>'.&mt('When').'</th>'         .'<th>'.&mt('When').'</th>'
        .'<th>'.&mt('Who made the change').'</th>'         .'<th>'.&mt('Who made the change').'</th>'
Line 5200  sub role_display_filter { Line 5228  sub role_display_filter {
         }          }
         $output .= '<option value="'.$chgtype.'"'.$selstr.'>'.$lt{$chgtype}.'</option>'."\n";          $output .= '<option value="'.$chgtype.'"'.$selstr.'>'.$lt{$chgtype}.'</option>'."\n";
     }      }
     $output .= '</select></td>'.      $output .= '</select></td>'
                '<td>&nbsp;&nbsp;</td>'.                .'</tr></table>';
                '<td valign="middle"><input type="submit" value="'.  
                &mt('Update Display').'" /></td></tr></table>'.      # Update Display button
                '<span class="LC_roleslog_note">'.      $output .= '<p>'
                &mt('[_1]Note:[_2] Only changes made from servers running LON-CAPA 2.6.99.0 or later are displayed.');                .'<input type="submit" value="'.&mt('Update Display').'" />'
                 .'</p>';
   
       # Server version info
       $output .= '<p class="LC_info">'
                 .&mt('Only changes made from servers running LON-CAPA [_1] or later are displayed.'
                     ,'2.6.99.0');
     if ($version) {      if ($version) {
         $output .= ' '.&mt('This server is version [_3].','<b>','</b>',$version);    }          $output .= ' '.&mt('This LON-CAPA server is version [_1]',$version);
     $output .= '</span><hr /><br />';      }
       $output .= '</p><hr />';
     return $output;      return $output;
 }  }
   

Removed from v.1.301  
changed lines
  Added in v.1.304


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