Bugzilla – Attachment 174671 Details for
Bug 36454
Provide indication if a patron is expired or restricted on patron search autocomplete
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36454: (QA follow-up) Use native is_expired instead of redundant JS calculation
Bug-36454-QA-follow-up-Use-native-isexpired-instea.patch (text/plain), 2.76 KB, created by
Pedro Amorim
on 2024-11-18 09:31:15 UTC
(
hide
)
Description:
Bug 36454: (QA follow-up) Use native is_expired instead of redundant JS calculation
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-11-18 09:31:15 UTC
Size:
2.76 KB
patch
obsolete
>From 8d8c969d0cc7d6a229a89a5c6332ece167242193 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Mon, 18 Nov 2024 09:30:52 +0000 >Subject: [PATCH] Bug 36454: (QA follow-up) Use native is_expired instead of > redundant JS calculation > >Test plan: >1) $ yarn api:bundle >2) $ koha-plack --restart kohadev >3) Make a patron expired, search for them. Verify the 'expired' badge still shows >--- > Koha/Patron.pm | 4 ++++ > api/v1/swagger/definitions/patron.yaml | 4 ++++ > koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 8 +------- > 3 files changed, 9 insertions(+), 7 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 48b2ee75c7..20ac75196d 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -2519,6 +2519,10 @@ sub to_api { > ? Mojo::JSON->true > : Mojo::JSON->false; > >+ $json_patron->{expired} = ( $self->is_expired ) >+ ? Mojo::JSON->true >+ : Mojo::JSON->false; >+ > return $json_patron; > } > >diff --git a/api/v1/swagger/definitions/patron.yaml b/api/v1/swagger/definitions/patron.yaml >index 331989f303..4adf5dcd53 100644 >--- a/api/v1/swagger/definitions/patron.yaml >+++ b/api/v1/swagger/definitions/patron.yaml >@@ -209,6 +209,10 @@ properties: > - boolean > - "null" > description: set to 1 if library marked this patron as having lost his card >+ expired: >+ type: boolean >+ readOnly: true >+ description: If patron is expired > restricted: > type: boolean > readOnly: true >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index e993f8fe01..e76bf876f6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -695,12 +695,6 @@ function patron_autocomplete(node, options) { > } else { > loggedInClass = ""; > } >- let new_date = new Date(); >- let today = Date.parse($date_to_rfc3339($date(new_date.toString()))); >- let expiration = Date.parse( >- $date_to_rfc3339($date(item.expiry_date.toString())) >- ); >- let expired = today > expiration; > return $("<li></li>") > .addClass(loggedInClass) > .data("ui-autocomplete-item", item) >@@ -735,7 +729,7 @@ function patron_autocomplete(node, options) { > item.library.name.escapeHtml() + > "</span>" > : "") + >- (expired >+ (item.expired > ? '<span class="badge text-bg-warning">' + > __("Expired") + > "</span>" >-- >2.39.5
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 36454
:
171516
|
171630
|
171631
|
171632
|
171633
|
171839
|
171840
|
174671
|
174682
|
174684
|
174685
|
174686
|
174687