Bugzilla – Attachment 31389 Details for
Bug 12201
Add the ability for the user to supply a callnumber splitting regexp for custom CN systems
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11201: Add a in-house use list pages
Bug-11201-Add-a-in-house-use-list-pages.patch (text/plain), 9.09 KB, created by
Jonathan Druart
on 2014-09-05 11:12:22 UTC
(
hide
)
Description:
Bug 11201: Add a in-house use list pages
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-09-05 11:12:22 UTC
Size:
9.09 KB
patch
obsolete
>From ff1ac08360c67e5c8059b35d55d9cf1a6d145cc2 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 5 Nov 2013 12:32:30 +0100 >Subject: [PATCH] Bug 11201: Add a in-house use list pages > >The circulation page has a new entry: a link to a list of the pending >in-house use. > >Bug 10860 introduces a new way for managing in-house uses. >This patch adds a new page (from the circulation home page) to list all >pending in-house uses. > >Test plan: >Go on the circulation home page and click on the in-house use link. >Verify all your in-house uses are listed and information are consistent. > >http://bugs.koha-community.org/show_bug.cgi?id=12201 >--- > C4/Circulation.pm | 31 +++++++++ > circ/in-house_use.pl | 43 ++++++++++++ > .../prog/en/modules/circ/circulation-home.tt | 1 + > .../prog/en/modules/circ/in-house_use.tt | 80 ++++++++++++++++++++++ > t/db_dependent/Circulation/GetIssues.t | 12 +++- > 5 files changed, 165 insertions(+), 2 deletions(-) > create mode 100755 circ/in-house_use.pl > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/circ/in-house_use.tt > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index f6a606f..020ed96 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -70,6 +70,7 @@ BEGIN { > &barcodedecode > &LostItem > &ReturnLostItem >+ &GetPendingInHouseUses > ); > > # subs to deal with issuing a book >@@ -3779,6 +3780,36 @@ sub GetAgeRestriction { > > 1; > >+=head2 GetPendingInHouseUses >+ >+=cut >+ >+sub GetPendingInHouseUses { >+ my $dbh = C4::Context->dbh; >+ return $dbh->selectall_arrayref(q| >+ SELECT >+ items.barcode, >+ items.biblionumber, >+ items.itemnumber, >+ items.itemnotes, >+ items.itemcallnumber, >+ items.location, >+ issues.date_due, >+ issues.branchcode, >+ biblio.author, >+ biblio.title, >+ borrowers.firstname, >+ borrowers.surname, >+ borrowers.cardnumber, >+ borrowers.borrowernumber >+ FROM items >+ LEFT JOIN issues ON items.itemnumber = issues.itemnumber >+ LEFT JOIN biblio ON items.biblionumber = biblio.biblionumber >+ LEFT JOIN borrowers ON issues.borrowernumber = borrowers.borrowernumber >+ WHERE issues.inhouse_use = 1 >+ |, { Slice => {} } ); >+} >+ > __END__ > > =head1 AUTHOR >diff --git a/circ/in-house_use.pl b/circ/in-house_use.pl >new file mode 100755 >index 0000000..1d6599e >--- /dev/null >+++ b/circ/in-house_use.pl >@@ -0,0 +1,43 @@ >+#!/usr/bin/perl >+# This file is part of Koha. >+# >+# Copyright (C) 2013 BibLibre >+# >+# 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 C4::Auth; >+use C4::Circulation qw( GetPendingInHouseUses ); >+use C4::Output; >+ >+my $cgi = new CGI; >+ >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >+ { >+ template_name => "circ/in-house_use.tt", >+ query => $cgi, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => {circulate => "circulate_remaining_permissions"}, >+ } >+); >+ >+my $pending_inhouse_use = C4::Circulation::GetPendingInHouseUses(); >+ >+$template->param( >+ pending_inhouse_use => $pending_inhouse_use, >+); >+ >+output_html_with_http_headers $cgi, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >index e5eaddc..f2f241a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >@@ -46,6 +46,7 @@ > systems with large numbers of overdue items.</li>[% END %] > <li> <a href="/cgi-bin/koha/circ/branchoverdues.pl">Overdues with fines</a> - Limited to your library. See report help for other details.</li> > <!-- <li> <a href="/cgi-bin/koha/circ/stats.pl?time=yesterday">Daily reconciliation</a></li> --> >+ <li><a href="/cgi-bin/koha/circ/in-house_use.pl">In-house use list</a></li> > </ul> > > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/in-house_use.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/in-house_use.tt >new file mode 100644 >index 0000000..331d050 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/in-house_use.tt >@@ -0,0 +1,80 @@ >+[% USE KohaBranchName %] >+[% USE KohaDates %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Circulation › In-house use</title> >+[% INCLUDE 'doc-head-close.inc' %] >+<link rel="stylesheet" href="[% themelang %]/css/datatables.css" /> >+[% INCLUDE 'datatables.inc' %] >+<script type="text/javascript"> >+//<![CDATA[ >+ >+$(document).ready(function(){ >+ if ( $("#pending_inhouse_use").length ) { >+ $("#pending_inhouse_use").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]], >+ "aoColumns": [ >+ { "sType": "title-string" }, >+ { "sType": "html" }, >+ { "sType": "html" }, >+ null, >+ { "sType": "html" }, >+ null, >+ null, >+ ], >+ 'bAutoWidth': false, >+ "sPaginationType": "four_button" >+ })); >+ } >+}); >+//]]> >+</script> >+ >+</head> >+<body id="circ_stats" class="circ"> >+[% INCLUDE 'header.inc' %] >+[% INCLUDE 'circ-search.inc' %] >+ >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> › In-house use</div> >+ >+<div id="doc3" class="yui-t2"> >+ <div id="bd"> >+ <div id="yui-main"> >+ <div class="yui-b"> >+ <h4>Pending in-house use list</h4> >+ [% IF pending_inhouse_use %] >+ <table id="pending_inhouse_use"> >+ <thead> >+ <tr> >+ <th>Date</th><th>Patron</th><th>Title</th><th>Callnumber</th><th>Barcode</th><th>Library</th><th>Location</th> >+ </tr> >+ </thead> >+ <tbody> >+ [% FOREACH item IN pending_inhouse_use %] >+ <tr> >+ <td><span title="[% item.date_due %]">[% item.date_due | $KohaDates %]</span></td> >+ <td> >+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.borrowernumber %]">[%item.firstname %] [% item.surname %]</a> >+ </td> >+ <td> >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblionumber %]"><strong>[% item.title |html %]</strong></a>[% IF ( item.author ) %], by [% item.author %][% END %][% IF ( item.itemnotes ) %]- <span class="circ-hlt">[% item.itemnotes %]</span>[% END %] >+ </td> >+ <td>[% item.itemcallnumber %]</td> >+ <td> >+ <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber %]&itemnumber=[% item.itemnumber %]#item[% item.itemnumber %]">[% item.barcode %]</a> >+ </td> >+ <td>[% item.branchcode | $KohaBranchName%]</td> >+ <td>[% item.location %]</td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ [% ELSE %] >+ <h3>No pending in-house use.</h3> >+ [% END %] >+ </div> >+ </div> >+ <div class="yui-b"> >+ [% INCLUDE 'circ-menu.inc' %] >+ </div> >+ </div> >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/t/db_dependent/Circulation/GetIssues.t b/t/db_dependent/Circulation/GetIssues.t >index e308dbe..ad0f3c5 100644 >--- a/t/db_dependent/Circulation/GetIssues.t >+++ b/t/db_dependent/Circulation/GetIssues.t >@@ -2,7 +2,7 @@ > > use Modern::Perl; > >-use Test::More; >+use Test::More tests => 10; > use Test::MockModule; > use C4::Biblio; > use C4::Items; >@@ -16,6 +16,8 @@ my $dbh = C4::Context->dbh; > $dbh->{AutoCommit} = 0; > $dbh->{RaiseError} = 1; > >+$dbh->do(q|DELETE FROM issues|); >+ > my $branchcode; > my $branch_created; > my @branches = keys %{ GetBranches() }; >@@ -82,4 +84,10 @@ is(scalar @$issues, 1, "The other is an item from biblio $biblionumber2"); > $issues = C4::Circulation::GetIssues({itemnumber => $itemnumber2}); > is(scalar @$issues, 0, "No one has issued the second item of biblio $biblionumber2"); > >-done_testing; >+my $inhouse_uses = GetPendingInHouseUses; >+is( scalar @$inhouse_uses, 0, "No pending in house use" ); >+ >+my $itemnumber4 = AddItem({ barcode => '0104', %item_branch_infos }, $biblionumber1); >+AddIssue( $borrower, '0104', undef, undef, undef, undef, { inhouse_use => 1 } ); >+$inhouse_uses = GetPendingInHouseUses; >+is( scalar @$inhouse_uses, 1, "There is 1 pending in house use" ); >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12201
:
31389
|
31390