Created attachment 144337 [details] Photo of patron account with restriction and flags (where I'd love to see the date they were placed) It would be nice to see the date a restriction was placed, without having to go in and view the restrictions. We are planning to add a more detailed message about the restriction, so it would be nice to be able to look for the date without having to leave the page. It would also be nice to get a date for when the lost card and gone--no address flags were added. (See attached photo.)
Created attachment 144796 [details] [review] Bug 32373: Show patron restriction date When viewing a patron account with a restriction there is no way to see when the restriction was placed. This is available in the borrower_debarrments table and has now been added to the UI. Test plan: 1) Create a restriction on a patron and navigate to that patron in Checkouts 2) There should be a message with details about the restriction but the creation date of the restriction won't be included in the message 3) Apply patch 4) The message should now say "Restricted since DATE" as in the screenshot attached.
Created attachment 144797 [details] Patch showing patron restriction date
Created attachment 144807 [details] [review] Bug 32373: Show patron restriction date When viewing a patron account with a restriction there is no way to see when the restriction was placed. This is available in the borrower_debarrments table and has now been added to the UI. Test plan: 1) Create a restriction on a patron and navigate to that patron in Checkouts 2) There should be a message with details about the restriction but the creation date of the restriction won't be included in the message 3) Apply patch 4) The message should now say "Restricted since DATE" as in the screenshot attached. Signed-off-by: David Nind <david@davidnind.com>
Hi Matt. I've signed off, but should the date be displayed using the format set in the dateformat system preference? (Similar to the way the rest of the restriction message displays if an expiration date is set, for example I set the date format to dd/mm/yyyy: "Restricted since 2022-12-22: Patron's account is restricted until 31/12/2022 with the explanation: ...".) I've also added a draft release note, and change the bug title to sentence case. David
Hi David, Its a good point about the date, I have used the timestamp that is created when a restriction is entered but this will be a generic SQL format. I will have a look at converting it to the syspref date format and re-submit. Matt
Created attachment 144813 [details] [review] Bug 32373: Show patron restriction date When viewing a patron account with a restriction there is no way to see when the restriction was placed. This is available in the borrower_debarrments table and has now been added to the UI and matched to the 'dateformat' syspref. (Previous commit missed the moremember.tt render and the syspref formatting) Test plan: 1) Create a restriction on a patron and navigate to that patron in Checkouts or the patron details page 2) There should be a message with details about the restriction but the creation date of the restriction won't be included in the message 3) Apply patch 4) The message should now say "Restricted since DATE" as in the screenshot attached. 5) Change the 'dateformat' syspref and refresh, the date should change to reflect the syspref
Created attachment 144815 [details] [review] Bug 32373: Show patron restriction date When viewing a patron account with a restriction there is no way to see when the restriction was placed. This is available in the borrower_debarrments table and has now been added to the UI and matched to the 'dateformat' syspref. (Previous commit missed the moremember.tt render and the syspref formatting) Test plan: 1) Create a restriction on a patron and navigate to that patron in Checkouts or the patron details page 2) There should be a message with details about the restriction but the creation date of the restriction won't be included in the message 3) Apply patch 4) The message should now say "Restricted since DATE" as in the screenshot attached. 5) Change the 'dateformat' syspref and refresh, the date should change to reflect the syspref
Created attachment 144828 [details] [review] Bug 32373: Show patron restriction date When viewing a patron account with a restriction there is no way to see when the restriction was placed. This is available in the borrower_debarrments table and has now been added to the UI and matched to the 'dateformat' syspref. (Previous commit missed the moremember.tt render and the syspref formatting) Test plan: 1) Create a restriction on a patron and navigate to that patron in Checkouts or the patron details page 2) There should be a message with details about the restriction but the creation date of the restriction won't be included in the message 3) Apply patch 4) The message should now say "Restricted since DATE" as in the screenshot attached. 5) Change the 'dateformat' syspref and refresh, the date should change to reflect the syspref Signed-off-by: David Nind <david@davidnind.com>
(In reply to Matt Blenkinsop from comment #5) > Hi David, > > Its a good point about the date, I have used the timestamp that is created > when a restriction is entered but this will be a generic SQL format. I will > have a look at converting it to the syspref date format and re-submit. > > Matt Thanks Matt! Now signed off. David
Hi Matt, have a look at the KohaDates TT filter. It will format the date nicely for you according to the DAteFormat system preference.
Some of the variables have a little typo: $debarrment -> debarment Might be nice to fix to avoid confusion in the future.
(In reply to Katrin Fischer from comment #10) > Hi Matt, have a look at the KohaDates TT filter. It will format the date > nicely for you according to the DAteFormat system preference. Thanks for the hint Katrin, I have used the filter and also fixed the typo - resubmitted for sign-off
Created attachment 144931 [details] [review] Bug 32373: Show patron restriction date When viewing a patron account with a restriction there is no way to see when the restriction was placed. This is available in the borrower_debarrments table and has now been added to the UI and matched to the 'dateformat' syspref. (Previous commit missed the moremember.tt render and the syspref formatting - this is now being done with the KohaDates template filter) Test plan: 1) Create a restriction on a patron and navigate to that patron in Checkouts or the patron details page 2) There should be a message with details about the restriction but the creation date of the restriction won't be included in the message 3) Apply patch 4) The message should now say "Restricted since DATE" as in the screenshot attached. 5) Change the 'dateformat' syspref and refresh, the date should change to reflect the syspref
I believe this could be removed again now, could you confirm? -use Koha::DateUtils qw( dt_from_string ); +use Koha::DateUtils qw( dt_from_string format_sqldatetime );
(In reply to Katrin Fischer from comment #14) > I believe this could be removed again now, could you confirm? > -use Koha::DateUtils qw( dt_from_string ); > +use Koha::DateUtils qw( dt_from_string format_sqldatetime ); Yes, it looks like 'format_sqldatetime' is not needed.
Created attachment 144942 [details] [review] Bug 32373: (follow-up) Show patron restriction date Unnecessary import of format_sqldatetime has now been removed Test plan: 1) Create a restriction on a patron and navigate to that patron in Checkouts or the patron details page 2) There should be a message with details about the restriction but the creation date of the restriction won't be included in the message 3) Apply patch 4) The message should now say "Restricted since DATE" as in the screenshot attached. 5) Change the 'dateformat' syspref and refresh, the date should change to reflect the syspref
Created attachment 144943 [details] [review] Bug 32373: Show patron restriction date When viewing a patron account with a restriction there is no way to see when the restriction was placed. This is available in the borrower_debarrments table and has now been added to the UI and matched to the 'dateformat' syspref. (Previous commit missed the moremember.tt render and the syspref formatting - this is now being done with the KohaDates template filter) Test plan: 1) Create a restriction on a patron and navigate to that patron in Checkouts or the patron details page 2) There should be a message with details about the restriction but the creation date of the restriction won't be included in the message 3) Apply patch 4) The message should now say "Restricted since DATE" as in the screenshot attached. 5) Change the 'dateformat' syspref and refresh, the date should change to reflect the syspref Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 144944 [details] [review] Bug 32373: (follow-up) Show patron restriction date Unnecessary import of format_sqldatetime has now been removed Test plan: 1) Create a restriction on a patron and navigate to that patron in Checkouts or the patron details page 2) There should be a message with details about the restriction but the creation date of the restriction won't be included in the message 3) Apply patch 4) The message should now say "Restricted since DATE" as in the screenshot attached. 5) Change the 'dateformat' syspref and refresh, the date should change to reflect the syspref Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Bug 31095 removed GetDebarments. This could be rewritten to use Koha::Patron::restrictions, and would require only template modifications.
Created attachment 146693 [details] [review] Bug 32373: Show patron restriction date This is a rebased submission following bug 31095 which removed the use of GetDebarments. This patch now uses $patron->restrictions to find the date and pass it to the template Test plan: 1) Create a restriction on a patron and navigate to that patron in Checkouts or the patron details page 2) There should be a message with details about the restriction but the creation date of the restriction won't be included in the message 3) Apply patch 4) The message should now say "Restricted since DATE" as in the screenshot attached. 5) Change the 'dateformat' syspref and refresh, the date should change to reflect the syspref
I received the following error: "NameError: global name 'host' is not defined" (In reply to Matt Blenkinsop from comment #20) > Created attachment 146693 [details] [review] [review] > Bug 32373: Show patron restriction date > > This is a rebased submission following bug 31095 which removed the use of > GetDebarments. This patch now uses $patron->restrictions to find the date > and pass it to the template > > Test plan: > 1) Create a restriction on a patron and navigate to that patron in Checkouts > or the patron details page > 2) There should be a message with details about the restriction but the > creation date of the restriction won't be included in the message > 3) Apply patch > 4) The message should now say "Restricted since DATE" as in the screenshot > attached. > 5) Change the 'dateformat' syspref and refresh, the date should change to > reflect the syspref
Hi Laura, Where are you seeing this error? I just applied the patch onto a fresh branch and can't see a similar error anywhere
(In reply to Matt Blenkinsop from comment #22) > Hi Laura, > > Where are you seeing this error? I just applied the patch onto a fresh > branch and can't see a similar error anywhere Please disregard the error message. It looks like it's exclusive to the Sandboxes. My apologies!
Created attachment 147230 [details] [review] Bug 32373: Show patron restriction date This is a rebased submission following bug 31095 which removed the use of GetDebarments. This patch now uses $patron->restrictions to find the date and pass it to the template Test plan: 1) Create a restriction on a patron and navigate to that patron in Checkouts or the patron details page 2) There should be a message with details about the restriction but the creation date of the restriction won't be included in the message 3) Apply patch 4) The message should now say "Restricted since DATE" as in the screenshot attached. 5) Change the 'dateformat' syspref and refresh, the date should change to reflect the syspref Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Works as described, thanks for the patch.
(In reply to PTFS Europe Sandboxes from comment #24) > Created attachment 147230 [details] [review] [review] > Bug 32373: Show patron restriction date > > This is a rebased submission following bug 31095 which removed the use of > GetDebarments. This patch now uses $patron->restrictions to find the date > and pass it to the template > > Test plan: > 1) Create a restriction on a patron and navigate to that patron in Checkouts > or the patron details page > 2) There should be a message with details about the restriction but the > creation date of the restriction won't be included in the message > 3) Apply patch > 4) The message should now say "Restricted since DATE" as in the screenshot > attached. > 5) Change the 'dateformat' syspref and refresh, the date should change to > reflect the syspref > > Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Created attachment 147763 [details] [review] Bug 32373: Show patron restriction date This is a rebased submission following bug 31095 which removed the use of GetDebarments. This patch now uses $patron->restrictions to find the date and pass it to the template Test plan: 1) Create a restriction on a patron and navigate to that patron in Checkouts or the patron details page 2) There should be a message with details about the restriction but the creation date of the restriction won't be included in the message 3) Apply patch 4) The message should now say "Restricted since DATE" as in the screenshot attached. 5) Change the 'dateformat' syspref and refresh, the date should change to reflect the syspref Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 147764 [details] [review] Bug 32373: Show patron restriction date This is a rebased submission following bug 31095 which removed the use of GetDebarments. This patch now uses $patron->restrictions to find the date and pass it to the template Test plan: 1) Create a restriction on a patron and navigate to that patron in Checkouts or the patron details page 2) There should be a message with details about the restriction but the creation date of the restriction won't be included in the message 3) Apply patch 4) The message should now say "Restricted since DATE" as in the screenshot attached. 5) Change the 'dateformat' syspref and refresh, the date should change to reflect the syspref Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Added Laura's sign-off line to the patch. Thx, Matt!
Pushed to master for 23.05. Nice work everyone, thanks!
Enhancement - not backporting to 22.11.x Nice work everyone!