version 1.105, 2013/02/05 17:02:40
|
version 1.107, 2013/03/25 04:05:30
|
Line 31 package Apache::lonpickcourse;
|
Line 31 package Apache::lonpickcourse;
|
use strict; |
use strict; |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
use Apache::loncommon; |
use Apache::loncommon; |
|
use Apache::lonhtmlcommon; |
use Apache::loncoursedata; |
use Apache::loncoursedata; |
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::lonlocal; |
use Apache::lonlocal; |
Line 105 sub handler {
|
Line 106 sub handler {
|
|
|
if ((($env{'form.form'} eq 'cu') || ($env{'form.form'} eq 'studentform')) && |
if ((($env{'form.form'} eq 'cu') || ($env{'form.form'} eq 'studentform')) && |
($env{'form.pickedcourse'})) { |
($env{'form.pickedcourse'})) { |
$loaditem{'onload'} .= 'setRoles();setSections();'; |
$loaditem{'onload'} .= 'setDefaultCredits();setRoles();setSections();'; |
} |
} |
my $js = &js_changer(); |
my $js = &js_changer(); |
$r->print(&Apache::loncommon::start_page($title,$js, |
$r->print(&Apache::loncommon::start_page($title,$js, |
Line 206 sub handler {
|
Line 207 sub handler {
|
} |
} |
|
|
sub js_changer { |
sub js_changer { |
return <<"ENDJS"; |
return <<ENDJS; |
<script type="text/javascript"> |
<script type="text/javascript"> |
|
// <![CDATA[ |
function updateFilters(caller) { |
function updateFilters(caller) { |
if (typeof(caller) != "undefined") { |
if (typeof(caller) != "undefined") { |
document.filterpicker.updater.value = caller.name; |
document.filterpicker.updater.value = caller.name; |
} |
} |
document.filterpicker.submit(); |
document.filterpicker.submit(); |
} |
} |
|
// ]]> |
</script> |
</script> |
|
|
ENDJS |
ENDJS |
|
|
} |
} |
|
|
sub processpick { |
sub processpick { |
Line 281 sub create_user_javascript {
|
Line 281 sub create_user_javascript {
|
my $cdom = $coursedescription{'domain'}; |
my $cdom = $coursedescription{'domain'}; |
my $cnum = $coursedescription{'num'}; |
my $cnum = $coursedescription{'num'}; |
my $crstype = $coursedescription{'type'}; |
my $crstype = $coursedescription{'type'}; |
|
my %domdefs = &Apache::lonnet::get_domain_defaults($cdom); |
|
my ($showcredits,$credits); |
|
if (($crstype ne 'Community') && |
|
($domdefs{'officialcredits'} || $domdefs{'unofficialcredits'})) { |
|
$showcredits = 1; |
|
$credits = $coursedescription{'internal.defaultcredits'}; |
|
} |
my $sec_element = 'currsec'; |
my $sec_element = 'currsec'; |
my $grplist_element = 'groups'; |
my $grplist_element = 'groups'; |
my ($sections,$groups) = |
my ($sections,$groups) = |
Line 291 sub create_user_javascript {
|
Line 298 sub create_user_javascript {
|
my $groupslist = join(',',@{$groups}); |
my $groupslist = join(',',@{$groups}); |
$output = qq| |
$output = qq| |
<script type="text/javascript"> |
<script type="text/javascript"> |
|
// <![CDATA[ |
function setSections() { |
function setSections() { |
opener.document.$env{"form.form"}.$grplist_element.value='$groupslist'; |
opener.document.$env{"form.form"}.$grplist_element.value='$groupslist'; |
window.opener.setSect('$seclist'); |
window.opener.setSect('$seclist'); |
Line 299 function setSections() {
|
Line 307 function setSections() {
|
function setRoles() { |
function setRoles() { |
window.opener.setRole('$crstype'); |
window.opener.setRole('$crstype'); |
} |
} |
|
|; |
|
if ($showcredits) { |
|
$output .= qq| |
|
function setDefaultCredits() { |
|
window.opener.setCredits('$credits'); |
|
} |
|
|; |
|
} |
|
$output .= qq| |
|
// ]]> |
</script> |
</script> |
|; |
|; |
; |
|
} |
} |
return $output; |
return $output; |
} |
} |
Line 324 sub display_matched_courses {
|
Line 341 sub display_matched_courses {
|
my $ccrolechk = ' '; |
my $ccrolechk = ' '; |
my $menuchk = ' checked="checked" '; |
my $menuchk = ' checked="checked" '; |
$r->print( |
$r->print( |
'<fieldset>' |
'<div class="LC_left_float">' |
.'<legend>'.&mt('Action').'</legend>' |
.'<fieldset>' |
.'<div class="LC_nobreak"><label>' |
.'<legend>'.&mt('Pick action').'</legend>' |
|
.'<span class="LC_nobreak"><label>' |
.'<input type="radio" name="phase" value="ccrole"'.$ccrolechk.'/>' |
.'<input type="radio" name="phase" value="ccrole"'.$ccrolechk.'/>' |
.' '); |
.' '); |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
Line 334 sub display_matched_courses {
|
Line 352 sub display_matched_courses {
|
} else { |
} else { |
$r->print(&mt('Enter the course with the role of [_1].',$cctitle)); |
$r->print(&mt('Enter the course with the role of [_1].',$cctitle)); |
} |
} |
$r->print('</label></div>' |
$r->print('</label></span><br />' |
.'<div class="LC_nobreak"><label>' |
.'<span class="LC_nobreak"><label>' |
.'<input type="radio" name="phase" value="menu"'.$menuchk.'/> '); |
.'<input type="radio" name="phase" value="menu"'.$menuchk.'/> '); |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$r->print(&mt('View or modify community settings which only a [_1] may modify.',$dctitle)); |
$r->print(&mt('View or modify community settings which only a [_1] may modify.',$dctitle)); |
} else { |
} else { |
$r->print(&mt('View or modify course settings which only a [_1] may modify.',$dctitle)); |
$r->print(&mt('View or modify course settings which only a [_1] may modify.',$dctitle)); |
} |
} |
$r->print('</label></div>' |
$r->print('</label></span>' |
.'</fieldset>' |
.'</fieldset></div>' |
.'<br />' |
.'<br clear="all" />' |
); |
); |
} |
} |
} |
} |
Line 891 sub search_courses {
|
Line 909 sub search_courses {
|
$ccrole = 'cc'; |
$ccrole = 'cc'; |
} |
} |
if (!$onlyown) { |
if (!$onlyown) { |
$r->print(&mt('Searching ...').'<br /> <br />'); |
$r->print('<div id="searching">'.&mt('Searching ...').'</div>'); |
$r->rflush(); |
$r->rflush(); |
if (($filter->{'ownerfilter'} ne '') || |
if (($filter->{'ownerfilter'} ne '') || |
($filter->{'ownerdomfilter'} ne '')) { |
($filter->{'ownerdomfilter'} ne '')) { |
Line 1010 sub gochoose_javascript {
|
Line 1028 sub gochoose_javascript {
|
list => 'courselist', |
list => 'courselist', |
}, |
}, |
); |
); |
my $output .= qq| |
my $output = qq| |
function gochoose(cname,cdom,cdesc) { |
function gochoose(cname,cdom,cdesc) { |
var openerForm = "$env{'form.form'}"; |
var openerForm = "$env{'form.form'}"; |
courseCount = 0; |
courseCount = 0; |