version 1.30, 2011/06/07 20:18:59
|
version 1.34, 2023/09/28 15:56:48
|
Line 50 sub handler {
|
Line 50 sub handler {
|
|
|
&Apache::loncommon::get_unprocessed_cgi |
&Apache::loncommon::get_unprocessed_cgi |
($ENV{'QUERY_STRING'},['filter','form','unameelement','udomelement', |
($ENV{'QUERY_STRING'},['filter','form','unameelement','udomelement', |
'roles','courseadvonly','clicker']); |
'roles','courseadv','clicker','identelement']); |
# Allowed? |
# Allowed? |
my $allowed; |
my $allowed; |
my $scope = $env{'request.course.id'}; |
if ($env{'request.course.id'}) { |
if (!($allowed = &Apache::lonnet::allowed('srm',$scope))) { |
if (!($allowed = &Apache::lonnet::allowed('srm',$env{'request.course.id'}))) { |
$scope .= '/'.$env{'request.course.sec'}; |
if ($env{'request.course.sec'}) { |
$allowed = &Apache::lonnet::allowed('srm',$scope); |
$allowed = &Apache::lonnet::allowed('srm', |
if ($allowed) { $allowed = 'section'; } |
"$env{'request.course.id'}/$env{'request.course.sec'}"); |
|
if ($allowed) { $allowed = 'section'; } |
|
} |
|
} |
} |
} |
|
|
unless (($env{'form.roles'}) || |
unless (($env{'form.roles'}) || ($allowed)) { |
(($env{'request.course.id'}) && ($allowed))) { |
|
$r->print(&mt('No context.'). |
$r->print(&mt('No context.'). |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
return OK; |
return OK; |
Line 77 sub handler {
|
Line 79 sub handler {
|
<input type="text" name="filter" value="$encoded_filter" /> |
<input type="text" name="filter" value="$encoded_filter" /> |
<input type="submit" name="Change" value="$change" /> |
<input type="submit" name="Change" value="$change" /> |
FILTER |
FILTER |
foreach my $name ('form','unameelement','udomelement','roles') { |
foreach my $name ('form','unameelement','udomelement','roles','courseadv','clicker','identelement') { |
my $value = &HTML::Entities::encode($env{"form.$name"},'<>&"'); |
my $value = &HTML::Entities::encode($env{"form.$name"},'<>&"'); |
$filterbutton .= <<HIDDEN; |
$filterbutton .= <<HIDDEN; |
<input type="hidden" name="$name" value="$value" /> |
<input type="hidden" name="$name" value="$value" /> |
HIDDEN |
HIDDEN |
} |
} |
unless ($env{'form.courseadvonly'}) { |
unless ($env{'form.courseadv'} eq 'only') { |
$filtermsg = '<br />'. |
if ($env{'request.course.id'}) { |
&mt('Showing users with a name starting with [_1]', |
my $crstype = &Apache::loncommon::course_type(); |
$filterbutton).'<br />'; |
my $showrole = &Apache::lonnet::plaintext('st',$crstype); |
|
$filtermsg = &mt("Showing users with role of '[_1]' with name starting: [_2]", |
|
$showrole,$filterbutton); |
|
} else { |
|
$filtermsg = |
|
&mt('Showing users with a name starting with [_1]', |
|
$filterbutton); |
|
} |
} |
} |
if ($filter eq '') { |
if ($filter eq '') { |
$filter = '.' |
$filter = '.' |
Line 97 HIDDEN
|
Line 106 HIDDEN
|
$r->print(<<ENDSCRIPT); |
$r->print(<<ENDSCRIPT); |
<script type="text/javascript"> |
<script type="text/javascript"> |
function gochoose(uname,udom) { |
function gochoose(uname,udom) { |
opener.document.$env{'form.form'}.elements['$env{'form.unameelement'}'].value=uname; |
var form = opener.document.$env{'form.form'}; |
var slct=opener.document.$env{'form.form'}.elements['$env{'form.udomelement'}']; |
form.elements["$env{'form.unameelement'}"].value=uname; |
var i; |
var slct = form.elements['$env{"form.udomelement"}']; |
for (i=0;i<slct.length;i++) { |
if ((slct.tagName === 'INPUT') && ((slct.type === 'text') || (slct.type === 'hidden'))) { |
if (slct.options[i].value==udom) { slct.selectedIndex=i; } |
slct.value=udom; |
|
} else if (slct.tagName === 'SELECT') { |
|
var i; |
|
for (i=0;i<slct.length;i++) { |
|
if (slct.options[i].value==udom) { |
|
slct.selectedIndex=i; |
|
break; |
|
} |
|
} |
|
} |
|
var identname = "$env{'form.identelement'}"; |
|
if ((identname != undefined) && (identname != '') && (identname != 'null')) { |
|
ident = opener.document.getElementsByName("$env{'form.identelement'}"); |
|
if (ident.length > 0) { |
|
var j; |
|
for (j=0; j<ident.length; j++) { |
|
if (ident[j].value == 'uname') { |
|
if (ident[j].checked) { |
|
break; |
|
} else { |
|
ident[j].checked = true; |
|
window.opener.toggleIdentifier(form); |
|
} |
|
} else { |
|
ident[j].checked = false; |
|
} |
|
} |
|
} |
} |
} |
self.close(); |
self.close(); |
} |
} |
</script> |
</script> |
ENDSCRIPT |
ENDSCRIPT |
|
|
$r->print('<form>'); |
$r->print('<form action="">'); |
if ($allowed && (!$env{'form.roles'})) { |
if ($allowed && (!$env{'form.roles'})) { |
|
unless ($env{'form.courseadv'} eq 'none') { |
# -------------------------------------------------------- Get course personnel |
# -------------------------------------------------------- Get course personnel |
$r->print('<h3>'.$env{'course.'.$env{'request.course.id'}.'.description'}. |
$r->print('<h3>'.$env{'course.'.$env{'request.course.id'}.'.description'}. |
'</h3>'); |
'</h3>'); |
my %coursepersonnel= |
my %coursepersonnel= |
&Apache::lonnet::get_course_adv_roles(); |
&Apache::lonnet::get_course_adv_roles(); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table()); |
foreach my $role (sort(keys(%coursepersonnel))) { |
foreach my $role (sort(keys(%coursepersonnel))) { |
foreach my $user (split(/\,/,$coursepersonnel{$role})) { |
foreach my $user (split(/\,/,$coursepersonnel{$role})) { |
my ($puname,$pudom)=split(/\:/,$user); |
my ($puname,$pudom)=split(/\:/,$user); |
$r->print(&Apache::loncommon::start_data_table_row(). |
$r->print(&Apache::loncommon::start_data_table_row(). |
'<td>'. |
'<td>'. |
'<input type="button" value="'.&mt('Select').'" onClick="gochoose('. |
'<input type="button" value="'.&mt('Select').'" onclick="gochoose('. |
"'".$puname."','".$pudom."')".'" /></td><td>'.$role.'</td><td>'. |
"'".$puname."','".$pudom."')".'" /></td><td>'.$role.'</td><td>'. |
&Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($puname,$pudom),$puname,$pudom).'</td>'. |
&Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($puname,$pudom),$puname,$pudom).'</td>'. |
&Apache::loncommon::end_data_table_row()); |
&Apache::loncommon::end_data_table_row()); |
} |
} |
} |
} |
$r->print(&Apache::loncommon::end_data_table().'<p> '); |
$r->print(&Apache::loncommon::end_data_table().'<br /><hr />'); |
|
} |
$r->print($filtermsg); |
|
|
|
$r->print('</p>'); |
if ($filtermsg ne '') { |
|
$r->print('<p>'.$filtermsg.'</p>'); |
|
} |
|
|
$r->rflush(); |
$r->rflush(); |
|
|
unless ($env{'form.courseadvonly'}) { |
unless ($env{'form.courseadv'} eq 'only') { |
|
|
# ------------------------------------------------------------------ Students |
# ------------------------------------------------------------------ Students |
|
|
Line 202 ENDSCRIPT
|
Line 240 ENDSCRIPT
|
} |
} |
$result .=&Apache::loncommon::start_data_table_row(). |
$result .=&Apache::loncommon::start_data_table_row(). |
'<td>'. |
'<td>'. |
'<input type="button" value="'.&mt('Select').'" onClick="gochoose('. |
'<input type="button" value="'.&mt('Select').'" onclick="gochoose('. |
"'".$uname."','".$udom."')".'" /></td>'. |
"'".$uname."','".$udom."')".'" /></td>'. |
'<td><tt>'.$uname.'</tt></td><td> <tt>'.$udom. |
'<td><tt>'.$uname.'</tt></td><td> <tt>'.$udom. |
'</tt></td><td>'. |
'</tt></td><td>'. |
Line 260 ENDSCRIPT
|
Line 298 ENDSCRIPT
|
my ($uname,$udom) = split(':',$user); |
my ($uname,$udom) = split(':',$user); |
$r->print(&Apache::loncommon::start_data_table_row(). |
$r->print(&Apache::loncommon::start_data_table_row(). |
'<td>'. |
'<td>'. |
'<input type="button" value="'.&mt('Select').'" onClick="gochoose('. |
'<input type="button" value="'.&mt('Select').'" onclick="gochoose('. |
"'".$uname."','".$udom."')".'" /></td>'. |
"'".$uname."','".$udom."')".'" /></td>'. |
'<td><tt>'.$uname.'</tt></td>'. |
'<td><tt>'.$uname.'</tt></td>'. |
'<td><tt>'.$udom.'</tt></td><td>'. |
'<td><tt>'.$udom.'</tt></td><td>'. |
Line 276 ENDSCRIPT
|
Line 314 ENDSCRIPT
|
} |
} |
$r->print('</form>'.&Apache::loncommon::end_page()); |
$r->print('</form>'.&Apache::loncommon::end_page()); |
return OK; |
return OK; |
} |
} |
|
|
1; |
1; |
__END__ |
__END__ |