← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4480: Added username to sender info in messages

 

------------------------------------------------------------
revno: 4480
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-08-29 23:12:03 +0200
message:
  Added username to sender info in messages
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonUser.vm
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/readMessage.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-api/src/main/java/org/hisp/dhis/user/User.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java	2011-06-17 11:38:43 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java	2011-08-29 21:12:03 +0000
@@ -181,6 +181,11 @@
         return IdentifiableObjectUtils.join( organisationUnits );
     }
     
+    public String getUsername()
+    {
+        return userCredentials != null ? userCredentials.getUsername() : null;
+    }
+    
     // -------------------------------------------------------------------------
     // Getters and setters
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonUser.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonUser.vm	2011-06-17 13:22:05 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonUser.vm	2011-08-29 21:12:03 +0000
@@ -3,6 +3,7 @@
     "id": ${user.id},
     "surname": "$!encoder.jsonEncode( ${user.surname} )",
     "firstName": "$!encoder.jsonEncode( ${user.firstName} )",
+    "username": "$!encoder.jsonEncode( ${user.username} )",
     "email": "$!encoder.jsonEncode( ${user.email} )",
     "phoneNumber": "$!encoder.jsonEncode( ${user.phoneNumber} )",
     "organisationUnits": "$!encoder.jsonEncode( ${user.organisationUnitsName} )"

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties	2011-08-04 11:22:31 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties	2011-08-29 21:12:03 +0000
@@ -35,4 +35,5 @@
 discard = Discard
 enter_subject = Please enter a subject
 enter_text = Please enter text
-reply = Reply
\ No newline at end of file
+reply = Reply
+username = Username
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js	2011-08-04 11:22:31 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js	2011-08-29 21:12:03 +0000
@@ -41,6 +41,7 @@
 	$.getJSON( "../dhis-web-commons-ajax-json/getUser.action", { id:id }, function( json ) {
 		$( "#senderName" ).html( json.user.firstName + " " + json.user.surname );
 		$( "#senderEmail" ).html( json.user.email );
+		$( "#senderUsername" ).html( json.user.username );
 		$( "#senderPhoneNumber" ).html( json.user.phoneNumber );
 		$( "#senderOrganisationUnits" ).html( json.user.organisationUnits );
 		

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/readMessage.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/readMessage.vm	2011-08-04 11:22:31 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/readMessage.vm	2011-08-29 21:12:03 +0000
@@ -11,6 +11,10 @@
 <td><span id="senderEmail"></span></td>
 </tr>
 <tr>
+<td><label>$i18n.getString( "username" ):</label></td>
+<td><span id="senderUsername"></span></td>
+</tr>
+<tr>
 <td><label>$i18n.getString( "phone_number" ):</label></td>
 <td><span id="senderPhoneNumber"></span></td>
 </tr>