Clean global session variables after saving preferences

This will refresh all company-level variables with the corresponding
values depending on the filtering preferences saved.

FEA: ItEr77S15FilteringEnhancements
This commit is contained in:
Lorenzo Tilve Álvaro 2013-02-22 19:45:14 +01:00
parent 2c34faa7e0
commit 18dc5e7749
2 changed files with 17 additions and 17 deletions

View file

@ -207,12 +207,19 @@ public class FilterUtils {
public static void clearBandboxes() {
writeProjectsParameters(null);
writeResourceLoadsParameters(null);
// Locate all order-specific bandboxes
for (String key : (Set <String>) Sessions.getCurrent().getAttributes().keySet() ) {
if (key.contains("-tasknameFilter")) {
Sessions.getCurrent().setAttribute(key, null);
}
}
}
public static void clearSessionDates() {
writeProjectsStartDate(null);
Sessions.getCurrent().setAttribute("companyFilterStartDateChanged",
null);
writeProjectsEndDate(null);
Sessions.getCurrent().setAttribute("companyFilterEndDateChanged", null);
writeResourceLoadsStartDate(null);
Sessions.getCurrent()
.setAttribute("resourceLoadStartDateChanged", null);
writeResourceLoadsEndDate(null);
Sessions.getCurrent().setAttribute("resourceLoadEndDateChanged", null);
}
public static ZoomLevel readZoomLevelCompanyView() {

View file

@ -26,11 +26,13 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.logging.Filter;
import org.libreplan.business.common.exceptions.ValidationException;
import org.libreplan.business.labels.entities.Label;
import org.libreplan.business.resources.entities.Criterion;
import org.libreplan.business.settings.entities.Language;
import org.libreplan.web.common.FilterUtils;
import org.libreplan.web.common.IMessagesForUser;
import org.libreplan.web.common.Level;
import org.libreplan.web.common.MessagesForUser;
@ -139,17 +141,8 @@ public class SettingsController extends GenericForwardComposer {
}
private void clearSessionVariables() {
Session current = Sessions.getCurrent();
// Projects filters
current.setAttribute("companyFilterStartDate", null);
current.setAttribute("companyFilterEndtDate", null);
current.setAttribute("companyFilterLabel", null);
// ResourcesLoad filters
current.setAttribute("resourceLoadStartDate", null);
current.setAttribute("resourceLoadEndDate", null);
current.setAttribute("resourceLoadFilterWorkerOrCriterion", null);
FilterUtils.clearBandboxes();
FilterUtils.clearSessionDates();
}
private void checkEmptyBandboxes() {