Bugzilla – Attachment 154013 Details for
Bug 21246
Extend the 'Last patron' navigation feature to 'Last X patrons'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21246: (QA follow-up) Add new syspref to control how many previous patrons are displayed
Bug-21246-QA-follow-up-Add-new-syspref-to-control-.patch (text/plain), 5.06 KB, created by
Katrin Fischer
on 2023-07-28 09:18:58 UTC
(
hide
)
Description:
Bug 21246: (QA follow-up) Add new syspref to control how many previous patrons are displayed
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-07-28 09:18:58 UTC
Size:
5.06 KB
patch
obsolete
>From 51b6431c1ecbdad63e73ada3e01cd765b01c82be Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 24 Jul 2023 12:22:57 -0400 >Subject: [PATCH] Bug 21246: (QA follow-up) Add new syspref to control how many > previous patrons are displayed > >Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> >Tidied the atomicupdate file. >Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> >--- > installer/data/mysql/atomicupdate/bug_21246.pl | 18 ++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../prog/en/includes/last-borrower.inc | 3 +++ > .../admin/preferences/staff_interface.pref | 5 ++++- > .../intranet-tmpl/prog/js/staff-global.js | 4 ++-- > 5 files changed, 28 insertions(+), 3 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_21246.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_21246.pl b/installer/data/mysql/atomicupdate/bug_21246.pl >new file mode 100755 >index 0000000000..22e281f8c6 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_21246.pl >@@ -0,0 +1,18 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "21246", >+ description => "A preference to specify how many previous patrons to show for showLastPatron", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >+ ('showLastPatronCount', '10', NULL, 'How many patrons should showLastPatron remember', 'Integer') >+ } >+ ); >+ say $out "Added new system preference 'showLastPatronCount'"; >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 30197591a8..81e679da1f 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -671,6 +671,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('MaxComponentRecords', '300', '','Max number of component records to display','Integer'), > ('ShowHeadingUse', '0', NULL, 'Show whether authority record contains an established heading that conforms to descriptive cataloguing rules, and can therefore be used as a main/added entry, or subject, or series title', 'YesNo'), > ('showLastPatron','0','','If ON, enables the last patron feature in the intranet','YesNo'), >+('showLastPatronCount', '10', '', 'How many patrons should showLastPatron remember', 'Integer'), > ('ShowPatronImageInWebBasedSelfCheck','0','','If ON, displays patron image when a patron uses web-based self-checkout','YesNo'), > ('ShowReviewer','full','none|full|first|surname|firstandinitial|username','Choose how a commenter\'s identity is presented alongside comments in the OPAC','Choice'), > ('ShowReviewerPhoto','1','','If ON, photo of reviewer will be shown beside comments in OPAC','YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/last-borrower.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/last-borrower.inc >index 7bd739bb4e..844bca2aaa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/last-borrower.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/last-borrower.inc >@@ -1,3 +1,6 @@ >+<script> >+ var showLastPatronCount = "[% Koha.Preference('showLastPatronCount') | html %]"; >+</script> > <div id="lastborrower-window"> > <div class="btn-group"> > <a class="btn btn-default navbar-btn lastborrower" id="lastborrowerlink" href="#" title=""><i class="fa fa-arrow-right"></i> Last patron</a> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref >index 0e5bb27f4c..62dca5a673 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref >@@ -162,7 +162,10 @@ Staff interface: > choices: > 0: "Don't show" > 1: Show >- - a link to the last searched patron in the staff interface. >+ - a link to the last >+ - pref: showLastPatronCount >+ class: integer >+ - searched patrons in the staff interface. > - > - pref: intranetbookbag > choices: >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index 88a70321ae..18ea8885f8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -177,8 +177,8 @@ $(document).ready(function() { > }; > > previous_patrons.unshift( previous_patron ); >- // Limit to last 10 patrons >- if ( previous_patrons.length > 10 ) previous_patrons.pop(); >+ // Limit to number of patrons specified in showLastPatronCount >+ if ( previous_patrons.length > showLastPatronCount ) previous_patrons.pop(); > localStorage.setItem("previousPatrons", JSON.stringify(previous_patrons)); > } > >-- >2.30.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 21246
:
152902
|
152980
|
153849
|
153850
|
153851
|
154011
|
154012
| 154013 |
154014