version 1.67.2.3, 2008/01/20 22:47:37
|
version 1.71, 2008/05/19 21:40:26
|
Line 251 sub display_matched_courses {
|
Line 251 sub display_matched_courses {
|
my $description = $descr; |
my $description = $descr; |
push (@{$by_descrip{$description}}, $course); |
push (@{$by_descrip{$description}}, $course); |
} |
} |
|
|
if ($numcourses > 1 && $multiple) { |
if ($numcourses > 1 && $multiple) { |
$r->print('<input type="button" value="check all" |
$r->print('<input type="button" value="check all" |
onclick="javascript:checkAll(document.courselist.course_id)" /> |
onclick="javascript:checkAll(document.courselist.course_id)" /> |
Line 258 sub display_matched_courses {
|
Line 259 sub display_matched_courses {
|
onclick="javascript:uncheckAll(document.courselist.course_id)" /> |
onclick="javascript:uncheckAll(document.courselist.course_id)" /> |
<br /><br />'); |
<br /><br />'); |
} |
} |
|
|
|
if (%courses) { |
|
$r->print(&Apache::loncommon::start_data_table()); |
|
$r->print(&Apache::loncommon::start_data_table_header_row()); |
|
$r->print('<th>'.&mt('Select').'</th>' |
|
.'<th>'.&mt('Course Description').'</th>' |
|
.'<th>'.&mt('Domain').'</th>' |
|
.'<th>'.&mt('Course Code').'</th>' |
|
.'<th>'.&mt('Owner:Domain').'</th>' |
|
.'<th>'.&mt('Type').'</th>' |
|
); |
|
$r->print(&Apache::loncommon::end_data_table_header_row()); |
|
} |
foreach my $description (sort { lc($a) cmp lc($b) } (keys(%by_descrip))) { |
foreach my $description (sort { lc($a) cmp lc($b) } (keys(%by_descrip))) { |
|
$r->print(&Apache::loncommon::start_data_table_row()); |
foreach my $course (@{$by_descrip{$description}}) { |
foreach my $course (@{$by_descrip{$description}}) { |
my $cleandesc=&HTML::Entities::encode($description,'<>&"'); |
my $cleandesc=&HTML::Entities::encode($description,'<>&"'); |
$cleandesc=~s/'/\\'/g; |
$cleandesc=~s/'/\\'/g; |
Line 280 sub display_matched_courses {
|
Line 295 sub display_matched_courses {
|
push(@owners,&unescape($singleowner)); |
push(@owners,&unescape($singleowner)); |
} |
} |
my $owner = join(', ',@owners); |
my $owner = join(', ',@owners); |
$r->print(&course_chooser($multiple,$cdom,$cnum,$cleandesc)); |
$r->print('<td>'.&course_chooser($multiple,$cdom,$cnum,$cleandesc).'</td>'); |
$r->print($description.' ('. |
$r->print('<td>'.$description.'</td>'); |
(&Apache::lonnet::domain($cdom,'description')? |
$r->print('<td>'); |
&Apache::lonnet::domain($cdom,'description'):$cdom).")"); |
$r->print(&Apache::lonnet::domain($cdom,'description')? |
|
$cdom.' ('.&Apache::lonnet::domain($cdom,'description').')':$cdom); |
|
$r->print('</td>'); |
|
$r->print('<td>'); |
if ($instcode ne '') { |
if ($instcode ne '') { |
$r->print(" - ".&unescape($instcode)); |
$r->print(&unescape($instcode)); |
|
} else { |
|
$r->print(' '); |
} |
} |
|
$r->print('</td>'); |
|
$r->print('<td>'); |
if (@owners > 1) { |
if (@owners > 1) { |
$r->print(', '.&mt('owners').' - ',join(', ',@owners)); |
# $r->print(', '.&mt('owners').' - ',join(', ',@owners)); |
|
$r->print(join(', ',@owners)); |
} elsif (@owners == 1) { |
} elsif (@owners == 1) { |
$r->print(', '.&mt('owner').' - '.$owner); |
# $r->print(', '.&mt('owner').' - '.$owner); |
|
$r->print($owner); |
} |
} |
|
$r->print('</td>'); |
|
$r->print('<td>'); |
if ($ttype ne '') { |
if ($ttype ne '') { |
$r->print(' ('.&unescape($ttype).')'); |
$r->print(&mt(&unescape($ttype))); |
|
} else { |
|
$r->print(' '); |
} |
} |
|
$r->print('</td>'); |
if ($multiple) { $r->print("</label>\n"); } |
if ($multiple) { $r->print("</label>\n"); } |
$r->print("<br />\n"); |
# $r->print("<br />\n"); |
} |
} |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
} |
} |
|
$r->print(&Apache::loncommon::end_data_table()); |
|
|
if (!%courses) { |
if (!%courses) { |
$r->print(&mt('None found')); |
$r->print(&mt('None found')); |
} elsif ($multiple) { |
} elsif ($multiple) { |
Line 452 $multelement
|
Line 484 $multelement
|
if ($domainselectform) { |
if ($domainselectform) { |
$output .= $lt{'cdo'}.': '.$domainselectform.'<br />'."\n"; |
$output .= $lt{'cdo'}.': '.$domainselectform.'<br />'."\n"; |
} |
} |
# if ($typeselectform) { |
if ($typeselectform) { |
# $output .= $lt{'cog'}.': '.$typeselectform.'<br />'."\n"; |
$output .= $lt{'cog'}.': '.$typeselectform.'<br />'."\n"; |
# } |
} |
if ($instcodeform) { |
if ($instcodeform) { |
$output .= $lt{'cin'}.': '.$instcodeform.'<br />'."\n"; |
$output .= $lt{'cin'}.': '.$instcodeform.'<br />'."\n"; |
} |
} |
Line 483 sub search_courses {
|
Line 515 sub search_courses {
|
my ($r,$type,$onlyown,$filter) = @_; |
my ($r,$type,$onlyown,$filter) = @_; |
my %courses; |
my %courses; |
if (!$onlyown) { |
if (!$onlyown) { |
$r->print(&mt('Searching').' ...<br /> <br />'); |
$r->print(&mt('Searching ...').'<br /> <br />'); |
$r->rflush(); |
$r->rflush(); |
if (($filter->{'ownerfilter'} ne '') || |
if (($filter->{'ownerfilter'} ne '') || |
($filter->{'ownerdomfilter'} ne '')) { |
($filter->{'ownerdomfilter'} ne '')) { |
Line 523 sub course_chooser {
|
Line 555 sub course_chooser {
|
if ($multiple) { |
if ($multiple) { |
$output = '<label><input type="checkbox" name="course_id" value="'.$cdom.'_'.$cnum.'" />'."\n"; |
$output = '<label><input type="checkbox" name="course_id" value="'.$cdom.'_'.$cnum.'" />'."\n"; |
} else { |
} else { |
$output = '<input type="button" value="Select" onClick="gochoose('. |
$output = '<input type="button" value="'.&mt('Select').'" onClick="gochoose('. |
"'".$cnum."','".$cdom."','".$cleandesc."')".'" />'."\n"; |
"'".$cnum."','".$cdom."','".$cleandesc."')".'" />'."\n"; |
} |
} |
return $output; |
return $output; |