version 1.37, 2008/01/01 17:24:59
|
version 1.41, 2008/01/02 09:01:02
|
Line 450 END
|
Line 450 END
|
foundatype=1; |
foundatype=1; |
if (current.argfield == null || current.argfield == '') { |
if (current.argfield == null || current.argfield == '') { |
var alertmsg = ''; |
var alertmsg = ''; |
switch (current.value) { |
switch (current.radiovalue) { |
case 'krb': |
case 'krb': |
alertmsg = '$alert{'krb'}'; |
alertmsg = '$alert{'krb'}'; |
break; |
break; |
Line 1329 sub print_userlist {
|
Line 1329 sub print_userlist {
|
$showroles = undef; |
$showroles = undef; |
} |
} |
my $withsec = 1; |
my $withsec = 1; |
|
my $hidepriv = 1; |
my %advrolehash = &Apache::lonnet::get_my_roles($cnum,$cdom,undef, |
my %advrolehash = &Apache::lonnet::get_my_roles($cnum,$cdom,undef, |
\@statuses,$showroles,undef,$withsec); |
\@statuses,$showroles,undef,$withsec,$hidepriv); |
&gather_userinfo($context,$format,\%userlist,$indexhash,\%userinfo, |
&gather_userinfo($context,$format,\%userlist,$indexhash,\%userinfo, |
\%advrolehash,$permission); |
\%advrolehash,$permission); |
} else { |
} else { |
Line 1381 sub print_userlist {
|
Line 1382 sub print_userlist {
|
} elsif ($env{'form.roletype'} eq 'course') { |
} elsif ($env{'form.roletype'} eq 'course') { |
if ($env{'form.coursepick'}) { |
if ($env{'form.coursepick'}) { |
my %courses = &process_coursepick(); |
my %courses = &process_coursepick(); |
my %allusers; |
my %allusers; |
|
my $hidepriv = 1; |
foreach my $cid (keys(%courses)) { |
foreach my $cid (keys(%courses)) { |
my ($cnum,$cdom,$cdesc) = &get_course_identity($cid); |
my ($cnum,$cdom,$cdesc) = &get_course_identity($cid); |
next if ($cnum eq '' || $cdom eq ''); |
next if ($cnum eq '' || $cdom eq ''); |
Line 1399 sub print_userlist {
|
Line 1401 sub print_userlist {
|
foreach my $type (@statuses) { |
foreach my $type (@statuses) { |
$access{$type} = $type; |
$access{$type} = $type; |
} |
} |
&Apache::loncommon::get_course_users($cdom,$cnum,\%access,\@roles,\@sections,\%users,\%userdata,\%statushash); |
&Apache::loncommon::get_course_users($cdom,$cnum,\%access,\@roles,\@sections,\%users,\%userdata,\%statushash,$hidepriv); |
foreach my $user (keys(%userdata)) { |
foreach my $user (keys(%userdata)) { |
next if (ref($userinfo{$user}) eq 'HASH'); |
next if (ref($userinfo{$user}) eq 'HASH'); |
foreach my $item ('fullname','id') { |
foreach my $item ('fullname','id') { |
Line 1905 END
|
Line 1907 END
|
my $alert = &mt("You must select at least one user by checking a user's 'Select' checkbox"); |
my $alert = &mt("You must select at least one user by checking a user's 'Select' checkbox"); |
my $singconfirm = &mt(' for a single user?'); |
my $singconfirm = &mt(' for a single user?'); |
my $multconfirm = &mt(' for multiple users?'); |
my $multconfirm = &mt(' for multiple users?'); |
my $date_sec_selector = &date_section_javascript($context,$setting,$statusmode); |
my $date_sec_selector = &date_section_javascript($context,$setting,$statusmode); |
|
my %lt = &Apache::lonlocal::texthash( |
|
acwi => 'Access will be set to start immediately', |
|
asyo => 'as you did not select an end date in the pop-up window', |
|
accw => 'Access will be set to continue indefinitely', |
|
asyd => 'as you did not select an end date in the pop-up window', |
|
sewi => "Sections will be switched to 'No section'", |
|
ayes => "as you either selected the 'No section' option", |
|
oryo => 'or you did not select a section in the pop-up window', |
|
arol => 'A role with no section will be added', |
|
swbs => 'Sections will be switched to:', |
|
rwba => 'Roles will be added for section(s):', |
|
); |
$r->print(<<END); |
$r->print(<<END); |
|
|
<script type="text/javascript" language="Javascript"> |
<script type="text/javascript" language="Javascript"> |
Line 1931 function verify_action (field) {
|
Line 1945 function verify_action (field) {
|
} |
} |
else { |
else { |
var message = document.studentform.bulkaction[document.studentform.bulkaction.selectedIndex].text; |
var message = document.studentform.bulkaction[document.studentform.bulkaction.selectedIndex].text; |
|
var choice = document.studentform.bulkaction[document.studentform.bulkaction.selectedIndex].value; |
if (numchecked == 1) { |
if (numchecked == 1) { |
message += singconf; |
message += singconf; |
} |
} |
else { |
else { |
message += multconf; |
message += multconf; |
} |
} |
|
if (choice == 'chgdates' || choice == 'reenable' || choice == 'activate') { |
|
var datemsg = ''; |
|
if ((document.studentform.startdate_month.value == '') && |
|
(document.studentform.startdate_day.value == '') && |
|
(document.studentform.startdate_year.value == '')) { |
|
datemsg = "\\n$lt{'acwi'},\\n$lt{'asyo'}.\\n"; |
|
} |
|
if ((document.studentform.enddate_month.value == '') && |
|
(document.studentform.enddate_day.value == '') && |
|
(document.studentform.enddate_year.value == '')) { |
|
datemsg += "\\n$lt{'accw'},\\n$lt{'asyd'}.\\n"; |
|
} |
|
if (datemsg != '') { |
|
message += "\\n"+datemsg; |
|
} |
|
} |
|
if (choice == 'chgsec') { |
|
var rolefilter = document.studentform.showrole.options[document.studentform.showrole.selectedIndex].value; |
|
var retained = document.studentform.retainsec.value; |
|
var secshow = document.studentform.newsecs.value; |
|
if (secshow == '') { |
|
if (rolefilter == 'st' || retained == 0 || retained == "") { |
|
message += "\\n\\n$lt{'sewi'},\\n$lt{'ayes'},\\n$lt{'oryo'}.\\n"; |
|
} else { |
|
message += "\\n\\n$lt{'arol'}\\n$lt{'ayes'},\\n$lt{'oryo'}.\\n"; |
|
} |
|
} else { |
|
if (rolefilter == 'st' || retained == 0 || retained == "") { |
|
message += "\\n\\n$lt{'swbs'} "+secshow+".\\n"; |
|
} else { |
|
message += "\\n\\n$lt{'rwba'} "+secshow+".\\n"; |
|
} |
|
} |
|
} |
if (confirm(message)) { |
if (confirm(message)) { |
document.studentform.phase.value = 'bulkchange'; |
document.studentform.phase.value = 'bulkchange'; |
document.studentform.submit(); |
document.studentform.submit(); |
Line 1987 END
|
Line 2036 END
|
'clicker' => "clicker id", |
'clicker' => "clicker id", |
'photo' => "photo", |
'photo' => "photo", |
'extent' => "extent", |
'extent' => "extent", |
|
'go' => "go", |
'pr' => "Proceed", |
'pr' => "Proceed", |
'ca' => "check all", |
'ca' => "check all", |
'ua' => "uncheck all", |
'ua' => "uncheck all", |
Line 2069 END
|
Line 2119 END
|
$output .= &mt("Click on a username to view the user's personal page.").'<br />'; |
$output .= &mt("Click on a username to view the user's personal page.").'<br />'; |
} |
} |
if ($actionselect) { |
if ($actionselect) { |
$output .= <<"END"; |
$output .= <<"END"; |
$lt{'ac'}: $actionselect <input type="button" value="$lt{'pr'}" onclick="javascript:verify_action(document.studentform.actionlist)" /></p> |
$lt{'ac'}: $actionselect <input type="button" value="$lt{'go'}" onclick="javascript:opendatebrowser(this.form,'studentform','go')" /></p> |
<p><input type="button" value="$lt{'ca'}" onclick="javascript:checkAll(document.studentform.actionlist)" /> |
<p><input type="button" value="$lt{'ca'}" onclick="javascript:checkAll(document.studentform.actionlist)" /> |
<input type="button" value="$lt{'ua'}" onclick="javascript:uncheckAll(document.studentform.actionlist)" /> |
<input type="button" value="$lt{'ua'}" onclick="javascript:uncheckAll(document.studentform.actionlist)" /><br /><br /><input type="button" value="$lt{'pr'}" onclick="javascript:verify_action(document.studentform.actionlist)" /> |
END |
END |
my @allroles; |
my @allroles; |
if ($env{'form.showrole'} eq 'Any') { |
if ($env{'form.showrole'} eq 'Any') { |
Line 2576 sub select_actions {
|
Line 2626 sub select_actions {
|
} |
} |
} |
} |
if ($options) { |
if ($options) { |
$output = '<select name="bulkaction" onchange="javascript:opendatebrowser(this.form,'."'studentform'".')" />'."\n". |
$output = '<select name="bulkaction" onchange="javascript:opendatebrowser(this.form,'."'studentform','change'".')" />'."\n". |
'<option value="" selected="selected">'. |
'<option value="" selected="selected">'. |
&mt('Please select').'</option>'."\n".$options."\n".'</select>'; |
&mt('Please select').'</option>'."\n".$options."\n".'</select>'; |
if ($choices{'dates'}) { |
if ($choices{'dates'}) { |
Line 2613 sub date_section_javascript {
|
Line 2663 sub date_section_javascript {
|
} else { |
} else { |
$title = &mt('Date selector'); |
$title = &mt('Date selector'); |
} |
} |
|
my %nopopup = &Apache::lonlocal::texthash ( |
|
revoke => "Check the boxes for any users for whom roles are to be revoked, and click 'Proceed'", |
|
delete => "Check the boxes for any users for whom roles are to be deleted, and click 'Proceed'", |
|
none => "Choose an action to take for selected users", |
|
); |
my $output = ' |
my $output = ' |
<script type="text/javascript"> |
<script type="text/javascript"> |
var stdeditbrowser;'."\n"; |
var stdeditbrowser;'."\n"; |
$output .= <<"ENDONE"; |
$output .= <<"ENDONE"; |
function opendatebrowser(callingform,formname) { |
function opendatebrowser(callingform,formname,calledby) { |
var bulkaction = callingform.bulkaction.options[callingform.bulkaction.selectedIndex].value; |
var bulkaction = callingform.bulkaction.options[callingform.bulkaction.selectedIndex].value; |
if (bulkaction == 'revoke' || bulkaction == 'delete' || bulkaction == '') { |
if (bulkaction == 'revoke' || bulkaction == 'delete' || bulkaction == '') { |
|
if (calledby == 'go') { |
|
if (bulkaction == 'revoke') { |
|
alert("$nopopup{'revoke'}"); |
|
} |
|
if (bulkaction == 'delete') { |
|
alert("$nopopup{'delete'}"); |
|
} |
|
if (bulkaction == '') { |
|
alert("$nopopup{'none'}"); |
|
} |
|
} |
return; |
return; |
} |
} |
var url = '/adm/createuser?'; |
var url = '/adm/createuser?'; |
Line 2663 function saveselections(formname) {
|
Line 2729 function saveselections(formname) {
|
END |
END |
if ($env{'form.bulkaction'} eq 'chgsec') { |
if ($env{'form.bulkaction'} eq 'chgsec') { |
$output .= <<"END"; |
$output .= <<"END"; |
opener.document.$callingform.retainsec.value = formname.retainsec.value; |
if (formname.retainsec.length > 1) { |
|
for (var i=0; i<formname.retainsec.length; i++) { |
|
if (formname.retainsec[i].checked == true) { |
|
opener.document.$callingform.retainsec.value = formname.retainsec[i].value; |
|
} |
|
} |
|
} else { |
|
opener.document.$callingform.retainsec.value = formname.retainsec.value; |
|
} |
setSections(formname); |
setSections(formname); |
if (seccheck == 'ok') { |
if (seccheck == 'ok') { |
opener.document.$callingform.newsecs.value = formname.sections.value; |
opener.document.$callingform.newsecs.value = formname.sections.value; |
Line 3937 sub update_user_list {
|
Line 4011 sub update_user_list {
|
if (@newsecs == 0) { |
if (@newsecs == 0) { |
$result = &mt('No change in section assignment (none)'); |
$result = &mt('No change in section assignment (none)'); |
$nochg = 1; |
$nochg = 1; |
} |
} else { |
|
$revresult = |
|
&Apache::lonnet::revokerole($udom,$uname, |
|
$scope,$role); |
|
} |
} else { |
} else { |
if (@newsecs > 0) { |
if (@newsecs > 0) { |
if (grep(/^\Q$sec\E$/,@newsecs)) { |
if (grep(/^\Q$sec\E$/,@newsecs)) { |