1 && $multiple) {
+ $r->print('
+
+
');
+ }
+
+ if (%courses) {
+ $r->print(&Apache::loncommon::start_data_table());
+ $r->print(&Apache::loncommon::start_data_table_header_row());
+ $r->print(''.&mt('Select').' | '
+ .''.&mt('Course Description').' | '
+ .''.&mt('Domain').' | '
+ .''.&mt('Course Code').' | '
+ .''.&mt('Owner/Co-owner(s)').' | '
+ .''.&mt('Type').' | '
+ );
+ $r->print(&Apache::loncommon::end_data_table_header_row());
+ }
+ foreach my $description (sort { lc($a) cmp lc($b) } (keys(%by_descrip))) {
+ foreach my $course (@{$by_descrip{$description}}) {
+ $r->print(&Apache::loncommon::start_data_table_row());
+ my $cleandesc=&HTML::Entities::encode($description,'<>&"');
+ $cleandesc=~s/'/\\'/g;
+ my ($cdom,$cnum)=split(/\_/,$course);
+ my ($descr,$instcode,$ttype,@owners);
+ if (ref($courses{$course}) eq 'HASH') {
+ $descr = $courses{$course}{'description'};
+ $instcode = $courses{$course}{'inst_code'};
+ $ttype = $courses{$course}{'type'};
+ push(@owners,&unescape($courses{$course}{'owner'}));
+ if (ref($courses{$course}{'co-owners'}) eq 'ARRAY') {
+ foreach my $item (@{$courses{$course}{'co-owners'}}) {
+ push(@owners,&unescape($item));
+ }
+ }
+ } else {
+ my $singleowner;
+ ($descr,$instcode,$singleowner,$ttype)=split(/:/,$courses{$course});
+ push(@owners,&unescape($singleowner));
}
- opener.document.$env{"form.form"}.currsec.multiple=true
- if (numSections < 3) {
- opener.document.$env{"form.form"}.currsec.size=numSections;
+ my $ownerstr = join(', ',@owners);
+ $r->print(''.&course_chooser($multiple,$cdom,$cnum,$cleandesc).' | ');
+ $r->print(''.$description.' | ');
+ $r->print('');
+ $r->print(&Apache::lonnet::domain($cdom,'description')?
+ $cdom.' ('.&Apache::lonnet::domain($cdom,'description').')':$cdom);
+ $r->print(' | ');
+ $r->print('');
+ if ($instcode ne '') {
+ $r->print(&unescape($instcode));
} else {
- opener.document.$env{"form.form"}.currsec.size=3;
+ $r->print(' ');
}
- opener.document.$env{"form.form"}.currsec.options[0].selected = false
+ $r->print(' | ');
+ $r->print(''.$ownerstr.' | ');
+ $r->print('');
+ if ($ttype ne '') {
+ $r->print(&mt(&unescape($ttype)));
+ } else {
+ $r->print(' ');
+ }
+ $r->print(' | ');
+ if ($multiple) { $r->print("\n"); }
+ $r->print(&Apache::loncommon::end_data_table_row());
+ # $r->print("
\n");
}
}
- opener.document.$env{"form.form"}.groups.value='$groupslist';
- self.close()
+ if (%courses) {
+ $r->print(&Apache::loncommon::end_data_table());
+ }
+
+ if (!%courses) {
+ $r->print(&mt('None found'));
+ } elsif ($multiple) {
+ $r->print('');
+ }
+ $r->print(''.
+ "\n".''."\n".
+ ''."\n");
+ if ((exists($env{'form.roleelement'})) && ($env{'form.form'} eq 'rolechoice')) {
+ $r->print(''."\n");
+ }
+ if ($env{'form.form'} eq 'portform') {
+ $r->print('');
+ $r->print('');
+ $r->print('');
+ $r->print('');
+ } elsif ($env{'form.form'} eq 'modifycourse') {
+ $r->print(&Apache::lonhtmlcommon::echo_form_input(['phase','pickedcourse','type','form']));
+ } else {
+ $r->print(''."\n".
+ ''."\n");
+ }
+ $r->print("