version 1.401, 2014/05/31 15:55:18
|
version 1.408, 2016/02/17 19:15:48
|
Line 2244 sub personal_data_display {
|
Line 2244 sub personal_data_display {
|
'<input type="text" name="uname" size="25" value="" autocomplete="off" />'; |
'<input type="text" name="uname" size="25" value="" autocomplete="off" />'; |
$rowcount ++; |
$rowcount ++; |
$output .= &Apache::lonhtmlcommon::row_closure(1); |
$output .= &Apache::lonhtmlcommon::row_closure(1); |
my $upassone = '<input type="password" name="upass'.$now.'" size="10" autocomplete="off" />'; |
my $upassone = '<input type="password" name="upass'.$now.'" size="20" autocomplete="off" />'; |
my $upasstwo = '<input type="password" name="upasscheck'.$now.'" size="10" autocomplete="off" />'; |
my $upasstwo = '<input type="password" name="upasscheck'.$now.'" size="20" autocomplete="off" />'; |
$output .= &Apache::lonhtmlcommon::row_title(&mt('Password').'<b>*</b>', |
$output .= &Apache::lonhtmlcommon::row_title(&mt('Password').'<b>*</b>', |
'LC_pick_box_title', |
'LC_pick_box_title', |
'LC_oddrow_value')."\n". |
'LC_oddrow_value')."\n". |
Line 3044 sub update_user_data {
|
Line 3044 sub update_user_data {
|
my %newenvhash; |
my %newenvhash; |
foreach my $key (keys(%changed)) { |
foreach my $key (keys(%changed)) { |
if (($key eq 'official') || ($key eq 'unofficial') |
if (($key eq 'official') || ($key eq 'unofficial') |
|| ($key eq 'community')) { |
|| ($key eq 'community') || ($key eq 'textbook')) { |
$newenvhash{'environment.requestcourses.'.$key} = |
$newenvhash{'environment.requestcourses.'.$key} = |
$changeHash{'requestcourses.'.$key}; |
$changeHash{'requestcourses.'.$key}; |
if ($changeHash{'requestcourses.'.$key}) { |
if ($changeHash{'requestcourses.'.$key}) { |
Line 3110 sub update_user_data {
|
Line 3110 sub update_user_data {
|
\%newsettingstext); |
\%newsettingstext); |
if ($env{'form.cid'} ne $userenv{'id'}) { |
if ($env{'form.cid'} ne $userenv{'id'}) { |
&Apache::lonnet::idput($env{'form.ccdomain'}, |
&Apache::lonnet::idput($env{'form.ccdomain'}, |
($env{'form.ccuname'} => $env{'form.cid'})); |
{$env{'form.ccuname'} => $env{'form.cid'}},$uhome,'ids'); |
if (($recurseid) && |
if (($recurseid) && |
(&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) { |
(&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) { |
my $idresult = |
my $idresult = |
Line 3625 sub update_roles {
|
Line 3625 sub update_roles {
|
my @rolechanges; |
my @rolechanges; |
my %disallowed; |
my %disallowed; |
$r->print('<h3>'.&mt('Modifying Roles').'</h3>'); |
$r->print('<h3>'.&mt('Modifying Roles').'</h3>'); |
foreach my $key (keys (%env)) { |
foreach my $key (keys(%env)) { |
next if (! $env{$key}); |
next if (! $env{$key}); |
next if ($key eq 'form.action'); |
next if ($key eq 'form.action'); |
# Revoke roles |
# Revoke roles |
Line 3807 sub update_roles {
|
Line 3807 sub update_roles {
|
} else { |
} else { |
my %curr_groups = |
my %curr_groups = |
&Apache::longroup::coursegroups($one,$two); |
&Apache::longroup::coursegroups($one,$two); |
foreach my $sec (sort {$a cmp $b} keys %sections) { |
foreach my $sec (sort {$a cmp $b} keys(%sections)) { |
if (($sec eq 'none') || ($sec eq 'all') || |
if (($sec eq 'none') || ($sec eq 'all') || |
exists($curr_groups{$sec})) { |
exists($curr_groups{$sec})) { |
$disallowed{$sec} = $url; |
$disallowed{$sec} = $url; |
Line 3853 sub update_roles {
|
Line 3853 sub update_roles {
|
my %curr_groups = |
my %curr_groups = |
&Apache::longroup::coursegroups($one,$two); |
&Apache::longroup::coursegroups($one,$two); |
my $emptysec = 0; |
my $emptysec = 0; |
foreach my $sec (sort {$a cmp $b} keys %sections) { |
foreach my $sec (sort {$a cmp $b} keys(%sections)) { |
$sec =~ s/\W//g; |
$sec =~ s/\W//g; |
if ($sec ne '') { |
if ($sec ne '') { |
if (($sec eq 'none') || ($sec eq 'all') || |
if (($sec eq 'none') || ($sec eq 'all') || |
Line 3893 sub update_roles {
|
Line 3893 sub update_roles {
|
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$two,$start,$end,$one,undef,'',$context)); |
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$two,$start,$end,$one,undef,'',$context)); |
} else { |
} else { |
my $emptysec = 0; |
my $emptysec = 0; |
foreach my $sec (sort {$a cmp $b} keys %sections) { |
foreach my $sec (sort {$a cmp $b} keys(%sections)) { |
if ($sec ne '') { |
if ($sec ne '') { |
my $securl = $url.'/'.$sec; |
my $securl = $url.'/'.$sec; |
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$securl,$two,$start,$end,$one,undef,$sec,$context)); |
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$securl,$two,$start,$end,$one,undef,$sec,$context)); |
Line 5544 sub print_selfenroll_menu {
|
Line 5544 sub print_selfenroll_menu {
|
butn => 'but no user types have been checked.', |
butn => 'but no user types have been checked.', |
wilf => "Please uncheck 'activate' or check at least one type.", |
wilf => "Please uncheck 'activate' or check at least one type.", |
); |
); |
|
&js_escape(\%alerts); |
my $selfenroll_js = <<"ENDSCRIPT"; |
my $selfenroll_js = <<"ENDSCRIPT"; |
function update_types(caller,num) { |
function update_types(caller,num) { |
var delidx = getIndexByName('selfenroll_delete'); |
var delidx = getIndexByName('selfenroll_delete'); |
Line 5745 ENDSCRIPT
|
Line 5746 ENDSCRIPT
|
$cathash = $domconfig{'coursecategories'}{'cats'}; |
$cathash = $domconfig{'coursecategories'}{'cats'}; |
$cattype{'auth'} = $domconfig{'coursecategories'}{'auth'}; |
$cattype{'auth'} = $domconfig{'coursecategories'}{'auth'}; |
$cattype{'unauth'} = $domconfig{'coursecategories'}{'unauth'}; |
$cattype{'unauth'} = $domconfig{'coursecategories'}{'unauth'}; |
|
if ($cattype{'auth'} eq '') { |
|
$cattype{'auth'} = 'std'; |
|
} |
|
if ($cattype{'unauth'} eq '') { |
|
$cattype{'unauth'} = 'std'; |
|
} |
} else { |
} else { |
$cathash = {}; |
$cathash = {}; |
$cattype{'auth'} = 'std'; |
$cattype{'auth'} = 'std'; |
Line 7310 sub course_level_table {
|
Line 7317 sub course_level_table {
|
((($role eq 'cc') || ($role eq 'co')) && ($isowner))) { |
((($role eq 'cc') || ($role eq 'co')) && ($isowner))) { |
$table .= &course_level_row($protectedcourse,$role,$area,$domain, |
$table .= &course_level_row($protectedcourse,$role,$area,$domain, |
$plrole,\%sections_count,\%lt, |
$plrole,\%sections_count,\%lt, |
$defaultcredits,$crstype); |
$showcredits,$defaultcredits,$crstype); |
} elsif ($env{'request.course.sec'} ne '') { |
} elsif ($env{'request.course.sec'} ne '') { |
if (&Apache::lonnet::allowed('c'.$role,$thiscourse.'/'. |
if (&Apache::lonnet::allowed('c'.$role,$thiscourse.'/'. |
$env{'request.course.sec'})) { |
$env{'request.course.sec'})) { |
$table .= &course_level_row($protectedcourse,$role,$area,$domain, |
$table .= &course_level_row($protectedcourse,$role,$area,$domain, |
$plrole,\%sections_count,\%lt, |
$plrole,\%sections_count,\%lt, |
$defaultcredits,$crstype); |
$showcredits,$defaultcredits,$crstype); |
} |
} |
} |
} |
} |
} |
Line 7325 sub course_level_table {
|
Line 7332 sub course_level_table {
|
next if ($crstype eq 'Community' && $customroles{$cust} =~ /bre\&S/); |
next if ($crstype eq 'Community' && $customroles{$cust} =~ /bre\&S/); |
my $role = 'cr_cr_'.$env{'user.domain'}.'_'.$env{'user.name'}.'_'.$cust; |
my $role = 'cr_cr_'.$env{'user.domain'}.'_'.$env{'user.name'}.'_'.$cust; |
$table .= &course_level_row($protectedcourse,$role,$area,$domain, |
$table .= &course_level_row($protectedcourse,$role,$area,$domain, |
$cust,\%sections_count,\%lt); |
$cust,\%sections_count,\%lt, |
|
$showcredits,$defaultcredits,$crstype); |
} |
} |
} |
} |
} |
} |
Line 7339 sub course_level_table {
|
Line 7347 sub course_level_table {
|
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row(). |
&Apache::loncommon::start_data_table_header_row(). |
'<th>'.$lt{'act'}.'</th><th>'.$lt{'rol'}.'</th>'."\n". |
'<th>'.$lt{'act'}.'</th><th>'.$lt{'rol'}.'</th>'."\n". |
'<th>'.$lt{'ext'}.'</th><th>'.$lt{'crd'}.'</th>'."\n". |
'<th>'.$lt{'ext'}.'</th><th>'."\n"; |
|
if ($showcredits) { |
|
$result .= $lt{'crd'}.'</th>'; |
|
} |
|
$result .= |
'<th>'.$lt{'grs'}.'</th><th>'.$lt{'sta'}.'</th>'."\n". |
'<th>'.$lt{'grs'}.'</th><th>'.$lt{'sta'}.'</th>'."\n". |
'<th>'.$lt{'end'}.'</th>'. |
'<th>'.$lt{'end'}.'</th>'. |
&Apache::loncommon::end_data_table_header_row(). |
&Apache::loncommon::end_data_table_header_row(). |
Line 7350 $table.
|
Line 7362 $table.
|
|
|
sub course_level_row { |
sub course_level_row { |
my ($protectedcourse,$role,$area,$domain,$plrole,$sections_count, |
my ($protectedcourse,$role,$area,$domain,$plrole,$sections_count, |
$lt,$defaultcredits,$crstype) = @_; |
$lt,$showcredits,$defaultcredits,$crstype) = @_; |
my $creditem; |
my $creditem; |
my $row = &Apache::loncommon::start_data_table_row(). |
my $row = &Apache::loncommon::start_data_table_row(). |
' <td><input type="checkbox" name="act_'. |
' <td><input type="checkbox" name="act_'. |
$protectedcourse.'_'.$role.'" /></td>'."\n". |
$protectedcourse.'_'.$role.'" /></td>'."\n". |
' <td>'.$plrole.'</td>'."\n". |
' <td>'.$plrole.'</td>'."\n". |
' <td>'.$area.'<br />Domain: '.$domain.'</td>'."\n"; |
' <td>'.$area.'<br />Domain: '.$domain.'</td>'."\n"; |
if (($role eq 'st') && ($crstype eq 'Course')) { |
if (($showcredits) && ($role eq 'st') && ($crstype eq 'Course')) { |
$row .= |
$row .= |
'<td><input type="text" name="credits_'.$protectedcourse.'_'. |
'<td><input type="text" name="credits_'.$protectedcourse.'_'. |
$role.'" size="3" value="'.$defaultcredits.'" /></td>'; |
$role.'" size="3" value="'.$defaultcredits.'" /></td>'; |
Line 7446 sub course_level_dc {
|
Line 7458 sub course_level_dc {
|
my $plrole=&Apache::lonnet::plaintext($role); |
my $plrole=&Apache::lonnet::plaintext($role); |
$otheritems .= ' <option value="'.$role.'">'.$plrole.'</option>'; |
$otheritems .= ' <option value="'.$role.'">'.$plrole.'</option>'; |
} |
} |
if ( keys %customroles > 0) { |
if ( keys(%customroles) > 0) { |
foreach my $cust (sort keys %customroles) { |
foreach my $cust (sort(keys(%customroles))) { |
my $custrole='cr_cr_'.$env{'user.domain'}. |
my $custrole='cr_cr_'.$env{'user.domain'}. |
'_'.$env{'user.name'}.'_'.$cust; |
'_'.$env{'user.name'}.'_'.$cust; |
$otheritems .= ' <option value="'.$custrole.'">'.$cust.'</option>'; |
$otheritems .= ' <option value="'.$custrole.'">'.$cust.'</option>'; |