=== added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObjectUtils.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObjectUtils.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObjectUtils.java 2011-06-17 13:22:05 +0000 @@ -0,0 +1,66 @@ +package org.hisp.dhis.common; + +/* + * Copyright (c) 2004-2010, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the HISP project nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import java.util.Collection; +import java.util.Iterator; + +/** + * @author Lars Helge Overland + */ +public class IdentifiableObjectUtils +{ + private static final String SEPARATOR_JOIN = ", "; + + /** + * Joins the names of the IdentifiableObjects in the given list and separates + * them with a comma and space. Returns null if the given list is null or has + * no elements. + * + * @param objects the list of IdentifiableObjects. + * @return the joined string. + */ + public static String join( Collection objects ) + { + if ( objects != null && objects.size() > 0 ) + { + Iterator iterator = objects.iterator(); + + StringBuilder builder = new StringBuilder( iterator.next().getName() ); + + while ( iterator.hasNext() ) + { + builder.append( SEPARATOR_JOIN ).append( iterator.next().getName() ); + } + + return builder.toString(); + } + + return null; + } +} === 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-11 08:15:29 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java 2011-06-17 11:38:43 +0000 @@ -33,6 +33,7 @@ import java.util.Set; import org.apache.commons.collections.CollectionUtils; +import org.hisp.dhis.common.IdentifiableObjectUtils; import org.hisp.dhis.organisationunit.OrganisationUnit; /** @@ -175,6 +176,11 @@ return !CollectionUtils.isEmpty( organisationUnits ); } + public String getOrganisationUnitsName() + { + return IdentifiableObjectUtils.join( organisationUnits ); + } + // ------------------------------------------------------------------------- // Getters and setters // ------------------------------------------------------------------------- === added 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 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonUser.vm 2011-06-17 13:22:05 +0000 @@ -0,0 +1,10 @@ +{ "user": + { + "id": ${user.id}, + "surname": "$!encoder.jsonEncode( ${user.surname} )", + "firstName": "$!encoder.jsonEncode( ${user.firstName} )", + "email": "$!encoder.jsonEncode( ${user.email} )", + "phoneNumber": "$!encoder.jsonEncode( ${user.phoneNumber} )", + "organisationUnits": "$!encoder.jsonEncode( ${user.organisationUnitsName} )" + } +} \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css 2011-06-16 08:08:02 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css 2011-06-17 10:58:25 +0000 @@ -6,7 +6,7 @@ * { font-family: LiberationSansRegular, arial; - line-height: 135%; + line-height: 140%; } html,body === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupSetAction.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupSetAction.java 2011-05-28 21:04:47 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupSetAction.java 2011-06-17 11:38:43 +0000 @@ -67,8 +67,11 @@ return dataElementGroupSet; } + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + public String execute() - throws Exception { if ( id != null ) { === added file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetUserAction.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetUserAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetUserAction.java 2011-06-17 13:22:05 +0000 @@ -0,0 +1,84 @@ +package org.hisp.dhis.commons.action; + +/* + * Copyright (c) 2004-2010, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the HISP project nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import org.hisp.dhis.user.User; +import org.hisp.dhis.user.UserService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Lars Helge Overland + */ +public class GetUserAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private UserService userService; + + public void setUserService( UserService userService ) + { + this.userService = userService; + } + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private Integer id; + + public void setId( Integer id ) + { + this.id = id; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private User user; + + public User getUser() + { + return user; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + public String execute() + { + user = userService.getUser( id ); + + return SUCCESS; + } +} === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetUsersAction.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetUsersAction.java 2011-05-28 21:04:47 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetUsersAction.java 2011-06-17 10:58:25 +0000 @@ -37,7 +37,7 @@ import org.hisp.dhis.user.UserService; import org.hisp.dhis.user.comparator.UserComparator; -/* +/** * @author mortenoh */ public class GetUsersAction === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml 2011-06-16 08:08:02 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml 2011-06-17 11:38:43 +0000 @@ -258,10 +258,10 @@ - + - + @@ -296,7 +296,7 @@ - + @@ -320,7 +320,13 @@ - + + + + + === 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 2011-06-16 08:08:02 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml 2011-06-17 11:38:43 +0000 @@ -397,24 +397,27 @@ + + + /dhis-web-commons/ajax/jsonUser.vm + plainTextError + + - /dhis-web-commons/ajax/jsonUsers.vm - + /dhis-web-commons/ajax/jsonUsers.vm plainTextError - /dhis-web-commons/ajax/jsonUserGroups.vm - + /dhis-web-commons/ajax/jsonUserGroups.vm plainTextError - /dhis-web-commons/ajax/jsonValidationRules.vm - + /dhis-web-commons/ajax/jsonValidationRules.vm plainTextError === modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml 2011-06-09 14:46:45 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml 2011-06-17 13:22:05 +0000 @@ -91,7 +91,7 @@ /main.vm /dhis-web-dashboard-integration/readMessage.vm /dhis-web-dashboard-integration/menu.vm - javascript/message.js + javascript/readMessage.js style/dashboard.css @@ -105,9 +105,14 @@ plainTextError - + message.action + + /dhis-web-dashboard-integration/getUserInfo.vm + plainTextError + + === added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/getUserInfo.vm' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/getUserInfo.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/getUserInfo.vm 2011-06-17 13:22:05 +0000 @@ -0,0 +1,15 @@ +

$user.name

+ + + + + + + + + + + + + +
$!encoder.htmlEncode( ${user.email} )
$!encoder.htmlEncode( ${user.phoneNumber} )
$!encoder.htmlEncode( ${user.organisationUnitsName} )
\ 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-04-11 15:07:08 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js 2011-06-17 13:22:05 +0000 @@ -7,4 +7,4 @@ function read( id ) { window.location.href = "readMessage.action?id=" + id; -} \ No newline at end of file +} === added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/readMessage.js' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/readMessage.js 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/readMessage.js 2011-06-17 13:22:05 +0000 @@ -0,0 +1,19 @@ + +var dialog = null; + +$( document ).ready( function() { + + dialog = $( "#senderInfo" ).dialog( { + modal: true, + autoOpen: false, + width: 300, + height: 250, + title: "Sender" } ); +} ); + +function showSenderInfo( id ) +{ + $( "#senderInfo" ).load( "getUserInfo.action", { id:id }, function() { + dialog.dialog( "open" ); + } ); +} === modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/mainForm.vm' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/mainForm.vm 2011-06-14 19:13:54 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/mainForm.vm 2011-06-17 10:58:25 +0000 @@ -43,7 +43,7 @@

$i18n.getString( "dashboard" ) • $i18n.getString( "write_feedback" ) -#if( $messageCount > 0 )• $messageCount #if( $messageCount > 1 )$i18n.getString( "unread_messages" )#else$i18n.getString( "unread_message" )#end! #end

+#if( $messageCount > 0 )• $messageCount #if( $messageCount > 1 )$i18n.getString( "unread_messages" )#else$i18n.getString( "unread_message" )#end #end === 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-06-12 10:33:24 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/readMessage.vm 2011-06-17 13:22:05 +0000 @@ -1,7 +1,7 @@

$encoder.htmlEncode( $message.message.subject )

-
$encoder.htmlEncode( $message.message.sender.name )  +
$encoder.htmlEncode( $message.message.sender.name )  $format.formatDate( $message.messageDate )
$encoder.htmlEncode( $message.message.text )
@@ -10,4 +10,6 @@ -
\ No newline at end of file + + +