dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19869
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8846: Included employer in account form
------------------------------------------------------------
revno: 8846
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2012-11-03 23:19:30 +0300
message:
Included employer in account form
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AccountController.java
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/account.css
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/account.js
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/resources/i18n_global.properties
--
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/AccountController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AccountController.java 2012-10-30 14:45:03 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AccountController.java 2012-11-03 20:19:30 +0000
@@ -177,6 +177,7 @@
@RequestParam String password,
@RequestParam String email,
@RequestParam String phoneNumber,
+ @RequestParam String employer,
@RequestParam( value = "recaptcha_challenge_field" ) String recapChallenge,
@RequestParam( value = "recaptcha_response_field" ) String recapResponse,
HttpServletRequest request,
@@ -200,6 +201,7 @@
password = StringUtils.trimToNull( password );
email = StringUtils.trimToNull( email );
phoneNumber = StringUtils.trimToNull( phoneNumber );
+ employer = StringUtils.trimToNull( employer );
recapChallenge = StringUtils.trimToNull( recapChallenge );
recapResponse = StringUtils.trimToNull( recapResponse );
@@ -251,6 +253,12 @@
return "Email is not specified or invalid";
}
+ if ( employer == null || employer.trim().length() > MAX_LENGTH )
+ {
+ response.setStatus( HttpServletResponse.SC_BAD_REQUEST );
+ return "Employer is not specified or invalid";
+ }
+
if ( recapChallenge == null )
{
response.setStatus( HttpServletResponse.SC_BAD_REQUEST );
@@ -298,6 +306,7 @@
user.setSurname( surname );
user.setEmail( email );
user.setPhoneNumber( phoneNumber );
+ user.setEmployer( employer );
credentials = new UserCredentials();
credentials.setUsername( username );
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/account.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/account.css 2012-10-23 10:26:43 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/account.css 2012-11-03 20:19:30 +0000
@@ -31,7 +31,6 @@
{
position: relative;
width: 600px;
- height: 760px;
margin-left: auto;
margin-right: auto;
}
@@ -39,7 +38,7 @@
#accountInput
{
position: relative;
- padding-top: 65px;
+ padding-top: 50px;
}
h3
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/account.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/account.js 2012-10-30 06:50:49 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/account.js 2012-11-03 20:19:30 +0000
@@ -27,6 +27,10 @@
required: true,
email: true,
rangelength: [ 4, 80 ]
+ },
+ employer: {
+ required: true,
+ rangelength: [ 2, 80 ]
}
}
};
=== 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 2012-10-23 15:01:19 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/account.vm 2012-11-03 20:19:30 +0000
@@ -36,7 +36,7 @@
</tr>
<tr>
<td><label for="password">$i18n.getString( "password" )</label></td>
- <td><input type="password" id="password" name="password" autocomplete="off"></td>
+ <td><input type="password" id="password" name="password" autocomplete="off" placeholder="$i18n.getString( 'password_hint' )"></td>
</tr>
<tr>
<td><label for="retypePassword">$i18n.getString( "confirm_password" )</label></td>
@@ -48,7 +48,11 @@
</tr>
<tr>
<td><label for="phoneNumber">$i18n.getString( "mobile_phone" )</label></td>
- <td style="padding-bottom: 5px"><input type="text" id="phoneNumber" name="phoneNumber"></td>
+ <td style="padding-bottom: 5px"><input type="text" id="phoneNumber" name="phoneNumber" placeholder="$i18n.getString( 'optional' )"></td>
+ </tr>
+ <tr>
+ <td><label for="employer">$i18n.getString( "employer" )</label></td>
+ <td style="padding-bottom: 5px"><input type="text" id="employer" name="employer"></td>
</tr>
<tr>
<td><label>$i18n.getString( "prove_you_are_not_a_robot" )</label></td>
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties 2012-10-30 07:18:35 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties 2012-11-03 20:19:30 +0000
@@ -133,6 +133,8 @@
account_recovery=Account recovery
recover=Recover
code_from_email=Code from email
+password_hint=Minimum 8 characters, 1 upper-case and 1 digit
+optional=Optional
#-- PeriodTypes ----------------------------------------------------------------#