From e464e93c1717664a09680ae14df74259607f6795 Mon Sep 17 00:00:00 2001 From: Kyle M Hall <kyle@bywatersolutions.com> 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 eaecef7..45322b2 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 f1bf34b..0148370 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 0000000..0bcf8b0 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-article-requests.inc @@ -0,0 +1,91 @@ +<div id="article-requests"> +[% IF patron.article_requests_current.count %] + <table id="article-requests-table" class="table table-bordered table-striped"> + <thead> + <tr> + <th class="anti-the">Record title</th> + <th class="psort">Placed on</th> + <th class="anti-the">Title</th> + <th>Author</th> + <th>Volume</th> + <th>Issue</th> + <th>Date</th> + <th>Pages</th> + <th>Chapters</th> + <th>Notes</th> + <th>Status</th> + <th>Pickup library</th> + </tr> + </thead> + + <tbody> + [% FOREACH ar IN patron.article_requests_current %] + <tr> + <td class="article-request-title"> + <a class="article-request-title" href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% ar.biblionumber %]"> + [% ar.biblio.title %] + [% ar.item.enumchron %] + </a> + [% ar.biblio.author %] + [% IF ar.itemnumber %] <i>(only [% ar.item.barcode %])</i>[% END %] + </td> + + <td class="article-request-created_on"> + [% ar.created_on | $KohaDates %] + </td> + + <td class="article-request-title"> + [% ar.title %] + </td> + + <td class="article-request-author"> + [% ar.author %] + </td> + + <td class="article-request-volume"> + [% ar.volume %] + </td> + + <td class="article-request-issue"> + [% ar.issue %] + </td> + + <td class="article-request-date"> + [% ar.date %] + </td> + + <td class="article-request-pages"> + [% ar.pages %] + </td> + + <td class="article-request-chapters"> + [% ar.chapters %] + </td> + + <td class="article-request-patron-notes"> + [% ar.patron_notes %] + </td> + + <td class="article-request-status"> + [% IF ar.status == 'PENDING' %] + Pending + [% ELSIF ar.status == 'PROCESSING' %] + Processing + [% ELSIF ar.status == 'COMPLETED' %] + Completed + [% ELSIF ar.status == 'CANCELED' %] + Canceled + [% END %] + </td> + + <td class="article-request-branchcode"> + [% ar.branch.branchname %] + </td> + </tr> + [% END %] + </tbody> + </table> + [% ELSE %] + Patron has no current article requests. + [% END %] +</div> 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 @@ <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="ar-actions"> <li> <a class="ar-process-request" href="#" onclick="Process( [% ar.id %], $(this) ); return false;"> - <i class="icon-ok-circle"></i> + <i class="fa fa-cog"></i> Process request </a> <a class="ar-complete-request" href="#" onclick="Complete( [% ar.id %], $(this) ); return false;"> - <i class="icon-ok-circle"></i> + <i class="fa fa-check-circle"></i> Complete request </a> <a class="ar-cancel-request" href="#" onclick="Cancel( [% ar.id %], $(this) ); return false;"> - <i class="icon-remove-circle"></i> + <i class="fa fa-minus-circle"></i> Cancel request </a> <a class="ar-print-request" href="#" onclick="PrintSlip('article-request-slip.pl?id=[% ar.id %]'); return false;"> - <i class="icon-print"></i> + <i class="fa fa-print"></i> Print slip </a> </li> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index e0284b2..7111ef9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -896,6 +896,13 @@ No patron matched <span class="ex">[% message | html %]</span> [% ELSE %] <a href="#reserves" id="holds-tab">0 Holds</a> [% END %] + </li> + + [% IF Koha.Preference('ArticleRequests') %] + <li> + <a href="#article-requests" id="article-requests-tab"> [% patron.article_requests_current.count %] Article requests</a> + </li> + [% END %] <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.size %] Restrictions</a></li> </ul> @@ -984,6 +991,10 @@ No patron matched <span class="ex">[% message | html %]</span> [% END %] </div> <!-- reservesloop --> +[% IF Koha.Preference('ArticleRequests') %] + [% INCLUDE 'patron-article-requests.inc' %] +[% END %] + [% ELSIF borrowernumber %] <div class="dialog message">This patron does not exist. <a href="/cgi-bin/koha/members/members-home.pl">Find another patron?</a></div> [% END %] <!-- borrowernumber and borrower--> 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 39da12e..a5008ca 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) { <a href="#reserves" id="holds-tab">0 Holds</a> [% END %] </li> + [% IF Koha.Preference('ArticleRequests') %] + <li> + <a href="#article-requests" id="article-requests-tab"> [% patron.article_requests_current.count %] Article requests</a> + </li> + [% END %] <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.size %] Restrictions</a></li> </ul> @@ -604,6 +609,11 @@ function validate1(date) { [% ELSE %]<p>Patron has nothing on hold.</p>[% END %] </div> + +[% IF Koha.Preference('ArticleRequests') %] + [% INCLUDE 'patron-article-requests.inc' %] +[% END %] + </div> [% END %] <!-- unknowuser --> 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 a242d44..70def8c 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 <div id="opac-user-article-requests"> <table id="article-requests-table" class="table table-bordered table-striped"> <caption>Article requests <span class="count">([% borrower.article_requests_current.count %] total)</span></caption> - <!-- RESERVES TABLE ROWS --> <thead> <tr> <th class="anti-the">Record title</th> diff --git a/members/moremember.pl b/members/moremember.pl index 91fdc1f..01d16b6 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -323,9 +323,10 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) { } # in template <TMPL_IF name="I"> => 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