dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20028
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8996: mobile: support saving of gender and birthday in profile
------------------------------------------------------------
revno: 8996
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-11-13 14:15:01 +0100
message:
mobile: support saving of gender and birthday in profile
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java
dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm
dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/user-account.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-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java 2012-11-13 12:14:21 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java 2012-11-13 13:15:01 +0000
@@ -57,6 +57,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
@@ -72,6 +73,8 @@
private static final int MAX_OBJECTS = 50;
+ private static SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
+
@Autowired
private CurrentUserService currentUserService;
@@ -169,7 +172,7 @@
userAccount.setIntroduction( currentUser.getIntroduction() );
userAccount.setJobTitle( currentUser.getJobTitle() );
userAccount.setGender( currentUser.getGender() );
- // currentUser.setBirthday( currentUser.getBirthday() );
+ userAccount.setBirthday( simpleDateFormat.format( currentUser.getBirthday() ) );
userAccount.setNationality( currentUser.getNationality() );
userAccount.setEmployer( currentUser.getEmployer() );
userAccount.setEducation( currentUser.getEducation() );
@@ -201,7 +204,7 @@
currentUser.setIntroduction( userAccount.getIntroduction() );
currentUser.setJobTitle( userAccount.getJobTitle() );
currentUser.setGender( userAccount.getGender() );
- // currentUser.setBirthday( userAccount.getBirthday() );
+ currentUser.setBirthday( simpleDateFormat.parse( userAccount.getBirthday() ) );
currentUser.setNationality( userAccount.getNationality() );
currentUser.setEmployer( userAccount.getEmployer() );
currentUser.setEducation( userAccount.getEducation() );
=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm 2012-11-13 12:14:46 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm 2012-11-13 13:15:01 +0000
@@ -1,6 +1,6 @@
<!DOCTYPE html>
-<html manifest="app-cache">
-<!-- <html> -->
+<!-- <html manifest="app-cache"> -->
+<html>
<head>
<title>DHIS2</title>
=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/user-account.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/user-account.vm 2012-11-13 12:14:21 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/user-account.vm 2012-11-13 13:15:01 +0000
@@ -21,9 +21,9 @@
item.selected = item.value == data.gender;
});
- $('#genderInput').selectmenu('refresh')
+ $('#genderInput').selectmenu('refresh');
- // $('#birthdayInput').val(data.birthday);
+ $('#birthdayInput').val(data.birthday);
$('#nationalityInput').val(data.nationality);
$('#employerInput').val(data.employer);
$('#educationInput').val(data.education);