From 7c3c8f97392c448ac92649cf46fa97242ca3e67a 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 --- circ/circulation.pl | 6 +- installer/data/mysql/sysprefs.sql | 2 +- .../prog/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 +++ .../opac-tmpl/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 b5442e4..dc993fa 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -258,7 +258,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 ); @@ -296,7 +298,6 @@ if ($borrowernumber) { finetotal => $fines ); - my $patron = Koha::Patrons->find( $borrowernumber ); if ( $patron and $patron->is_debarred ) { $template->param( 'userdebarred' => $borrower->{debarred}, @@ -594,7 +595,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; @@ -623,6 +624,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 fd299d0..cb4fd95 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -43,11 +43,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 0000000..0bcf8b0 --- /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 7a93511..1606cb0 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 @@ @@ -980,6 +987,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 8212451..68d3e2e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -484,6 +484,11 @@ function validate1(date) { 0 Holds [% END %] + [% IF Koha.Preference('ArticleRequests') %] +
  • + [% patron.article_requests_current.count %] Article requests +
  • + [% END %]
  • [% debarments.size %] Restrictions
  • @@ -575,6 +580,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 f219140..37b6817 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -734,7 +734,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 9f3ae74..6ee8d9a 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -310,9 +310,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.1.4
    Article requests ([% borrower.article_requests_current.count %] total)
    Record title