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

(-)a/Koha/Schema/Result/Issue.pm (+24 lines)
Lines 190-193 __PACKAGE__->belongs_to( Link Here
190
  { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
190
  { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
191
);
191
);
192
192
193
__PACKAGE__->belongs_to(
194
  "item",
195
  "Koha::Schema::Result::Item",
196
  { itemnumber => "itemnumber" },
197
  {
198
    is_deferrable => 1,
199
    join_type     => "LEFT",
200
    on_delete     => "CASCADE",
201
    on_update     => "CASCADE",
202
  },
203
);
204
205
__PACKAGE__->belongs_to(
206
  "branch",
207
  "Koha::Schema::Result::Branch",
208
  { branchcode => "branchcode" },
209
  {
210
    is_deferrable => 1,
211
    join_type     => "LEFT",
212
    on_delete     => "CASCADE",
213
    on_update     => "CASCADE",
214
  },
215
);
216
193
1;
217
1;
(-)a/api/checkin.pl (+75 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2014 ByWater Solutions
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use CGI;
23
use JSON qw(to_json);
24
25
use C4::Circulation;
26
use C4::Items qw(GetBarcodeFromItemnumber);
27
use C4::Context;
28
use C4::Auth qw(check_cookie_auth);
29
30
use Koha::DateUtils qw(output_pref_due);
31
32
my $input = new CGI;
33
34
my ( $auth_status, $sessionID ) =
35
  check_cookie_auth( $input->cookie('CGISESSID'),
36
    { circulate => 'circulate_remaining_permissions' } );
37
38
if ( $auth_status ne "ok" ) {
39
    exit 0;
40
}
41
42
binmode STDOUT, ":encoding(UTF-8)";
43
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
44
45
my $itemnumber     = $input->param('itemnumber');
46
my $borrowernumber = $input->param('borrowernumber');
47
my $override_limit = $input->param('override_limit');
48
my $exempt_fine    = $input->param('exempt_fine');
49
my $branchcode     = $input->param('branchcode')
50
  || C4::Context->userenv->{'branch'};
51
52
my $barcode = GetBarcodeFromItemnumber($itemnumber);
53
54
my $data;
55
$data->{itemnumber}     = $itemnumber;
56
$data->{borrowernumber} = $borrowernumber;
57
$data->{branchcode}     = $branchcode;
58
59
if ( C4::Context->preference("InProcessingToShelvingCart") ) {
60
    my $item = GetItem($itemnumber);
61
    if ( $item->{'location'} eq 'PROC' ) {
62
        $item->{'location'} = 'CART';
63
        ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
64
    }
65
}
66
67
if ( C4::Context->preference("ReturnToShelvingCart") ) {
68
    my $item = GetItem($itemnumber);
69
    $item->{'location'} = 'CART';
70
    ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
71
}
72
73
( $data->{returned} ) = AddReturn( $barcode, $branchcode, $exempt_fine );
74
75
print to_json($data);
(-)a/api/checkouts.pl (+116 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This software is placed under the gnu General Public License, v2 (http://www.gnu.org/licenses/gpl.html)
4
5
# Copyright 2014 ByWater Solutions
6
#
7
# This file is part of Koha.
8
#
9
# Koha is free software; you can redistribute it and/or modify it under the
10
# terms of the GNU General Public License as published by the Free Software
11
# Foundation; either version 3 of the License, or (at your option) any later
12
# version.
13
#
14
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License along
19
# with Koha; if not, write to the Free Software Foundation, Inc.,
20
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
22
use Modern::Perl;
23
24
use CGI;
25
use JSON qw(to_json);
26
27
use C4::Context;
28
use C4::Charset;
29
use C4::Auth qw(check_cookie_auth);
30
use C4::Circulation qw(GetIssuingCharges CanBookBeRenewed GetRenewCount);
31
32
use Koha::Database;
33
use Koha::DateUtils;
34
35
my $input = new CGI;
36
37
my ( $auth_status, $sessionID ) =
38
  check_cookie_auth( $input->cookie('CGISESSID'),
39
    { circulate => 'circulate_remaining_permissions' } );
40
41
if ( $auth_status ne "ok" ) {
42
    exit 0;
43
}
44
45
my $schema = Koha::Database->new()->schema();
46
47
my @sort_columns = qw/date_due title itype issuedate branchcode itemcallnumber/;
48
49
my $borrowernumber    = $input->param('borrowernumber');
50
my $offset            = $input->param('iDisplayStart');
51
my $results_per_page  = $input->param('iDisplayLength');
52
my $sorting_column    = $sort_columns[ $input->param('iSortCol_0') ];
53
my $sorting_direction = $input->param('sSortDir_0');
54
55
$results_per_page = undef if ( $results_per_page == -1 );
56
57
binmode STDOUT, ":encoding(UTF-8)";
58
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
59
60
my $checkouts_rs =
61
  $schema->resultset('Issue')->search( { borrowernumber => $borrowernumber },
62
    { prefetch => { 'item' => 'biblio' }, orderby => 'issuedate' } );
63
64
my @checkouts;
65
while ( my $c = $checkouts_rs->next() ) {
66
    my $itemnumber = $c->itemnumber()->itemnumber();
67
68
    my ($charge) = GetIssuingCharges(
69
        $c->itemnumber()->itemnumber(),
70
        $c->borrowernumber()->borrowernumber()
71
    );
72
73
    my ( $can_renew, $can_renew_error ) =
74
      CanBookBeRenewed( $borrowernumber, $itemnumber );
75
76
    my ( $renewals_count, $renewals_allowed, $renewals_remaining ) =
77
      GetRenewCount( $borrowernumber, $itemnumber );
78
79
    push(
80
        @checkouts,
81
        {
82
            DT_RowId           => "$itemnumber-$borrowernumber",
83
            title              => $c->item()->biblio()->title(),
84
            author             => $c->item()->biblio()->author(),
85
            barcode            => $c->item()->barcode(),
86
            itemtype           => $c->item()->effective_itemtype(),
87
            branchcode         => $c->branchcode(),
88
            branchname         => $c->branch->branchname(),
89
            itemcallnumber     => $c->item()->itemcallnumber() || q{},
90
            charge             => $charge,
91
            price              => $c->item->replacementprice() || q{},
92
            can_renew          => $can_renew,
93
            can_renew_error    => $can_renew_error,
94
            itemnumber         => $itemnumber,
95
            borrowernumber     => $borrowernumber,
96
            biblionumber       => $c->item()->biblio()->biblionumber,
97
            issuedate          => $c->issuedate(),
98
            date_due           => $c->date_due(),
99
            renewals_count     => $renewals_count,
100
            renewals_allowed   => $renewals_allowed,
101
            renewals_remaining => $renewals_remaining,
102
            issuedate_formatted =>
103
              output_pref( dt_from_string( $c->issuedate() ) ),
104
            date_due_formatted =>
105
              output_pref_due( dt_from_string( $c->date_due() ) ),
106
        }
107
    );
108
}
109
110
my $data;
111
$data->{'iTotalRecords'}        = scalar @checkouts;                 #FIXME
112
$data->{'iTotalDisplayRecords'} = scalar @checkouts;
113
$data->{'sEcho'}                = $input->param('sEcho') || undef;
114
$data->{'aaData'}               = \@checkouts;
115
116
print to_json($data);
(-)a/api/renew.pl (+63 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2014 ByWater Solutions
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use CGI;
23
use JSON qw(to_json);
24
25
use C4::Circulation;
26
use C4::Context;
27
use C4::Auth qw(check_cookie_auth);
28
29
use Koha::DateUtils qw(output_pref_due);
30
31
my $input = new CGI;
32
33
my ( $auth_status, $sessionID ) =
34
  check_cookie_auth( $input->cookie('CGISESSID'),
35
    { circulate => 'circulate_remaining_permissions' } );
36
37
if ( $auth_status ne "ok" ) {
38
    exit 0;
39
}
40
41
binmode STDOUT, ":encoding(UTF-8)";
42
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
43
44
my $itemnumber     = $input->param('itemnumber');
45
my $borrowernumber = $input->param('borrowernumber');
46
my $override_limit = $input->param('override_limit');
47
my $branchcode     = $input->param('branchcode')
48
  || C4::Context->userenv->{'branch'};
49
50
my $data;
51
$data->{itemnumber} = $itemnumber;
52
$data->{borrowernumber} = $borrowernumber;
53
$data->{branchcode} = $branchcode;
54
55
( $data->{renew_okay}, $data->{error} ) =
56
  CanBookBeRenewed( $borrowernumber, $itemnumber, $override_limit );
57
58
if ( $data->{renew_okay} ) {
59
    my $date_due = AddRenewal( $borrowernumber, $itemnumber, $branchcode );
60
    $data->{date_due} = output_pref_due( $date_due );
61
}
62
63
print to_json($data);
(-)a/circ/circulation.pl (-94 lines)
Lines 96-109 my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( Link Here
96
96
97
my $branches = GetBranches();
97
my $branches = GetBranches();
98
98
99
my @failedrenews = $query->param('failedrenew');    # expected to be itemnumbers 
100
our %renew_failed = ();
101
for (@failedrenews) { $renew_failed{$_} = 1; }
102
103
my @failedreturns = $query->param('failedreturn');
104
our %return_failed = ();
105
for (@failedreturns) { $return_failed{$_} = 1; }
106
107
my $findborrower = $query->param('findborrower') || q{};
99
my $findborrower = $query->param('findborrower') || q{};
108
$findborrower =~ s|,| |g;
100
$findborrower =~ s|,| |g;
109
my $borrowernumber = $query->param('borrowernumber');
101
my $borrowernumber = $query->param('borrowernumber');
Lines 466-556 our @relissues = (); Link Here
466
our @relprevissues  = ();
458
our @relprevissues  = ();
467
my $displayrelissues;
459
my $displayrelissues;
468
460
469
our $totalprice = 0;
470
471
sub build_issue_data {
472
    my $issueslist = shift;
473
    my $relatives = shift;
474
475
    # split in 2 arrays for today & previous
476
    foreach my $it ( @$issueslist ) {
477
        my $itemtypeinfo = getitemtypeinfo( (C4::Context->preference('item-level_itypes')) ? $it->{'itype'} : $it->{'itemtype'} );
478
479
        # set itemtype per item-level_itype syspref - FIXME this is an ugly hack
480
        $it->{'itemtype'} = ( C4::Context->preference( 'item-level_itypes' ) ) ? $it->{'itype'} : $it->{'itemtype'};
481
482
        ($it->{'charge'}, $it->{'itemtype_charge'}) = GetIssuingCharges(
483
            $it->{'itemnumber'}, $it->{'borrowernumber'}
484
        );
485
        $it->{'charge'} = sprintf("%.2f", $it->{'charge'});
486
        my ($can_renew, $can_renew_error) = CanBookBeRenewed( 
487
            $it->{'borrowernumber'},$it->{'itemnumber'}
488
        );
489
        $it->{"renew_error_${can_renew_error}"} = 1 if defined $can_renew_error;
490
        my $restype = C4::Reserves::GetReserveStatus( $it->{'itemnumber'} );
491
        $it->{'can_renew'} = $can_renew;
492
        $it->{'can_confirm'} = !$can_renew && !$restype;
493
        $it->{'renew_error'} = ( $restype eq "Waiting" or $restype eq "Reserved" ) ? 1 : 0;
494
        $it->{'checkoutdate'} = C4::Dates->new($it->{'issuedate'},'iso')->output('syspref');
495
        $it->{'issuingbranchname'} = GetBranchName($it->{'branchcode'});
496
497
        $totalprice += $it->{'replacementprice'} || 0;
498
        $it->{'itemtype'} = $itemtypeinfo->{'description'};
499
        $it->{'itemtype_image'} = $itemtypeinfo->{'imageurl'};
500
        $it->{'dd_sort'} = $it->{'date_due'};
501
        $it->{'dd'} = output_pref($it->{'date_due'});
502
        $it->{'displaydate_sort'} = $it->{'issuedate'};
503
        $it->{'displaydate'} = output_pref($it->{'issuedate'});
504
        #$it->{'od'} = ( $it->{'date_due'} lt $todaysdate ) ? 1 : 0 ;
505
        $it->{'od'} = $it->{'overdue'};
506
        $it->{'subtitle'} = GetRecordValue('subtitle', GetMarcBiblio($it->{biblionumber}), GetFrameworkCode($it->{biblionumber}));
507
        $it->{'renew_failed'} = $renew_failed{$it->{'itemnumber'}};
508
        $it->{'return_failed'} = $return_failed{$it->{'barcode'}};
509
510
        if ( ( $it->{'issuedate'} && $it->{'issuedate'} gt $todaysdate )
511
          || ( $it->{'lastreneweddate'} && $it->{'lastreneweddate'} gt $todaysdate ) ) {
512
            (!$relatives) ? push @todaysissues, $it : push @relissues, $it;
513
        } else {
514
            (!$relatives) ? push @previousissues, $it : push @relprevissues, $it;
515
        }
516
        ($it->{'renewcount'},$it->{'renewsallowed'},$it->{'renewsleft'}) = C4::Circulation::GetRenewCount($it->{'borrowernumber'},$it->{'itemnumber'}); #Add renewal count to item data display
517
    }
518
}
519
520
if ($borrower) {
521
522
    # Getting borrower relatives
523
    my @relborrowernumbers = GetMemberRelatives($borrower->{'borrowernumber'});
524
    #push @borrowernumbers, $borrower->{'borrowernumber'};
525
526
    # get each issue of the borrower & separate them in todayissues & previous issues
527
    my $issueslist = GetPendingIssues($borrower->{'borrowernumber'});
528
    my $relissueslist = [];
529
    if ( @relborrowernumbers ) {
530
        $relissueslist = GetPendingIssues(@relborrowernumbers);
531
    }
532
533
    build_issue_data($issueslist, 0);
534
    build_issue_data($relissueslist, 1);
535
  
536
    $displayrelissues = scalar($relissueslist);
537
538
    if ( C4::Context->preference( "todaysIssuesDefaultSortOrder" ) eq 'asc' ) {
539
        @todaysissues   = sort { $a->{'timestamp'} cmp $b->{'timestamp'} } @todaysissues;
540
    }
541
    else {
542
        @todaysissues   = sort { $b->{'timestamp'} cmp $a->{'timestamp'} } @todaysissues;
543
    }
544
545
    if ( C4::Context->preference( "previousIssuesDefaultSortOrder" ) eq 'asc' ){
546
        @previousissues = sort { $a->{'date_due'} cmp $b->{'date_due'} } @previousissues;
547
    }
548
    else {
549
        @previousissues = sort { $b->{'date_due'} cmp $a->{'date_due'} } @previousissues;
550
    }
551
}
552
553
554
my @values;
461
my @values;
555
my %labels;
462
my %labels;
556
my $CGIselectborrower;
463
my $CGIselectborrower;
Lines 739-745 $template->param( Link Here
739
    duedatespec       => $duedatespec,
646
    duedatespec       => $duedatespec,
740
    message           => $message,
647
    message           => $message,
741
    CGIselectborrower => $CGIselectborrower,
648
    CGIselectborrower => $CGIselectborrower,
742
    totalprice        => sprintf('%.2f', $totalprice),
743
    totaldue          => sprintf('%.2f', $total),
649
    totaldue          => sprintf('%.2f', $total),
744
    todayissues       => \@todaysissues,
650
    todayissues       => \@todaysissues,
745
    previssues        => \@previousissues,
651
    previssues        => \@previousissues,
(-)a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css (-1 / +1 lines)
Lines 270-276 tr.even td, tr.even.highlight td { Link Here
270
    border-right : 1px solid #BCBCBC;
270
    border-right : 1px solid #BCBCBC;
271
}
271
}
272
272
273
td.od {
273
.overdue td.od {
274
	color : #cc0000;
274
	color : #cc0000;
275
	font-weight : bold;
275
	font-weight : bold;
276
}
276
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js (-35 / +106 lines)
Lines 1-57 Link Here
1
$(document).ready(function() {
1
$(document).ready(function() {
2
    $('#patronlists').tabs();
2
    // Handle the select all/none links for checkouts table columns
3
    var allcheckboxes = $(".checkboxed");
3
    $("#CheckAllRenewals").on("click",function(){
4
    $("#renew_all").on("click",function(){
4
        $("#UncheckAllCheckins").click();
5
        allcheckboxes.checkCheckboxes(":input[name*=items]");
5
        $(".renew:visible").attr("checked", "checked" );
6
        allcheckboxes.unCheckCheckboxes(":input[name*=barcodes]");
6
        return false;
7
    });
8
    $("#CheckAllitems").on("click",function(){
9
        allcheckboxes.checkCheckboxes(":input[name*=items]");
10
        allcheckboxes.unCheckCheckboxes(":input[name*=barcodes]"); return false;
11
    });
7
    });
12
    $("#CheckNoitems").on("click",function(){
8
    $("#UncheckAllRenewals").on("click",function(){
13
        allcheckboxes.unCheckCheckboxes(":input[name*=items]"); return false;
9
        $(".renew:visible").removeAttr("checked");
10
        return false;
14
    });
11
    });
15
    $("#CheckAllreturns").on("click",function(){
12
16
        allcheckboxes.checkCheckboxes(":input[name*=barcodes]");
13
    $("#CheckAllCheckins").on("click",function(){
17
        allcheckboxes.unCheckCheckboxes(":input[name*=items]"); return false;
14
        $("#UncheckAllRenewals").click();
15
        $(".checkin:visible").attr("checked", "checked" );
16
        return false;
18
    });
17
    });
19
    $("#CheckNoreturns" ).on("click",function(){
18
    $("#UncheckAllCheckins").on("click",function(){
20
        allcheckboxes.unCheckCheckboxes(":input[name*=barcodes]"); return false;
19
        $(".checkin:visible").removeAttr("checked");
20
        return false;
21
    });
21
    });
22
22
23
    $("#CheckAllexports").on("click",function(){
23
    $("#CheckAllExports").on("click",function(){
24
        allcheckboxes.checkCheckboxes(":input[name*=biblionumbers]");
24
        $(".export:visible").attr("checked", "checked" );
25
        return false;
25
        return false;
26
    });
26
    });
27
    $("#CheckNoexports").on("click",function(){
27
    $("#UncheckAllExports").on("click",function(){
28
        allcheckboxes.unCheckCheckboxes(":input[name*=biblionumbers]");
28
        $(".export:visible").removeAttr("checked");
29
        return false;
29
        return false;
30
    });
30
    });
31
31
32
    $("#relrenew_all").on("click",function(){
32
    // Don't allow both return and renew checkboxes to be checked
33
        allcheckboxes.checkCheckboxes(":input[name*=items]");
33
    $(document).on("change", '.renew', function(){
34
        allcheckboxes.unCheckCheckboxes(":input[name*=barcodes]");
34
        if ( $(this).is(":checked") ) {
35
    });
35
            $( "#checkin_" + $(this).val() ).removeAttr("checked");
36
    $("#relCheckAllitems").on("click",function(){
36
        }
37
        allcheckboxes.checkCheckboxes(":input[name*=items]");
38
        allcheckboxes.unCheckCheckboxes(":input[name*=barcodes]"); return false;
39
    });
37
    });
40
    $("#relCheckNoitems").on("click",function(){
38
    $(document).on("change", '.checkin', function(){
41
        allcheckboxes.unCheckCheckboxes(":input[name*=items]"); return false;
39
        if ( $(this).is(":checked") ) {
40
            $( "#renew_" + $(this).val() ).removeAttr("checked");
41
        }
42
    });
42
    });
43
    $("#relCheckAllreturns").on("click",function(){
43
44
        allcheckboxes.checkCheckboxes(":input[name*=barcodes]");
44
    // Handle renewals
45
        allcheckboxes.unCheckCheckboxes(":input[name*=items]"); return false;
45
    $("#RenewCheckinChecked").on("click",function(){
46
        $(".checkin:checked:visible").each(function() {
47
            itemnumber = $(this).val();
48
49
            $(this).replaceWith("<img id='checkin_" + itemnumber + "' src='" + interface + "/" + theme + "/img/loading-small.gif' />");       
50
51
            params = { 
52
                itemnumber: itemnumber, 
53
                borrowernumber: borrowernumber,
54
                branchcode: branchcode
55
            };
56
57
            $.post( "/cgi-bin/koha/api/checkin.pl", params, function( data ) {
58
                id = "#checkin_" + data.itemnumber;
59
60
                content = "";
61
                if ( data.returned ) {
62
                    content = _("Returned");
63
                } else {
64
                    content = _("Unable to return");
65
                }
66
                    
67
                $(id).replaceWith( content );
68
            }, "json")
69
        });
70
71
        $(".renew:checked:visible").each(function() {
72
            var override_limit = $("#override_limit").is(':checked') ? 1 : 0;
73
74
            var itemnumber = $(this).val();
75
76
            $(this).replaceWith("<img id='renew_" + itemnumber + "' src='" + interface + "/" + theme + "/img/loading-small.gif' />");       
77
78
            var params = { 
79
                itemnumber: itemnumber, 
80
                borrowernumber: borrowernumber,
81
                branchcode: branchcode,
82
                override_limit: override_limit
83
            };
84
85
            $.post( "/cgi-bin/koha/api/renew.pl", params, function( data ) {
86
                var id = "#renew_" + data.itemnumber;
87
88
                var content = "";
89
                if ( data.renew_okay ) {
90
                    content = _("Renewed, due: ") + data.date_due;
91
                } else {
92
                    content = _("Renew failed: ");
93
                    if ( data.error == "no_checkout" ) {
94
                        content += _("not checked out");
95
                    } else if ( data.error == "too_many" ) {
96
                        content += _("too many renewals");
97
                    } else if ( data.error == "on_reserve" ) {
98
                        content += _("on reserve");
99
                    } else if ( data.error ) {
100
                        content += data.error;
101
                    } else {
102
                        content += _("reason unknown");
103
                    }
104
                }
105
                    
106
                $(id).replaceWith( content );
107
            }, "json")
108
        });
46
    });
109
    });
47
    $("#relCheckNoreturns").on("click",function(){
110
48
        allcheckboxes.unCheckCheckboxes(":input[name*=barcodes]"); return false;
111
    $("#RenewAll").on("click",function(){
112
        $("#CheckAllRenewals").click();
113
        $("#UncheckAllCheckins").click();
114
        $("#RenewCheckinChecked").click();
49
    });
115
    });
116
117
    $('#patronlists').tabs();
118
50
    $("#messages ul").after("<a href=\"#\" id=\"addmessage\">"+MSG_ADD_MESSAGE+"</a>");
119
    $("#messages ul").after("<a href=\"#\" id=\"addmessage\">"+MSG_ADD_MESSAGE+"</a>");
120
51
    $("#borrower_messages .cancel").on("click",function(){
121
    $("#borrower_messages .cancel").on("click",function(){
52
        $("#add_message_form").hide();
122
        $("#add_message_form").hide();
53
        $("#addmessage").show();
123
        $("#addmessage").show();
54
    });
124
    });
125
55
    $("#addmessage").on("click",function(){
126
    $("#addmessage").on("click",function(){
56
        $(this).hide();
127
        $(this).hide();
57
        $("#add_message_form").show();
128
        $("#add_message_form").show();
Lines 77-83 $(document).ready(function() { Link Here
77
        return false;
148
        return false;
78
    });
149
    });
79
    // Clicking the table cell checks the checkbox inside it
150
    // Clicking the table cell checks the checkbox inside it
80
    $("td").on("click",function(e){
151
    $(document).on("click", 'td', function(e){
81
        if(e.target.tagName.toLowerCase() == 'td'){
152
        if(e.target.tagName.toLowerCase() == 'td'){
82
          $(this).find("input:checkbox:visible").each( function() {
153
          $(this).find("input:checkbox:visible").each( function() {
83
            $(this).click();
154
            $(this).click();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-258 / +195 lines)
Lines 13-27 Link Here
13
</title>
13
</title>
14
[% INCLUDE 'doc-head-close.inc' %]
14
[% INCLUDE 'doc-head-close.inc' %]
15
[% INCLUDE 'calendar.inc' %]
15
[% INCLUDE 'calendar.inc' %]
16
[% IF ( UseTablesortForCirc ) %]<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
16
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
17
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
17
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
18
[% INCLUDE 'datatables-strings.inc' %]
18
[% INCLUDE 'datatables-strings.inc' %]
19
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>[% END %]
19
<!-- <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> -->
20
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
20
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
21
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
21
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
22
<script type="text/javascript" src="[% themelang %]/js/pages/circulation.js"></script>
22
<script type="text/javascript" src="[% themelang %]/js/pages/circulation.js"></script>
23
<script type="text/javascript">
23
<script type="text/javascript">
24
//<![CDATA[
24
//<![CDATA[
25
/* Set some variable needed in circulation.js */
26
var interface = "[% interface %]";
27
var theme = "[% theme %]";
28
var borrowernumber = "[% borrowernumber %]";
29
var branchcode = "[% branch %]";
30
25
var MSG_ADD_MESSAGE = _("Add a new message");
31
var MSG_ADD_MESSAGE = _("Add a new message");
26
var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
32
var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
27
[% IF ( UseTablesortForCirc && dateformat == 'metric' ) %]dt_add_type_uk_date();[% END %]
33
[% IF ( UseTablesortForCirc && dateformat == 'metric' ) %]dt_add_type_uk_date();[% END %]
Lines 38-56 var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); Link Here
38
                }
44
                }
39
            }
45
            }
40
        }[% END %]);
46
        }[% END %]);
41
        [% IF ( UseTablesortForCirc ) %]
47
42
        $("#issuest").dataTable($.extend(true, {}, dataTablesDefaults, {
48
        $("#issues-table").dataTable(/*$.extend(true, {}, dataTablesDefaults, */{
43
            "sDom": 't',
49
            "sDom": "<'row-fluid'<'span6'><'span6'>r>t<'row-fluid'>t",
44
            "aaSorting": [],
50
            "aaSorting": [],
45
            "aoColumnDefs": [
46
                { "aTargets": [ -1, -2[% IF ( exports_enabled ) %], -3[% END %] ], "bSortable": false, "bSearchable": false }
47
            ],
48
            "aoColumns": [
51
            "aoColumns": [
49
                { "sType": "title-string" },{ "sType": "html" },null,{ "sType": "title-string" },null,null,null,null,null,null[% IF ( exports_enabled ) %],null[% END %]
52
                { 
53
                    "mDataProp": function( oObj ) {
54
                        var today = new Date();
55
                        var due = new Date( oObj.date_due );
56
                        if ( today > due ) {
57
                            return "<span class='overdue'>" + oObj.date_due_formatted + "</span>"; 
58
                        } else {
59
                            return oObj.date_due_formatted;
60
                        }
61
                    }
62
                },
63
                { 
64
                    "mDataProp": function ( oObj ) {
65
                        title = "<a href='/cgi-bin/koha/catalogue/detail.pl?biblionumber=" 
66
                              + oObj.biblionumber 
67
                              + "'>" 
68
                              + oObj.title 
69
                              + "</a>";
70
71
                        if ( oObj.author ) {
72
                            title += " " + _("by") + " " + oObj.author;
73
                        }
74
75
                        title += " " 
76
                              + "<a href='/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=" 
77
                              + oObj.biblionumber 
78
                              + "&itemnumber=" 
79
                              + oObj.itemnumber 
80
                              + "#" 
81
                              + oObj.itemnumber 
82
                              + "'>" 
83
                              + oObj.barcode 
84
                              + "</a>";
85
86
                        return title;
87
                    }
88
                },
89
                { "mDataProp": "itemtype" },
90
                { "mDataProp": "issuedate" },
91
                { "mDataProp": "branchname" },
92
                { "mDataProp": "itemcallnumber" },
93
                { "mDataProp": "charge" },
94
                { "mDataProp": "price" },
95
                { 
96
                    "bSortable": false,
97
                    "mDataProp": function ( oObj ) {
98
                        var content = "";
99
                        var span_style = "";
100
                        var span_class = "";
101
102
                        content += "<span style='padding: 0 1em;'>" + oObj.renewals_count + "</span>";
103
104
                        if ( oObj.can_renew ) {
105
                            // Do nothing 
106
                        } else if ( oObj.can_renew_error == "on_reserve" ) {
107
                            content += "<span class='renewals-disabled'>"
108
                                    + "<a href='/cgi-bin/koha/reserve/request.pl?biblionumber=" + oObj.biblionumber + "'>" + _("On hold") + "</a>"
109
                                    + "</span>";
110
111
                            span_style = "display: none";
112
                            span_class = "renewals-allowed";
113
                        } else if ( oObj.can_renew_error == "too_many" ) {
114
                            content += "<span class='renewals-disabled'>"
115
                                    + _("Not renewable")
116
                                    + "</span>";
117
118
                            span_style = "display: none";
119
                            span_class = "renewals-allowed";
120
                        } else {
121
                            content += "<span class='renewals-disabled'>" 
122
                                    + oObj.can_renew_error 
123
                                    + "</span>";
124
125
                            span_style = "display: none";
126
                            span_class = "renewals-allowed";
127
                        }
128
129
                        content += "<span class='" + span_class + "' style='" + span_style + "'>"
130
                                +  "<input type='checkbox' class='renew' id='renew_" + oObj.itemnumber + "' name='renew' value='" + oObj.itemnumber +"'/>"
131
                                +  "</span>";
132
133
                        if ( oObj.renewals_remaining ) {
134
                            content += "<span class='renewals'>(" 
135
                                    + oObj.renewals_remaining 
136
                                    + " " + _("of") + " " 
137
                                    + oObj.renewals_allowed + " " 
138
                                    + _("renewals remaining") + ")</span>"
139
                        }
140
141
142
                        return content;
143
                    }
144
                },
145
                { 
146
                    "bSortable": false,
147
                    "mDataProp": function ( oObj ) {
148
                        if ( oObj.can_renew_error == "on_reserve" ) {
149
                            return "<a href='/cgi-bin/koha/reserve/request.pl?biblionumber=" + oObj.biblionumber + "'>" + _("On hold") + "</a>";
150
                        } else {
151
                            return "<input type='checkbox' class='checkin' id='checkin_" + oObj.itemnumber + "' name='checkin' value='" + oObj.itemnumber +"'></input>";
152
                        }
153
                    }
154
                },
155
                {
156
                    "bSortable": false,
157
                    "mDataProp": function ( oObj ) {
158
                        return "<input type='checkbox' class='export' id='export_" + oObj.biblionumber + "' name='biblionumbers' value='" + oObj.biblionumber + "' />";
159
                    }
160
                }
50
            ],
161
            ],
51
            "bPaginate": false
162
            "bPaginate": false,
52
        }));
163
            "bProcessing": true,
53
164
            "bServerSide": true,
165
            "sAjaxSource": '/cgi-bin/koha/api/checkouts.pl',
166
            "fnServerData": function ( sSource, aoData, fnCallback ) {
167
                aoData.push( { "name": "borrowernumber", "value": "[% borrowernumber %]" } );
168
169
                $.getJSON( sSource, aoData, function (json) {
170
                    fnCallback(json)
171
                } );
172
            },
173
        }/*)*/);
174
175
[%#
54
        $("#relissuest").dataTable($.extend(true, {}, dataTablesDefaults, {
176
        $("#relissuest").dataTable($.extend(true, {}, dataTablesDefaults, {
55
            "sDom": 't',
177
            "sDom": 't',
56
            "aaSorting": [],
178
            "aaSorting": [],
Lines 59-86 var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); Link Here
59
            ],
181
            ],
60
            "bPaginate": false
182
            "bPaginate": false
61
        }));
183
        }));
184
%]
62
185
63
        $("#issuest").on("sort",function() {
186
        $("#issues-table").on("sort",function() {
64
            $("#previous").hide();  // Don't want to see "previous checkouts" header sorted with other rows
187
            $("#previous").hide();  // Don't want to see "previous checkouts" header sorted with other rows
65
        });
188
        });
66
        $("#relissuest").on("sort",function() {
189
        $("#relissuest").on("sort",function() {
67
            $("#relprevious").hide();  // Don't want to see "previous checkouts" header sorted with other rows
190
            $("#relprevious").hide();  // Don't want to see "previous checkouts" header sorted with other rows
68
        });
191
        });
69
        [% END %]
192
70
        [% IF ( AllowRenewalLimitOverride ) %]
193
        [% IF ( AllowRenewalLimitOverride ) %]
71
        $( '#override_limit' ).click( function () {
194
            $( '#override_limit' ).click( function () {
72
            if ( this.checked ) {
195
                if ( this.checked ) {
73
                $( '.renewals-allowed' ).show(); $( '.renewals-disabled' ).hide();
196
                    $( '.renewals-allowed' ).show(); $( '.renewals-disabled' ).hide();
74
            } else {
197
                } else {
75
                $( '.renewals-allowed' ).hide(); $( '.renewals-disabled' ).show();
198
                    $( '.renewals-allowed' ).hide(); $( '.renewals-disabled' ).show();
76
            }
199
                }
77
        } ).attr( 'checked', false );
200
            } ).attr( 'checked', false );
78
        [% END %][% IF !( CircAutoPrintQuickSlip == 'clear' ) %]
201
        [% END %]
79
        // listen submit to trigger qslip on empty checkout
202
            
80
        $('#mainform').bind('submit',function() {
203
        [% IF !( CircAutoPrintQuickSlip == 'clear' ) %]
81
          if ($('#barcode').val() == '') {
204
            // listen submit to trigger qslip on empty checkout
82
            return printx_window( '[% CircAutoPrintQuickSlip %]' ); }
205
            $('#mainform').bind('submit',function() {
83
        });[% END %]
206
                if ($('#barcode').val() == '') {
207
                    return printx_window( '[% CircAutoPrintQuickSlip %]' ); 
208
                }
209
            });
210
        [% END %]
84
211
85
    [% IF ( CAN_user_circulate_override_renewals ) %]
212
    [% IF ( CAN_user_circulate_override_renewals ) %]
86
    [% IF ( AllowRenewalLimitOverride ) %]
213
    [% IF ( AllowRenewalLimitOverride ) %]
Lines 706-953 No patron matched <span class="ex">[% message %]</span> Link Here
706
<!-- SUMMARY : TODAY & PREVIOUS ISSUES -->
833
<!-- SUMMARY : TODAY & PREVIOUS ISSUES -->
707
<div id="checkouts">
834
<div id="checkouts">
708
[% IF ( issuecount ) %]
835
[% IF ( issuecount ) %]
709
    <form name="issues" action="/cgi-bin/koha/reserve/renewscript.pl" method="post" class="checkboxed">
836
    <table id="issues-table">
710
    <input type="hidden" value="circ" name="destination" />
837
        <thead>
711
    <input type="hidden" name="cardnumber" value="[% cardnumber %]" />
838
            <tr>
712
    <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
839
                <th scope="col">Due date</th>
713
    <input type="hidden" name="branch" value="[% branch %]" />
840
                <th scope="col">Title</th>
714
        <table id="issuest">
841
                <th scope="col">Item type</th>
715
    <thead><tr>
842
                <th scope="col">Checked out on</th>
716
        <th scope="col">Due date</th>
843
                <th scope="col">Checked out from</th>
717
        <th scope="col">Title</th>
844
                <th scope="col">Call no</th>
718
        <th scope="col">Item type</th>
845
                <th scope="col">Charge</th>
719
        <th scope="col">Checked out on</th>
846
                <th scope="col">Price</th>
720
        <th scope="col">Checked out from</th>
847
                <th scope="col">Renew <p class="column-tool"><a href="#" id="CheckAllRenewals">select all</a> | <a href="#" id="UncheckAllRenewals">none</a></p></th>
721
        <th scope="col">Call no</th>
848
                <th scope="col">Check in <p class="column-tool"><a href="#" id="CheckAllCheckins">select all</a> | <a href="#" id="UncheckAllCheckins">none</a></p></th>
722
        <th scope="col">Charge</th>
849
                <th scope="col">Export <p class="column-tool"><a href="#" id="CheckAllExports">select all</a> | <a href="#" id="UncheckAllExports">none</a></p></th>
723
        <th scope="col">Price</th>
850
            </tr>
724
        <th scope="col">Renew <p class="column-tool"><a href="#" id="CheckAllitems">select all</a> | <a href="#" id="CheckNoitems">none</a></p></th>
851
        </thead>
725
        <th scope="col">Check in <p class="column-tool"><a href="#" id="CheckAllreturns">select all</a> | <a href="#" id="CheckNoreturns">none</a></p></th>
852
    </table>
726
        [% IF ( exports_enabled ) %]
727
          <th scope="col">Export <p class="column-tool"><a href="#" id="CheckAllexports">select all</a> | <a href="#" id="CheckNoexports">none</a></p></th>
728
        [% END %]
729
    </tr></thead>
730
[% IF ( todayissues ) %]
731
[% INCLUDE 'checkouts-table-footer.inc' %]
732
	<tbody>
733
734
    [% FOREACH todayissue IN todayissues %]
735
    [% IF ( loop.odd ) %]
736
    <tr>
737
    [% ELSE %]
738
    <tr class="highlight">
739
    [% END %]
740
        [% IF ( todayissue.od ) %]<td class="od">[% ELSE %]<td>[% END %]
741
        <span title="[% todayissue.dd_sort %]">[% todayissue.dd %]</span>
742
853
743
            [% IF ( todayissue.itemlost ) %]
854
    [% IF ( issuecount ) %]
744
                <span class="lost">[% AuthorisedValues.GetByCode( 'LOST', todayissue.itemlost ) %]</span>
855
        <fieldset class="action">
745
            [% END %]
856
            [% IF ( CAN_user_circulate_override_renewals ) %]
746
            [% IF ( todayissue.damaged ) %]
857
                [% IF ( AllowRenewalLimitOverride ) %]
747
                <span class="dmg">[% AuthorisedValues.GetByCode( 'DAMAGED', todayissue.damaged ) %]</span>
858
                    <label for="override_limit">Override renewal limit:</label>
748
            [% END %]
859
                    <input type="checkbox" name="override_limit" id="override_limit" value="1" />
749
        </td>
750
        <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% todayissue.biblionumber %]&amp;type=intra"><strong>[% todayissue.title |html %][% FOREACH subtitl IN todayissue.subtitle %] [% subtitl.subfield %][% END %]</strong></a>[% IF ( todayissue.author ) %], by [% todayissue.author %][% END %][% IF ( todayissue.itemnotes ) %]- <span class="circ-hlt">[% todayissue.itemnotes %]</span>[% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% todayissue.biblionumber %]&amp;itemnumber=[% todayissue.itemnumber %]#item[% todayissue.itemnumber %]">[% todayissue.barcode %]</a></td>
751
        <td>[% UNLESS ( noItemTypeImages ) %] [% IF ( todayissue.itemtype_image ) %]<img src="[% todayissue.itemtype_image %]" alt="" />[% END %][% END %][% todayissue.itemtype %]</td>
752
        <td><span title="[% todayissue.displaydate_sort %]">[% todayissue.checkoutdate %]</span></td>
753
        [% IF ( todayissue.multiple_borrowers ) %]<td>[% todayissue.firstname %] [% todayissue.surname %]</td>[% END %]
754
        <td>[% todayissue.issuingbranchname %]</td>
755
        <td>[% todayissue.itemcallnumber %]</td>
756
            <td>[% todayissue.charge %]</td>
757
            <td>[% todayissue.replacementprice %]</td>
758
      [% IF ( todayissue.renew_failed ) %]
759
            <td class="problem">Renewal failed</td>
760
      [% ELSE %]
761
        <td><span style="padding: 0 1em;">[% IF ( todayissue.renewals ) %][% todayissue.renewals %][% ELSE %]0[% END %]</span>
762
        [% IF ( todayissue.can_renew ) %]
763
        <input type="checkbox" name="all_items[]" value="[% todayissue.itemnumber %]" checked="checked" style="display: none;" />
764
        [% IF ( todayissue.od ) %]
765
            <input type="checkbox" class="radio" name="items[]" value="[% todayissue.itemnumber %]" checked="checked" />
766
        [% ELSE %]
767
            <input type="checkbox" class="radio" name="items[]" value="[% todayissue.itemnumber %]" />
768
        [% END %]
769
            [% IF todayissue.renewsallowed && todayissue.renewsleft %]
770
                <span class="renewals">([% todayissue.renewsleft %] of [% todayissue.renewsallowed %] renewals remaining)</span>
771
            [% END %]
772
        [% ELSE %]
773
            [% IF ( todayissue.can_confirm ) %]<span class="renewals-allowed" style="display: none">
774
                <input type="checkbox" name="all_items[]" value="[% todayissue.itemnumber %]" checked="checked" style="display: none;" />
775
                [% IF ( todayissue.od ) %]
776
                    <input type="checkbox" class="radio" name="items[]" value="[% todayissue.itemnumber %]" checked="checked" />
777
                [% ELSE %]
778
                    <input type="checkbox" class="radio" name="items[]" value="[% todayissue.itemnumber %]" />
779
                [% END %]
780
                </span>
781
                [% IF todayissue.renewsallowed && todayissue.renewsleft %]
782
                    <span class="renewals">([% todayissue.renewsleft %] of [% todayissue.renewsallowed %] renewals remaining)</span>
783
                [% END %]
784
                <span class="renewals-disabled">
785
            [% END %]
786
		[% IF ( todayissue.renew_error_on_reserve ) %]
787
            <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% todayissue.biblionumber %]">On hold</a>
788
		[% END %]
789
                [% IF ( todayissue.renew_error_too_many ) %]
790
            Not renewable
791
                [% END %]
860
                [% END %]
792
            [% IF ( todayissue.can_confirm ) %]
793
                </span>
794
            [% END %]
861
            [% END %]
795
        [% END %]
862
            <button class="btn" id="RenewCheckinChecked"><i class="icon-book"></i> Renew or Return checked items</button>
796
        </td>
863
            <button class="btn" id="RenewAll"><i class="icon-book"></i> Renew all</button>
797
        [% END %]
864
        </fieldset>
798
        [% IF ( todayissue.return_failed ) %]
799
            <td class="problem">Checkin failed</td>
800
        [% ELSE %]
801
            [% IF ( todayissue.renew_error_on_reserve ) %]
802
               <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% todayissue.biblionumber %]">On hold</a>
803
                <input type="checkbox" name="all_barcodes[]" value="[% todayissue.barcode %]" checked="checked" style="display: none;" />
804
                </td>
805
            [% ELSE %]
806
            <td><input type="checkbox" class="radio" name="barcodes[]"  value="[% todayissue.barcode %]" />
807
                <input type="checkbox" name="all_barcodes[]" value="[% todayissue.barcode %]" checked="checked" style="display: none;" />
808
            </td>
809
            [% END %]
810
        [% END %]
811
        [% IF ( exports_enabled ) %]
812
          <td style="text-align:center;">
813
            <input type="checkbox" id="export_[% todayissue.biblionumber %]" name="biblionumbers" value="[% todayissue.biblionumber %]" />
814
            <input type="checkbox" name="itemnumbers" value="[% todayissue.itemnumber %]" style="visibility:hidden;" />
815
          </td>
816
        [% END %]
817
    </tr>
818
    [% END %] <!-- /loop todayissues -->
819
    <!-- /if todayissues -->[% END %]
820
865
821
[% IF ( previssues ) %]
822
    [% UNLESS ( todayissues ) %]
823
    [% INCLUDE 'checkouts-table-footer.inc' %]
824
        <tbody>
825
    [% END %]
826
    [% IF ( UseTablesortForCirc ) %]<tr id="previous"><th><span title="">Previous checkouts</span></th><th></th><th></th><th><span title=""></span></th><th></th><th></th><th></th><th></th><th></th><th></th>[% IF ( exports_enabled ) %]<th></th>[% END %]</tr>[% ELSE %]<tr id="previous">[% IF ( exports_enabled ) %]<th colspan="11">[% ELSE %]<th colspan="10">[% END %]Previous checkouts</th></tr>[% END %]
827
    [% FOREACH previssue IN previssues %]
828
    [% IF ( loop.odd ) %]
829
        <tr>
830
    [% ELSE %]
831
        <tr class="highlight">
832
    [% END %]
833
        [% IF ( previssue.od ) %]<td class="od">[% ELSE %]<td>[% END %]
834
        <span title="[% previssue.dd_sort %]">[% previssue.dd %]</span>
835
836
            [% IF ( previssue.itemlost ) %]
837
                <span class="lost">[% AuthorisedValues.GetByCode( 'LOST', previssue.itemlost ) %]</span>
838
            [% END %]
839
            [% IF ( previssue.damaged ) %]
840
                <span class="dmg">[% AuthorisedValues.GetByCode( 'DAMAGED', previssue.damaged ) %]</span>
841
            [% END %]
842
        </td>
843
        <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% previssue.biblionumber %]&amp;type=intra"><strong>[% previssue.title |html %][% FOREACH subtitl IN previssue.subtitle %] [% subtitl.subfield %][% END %]</strong></a>[% IF ( previssue.author ) %], by [% previssue.author %][% END %] [% IF ( previssue.itemnotes ) %]- [% previssue.itemnotes %][% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% previssue.biblionumber %]&amp;itemnumber=[% previssue.itemnumber %]#item[% previssue.itemnumber %]">[% previssue.barcode %]</a></td>
844
        <td>
845
            [% previssue.itemtype %]
846
        </td>
847
        <td><span title="[% previssue.displaydate_sort %]">[% previssue.displaydate %]</span></td>
848
        [% IF ( previssue.multiple_borrowers ) %]<td>[% previssue.firstname %] [% previssue.surname %]</td>[% END %]
849
        <td>[% previssue.issuingbranchname %]</td>
850
        <td>[% previssue.itemcallnumber %]</td>
851
        <td>[% previssue.charge %]</td>
852
        <td>[% previssue.replacementprice %]</td>
853
      [% IF ( previssue.renew_failed ) %]
854
            <td class="problem">Renewal failed</td>
855
      [% ELSE %]
856
        <td><span style="padding: 0 1em;">[% IF ( previssue.renewals ) %][% previssue.renewals %][% ELSE %]0[% END %]</span>
857
        [% IF ( previssue.can_renew ) %]
858
        <input type="checkbox" name="all_items[]" value="[% previssue.itemnumber %]" checked="checked" style="display: none;" />
859
        [% IF ( previssue.od ) %]
860
            <input type="checkbox" class="radio" name="items[]" value="[% previssue.itemnumber %]" checked="checked" />
861
        [% ELSE %]
862
            <input type="checkbox" class="radio" name="items[]" value="[% previssue.itemnumber %]" />
863
        [% END %]
864
            [% IF previssue.renewsallowed && previssue.renewsleft %]
865
                <span class="renewals">([% previssue.renewsleft %] of [% previssue.renewsallowed %] renewals remaining)</span>
866
            [% END %]
867
        [% ELSE %]
868
            [% IF ( previssue.can_confirm ) %]<span class="renewals-allowed" style="display: none">
869
                <input type="checkbox" name="all_items[]" value="[% previssue.itemnumber %]" checked="checked" style="display: none;" />
870
                [% IF ( previssue.od ) %]
871
                    <input type="checkbox" class="radio" name="items[]" value="[% previssue.itemnumber %]" checked="checked" />
872
                [% ELSE %]
873
                    <input type="checkbox" class="radio" name="items[]" value="[% previssue.itemnumber %]" />
874
                [% END %]
875
                </span>
876
                [% IF previssue.renewsallowed && previssue.renewsleft %]
877
                    <span class="renewals">([% previssue.renewsleft %] of [% previssue.renewsallowed %] renewals remaining)</span>
878
                [% END %]
879
                <span class="renewals-disabled">
880
            [% END %]
881
		[% IF ( previssue.renew_error_on_reserve ) %]
882
            <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% previssue.biblionumber %]">On hold</a>
883
		[% END %]
884
                [% IF ( previssue.renew_error_too_many ) %]
885
            Not renewable
886
                [% END %]
887
            [% IF ( previssue.can_confirm ) %]
888
                </span>
889
            [% END %]
890
        [% END %]
891
        </td>
892
        [% END %]
893
		  [% IF ( previssue.return_failed ) %]
894
            <td class="problem">Check-in failed</td>
895
        [% ELSE %]
896
            [% IF ( previssue.renew_error_on_reserve ) %]
897
               <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% previssue.biblionumber %]">On hold</a>
898
                <input type="checkbox" name="all_barcodes[]" value="[% previssue.barcode %]" checked="checked" style="display: none;" />
899
                </td>
900
            [% ELSE %]
901
            <td><input type="checkbox" class="radio" name="barcodes[]"  value="[% previssue.barcode %]" />
902
                <input type="checkbox" name="all_barcodes[]" value="[% previssue.barcode %]" checked="checked" style="display: none;" />
903
            </td>
904
            [% END %]
905
        [% END %]
906
        [% IF ( exports_enabled ) %]
907
          <td style="text-align:center;">
908
            <input type="checkbox" id="export_[% previssue.biblionumber %]" name="biblionumbers" value="[% previssue.biblionumber %]" />
909
            <input type="checkbox" name="itemnumbers" value="[% previssue.itemnumber %]" style="visibility:hidden;" />
910
          </td>
911
        [% END %]
912
    </tr>
913
    <!-- /loop previssues -->[% END %]
914
<!--/if previssues -->[% END %]
915
      </tbody>
916
    </table>
917
    [% IF ( issuecount ) %]
918
    <fieldset class="action">
919
        [% IF ( CAN_user_circulate_override_renewals ) %]
920
        [% IF ( AllowRenewalLimitOverride ) %]
921
        <label for="override_limit">Override renewal limit:</label>
922
        <input type="checkbox" name="override_limit" id="override_limit" value="1" />
923
        [% END %]
924
        [% END %]
925
        <input type="submit" name="renew_checked" value="Renew or Return checked items" />
926
        <input type="submit" id="renew_all" name="renew_all" value="Renew all" />
927
    </fieldset>
928
        [% IF ( exports_enabled ) %]
866
        [% IF ( exports_enabled ) %]
929
            <fieldset>
867
            <fieldset>
930
            <label for="export_formats"><b>Export checkouts using format:</b></label>
868
                <label for="export_formats"><b>Export checkouts using format:</b></label>
931
            <select name="export_formats" id="export_formats">
869
                <select name="export_formats" id="export_formats">
932
                <option value="iso2709_995">ISO2709 with items</option>
870
                    <option value="iso2709_995">ISO2709 with items</option>
933
                <option value="iso2709">ISO2709 without items</option>
871
                    <option value="iso2709">ISO2709 without items</option>
934
                [% IF ( export_with_csv_profile ) %]
872
                    [% IF ( export_with_csv_profile ) %]
935
                    <option value="csv">CSV</option>
873
                        <option value="csv">CSV</option>
936
                [% END %]
874
                    [% END %]
875
                </select>
937
876
938
            </select>
877
               <label for="export_remove_fields">Don't export fields:</label> <input type="text" id="export_remove_fields" name="export_remove_fields" value="[% export_remove_fields %]" title="Use for iso2709 exports" />
939
           <label for="export_remove_fields">Don't export fields:</label> <input type="text" id="export_remove_fields" name="export_remove_fields" value="[% export_remove_fields %]" title="Use for iso2709 exports" />
878
                <input type="hidden" name="op" value="export" />
940
            <input type="hidden" name="op" value="export" />
879
                <input type="hidden" id="export_format" name="format" value="iso2709" />
941
            <input type="hidden" id="export_format" name="format" value="iso2709" />
880
                <input type="hidden" id="dont_export_item" name="dont_export_item" value="0" />
942
            <input type="hidden" id="dont_export_item" name="dont_export_item" value="0" />
881
                <input type="hidden" id="record_type" name="record_type" value="bibs" />
943
            <input type="hidden" id="record_type" name="record_type" value="bibs" />
882
                <input type="button" id="export_submit" value="Export" />
944
            <input type="button" id="export_submit" value="Export" />
945
            </fieldset>
883
            </fieldset>
946
        [% END %]
884
        [% END %]
947
    [% END %]
885
    [% END %]
948
    </form>
886
    </form>
949
[% ELSE %]
887
[% ELSE %]
950
<p>Patron has nothing checked out.</p>
888
    <p>Patron has nothing checked out.</p>
951
[% END %]
889
[% END %]
952
890
953
</div>
891
</div>
954
- 

Return to bug 11703