← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4855: User settings - Refactor and consistent the on-the-fly saving by one action only.

 

------------------------------------------------------------
revno: 4855
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-10-06 15:48:28 +0700
message:
  User settings - Refactor and consistent the on-the-fly saving by one action only.
  Fixed bug saving "checkbox" fields in System settings.
removed:
  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/SetCurrentChartsInDashboardAction.java
  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/SetCurrentLocaleAction.java
  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/SetCurrentSortOrderAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentStyleAction.java
added:
  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/webapp/dhis-web-maintenance-settings/userGeneralSettings.vm
modified:
  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/resources/META-INF/dhis/beans.xml
  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
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemGeneralSettings.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-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 <ORGANIZATION> 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 @@
     </property>
   </bean>
 
-  <bean id="org.hisp.dhis.settings.action.user.SetCurrentLocaleAction" class="org.hisp.dhis.settings.action.user.SetCurrentLocaleAction"
+  <bean id="org.hisp.dhis.settings.action.user.SetGeneralSettingsAction" class="org.hisp.dhis.settings.action.user.SetGeneralSettingsAction"
     scope="prototype">
-    <property name="localeManager">
+    <property name="localeManagerInterface">
       <ref bean="org.hisp.dhis.i18n.locale.LocaleManager" />
     </property>
-  </bean>
-
-  <bean id="org.hisp.dhis.settings.action.user.SetCurrentLocaleDbAction" class="org.hisp.dhis.settings.action.user.SetCurrentLocaleDbAction"
-    scope="prototype">
-    <property name="localeManager">
+    <property name="localeManagerDB">
       <ref bean="org.hisp.dhis.i18n.locale.LocaleManagerDb" />
     </property>
-  </bean>
-
-  <bean id="org.hisp.dhis.settings.action.user.SetCurrentSortOrderAction" class="org.hisp.dhis.settings.action.user.SetCurrentSortOrderAction"
-    scope="prototype">
     <property name="sortOrderManager">
       <ref bean="org.hisp.dhis.options.sortorder.SortOrderManager" />
     </property>
-  </bean>
-
-  <bean id="org.hisp.dhis.settings.action.user.SetCurrentChartsInDashboardAction" class="org.hisp.dhis.settings.action.user.SetCurrentChartsInDashboardAction"
-    scope="prototype">
-    <property name="userSettingService">
-      <ref bean="org.hisp.dhis.user.UserSettingService" />
-    </property>
-  </bean>
-
-  <bean id="org.hisp.dhis.settings.action.user.SetCurrentDisplayPropertyAction" class="org.hisp.dhis.settings.action.user.SetCurrentDisplayPropertyAction"
-    scope="prototype">
     <property name="displayPropertyManager">
       <ref bean="org.hisp.dhis.options.displayproperty.DisplayPropertyManager" />
     </property>
-  </bean>
-
-  <bean id="org.hisp.dhis.settings.action.user.SetAutoSaveDataEntryFormAction" class="org.hisp.dhis.settings.action.user.SetAutoSaveDataEntryFormAction"
-    scope="prototype">
     <property name="userSettingService">
       <ref bean="org.hisp.dhis.user.UserSettingService" />
     </property>
-  </bean>
-
-  <bean id="org.hisp.dhis.settings.action.user.SetCurrentStyleAction" class="org.hisp.dhis.settings.action.user.SetCurrentStyleAction"
-    scope="prototype">
     <property name="styleManager">
       <ref bean="org.hisp.dhis.options.style.StyleManager" />
     </property>

=== 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 @@
     
     <!-- User settings -->
 
-    <action name="userSettings" class="org.hisp.dhis.settings.action.user.GetAvailableUserSettingsAction">
+    <action name="userGeneralSettings" class="org.hisp.dhis.settings.action.user.GetAvailableUserSettingsAction">
       <result name="success" type="velocity">/main.vm</result>
-      <param name="page">/dhis-web-maintenance-settings/userSettings.vm</param>
+      <param name="page">/dhis-web-maintenance-settings/userGeneralSettings.vm</param>
       <param name="menu">/dhis-web-maintenance-settings/settingsMenu.vm</param>
     </action>
 
-    <action name="setCurrentLocale" class="org.hisp.dhis.settings.action.user.SetCurrentLocaleAction">
-      <result name="success" type="redirect">userSettings.action</result>
-    </action>
-
-    <action name="setCurrentLocaleDb" class="org.hisp.dhis.settings.action.user.SetCurrentLocaleDbAction">
-      <result name="success" type="redirect">userSettings.action</result>
-    </action>
-
-    <action name="setCurrentSortOrder" class="org.hisp.dhis.settings.action.user.SetCurrentSortOrderAction">
-      <result name="success" type="redirect">userSettings.action</result>
-    </action>
-
-    <action name="setCurrentChartsInDashboard" class="org.hisp.dhis.settings.action.user.SetCurrentChartsInDashboardAction">
-      <result name="success" type="redirect">userSettings.action</result>
-    </action>
-
-    <action name="setCurrentDisplayProperty" class="org.hisp.dhis.settings.action.user.SetCurrentDisplayPropertyAction">
-      <result name="success" type="redirect">userSettings.action</result>
-    </action>
-
-    <action name="setAutoSaveDataEntryForm" class="org.hisp.dhis.settings.action.user.SetAutoSaveDataEntryFormAction">
-      <result name="success" type="redirect">userSettings.action</result>
-    </action>
-
-    <action name="setCurrentStyle" class="org.hisp.dhis.settings.action.user.SetCurrentStyleAction">
-      <result name="success" type="redirect">userSettings.action</result>
+    <action name="setUserGeneralSettings" class="org.hisp.dhis.settings.action.user.SetGeneralSettingsAction">
+      <result name="success" type="velocity-json">
+		/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+	  <param name="onExceptionReturn">plainTextError</param>
     </action>
 
   </package>

