Bugzilla – Attachment 168044 Details for
Bug 31606
Enhance acquisitions to allow ordering on next year's budget when still in current year.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31606: [WIP] Add FundDropdownSortField system preference
Bug-31606-WIP-Add-FundDropdownSortField-system-pre.patch (text/plain), 4.91 KB, created by
Aleisha Amohia
on 2024-06-24 20:27:04 UTC
(
hide
)
Description:
Bug 31606: [WIP] Add FundDropdownSortField system preference
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2024-06-24 20:27:04 UTC
Size:
4.91 KB
patch
obsolete
>From 138b3bee5dcb7f633947de5caf3b6e1e2cb7a8cb Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Mon, 24 Jun 2024 20:25:51 +0000 >Subject: [PATCH] Bug 31606: [WIP] Add FundDropdownSortField system preference > >Libraries may want to sort the funds by modification/creation date, rather than by ID or code. > >Work in progress. >--- > C4/Budgets.pm | 7 ++++--- > ..._31606_-_add_FundDropdownSortField_syspref.pl | 16 ++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../modules/admin/preferences/acquisitions.pref | 8 ++++++++ > 4 files changed, 29 insertions(+), 3 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_31606_-_add_FundDropdownSortField_syspref.pl > >diff --git a/C4/Budgets.pm b/C4/Budgets.pm >index 26e4c49143d..62f187feb76 100644 >--- a/C4/Budgets.pm >+++ b/C4/Budgets.pm >@@ -524,9 +524,10 @@ sub GetBudgetHierarchy { > push @bind_params, $branchcode; > } > } >- $query.=" WHERE ".join(' AND ', @where_strings) if @where_strings; >- my $sth = $dbh->prepare($query); >- $sth->execute(@bind_params); >+ $query .= " WHERE " . join( ' AND ', @where_strings ) if @where_strings; >+ $query .= " ORDER BY timestamp DESC" if C4::Context->preference('FundDropdownSortField') eq 'timestamp'; >+ my $sth = $dbh->prepare($query); >+ $sth->execute(@bind_params); > > my %links; > # create hash with budget_id has key >diff --git a/installer/data/mysql/atomicupdate/bug_31606_-_add_FundDropdownSortField_syspref.pl b/installer/data/mysql/atomicupdate/bug_31606_-_add_FundDropdownSortField_syspref.pl >new file mode 100755 >index 00000000000..e4a9ad40213 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_31606_-_add_FundDropdownSortField_syspref.pl >@@ -0,0 +1,16 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "31606", >+ description => "Make acquisitions fund dropdown consistently show budget name", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ $dbh->do( >+ q{ INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('FundDropdownSortField','budget_code','budget_code|timestamp','Choose the display order of budgets and funds','Choice') } >+ ); >+ >+ say $out "Added system preference 'FundDropdownSortField'"; >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 59fc38ed46d..e1ac18581c4 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -281,6 +281,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('finesMode','off','off|production','Choose the fines mode, \'off\' (no charges), \'production\' (accrue overdue fines). Requires accruefines cronjob.','Choice'), > ('ForceLibrarySelection','0',NULL,'Force staff to select a library when logging into the staff interface.','YesNo'), > ('FRBRizeEditions','0','','If ON, Koha will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','YesNo'), >+('FundDropdownSortField','budget_code','budget_code|timestamp','Choose the display order of budgets and funds','Choice'); > ('GenerateAuthorityField667', 'Machine generated authority record', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 667$a field of MARC21 records', 'free'), > ('GenerateAuthorityField670', 'Work cat.', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 670$a field of MARC21 records', 'free'), > ('GoogleJackets','0',NULL,'if ON, displays jacket covers from Google Books API','YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref >index 3584d9d59d5..629e513bbe6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref >@@ -138,6 +138,14 @@ Acquisitions: > class: email > - 'when sending acquisitions order and claim notices.' > - '<br>If left empty, it will fall back to the first defined address in the following list: library reply-to, library email, <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ReplytoDefault">ReplytoDefault</a>, <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=KohaAdminEmailAddress">KohaAdminEmailAddress</a>.' >+ - >+ - When displaying the budgets and funds dropdown, sort by >+ - pref: FundDropdownSortField >+ default: budget_code >+ choices: >+ budget_code: "budget code" >+ timestamp: "last modified timestamp" >+ - "." > Printing: > - > - Use the >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31606
:
140860
|
140958
|
141004
|
148574
|
167427
|
167505
|
167522
|
167908
|
168043
|
168044
|
169264
|
169265
|
169442
|
169521
|
169767
|
169768
|
169769