View | Details | Raw Unified | Return to bug 11201
Collapse All | Expand All

(-)a/C4/Circulation.pm (+31 lines)
Lines 70-75 BEGIN { Link Here
70
		&barcodedecode
70
		&barcodedecode
71
        &LostItem
71
        &LostItem
72
        &ReturnLostItem
72
        &ReturnLostItem
73
        &GetPendingInHouseUses
73
	);
74
	);
74
75
75
	# subs to deal with issuing a book
76
	# subs to deal with issuing a book
Lines 3779-3784 sub GetAgeRestriction { Link Here
3779
3780
3780
1;
3781
1;
3781
3782
3783
=head2 GetPendingInHouseUses
3784
3785
=cut
3786
3787
sub GetPendingInHouseUses {
3788
    my $dbh = C4::Context->dbh;
3789
    return $dbh->selectall_arrayref(q|
3790
        SELECT
3791
          items.barcode,
3792
          items.biblionumber,
3793
          items.itemnumber,
3794
          items.itemnotes,
3795
          items.itemcallnumber,
3796
          items.location,
3797
          issues.date_due,
3798
          issues.branchcode,
3799
          biblio.author,
3800
          biblio.title,
3801
          borrowers.firstname,
3802
          borrowers.surname,
3803
          borrowers.cardnumber,
3804
          borrowers.borrowernumber
3805
        FROM items
3806
        LEFT JOIN issues ON items.itemnumber = issues.itemnumber
3807
        LEFT JOIN biblio ON items.biblionumber = biblio.biblionumber
3808
        LEFT JOIN borrowers ON issues.borrowernumber = borrowers.borrowernumber
3809
        WHERE issues.inhouse_use = 1
3810
    |, { Slice => {} } );
3811
}
3812
3782
__END__
3813
__END__
3783
3814
3784
=head1 AUTHOR
3815
=head1 AUTHOR
(-)a/circ/in-house_use.pl (+43 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
# This file is part of Koha.
3
#
4
# Copyright (C) 2013 BibLibre
5
#
6
# Koha is free software; you can redistribute it and/or modify it
7
# under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 3 of the License, or
9
# (at your option) any later version.
10
#
11
# Koha is distributed in the hope that it will be useful, but
12
# WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
19
use Modern::Perl;
20
21
use C4::Auth;
22
use C4::Circulation qw( GetPendingInHouseUses );
23
use C4::Output;
24
25
my $cgi = new CGI;
26
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
28
    {
29
        template_name   => "circ/in-house_use.tt",
30
        query           => $cgi,
31
        type            => "intranet",
32
        authnotrequired => 0,
33
        flagsrequired => {circulate => "circulate_remaining_permissions"},
34
    }
35
);
36
37
my $pending_inhouse_use = C4::Circulation::GetPendingInHouseUses();
38
39
$template->param(
40
    pending_inhouse_use => $pending_inhouse_use,
41
);
42
43
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt (+1 lines)
Lines 46-51 Link Here
46
	systems with large numbers of overdue items.</li>[% END %]
46
	systems with large numbers of overdue items.</li>[% END %]
47
	<li>    <a href="/cgi-bin/koha/circ/branchoverdues.pl">Overdues with fines</a> - Limited to your library.  See report help for other details.</li>
47
	<li>    <a href="/cgi-bin/koha/circ/branchoverdues.pl">Overdues with fines</a> - Limited to your library.  See report help for other details.</li>
48
<!--	<li>    <a href="/cgi-bin/koha/circ/stats.pl?time=yesterday">Daily reconciliation</a></li> -->
48
<!--	<li>    <a href="/cgi-bin/koha/circ/stats.pl?time=yesterday">Daily reconciliation</a></li> -->
49
    <li><a href="/cgi-bin/koha/circ/in-house_use.pl">In-house use list</a></li>
49
</ul>
50
</ul>
50
	
51
	
51
	</div>
52
	</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/in-house_use.tt (+80 lines)
Line 0 Link Here
1
[% USE KohaBranchName %]
2
[% USE KohaDates %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Circulation &rsaquo; In-house use</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
<link rel="stylesheet" href="[% themelang %]/css/datatables.css" />
7
[% INCLUDE 'datatables.inc' %]
8
<script type="text/javascript">
9
//<![CDATA[
10
11
$(document).ready(function(){
12
  if ( $("#pending_inhouse_use").length ) {
13
    $("#pending_inhouse_use").dataTable($.extend(true, {}, dataTablesDefaults, {
14
        "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
15
        "aoColumns": [
16
            { "sType": "title-string" },
17
            { "sType": "html" },
18
            { "sType": "html" },
19
            null,
20
            { "sType": "html" },
21
            null,
22
            null,
23
        ],
24
        'bAutoWidth': false,
25
        "sPaginationType": "four_button"
26
    }));
27
  }
28
});
29
//]]>
30
</script>
31
32
</head>
33
<body id="circ_stats" class="circ">
34
[% INCLUDE 'header.inc' %]
35
[% INCLUDE 'circ-search.inc' %]
36
37
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>  &rsaquo; In-house use</div>
38
39
<div id="doc3" class="yui-t2">
40
  <div id="bd">
41
    <div id="yui-main">
42
      <div class="yui-b">
43
        <h4>Pending in-house use list</h4>
44
        [% IF pending_inhouse_use %]
45
          <table id="pending_inhouse_use">
46
            <thead>
47
              <tr>
48
                <th>Date</th><th>Patron</th><th>Title</th><th>Callnumber</th><th>Barcode</th><th>Library</th><th>Location</th>
49
              </tr>
50
            </thead>
51
            <tbody>
52
              [% FOREACH item IN pending_inhouse_use %]
53
                <tr>
54
                  <td><span title="[% item.date_due %]">[% item.date_due | $KohaDates %]</span></td>
55
                  <td>
56
                    <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.borrowernumber %]">[%item.firstname %] [% item.surname %]</a>
57
                  </td>
58
                  <td>
59
                    <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 %]