=== 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 @@
 <h3>$i18n.getString( "dhis-web-maintenance-settings" )</h3>
 
 <ul id="introList">
-    #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 @@
 <h2>$i18n.getString( "user_settings" )&nbsp;</h2>
 <ul>
-	<li><a href="userSettings.action">$i18n.getString( "general" )&nbsp;</a></li>
+	<li><a href="userGeneralSettings.action">$i18n.getString( "general" )&nbsp;</a></li>
 </ul>
 
 <h2>$i18n.getString( "system_settings" )&nbsp;</h2>

=== 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 @@
 <h4>$i18n.getString( "omit_indicators_zero_numerator_data_mart" )</h4>
 
 <p>
-	<input type="checkbox" id="omitIndicatorsZeroNumeratorDataMart" name="omitIndicatorsZeroNumeratorDataMart" value="true" #if( $omitIndicatorsZeroNumeratorDataMart )checked="checked"#end/>
+	<input type="checkbox" id="omitIndicatorsZeroNumeratorDataMart" name="omitIndicatorsZeroNumeratorDataMart" #if( $omitIndicatorsZeroNumeratorDataMart )checked="checked"#end/>
 </p>
 
 <!-- disable_dataentry_when_dataset_completed -->
 <h4>$i18n.getString( "disable_dataentry_when_dataset_completed" )</h4>
 
 <p>
-	<input type="checkbox" id="disableDataEntryWhenCompleted" name="disableDataEntryWhenCompleted" value="true" #if( $dataEntryFormCompleted )checked="checked"#end/>
+	<input type="checkbox" id="disableDataEntryWhenCompleted" name="disableDataEntryWhenCompleted" #if( $dataEntryFormCompleted )checked="checked"#end/>
 </p>
 
 <!-- data_analysis_factor -->

=== 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 )
+<script type="text/javascript">
+	
+	jQuery(document).ready(function() {
+		jQuery("input[type=button]").click(function() {
+			jQuery.postJSON( 'setUserGeneralSettings.action', {
+				currentLocale: getFieldValue( 'currentLocale' ),
+				currentLocaleDb: getFieldValue( 'currentLocaleDb' ),
+				currentSortOrder: getFieldValue( 'currentSortOrder' ),
+				currentDisplayProperty: getFieldValue( 'currentDisplayProperty' ),
+				currentStyle: getFieldValue( 'currentStyle' ),
+				chartsInDashboard: getFieldValue( 'chartsInDashboard' ),
+				autoSave: jQuery( '#autoSave' ).is(':checked' )
+			}, function ( json ) {
+				if ( json.response == "success" )
+					window.location.reload();
+			});
+		});
+	});
+</script>
+
+<h3>$i18n.getString("user_general_settings")</h3>
+
+<h4>$i18n.getString( "language" )</h4>
+
+<select id="currentLocale" name="currentLocale" style="min-width:250px">
+#foreach( $locale in $availableLocales )
+	<option value="$locale.toString()" #if( $locale == $currentLocale )selected="selected"#end>$locale.getDisplayName()</option>
+#end
+</select>
+
+<h4>$i18n.getString( "db_language" )</h4>
+
+<select id="currentLocaleDb" name="currentLocaleDb" style="min-width:250px">
+#foreach( $locale in $availableLocalesDb )
+	<option value="$locale.toString()" #if( $locale == $currentLocaleDb )selected="selected"#end>$locale.getDisplayName()</option>
+#end
+</select>
+
+<h4>$i18n.getString( "sort_order" )</h4>
+
+<select id="currentSortOrder" name="currentSortOrder" style="min-width:250px">
+#foreach( $sortOrder in $sortOrders )
+	<option value="$sortOrder" #if( $sortOrder == $currentSortOrder )selected="selected"#end>$i18n.getString( $sortOrder )</option>
+#end
+</select>
+
+<h4>$i18n.getString( "display_property" )</h4>
+
+<select id="currentDisplayProperty" name="currentDisplayProperty" style="min-width:250px">
+#foreach( $property in $displayProperties )
+	<option value="$property" #if( $property == $currentDisplayProperty )selected="selected"#end>$i18n.getString( $property )</option>
+#end
+</select>
+
+<h4>$i18n.getString( "style" )</h4>
+
+<select id="currentStyle" name="currentStyle" style="min-width:250px">
+#foreach( $style in $styles.entrySet() )
+	<option value="$style.value" #if( $style.value == $currentStyle )selected="selected"#end>$i18n.getString( $style.key )</option>
+#end
+</select>
+
+<h4>$i18n.getString( "dashboard_charts_to_display" )</h4>
+
+<select id="chartsInDashboard" name="chartsInDashboard" style="min-width:250px">
+#foreach( $charts in $chartsInDashboardOptions )
+	<option value="$charts" #if($charts == $chartsInDashboard) selected="selected"#end>$charts</option>
+#end
+</select>
+
+<h4>$i18n.getString( "auto_save_data_entry_form" )</h4>
+<input type="checkbox" id="autoSave" name="autoSave" #if( $autoSave ) checked="checked"#end/>
+
+<p><input type="button" value="$i18n.getString( 'save' )" style="width:10em"/></p>
+
+#end
\ No newline at end of file