version 1.104, 2021/04/30 18:19:41
|
version 1.107, 2025/02/24 13:40:33
|
Line 357 function check_selected() {
|
Line 357 function check_selected() {
|
} |
} |
ENDJS |
ENDJS |
} |
} |
$catjs = '<script type="text/javascript">'."\n".$catjs."\n".'</script>'; |
my $js = '<script type="text/javascript">'."\n". |
&cat_header($r,$codedom,$catjs,\%add_entries,$catlinks,undef,$cattype); |
'// <![CDATA['."\n". |
|
"$catjs\n". |
|
'// ]]>'."\n". |
|
'</script>'; |
|
&cat_header($r,$codedom,$js,\%add_entries,$catlinks,undef,$cattype); |
if ($env{'form.currcat_0'} ne '') { |
if ($env{'form.currcat_0'} ne '') { |
$r->print('<form name="'.$formname. |
$r->print('<form name="'.$formname. |
'" method="post" action="/adm/coursecatalog">'. |
'" method="post" action="/adm/coursecatalog">'. |
Line 1511 sub construct_data_table {
|
Line 1515 sub construct_data_table {
|
} |
} |
my $count = 1; |
my $count = 1; |
my $totalsec = 0; |
my $totalsec = 0; |
|
my %clutteredxlists; |
|
foreach my $course (keys(%courseinfo)) { |
|
if (ref($courseinfo{$course}) eq 'HASH') { |
|
if ($courseinfo{$course}{'xlist'} ne '') { |
|
my $crskey = $courseinfo{$course}{'cnum'}.':'.$courseinfo{$course}{'code'}; |
|
my @xlists = split(/,\s/,$courseinfo{$course}{'xlist'}); |
|
$clutteredxlists{$crskey} = \@xlists; |
|
} |
|
} |
|
} |
|
if (keys(%clutteredxlists)) { |
|
my %reformattedxlists = &Apache::lonnet::auto_instsec_reformat($domain,'declutter',\%clutteredxlists); |
|
foreach my $crskey (keys(%reformattedxlists)) { |
|
if (ref($reformattedxlists{$crskey}) eq 'ARRAY') { |
|
my $course = $domain.'_'.(split(/:/,$crskey))[0]; |
|
$courseinfo{$course}{'xlist'} = join(', ',@{$reformattedxlists{$crskey}}); |
|
} |
|
} |
|
} |
foreach my $item (@sorted_courses) { |
foreach my $item (@sorted_courses) { |
foreach my $course (@{$Sortby{$item}}) { |
foreach my $course (@{$Sortby{$item}}) { |
$output.=&Apache::loncommon::start_data_table_row(); |
$output.=&Apache::loncommon::start_data_table_row(); |
Line 1872 sub courseinfo_row {
|
Line 1895 sub courseinfo_row {
|
@cats = split('&',$categories); |
@cats = split('&',$categories); |
} |
} |
if ((ref($trails) eq 'ARRAY') && (ref($allitems) eq 'HASH')) { |
if ((ref($trails) eq 'ARRAY') && (ref($allitems) eq 'HASH')) { |
my @categories = map { $trails->[$allitems->{$_}]; } @cats; |
my @categories; |
|
foreach my $cat (@cats) { |
|
next if ($cat eq ''); |
|
if (($allitems->{$cat} ne '') && ($trails->[$allitems->{$cat}] ne '')) { |
|
push(@categories,$trails->[$allitems->{$cat}]); |
|
} |
|
} |
$categorylist = join('<br />',@categories); |
$categorylist = join('<br />',@categories); |
} |
} |
if ($categorylist eq '') { |
if ($categorylist eq '') { |
Line 1971 sub identify_sections {
|
Line 2000 sub identify_sections {
|
sub get_valid_classes { |
sub get_valid_classes { |
my ($seclist,$xlist_items,$crscode,$owners,$cdom,$cnum) = @_; |
my ($seclist,$xlist_items,$crscode,$owners,$cdom,$cnum) = @_; |
my $response; |
my $response; |
my (@sections,@xlists,%possclasses,%okclasses,%validations); |
my (@sections,@format_sections,@xlists,%possclasses,%okclasses,%validations); |
@{$validations{'sections'}} = (); |
@{$validations{'sections'}} = (); |
@{$validations{'xlists'}} = (); |
@{$validations{'xlists'}} = (); |
my $totalitems = 0; |
my $totalitems = 0; |
if ($seclist) { |
if ($seclist) { |
@sections = split(/,\s+/,$seclist); |
@sections = split(/,\s+/,$seclist); |
map { $possclasses{$crscode.$_} = 1; } @sections; |
my $crskey = $cnum.':'.$crscode; |
|
my %formattedsec = &Apache::lonnet::auto_instsec_reformat($cdom,'clutter', |
|
{$crskey => \@sections}); |
|
if (ref($formattedsec{$crskey}) eq 'ARRAY') { |
|
@format_sections = @{$formattedsec{$crskey}}; |
|
map { $possclasses{$crscode.$_} = 1; } @format_sections; |
|
} |
} |
} |
if ($xlist_items) { |
if ($xlist_items) { |
@xlists = split(/,\s+/,$xlist_items); |
@xlists = split(/,\s+/,$xlist_items); |
Line 1986 sub get_valid_classes {
|
Line 2021 sub get_valid_classes {
|
my %okclasses = &Apache::lonnet::auto_validate_instclasses($cdom,$cnum,$owners, |
my %okclasses = &Apache::lonnet::auto_validate_instclasses($cdom,$cnum,$owners, |
\%possclasses); |
\%possclasses); |
if (keys(%okclasses)) { |
if (keys(%okclasses)) { |
foreach my $sec (@sections) { |
for (my $i=0; $i<@sections; $i++) { |
if ($okclasses{$crscode.$sec}) { |
if ($okclasses{$crscode.$format_sections[$i]}) { |
if (!grep(/^\Q$sec$\E/,@{$validations{'sections'}})) { |
my $sec = $sections[$i]; |
|
if (!grep(/^\Q$sec\E$/,@{$validations{'sections'}})) { |
push(@{$validations{'sections'}},$sec); |
push(@{$validations{'sections'}},$sec); |
$totalitems ++; |
$totalitems ++; |
} |
} |
Line 2009 sub get_valid_classes {
|
Line 2045 sub get_valid_classes {
|
join(', ',@{$validations{'sections'}}).'<br />'; |
join(', ',@{$validations{'sections'}}).'<br />'; |
} |
} |
if (@{$validations{'xlists'}}) { |
if (@{$validations{'xlists'}}) { |
|
my $crskey = $cnum.':'.$crscode; |
|
my %reformattedxlists = |
|
&Apache::lonnet::auto_instsec_reformat($cdom,'declutter', |
|
{$crskey => $validations{'xlists'}}); |
|
if (ref($reformattedxlists{$crskey}) eq 'ARRAY') { |
|
$validations{'xlists'} = $reformattedxlists{$crskey}; |
|
} |
$response .= &mt('Courses:').' '. |
$response .= &mt('Courses:').' '. |
join(', ',@{$validations{'xlists'}}); |
join(', ',@{$validations{'xlists'}}); |
} |
} |