=== added directory 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/settings' === added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/settings/index.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/settings/index.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/settings/index.vm 2012-10-07 07:26:14 +0000 @@ -0,0 +1,14 @@ + + +

$i18n.getString( "settings" )

+ + + === added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/settings/settingsMenu.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/settings/settingsMenu.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/settings/settingsMenu.vm 2012-10-07 07:26:14 +0000 @@ -0,0 +1,5 @@ +

$i18n.getString( "user_settings" ) 

+ \ No newline at end of file === added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/settings/userGeneralSettings.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/settings/userGeneralSettings.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/settings/userGeneralSettings.vm 2012-10-07 07:26:14 +0000 @@ -0,0 +1,51 @@ +#if( $availableLocales ) + + +

$i18n.getString("user_general_settings") #openHelp( "userGeneralSettings" )

+ +

$i18n.getString( "language" )

+ + + +

$i18n.getString( "db_language" )

+ + + +

$i18n.getString( "style" )

+ + + +

$i18n.getString( "auto_save_data_entry_form" )

+ + +

+ +#end \ No newline at end of file === added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/settings/userMessageSettings.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/settings/userMessageSettings.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/settings/userMessageSettings.vm 2012-10-07 07:26:14 +0000 @@ -0,0 +1,23 @@ + + +

$i18n.getString( "user_message_settings" ) #openHelp( "userMessageSettings" )

+ +

$i18n.getString( "message_email_notification" )

+

+ +

$i18n.getString( "message_sms_notification" )

+

+ +

\ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.js 2012-06-05 19:47:24 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.js 2012-10-07 07:26:14 +0000 @@ -25,11 +25,16 @@ var currentPath = '../dhis-web-commons-about/'; var backURL = '?backUrl=' + window.location; + $( "#menuDropDownUserSettings" ).click( function() + { + window.location.href = currentPath + 'userSettings.action' + backURL; + }); + $( "#menuDropDownHelpCenter" ).click( function() { window.location.href = currentPath + 'help.action' + backURL; }); - + $( "#menuDropDownChangeLog" ).click( function() { window.location.href = currentPath + 'displayChangeLog.action' + backURL; === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm 2012-10-05 11:57:54 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm 2012-10-07 07:26:14 +0000 @@ -104,6 +104,7 @@ @@ -135,10 +136,10 @@ #else
- - - - + + + +
@@ -164,7 +165,7 @@
- $i18n.getString( 'close' ) + $i18n.getString( 'close' )
=== added directory 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/settings' === added directory 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/settings/user' === added directory 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/settings/user/action' === added file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/settings/user/action/GetGeneralSettingsAction.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/settings/user/action/GetGeneralSettingsAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/settings/user/action/GetGeneralSettingsAction.java 2012-10-07 07:26:14 +0000 @@ -0,0 +1,237 @@ +package org.hisp.dhis.settings.user.action; + +/* + * Copyright (c) 2004-2012, 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 static org.hisp.dhis.user.UserSettingService.AUTO_SAVE_DATA_ENTRY_FORM; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Locale; +import java.util.SortedMap; + +import org.hisp.dhis.i18n.I18nService; +import org.hisp.dhis.i18n.locale.LocaleManager; +import org.hisp.dhis.i18n.resourcebundle.ResourceBundleManager; +import org.hisp.dhis.setting.StyleManager; +import org.hisp.dhis.user.UserSettingService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * @version $ GetAvailableUserSettingsAction.java May 31, 2011 9:31:54 AM $ + * + */ +public class GetGeneralSettingsAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private ResourceBundleManager resourceBundleManager; + + public void setResourceBundleManager( ResourceBundleManager resourceBundleManager ) + { + this.resourceBundleManager = resourceBundleManager; + } + + private I18nService i18nService; + + public void setI18nService( I18nService i18nService ) + { + this.i18nService = i18nService; + } + + private LocaleManager localeManager; + + public void setLocaleManager( LocaleManager localeManager ) + { + this.localeManager = localeManager; + } + + private UserSettingService userSettingService; + + public void setUserSettingService( UserSettingService userSettingService ) + { + this.userSettingService = userSettingService; + } + + private StyleManager styleManager; + + public void setStyleManager( StyleManager styleManager ) + { + this.styleManager = styleManager; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private List availableLocales; + + public List getAvailableLocales() + { + return availableLocales; + } + + private Locale currentLocale; + + public Locale getCurrentLocale() + { + return currentLocale; + } + + private List availableLocalesDb; + + public List getAvailableLocalesDb() + { + return availableLocalesDb; + } + + private Locale currentLocaleDb; + + public Locale getCurrentLocaleDb() + { + return currentLocaleDb; + } + + private List sortOrders; + + public List getSortOrders() + { + return sortOrders; + } + + private String currentSortOrder; + + public String getCurrentSortOrder() + { + return currentSortOrder; + } + + private List chartsInDashboardOptions; + + public List getChartsInDashboardOptions() + { + return chartsInDashboardOptions; + } + + private List displayProperties; + + public List getDisplayProperties() + { + return displayProperties; + } + + private String currentDisplayProperty; + + public String getCurrentDisplayProperty() + { + return currentDisplayProperty; + } + + private Boolean autoSave; + + public Boolean getAutoSave() + { + return autoSave; + } + + private String currentStyle; + + public String getCurrentStyle() + { + return currentStyle; + } + + private SortedMap styles; + + public SortedMap getStyles() + { + return styles; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + public String execute() + throws Exception + { + // --------------------------------------------------------------------- + // Get available locales + // --------------------------------------------------------------------- + + availableLocales = new ArrayList( resourceBundleManager.getAvailableLocales() ); + + Collections.sort( availableLocales, new Comparator() + { + public int compare( Locale locale0, Locale locale1 ) + { + return locale0.getDisplayName().compareTo( locale1.getDisplayName() ); + } + } ); + + currentLocale = localeManager.getCurrentLocale(); + + // --------------------------------------------------------------------- + // Get available locales in db + // --------------------------------------------------------------------- + + availableLocalesDb = new ArrayList( i18nService.getAvailableLocales() ); + + Collections.sort( availableLocalesDb, new Comparator() + { + public int compare( Locale locale0, Locale locale1 ) + { + return locale0.getDisplayName().compareTo( locale1.getDisplayName() ); + } + } ); + + currentLocaleDb = i18nService.getCurrentLocale(); + + // --------------------------------------------------------------------- + // Get Auto-save data entry form + // --------------------------------------------------------------------- + + autoSave = (Boolean) userSettingService.getUserSetting( AUTO_SAVE_DATA_ENTRY_FORM, false ); + + // --------------------------------------------------------------------- + // Get styles + // --------------------------------------------------------------------- + + styles = styleManager.getStyles(); + + currentStyle = styleManager.getCurrentStyle(); + + return SUCCESS; + } +} === added file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/settings/user/action/GetMessageSettingsAction.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/settings/user/action/GetMessageSettingsAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/settings/user/action/GetMessageSettingsAction.java 2012-10-07 07:26:14 +0000 @@ -0,0 +1,90 @@ +package org.hisp.dhis.settings.user.action; + +/* + * Copyright (c) 2004-2012, 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 static org.hisp.dhis.user.UserSettingService.KEY_MESSAGE_EMAIL_NOTIFICATION; +import static org.hisp.dhis.user.UserSettingService.KEY_MESSAGE_SMS_NOTIFICATION; + +import org.hisp.dhis.user.UserSettingService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Dang Duy Hieu + * @version $Id$ + */ +public class GetMessageSettingsAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private UserSettingService userSettingService; + + public void setUserSettingService( UserSettingService userSettingService ) + { + this.userSettingService = userSettingService; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private Boolean messageEmailNotification; + + public Boolean getMessageEmailNotification() + { + return messageEmailNotification; + } + + private Boolean messageSmsNotification; + + public Boolean getMessageSmsNotification() + { + return messageSmsNotification; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + public String execute() + throws Exception + { + // --------------------------------------------------------------------- + // Get Message-email-notification + // --------------------------------------------------------------------- + + messageEmailNotification = (Boolean) userSettingService.getUserSetting( KEY_MESSAGE_EMAIL_NOTIFICATION, false ); + + messageSmsNotification = (Boolean) userSettingService.getUserSetting( KEY_MESSAGE_SMS_NOTIFICATION, false ); + + return SUCCESS; + } +} === added file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/settings/user/action/SetGeneralSettingsAction.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/settings/user/action/SetGeneralSettingsAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/settings/user/action/SetGeneralSettingsAction.java 2012-10-07 07:26:14 +0000 @@ -0,0 +1,175 @@ +package org.hisp.dhis.settings.user.action; + +/* + * Copyright (c) 2004-2012, 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 static org.hisp.dhis.user.UserSettingService.AUTO_SAVE_DATA_ENTRY_FORM; +import static org.hisp.dhis.user.UserSettingService.KEY_DB_LOCALE; + +import java.util.Locale; + +import org.apache.commons.lang.StringUtils; +import org.hisp.dhis.i18n.I18n; +import org.hisp.dhis.i18n.locale.LocaleManager; +import org.hisp.dhis.setting.StyleManager; +import org.hisp.dhis.user.UserSettingService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Dang Duy Hieu + * @version $Id$ + */ +public class SetGeneralSettingsAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private LocaleManager localeManager; + + public void setLocaleManager( LocaleManager localeManager ) + { + this.localeManager = localeManager; + } + + private StyleManager styleManager; + + public void setStyleManager( StyleManager styleManager ) + { + this.styleManager = styleManager; + } + + private UserSettingService userSettingService; + + public void setUserSettingService( UserSettingService userSettingService ) + { + this.userSettingService = userSettingService; + } + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private Boolean autoSave; + + public void setAutoSave( Boolean autoSave ) + { + this.autoSave = autoSave; + } + + private String currentLocale; + + public void setCurrentLocale( String locale ) + { + this.currentLocale = locale; + } + + private String currentLocaleDb; + + public void setCurrentLocaleDb( String currentLocaleDb ) + { + this.currentLocaleDb = currentLocaleDb; + } + + private String currentStyle; + + public void setCurrentStyle( String style ) + { + this.currentStyle = style; + } + + private String message; + + public String getMessage() + { + return message; + } + + private I18n i18n; + + public void setI18n( I18n i18n ) + { + this.i18n = i18n; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + public String execute() + throws Exception + { + localeManager.setCurrentLocale( getRespectiveLocale( currentLocale ) ); + + userSettingService.saveUserSetting( KEY_DB_LOCALE, getRespectiveLocale( StringUtils + .trimToNull( currentLocaleDb ) ) ); + + styleManager.setUserStyle( currentStyle ); + + userSettingService.saveUserSetting( AUTO_SAVE_DATA_ENTRY_FORM, autoSave ); + + message = i18n.getString( "settings_updated" ); + + return SUCCESS; + } + + // ------------------------------------------------------------------------- + // Supportive methods + // ------------------------------------------------------------------------- + + private Locale getRespectiveLocale( String locale ) + { + if ( locale == null ) + { + return null; + } + + String[] tokens = locale.split( "_" ); + Locale newLocale = null; + + switch ( tokens.length ) + { + case 1: + newLocale = new Locale( tokens[0] ); + break; + + case 2: + newLocale = new Locale( tokens[0], tokens[1] ); + break; + + case 3: + newLocale = new Locale( tokens[0], tokens[1], tokens[2] ); + break; + + default: + } + + return newLocale; + } +} === added file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/settings/user/action/SetMessageSettingsAction.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/settings/user/action/SetMessageSettingsAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/settings/user/action/SetMessageSettingsAction.java 2012-10-07 07:26:14 +0000 @@ -0,0 +1,102 @@ +package org.hisp.dhis.settings.user.action; + +/* + * Copyright (c) 2004-2012, 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 static org.hisp.dhis.user.UserSettingService.KEY_MESSAGE_EMAIL_NOTIFICATION; +import static org.hisp.dhis.user.UserSettingService.KEY_MESSAGE_SMS_NOTIFICATION; + +import org.hisp.dhis.i18n.I18n; +import org.hisp.dhis.user.UserSettingService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Dang Duy Hieu + */ +public class SetMessageSettingsAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private UserSettingService userSettingService; + + public void setUserSettingService( UserSettingService userSettingService ) + { + this.userSettingService = userSettingService; + } + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private Boolean messageEmailNotification; + + public void setMessageEmailNotification( Boolean messageEmailNotification ) + { + this.messageEmailNotification = messageEmailNotification; + } + + private Boolean messageSmsNotification; + + public void setMessageSmsNotification( Boolean messageSmsNotification ) + { + this.messageSmsNotification = messageSmsNotification; + } + + private String message; + + public String getMessage() + { + return message; + } + + private I18n i18n; + + public void setI18n( I18n i18n ) + { + this.i18n = i18n; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + public String execute() + throws Exception + { + userSettingService.saveUserSetting( KEY_MESSAGE_EMAIL_NOTIFICATION, messageEmailNotification ); + + userSettingService.saveUserSetting( KEY_MESSAGE_SMS_NOTIFICATION, messageSmsNotification ); + + message = i18n.getString( "settings_updated" ); + + return SUCCESS; + } +} === 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 2012-10-06 08:45:50 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml 2012-10-07 07:26:14 +0000 @@ -564,6 +564,8 @@ + + @@ -587,6 +589,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + === 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-06 08:45:50 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml 2012-10-07 07:26:14 +0000 @@ -887,6 +887,40 @@ /dhis-web-commons/about/menu.vm + + + + /main.vm + /dhis-web-commons/settings/index.vm + /dhis-web-commons/settings/settingsMenu.vm + + + + + /main.vm + /dhis-web-commons/settings/userGeneralSettings.vm + /dhis-web-commons/settings/settingsMenu.vm + + + + + /dhis-web-commons/ajax/jsonResponseSuccess.vm + plainTextError + + + + + + /main.vm + /dhis-web-commons/settings/userMessageSettings.vm + /dhis-web-commons/settings/settingsMenu.vm + + + + + /dhis-web-commons/ajax/jsonResponseSuccess.vm + plainTextError + + - === 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-07 03:21:33 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties 2012-10-07 07:26:14 +0000 @@ -311,7 +311,14 @@ interests=Interests languages=Languages update_user_profile_success=Profile was updated - +settings=Settings +user_settings=User settings +general=General +message=Message +user_general_settings=User General Settings +user_message_settings=User Message Settings +intro_user_general_settings=Customize the system with user specific settings for locale, style and more. +intro_user_message_settings=Customize the system with user specific settings for message email and sms notification. #-- Change Log------------------------------------------------------------------# change_log=Change Log === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global_vi_VN.properties' --- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global_vi_VN.properties 2012-10-07 03:21:33 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global_vi_VN.properties 2012-10-07 07:26:14 +0000 @@ -424,4 +424,11 @@ education=Tr\u00ecnh \u0111\u1ed9 interests=S\u1edf th\u00edch languages=Ng\u00f4n ng\u1eef -update_user_profile_success=Profile \u0111\u00e3 \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt \ No newline at end of file +update_user_profile_success=Profile \u0111\u00e3 \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt +intro_user_general_settings=T\u00f9y bi\u1ebfn h\u1ec7 th\u1ed1ng v\u1edbi c\u00e1c thi\u1ebft l\u1eadp ng\u01b0\u1eddi d\u00f9ng cho \u0111\u1ecbnh v\u1ecb, th\u1ee9 t\u1ef1 s\u1eafp x\u1ebfp, thu\u1ed9c t\u00ednh hi\u1ec3n th\u1ecb, c\u00e1ch th\u1ee9c v\u00e0 h\u01a1n n\u1eefa. +intro_user_message_settings=T\u00f9y ch\u1ec9nh h\u1ec7 th\u1ed1ng v\u1edbi c\u00e1c c\u00e0i \u0111\u1eb7t c\u1ee5 th\u1ec3 cho ng\u01b0\u1eddi d\u00f9ng \u0111\u1ed1i v\u1edbi c\u00e1c th\u00f4ng b\u00e1o qua th\u01b0 \u0111i\u1ec7n t\u1eed v\u00e0 tin nh\u1eafn sms. +user_message_settings=C\u00e0i \u0111\u1eb7t th\u00f4ng \u0111i\u1ec7p ng\u01b0\u1eddi d\u00f9ng +settings=C\u00e1c c\u00e0i \u0111\u1eb7t +user_settings=C\u00e0i \u0111\u1eb7t ng\u01b0\u1eddi d\u00f9ng +general=Thi\u1ebft l\u1eadp t\u1ed5ng qu\u00e1t +message=Th\u00f4ng \u0111i\u1ec7p \ No newline at end of file === removed directory 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user' === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetGeneralSettingsAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetGeneralSettingsAction.java 2012-06-05 22:03:24 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetGeneralSettingsAction.java 1970-01-01 00:00:00 +0000 @@ -1,237 +0,0 @@ -/* - * Copyright (c) 2004-2011, 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. - */ - -package org.hisp.dhis.settings.action.user; - -import static org.hisp.dhis.user.UserSettingService.AUTO_SAVE_DATA_ENTRY_FORM; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.Locale; -import java.util.SortedMap; - -import org.hisp.dhis.i18n.I18nService; -import org.hisp.dhis.i18n.locale.LocaleManager; -import org.hisp.dhis.i18n.resourcebundle.ResourceBundleManager; -import org.hisp.dhis.setting.StyleManager; -import org.hisp.dhis.user.UserSettingService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Chau Thu Tran - * @version $ GetAvailableUserSettingsAction.java May 31, 2011 9:31:54 AM $ - * - */ -public class GetGeneralSettingsAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ResourceBundleManager resourceBundleManager; - - public void setResourceBundleManager( ResourceBundleManager resourceBundleManager ) - { - this.resourceBundleManager = resourceBundleManager; - } - - private I18nService i18nService; - - public void setI18nService( I18nService i18nService ) - { - this.i18nService = i18nService; - } - - private LocaleManager localeManager; - - public void setLocaleManager( LocaleManager localeManager ) - { - this.localeManager = localeManager; - } - - private UserSettingService userSettingService; - - public void setUserSettingService( UserSettingService userSettingService ) - { - this.userSettingService = userSettingService; - } - - private StyleManager styleManager; - - public void setStyleManager( StyleManager styleManager ) - { - this.styleManager = styleManager; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private List availableLocales; - - public List getAvailableLocales() - { - return availableLocales; - } - - private Locale currentLocale; - - public Locale getCurrentLocale() - { - return currentLocale; - } - - private List availableLocalesDb; - - public List getAvailableLocalesDb() - { - return availableLocalesDb; - } - - private Locale currentLocaleDb; - - public Locale getCurrentLocaleDb() - { - return currentLocaleDb; - } - - private List sortOrders; - - public List getSortOrders() - { - return sortOrders; - } - - private String currentSortOrder; - - public String getCurrentSortOrder() - { - return currentSortOrder; - } - - private List chartsInDashboardOptions; - - public List getChartsInDashboardOptions() - { - return chartsInDashboardOptions; - } - - private List displayProperties; - - public List getDisplayProperties() - { - return displayProperties; - } - - private String currentDisplayProperty; - - public String getCurrentDisplayProperty() - { - return currentDisplayProperty; - } - - private Boolean autoSave; - - public Boolean getAutoSave() - { - return autoSave; - } - - private String currentStyle; - - public String getCurrentStyle() - { - return currentStyle; - } - - private SortedMap styles; - - public SortedMap getStyles() - { - return styles; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - // --------------------------------------------------------------------- - // Get available locales - // --------------------------------------------------------------------- - - availableLocales = new ArrayList( resourceBundleManager.getAvailableLocales() ); - - Collections.sort( availableLocales, new Comparator() - { - public int compare( Locale locale0, Locale locale1 ) - { - return locale0.getDisplayName().compareTo( locale1.getDisplayName() ); - } - } ); - - currentLocale = localeManager.getCurrentLocale(); - - // --------------------------------------------------------------------- - // Get available locales in db - // --------------------------------------------------------------------- - - availableLocalesDb = new ArrayList( i18nService.getAvailableLocales() ); - - Collections.sort( availableLocalesDb, new Comparator() - { - public int compare( Locale locale0, Locale locale1 ) - { - return locale0.getDisplayName().compareTo( locale1.getDisplayName() ); - } - } ); - - currentLocaleDb = i18nService.getCurrentLocale(); - - // --------------------------------------------------------------------- - // Get Auto-save data entry form - // --------------------------------------------------------------------- - - autoSave = (Boolean) userSettingService.getUserSetting( AUTO_SAVE_DATA_ENTRY_FORM, false ); - - // --------------------------------------------------------------------- - // Get styles - // --------------------------------------------------------------------- - - styles = styleManager.getStyles(); - - currentStyle = styleManager.getCurrentStyle(); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetMessageSettingsAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetMessageSettingsAction.java 2011-12-10 12:23:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetMessageSettingsAction.java 1970-01-01 00:00:00 +0000 @@ -1,91 +0,0 @@ -package org.hisp.dhis.settings.action.user; - -/* - * Copyright (c) 2004-2011, 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 static org.hisp.dhis.user.UserSettingService.KEY_MESSAGE_EMAIL_NOTIFICATION; -import static org.hisp.dhis.user.UserSettingService.KEY_MESSAGE_SMS_NOTIFICATION; - -import org.hisp.dhis.user.UserSettingService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Dang Duy Hieu - * @version $Id$ - * - */ -public class GetMessageSettingsAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private UserSettingService userSettingService; - - public void setUserSettingService( UserSettingService userSettingService ) - { - this.userSettingService = userSettingService; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private Boolean messageEmailNotification; - - public Boolean getMessageEmailNotification() - { - return messageEmailNotification; - } - - private Boolean messageSmsNotification; - - public Boolean getMessageSmsNotification() - { - return messageSmsNotification; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - // --------------------------------------------------------------------- - // Get Message-email-notification - // --------------------------------------------------------------------- - - messageEmailNotification = (Boolean) userSettingService.getUserSetting( KEY_MESSAGE_EMAIL_NOTIFICATION, false ); - - messageSmsNotification = (Boolean) userSettingService.getUserSetting( KEY_MESSAGE_SMS_NOTIFICATION, false ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetGeneralSettingsAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetGeneralSettingsAction.java 2012-06-05 22:03:24 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetGeneralSettingsAction.java 1970-01-01 00:00:00 +0000 @@ -1,157 +0,0 @@ -package org.hisp.dhis.settings.action.user; - -/* - * Copyright (c) 2004-2011, 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 static org.hisp.dhis.user.UserSettingService.AUTO_SAVE_DATA_ENTRY_FORM; -import static org.hisp.dhis.user.UserSettingService.KEY_DB_LOCALE; - -import java.util.Locale; - -import org.apache.commons.lang.StringUtils; -import org.hisp.dhis.i18n.locale.LocaleManager; -import org.hisp.dhis.setting.StyleManager; -import org.hisp.dhis.user.UserSettingService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Dang Duy Hieu - * @version $Id$ - */ -public class SetGeneralSettingsAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private LocaleManager localeManager; - - public void setLocaleManager( LocaleManager localeManager ) - { - this.localeManager = localeManager; - } - - private StyleManager styleManager; - - public void setStyleManager( StyleManager styleManager ) - { - this.styleManager = styleManager; - } - - private UserSettingService userSettingService; - - public void setUserSettingService( UserSettingService userSettingService ) - { - this.userSettingService = userSettingService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private Boolean autoSave; - - public void setAutoSave( Boolean autoSave ) - { - this.autoSave = autoSave; - } - - private String currentLocale; - - public void setCurrentLocale( String locale ) - { - this.currentLocale = locale; - } - - private String currentLocaleDb; - - public void setCurrentLocaleDb( String currentLocaleDb ) - { - this.currentLocaleDb = currentLocaleDb; - } - - private String currentStyle; - - public void setCurrentStyle( String style ) - { - this.currentStyle = style; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - localeManager.setCurrentLocale( getRespectiveLocale( currentLocale ) ); - - userSettingService.saveUserSetting( KEY_DB_LOCALE, getRespectiveLocale( StringUtils.trimToNull( currentLocaleDb ) ) ); - - styleManager.setUserStyle( currentStyle ); - - userSettingService.saveUserSetting( AUTO_SAVE_DATA_ENTRY_FORM, autoSave ); - - return SUCCESS; - } - - // ------------------------------------------------------------------------- - // Supportive methods - // ------------------------------------------------------------------------- - - private Locale getRespectiveLocale( String locale ) - { - if ( locale == null ) - { - return null; - } - - String[] tokens = locale.split( "_" ); - Locale newLocale = null; - - switch ( tokens.length ) - { - case 1: - newLocale = new Locale( tokens[0] ); - break; - - case 2: - newLocale = new Locale( tokens[0], tokens[1] ); - break; - - case 3: - newLocale = new Locale( tokens[0], tokens[1], tokens[2] ); - break; - - default: - } - - return newLocale; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetMessageSettingsAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetMessageSettingsAction.java 2011-12-10 12:23:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetMessageSettingsAction.java 1970-01-01 00:00:00 +0000 @@ -1,102 +0,0 @@ -package org.hisp.dhis.settings.action.user; - -/* - * Copyright (c) 2004-2011, 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 static org.hisp.dhis.user.UserSettingService.KEY_MESSAGE_EMAIL_NOTIFICATION; -import static org.hisp.dhis.user.UserSettingService.KEY_MESSAGE_SMS_NOTIFICATION; - -import org.hisp.dhis.i18n.I18n; -import org.hisp.dhis.user.UserSettingService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Dang Duy Hieu - */ -public class SetMessageSettingsAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private UserSettingService userSettingService; - - public void setUserSettingService( UserSettingService userSettingService ) - { - this.userSettingService = userSettingService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private Boolean messageEmailNotification; - - public void setMessageEmailNotification( Boolean messageEmailNotification ) - { - this.messageEmailNotification = messageEmailNotification; - } - - private Boolean messageSmsNotification; - - public void setMessageSmsNotification( Boolean messageSmsNotification ) - { - this.messageSmsNotification = messageSmsNotification; - } - - private String message; - - public String getMessage() - { - return message; - } - - private I18n i18n; - - public void setI18n( I18n i18n ) - { - this.i18n = i18n; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - userSettingService.saveUserSetting( KEY_MESSAGE_EMAIL_NOTIFICATION, messageEmailNotification ); - - userSettingService.saveUserSetting( KEY_MESSAGE_SMS_NOTIFICATION, messageSmsNotification ); - - message = i18n.getString( "settings_updated" ); - - return SUCCESS; - } -} === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/META-INF/dhis/beans.xml 2012-06-27 16:54:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/META-INF/dhis/beans.xml 2012-10-07 07:26:14 +0000 @@ -53,56 +53,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties 2012-09-27 17:19:33 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties 2012-10-07 07:26:14 +0000 @@ -10,7 +10,6 @@ host_name=Host name username=User name password=Password -user_settings=User settings application_title=Application title dhis-web-maintenance-settings=Settings settings=Settings @@ -67,13 +66,9 @@ portal=Portal start_page=Start page no_start_page=No start page -intro_user_general_settings=Customize the system with user specific settings for locale, style and more. -intro_user_message_settings=Customize the system with user specific settings for message email and sms notification. intro_system_general_settings=Customize the system behavior with regard to aggregation strategy, infrastructural data elements and more. intro_system_appearance_settings=Customize the system behavior with regard to application title, style, flag, start page. intro_system_email_settings=Configure the email SMTP setup with regard to host name, user name and password. -user_general_settings=User General Settings -user_message_settings=User Message Settings system_general_settings=System General Settings system_appearance_settings=System Appearance Settings system_email_settings=System Email Settings === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module_vi_VN.properties' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module_vi_VN.properties 2012-04-25 15:07:51 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module_vi_VN.properties 2012-10-07 07:26:14 +0000 @@ -70,7 +70,6 @@ background_color_in_menu=M\u00e0u n\u1ec1n c\u1ee7a thanh c\u00f4ng c\u1ee5 set_left_background_color=M\u00e0u n\u1ec1n b\u00ean tr\u00e1i feedback_recipients=Ph\u00e0n h\u1ed3i c\u1ee7a ng\u01b0\u1eddi nh\u1eadn -general=Thi\u1ebft l\u1eadp t\u1ed5ng qu\u00e1t system_general_settings=C\u00e1c thi\u1ebft l\u1eadp chung cho h\u1ec7 th\u1ed1ng delete_left_background_color=X\u00f3a m\u00e0u n\u1ec1n b\u00ean tr\u00e1i benin=Benin @@ -83,7 +82,6 @@ password=M\u1eadt kh\u1ea9u blue=M\u00f9a xanh sri_lanka=Sri-lan-ka -intro_user_general_settings=T\u00f9y bi\u1ebfn h\u1ec7 th\u1ed1ng v\u1edbi c\u00e1c thi\u1ebft l\u1eadp ng\u01b0\u1eddi d\u00f9ng cho \u0111\u1ecbnh v\u1ecb, th\u1ee9 t\u1ef1 s\u1eafp x\u1ebfp, thu\u1ed9c t\u00ednh hi\u1ec3n th\u1ecb, c\u00e1ch th\u1ee9c v\u00e0 h\u01a1n n\u1eefa. max_attempts=S\u1ed1 ng\u01b0\u1eddi d\u00f9ng t\u1ed1i \u0111a \u0111\u0103ng nh\u1eadp dhis-web-reporting=C\u00e1c b\u00e1o c\u00e1o store_background_color_in_menu=L\u01b0u m\u00e0u n\u1ec1n c\u1ee7a tr\u00ecnh \u0111\u01a1n @@ -100,7 +98,6 @@ intro_system_email_settings=Thi\u1ebft l\u1eadp h\u1ec7 th\u1ed1ng v\u1ec1 th\u01b0 \u0111i\u1ec7n t\u1eed. macos=H\u1ec7 \u0111i\u1ec1u h\u00e0nh Mac guinea_bissau=Guinea Bissau -settings=C\u00e1c c\u00e0i \u0111\u1eb7t color_scheme=M\u1eabu m\u00e0u choose_sort_order=Ch\u1ecdn th\u1ee9 t\u1ef1 s\u1eafp x\u1ebfp regular=B\u00ecnh th\u01b0\u1eddng @@ -152,7 +149,6 @@ namibia=Na-mi-bi-a data_dictionary_mode=Ch\u1ebf \u0111\u1ed9 t\u1eeb \u0111i\u1ec3n d\u1eef li\u1ec7u message_email_notification=Th\u00f4ng b\u00e1o tin nh\u1eafn qua th\u01b0 \u0111i\u1ec7n t\u1eed -user_settings=C\u00e0i \u0111\u1eb7t ng\u01b0\u1eddi d\u00f9ng tanzania=Tan-za-ni-a language=Ng\u00f4n ng\u1eef giao di\u1ec7n ghana=Ga-na @@ -166,9 +162,6 @@ norway=Na uy togo=T\u00f4-g\u00f4 flag=C\u1edd qu\u1ed1c gia -intro_user_message_settings=T\u00f9y ch\u1ec9nh h\u1ec7 th\u1ed1ng v\u1edbi c\u00e1c c\u00e0i \u0111\u1eb7t c\u1ee5 th\u1ec3 cho ng\u01b0\u1eddi d\u00f9ng \u0111\u1ed1i v\u1edbi c\u00e1c th\u00f4ng b\u00e1o qua th\u01b0 \u0111i\u1ec7n t\u1eed v\u00e0 tin nh\u1eafn sms. -user_message_settings=C\u00e0i \u0111\u1eb7t th\u00f4ng \u0111i\u1ec7p ng\u01b0\u1eddi d\u00f9ng -message=Th\u00f4ng \u0111i\u1ec7p message_sms_notification=Th\u00f4ng b\u00e1o sms use_db_locale_no_translation=D\u00f9ng c\u01a1 s\u1edf d\u1eef li\u1ec7u \u0111\u1ecba ph\u01b0\u01a1ng / kh\u00f4ng bi\u00ean d\u1ecbch -system_overview=System overview +system_overview=System overview \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/struts.xml 2011-12-10 12:23:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/struts.xml 2012-10-07 07:26:14 +0000 @@ -59,35 +59,6 @@ /dhis-web-commons/ajax/jsonResponseSuccess.vm plainTextError - - - - - - /main.vm - /dhis-web-maintenance-settings/userGeneralSettings.vm - /dhis-web-maintenance-settings/settingsMenu.vm - - - - - /dhis-web-commons/ajax/jsonResponseSuccess.vm - plainTextError - - - - - - /main.vm - /dhis-web-maintenance-settings/userMessageSettings.vm - /dhis-web-maintenance-settings/settingsMenu.vm - - - - - /dhis-web-commons/ajax/jsonResponseSuccess.vm - plainTextError - === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/index.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/index.vm 2012-03-04 13:26:24 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/index.vm 2012-10-07 07:26:14 +0000 @@ -8,8 +8,6 @@

$i18n.getString( "dhis-web-maintenance-settings" )

    - #introListImgItem( "userGeneralSettings.action" "user_general_settings" "usersettings" ) - #introListImgItem( "userMessageSettings.action" "user_message_settings" "usersettings" ) #introListImgItem( "systemGeneralSettings.action" "system_general_settings" "systemsettings" ) #introListImgItem( "systemAppearanceSettings.action" "system_appearance_settings" "systemsettings" ) #introListImgItem( "systemEmailSettings.action" "system_email_settings" "systemsettings" ) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/settingsMenu.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/settingsMenu.vm 2011-12-15 14:08:46 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/settingsMenu.vm 2012-10-07 07:26:14 +0000 @@ -1,9 +1,3 @@ -

    $i18n.getString( "user_settings" ) 

    - -

    $i18n.getString( "system_settings" ) 

    • $i18n.getString( "general" ) 
    • === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/userGeneralSettings.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/userGeneralSettings.vm 2012-06-05 22:03:24 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/userGeneralSettings.vm 1970-01-01 00:00:00 +0000 @@ -1,51 +0,0 @@ -#if( $availableLocales ) - - -

      $i18n.getString("user_general_settings") #openHelp( "userGeneralSettings" )

      - -

      $i18n.getString( "language" )

      - - - -

      $i18n.getString( "db_language" )

      - - - -

      $i18n.getString( "style" )

      - - - -

      $i18n.getString( "auto_save_data_entry_form" )

      - - -

      - -#end \ No newline at end of file === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/userMessageSettings.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/userMessageSettings.vm 2012-04-16 12:26:55 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/userMessageSettings.vm 1970-01-01 00:00:00 +0000 @@ -1,23 +0,0 @@ - - -

      $i18n.getString( "user_message_settings" ) #openHelp( "userMessageSettings" )

      - -

      $i18n.getString( "message_email_notification" )

      -

      - -

      $i18n.getString( "message_sms_notification" )

      -

      - -

      \ No newline at end of file