From 318785f003a02f6c1cd92fd334bc400ac6009b53 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 --- .../prog/en/modules/members/moremember.tt | 24 +++++++++++++++++++ members/moremember.pl | 2 ++ 2 files changed, 26 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..d13fdd2da4 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,30 @@ [% END %] [% # /div#patron-alternative-contact %] + +
+
+

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 %] + +
+
+ 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.20.1