Delete stored filter session variables when saving changes on preferences values
FEA: ItEr77S15FilteringEnhancements
This commit is contained in:
parent
ef42d9b954
commit
80f84d22ea
1 changed files with 17 additions and 0 deletions
|
|
@ -36,6 +36,8 @@ import org.libreplan.web.common.Level;
|
|||
import org.libreplan.web.common.MessagesForUser;
|
||||
import org.libreplan.web.common.components.bandboxsearch.BandboxSearch;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.Session;
|
||||
import org.zkoss.zk.ui.Sessions;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zk.ui.event.Events;
|
||||
|
|
@ -126,6 +128,7 @@ public class SettingsController extends GenericForwardComposer {
|
|||
public boolean save() {
|
||||
try {
|
||||
checkEmptyBandboxes();
|
||||
clearSessionVariables();
|
||||
settingsModel.confirmSave();
|
||||
messages.showMessage(Level.INFO, _("Settings saved"));
|
||||
return true;
|
||||
|
|
@ -135,6 +138,20 @@ public class SettingsController extends GenericForwardComposer {
|
|||
return false;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
private void checkEmptyBandboxes() {
|
||||
if (projectsFilterLabelBandboxSearch.getSelectedElement() == null) {
|
||||
settingsModel.setProjectsFilterLabel(null);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue