version 1.27, 2005/10/04 18:27:32
|
version 1.29, 2005/11/04 21:25:34
|
Line 485 ENDTWO
|
Line 485 ENDTWO
|
</form> |
</form> |
ENDTWO |
ENDTWO |
} elsif ($action eq "notify") { |
} elsif ($action eq "notify") { |
my @notified = (); |
my @notified = split(/,/,$enrollvar{notifylist}); |
if ($enrollvar{notifylist} =~ m/,/) { |
|
@notified = split/,/,$enrollvar{notifylist}; |
|
} else { |
|
@notified = $enrollvar{notifylist}; |
|
} |
|
my $notifycount = 0; |
my $notifycount = 0; |
foreach (@notified) { |
foreach (@notified) { |
unless ($_ eq '') { $notifycount ++; } |
unless ($_ eq '') { $notifycount ++; } |
} |
} |
my $noteset = ''; |
my $noteset = ''; |
if ($notifycount) { |
if ($notifycount) { |
Line 638 ENDTWO
|
Line 633 ENDTWO
|
</form> |
</form> |
"); |
"); |
} elsif ($action eq "crosslist") { |
} elsif ($action eq "crosslist") { |
my @xlists = (); |
my @xlists; |
if ($enrollvar{crosslistings} =~ m/,/) { |
if ($enrollvar{crosslistings} ne '') { |
@xlists = split/,/,$enrollvar{crosslistings}; |
@xlists = split(/,/,$enrollvar{crosslistings}); |
} elsif ($enrollvar{crosslistings} ne '') { |
|
$xlists[0] = $enrollvar{crosslistings}; |
|
} |
} |
my $cross_str = @xlists; |
my $cross_str = @xlists; |
$r->print(" |
$r->print(" |
Line 723 ENDTWO
|
Line 716 ENDTWO
|
} elsif ($action eq "sections") { |
} elsif ($action eq "sections") { |
my @sections = (); |
my @sections = (); |
@sections = &Apache::lonnet::auto_get_sections($crs,$dom,$enrollvar{coursecode}); |
@sections = &Apache::lonnet::auto_get_sections($crs,$dom,$enrollvar{coursecode}); |
my @storedsections = (); |
my @storedsections = split(/,/,$enrollvar{sectionnums}); |
my @currsections = (); |
my @currsections = (); |
my %sec_id = (); |
my %sec_id = (); |
if ($enrollvar{sectionnums} =~ m/,/) { |
|
@storedsections = split/,/,$enrollvar{sectionnums}; |
|
} else { |
|
$storedsections[0] = $enrollvar{sectionnums}; |
|
} |
|
foreach (@storedsections) { |
foreach (@storedsections) { |
if ($_ =~ m/^(\w+):(\w*)$/) { |
if ($_ =~ m/^(\w+):(\w*)$/) { |
push @currsections, $1; |
push @currsections, $1; |
Line 1488 sub print_notify_response {
|
Line 1476 sub print_notify_response {
|
my %settings = &Apache::lonnet::get('environment',['internal.notifylist','internal.coursecode'],$dom,$crs); |
my %settings = &Apache::lonnet::get('environment',['internal.notifylist','internal.coursecode'],$dom,$crs); |
my $notifylist = $settings{'internal.notifylist'}; |
my $notifylist = $settings{'internal.notifylist'}; |
my $coursecode = $settings{'internal.coursecode'}; |
my $coursecode = $settings{'internal.coursecode'}; |
my @currpeople = (); |
my @currpeople = split(/,/,$notifylist); |
my $notify = 0; |
my $notify = 0; |
my @people = (); |
my @people = (); |
my $peoplestr = ""; |
my $peoplestr = ""; |
my $response = ""; |
my $response = ""; |
my $noprocess = 0; |
my $noprocess = 0; |
|
|
if ($notifylist =~ m/,/) { |
|
@currpeople = split/,/,$notifylist; |
|
} else { |
|
$currpeople[0] = $notifylist; |
|
} |
|
my $currcount = 0; |
my $currcount = 0; |
foreach (@currpeople) { |
foreach (@currpeople) { |
unless ($_ eq '') { $currcount ++; } |
unless ($_ eq '') { $currcount ++; } |
Line 1574 sub print_crosslistings_menu () {
|
Line 1557 sub print_crosslistings_menu () {
|
my $xliststr = ''; |
my $xliststr = ''; |
my $response = ''; |
my $response = ''; |
my $coursecode = $settings{'internal.coursecode'}; |
my $coursecode = $settings{'internal.coursecode'}; |
if ($settings{'internal.crosslistings'} =~ m/,/) { |
if ($settings{'internal.crosslistings'} ne '') { |
@currxlists = split/,/,$settings{'internal.crosslistings'}; |
@currxlists = split(/,/,$settings{'internal.crosslistings'}); |
} elsif ($settings{'internal.crosslistings'} ne '') { |
|
$currxlists[0] = $settings{'internal.crosslistings'}; |
|
} |
} |
|
|
if (@currxlists > 0) { |
if (@currxlists > 0) { |
Line 1600 sub print_crosslistings_menu () {
|
Line 1581 sub print_crosslistings_menu () {
|
} |
} |
} |
} |
|
|
if ($crosscount > 1) { |
$xliststr = join(",",@xlists); |
$xliststr = join(",",@xlists); |
|
} else { |
|
$xliststr = $xlists[0]; |
|
} |
|
my %cenv = ('internal.crosslistings' => $xliststr); |
my %cenv = ('internal.crosslistings' => $xliststr); |
my $reply = &Apache::lonnet::put('environment',\%cenv,$dom,$crs); |
my $reply = &Apache::lonnet::put('environment',\%cenv,$dom,$crs); |
if ($reply !~ /^ok$/) { |
if ($reply !~ /^ok$/) { |
Line 1682 sub print_crosslistings_response () {
|
Line 1660 sub print_crosslistings_response () {
|
my $warning = ''; |
my $warning = ''; |
my $warn_prefix = ''; |
my $warn_prefix = ''; |
|
|
if ($xliststr =~ m/,/) { |
if ($xliststr ne '') { |
@allxlists = split/,/,$xliststr; |
@allxlists = split(/,/,$xliststr); |
} else { |
|
unless ($xliststr eq '') { $allxlists[0] = $xliststr; } |
|
} |
} |
|
|
if ( exists($env{'form.numcross'}) ) { |
if ( exists($env{'form.numcross'}) ) { |
Line 1717 sub print_crosslistings_response () {
|
Line 1693 sub print_crosslistings_response () {
|
|
|
if (@xlists > 0 ) { |
if (@xlists > 0 ) { |
unless ($xliststr eq '') { $xliststr .= ","; } |
unless ($xliststr eq '') { $xliststr .= ","; } |
if (@xlists > 1) { |
$xliststr .= join(",",@xlists); |
$xliststr .= join(",",@xlists); |
|
} else { |
|
$xliststr .= $xlists[0]; |
|
} |
|
my %cenv = ('internal.crosslistings' => $xliststr); |
my %cenv = ('internal.crosslistings' => $xliststr); |
my $reply = &Apache::lonnet::put('environment',\%cenv,$dom,$crs); |
my $reply = &Apache::lonnet::put('environment',\%cenv,$dom,$crs); |
if ($reply !~ /^ok$/) { |
if ($reply !~ /^ok$/) { |
Line 1736 sub print_crosslistings_response () {
|
Line 1709 sub print_crosslistings_response () {
|
} |
} |
} else { |
} else { |
if ($xliststr =~ m/:/) { |
if ($xliststr =~ m/:/) { |
my @oldxlists = (); |
my @oldxlists = (split/,/,$xliststr); |
if ($xliststr =~ m/,/) { |
|
@oldxlists = split/,/,$xliststr; |
|
} else { |
|
$oldxlists[0] = $xliststr; |
|
} |
|
$response .= "Although no new crosslistings were added, the courses listed below continue to be crosslisted with your LON-CAPA course.<br/><ul>\n"; |
$response .= "Although no new crosslistings were added, the courses listed below continue to be crosslisted with your LON-CAPA course.<br/><ul>\n"; |
foreach (@oldxlists) { |
foreach (@oldxlists) { |
my ($xlist,$gp) = split/:/,$_; |
my ($xlist,$gp) = split/:/,$_; |
Line 1796 sub print_sections_menu () {
|
Line 1764 sub print_sections_menu () {
|
my $warn_prefix = ""; |
my $warn_prefix = ""; |
my $coursecode = $settings{'internal.coursecode'}; |
my $coursecode = $settings{'internal.coursecode'}; |
my $owner = $settings{'internal.courseowner'}; |
my $owner = $settings{'internal.courseowner'}; |
if ($settings{'internal.sectionnums'} =~ m/,/) { |
if ($settings{'internal.sectionnums'} ne '') { |
@currsections = split/,/,$settings{'internal.sectionnums'}; |
@currsections = split(/,/,$settings{'internal.sectionnums'}); |
} elsif ($settings{'internal.sectionnums'} ne '') { |
|
$currsections[0] = $settings{'internal.sectionnums'}; |
|
} |
} |
|
|
if ( exists($env{'form.secshow'}) ) { |
if ( exists($env{'form.secshow'}) ) { |
Line 1866 sub print_sections_menu () {
|
Line 1832 sub print_sections_menu () {
|
} |
} |
} |
} |
|
|
if ($seccount > 1) { |
$secstr = join(",",@sections); |
$secstr = join(",",@sections); |
|
} else { |
|
$secstr = $sections[0]; |
|
} |
|
my %cenv = ('internal.sectionnums' => $secstr); |
my %cenv = ('internal.sectionnums' => $secstr); |
my $reply = &Apache::lonnet::put('environment',\%cenv,$dom,$crs); |
my $reply = &Apache::lonnet::put('environment',\%cenv,$dom,$crs); |
if ($reply !~ /^ok$/) { |
if ($reply !~ /^ok$/) { |
Line 1980 sub print_sections_response () {
|
Line 1943 sub print_sections_response () {
|
my $putreply = ''; |
my $putreply = ''; |
my $warning = ''; |
my $warning = ''; |
my $warn_prefix = ''; |
my $warn_prefix = ''; |
if ($secstr =~ m/,/) { |
if ($secstr ne '') { |
@allsections = split/,/,$secstr; |
@allsections = split(/,/,$secstr); |
} else { |
|
unless ($secstr eq '') { $allsections[0] = $secstr; } |
|
} |
} |
|
|
if ( exists($env{'form.numsec'}) ) { |
if ( exists($env{'form.numsec'}) ) { |
Line 2016 sub print_sections_response () {
|
Line 1977 sub print_sections_response () {
|
|
|
if (@sections > 0 ) { |
if (@sections > 0 ) { |
unless ($secstr eq '') { $secstr .= ","; } |
unless ($secstr eq '') { $secstr .= ","; } |
if (@sections > 1) { |
$secstr .= join(",",@sections); |
$secstr .= join(",",@sections); |
|
} else { |
|
$secstr .= $sections[0]; |
|
} |
|
my %cenv = ('internal.sectionnums' => $secstr); |
my %cenv = ('internal.sectionnums' => $secstr); |
$putreply = &Apache::lonnet::put('environment',\%cenv,$dom,$crs); |
$putreply = &Apache::lonnet::put('environment',\%cenv,$dom,$crs); |
if ($putreply !~ /^ok$/) { |
if ($putreply !~ /^ok$/) { |
Line 2137 sub print_update_result () {
|
Line 2094 sub print_update_result () {
|
my @currsections = (); |
my @currsections = (); |
my @currxlists = (); |
my @currxlists = (); |
|
|
if ($settings{'internal.sectionnums'} =~ m/,/) { |
if ($settings{'internal.sectionnums'} ne '') { |
@currsections = split/,/,$settings{'internal.sectionnums'}; |
@currsections = split(/,/,$settings{'internal.sectionnums'}); |
} elsif ($settings{'internal.sectionnums'} ne '') { |
|
$currsections[0] = $settings{'internal.sectionnums'}; |
|
} |
} |
|
|
if ($settings{'internal.crosslistings'} =~ m/,/) { |
if ($settings{'internal.crosslistings'} ne '') { |
@currxlists = split/,/,$settings{'internal.crosslistings'}; |
@currxlists = split(/,/,$settings{'internal.crosslistings'}); |
} elsif ($settings{'internal.crosslistings'} ne '') { |
|
$currxlists[0] = $settings{'internal.crosslistings'}; |
|
} |
} |
|
|
if (@currxlists > 0) { |
if (@currxlists > 0) { |