Bug 14919: Add holds history for patron
Test plan: 0) Have a patron with some current and old reserves 1) Go to patron circulation page 2) Notice, there is new item called "Holds history" in the left circulation menu 3) Go to this page and confirm the data on this page are OK, and that ui does behave as expected 4) Go to adminitration, columns setting, try to change the setting for holdshistory table and confirm it is taken into account on holds history page Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
9a0853ef67
commit
4fa34acc41
4 changed files with 291 additions and 25 deletions
|
@ -255,43 +255,34 @@ modules:
|
|||
cannot_be_toggled: 1
|
||||
cannot_be_modified: 1
|
||||
|
||||
opac:
|
||||
biblio-detail:
|
||||
holdingst:
|
||||
holdshistory:
|
||||
holdshistory-table:
|
||||
-
|
||||
columnname: item_itemtype
|
||||
columnname: title
|
||||
cannot_be_toggled: 1
|
||||
cannot_be_modified: 1
|
||||
-
|
||||
columnname: item_current_location
|
||||
columnname: author
|
||||
-
|
||||
columnname: item_home_location
|
||||
columnname: barcode
|
||||
-
|
||||
columnname: item_shelving_location
|
||||
is_hidden: 1
|
||||
columnname: branch
|
||||
-
|
||||
columnname: item_ccode
|
||||
columnname: reservedate
|
||||
-
|
||||
columnname: item_callnumber
|
||||
columnname: notificationdate
|
||||
-
|
||||
columnname: item_enumchron
|
||||
columnname: reminderdate
|
||||
-
|
||||
columnname: item_url
|
||||
columnname: expirationdate
|
||||
-
|
||||
columnname: item_copy
|
||||
columnname: waitingdate
|
||||
-
|
||||
columnname: item_status
|
||||
columnname: cancellationdate
|
||||
-
|
||||
columnname: item_notes
|
||||
columnname: itemtype
|
||||
-
|
||||
columnname: item_datedue
|
||||
-
|
||||
columnname: item_barcode
|
||||
is_hidden: 1
|
||||
-
|
||||
columnname: item_holds
|
||||
-
|
||||
columnname: item_priority
|
||||
-
|
||||
columnname: item_coursereserves
|
||||
columnname: status
|
||||
|
||||
reports:
|
||||
lostitems:
|
||||
|
@ -455,3 +446,42 @@ modules:
|
|||
columnname: locations
|
||||
-
|
||||
columnname: hold_date
|
||||
|
||||
opac:
|
||||
biblio-detail:
|
||||
holdingst:
|
||||
-
|
||||
columnname: item_itemtype
|
||||
-
|
||||
columnname: item_current_location
|
||||
-
|
||||
columnname: item_home_location
|
||||
-
|
||||
columnname: item_shelving_location
|
||||
is_hidden: 1
|
||||
-
|
||||
columnname: item_ccode
|
||||
-
|
||||
columnname: item_callnumber
|
||||
-
|
||||
columnname: item_enumchron
|
||||
-
|
||||
columnname: item_url
|
||||
-
|
||||
columnname: item_copy
|
||||
-
|
||||
columnname: item_status
|
||||
-
|
||||
columnname: item_notes
|
||||
-
|
||||
columnname: item_datedue
|
||||
-
|
||||
columnname: item_barcode
|
||||
is_hidden: 1
|
||||
-
|
||||
columnname: item_holds
|
||||
-
|
||||
columnname: item_priority
|
||||
-
|
||||
columnname: item_coursereserves
|
||||
|
||||
|
|
|
@ -88,6 +88,11 @@
|
|||
[% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]">Circulation history</a></li>
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% IF ( CAN_user_borrowers ) %]
|
||||
[% IF ( intranetreadinghistory ) %]
|
||||
[% IF ( holdshistoryview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/holdsshistory.pl?borrowernumber=[% borrowernumber %]">Holds history</a></li>
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% IF ( CAN_user_parameters ) %]
|
||||
[% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&modules=MEMBERS&modules=circulation&object=[% borrowernumber %]&src=circ">Modification log</a></li>
|
||||
[% END %]
|
||||
|
|
135
koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt
Normal file
135
koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt
Normal file
|
@ -0,0 +1,135 @@
|
|||
[% USE KohaDates %]
|
||||
[% USE Koha %]
|
||||
[% USE AuthorisedValues %]
|
||||
[% USE Branches %]
|
||||
[% USE ColumnsSettings %]
|
||||
[% INCLUDE 'doc-head-open.inc' %]
|
||||
<title>Holds history for [% INCLUDE 'patron-title.inc' %]</title>
|
||||
[% INCLUDE 'doc-head-close.inc' %]
|
||||
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
|
||||
[% INCLUDE 'datatables.inc' %]
|
||||
[% INCLUDE 'columns_settings.inc' %]
|
||||
<script type="text/javascript" id="js">
|
||||
//<![CDATA[
|
||||
|
||||
$(document).ready(function() {
|
||||
var columns_settings = [% ColumnsSettings.GetColumns('members', 'holdshistory', 'holdshistory-table', 'json') %];
|
||||
var table = KohaTable("#table_holdshistory", {
|
||||
"sPaginationType": "four_button",
|
||||
"aaSorting": [[4, 'desc']],
|
||||
"sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
|
||||
"aoColumnDefs": [
|
||||
{ "sType": "anti-the", "aTargets" : [ "anti-the" ] },
|
||||
{ "sType": "title-string", "aTargets" : [ "title-string" ] }
|
||||
]
|
||||
}, columns_settings);
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
<body id="pat_holdshistory" class="pat">
|
||||
[% INCLUDE 'header.inc' %]
|
||||
[% INCLUDE 'patron-search.inc' %]
|
||||
|
||||
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Holds history for [% INCLUDE 'patron-title.inc' %]</div>
|
||||
|
||||
<div id="doc3" class="yui-t2">
|
||||
<div id="bd">
|
||||
<div id="yui-main">
|
||||
<div class="yui-b">
|
||||
[% INCLUDE 'members-toolbar.inc' %]
|
||||
<h1>Holds history</h1>
|
||||
|
||||
[% UNLESS Koha.Preference('intranetreadinghistory') %]
|
||||
<div class="dialog alert">Staff members are not allowed to access patron's holds history</div>
|
||||
[% ELSIF is_anonymous %]
|
||||
<div class="dialog alert">This is the anonymous patron, so no holds history is displayed.</div>
|
||||
[% ELSIF ( !holds ) %]
|
||||
<div class="dialog message">This patron has no holds history.</div>
|
||||
[% ELSE %]
|
||||
|
||||
<div id="holdshistory" style="overflow:hidden">
|
||||
<table id="table_holdshistory">
|
||||
<thead>
|
||||
<th class="anti-the">Title</th>
|
||||
<th>Author</th>
|
||||
<th>Barcode</th>
|
||||
<th>Library</th>
|
||||
<th class="title-string">Reserve date</th>
|
||||
<th class="title-string">Notification date</th>
|
||||
<th class="title-string">Reminder date</th>
|
||||
<th class="title-string">Expiration date</th>
|
||||
<th class="title-string">Waiting date</th>
|
||||
<th class="title-string">Cancellation date</th>
|
||||
<th>Item type</th>
|
||||
<th>Status</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
[% FOREACH hold IN holds %]
|
||||
<td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.biblio.biblionumber %]">[% hold.biblio.title |html %]</a></td>
|
||||
<td>[% hold.biblio.author %]</td>
|
||||
<td>[% hold.item.barcode %]</td>
|
||||
<td>[% Branches.GetName( hold.branchcode ) %]</td>
|
||||
<td><span title="[% hold.reservedate %]">[% hold.reservedate | $KohaDates %]</span></td>
|
||||
<td>
|
||||
[% IF hold.notificationdate %]
|
||||
<span title="[% hold.notificationdate %]">[% hold.notificationdate | $KohaDates %]</span>
|
||||
[% ELSE %]
|
||||
<span title="0000-00-00"></span>
|
||||
[% END %]
|
||||
</td>
|
||||
<td>
|
||||
[% IF hold.reminderdate %]
|
||||
<span title="[% hold.reminderdate %]">[% hold.reminderdate | $KohaDates %]</span>
|
||||
[% ELSE %]
|
||||
<span title="0000-00-00"></span>
|
||||
[% END %]
|
||||
</td>
|
||||
<td>
|
||||
[% IF hold.expirationdate %]
|
||||
<span title="[% hold.expirationdate %]">[% hold.expirationdate | $KohaDates %]</span>
|
||||
[% ELSE %]
|
||||
<span title="0000-00-00"></span>
|
||||
[% END %]
|
||||
</td>
|
||||
<td>
|
||||
[% IF hold.waitingdate %]
|
||||
<span title="[% hold.waitingdate %]">[% hold.waitingdate | $KohaDates %]</span>
|
||||
[% ELSE %]
|
||||
<span title="0000-00-00"></span>
|
||||
[% END %]
|
||||
</td>
|
||||
<td>
|
||||
[% IF hold.cancellationdate %]
|
||||
<span title="[% hold.cancellationdate %]">[% hold.cancellationdate | $KohaDates %]</span>
|
||||
[% ELSE %]
|
||||
<span title="0000-00-00"></span>
|
||||
[% END %]
|
||||
</td>
|
||||
<td>[% hold.itemtype %]</td>
|
||||
<td>
|
||||
[% IF hold.found == 'W' %]
|
||||
Waiting
|
||||
[% ELSIF hold.found == 'T' %]
|
||||
In transit
|
||||
[% ELSIF hold.cancellationdate %]
|
||||
Cancelled
|
||||
[% ELSE %]
|
||||
In queue
|
||||
[% END %]
|
||||
</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
[% END %]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="yui-b">
|
||||
[% INCLUDE 'circ-menu.inc' %]
|
||||
</div>
|
||||
</div>
|
||||
[% INCLUDE 'intranet-bottom.inc' %]
|
96
members/holdshistory.pl
Normal file
96
members/holdshistory.pl
Normal file
|
@ -0,0 +1,96 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# This file is part of Koha.
|
||||
#
|
||||
# Koha is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Koha is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Koha; if not, see <http://www.gnu.org/licenses>.
|
||||
|
||||
use Modern::Perl;
|
||||
|
||||
use CGI qw ( -utf8 );
|
||||
|
||||
use C4::Auth;
|
||||
use C4::Output;
|
||||
|
||||
use Koha::Patrons;
|
||||
|
||||
my $input = CGI->new;
|
||||
|
||||
my $borrowernumber;
|
||||
my $cardnumber;
|
||||
my @all_holds;
|
||||
|
||||
my ($template, $loggedinuser, $cookie)= get_template_and_user({template_name => "members/holdshistory.tt",
|
||||
query => $input,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {borrowers => 1},
|
||||
debug => 1,
|
||||
});
|
||||
|
||||
my $patron;
|
||||
|
||||
if ($input->param('cardnumber')) {
|
||||
$cardnumber = $input->param('cardnumber');
|
||||
$patron = Koha::Patrons->find( { cardnumber => $cardnumber } );
|
||||
}
|
||||
if ($input->param('borrowernumber')) {
|
||||
$borrowernumber = $input->param('borrowernumber');
|
||||
$patron = Koha::Patrons->find( $borrowernumber );
|
||||
}
|
||||
|
||||
unless ( $patron ) {
|
||||
print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
|
||||
exit;
|
||||
}
|
||||
|
||||
my $holds;
|
||||
my $old_holds;
|
||||
|
||||
if ( $borrowernumber eq C4::Context->preference('AnonymousPatron') ){
|
||||
# use of 'eq' in the above comparison is intentional -- the
|
||||
# system preference value could be blank
|
||||
$template->param( is_anonymous => 1 );
|
||||
} else {
|
||||
$holds = $patron->holds;
|
||||
$old_holds = $patron->old_holds;
|
||||
|
||||
while (my $hold = $holds->next) {
|
||||
push @all_holds, $hold;
|
||||
}
|
||||
|
||||
while (my $hold = $old_holds->next) {
|
||||
push @all_holds, $hold;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $patron->category->category_type eq 'C') {
|
||||
my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
|
||||
$template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
|
||||
$template->param( 'catcode' => $patron_categories->next ) if $patron_categories->count == 1;
|
||||
}
|
||||
|
||||
$template->param( adultborrower => 1 ) if ( $patron->category->category_type eq 'A' || $patron->category->category_type eq 'I' );
|
||||
|
||||
$template->param( picture => 1 ) if $patron->image;
|
||||
|
||||
$template->param(%{ $patron->unblessed });
|
||||
|
||||
$template->param(
|
||||
holdshistoryview => 1,
|
||||
borrowernumber => $borrowernumber,
|
||||
patron => $patron,
|
||||
holds => \@all_holds,
|
||||
);
|
||||
|
||||
output_html_with_http_headers $input, $cookie, $template->output;
|
Loading…
Reference in a new issue