60
                  </td>
61
                  <td>[% item.itemcallnumber %]</td>
62
                  <td>
63
                    <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber %]&amp;itemnumber=[% item.itemnumber %]#item[% item.itemnumber %]">[% item.barcode %]</a>
64
                  </td>
65
                  <td>[% item.branchcode | $KohaBranchName%]</td>
66
                  <td>[% item.location %]</td>
67
                </tr>
68
              [% END %]
69
            </tbody>
70
          </table>
71
        [% ELSE %]
72
          <h3>No pending in-house use.</h3>
73
        [% END %]
74
      </div>
75
    </div>
76
    <div class="yui-b">
77
      [% INCLUDE 'circ-menu.inc' %]
78
    </div>
79
  </div>
80
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/t/db_dependent/Circulation/GetIssues.t (-3 / +10 lines)
Lines 2-8 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Test::More;
5
use Test::More tests => 10;
6
use Test::MockModule;
6
use Test::MockModule;
7
use C4::Biblio;
7
use C4::Biblio;
8
use C4::Items;
8
use C4::Items;
Lines 16-21 my $dbh = C4::Context->dbh; Link Here
16
$dbh->{AutoCommit} = 0;
16
$dbh->{AutoCommit} = 0;
17
$dbh->{RaiseError} = 1;
17
$dbh->{RaiseError} = 1;
18
18
19
$dbh->do(q|DELETE FROM issues|);
20
19
my $branchcode;
21
my $branchcode;
20
my $branch_created;
22
my $branch_created;
21
my @branches = keys %{ GetBranches() };
23
my @branches = keys %{ GetBranches() };
Lines 82-85 is(scalar @$issues, 1, "The other is an item from biblio $biblionumber2"); Link Here
82
$issues = C4::Circulation::GetIssues({itemnumber => $itemnumber2});
84
$issues = C4::Circulation::GetIssues({itemnumber => $itemnumber2});
83
is(scalar @$issues, 0, "No one has issued the second item of biblio $biblionumber2");
85
is(scalar @$issues, 0, "No one has issued the second item of biblio $biblionumber2");
84
86
85
done_testing;
87
my $inhouse_uses = GetPendingInHouseUses;
88
is( scalar @$inhouse_uses, 0, "No pending in house use" );
89
90
my $itemnumber4 = AddItem({ barcode => '0104', %item_branch_infos }, $biblionumber1);
91
AddIssue( $borrower, '0104', undef, undef, undef, undef, { inhouse_use => 1 } );
92
$inhouse_uses = GetPendingInHouseUses;
93
is( scalar @$inhouse_uses, 1, "There is 1 pending in house use" );
86
- 

Return to bug 11201