Bug 14610 [QA Followup] - Implement staff patron tab

Also fixes a few other minor issues

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Kyle Hall 2016-09-14 13:39:19 +00:00
parent 628b78eda6
commit bbcb2fbeaf
8 changed files with 124 additions and 10 deletions

View file

@ -261,7 +261,9 @@ if ($findborrower) {
} }
# get the borrower information..... # get the borrower information.....
my $patron;
if ($borrowernumber) { if ($borrowernumber) {
$patron = Koha::Patrons->find( $borrowernumber );
$borrower = GetMemberDetails( $borrowernumber, 0 ); $borrower = GetMemberDetails( $borrowernumber, 0 );
my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber ); my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
@ -299,7 +301,6 @@ if ($borrowernumber) {
finetotal => $fines finetotal => $fines
); );
my $patron = Koha::Patrons->find( $borrowernumber );
if ( $patron and $patron->is_debarred ) { if ( $patron and $patron->is_debarred ) {
$template->param( $template->param(
'userdebarred' => $borrower->{debarred}, 'userdebarred' => $borrower->{debarred},
@ -596,7 +597,7 @@ my $view = $batch
my @relatives; my @relatives;
if ( $borrowernumber ) { if ( $borrowernumber ) {
if ( my $patron = Koha::Patrons->find( $borrower->{borrowernumber} ) ) { if ( $patron ) {
if ( my $guarantor = $patron->guarantor ) { if ( my $guarantor = $patron->guarantor ) {
push @relatives, $guarantor->borrowernumber; push @relatives, $guarantor->borrowernumber;
push @relatives, $_->borrowernumber for $patron->siblings; push @relatives, $_->borrowernumber for $patron->siblings;
@ -626,6 +627,7 @@ if ($restoreduedatespec || $stickyduedate) {
} }
$template->param( $template->param(
patron => $patron,
librarian_messages => $librarian_messages, librarian_messages => $librarian_messages,
patron_messages => $patron_messages, patron_messages => $patron_messages,
borrower => $borrower, borrower => $borrower,

View file

@ -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'), ('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'), ('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',''), ('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'), ('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'), ('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'), ('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'), ('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'), ('AuthDisplayHierarchy','0','','Display authority hierarchies','YesNo'),
('AuthoritiesLog','1',NULL,'If ON, log edit/create/delete actions on authorities.','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'), ('AuthoritySeparator','--','10','Used to separate a list of authorities in a display. Usually --','free'),

View file

@ -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>

View file

@ -252,22 +252,22 @@
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="ar-actions"> <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="ar-actions">
<li> <li>
<a class="ar-process-request" href="#" onclick="Process( [% ar.id %], $(this) ); return false;"> <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 Process request
</a> </a>
<a class="ar-complete-request" href="#" onclick="Complete( [% ar.id %], $(this) ); return false;"> <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 Complete request
</a> </a>
<a class="ar-cancel-request" href="#" onclick="Cancel( [% ar.id %], $(this) ); return false;"> <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 Cancel request
</a> </a>
<a class="ar-print-request" href="#" onclick="PrintSlip('article-request-slip.pl?id=[% ar.id %]'); return false;"> <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 Print slip
</a> </a>
</li> </li>

View file

@ -896,6 +896,13 @@ No patron matched <span class="ex">[% message | html %]</span>
[% ELSE %] [% ELSE %]
<a href="#reserves" id="holds-tab">0 Holds</a> <a href="#reserves" id="holds-tab">0 Holds</a>
[% END %] [% 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> <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.size %] Restrictions</a></li>
</ul> </ul>
@ -984,6 +991,10 @@ No patron matched <span class="ex">[% message | html %]</span>
[% END %] [% END %]
</div> <!-- reservesloop --> </div> <!-- reservesloop -->
[% IF Koha.Preference('ArticleRequests') %]
[% INCLUDE 'patron-article-requests.inc' %]
[% END %]
[% ELSIF borrowernumber %] [% 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> <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--> [% END %] <!-- borrowernumber and borrower-->

View file

@ -513,6 +513,11 @@ function validate1(date) {
<a href="#reserves" id="holds-tab">0 Holds</a> <a href="#reserves" id="holds-tab">0 Holds</a>
[% END %] [% END %]
</li> </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> <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.size %] Restrictions</a></li>
</ul> </ul>
@ -604,6 +609,11 @@ function validate1(date) {
[% ELSE %]<p>Patron has nothing on hold.</p>[% END %] [% ELSE %]<p>Patron has nothing on hold.</p>[% END %]
</div> </div>
[% IF Koha.Preference('ArticleRequests') %]
[% INCLUDE 'patron-article-requests.inc' %]
[% END %]
</div> </div>
[% END %] <!-- unknowuser --> [% END %] <!-- unknowuser -->

View file

@ -722,7 +722,6 @@ Using this account is not recommended because some parts of Koha will not functi
<div id="opac-user-article-requests"> <div id="opac-user-article-requests">
<table id="article-requests-table" class="table table-bordered table-striped"> <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> <caption>Article requests <span class="count">([% borrower.article_requests_current.count %] total)</span></caption>
<!-- RESERVES TABLE ROWS -->
<thead> <thead>
<tr> <tr>
<th class="anti-the">Record title</th> <th class="anti-the">Record title</th>

View file

@ -323,9 +323,10 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) {
} }
# in template <TMPL_IF name="I"> => instutitional (A for Adult, C for children) # 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( $template->param(
detailview => 1, patron => $patron,
detailview => 1,
borrowernumber => $borrowernumber, borrowernumber => $borrowernumber,
othernames => $data->{'othernames'}, othernames => $data->{'othernames'},
categoryname => $data->{'description'}, categoryname => $data->{'description'},