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

(-)a/C4/Circulation.pm (+31 lines)
Lines 73-78 BEGIN { Link Here
73
		&barcodedecode
73
		&barcodedecode
74
        &LostItem
74
        &LostItem
75
        &ReturnLostItem
75
        &ReturnLostItem
76
        &GetPendingOnSiteCheckouts
76
	);
77
	);
77
78
78
	# subs to deal with issuing a book
79
	# subs to deal with issuing a book
Lines 3894-3899 sub GetAgeRestriction { Link Here
3894
3895
3895
1;
3896
1;
3896
3897
3898
=head2 GetPendingOnSiteCheckouts
3899
3900
=cut
3901
3902
sub GetPendingOnSiteCheckouts {
3903
    my $dbh = C4::Context->dbh;
3904
    return $dbh->selectall_arrayref(q|
3905
        SELECT
3906
          items.barcode,
3907
          items.biblionumber,
3908
          items.itemnumber,
3909
          items.itemnotes,
3910
          items.itemcallnumber,
3911
          items.location,
3912
          issues.date_due,
3913
          issues.branchcode,
3914
          biblio.author,
3915
          biblio.title,
3916
          borrowers.firstname,
3917
          borrowers.surname,
3918
          borrowers.cardnumber,
3919
          borrowers.borrowernumber
3920
        FROM items
3921
        LEFT JOIN issues ON items.itemnumber = issues.itemnumber
3922
        LEFT JOIN biblio ON items.biblionumber = biblio.biblionumber
3923
        LEFT JOIN borrowers ON issues.borrowernumber = borrowers.borrowernumber
3924
        WHERE issues.onsite_checkout = 1
3925
    |, { Slice => {} } );
3926
}
3927
3897
__END__
3928
__END__
3898
3929
3899
=head1 AUTHOR
3930
=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