Bugzilla – Attachment 133365 Details for
Bug 30553
Add a count to the Files tab in the patron account
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30553: Add file count to patron circ-menu
Bug-30553-Add-file-count-to-patron-circ-menu.patch (text/plain), 2.41 KB, created by
Lucas Gass
on 2022-04-15 21:29:43 UTC
(
hide
)
Description:
Bug 30553: Add file count to patron circ-menu
Filename:
MIME Type:
Creator:
Lucas Gass
Created:
2022-04-15 21:29:43 UTC
Size:
2.41 KB
patch
obsolete
>From 2f13941e60e5a407e38bad6afb304fffd28c51b6 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 15 Apr 2022 21:22:59 +0000 >Subject: [PATCH] Bug 30553: Add file count to patron circ-menu > >To test: >1. Apply patch >2. Enable the system preference 'EnableBorrowerFiles' >3. Go to a patron account and noticet the Files tab on left nav bar. >4. It should read "Files (0)" >5. Begin uploading some files to the borrower. The tab should reflect the number of files uploaded. >6. Go to other pages on the borrower account ( Checkout, Details, etc. ) >7. The number of files should display from all borrower pages >--- > Koha/Patron.pm | 12 ++++++++++++ > .../intranet-tmpl/prog/en/includes/circ-menu.inc | 2 +- > 2 files changed, 13 insertions(+), 1 deletion(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index e88e72551c..e9d5fba881 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -45,6 +45,7 @@ use Koha::Patron::Debarments; > use Koha::Patron::HouseboundProfile; > use Koha::Patron::HouseboundRole; > use Koha::Patron::Images; >+use Koha::Patron::Files; > use Koha::Patron::Messages; > use Koha::Patron::Modifications; > use Koha::Patron::Relationships; >@@ -436,6 +437,17 @@ sub image { > return Koha::Patron::Images->find( $self->borrowernumber ); > } > >+=head3 filecount >+ >+=cut >+ >+sub filecount { >+ my ( $self ) = @_; >+ >+ my $files = Koha::Patron::Files->new( borrowernumber => $self->borrowernumber )->GetFilesInfo(); >+ return $files; >+} >+ > =head3 library > > Returns a Koha::Library object representing the patron's home library. >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >index 926008ed94..dfb976f70d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >@@ -159,7 +159,7 @@ > [% END %] > [% IF CAN_user_borrowers_edit_borrowers %] > [% IF ( EnableBorrowerFiles ) %] >- [% IF ( borrower_files ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/files.pl?borrowernumber=[% patron.borrowernumber | uri %]">Files</a></li> >+ [% IF ( borrower_files ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/files.pl?borrowernumber=[% patron.borrowernumber | uri %]">Files ([% patron.filecount.size | html%])</a></li> > [% END %] > [% END %] > >-- >2.30.2
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 30553
:
133365
|
133480
|
133847
|
134287