From bbcb2fbeaf0e463dcb7960336f86dee61f1fb4d8 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 14 Sep 2016 13:39:19 +0000 Subject: [PATCH] Bug 14610 [QA Followup] - Implement staff patron tab Also fixes a few other minor issues Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall --- circ/circulation.pl | 6 +- installer/data/mysql/sysprefs.sql | 2 +- .../en/includes/patron-article-requests.inc | 91 +++++++++++++++++++ .../prog/en/modules/circ/article-requests.tt | 8 +- .../prog/en/modules/circ/circulation.tt | 11 +++ .../prog/en/modules/members/moremember.tt | 10 ++ .../bootstrap/en/modules/opac-user.tt | 1 - members/moremember.pl | 5 +- 8 files changed, 124 insertions(+), 10 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/patron-article-requests.inc diff --git a/circ/circulation.pl b/circ/circulation.pl index eaecef7fc7..45322b2a1c 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -261,7 +261,9 @@ if ($findborrower) { } # get the borrower information..... +my $patron; if ($borrowernumber) { + $patron = Koha::Patrons->find( $borrowernumber ); $borrower = GetMemberDetails( $borrowernumber, 0 ); my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber ); @@ -299,7 +301,6 @@ if ($borrowernumber) { finetotal => $fines ); - my $patron = Koha::Patrons->find( $borrowernumber ); if ( $patron and $patron->is_debarred ) { $template->param( 'userdebarred' => $borrower->{debarred}, @@ -596,7 +597,7 @@ my $view = $batch my @relatives; if ( $borrowernumber ) { - if ( my $patron = Koha::Patrons->find( $borrower->{borrowernumber} ) ) { + if ( $patron ) { if ( my $guarantor = $patron->guarantor ) { push @relatives, $guarantor->borrowernumber; push @relatives, $_->borrowernumber for $patron->siblings; @@ -626,6 +627,7 @@ if ($restoreduedatespec || $stickyduedate) { } $template->param( + patron => $patron, librarian_messages => $librarian_messages, patron_messages => $patron_messages, borrower => $borrower, diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index f1bf34b709..0148370c4e 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -44,11 +44,11 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AmazonLocale','US','US|CA|DE|FR|JP|UK','Use to set the Locale of your Amazon.com Web Services','Choice'), ('AnonSuggestions','0',NULL,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber','YesNo'), ('AnonymousPatron','0',NULL,'Set the identifier (borrowernumber) of the anonymous patron. Used for Suggestion and reading history privacy',''), -('AudioAlerts','0','','Enable circulation sounds during checkin and checkout in the staff interface. Not supported by all web browsers yet.','YesNo'), ('ArticleRequests', '0', NULL, 'Enables the article request feature', 'YesNo'), ('ArticleRequestsMandatoryFields', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''yes''', 'multiple'), ('ArticleRequestsMandatoryFieldsItemsOnly', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''item_only''', 'multiple'), ('ArticleRequestsMandatoryFieldsRecordOnly', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''bib_only''', 'multiple'), +('AudioAlerts','0','','Enable circulation sounds during checkin and checkout in the staff interface. Not supported by all web browsers yet.','YesNo'), ('AuthDisplayHierarchy','0','','Display authority hierarchies','YesNo'), ('AuthoritiesLog','1',NULL,'If ON, log edit/create/delete actions on authorities.','YesNo'), ('AuthoritySeparator','--','10','Used to separate a list of authorities in a display. Usually --','free'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-article-requests.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-article-requests.inc new file mode 100644 index 0000000000..0bcf8b0212 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-article-requests.inc @@ -0,0 +1,91 @@ +
+[% IF patron.article_requests_current.count %] + + + + + + + + + + + + + + + + + + + + [% FOREACH ar IN patron.article_requests_current %] + + + + + + + + + + + + + + + + + + + + + + + + + + [% END %] + +
Record titlePlaced onTitleAuthorVolumeIssueDatePagesChaptersNotesStatusPickup library
+ + [% ar.biblio.title %] + [% ar.item.enumchron %] + + [% ar.biblio.author %] + [% IF ar.itemnumber %] (only [% ar.item.barcode %])[% END %] + + [% ar.created_on | $KohaDates %] + + [% ar.title %] + + [% ar.author %] + + [% ar.volume %] + + [% ar.issue %] + + [% ar.date %] + + [% ar.pages %] + + [% ar.chapters %] + + [% ar.patron_notes %] + + [% IF ar.status == 'PENDING' %] + Pending + [% ELSIF ar.status == 'PROCESSING' %] + Processing + [% ELSIF ar.status == 'COMPLETED' %] + Completed + [% ELSIF ar.status == 'CANCELED' %] + Canceled + [% END %] + + [% ar.branch.branchname %] +
+ [% ELSE %] + Patron has no current article requests. + [% END %] +
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt index 7a93511e56..1606cb0054 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt @@ -252,22 +252,22 @@ @@ -984,6 +991,10 @@ No patron matched [% message | html %] [% END %] +[% IF Koha.Preference('ArticleRequests') %] + [% INCLUDE 'patron-article-requests.inc' %] +[% END %] + [% ELSIF borrowernumber %]
This patron does not exist. Find another patron?
[% END %] 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 39da12e22c..a5008cabf2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -513,6 +513,11 @@ function validate1(date) { 0 Holds [% END %] + [% IF Koha.Preference('ArticleRequests') %] +
  • + [% patron.article_requests_current.count %] Article requests +
  • + [% END %]
  • [% debarments.size %] Restrictions
  • @@ -604,6 +609,11 @@ function validate1(date) { [% ELSE %]

    Patron has nothing on hold.

    [% END %] + +[% IF Koha.Preference('ArticleRequests') %] + [% INCLUDE 'patron-article-requests.inc' %] +[% END %] + [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index a242d44a13..70def8cc41 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -722,7 +722,6 @@ Using this account is not recommended because some parts of Koha will not functi
    - diff --git a/members/moremember.pl b/members/moremember.pl index 91fdc1f610..01d16b681a 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -323,9 +323,10 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) { } # in template => instutitional (A for Adult, C for children) -$template->param( $data->{'categorycode'} => 1 ); +$template->param( $data->{'categorycode'} => 1 ); $template->param( - detailview => 1, + patron => $patron, + detailview => 1, borrowernumber => $borrowernumber, othernames => $data->{'othernames'}, categoryname => $data->{'description'}, -- 2.39.5
    Article requests ([% borrower.article_requests_current.count %] total)
    Record title