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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Fri, 09 Nov 2007 20:51:26 -0000


albertel		Fri Nov  9 15:51:26 2007 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  - preserve last choices on the user search screen
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.191 loncom/interface/loncreateuser.pm:1.192
--- loncom/interface/loncreateuser.pm:1.191	Mon Nov  5 23:39:19 2007
+++ loncom/interface/loncreateuser.pm	Fri Nov  9 15:51:20 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.191 2007/11/06 04:39:19 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.192 2007/11/09 20:51:20 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2434,12 +2434,13 @@
     } elsif ($env{'form.action'} eq 'singleuser' && $permission->{'cusr'}) {
         my $phase = $env{'form.phase'};
         my @search = ('srchterm','srchby','srchin','srchtype','srchdomain');
+	&Apache::loncreateuser::restore_prev_selections();
+	my $srch;
+	foreach my $item (@search) {
+	    $srch->{$item} = $env{'form.'.$item};
+	}
 
         if (($phase eq 'get_user_info') || ($phase eq 'userpicked')) {
-            my $srch;
-            foreach my $item (@search) {
-                $srch->{$item} = $env{'form.'.$item};
-            }
             if ($env{'form.phase'} eq 'get_user_info') {
                 my ($currstate,$response,$forcenewuser,$results) = 
                     &user_search_result($srch);
@@ -2480,7 +2481,7 @@
         } elsif ($env{'form.phase'} eq 'update_user_data') {
             &update_user_data($r);
         } else {
-            &print_username_entry_form($r);
+            &print_username_entry_form($r,undef,$srch);
         }
     } elsif ($env{'form.action'} eq 'custom' && $permission->{'custom'}) {
         if ($env{'form.phase'} eq 'set_custom_roles') {