From ccc23c6ce0c0fddcd0cdc325598149fe6e05d492 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 fcd967d..cba734e 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -260,7 +260,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 ); @@ -298,7 +300,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; @@ -625,6 +626,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 960b4ab..7b2733d 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 @@ @@ -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 c5325e1..f7f2891 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -485,6 +485,11 @@ function validate1(date) { 0 Holds [% END %] + [% IF Koha.Preference('ArticleRequests') %] +
  • + [% patron.article_requests_current.count %] Article requests +
  • + [% END %]
  • [% debarments.size %] Restrictions
  • @@ -576,6 +581,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 a6ae7f9..5e8dbe8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -735,7 +735,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 00e2600..b663830 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -320,9 +320,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