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

raeburn raeburn at source.lon-capa.org
Thu Sep 26 13:46:42 EDT 2013


raeburn		Thu Sep 26 17:46:42 2013 EDT

  Modified files:              
    /loncom/interface	lonuserutils.pm 
  Log:
  - Displaying user lists:
    - Correct column identifier for student photo column. 
    - Column header is not a link, if sorting unavailable for the item in the column.
  
  
Index: loncom/interface/lonuserutils.pm
diff -u loncom/interface/lonuserutils.pm:1.155 loncom/interface/lonuserutils.pm:1.156
--- loncom/interface/lonuserutils.pm:1.155	Sat Sep 21 14:10:30 2013
+++ loncom/interface/lonuserutils.pm	Thu Sep 26 17:46:42 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Utility functions for managing LON-CAPA user accounts
 #
-# $Id: lonuserutils.pm,v 1.155 2013/09/21 14:10:30 raeburn Exp $
+# $Id: lonuserutils.pm,v 1.156 2013/09/26 17:46:42 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1988,7 +1988,7 @@
         }
         if (($context eq 'course') && ($mode ne 'autoenroll') &&
             ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'})) {
-            push(@cols,'photos');
+            push(@cols,'photo');
         }
         if ($context eq 'domain') {
             push (@cols,'extent');
@@ -2468,7 +2468,9 @@
     if ($mode eq 'pickauthor') {
         @sortable = ('username','fullname','email','status');
     }
-    if (!grep(/^\Q$sortby\E$/, at sortable)) {
+    my %is_sortable;
+    map { $is_sortable{$_} => 1; } @sortable;
+    unless ($is_sortable{$sortby}) {
         $sortby = 'username';
     }
     my $setting = $env{'form.roletype'};
@@ -2712,7 +2714,13 @@
             }
         }
         foreach my $item (@cols) {
-            $output .= "<th><a href=\"javascript:document.$formname.sortby.value='$item';document.$formname.submit();\">$lt{$item}</a></th>\n";
+            $output .= "<th>";
+            if ($is_sortable{$item}) {
+                $output .= "<a href=\"javascript:document.$formname.sortby.value='$item';document.$formname.submit();\">$lt{$item}</a>";
+            } else {
+                $output .= $lt{$item};
+            }
+            $output .= "</th>\n";
         }
         my %role_types = &role_type_names();
         $output .= &Apache::loncommon::end_data_table_header_row();




More information about the LON-CAPA-cvs mailing list