From c17e66ae30fb4dcca0a59c3fdbbfba0c4e1b0e76 Mon Sep 17 00:00:00 2001 From: Remington Steed Date: Thu, 29 Sep 2016 14:55:41 -0400 Subject: [PATCH] LP#1586567 Always return Fund Years sorted descending Currently, fund year selectors in Acq interfaces (at least Acq Admin -> Funds, and Acq -> Load MARC Order Records) show the fund years in database order. This commit adds a descending sort to the perl function that retrieves fund years for those interfaces. It also removes the unsuccessful attempt at sorting that was present in the dojo code. Signed-off-by: Remington Steed Signed-off-by: Dawn Dale Signed-off-by: Kathy Lussier --- .../src/perlmods/lib/OpenILS/Application/Acq/Financials.pm | 7 +++++-- Open-ILS/web/js/ui/default/acq/financial/list_funds.js | 1 - Open-ILS/web/js/ui/default/acq/picklist/upload.js | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Financials.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Financials.pm index 28b4f512f8..e66e648563 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Financials.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Financials.pm @@ -327,8 +327,11 @@ sub retrieve_org_funds { acqf => [{column => 'year', transform => 'distinct'}] }, from => 'acqf', - where => $filter} - ); + where => $filter, + order_by => { + acqf => {"year" => {"direction" => "desc"}} + } + }); return [map { $_->{year} } @$data]; } 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 69ec8b4e07..0d2f7de063 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 @@ -169,7 +169,6 @@ function loadYearSelector() { yearList = yearList.map(function(year){return {year:year+''};}); // dojo wants strings var yearStore = {identifier:'year', name:'year', items:yearList}; - yearStore.items = yearStore.items.sort().reverse(); fundFilterYearSelect.store = new dojo.data.ItemFileWriteStore({data:yearStore}); // default to this year diff --git a/Open-ILS/web/js/ui/default/acq/picklist/upload.js b/Open-ILS/web/js/ui/default/acq/picklist/upload.js index 6abdc69226..b2af53f2bc 100644 --- a/Open-ILS/web/js/ui/default/acq/picklist/upload.js +++ b/Open-ILS/web/js/ui/default/acq/picklist/upload.js @@ -224,7 +224,6 @@ function loadYearSelector() { yearList = yearList.map(function(year){return {year:year+''};}); // dojo wants strings var yearStore = {identifier:'year', name:'year', items:yearList}; - yearStore.items = yearStore.items.sort().reverse(); acqUploadYearSelector.store = new dojo.data.ItemFileReadStore({data:yearStore}); // until an ordering agency is selected, default to the -- 2.43.2