version 1.197, 2007/12/01 03:49:08
|
version 1.202, 2007/12/05 21:23:14
|
Line 627 sub print_user_modification_page {
|
Line 627 sub print_user_modification_page {
|
} |
} |
ENDSCRIPT |
ENDSCRIPT |
} else { |
} else { |
$nondc_setsection_code = <<"ENDSECCODE"; |
$nondc_setsection_code = |
function setSections() { |
&Apache::lonuserutils::setsections_javascript('cu',$groupslist); |
var re1 = /^currsec_/; |
|
var groups = new Array($groupslist); |
|
for (var i=0;i<document.cu.elements.length;i++) { |
|
var str = document.cu.elements[i].name; |
|
var checkcurr = str.match(re1); |
|
if (checkcurr != null) { |
|
if (document.cu.elements[i-1].checked == true) { |
|
var match = str.split('_'); |
|
var role = match[3]; |
|
if (role == 'cc') { |
|
alert("Section designations do not apply to Course Coordinator roles.\\nA course coordinator role will be added with access to all sections."); |
|
} |
|
else { |
|
var sections = ''; |
|
var numsec = 0; |
|
var sections; |
|
for (var j=0; j<document.cu.elements[i].length; j++) { |
|
if (document.cu.elements[i].options[j].selected == true ) { |
|
if (document.cu.elements[i].options[j].value != "") { |
|
if (numsec == 0) { |
|
if (document.cu.elements[i].options[j].value != "") { |
|
sections = document.cu.elements[i].options[j].value; |
|
numsec ++; |
|
} |
|
} |
|
else { |
|
sections = sections + "," + document.cu.elements[i].options[j].value |
|
numsec ++; |
|
} |
|
} |
|
} |
|
} |
|
if (numsec > 0) { |
|
if (document.cu.elements[i+1].value != "" && document.cu.elements[i+1].value != null) { |
|
sections = sections + "," + document.cu.elements[i+1].value; |
|
} |
|
} |
|
else { |
|
sections = document.cu.elements[i+1].value; |
|
} |
|
var newsecs = document.cu.elements[i+1].value; |
|
var numsplit; |
|
if (newsecs != null && newsecs != "") { |
|
numsplit = newsecs.split(/,/g); |
|
numsec = numsec + numsplit.length; |
|
} |
|
|
|
if ((role == 'st') && (numsec > 1)) { |
|
alert("In each course, each user may only have one student role at a time. You had selected "+numsec+" sections.\\nPlease modify your selections so they include no more than one section.") |
|
return; |
|
} |
|
else if (numsplit != null) { |
|
for (var j=0; j<numsplit.length; j++) { |
|
if ((numsplit[j] == 'all') || |
|
(numsplit[j] == 'none')) { |
|
alert("'"+numsplit[j]+"' may not be used as the name for a section, as it is a reserved word.\\nPlease choose a different section name."); |
|
return; |
|
} |
|
for (var k=0; k<groups.length; k++) { |
|
if (numsplit[j] == groups[k]) { |
|
alert("'"+numsplit[j]+"' may not be used as a section name, as it is the name of a course group.\\nSection names and group names must be distinct. Please choose a different section name."); |
|
return; |
|
} |
|
} |
|
} |
|
} |
|
document.cu.elements[i+2].value = sections; |
|
} |
|
} |
|
} |
|
} |
|
document.cu.submit(); |
|
} |
|
ENDSECCODE |
|
} |
} |
my $js = &user_modification_js($pjump_def,$dc_setcourse_code, |
my $js = &user_modification_js($pjump_def,$dc_setcourse_code, |
$nondc_setsection_code,$groupslist); |
$nondc_setsection_code,$groupslist); |
Line 792 $lt{'hs'}: $home_server_pick
|
Line 718 $lt{'hs'}: $home_server_pick
|
} else { |
} else { |
$r->print($home_server_pick); |
$r->print($home_server_pick); |
} |
} |
if ($context eq 'domain') { |
|
$r->print(&Apache::lonuserutils::forceid_change()); |
|
} |
|
$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 862 $forminfo
|
Line 785 $forminfo
|
ENDCHANGEUSER |
ENDCHANGEUSER |
$r->print('<div class="LC_left_float">'. |
$r->print('<div class="LC_left_float">'. |
&personal_data_display($ccuname,$ccdomain,$newuser, |
&personal_data_display($ccuname,$ccdomain,$newuser, |
%inst_results). |
%inst_results)); |
'</div>'); |
if ($context eq 'domain') { |
|
$r->print(&Apache::lonuserutils::forceid_change()); |
|
} |
|
$r->print('</div>'); |
my $user_auth_text = |
my $user_auth_text = |
&user_authentication($ccuname,$ccdomain,$krbdefdom,\%abv_auth); |
&user_authentication($ccuname,$ccdomain,$krbdefdom,\%abv_auth); |
my $user_quota_text; |
my $user_quota_text; |
Line 1214 ENDNOPORTPRIV
|
Line 1140 ENDNOPORTPRIV
|
} |
} |
} else { |
} else { |
$r->print(&course_level_table(%inccourses)); |
$r->print(&course_level_table(%inccourses)); |
$r->print('<br /><input type="button" value="'.&mt('Modify User').'" onClick="setSections()" />'."\n"); |
$r->print('<br /><input type="button" value="'.&mt('Modify User').'" onClick="setSections(this.form)" />'."\n"); |
} |
} |
$r->print(&Apache::lonhtmlcommon::echo_form_input(['phase','userrole','ccdomain','prevphase','currstate','ccuname','ccdomain'])); |
$r->print(&Apache::lonhtmlcommon::echo_form_input(['phase','userrole','ccdomain','prevphase','currstate','ccuname','ccdomain'])); |
$r->print('<input type="hidden" name="currstate" value="" />'); |
$r->print('<input type="hidden" name="currstate" value="" />'); |
Line 1272 ENDBADAUTH
|
Line 1198 ENDBADAUTH
|
} |
} |
} else { # Authentication type is valid |
} else { # Authentication type is valid |
&initialize_authen_forms($ccdomain,$currentauth); |
&initialize_authen_forms($ccdomain,$currentauth); |
|
my $authformnop_row; |
|
if (&Apache::lonnet::allowed('mau',$ccdomain)) { |
|
$authformnop_row = &Apache::loncommon::start_data_table_row(); |
|
} |
my ($authformcurrent,$authform_other,$can_modify) = |
my ($authformcurrent,$authform_other,$can_modify) = |
&modify_login_block($ccdomain,$currentauth); |
&modify_login_block($ccdomain,$currentauth); |
if (&Apache::lonnet::allowed('mau',$ccdomain)) { |
if (&Apache::lonnet::allowed('mau',$ccdomain)) { |
Line 1287 ENDBADAUTH
|
Line 1217 ENDBADAUTH
|
'</script>'."\n". |
'</script>'."\n". |
'<h3>'.$lt{'ld'}.'</h3>'. |
'<h3>'.$lt{'ld'}.'</h3>'. |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_row(). |
$authformnop_row. |
'<td>'.$authformnop; |
'<td>'.$authformnop; |
if ($can_modify) { |
if ($can_modify) { |
$outcome .= '</td>'."\n". |
$outcome .= '</td>'."\n". |
Line 1296 ENDBADAUTH
|
Line 1226 ENDBADAUTH
|
'<td>'.$authformcurrent.'</td>'. |
'<td>'.$authformcurrent.'</td>'. |
&Apache::loncommon::end_data_table_row()."\n"; |
&Apache::loncommon::end_data_table_row()."\n"; |
} else { |
} else { |
$outcome .= ' ('.$authformcurrent.')</td>'; |
$outcome .= ' ('.$authformcurrent.')</td>'. |
|
&Apache::loncommon::end_data_table_row()."\n"; |
} |
} |
if ($authform_other ne '') { |
if ($authform_other ne '') { |
$outcome .= $authform_other; |
$outcome .= $authform_other; |
Line 1769 sub update_user_data {
|
Line 1700 sub update_user_data {
|
'prvs' => "Previous", |
'prvs' => "Previous", |
'chto' => "Changed To" |
'chto' => "Changed To" |
); |
); |
|
$r->print('<h4>'.$lt{'uic'}.'</h4>'. |
|
&Apache::loncommon::start_data_table(). |
|
&Apache::loncommon::start_data_table_header_row()); |
$r->print(<<"END"); |
$r->print(<<"END"); |
<table border="2"> |
<th> </th> |
<caption>$lt{'uic'}</caption> |
|
<tr><th> </th> |
|
<th>$lt{'frst'}</th> |
<th>$lt{'frst'}</th> |
<th>$lt{'mddl'}</th> |
<th>$lt{'mddl'}</th> |
<th>$lt{'lst'}</th> |
<th>$lt{'lst'}</th> |
<th>$lt{'gen'}</th> |
<th>$lt{'gen'}</th> |
<th>$lt{'id'}</th> |
<th>$lt{'id'}</th> |
<th>$lt{'mail'}</th> |
<th>$lt{'mail'}</th> |
<th>$lt{'disk'}</th></tr> |
<th>$lt{'disk'}</th> |
<tr><td>$lt{'prvs'}</td> |
END |
|
$r->print(&Apache::loncommon::end_data_table_header_row(). |
|
&Apache::loncommon::start_data_table_row()); |
|
$r->print(<<"END"); |
|
<td><b>$lt{'prvs'}</b></td> |
<td>$userenv{'firstname'} </td> |
<td>$userenv{'firstname'} </td> |
<td>$userenv{'middlename'} </td> |
<td>$userenv{'middlename'} </td> |
<td>$userenv{'lastname'} </td> |
<td>$userenv{'lastname'} </td> |
Line 1788 sub update_user_data {
|
Line 1724 sub update_user_data {
|
<td>$userenv{'id'}</td> |
<td>$userenv{'id'}</td> |
<td>$userenv{'permanentemail'} </td> |
<td>$userenv{'permanentemail'} </td> |
<td>$oldportfolioquota Mb</td> |
<td>$oldportfolioquota Mb</td> |
</tr> |
END |
<tr><td>$lt{'chto'}</td> |
$r->print(&Apache::loncommon::end_data_table_row(). |
|
&Apache::loncommon::start_data_table_row()); |
|
$r->print(<<"END"); |
|
<td><b>$lt{'chto'}</b></td> |
<td>$env{'form.cfirstname'} </td> |
<td>$env{'form.cfirstname'} </td> |
<td>$env{'form.cmiddlename'} </td> |
<td>$env{'form.cmiddlename'} </td> |
<td>$env{'form.clastname'} </td> |
<td>$env{'form.clastname'} </td> |
<td>$env{'form.cgeneration'} </td> |
<td>$env{'form.cgeneration'} </td> |
<td>$env{'form.cid'} </td> |
<td>$env{'form.cid'} </td> |
<td>$env{'form.cpermanentemail'} </td> |
<td>$env{'form.cpermanentemail'} </td> |
<td>$newportfolioquota Mb $defquotatext </td></tr> |
<td>$newportfolioquota Mb $defquotatext </td> |
</table> |
|
END |
END |
|
$r->print(&Apache::loncommon::end_data_table_row(). |
|
&Apache::loncommon::end_data_table()); |
if (($forceid) && ($recurseid) && (!$disallowed_id) && |
if (($forceid) && ($recurseid) && (!$disallowed_id) && |
(&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) { |
(&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) { |
my %userupdate = ( |
my %userupdate = ( |
Line 1876 END
|
Line 1816 END
|
$r->print(&mt('Revoking [_1] in [_2]: [_3]', |
$r->print(&mt('Revoking [_1] in [_2]: [_3]', |
$role,$scope,'<b>'.$result.'</b>').'<br />'); |
$role,$scope,'<b>'.$result.'</b>').'<br />'); |
if ($role eq 'st') { |
if ($role eq 'st') { |
my $result = &classlist_drop($scope,$env{'form.ccuname'}, |
my $result = |
$env{'form.ccdomain'},$now); |
&Apache::lonuserutils::classlist_drop($scope, |
|
$env{'form.ccuname'},$env{'form.ccdomain'}, |
|
$now); |
$r->print($result); |
$r->print($result); |
} |
} |
} |
} |
Line 1901 END
|
Line 1843 END
|
$r->print(&mt('Deleting [_1] in [_2]: [_3]',$role,$scope, |
$r->print(&mt('Deleting [_1] in [_2]: [_3]',$role,$scope, |
'<b>'.$result.'</b>').'<br />'); |
'<b>'.$result.'</b>').'<br />'); |
if ($role eq 'st') { |
if ($role eq 'st') { |
my $result = &classlist_drop($scope,$env{'form.ccuname'}, |
my $result = |
$env{'form.ccdomain'},$now); |
&Apache::lonuserutils::classlist_drop($scope, |
|
$env{'form.ccuname'},$env{'form.ccdomain'}, |
|
$now); |
$r->print($result); |
$r->print($result); |
} |
} |
} |
} |
Line 2101 sub update_result_form {
|
Line 2045 sub update_result_form {
|
return $outcome; |
return $outcome; |
} |
} |
|
|
sub classlist_drop { |
|
my ($scope,$uname,$udom,$now) = @_; |
|
my ($cdom,$cnum) = ($scope=~m{^/($match_domain)/($match_courseid)}); |
|
my $cid=$cdom.'_'.$cnum; |
|
my $user = $uname.':'.$udom; |
|
if (!&active_student_roles($cnum,$cdom,$uname,$udom)) { |
|
my $result = |
|
&Apache::lonnet::cput('classlist', |
|
{ $user => $now }, |
|
$env{'course.'.$cid.'.domain'}, |
|
$env{'course.'.$cid.'.num'}); |
|
return &mt('Drop from classlist: [_1]', |
|
'<b>'.$result.'</b>').'<br />'; |
|
} |
|
} |
|
|
|
sub active_student_roles { |
|
my ($cnum,$cdom,$uname,$udom) = @_; |
|
my %roles = |
|
&Apache::lonnet::get_my_roles($uname,$udom,'userroles', |
|
['future','active'],['st']); |
|
return exists($roles{"$cnum:$cdom:st"}); |
|
} |
|
|
|
sub quota_admin { |
sub quota_admin { |
my ($setquota,$changeHash) = @_; |
my ($setquota,$changeHash) = @_; |
my $quotachanged; |
my $quotachanged; |
Line 2473 sub handler {
|
Line 2393 sub handler {
|
$context = 'domain'; |
$context = 'domain'; |
} |
} |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['action','state']); |
['action','state','callingform','roletype','showrole','bulkaction']); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::add_breadcrumb |
if ($env{'form.action'} ne 'dateselect') { |
({href=>"/adm/createuser", |
&Apache::lonhtmlcommon::add_breadcrumb |
text=>"User Management"}); |
({href=>"/adm/createuser", |
|
text=>"User Management"}); |
|
} |
my ($permission,$allowed) = &get_permission($context); |
my ($permission,$allowed) = &get_permission($context); |
if (!$allowed) { |
if (!$allowed) { |
$env{'user.error.msg'}= |
$env{'user.error.msg'}= |
Line 2527 sub handler {
|
Line 2449 sub handler {
|
if (! exists($env{'form.state'})) { |
if (! exists($env{'form.state'})) { |
&Apache::lonuserutils::print_expire_menu($r,$context); |
&Apache::lonuserutils::print_expire_menu($r,$context); |
} elsif ($env{'form.state'} eq 'done') { |
} elsif ($env{'form.state'} eq 'done') { |
&Apache::lonuserutils::expire_user_list($r); |
&Apache::lonuserutils::expire_user_list($r,$context); |
} else { |
} else { |
&Apache::lonuserutils::print_expire_menu($r,$context); |
&Apache::lonuserutils::print_expire_menu($r,$context); |
} |
} |
Line 2592 sub handler {
|
Line 2514 sub handler {
|
&custom_role_editor($r); |
&custom_role_editor($r); |
} |
} |
} elsif ($env{'form.action'} eq 'listusers' && $permission->{'view'}) { |
} elsif ($env{'form.action'} eq 'listusers' && $permission->{'view'}) { |
my ($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles); |
if ($env{'form.phase'} eq 'bulkchange') { |
my $formname = 'studentform'; |
&Apache::lonhtmlcommon::add_breadcrumb |
if ($context eq 'domain' && $env{'form.roletype'} eq 'course') { |
({href=>'backPage(document.studentform)', |
($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles) = |
text=>"List Users"}); |
&Apache::lonuserutils::courses_selector($env{'request.role.domain'}, |
my $setting = $env{'form.roletype'}; |
$formname); |
my $choice = $env{'form.bulkaction'}; |
my $js = &add_script($jscript).$cb_jscript; |
$r->print(&header()); |
my $loadcode = |
$r->print(&Apache::lonhtmlcommon::breadcrumbs("List Users", |
&Apache::lonuserutils::course_selector_loadcode($formname); |
'User_Management_List')); |
if ($loadcode ne '') { |
if ($permission->{'cusr'}) { |
$r->print(&header($js,{'onload' => $loadcode,})); |
&Apache::lonuserutils::update_user_list($r,$context,$setting,$choice); |
|
} |
|
} else { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>'/adm/createuser?action=listusers', |
|
text=>"List Users"}); |
|
my ($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles); |
|
my $formname = 'studentform'; |
|
if ($context eq 'domain' && $env{'form.roletype'} eq 'course') { |
|
($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles) = |
|
&Apache::lonuserutils::courses_selector($env{'request.role.domain'}, |
|
$formname); |
|
$jscript .= &verify_user_display(); |
|
my $js = &add_script($jscript).$cb_jscript; |
|
my $loadcode = |
|
&Apache::lonuserutils::course_selector_loadcode($formname); |
|
if ($loadcode ne '') { |
|
$r->print(&header($js,{'onload' => $loadcode,})); |
|
} else { |
|
$r->print(&header($js)); |
|
} |
} else { |
} else { |
$r->print(&header($js)); |
$r->print(&header(&add_script(&verify_user_display()))); |
} |
} |
} else { |
$r->print(&Apache::lonhtmlcommon::breadcrumbs("List Users", |
$r->print(&header()); |
'User_Management_List')); |
|
&Apache::lonuserutils::print_userlist($r,undef,$permission,$context, |
|
$formname,$totcodes,$codetitles,$idlist,$idlist_titles); |
|
$r->print(&Apache::loncommon::end_page()); |
} |
} |
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>'/adm/createuser?action=listusers', |
|
text=>"List Users"}); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs("List Users", |
|
'User_Management_List')); |
|
&Apache::lonuserutils::print_userlist($r,undef,$permission,$context, |
|
$formname,$totcodes,$codetitles,$idlist,$idlist_titles); |
|
$r->print(&Apache::loncommon::end_page()); |
|
} elsif ($env{'form.action'} eq 'expire' && $permission->{'cusr'}) { |
} elsif ($env{'form.action'} eq 'expire' && $permission->{'cusr'}) { |
$r->print(&header()); |
$r->print(&header()); |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
Line 2627 sub handler {
|
Line 2564 sub handler {
|
if (! exists($env{'form.state'})) { |
if (! exists($env{'form.state'})) { |
&Apache::lonuserutils::print_expire_menu($r,$context); |
&Apache::lonuserutils::print_expire_menu($r,$context); |
} elsif ($env{'form.state'} eq 'done') { |
} elsif ($env{'form.state'} eq 'done') { |
&Apache::lonuserutiles::expire_user_list($r); |
&Apache::lonuserutiles::expire_user_list($r,$context); |
} else { |
} else { |
&print_expire_menu($r,$context); |
&print_expire_menu($r,$context); |
} |
} |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
|
} elsif ($env{'form.action'} eq 'dateselect') { |
|
if ($permission->{'cusr'}) { |
|
$r->print(&header(undef,undef,{'no_nav_bar' => 1}). |
|
&Apache::lonuserutils::date_section_selector($context). |
|
&Apache::loncommon::end_page()); |
|
} else { |
|
$r->print(&header(). |
|
'<span class="LC_error">'.&mt('You do not have permission to modify dates or sections for users').'</span>'. |
|
&Apache::loncommon::end_page()); |
|
} |
} else { |
} else { |
$r->print(&header()); |
$r->print(&header()); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management')); $r->print(&print_main_menu($permission)); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management')); |
|
$r->print(&print_main_menu($permission)); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
return OK; |
return OK; |
} |
} |
|
|
sub header { |
sub header { |
my ($jscript,$loaditems) = @_; |
my ($jscript,$loaditems,$args) = @_; |
my $start_page; |
my $start_page; |
if (ref($loaditems) eq 'HASH') { |
if (ref($loaditems) eq 'HASH') { |
$start_page=&Apache::loncommon::start_page('User Management',$jscript,{'add_entries' => $loaditems,}); |
$start_page=&Apache::loncommon::start_page('User Management',$jscript,{'add_entries' => $loaditems}); |
} else { |
} else { |
$start_page=&Apache::loncommon::start_page('User Management',$jscript); |
$start_page=&Apache::loncommon::start_page('User Management',$jscript,$args); |
} |
} |
return $start_page; |
return $start_page; |
} |
} |
Line 2656 sub add_script {
|
Line 2604 sub add_script {
|
return '<script type="text/javascript">'."\n".$js."\n".'</script>'; |
return '<script type="text/javascript">'."\n".$js."\n".'</script>'; |
} |
} |
|
|
|
sub verify_user_display { |
|
my $output = <<"END"; |
|
|
|
function display_update() { |
|
document.studentform.action.value = 'listusers'; |
|
document.studentform.phase.value = 'display'; |
|
document.studentform.submit(); |
|
} |
|
|
|
END |
|
return $output; |
|
|
|
} |
|
|
############################################################### |
############################################################### |
############################################################### |
############################################################### |
# Menu Phase One |
# Menu Phase One |
Line 3230 sub course_level_table {
|
Line 3192 sub course_level_table {
|
<td>'.$area.'<br />Domain: '.$domain.'</td>'."\n"; |
<td>'.$area.'<br />Domain: '.$domain.'</td>'."\n"; |
if ($role ne 'cc') { |
if ($role ne 'cc') { |
if (%sections_count) { |
if (%sections_count) { |
my $currsec = &course_sections(\%sections_count,$protectedcourse.'_'.$role); |
my $currsec = |
|
&Apache::lonuserutils::course_sections(\%sections_count, |
|
$protectedcourse.'_'.$role); |
$table .= |
$table .= |
'<td><table class="LC_createuser">'. |
'<td><table class="LC_createuser">'. |
'<tr class="LC_section_row"> |
'<tr class="LC_section_row"> |
Line 3270 ENDTIMEENTRY
|
Line 3234 ENDTIMEENTRY
|
<td>'.$plrole.'</td> |
<td>'.$plrole.'</td> |
<td>'.$area.'</td>'."\n"; |
<td>'.$area.'</td>'."\n"; |
if (%sections_count) { |
if (%sections_count) { |
my $currsec = &course_sections(\%sections_count,$customrole); |
my $currsec = |
|
&Apache::lonuserutils::course_sections(\%sections_count, |
|
$customrole); |
$table.= |
$table.= |
'<td><table class="LC_createuser">'. |
'<td><table class="LC_createuser">'. |
'<tr class="LC_section_row"><td valign="top">'. |
'<tr class="LC_section_row"><td valign="top">'. |
Line 3314 $table.
|
Line 3280 $table.
|
return $result; |
return $result; |
} |
} |
|
|
sub course_sections { |
|
my ($sections_count,$role) = @_; |
|
my $output = ''; |
|
my @sections = (sort {$a <=> $b} keys %{$sections_count}); |
|
if (scalar(@sections) == 1) { |
|
$output = '<select name="currsec_'.$role.'" >'."\n". |
|
' <option value="">Select</option>'."\n". |
|
' <option value="">No section</option>'."\n". |
|
' <option value="'.$sections[0].'" >'.$sections[0].'</option>'."\n"; |
|
} else { |
|
$output = '<select name="currsec_'.$role.'" '; |
|
my $multiple = 4; |
|
if (scalar(@sections) < 4) { $multiple = scalar(@sections); } |
|
$output .= 'multiple="multiple" size="'.$multiple.'">'."\n"; |
|
foreach my $sec (@sections) { |
|
$output .= '<option value="'.$sec.'">'.$sec."</option>\n"; |
|
} |
|
} |
|
$output .= '</select>'; |
|
return $output; |
|
} |
|
|
|
sub course_level_dc { |
sub course_level_dc { |
my ($dcdom) = @_; |
my ($dcdom) = @_; |
my %customroles=&Apache::lonuserutils::my_custom_roles(); |
my %customroles=&Apache::lonuserutils::my_custom_roles(); |