From: Galen Charlton Date: Tue, 7 Oct 2014 03:56:13 +0000 (-0700) Subject: LP#1378169: make context OU selector on funds page sticky X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8e8c2a8e4f7866ed6fd9815266f26f1b806c63fb;p=evergreen%2Fpines.git LP#1378169: make context OU selector on funds page sticky This patch uses local storage to persist the selected value of the context OU selector on the funds page. This is meant to ease workflows where an acquisitions administrator needs to frequently transfer money between funds that are attached to children of a system-level OU. Specifically, rather than defaulting to the user's workstation OU, the selector will default to the OU selected the last time the funds page was opened. Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/web/js/ui/default/acq/financial/list_funds.js b/Open-ILS/web/js/ui/default/acq/financial/list_funds.js index 09a47d55d8..915f7815a9 100644 --- a/Open-ILS/web/js/ui/default/acq/financial/list_funds.js +++ b/Open-ILS/web/js/ui/default/acq/financial/list_funds.js @@ -19,6 +19,10 @@ dojo.require('fieldmapper.OrgUtils'); dojo.requireLocalization('openils.acq', 'acq'); var localeStrings = dojo.i18n.getLocalization('openils.acq', 'acq'); +dojo.require('openils.XUL'); +var xulStorage = openils.XUL.localStorage(); +var storekey = 'eg.acq.fund.list.context_ou_selector'; + var contextOrg; var rolloverResponses; var rolloverMode = false; @@ -35,7 +39,7 @@ var adminPermOrgs = []; var cachedFunds = []; function initPage() { - contextOrg = openils.User.user.ws_ou(); + contextOrg = xulStorage.getItem(storekey) || openils.User.user.ws_ou(); /* Reveal controls for rollover without money if org units say ok. * Actual ability to do the operation is controlled in the database, of @@ -56,6 +60,7 @@ function initPage() { dojo.connect(contextOrgSelector, 'onChange', function() { contextOrg = this.attr('value'); + xulStorage.setItem(storekey, contextOrg); dojo.byId('oils-acq-rollover-ctxt-org').innerHTML = fieldmapper.aou.findOrgUnit(contextOrg).shortname(); rolloverMode = false;