version 1.9, 2007/12/05 17:53:13
|
version 1.10, 2007/12/05 19:11:37
|
Line 1358 sub print_userlist {
|
Line 1358 sub print_userlist {
|
&gather_userinfo($context,$format,\%userlist,$indexhash, |
&gather_userinfo($context,$format,\%userlist,$indexhash, |
\%userinfo,\%allusers); |
\%userinfo,\%allusers); |
} else { |
} else { |
|
$r->print('<input type="hidden" name="phase" value="'. |
|
$env{'form.phase'}.'" /></form>'); |
return; |
return; |
} |
} |
} |
} |
Line 1381 sub print_userlist {
|
Line 1383 sub print_userlist {
|
# Print out the available choices |
# Print out the available choices |
my $usercount; |
my $usercount; |
if ($env{'form.action'} eq 'modifystudent') { |
if ($env{'form.action'} eq 'modifystudent') { |
($usercount) = &show_users_list($r,$context,'view','modify', |
($usercount) = &show_users_list($r,$context,'view',$permission, |
$env{'form.Status'},\%userlist,$keylist); |
$env{'form.Status'},\%userlist,$keylist); |
} else { |
} else { |
($usercount) = &show_users_list($r,$context,$env{'form.output'}, |
($usercount) = &show_users_list($r,$context,$env{'form.output'}, |
'aboutme',$env{'form.Status'},\%userlist,$keylist); |
$permission,$env{'form.Status'},\%userlist,$keylist); |
} |
} |
if (!$usercount) { |
if (!$usercount) { |
$r->print('<br />'.&mt('There are no users matching the search criteria.')); |
$r->print('<br />'.&mt('There are no users matching the search criteria.')); |
} |
} |
} |
} |
$r->print('</form>'); |
$r->print('<input type="hidden" name="phase" value="'. |
|
$env{'form.phase'}.'" /></form>'); |
} |
} |
|
|
sub list_submit_button { |
sub list_submit_button { |
Line 1696 sub process_date_info {
|
Line 1699 sub process_date_info {
|
} |
} |
|
|
sub show_users_list { |
sub show_users_list { |
my ($r,$context,$mode,$linkto,$statusmode,$userlist,$keylist)=@_; |
my ($r,$context,$mode,$permission,$statusmode,$userlist,$keylist)=@_; |
# |
# |
# Variables for excel output |
# Variables for excel output |
my ($excel_workbook, $excel_sheet, $excel_filename,$row,$format); |
my ($excel_workbook, $excel_sheet, $excel_filename,$row,$format); |
Line 1749 END
|
Line 1752 END
|
} |
} |
unless ($mode eq 'autoenroll') { |
unless ($mode eq 'autoenroll') { |
$r->print(<<END); |
$r->print(<<END); |
|
|
|
<script type="text/javascript" language="Javascript"> |
|
|
|
function username_display_launch(username,domain) { |
|
var target; |
|
for (var i=0; i<document.studentform.usernamelink.length; i++) { |
|
if (document.studentform.usernamelink[i].checked) { |
|
target = document.studentform.usernamelink[i].value; |
|
} |
|
} |
|
if (target == 'modify') { |
|
document.studentform.srchterm.value=username; |
|
document.studentform.srchdomain.value=domain; |
|
document.studentform.phase.value='get_user_info'; |
|
document.studentform.action.value = 'singleuser'; |
|
document.studentform.submit(); |
|
} |
|
else { |
|
document.location.href = '/adm/'+domain+'/'+username+'/aboutme'; |
|
} |
|
} |
|
</script> |
|
|
<input type="hidden" name="state" value="$env{'form.state'}" /> |
<input type="hidden" name="state" value="$env{'form.state'}" /> |
END |
END |
} |
} |
Line 1772 END
|
Line 1798 END
|
'clicker' => "clicker id", |
'clicker' => "clicker id", |
'photo' => "photo", |
'photo' => "photo", |
'extent' => "extent", |
'extent' => "extent", |
|
'link' => "Behavior of username links", |
|
'aboutme' => "Display a user's personal page", |
|
'modify' => "Modify a user's information", |
); |
); |
if ($context eq 'domain' && $env{'form.roletype'} eq 'course') { |
if ($context eq 'domain' && $env{'form.roletype'} eq 'course') { |
$lt{'extent'} = &mt('Course(s): description, section(s), status'); |
$lt{'extent'} = &mt('Course(s): description, section(s), status'); |
Line 1813 END
|
Line 1842 END
|
my $output; |
my $output; |
if ($mode eq 'html' || $mode eq 'view') { |
if ($mode eq 'html' || $mode eq 'view') { |
$r->print(<<END); |
$r->print(<<END); |
<input type="hidden" name="sname" value="" /> |
<input type="hidden" name="srchby" value="uname" /> |
<input type="hidden" name="sdom" value="" /> |
<input type="hidden" name="srchin" value="dom" /> |
|
<input type="hidden" name="srchtype" value="exact" /> |
|
<input type="hidden" name="srchterm" value="" /> |
|
<input type="hidden" name="srchdomain" value="" /> |
END |
END |
if ($linkto eq 'aboutme') { |
if ($mode ne 'autoenroll') { |
$output = &mt("Select a user name to view the user's personal page."); |
$output = '<p>'; |
} elsif ($linkto eq 'modify') { |
my @linkdests = ('aboutme'); |
$output = &mt("Select a user name to modify the user's information"); |
if ($permission->{'cusr'}) { |
|
push (@linkdests,'modify'); |
|
$output .= '<span class="LC_nobreak">'.$lt{'link'}.': '; |
|
my $usernamelink = $env{'form.usernamelink'}; |
|
if ($usernamelink eq '') { |
|
$usernamelink = 'aboutme'; |
|
} |
|
foreach my $item (@linkdests) { |
|
my $checkedstr = ''; |
|
if ($item eq $usernamelink) { |
|
$checkedstr = ' checked="checked" '; |
|
} |
|
$output .= '<label><input type="radio" name="usernamelink" value="'.$item.'"'.$checkedstr.'> '.$lt{$item}.'</label> '; |
|
} |
|
$output .= '</span><br />'; |
|
} else { |
|
$output .= &mt("Click on a username to view the user's personal page.").'<br />'; |
|
} |
} |
} |
$output .= "\n<p>\n". |
$output .= "\n<p>\n". |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
Line 2000 END
|
Line 2049 END
|
if ($mode eq 'view' || $mode eq 'html' || $mode eq 'autoenroll') { |
if ($mode eq 'view' || $mode eq 'html' || $mode eq 'autoenroll') { |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print("<td>$rowcount</td>\n"); |
$r->print("<td>$rowcount</td>\n"); |
if ($linkto eq 'aboutme') { |
|
$in{'username'} = |
|
&Apache::loncommon::aboutmewrapper($in{'username'}, |
|
$in{'username'}, |
|
$in{'domain'}); |
|
} elsif ($linkto eq 'modify') { |
|
$in{'username'} = '<a href="'. |
|
"javascript:document.studentform.sname.value='". |
|
$in{'username'}. |
|
"';document.studentform.sdom.value='".$in{'domain'}. |
|
"';document.studentform.state.value='selected". |
|
"';document.studentform.submit();".'">'. |
|
$in{'username'}."</a>\n"; |
|
} |
|
foreach my $item (@cols) { |
foreach my $item (@cols) { |
$r->print('<td>'.$in{$item}.'</td>'."\n"); |
if ($item eq 'username') { |
|
$r->print('<td>'.&print_username_link($permission,\%in).'</td>'); |
|
} else { |
|
$r->print('<td>'.$in{$item}.'</td>'."\n"); |
|
} |
} |
} |
if ($context eq 'course') { |
if ($context eq 'course') { |
if ($env{'form.showrole'} eq 'st' || $env{'form.showrole'} eq 'Any') { |
if ($env{'form.showrole'} eq 'st' || $env{'form.showrole'} eq 'Any') { |
Line 2096 END
|
Line 2135 END
|
} |
} |
} |
} |
|
|
|
sub print_username_link { |
|
my ($permission,$in) = @_; |
|
my $output; |
|
if (!$permission->{'cusr'}) { |
|
$output = &Apache::loncommon::aboutmewrapper($in->{'username'}, |
|
$in->{'username'}, |
|
$in->{'domain'}); |
|
} else { |
|
$output = '<a href="javascript:username_display_launch('. |
|
"'$in->{'username'}','$in->{'domain'}'".')" />'. |
|
$in->{'username'}.'</a>'; |
|
} |
|
return $output; |
|
} |
|
|
sub role_type_names { |
sub role_type_names { |
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
'domain' => 'Domain Roles', |
'domain' => 'Domain Roles', |