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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Fri, 14 Dec 2007 21:27:09 -0000


raeburn		Fri Dec 14 16:27:09 2007 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  - Only display "Create a new user" textbox and domain selector on the initial  Single User Management screen.
  - In javascript backPage() function set phase to null, if prevphase argument is undefined.
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.210 loncom/interface/loncreateuser.pm:1.211
--- loncom/interface/loncreateuser.pm:1.210	Fri Dec 14 12:35:52 2007
+++ loncom/interface/loncreateuser.pm	Fri Dec 14 16:27:07 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.210 2007/12/14 17:35:52 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.211 2007/12/14 21:27:07 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -295,7 +295,7 @@
 <input name="userrole" type="button" value="$srchbutton" onclick="javascript:validateEntry(document.crtuser)" />
 </form>
 ENDBLOCK
-    if ($cancreate) {
+    if ($cancreate && $env{'form.phase'} eq '') {
         my $defdom=$env{'request.role.domain'};
         my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain');
         my $helpcrt=&Apache::loncommon::help_open_topic('Course_Change_Privileges');
@@ -3355,8 +3355,18 @@
 
     my $jsback .= qq|
 function backPage(formname,prevphase,prevstate) {
-    formname.phase.value = prevphase;
-    formname.currstate.value = prevstate;
+    if (typeof prevphase == 'undefined') {
+        formname.phase.value = '';
+    }
+    else {  
+        formname.phase.value = prevphase;
+    }
+    if (typeof prevstate == 'undefined') {
+        formname.currstate.value = '';
+    }
+    else {
+        formname.currstate.value = prevstate;
+    }
     formname.submit();
 }
 |;