version 1.40, 2008/07/15 19:43:15
|
version 1.43, 2008/09/23 14:41:00
|
Line 113 function setCourseId(caller) {
|
Line 113 function setCourseId(caller) {
|
} |
} |
|
|
ENDSCRIPT |
ENDSCRIPT |
$catjs .= &syllabus_javascript(); |
$catjs .= &courselink_javascript(); |
my $numtitles; |
my $numtitles; |
if ($env{'form.currcat_0'} eq 'instcode::0') { |
if ($env{'form.currcat_0'} eq 'instcode::0') { |
$numtitles = &instcode_course_selector($r,$codedom,$formname,$domdesc, |
$numtitles = &instcode_course_selector($r,$codedom,$formname,$domdesc, |
Line 158 sub course_details {
|
Line 158 sub course_details {
|
my %add_entries = (topmargin => "0", |
my %add_entries = (topmargin => "0", |
marginheight => "0",); |
marginheight => "0",); |
my $js = '<script type="text/javascript">'."\n". |
my $js = '<script type="text/javascript">'."\n". |
&syllabus_javascript().'</script>'."\n"; |
&courselink_javascript().'</script>'."\n"; |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Course Catalog',$js, |
&Apache::loncommon::start_page('Course Catalog',$js, |
{ |
{ |
Line 181 sub course_details {
|
Line 181 sub course_details {
|
$r->print('<form name="'.$formname.'" method="post" action="/adm/coursecatalog">'. |
$r->print('<form name="'.$formname.'" method="post" action="/adm/coursecatalog">'. |
'<a href = "javascript:document.coursecatalog.submit()">'. |
'<a href = "javascript:document.coursecatalog.submit()">'. |
&mt('Back to course listing').'</a>'. |
&mt('Back to course listing').'</a>'. |
&Apache::lonhtmlcommon::echo_form_input(['coursenum','catalogfilter','showdetails']).'</form>'); |
&Apache::lonhtmlcommon::echo_form_input(['coursenum','catalogfilter', |
|
'showdetails','courseid']).'</form>'); |
return; |
return; |
} |
} |
|
|
sub syllabus_javascript { |
sub courselink_javascript { |
return <<"END"; |
return <<"END"; |
|
|
function ToSyllabus(cdom,cnum) { |
function ToSyllabus(cdom,cnum) { |
Line 195 function ToSyllabus(cdom,cnum) {
|
Line 196 function ToSyllabus(cdom,cnum) {
|
if (cnum == '' || cnum == null) { |
if (cnum == '' || cnum == null) { |
return; |
return; |
} |
} |
document.syllabuslaunch.action = "/public/"+cdom+"/"+cnum+"/syllabus"; |
document.linklaunch.action = "/public/"+cdom+"/"+cnum+"/syllabus"; |
document.syllabuslaunch.submit(); |
document.linklaunch.submit(); |
|
} |
|
|
|
function ToSelfenroll(courseid) { |
|
if (courseid == '') { |
|
return; |
|
} |
|
document.linklaunch.action = "/adm/selfenroll"; |
|
document.linklaunch.courseid.value = courseid; |
|
document.linklaunch.submit(); |
} |
} |
|
|
END |
END |
Line 755 sub print_course_listing {
|
Line 765 sub print_course_listing {
|
my %domconfig = |
my %domconfig = |
&Apache::lonnet::get_dom('configuration',['usercreation'],$domain); |
&Apache::lonnet::get_dom('configuration',['usercreation'],$domain); |
$output .= &construct_data_table($knownuser,\%courses,$details,undef,$now,\%domconfig,$trails,$allitems); |
$output .= &construct_data_table($knownuser,\%courses,$details,undef,$now,\%domconfig,$trails,$allitems); |
$output .= "\n".'<form name="syllabuslaunch" method="post" action="">'. |
$output .= "\n".'<form name="linklaunch" method="post" action="">'. |
'<input type="hidden" name="backto" value="coursecatalog" />'. |
'<input type="hidden" name="backto" value="coursecatalog" />'. |
&Apache::lonhtmlcommon::echo_form_input(['catalogfilter']).'</form>'; |
'<input type="hidden" name="courseid" value="" />'. |
|
&Apache::lonhtmlcommon::echo_form_input(['catalogfilter','courseid']).'</form>'; |
return $output; |
return $output; |
} |
} |
|
|
Line 799 sub construct_data_table {
|
Line 810 sub construct_data_table {
|
$output .= |
$output .= |
'<th>'.&mt('Default Access Dates for Students').'</th>'. |
'<th>'.&mt('Default Access Dates for Students').'</th>'. |
'<th>'.&mt('Student Counts').'</th>'. |
'<th>'.&mt('Student Counts').'</th>'. |
'<th>'.&mt('Auto-enrollment of <br />registered students').'</th>'; |
'<th>'.&mt('Auto-enrollment of[_1]registered students','<br />').'</th>'; |
} else { |
} else { |
$output .= '<th>'.&mt('Details').'</th>'; |
$output .= '<th>'.&mt('Details').'</th>'; |
} |
} |
Line 946 sub build_courseinfo_hash {
|
Line 957 sub build_courseinfo_hash {
|
} |
} |
} |
} |
if ($startaccess) { |
if ($startaccess) { |
$accessdates .= &mt('<i>From:</i> ').$startaccess.'<br />'; |
$accessdates .= '<i>'.&mt('From:[_1]','</i> '.$startaccess).'<br />'; |
} |
} |
if ($endaccess) { |
if ($endaccess) { |
$accessdates .= &mt('<i>To:</i> ').$endaccess.'<br />'; |
$accessdates .= '<i>'.&mt('To:[_1]','</i> '.$endaccess).'<br />'; |
} |
} |
if (($selfenroll_types ne '') && |
if (($selfenroll_types ne '') && |
($selfenroll_end > 0 && $selfenroll_end > $now)) { |
($selfenroll_end > 0 && $selfenroll_end > $now)) { |
Line 970 sub build_courseinfo_hash {
|
Line 981 sub build_courseinfo_hash {
|
if ($selfenroll_start_access || $selfenroll_end_access) { |
if ($selfenroll_start_access || $selfenroll_end_access) { |
$accessdates .= '<br/><br /><i>'.&mt('Self-enrollers:').'</i><br />'; |
$accessdates .= '<br/><br /><i>'.&mt('Self-enrollers:').'</i><br />'; |
if ($selfenroll_start_access) { |
if ($selfenroll_start_access) { |
$accessdates .= &mt('<i>From:</i> ').$selfenroll_start_access.'<br />'; |
$accessdates .= '<i>'.&mt('From:[_1]','</i> '.$selfenroll_start_access).'<br />'; |
} |
} |
if ($selfenroll_end_access) { |
if ($selfenroll_end_access) { |
$accessdates .= &mt('<i>To:</i> ').$selfenroll_end_access.'<br />'; |
$accessdates .= '<i>'.&mt('To:[_1]','</i> '.$selfenroll_end_access).'<br />'; |
} |
} |
} |
} |
} |
} |
Line 1008 sub count_students {
|
Line 1019 sub count_students {
|
$student_count{$data->[$idx{'status'}]} ++; |
$student_count{$data->[$idx{'status'}]} ++; |
} |
} |
|
|
my $countslist = &mt('[quant,_1,section]',$numsec).':<br />'; |
my $countslist = &mt('[quant,_1,section:,sections:,No sections]',$numsec).'<br />'; |
foreach my $status ('Active','Future') { |
foreach my $status ('Active','Future') { |
$countslist .= '<nobr>'.$status_title{$status}.': '. |
$countslist .= '<span class="LC_nobreak">'.$status_title{$status}.': '. |
$student_count{$status}.'</nobr><br />'; |
$student_count{$status}.'</span><br />'; |
} |
} |
return $countslist; |
return $countslist; |
} |
} |
Line 1084 sub courseinfo_row {
|
Line 1095 sub courseinfo_row {
|
if (($info->{'selfenroll_start'} > 0) && ($info->{'selfenroll_start'} > $now)) { |
if (($info->{'selfenroll_start'} > 0) && ($info->{'selfenroll_start'} > $now)) { |
$output .= '<td>'.&mt('Starts: [_1]','<span class="LC_cusr_emph">'.$showstart.'</span>').'<br />'.&mt('Ends: [_1]','<span class="LC_cusr_emph">'.$showend.'</span>').'</td>'; |
$output .= '<td>'.&mt('Starts: [_1]','<span class="LC_cusr_emph">'.$showstart.'</span>').'<br />'.&mt('Ends: [_1]','<span class="LC_cusr_emph">'.$showend.'</span>').'</td>'; |
} else { |
} else { |
$output .= '<td><a href="/adm/selfenroll?cid='.$course.'">'.&mt('Enroll in course').'</a></td>'; |
$output .= '<td><a href="javascript:ToSelfenroll('."'$course'".')">'.&mt('Enroll in course').'</a></td>'; |
} |
} |
$selfenroll = 1; |
$selfenroll = 1; |
} |
} |
Line 1151 sub get_valid_classes {
|
Line 1162 sub get_valid_classes {
|
} |
} |
if ($totalitems > 0) { |
if ($totalitems > 0) { |
if (@{$validations{'sections'}}) { |
if (@{$validations{'sections'}}) { |
$response = &mt('Sections: '). |
$response = &mt('Sections:').' '. |
join(', ',@{$validations{'sections'}}).'<br />'; |
join(', ',@{$validations{'sections'}}).'<br />'; |
} |
} |
if (@{$validations{'xlists'}}) { |
if (@{$validations{'xlists'}}) { |
$response .= &mt('Courses: '). |
$response .= &mt('Courses:').' '. |
join(', ',@{$validations{'xlists'}}); |
join(', ',@{$validations{'xlists'}}); |
} |
} |
} |
} |
Line 1320 sub autoenroll_info {
|
Line 1331 sub autoenroll_info {
|
&get_valid_classes($seclist,$xlist_items,$code, |
&get_valid_classes($seclist,$xlist_items,$code, |
$owners,$cdom,$cnum); |
$owners,$cdom,$cnum); |
if ($valid_classes ne '') { |
if ($valid_classes ne '') { |
$autoenrolldates = &mt('Not enabled<br />Starts: '). |
$autoenrolldates = &mt('Not enabled').'<br />' |
$autostart.'<br />'.$valid_classes; } |
.&mt('Starts: [_1]',$autostart) |
|
.'<br />'.$valid_classes; |
|
} |
} |
} |
} else { |
} else { |
if ($coursehash->{'internal.autoend'} && $coursehash->{'internal.autoend'} < $now) { |
if ($coursehash->{'internal.autoend'} && $coursehash->{'internal.autoend'} < $now) { |
$autoenrolldates = &mt('Not enabled<br />Ended: ').$autoend; |
$autoenrolldates = &mt('Not enabled').'<br />' |
|
.&mt('Ended: [_1]',$autoend); |
} else { |
} else { |
my $valid_classes = &get_valid_classes($seclist,$xlist_items, |
my $valid_classes = &get_valid_classes($seclist,$xlist_items, |
$code,$owners,$cdom,$cnum); |
$code,$owners,$cdom,$cnum); |
if ($valid_classes ne '') { |
if ($valid_classes ne '') { |
$autoenrolldates = &mt('Currently enabled<br />'). |
$autoenrolldates = &mt('Currently enabled').'<br />'. |
$valid_classes; |
$valid_classes; |
} |
} |
} |
} |