From: Owen Leonard Date: Mon, 27 Jul 2020 15:57:40 +0000 (+0000) Subject: Bug 21345: Patron records with attached files not obvious from patron details view X-Git-Url: http://git.equinoxoli.org/?p=koha.git;a=commitdiff_plain;h=75e25c9d38edc86f7cd545e55b919624f92e2716 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 --- 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 5803963..11f9897 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 93efa7a..5d7d522 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;