← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8493: Improved impl of update user account

 

------------------------------------------------------------
revno: 8493
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-10-11 19:21:32 +0200
message:
  Improved impl of update user account
removed:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/updateUserInput.vm
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/updateUserSuccess.vm
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/updateUserAccountForm.js
  dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/profile.vm


--
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/javascripts/useraccount/updateUserAccountForm.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/updateUserAccountForm.js	2012-10-11 16:02:00 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/updateUserAccountForm.js	2012-10-11 17:21:32 +0000
@@ -22,19 +22,18 @@
 function updateUser()
 {
 	$.postUTF8( 'updateUserAccount.action',
-		{
-			id: getFieldValue( 'id' ),
-			oldPassword: getFieldValue( 'oldPassword' ),
-			rawPassword: getFieldValue( 'rawPassword' ),
-			retypePassword: getFieldValue( 'retypePassword' ),
-			surname: getFieldValue( 'surname' ),
-			firstName: getFieldValue( 'firstName' ),
-			email: getFieldValue( 'email' ),
-			phoneNumber: getFieldValue( 'phoneNumber' )
-		}
-		, function( xmlObject ) 
-		{
-			xmlObject = xmlObject.getElementsByTagName( 'message' )[0];
-			setHeaderDelayMessage( xmlObject.firstChild.nodeValue );
-		} );
+	{
+		id: getFieldValue( 'id' ),
+		oldPassword: getFieldValue( 'oldPassword' ),
+		rawPassword: getFieldValue( 'rawPassword' ),
+		retypePassword: getFieldValue( 'retypePassword' ),
+		surname: getFieldValue( 'surname' ),
+		firstName: getFieldValue( 'firstName' ),
+		email: getFieldValue( 'email' ),
+		phoneNumber: getFieldValue( 'phoneNumber' )
+	},
+	function( json ) 
+	{
+		setHeaderDelayMessage( json.message );
+	} );
 }

=== removed file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/updateUserInput.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/updateUserInput.vm	2010-03-30 02:59:14 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/updateUserInput.vm	1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<message type="input">$encoder.xmlEncode( $message )</message>
\ No newline at end of file

=== removed file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/updateUserSuccess.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/updateUserSuccess.vm	2010-03-30 02:59:14 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/updateUserSuccess.vm	1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<message type="success">$encoder.xmlEncode( $message )</message>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml	2012-10-11 16:23:03 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml	2012-10-11 17:21:32 +0000
@@ -860,11 +860,11 @@
     </action>
 
     <action name="updateUserAccount" class="org.hisp.dhis.useraccount.action.UpdateUserAccountAction">
-      <result name="success" type="velocity-xml">
-        /dhis-web-commons/useraccount/updateUserSuccess.vm
+      <result name="success" type="velocity-json">
+        /dhis-web-commons/ajax/jsonResponseSuccess.vm
       </result>
-      <result name="input" type="velocity-xml">
-        /dhis-web-commons/useraccount/updateUserInput.vm
+      <result name="error" type="velocity-json">
+        /dhis-web-commons/ajax/jsonResponseError.vm
       </result>
     </action>
 

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/profile.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/profile.vm	2012-10-11 16:02:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/profile.vm	2012-10-11 17:21:32 +0000
@@ -18,7 +18,7 @@
 <div class="userRow"><div class="userLabel">$i18n.getString( "interested_in" )</div><div class="userValue">$!encoder.htmlEncode( $user.jobTitle )</div></div>
 <div class="userRow"><div class="userLabel">$i18n.getString( "speaks" )</div><div class="userValue">$!encoder.htmlEncode( $user.languages )</div></div>
 <div class="userRow"><div class="userLabel">$i18n.getString( "birthday" )</div><div class="userValue">$!format.formatDate( $user.birthday )</div></div>
-<div class="userRow"><div class="userLabel">$i18n.getString( "gender" )</div><div class="userValue">$!i18n.getString( $user.gender )</div></div>
+<div class="userRow"><div class="userLabel">$i18n.getString( "gender" )</div><div class="userValue">#if( $user.gender )$i18n.getString( $user.gender )#end</div></div>
 <div class="userRow"><div class="userLabel">$i18n.getString( "nationality" )</div><div class="userValue">$!encoder.htmlEncode( $user.nationality )</div></div>
 <div class="userRow"><div class="userLabel">$i18n.getString( "email" )</div><div class="userValue">$!encoder.htmlEncode( $user.email )</div></div>
 <div class="userRow"><div class="userLabel">$i18n.getString( "phone_number" )</div><div class="userValue">$!encoder.htmlEncode( $user.phoneNumber )</div></div>