dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #14365
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4858: User settings - Implemented a new setting called "Message email notification".
------------------------------------------------------------
revno: 4858
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-10-06 16:36:05 +0700
message:
User settings - Implemented a new setting called "Message email notification".
removed:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableUserSettingsAction.java
added:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetEmailSettingsAction.java
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/SetEmailSettingsAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/userEmailSettings.vm
modified:
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/resources/META-INF/dhis/beans.xml
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_vi_VN.properties
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/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/settingsMenu.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
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableUserSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableUserSettingsAction.java 2011-10-06 08:48:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableUserSettingsAction.java 1970-01-01 00:00:00 +0000
@@ -1,290 +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.DEFAULT_CHARTS_IN_DASHBOARD;
-import static org.hisp.dhis.user.UserSettingService.KEY_CHARTS_IN_DASHBOARD;
-
-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.options.displayproperty.DisplayPropertyManager;
-import org.hisp.dhis.options.sortorder.SortOrderManager;
-import org.hisp.dhis.options.style.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 GetAvailableUserSettingsAction
- 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 SortOrderManager sortOrderManager;
-
- public void setSortOrderManager( SortOrderManager sortOrderManager )
- {
- this.sortOrderManager = sortOrderManager;
- }
-
- private UserSettingService userSettingService;
-
- public void setUserSettingService( UserSettingService userSettingService )
- {
- this.userSettingService = userSettingService;
- }
-
- private StyleManager styleManager;
-
- public void setStyleManager( StyleManager styleManager )
- {
- this.styleManager = styleManager;
- }
-
- private DisplayPropertyManager displayPropertyManager;
-
- public void setDisplayPropertyManager( DisplayPropertyManager displayPropertyManager )
- {
- this.displayPropertyManager = displayPropertyManager;
- }
-
- // -------------------------------------------------------------------------
- // Output
- // -------------------------------------------------------------------------
-
- private List<Locale> availableLocales;
-
- public List<Locale> getAvailableLocales()
- {
- return availableLocales;
- }
-
- private Locale currentLocale;
-
- public Locale getCurrentLocale()
- {
- return currentLocale;
- }
-
- private List<Locale> availableLocalesDb;
-
- public List<Locale> getAvailableLocalesDb()
- {
- return availableLocalesDb;
- }
-
- private Locale currentLocaleDb;
-
- public Locale getCurrentLocaleDb()
- {
- return currentLocaleDb;
- }
-
- private List<String> sortOrders;
-
- public List<String> getSortOrders()
- {
- return sortOrders;
- }
-
- private String currentSortOrder;
-
- public String getCurrentSortOrder()
- {
- return currentSortOrder;
- }
-
- private Integer chartsInDashboard;
-
- public Integer getChartsInDashboard()
- {
- return chartsInDashboard;
- }
-
- private List<Integer> chartsInDashboardOptions;
-
- public List<Integer> getChartsInDashboardOptions()
- {
- return chartsInDashboardOptions;
- }
-
- private List<String> displayProperties;
-
- public List<String> 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<String, String> styles;
-
- public SortedMap<String, String> getStyles()
- {
- return styles;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- throws Exception
- {
- // ---------------------------------------------------------------------
- // Get available locales
- // ---------------------------------------------------------------------
-
- availableLocales = new ArrayList<Locale>( resourceBundleManager.getAvailableLocales() );
-
- Collections.sort( availableLocales, new Comparator<Locale>()
- {
- public int compare( Locale locale0, Locale locale1 )
- {
- return locale0.getDisplayName().compareTo( locale1.getDisplayName() );
- }
- } );
-
- currentLocale = localeManager.getCurrentLocale();
-
- // ---------------------------------------------------------------------
- // Get available locales in db
- // ---------------------------------------------------------------------
-
- availableLocalesDb = new ArrayList<Locale>( i18nService.getAvailableLocales() );
-
- if ( !availableLocales.contains( localeManager.getFallbackLocale() ) )
- {
- availableLocales.add( localeManager.getFallbackLocale() );
- }
-
- Collections.sort( availableLocales, new Comparator<Locale>()
- {
- public int compare( Locale locale0, Locale locale1 )
- {
- return locale0.getDisplayName().compareTo( locale1.getDisplayName() );
- }
- } );
-
- currentLocaleDb = localeManager.getCurrentLocale();
-
- // ---------------------------------------------------------------------
- // Get Sort orders
- // ---------------------------------------------------------------------
-
- sortOrders = sortOrderManager.getSortOrders();
-
- currentSortOrder = sortOrderManager.getCurrentSortOrder();
-
- // ---------------------------------------------------------------------
- // Get Charts in Dashboard
- // ---------------------------------------------------------------------
-
- chartsInDashboard = (Integer) userSettingService.getUserSetting( KEY_CHARTS_IN_DASHBOARD, DEFAULT_CHARTS_IN_DASHBOARD );
-
- chartsInDashboardOptions = UserSettingService.DASHBOARD_CHARTS_TO_DISPLAY;
-
- // ---------------------------------------------------------------------
- // Get Display Properties
- // ---------------------------------------------------------------------
-
- displayProperties = displayPropertyManager.getDisplayProperties();
-
- currentDisplayProperty = displayPropertyManager.getCurrentDisplayProperty();
-
- // ---------------------------------------------------------------------
- // Get Auto-save data entry form
- // ---------------------------------------------------------------------
-
- autoSave = (Boolean) userSettingService.getUserSetting( UserSettingService.AUTO_SAVE_DATA_ENTRY_FORM, false );
-
- // ---------------------------------------------------------------------
- // Get styles
- // ---------------------------------------------------------------------
-
- styles = styleManager.getStyles();
-
- currentStyle = styleManager.getCurrentStyle();
-
- return SUCCESS;
- }
-}
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetEmailSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetEmailSettingsAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetEmailSettingsAction.java 2011-10-06 09:36:05 +0000
@@ -0,0 +1,86 @@
+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 java.util.List;
+import java.util.Locale;
+import java.util.SortedMap;
+
+import org.hisp.dhis.user.UserSettingService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Dang Duy Hieu
+ * @version $Id$
+ *
+ */
+public class GetEmailSettingsAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private UserSettingService userSettingService;
+
+ public void setUserSettingService( UserSettingService userSettingService )
+ {
+ this.userSettingService = userSettingService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Output
+ // -------------------------------------------------------------------------
+
+ private Boolean messageEmailNotification;
+
+ public Boolean getMessageEmailNotification()
+ {
+ return messageEmailNotification;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ public String execute()
+ throws Exception
+ {
+ // ---------------------------------------------------------------------
+ // Get Message-email-notification
+ // ---------------------------------------------------------------------
+
+ messageEmailNotification = (Boolean) userSettingService.getUserSetting( KEY_MESSAGE_EMAIL_NOTIFICATION, false );
+
+ return SUCCESS;
+ }
+}
=== added 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 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetGeneralSettingsAction.java 2011-10-06 09:36:05 +0000
@@ -0,0 +1,292 @@
+/*
+ * 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 static org.hisp.dhis.user.UserSettingService.DEFAULT_CHARTS_IN_DASHBOARD;
+import static org.hisp.dhis.user.UserSettingService.KEY_CHARTS_IN_DASHBOARD;
+
+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.options.displayproperty.DisplayPropertyManager;
+import org.hisp.dhis.options.sortorder.SortOrderManager;
+import org.hisp.dhis.options.style.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 SortOrderManager sortOrderManager;
+
+ public void setSortOrderManager( SortOrderManager sortOrderManager )
+ {
+ this.sortOrderManager = sortOrderManager;
+ }
+
+ private UserSettingService userSettingService;
+
+ public void setUserSettingService( UserSettingService userSettingService )
+ {
+ this.userSettingService = userSettingService;
+ }
+
+ private StyleManager styleManager;
+
+ public void setStyleManager( StyleManager styleManager )
+ {
+ this.styleManager = styleManager;
+ }
+
+ private DisplayPropertyManager displayPropertyManager;
+
+ public void setDisplayPropertyManager( DisplayPropertyManager displayPropertyManager )
+ {
+ this.displayPropertyManager = displayPropertyManager;
+ }
+
+ // -------------------------------------------------------------------------
+ // Output
+ // -------------------------------------------------------------------------
+
+ private List<Locale> availableLocales;
+
+ public List<Locale> getAvailableLocales()
+ {
+ return availableLocales;
+ }
+
+ private Locale currentLocale;
+
+ public Locale getCurrentLocale()
+ {
+ return currentLocale;
+ }
+
+ private List<Locale> availableLocalesDb;
+
+ public List<Locale> getAvailableLocalesDb()
+ {
+ return availableLocalesDb;
+ }
+
+ private Locale currentLocaleDb;
+
+ public Locale getCurrentLocaleDb()
+ {
+ return currentLocaleDb;
+ }
+
+ private List<String> sortOrders;
+
+ public List<String> getSortOrders()
+ {
+ return sortOrders;
+ }
+
+ private String currentSortOrder;
+
+ public String getCurrentSortOrder()
+ {
+ return currentSortOrder;
+ }
+
+ private Integer chartsInDashboard;
+
+ public Integer getChartsInDashboard()
+ {
+ return chartsInDashboard;
+ }
+
+ private List<Integer> chartsInDashboardOptions;
+
+ public List<Integer> getChartsInDashboardOptions()
+ {
+ return chartsInDashboardOptions;
+ }
+
+ private List<String> displayProperties;
+
+ public List<String> 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<String, String> styles;
+
+ public SortedMap<String, String> getStyles()
+ {
+ return styles;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ public String execute()
+ throws Exception
+ {
+ // ---------------------------------------------------------------------
+ // Get available locales
+ // ---------------------------------------------------------------------
+
+ availableLocales = new ArrayList<Locale>( resourceBundleManager.getAvailableLocales() );
+
+ Collections.sort( availableLocales, new Comparator<Locale>()
+ {
+ public int compare( Locale locale0, Locale locale1 )
+ {
+ return locale0.getDisplayName().compareTo( locale1.getDisplayName() );
+ }
+ } );
+
+ currentLocale = localeManager.getCurrentLocale();
+
+ // ---------------------------------------------------------------------
+ // Get available locales in db
+ // ---------------------------------------------------------------------
+
+ availableLocalesDb = new ArrayList<Locale>( i18nService.getAvailableLocales() );
+
+ if ( !availableLocales.contains( localeManager.getFallbackLocale() ) )
+ {
+ availableLocales.add( localeManager.getFallbackLocale() );
+ }
+
+ Collections.sort( availableLocales, new Comparator<Locale>()
+ {
+ public int compare( Locale locale0, Locale locale1 )
+ {
+ return locale0.getDisplayName().compareTo( locale1.getDisplayName() );
+ }
+ } );
+
+ currentLocaleDb = localeManager.getCurrentLocale();
+
+ // ---------------------------------------------------------------------
+ // Get Sort orders
+ // ---------------------------------------------------------------------
+
+ sortOrders = sortOrderManager.getSortOrders();
+
+ currentSortOrder = sortOrderManager.getCurrentSortOrder();
+
+ // ---------------------------------------------------------------------
+ // Get Charts in Dashboard
+ // ---------------------------------------------------------------------
+
+ chartsInDashboard = (Integer) userSettingService.getUserSetting( KEY_CHARTS_IN_DASHBOARD,
+ DEFAULT_CHARTS_IN_DASHBOARD );
+
+ chartsInDashboardOptions = UserSettingService.DASHBOARD_CHARTS_TO_DISPLAY;
+
+ // ---------------------------------------------------------------------
+ // Get Display Properties
+ // ---------------------------------------------------------------------
+
+ displayProperties = displayPropertyManager.getDisplayProperties();
+
+ currentDisplayProperty = displayPropertyManager.getCurrentDisplayProperty();
+
+ // ---------------------------------------------------------------------
+ // 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-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetEmailSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetEmailSettingsAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetEmailSettingsAction.java 2011-10-06 09:36:05 +0000
@@ -0,0 +1,93 @@
+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 org.hisp.dhis.i18n.I18n;
+import org.hisp.dhis.user.UserSettingService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Dang Duy Hieu
+ * @version $Id$
+ */
+public class SetEmailSettingsAction
+ 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 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 );
+
+ message = i18n.getString( "settings_updated" );
+
+ return SUCCESS;
+ }
+}
=== modified 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 2011-10-06 08:48:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetGeneralSettingsAction.java 2011-10-06 09:36:05 +0000
@@ -27,6 +27,7 @@
* 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_CHARTS_IN_DASHBOARD;
import java.util.Locale;
@@ -164,8 +165,8 @@
userSettingService.saveUserSetting( KEY_CHARTS_IN_DASHBOARD, chartsInDashboard );
- userSettingService.saveUserSetting( UserSettingService.AUTO_SAVE_DATA_ENTRY_FORM, autoSave );
-
+ userSettingService.saveUserSetting( AUTO_SAVE_DATA_ENTRY_FORM, autoSave );
+
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 2011-10-06 08:48:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/META-INF/dhis/beans.xml 2011-10-06 09:36:05 +0000
@@ -47,8 +47,8 @@
</bean>
<!-- User settings -->
-
- <bean id="org.hisp.dhis.settings.action.user.GetAvailableUserSettingsAction" class="org.hisp.dhis.settings.action.user.GetAvailableUserSettingsAction"
+ <!-- General settings -->
+ <bean id="org.hisp.dhis.settings.action.user.GetGeneralSettingsAction" class="org.hisp.dhis.settings.action.user.GetGeneralSettingsAction"
scope="prototype">
<property name="resourceBundleManager">
<ref bean="org.hisp.dhis.i18n.resourcebundle.ResourceBundleManager" />
@@ -94,5 +94,20 @@
<ref bean="org.hisp.dhis.options.style.StyleManager" />
</property>
</bean>
+
+ <!-- Email settings -->
+ <bean id="org.hisp.dhis.settings.action.user.GetEmailSettingsAction" class="org.hisp.dhis.settings.action.user.GetEmailSettingsAction"
+ scope="prototype">
+ <property name="userSettingService">
+ <ref bean="org.hisp.dhis.user.UserSettingService" />
+ </property>
+ </bean>
+
+ <bean id="org.hisp.dhis.settings.action.user.SetEmailSettingsAction" class="org.hisp.dhis.settings.action.user.SetEmailSettingsAction"
+ scope="prototype">
+ <property name="userSettingService">
+ <ref bean="org.hisp.dhis.user.UserSettingService" />
+ </property>
+ </bean>
</beans>
=== 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 2011-10-06 07:05:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties 2011-10-06 09:36:05 +0000
@@ -86,6 +86,7 @@
forum_integration = Forum integration
no_start_page = No start page
intro_user_general_settings = Customize the system with user specific settings for locale, sort order, display property, style and more.
+intro_user_email_settings = Customize the system with user specific settings for message email 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.
@@ -111,4 +112,5 @@
infrastructural_period_type = Infrastructural period type
feedback_recipients = Feedback recipients
no_feedback_recipients = No message recipients
-settings_updated = Settings were updated
\ No newline at end of file
+settings_updated = Settings were updated
+message_email_notification = Message email notification
\ No newline at end of file
=== 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 2011-10-06 07:05:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module_vi_VN.properties 2011-10-06 09:36:05 +0000
@@ -62,10 +62,11 @@
jasper=C\u00e1c b\u00e1o c\u00e1o Jasper
ivory_coast=B\u1edd bi\u1ec3n ng\u00e0
irc=\u1ee6y ban gi\u1ea3i c\u1ee9u qu\u1ed1c t\u1ebf
-intro_user_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_general_settings = Thi\u1ebft l\u1eadp h\u1ec7 th\u1ed1ng v\u1ec1 c\u00e1ch th\u1ee9c t\u1ed5ng h\u1ee3p d\u1eef li\u1ec7u, C\u01a1 s\u1edf h\u1ea1 t\u1ea7ng h\u00f3a ph\u1ea7n t\u1eed d\u1eef li\u1ec7u, C\u01a1 s\u1edf h\u1ea1 t\u1ea7ng h\u00f3a ki\u1ec3u th\u1eddi gian, Kh\u00f3a bi\u1ec3u nh\u1eadp khi ho\u00e0n t\u1ea5t v\u00e0 h\u01a1n n\u1eefa.
-intro_appearance_settings = Thi\u1ebft l\u1eadp h\u1ec7 th\u1ed1ng v\u1ec1 ti\u00eau \u0111\u1ec1 c\u1ee7a \u1ee9ng d\u1ee5ng, ki\u1ec3u phong c\u00e1ch, c\u1edd v\u00e0 trang ch\u00ednh khi v\u00e0o h\u1ec7 th\u1ed1ng.
-intro_smtp_settings = Thi\u1ebft l\u1eadp h\u1ec7 th\u1ed1ng v\u1ec1 th\u01b0 \u0111i\u1ec7n t\u1eed.
+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_email_settings=CT\u00f9y bi\u1ebfn h\u1ec7 th\u1ed1ng v\u1edbi c\u00e1c thi\u1ebft l\u1eadp ng\u01b0\u1eddi d\u00f9ng cho cho ph\u00e9p th\u00f4ng b\u00e1o tin nh\u1eafn qua th\u01b0 \u0111i\u1ec7n t\u1eed.
+intro_system_general_settings = Thi\u1ebft l\u1eadp h\u1ec7 th\u1ed1ng v\u1ec1 c\u00e1ch th\u1ee9c t\u1ed5ng h\u1ee3p d\u1eef li\u1ec7u, C\u01a1 s\u1edf h\u1ea1 t\u1ea7ng h\u00f3a ph\u1ea7n t\u1eed d\u1eef li\u1ec7u, C\u01a1 s\u1edf h\u1ea1 t\u1ea7ng h\u00f3a ki\u1ec3u th\u1eddi gian, Kh\u00f3a bi\u1ec3u nh\u1eadp khi ho\u00e0n t\u1ea5t v\u00e0 h\u01a1n n\u1eefa.
+intro_system_appearance_settings = Thi\u1ebft l\u1eadp h\u1ec7 th\u1ed1ng v\u1ec1 ti\u00eau \u0111\u1ec1 c\u1ee7a \u1ee9ng d\u1ee5ng, ki\u1ec3u phong c\u00e1ch, c\u1edd v\u00e0 trang ch\u00ednh khi v\u00e0o h\u1ec7 th\u1ed1ng.
+intro_system_email_settings = Thi\u1ebft l\u1eadp h\u1ec7 th\u1ed1ng v\u1ec1 th\u01b0 \u0111i\u1ec7n t\u1eed.
india=India
green=M\u00e0u xanh l\u00e1 c\u00e2y
ghana=Ghana
@@ -126,4 +127,5 @@
host_name = \u0110\u1ecba ch\u1ec9 m\u00e1y ch\u1ee7 (URL)
username = T\u00ean \u0111\u0103ng nh\u1eadp
password = M\u1eadt kh\u1ea9u
-settings_updated = C\u00e1c thi\u1ebft l\u1eadp \u0111\u00e3 \u0111\u01b0\u1ee3c thay \u0111\u1ed5i
\ No newline at end of file
+settings_updated = C\u00e1c thi\u1ebft l\u1eadp \u0111\u00e3 \u0111\u01b0\u1ee3c thay \u0111\u1ed5i
+message_email_notification = Th\u00f4ng b\u00e1o tin nh\u1eafn qua th\u01b0 \u0111i\u1ec7n t\u1eed
\ 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-10-06 08:48:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/struts.xml 2011-10-06 09:36:05 +0000
@@ -14,7 +14,8 @@
<param name="menu">/dhis-web-maintenance-settings/settingsMenu.vm</param>
</action>
- <!-- General settings -->
+ <!-- System settings -->
+ <!-- General settings -->
<action name="systemGeneralSettings" class="org.hisp.dhis.settings.action.system.GetGeneralSettingsAction">
<result name="success" type="velocity">/main.vm</result>
@@ -29,7 +30,7 @@
<param name="onExceptionReturn">plainTextError</param>
</action>
- <!-- Appearance settings -->
+ <!-- Appearance settings -->
<action name="systemAppearanceSettings" class="org.hisp.dhis.settings.action.system.GetAppearanceSettingsAction">
<result name="success" type="velocity">/main.vm</result>
@@ -44,7 +45,7 @@
<param name="onExceptionReturn">plainTextError</param>
</action>
- <!-- Email settings -->
+ <!-- Email settings -->
<action name="systemEmailSettings" class="org.hisp.dhis.settings.action.system.GetSMTPSettingsAction">
<result name="success" type="velocity">/main.vm</result>
@@ -60,8 +61,9 @@
</action>
<!-- User settings -->
+ <!-- General settings -->
- <action name="userGeneralSettings" class="org.hisp.dhis.settings.action.user.GetAvailableUserSettingsAction">
+ <action name="userGeneralSettings" class="org.hisp.dhis.settings.action.user.GetGeneralSettingsAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-settings/userGeneralSettings.vm</param>
<param name="menu">/dhis-web-maintenance-settings/settingsMenu.vm</param>
@@ -72,6 +74,20 @@
/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
<param name="onExceptionReturn">plainTextError</param>
</action>
+
+ <!-- Email settings -->
+
+ <action name="userEmailSettings" class="org.hisp.dhis.settings.action.user.GetEmailSettingsAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-maintenance-settings/userEmailSettings.vm</param>
+ <param name="menu">/dhis-web-maintenance-settings/settingsMenu.vm</param>
+ </action>
+
+ <action name="setUserEmailSettings" class="org.hisp.dhis.settings.action.user.SetEmailSettingsAction">
+ <result name="success" type="velocity-json">
+ /dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+ <param name="onExceptionReturn">plainTextError</param>
+ </action>
</package>
</struts>
=== 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 2011-10-06 08:48:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/index.vm 2011-10-06 09:36:05 +0000
@@ -9,6 +9,7 @@
<ul id="introList">
#introListImgItem( "userGeneralSettings.action" "user_general_settings" "usersettings" )
+ #introListImgItem( "userEmailSettings.action" "user_email_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-10-06 08:48:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/settingsMenu.vm 2011-10-06 09:36:05 +0000
@@ -1,6 +1,7 @@
<h2>$i18n.getString( "user_settings" ) </h2>
<ul>
<li><a href="userGeneralSettings.action">$i18n.getString( "general" ) </a></li>
+ <li><a href="userEmailSettings.action">$i18n.getString( "email" ) </a></li>
</ul>
<h2>$i18n.getString( "system_settings" ) </h2>
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/userEmailSettings.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/userEmailSettings.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/userEmailSettings.vm 2011-10-06 09:36:05 +0000
@@ -0,0 +1,23 @@
+#if( $availableLocales )
+<script type="text/javascript">
+
+ jQuery(document).ready(function() {
+ jQuery("input[type=button]").click(function() {
+ jQuery.postJSON( 'setUserEmailSettings.action', {
+ messageEmailNotification: jQuery( '#messageEmailNotification' ).is(':checked' )
+ }, function ( json ) {
+ if ( json.response == "success" )
+ setHeaderDelayMessage( json.message );
+ });
+ });
+ });
+</script>
+
+<h3>$i18n.getString("email_settings")</h3>
+
+<h4>$i18n.getString( "message_email_notification" )</h4>
+<input type="checkbox" id="messageEmailNotification" name="messageEmailNotification" #if( $messageEmailNotification ) checked="checked"#end/>
+
+<p><input type="button" value="$i18n.getString( 'save' )" style="width:10em"/></p>
+
+#end
\ No newline at end of file