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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Thu, 10 Jul 2008 22:07:22 -0000


raeburn		Thu Jul 10 18:07:22 2008 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm loncommon.pm 
  Log:
  Self-enroll: 'other' vs. 'any'. 
    - &loncommon::sorted_inst_types()
       - &mt() for 'any' in course context.
    - &loncommon::selfenroll_inst_types() check for keys in $usertypes hash for 
         consistency with &loncommon::sorted_inst_types()
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.250 loncom/interface/loncreateuser.pm:1.251
--- loncom/interface/loncreateuser.pm:1.250	Mon Jul  7 19:54:27 2008
+++ loncom/interface/loncreateuser.pm	Thu Jul 10 18:07:18 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.250 2008/07/07 23:54:27 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.251 2008/07/10 22:07:18 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3538,7 +3538,7 @@
     my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($currdom);
     my $othervalue = 'any';
     if ((ref($types) eq 'ARRAY') && (ref($usertypes) eq 'HASH')) {
-        if (@{$types} > 0) {
+        if (keys(%{$usertypes}) > 0) {
             $othervalue = 'other';
         }
         $output .= '<table><tr>';
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.667 loncom/interface/loncommon.pm:1.668
--- loncom/interface/loncommon.pm:1.667	Mon Jul  7 21:08:57 2008
+++ loncom/interface/loncommon.pm	Thu Jul 10 18:07:18 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.667 2008/07/08 01:08:57 raeburn Exp $
+# $Id: loncommon.pm,v 1.668 2008/07/10 22:07:18 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -6838,7 +6838,7 @@
     my ($usertypes,$order) = &Apache::lonnet::retrieve_inst_usertypes($dom);
     my $othertitle = &mt('All users');
     if ($env{'request.course.id'}) {
-        $othertitle  = 'any';
+        $othertitle  = &mt('Any users');
     }
     my @types;
     if (ref($order) eq 'ARRAY') {
@@ -6851,9 +6851,6 @@
     }
     if (keys(%{$usertypes}) > 0) {
         $othertitle = &mt('Other users');
-        if ($env{'request.course.id'}) {
-            $othertitle = 'other';
-        }
     }
     return ($othertitle,$usertypes,\@types);
 }