=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2013-07-17 16:50:42 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2013-07-18 05:21:15 +0000 @@ -31,12 +31,25 @@ return $.cookie( "currentPage" ); } +dhis2.commons.getCurrentKey = function() { + return $.cookie( "currentKey" ); +} + dhis2.commons.redirectCurrentPage = function( url ) { var currentPage = dhis2.commons.getCurrentPage(); + var currentKey = dhis2.commons.getCurrentKey(); var separator = url && url.indexOf( "?" ) == -1 ? "?" : "&"; - var redirect = currentPage ? ( url + separator + "currentPage=" + currentPage ) : url; - window.location.href = redirect; -} + + var redirect = url; + + if ( currentPage && currentKey ) { + redirect = currentPage ? ( url + separator + "currentPage=" + currentPage + "&key=" + currentKey ) : url; + } else if ( currentPage ) { + redirect = currentPage ? ( url + separator + "currentPage=" + currentPage ) : url; + } + + window.location.href = redirect; +}; // ----------------------------------------------------------------------------- // Global variables === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm 2013-07-17 15:23:18 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm 2013-07-18 05:21:15 +0000 @@ -89,12 +89,23 @@ #end #macro( filterDiv $action ) -
+ - - + +
+ #end #macro( trHeader $text ) === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/ContextInterceptor.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/ContextInterceptor.java 2012-02-13 20:04:18 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/ContextInterceptor.java 2013-07-18 05:21:15 +0000 @@ -27,17 +27,16 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import static org.hisp.dhis.util.ContextUtils.getCookieValue; - -import java.util.HashMap; -import java.util.Map; - +import com.opensymphony.xwork2.ActionInvocation; +import com.opensymphony.xwork2.interceptor.Interceptor; import org.apache.struts2.ServletActionContext; import org.hisp.dhis.system.database.DatabaseInfoProvider; import org.hisp.dhis.system.util.TextUtils; -import com.opensymphony.xwork2.ActionInvocation; -import com.opensymphony.xwork2.interceptor.Interceptor; +import java.util.HashMap; +import java.util.Map; + +import static org.hisp.dhis.util.ContextUtils.getCookieValue; /** * @author Lars Helge Overland @@ -48,14 +47,15 @@ private static final String KEY_IN_MEMORY_DATABASE = "inMemoryDatabase"; private static final String KEY_TEXT_UTILS = "dhisTextUtils"; private static final String KEY_CURRENT_PAGE = "keyCurrentPage"; - + private static final String KEY_CURRENT_KEY = "keyCurrentKey"; + private DatabaseInfoProvider databaseInfoProvider; public void setDatabaseInfoProvider( DatabaseInfoProvider databaseInfoProvider ) { this.databaseInfoProvider = databaseInfoProvider; } - + @Override public void destroy() { @@ -71,13 +71,14 @@ throws Exception { Map map = new HashMap(); - + map.put( KEY_IN_MEMORY_DATABASE, databaseInfoProvider.isInMemory() ); map.put( KEY_TEXT_UTILS, TextUtils.INSTANCE ); map.put( KEY_CURRENT_PAGE, getCookieValue( ServletActionContext.getRequest(), "currentPage" ) ); - + map.put( KEY_CURRENT_KEY, getCookieValue( ServletActionContext.getRequest(), "currentKey" ) ); + invocation.getStack().push( map ); - + return invocation.invoke(); } } === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml 2013-07-12 09:21:55 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml 2013-07-18 05:21:15 +0000 @@ -58,7 +58,7 @@ - dataElement.action + dataElement.action?currentPage=${keyCurrentPage}&key=${keyCurrentKey} F_DATAELEMENT_PUBLIC_ADD, F_DATAELEMENT_PRIVATE_ADD @@ -70,7 +70,7 @@ - dataElement.action?currentPage=${keyCurrentPage} + dataElement.action?currentPage=${keyCurrentPage}&key=${keyCurrentKey} F_DATAELEMENT_UPDATE