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
        &GetPendingOnSiteCheckouts
73
	);
74
	);
74
75
75
	# subs to deal with issuing a book
76
	# subs to deal with issuing a book
Lines 3781-3786 sub GetAgeRestriction { Link Here
3781
3782
3782
1;
3783
1;
3783
3784
3785
=head2 GetPendingOnSiteCheckouts
3786
3787
=cut
3788
3789
sub GetPendingOnSiteCheckouts {
3790
    my $dbh = C4::Context->dbh;
3791
    return $dbh->selectall_arrayref(q|
3792
        SELECT
3793
          items.barcode,
3794
          items.biblionumber,
3795
          items.itemnumber,
3796
          items.itemnotes,
3797
          items.itemcallnumber,
3798
          items.location,
3799
          issues.date_due,
3800
          issues.branchcode,
3801
          biblio.author,
3802
          biblio.title,
3803
          borrowers.firstname,
3804
          borrowers.surname,
3805
          borrowers.cardnumber,
3806
          borrowers.borrowernumber
3807
        FROM items
3808
        LEFT JOIN issues ON items.itemnumber = issues.itemnumber
3809
        LEFT JOIN biblio ON items.biblionumber = biblio.biblionumber
3810
        LEFT JOIN borrowers ON issues.borrowernumber = borrowers.borrowernumber
3811
        WHERE issues.onsite_checkout = 1
3812
    |, { Slice => {} } );
3813
}
3814
3784
__END__
3815
__END__
3785
3816
3786
=head1 AUTHOR
3817
=head1 AUTHOR
(-)a/circ/on-site_checkouts.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( GetPendingOnSiteCheckouts );
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/on-site_checkouts.tt",
30
        query           => $cgi,
31
        type            => "intranet",
32
        authnotrequired => 0,
33
        flagsrequired => {circulate => "circulate_remaining_permissions"},
34
    }
35
);
36
37
my $pending_onsite_checkouts = C4::Circulation::GetPendingOnSiteCheckouts();
38
39
$template->param(
40
    pending_onsite_checkouts => $pending_onsite_checkouts,
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/on-site_checkouts.pl">On-site checkout list</a></li>
49
</ul>
50
</ul>
50
	
51
	
51
	</div>
52
	</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/on-site_checkouts.tt (+81 lines)
Line 0 Link Here
1
[% USE Branches %]
2
[% USE KohaDates %]
3
[% USE AuthorisedValues %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Circulation &rsaquo; On-site checkouts</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
<link rel="stylesheet" href="[% themelang %]/css/datatables.css" />
8
[% INCLUDE 'datatables.inc' %]
9
<script type="text/javascript">
10
//<![CDATA[
11
12
$(document).ready(function(){
13
  if ( $("#pending_onsite_checkout").length ) {
14
    $("#pending_onsite_checkout").dataTable($.extend(true, {}, dataTablesDefaults, {
15
        "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
16
        "aoColumns": [
17
            { "sType": "title-string" },
18
            { "sType": "html" },
19
            { "sType": "html" },
20
            null,
21
            { "sType": "html" },
22
            null,
23
            null,
24
        ],
25
        'bAutoWidth': false,
26
        "sPaginationType": "four_button"
27
    }));
28
  }
29
});
30
//]]>
31
</script>
32
33
</head>
34
<body id="circ_stats" class="circ">
35
[% INCLUDE 'header.inc' %]
36
[% INCLUDE 'circ-search.inc' %]
37
38
<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; On-site checkouts</div>
39
40
<div id="doc3" class="yui-t2">
41
  <div id="bd">
42
    <div id="yui-main">
43
      <div class="yui-b">
44
        <h4>Pending on-site checkout list</h4>
45
        [% IF pending_onsite_checkouts %]
46
          <table id="pending_onsite_checkout">
47
            <thead>
48
              <tr>
49
                <th>Date</th><th>Patron</th><th>Title</th><th>Callnumber</th><th>Barcode</th><th>Library</th><th>Location</th>
50
              </tr>
51
            </thead>
52
            <tbody>
53
              [% FOREACH item IN pending_onsite_checkouts %]
54
                <tr>
55
                  <td><span title="[% item.date_due %]">[% item.date_due | $KohaDates %]</span></td>
56
                  <td>
57
                    <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.borrowernumber %]">[%item.firstname %] [% item.surname %]</a>
58
                  </td>
59
                  <td>
60
                    <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 %]
61
                  </td>
62
                  <td>[% item.itemcallnumber %]</td>
63
                  <td>
64
                    <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber %]&amp;itemnumber=[% item.itemnumber %]#item[% item.itemnumber %]">[% item.barcode %]</a>
65
                  </td>
66
                  <td>[% Branches.GetName(item.branchcode) %]</td>
67
                  <td>[% AuthorisedValues.GetByCode( 'LOC', item.location )%]</td>
68
                </tr>
69
              [% END %]
70
            </tbody>
71
          </table>
72
        [% ELSE %]
73
          <h3>No pending on-site checkout.</h3>
74
        [% END %]
75
      </div>
76
    </div>
77
    <div class="yui-b">
78
      [% INCLUDE 'circ-menu.inc' %]
79
    </div>
80
  </div>
81
[% 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 $onsite_checkouts = GetPendingOnSiteCheckouts;
88
is( scalar @$onsite_checkouts, 0, "No pending on-site checkouts" );
89
90
my $itemnumber4 = AddItem({ barcode => '0104', %item_branch_infos }, $biblionumber1);
91
AddIssue( $borrower, '0104', undef, undef, undef, undef, { onsite_checkout => 1 } );
92
$onsite_checkouts = GetPendingOnSiteCheckouts;
93
is( scalar @$onsite_checkouts, 1, "There is 1 pending on-site checkout" );
86
- 

Return to bug 11201