← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16796: Account/invite form minor fixes

 

------------------------------------------------------------
revno: 16796
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-09-24 13:36:49 +0200
message:
  Account/invite form minor fixes
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/account.vm
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/action/AddSelectedOrganisationUnitAction.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/account.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/account.vm	2014-02-14 14:09:37 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/account.vm	2014-09-24 11:36:49 +0000
@@ -28,7 +28,7 @@
 
 <table>
 
-#if( $accountAction == "invited" )
+	#if( $accountAction == "invited" )
     <tr>
         <td style="width:140px"><label for="code">$i18n.getString( "code_from_email" )</label></td>
         <td>
@@ -37,7 +37,7 @@
             <input type="hidden" id="inviteToken" name="inviteToken" value="$token">
         </td>
     </tr>
-#end
+	#end
 
     <tr>
         <td style="width:140px"><label id="label_firstName" for="firstName">$i18n.getString( "name" )</label></td>
@@ -48,14 +48,13 @@
     </tr>
     <tr>
         <td><label id="label_username" for="username">$i18n.getString( "user_name" )</label></td>
+        #if( $usernameChoice == "false" )
+        <td><input type="hidden" id="username" name="username" value="RpuECtIlVoRKTpYmEkYrAHmPtX4m1U">
+        	<input type="text" id="assignedUsername" name="assignedUsername" disabled="disabled" value="${username}"></td>
+        #else
+        <td><input type="text" id="username" name="username" autocomplete="off"></td>
+        #end
         <td>
-            <input type="text" id="username" name="username" autocomplete="off" #if( $usernameChoice == "false" ) style="display:none" value="nonExistingUserName_RpuECtIlVoRKTpYmEkYrAHmPtX4m1U" #end>
-
-#if( $usernameChoice == "false" )
-            <input type="text" id="assignedUsername" name="assignedUsername" disabled="disabled" value="$username">
-#end
-
-        </td>
     </tr>
     <tr>
         <td><label id="label_password" for="password">$i18n.getString( "password" )</label></td>

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/action/AddSelectedOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/action/AddSelectedOrganisationUnitAction.java	2014-09-17 10:16:52 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/action/AddSelectedOrganisationUnitAction.java	2014-09-24 11:36:49 +0000
@@ -88,16 +88,19 @@
     {
         selectedUnits = selectionManager.getSelectedOrganisationUnits();
 
-        for ( String currentId : id )
+        if ( id != null )
         {
-            OrganisationUnit unit = organisationUnitService.getOrganisationUnit( currentId );
-
-            if ( unit == null )
+            for ( String currentId : id )
             {
-                throw new RuntimeException( "OrganisationUnit with id " + id + " doesn't exist" );
+                OrganisationUnit unit = organisationUnitService.getOrganisationUnit( currentId );
+    
+                if ( unit == null )
+                {
+                    throw new RuntimeException( "OrganisationUnit with id " + id + " doesn't exist" );
+                }
+    
+                selectedUnits.add( unit );
             }
-
-            selectedUnits.add( unit );
         }
 
         selectionManager.setSelectedOrganisationUnits( selectedUnits );