=== modified 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-09-30 12:21:59 +0000 +++ 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2009, University of Oslo + * Copyright (c) 2004-2011, University of Oslo * All rights reserved. * * Redistribution and use in source and binary forms, with or without === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetAutoSaveDataEntryFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetAutoSaveDataEntryFormAction.java 2011-05-05 21:15:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetAutoSaveDataEntryFormAction.java 1970-01-01 00:00:00 +0000 @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2004-2010, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package org.hisp.dhis.settings.action.user; - -import org.hisp.dhis.user.UserSettingService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Chau Thu Tran - * @version GetAvailableAutoSaveDataEntryFormAction.java Jun 23, 2010 3:49:11 PM - */ -public class SetAutoSaveDataEntryFormAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependency - // ------------------------------------------------------------------------- - - private UserSettingService userSettingService; - - public void setUserSettingService( UserSettingService userSettingService ) - { - this.userSettingService = userSettingService; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private Boolean autoSave; - - public void setAutoSave( Boolean autoSave ) - { - this.autoSave = autoSave; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() throws Exception - { - userSettingService.saveUserSetting( UserSettingService.AUTO_SAVE_DATA_ENTRY_FORM, autoSave ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentChartsInDashboardAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentChartsInDashboardAction.java 2011-09-30 10:24:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentChartsInDashboardAction.java 1970-01-01 00:00:00 +0000 @@ -1,61 +0,0 @@ -package org.hisp.dhis.settings.action.user; - -/* - * Copyright (c) 2004-2010, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.hisp.dhis.user.UserSettingService; - -import com.opensymphony.xwork2.Action; - -import static org.hisp.dhis.user.UserSettingService.*; - -public class SetCurrentChartsInDashboardAction - implements Action -{ - private UserSettingService userSettingService; - - public void setUserSettingService( UserSettingService userSettingService ) - { - this.userSettingService = userSettingService; - } - - private Integer chartsInDashboard; - - public void setChartsInDashboard( Integer chartsInDashboard ) - { - this.chartsInDashboard = chartsInDashboard; - } - - @Override - public String execute() - throws Exception - { - userSettingService.saveUserSetting( KEY_CHARTS_IN_DASHBOARD, chartsInDashboard ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentDisplayPropertyAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentDisplayPropertyAction.java 2011-05-05 21:15:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentDisplayPropertyAction.java 1970-01-01 00:00:00 +0000 @@ -1,73 +0,0 @@ -package org.hisp.dhis.settings.action.user; - -/* - * Copyright (c) 2004-2010, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.hisp.dhis.options.displayproperty.DisplayPropertyManager; - -import com.opensymphony.xwork2.Action; - -/** - * @author Lars Helge Overland - * @version $Id: SetCurrentDisplayPropertyAction.java 3264 2007-04-25 14:54:05Z stianast $ - */ -public class SetCurrentDisplayPropertyAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private DisplayPropertyManager displayPropertyManager; - - public void setDisplayPropertyManager( DisplayPropertyManager displayPropertyManager ) - { - this.displayPropertyManager = displayPropertyManager; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private String currentDisplayProperty; - - public void setCurrentDisplayProperty( String currentDisplayProperty ) - { - this.currentDisplayProperty = currentDisplayProperty; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() throws Exception - { - displayPropertyManager.setCurrentDisplayProperty( currentDisplayProperty ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentLocaleAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentLocaleAction.java 2011-05-05 21:15:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentLocaleAction.java 1970-01-01 00:00:00 +0000 @@ -1,96 +0,0 @@ -package org.hisp.dhis.settings.action.user; - -/* - * Copyright (c) 2004-2010, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.Locale; - -import org.hisp.dhis.i18n.locale.LocaleManager; - -import com.opensymphony.xwork2.Action; - -/** - * @author Torgeir Lorange Ostby - * @version $Id: SetCurrentLocaleAction.java 3264 2007-04-25 14:54:05Z stianast $ - */ -public class SetCurrentLocaleAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private LocaleManager localeManager; - - public void setLocaleManager( LocaleManager localeManager ) - { - this.localeManager = localeManager; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private String currentLocale; - - public void setCurrentLocale( String locale ) - { - this.currentLocale = locale; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() throws Exception - { - String[] tokens = currentLocale.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: - } - - localeManager.setCurrentLocale( newLocale ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentLocaleDbAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentLocaleDbAction.java 2011-05-05 21:15:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentLocaleDbAction.java 1970-01-01 00:00:00 +0000 @@ -1,96 +0,0 @@ -package org.hisp.dhis.settings.action.user; - -/* - * Copyright (c) 2004-2005, 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 nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.Locale; - -import org.hisp.dhis.i18n.locale.LocaleManager; - -import com.opensymphony.xwork2.Action; - -/** - * @author Oyvind Brucker - */ -public class SetCurrentLocaleDbAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private LocaleManager localeManager; - - public void setLocaleManager( LocaleManager localeManager ) - { - this.localeManager = localeManager; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private String currentLocaleDb; - - public void setCurrentLocaleDb( String currentLocaleDb ) - { - this.currentLocaleDb = currentLocaleDb; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() throws Exception - { - String[] tokens = currentLocaleDb.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: - } - - localeManager.setCurrentLocale( newLocale ); - - return SUCCESS; - } -} - === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentSortOrderAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentSortOrderAction.java 2011-05-05 21:15:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentSortOrderAction.java 1970-01-01 00:00:00 +0000 @@ -1,73 +0,0 @@ -package org.hisp.dhis.settings.action.user; - -/* - * Copyright (c) 2004-2010, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.hisp.dhis.options.sortorder.SortOrderManager; - -import com.opensymphony.xwork2.Action; - -/** - * @author Lars Helge Overland - * @version $Id: SetCurrentSortOrderAction.java 3264 2007-04-25 14:54:05Z stianast $ - */ -public class SetCurrentSortOrderAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private SortOrderManager sortOrderManager; - - public void setSortOrderManager( SortOrderManager sortOrderManager ) - { - this.sortOrderManager = sortOrderManager; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private String currentSortOrder; - - public void setCurrentSortOrder( String currentSortOrder ) - { - this.currentSortOrder = currentSortOrder; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() throws Exception - { - sortOrderManager.setCurrentSortOrder( currentSortOrder ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentStyleAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentStyleAction.java 2011-09-30 12:21:59 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentStyleAction.java 1970-01-01 00:00:00 +0000 @@ -1,73 +0,0 @@ -package org.hisp.dhis.settings.action.user; - -/* - * Copyright (c) 2004-2010, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.hisp.dhis.options.style.StyleManager; - -import com.opensymphony.xwork2.Action; - -/** - * @author Chau Thu Tran - * @version $Id: SetCurrentStyleAction.java 2010-10-26 17:29:15Z $ - */ -public class SetCurrentStyleAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private StyleManager styleManager; - - public void setStyleManager( StyleManager styleManager ) - { - this.styleManager = styleManager; - } - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private String currentStyle; - - public void setCurrentStyle( String style ) - { - this.currentStyle = style; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - { - styleManager.setUserStyle( currentStyle ); - - return SUCCESS; - } -} === added 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 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/SetGeneralSettingsAction.java 2011-10-06 08:48:28 +0000 @@ -0,0 +1,200 @@ +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_CHARTS_IN_DASHBOARD; + +import java.util.Locale; + +import org.hisp.dhis.i18n.locale.LocaleManager; +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 Dang Duy Hieu + * @version $Id$ + */ +public class SetGeneralSettingsAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private DisplayPropertyManager displayPropertyManager; + + public void setDisplayPropertyManager( DisplayPropertyManager displayPropertyManager ) + { + this.displayPropertyManager = displayPropertyManager; + } + + private LocaleManager localeManagerInterface; + + public void setLocaleManagerInterface( LocaleManager localeManagerInterface ) + { + this.localeManagerInterface = localeManagerInterface; + } + + private LocaleManager localeManagerDB; + + public void setLocaleManagerDB( LocaleManager localeManagerDB ) + { + this.localeManagerDB = localeManagerDB; + } + + private SortOrderManager sortOrderManager; + + public void setSortOrderManager( SortOrderManager sortOrderManager ) + { + this.sortOrderManager = sortOrderManager; + } + + 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 Integer chartsInDashboard; + + public void setChartsInDashboard( Integer chartsInDashboard ) + { + this.chartsInDashboard = chartsInDashboard; + } + + private String currentDisplayProperty; + + public void setCurrentDisplayProperty( String currentDisplayProperty ) + { + this.currentDisplayProperty = currentDisplayProperty; + } + + private String currentLocale; + + public void setCurrentLocale( String locale ) + { + this.currentLocale = locale; + } + + private String currentLocaleDb; + + public void setCurrentLocaleDb( String currentLocaleDb ) + { + this.currentLocaleDb = currentLocaleDb; + } + + private String currentSortOrder; + + public void setCurrentSortOrder( String currentSortOrder ) + { + this.currentSortOrder = currentSortOrder; + } + + private String currentStyle; + + public void setCurrentStyle( String style ) + { + this.currentStyle = style; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + public String execute() + throws Exception + { + localeManagerInterface.setCurrentLocale( getRespectiveLocale( currentLocale ) ); + + localeManagerDB.setCurrentLocale( getRespectiveLocale( currentLocaleDb ) ); + + sortOrderManager.setCurrentSortOrder( currentSortOrder ); + + displayPropertyManager.setCurrentDisplayProperty( currentDisplayProperty ); + + styleManager.setUserStyle( currentStyle ); + + userSettingService.saveUserSetting( KEY_CHARTS_IN_DASHBOARD, chartsInDashboard ); + + userSettingService.saveUserSetting( UserSettingService.AUTO_SAVE_DATA_ENTRY_FORM, autoSave ); + + return SUCCESS; + } + + // ------------------------------------------------------------------------- + // Supportive methods + // ------------------------------------------------------------------------- + + private Locale getRespectiveLocale( String locale ) + { + 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; + } +} === 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-05 07:03:07 +0000 +++ 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 @@ -73,50 +73,23 @@ - - + - - - - + - - - - - - - - - - - - - - - - - - === 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 07:05:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/struts.xml 2011-10-06 08:48:28 +0000 @@ -61,38 +61,16 @@ - + /main.vm - /dhis-web-maintenance-settings/userSettings.vm + /dhis-web-maintenance-settings/userGeneralSettings.vm /dhis-web-maintenance-settings/settingsMenu.vm - - userSettings.action - - - - userSettings.action - - - - userSettings.action - - - - userSettings.action - - - - userSettings.action - - - - userSettings.action - - - - userSettings.action + + + /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 2011-10-06 07:05:49 +0000 +++ 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 @@ -8,7 +8,7 @@

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

    - #introListImgItem( "userSettings.action" "user_general_settings" "usersettings" ) + #introListImgItem( "userGeneralSettings.action" "user_general_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 07:05:49 +0000 +++ 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 @@ -1,6 +1,6 @@

    $i18n.getString( "user_settings" ) 

    $i18n.getString( "system_settings" ) 

    === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemGeneralSettings.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemGeneralSettings.vm 2011-10-06 07:05:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemGeneralSettings.vm 2011-10-06 08:48:28 +0000 @@ -6,8 +6,8 @@ infrastructuralDataElements: getFieldValue( 'infrastructuralDataElements' ), infrastructuralPeriodType: getFieldValue( 'infrastructuralPeriodType' ), feedbackRecipients: getFieldValue( 'feedbackRecipients' ), - omitIndicatorsZeroNumeratorDataMart: getFieldValue( 'omitIndicatorsZeroNumeratorDataMart' ), - disableDataEntryWhenCompleted: getFieldValue( 'disableDataEntryWhenCompleted' ), + omitIndicatorsZeroNumeratorDataMart: jQuery( '#omitIndicatorsZeroNumeratorDataMart' ).is( ':checked' ), + disableDataEntryWhenCompleted: jQuery( '#disableDataEntryWhenCompleted' ).is( ':checked' ), factorDeviation: getFieldValue( 'factorDeviation' ), completenessOffset: getFieldValue( 'completenessOffset' ) }, function( json ) { @@ -67,14 +67,14 @@

    $i18n.getString( "omit_indicators_zero_numerator_data_mart" )

    - +

    $i18n.getString( "disable_dataentry_when_dataset_completed" )

    - +

    === added 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 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/userGeneralSettings.vm 2011-10-06 08:48:28 +0000 @@ -0,0 +1,77 @@ +#if( $availableLocales ) + + +

    $i18n.getString("user_general_settings")

    + +

    $i18n.getString( "language" )

    + + + +

    $i18n.getString( "db_language" )

    + + + +

    $i18n.getString( "sort_order" )

    + + + +

    $i18n.getString( "display_property" )

    + + + +

    $i18n.getString( "style" )

    + + + +

    $i18n.getString( "dashboard_charts_to_display" )

    + + + +

    $i18n.getString( "auto_save_data_entry_form" )

    + + +

    + +#end \ No newline at end of file