[LON-CAPA-cvs] cvs: loncom /interface lonpickcourse.pm

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Sat, 31 May 2008 00:50:01 -0000


raeburn		Fri May 30 20:50:01 2008 EDT

  Modified files:              
    /loncom/interface	lonpickcourse.pm 
  Log:
  - calls to &Apache::loncommon::start_data_table_row() and &Apache::loncommon::end_data_table_row() moved to correct locations.
  - xhtml
  
  
Index: loncom/interface/lonpickcourse.pm
diff -u loncom/interface/lonpickcourse.pm:1.71 loncom/interface/lonpickcourse.pm:1.72
--- loncom/interface/lonpickcourse.pm:1.71	Mon May 19 17:40:26 2008
+++ loncom/interface/lonpickcourse.pm	Fri May 30 20:50:00 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Pick a course
 #
-# $Id: lonpickcourse.pm,v 1.71 2008/05/19 21:40:26 bisitz Exp $
+# $Id: lonpickcourse.pm,v 1.72 2008/05/31 00:50:00 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -267,14 +267,14 @@
                  .'<th>'.&mt('Course Description').'</th>'
                  .'<th>'.&mt('Domain').'</th>'
                  .'<th>'.&mt('Course Code').'</th>'
-                 .'<th>'.&mt('Owner:Domain').'</th>'
+                 .'<th>'.&mt('Owner/Co-owner(s)').'</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))) {
-        $r->print(&Apache::loncommon::start_data_table_row());
         foreach my $course (@{$by_descrip{$description}}) {
+            $r->print(&Apache::loncommon::start_data_table_row());
             my $cleandesc=&HTML::Entities::encode($description,'<>&"');
             $cleandesc=~s/'/\\'/g;
             my ($cdom,$cnum)=split(/\_/,$course);
@@ -294,7 +294,7 @@
                 ($descr,$instcode,$singleowner,$ttype)=split(/:/,$courses{$course});
                 push(@owners,&unescape($singleowner));
             }
-            my $owner = join(', ',@owners);
+            my $ownerstr = join(', ',@owners);
             $r->print('<td>'.&course_chooser($multiple,$cdom,$cnum,$cleandesc).'</td>');
             $r->print('<td>'.$description.'</td>');
             $r->print('<td>');
@@ -308,15 +308,7 @@
                 $r->print('&nbsp;');
             }
             $r->print('</td>');
-            $r->print('<td>');
-            if (@owners > 1) {
-#               $r->print(', '.&mt('owners').' - ',join(', ',@owners)); 
-                $r->print(join(', ',@owners)); 
-            } elsif (@owners == 1) {
-#               $r->print(', '.&mt('owner').' - '.$owner);
-                $r->print($owner);
-            }
-            $r->print('</td>');
+            $r->print('<td>'.$ownerstr.'</td>');
             $r->print('<td>');
             if ($ttype ne '') {
                 $r->print(&mt(&unescape($ttype)));
@@ -325,11 +317,13 @@
             }
             $r->print('</td>');
             if ($multiple) { $r->print("</label>\n"); }
+            $r->print(&Apache::loncommon::end_data_table_row());
             # $r->print("<br />\n");
         }
-        $r->print(&Apache::loncommon::end_data_table_row());
     }
-    $r->print(&Apache::loncommon::end_data_table());
+    if (%courses) {
+        $r->print(&Apache::loncommon::end_data_table());
+    }
 
     if (!%courses) {
         $r->print(&mt('None found'));
@@ -449,8 +443,8 @@
                 $list->{'instcodefilter'}.'" />';
     }
     foreach my $posstype ('Course','Non-standard Course') {
-        $typeselectform.='<option value="'.$posstype.'" "'.
-            ($posstype eq $type ? 'selected="selected" ' : ''). ">$posstype</option>\n";
+        $typeselectform.='<option value="'.$posstype.'"'.
+            ($posstype eq $type ? ' selected="selected" ' : ''). ">$posstype</option>\n";
     }
     $typeselectform.="</select>";
     my $output = qq|