--- loncom/interface/lonpickcourse.pm 2009/11/03 14:32:44 1.89
+++ loncom/interface/lonpickcourse.pm 2009/11/04 14:12:19 1.90
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Pick a course
#
-# $Id: lonpickcourse.pm,v 1.89 2009/11/03 14:32:44 raeburn Exp $
+# $Id: lonpickcourse.pm,v 1.90 2009/11/04 14:12:19 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -51,7 +51,7 @@ sub handler {
($ENV{'QUERY_STRING'},['domainfilter','form','cnumelement',
'cdomelement','cnameelement','roleelement',
'multiple','type','setroles','fixeddom','cloner']);
- my ($type,$title,$jscript,$multelement,$multiple,$roleelement,
+ my ($type,$title,$jscript,$multelement,$multiple,$roleelement,$typeelement,
$lastaction,$autosubmit,$submitopener,$cloneruname,$clonerudom);
# Get course type - Course or Community.
@@ -75,6 +75,9 @@ sub handler {
$submitopener = &processpick();
$autosubmit = 'process_pick("'.$roledom.'")';
}
+ if ($env{'form.typeelement'} ne '') {
+ $typeelement = '';
+ }
# if called when a DC is creating a course
if ($env{'form.form'} eq 'ccrs') {
@@ -165,7 +168,7 @@ sub handler {
$r->print(&build_filters($filterlist,$type,$roleelement,$multelement,
$filter,$action,\$numtitles,undef,$cloneruname,
- $clonerudom));
+ $clonerudom,$typeelement));
}
# ---------------------------------------------------------------- Get the data
@@ -481,6 +484,11 @@ sub display_matched_courses {
$env{'form.cnumelement'}.'" />'."\n".
''."\n");
+ if ($env{'form.typeelement'} ne '') {
+ $r->print(''."\n");
+
+ }
}
if ((exists($env{'form.fixeddom'})) && ($env{'form.form'} eq 'rules')) {
$r->print(''."\n";
@@ -981,13 +990,19 @@ function gochoose(cname,cdom,cdesc) {
}
ENDSCRIPT
} else {
- my $name_code;
+ my ($name_code,$type_code);
if ($env{'form.cnameelement'} ne '') {
$name_code = 'opener.document.'.$env{'form.form'}.'.'.
$env{'form.cnameelement'}.'.value=cdesc;';
}
+ if ($env{'form.typeelement'} ne '') {
+ $type_code = 'opener.document.'.$env{'form.form'}.'.'.
+ $env{'form.typeelement'}.'.value=document.courselist.type;';
+ }
+
$output .= qq|
$name_code
+ $type_code
opener.document.$env{'form.form'}.$env{'form.cnumelement'}.value=cname;
var slct=opener.document.$env{'form.form'}.$env{'form.cdomelement'};
if (slct.options == undefined) {
@@ -1129,10 +1144,10 @@ Side Effects: None
=item *
X
-B:
+B:
-Input: 7 - anonymous array of search criteria; course type; $roleelement ; $multelement ; anonymous hash of criteria and their values; form action; ref to scalar (count of number of elements in institutional codes -- e.g., 4 for year, semester, department, and number); caller context (e.g., set to 'modifycourse' when routine is called from lonmodifycourse.pm).
+Input: 11 - anonymous array of search criteria; course type; $roleelement ; $multelement ; anonymous hash of criteria and their values; form action; ref to scalar (count of number of elements in institutional codes -- e.g., 4 for year, semester, department, and number); caller context (e.g., set to 'modifycourse' when routine is called from lonmodifycourse.pm), username and domain of new course owner who wants to clone, $tyepelem
Output: 1 - $output - HTML for display of search criteria, and hidden form elements.