--- loncom/interface/lonmodifycourse.pm	2006/02/10 23:36:47	1.21
+++ loncom/interface/lonmodifycourse.pm	2006/05/30 12:46:09	1.25
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # automated enrollment course setup handler
 #
-# $Id: lonmodifycourse.pm,v 1.21 2006/02/10 23:36:47 albertel Exp $
+# $Id: lonmodifycourse.pm,v 1.25 2006/05/30 12:46:09 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -35,6 +35,7 @@ use Apache::lonlocal;
 use Apache::londropadd;
 use LONCAPA::Enrollment;
 use lib '/home/httpd/lib/perl';
+use LONCAPA;
 
 sub print_course_selection_page {
     my ($r,$tasklongref) = @_;
@@ -101,12 +102,12 @@ ENDBLOCK
             if ($item =~ m/^($dom)_(\w+)$/) {
                 $crs = $2;
                 if ($courseIDs{$item} =~ /^([^:]*):([^:]*):([^:]*)/) {
-                    $description = &Apache::lonnet::unescape($1);
-                    $owner = &Apache::lonnet::unescape($3);
+                    $description = &unescape($1);
+                    $owner = &unescape($3);
                 } elsif ($courseIDs{$item} =~ /^([^:]*):([^:]*)$/) {
-                    $description = &Apache::lonnet::unescape($1);
+                    $description = &unescape($1);
                 } else {   
-                    $description = &Apache::lonnet::unescape($courseIDs{$item});
+                    $description = &unescape($courseIDs{$item});
                 }
 # Get course owner
                 if ($owner eq '') {
@@ -210,9 +211,12 @@ all settings except course code, course
 	        } else {
 	            $enrollvar{$type} = localtime($settings{$item});
 	        }
+	    } elsif ($type eq "sectionums") {
+		$enrollvar{$type} = $settings{$item};
+		$enrollvar{$type} =~ s/,/, /g;
             } elsif ($type eq "courseowner"   || $type eq "authtype" 
-		     || $type eq "autharg"    || $type eq "sectionums"
-		     || $type eq "coursecode" || $type eq "crosslistings") {
+		     || $type eq "autharg"    || $type eq "coursecode"
+		     || $type eq "crosslistings") {
 	        $enrollvar{$type} = $settings{$item};
             }
         } elsif ($item =~ m/^default_enrollment_(start|end)_date$/) {
@@ -256,7 +260,7 @@ all settings except course code, course
         }
     }
     my $numlocalcc = @local_ccs;
-    my $bodytag=&Apache::loncommon::bodytag(&mt("Modify Course Settings"));
+
     my $helplink=&Apache::loncommon::help_open_topic('Modify_Course',&mt("Help on Modifying Courses"));
     my ($krbdef,$krbdefdom)=&Apache::loncommon::get_kerberos_defaults($dom);
     my $curr_authtype = '';
@@ -531,7 +535,7 @@ sub modify_course {
         }
     }
     if ($changeowner == 1 || $changecode == 1) {
-        my $courseid_entry = &Apache::lonnet::escape($dom.'_'.$crs).'='.&Apache::lonnet::escape($description).':'.&Apache::lonnet::escape($env{'form.coursecode'}).':'.&Apache::lonnet::escape($env{'form.courseowner'});
+        my $courseid_entry = &escape($dom.'_'.$crs).'='.&escape($description).':'.&escape($env{'form.coursecode'}).':'.&escape($env{'form.courseowner'});
         &Apache::lonnet::courseidput($dom,$courseid_entry,&Apache::lonnet::homeserver($crs,$dom));
     }
 
@@ -645,7 +649,6 @@ sub modify_course {
 sub print_header {
     my ($r,$tasklongref,$description,$javascriptref) = @_;
     my %lt =&Apache::lonlocal::texthash(
-             'vmcs' => 'View/Modify Course Settings',
              'chco' => 'Choose a course',
              'main' => 'Main Menu',
              'comg' => 'Course Manager',
@@ -658,7 +661,7 @@ sub print_header {
         $description = $lt{'comg'};
     }
     my $page = '';
-    my $bodytag=&Apache::loncommon::bodytag($lt{'vmcs'});
+
     if ($action eq 'start') {  
         $page = "<b>$lt{'chco'}</b>";
     } else {
@@ -670,21 +673,16 @@ sub print_header {
             $page .=  " -&gt; <b>".$$tasklongref{$action}."</b>";
         }
     }
-    my $html=&Apache::lonxml::xmlbegin();
-    $r->print("
-$html
-<head>
-");
+
+    my $js;
     if ($action eq 'display') {
-        $r->print("
-<script language=\"JavaScript\" type=\"text/javascript\">
-$$javascriptref
-</script>");
+	$js = '<script  type="text/javascript">
+                  '.$$javascriptref.'
+               </script>';
     }
+    $r->print(&Apache::loncommon::start_page('View/Modify Course Settings',
+					     $js));
     $r->print(<<ENDTHIS);
-<title>The LearningOnline Network with CAPA</title>
-</head>
-$bodytag
 <table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
   <td bgcolor="#CCCC99">
@@ -700,12 +698,8 @@ ENDTHIS
 }
 
 sub print_footer {
-    my $r = shift;
-    $r->print(<<ENDBASE);
-<br/>
-</body>
-</html>
-ENDBASE
+    my ($r) = @_;
+    $r->print('<br />'.&Apache::loncommon::end_page());
     return;
 }