From 8e8c2a8e4f7866ed6fd9815266f26f1b806c63fb Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 6 Oct 2014 20:56:13 -0700 Subject: [PATCH 1/1] 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 --- Open-ILS/web/js/ui/default/acq/financial/list_funds.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- 2.43.2