From 75e25c9d38edc86f7cd545e55b919624f92e2716 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 27 Jul 2020 15:57:40 +0000 Subject: [PATCH] Bug 21345: Patron records with attached files not obvious from patron details view This patch adds a section to the patron details page for listing files which have been attached to the patron record. To test, apply the patch and enable the EnableBorrowerFiles system preference. - If necessary, attach some files to a patron record by viewing a patron record and choosing "Files" from the sidebar menu. - View the detail page (moremember.pl) for a patron who has files attached. - You should see a new section under "Alternative contact" with the heading "Files." - Test the "Manage" button to make sure it takes you to that patron's files. - Confirm that all the attached files are listed. - Confirm that the links to each file work correctly. Signed-off-by: Sally Signed-off-by: Barbara Johnson Signed-off-by: Katrin Fischer JD amended patch: replace a html filter with uri Bug 21345: (follow-up) Hide files information if EnableBorrowerFiles is disabled This patch wraps the new patron file information in a check for the EnableBorrowerFiles system preference. Signed-off-by: Jonathan Druart --- .../prog/en/modules/members/moremember.tt | 26 +++++++++++++++++++ members/moremember.pl | 2 ++ 2 files changed, 28 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 5803963479..11f9897ef0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -700,6 +700,32 @@ [% END %] [% # /div#patron-alternative-contact %] + + [% IF Koha.Preference('EnableBorrowerFiles') %] +
+
+

Files

+ Manage + + [% IF ( files ) %] +
+
    + [% FOREACH f IN files %] +
  1. + [% f.file_name | html %] + [% IF ( f.file_description ) %] + - [% f.file_description | html %] + [% END %] +
  2. + [% END # /FOREACH f %] +
+
+ [% END # /IF files %] + +
+
+ [% END # /IF EnableBorrowerFiles %] + diff --git a/members/moremember.pl b/members/moremember.pl index 93efa7a4b5..5d7d5227c8 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -40,6 +40,7 @@ use Koha::Patron::Messages; use Koha::DateUtils; use Koha::CsvProfiles; use Koha::Patrons; +use Koha::Patron::Files; use Koha::Token; use Koha::Checkouts; @@ -209,6 +210,7 @@ $template->param( relatives_issues_count => $relatives_issues_count, relatives_borrowernumbers => \@relatives, logged_in_user => $logged_in_user, + files => Koha::Patron::Files->new( borrowernumber => $borrowernumber ) ->GetFilesInfo(), ); output_html_with_http_headers $input, $cookie, $template->output; -- 2.39.5