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

(-)a/C4/HoldsQueue.pm (-8 / +59 lines)
Lines 46-51 BEGIN { Link Here
46
46
47
        &TransportCostMatrix
47
        &TransportCostMatrix
48
        &UpdateTransportCostMatrix
48
        &UpdateTransportCostMatrix
49
50
        &MarkHoldPrinted
51
        &GetItemNumberFromTmpHold
49
     );
52
     );
50
}
53
}
51
54
Lines 116-122 Returns hold queue for a holding branch. If branch is omitted, then whole queue Link Here
116
=cut
119
=cut
117
120
118
sub GetHoldsQueueItems {
121
sub GetHoldsQueueItems {
119
    my ($branchlimit) = @_;
122
    my ($branchlimit, $printstatus) = @_;
120
    my $dbh   = C4::Context->dbh;
123
    my $dbh   = C4::Context->dbh;
121
124
122
    my @bind_params = ();
125
    my @bind_params = ();
Lines 130-135 sub GetHoldsQueueItems { Link Here
130
        $query .=" WHERE tmp_holdsqueue.holdingbranch = ?";
133
        $query .=" WHERE tmp_holdsqueue.holdingbranch = ?";
131
        push @bind_params, $branchlimit;
134
        push @bind_params, $branchlimit;
132
    }
135
    }
136
    if (C4::Context->preference('printSlipFromHoldsQueue')){
137
        $query .= $branchlimit ? " AND" : " WHERE";
138
        $query .= " tmp_holdsqueue.print_status = ?";
139
        push @bind_params, $printstatus;
140
    }
133
    $query .= " ORDER BY ccode, location, cn_sort, author, title, pickbranch, reservedate";
141
    $query .= " ORDER BY ccode, location, cn_sort, author, title, pickbranch, reservedate";
134
    my $sth = $dbh->prepare($query);
142
    my $sth = $dbh->prepare($query);
135
    $sth->execute(@bind_params);
143
    $sth->execute(@bind_params);
Lines 266-273 sub GetPendingHoldRequestsForBib { Link Here
266
274
267
    my $dbh = C4::Context->dbh;
275
    my $dbh = C4::Context->dbh;
268
276
269
    my $request_query = "SELECT biblionumber, borrowernumber, itemnumber, priority, reserves.branchcode,
277
    my $request_query = "SELECT reserve_id, biblionumber, borrowernumber, itemnumber, priority, reserves.branchcode,
270
                                reservedate, reservenotes, borrowers.branchcode AS borrowerbranch
278
                                reservedate, reservenotes, borrowers.branchcode AS borrowerbranch, print_status
271
                         FROM reserves
279
                         FROM reserves
272
                         JOIN borrowers USING (borrowernumber)
280
                         JOIN borrowers USING (borrowernumber)
273
                         WHERE biblionumber = ?
281
                         WHERE biblionumber = ?
Lines 385-390 sub MapItemsToHoldRequests { Link Here
385
            if (exists $items_by_itemnumber{$request->{itemnumber}} and
393
            if (exists $items_by_itemnumber{$request->{itemnumber}} and
386
                not exists $allocated_items{$request->{itemnumber}}) {
394
                not exists $allocated_items{$request->{itemnumber}}) {
387
                $item_map{$request->{itemnumber}} = {
395
                $item_map{$request->{itemnumber}} = {
396
                    reserve_id => $request->{reserve_id},
388
                    borrowernumber => $request->{borrowernumber},
397
                    borrowernumber => $request->{borrowernumber},
389
                    biblionumber => $request->{biblionumber},
398
                    biblionumber => $request->{biblionumber},
390
                    holdingbranch =>  $items_by_itemnumber{$request->{itemnumber}}->{holdingbranch},
399
                    holdingbranch =>  $items_by_itemnumber{$request->{itemnumber}}->{holdingbranch},
Lines 392-397 sub MapItemsToHoldRequests { Link Here
392
                    item_level => 1,
401
                    item_level => 1,
393
                    reservedate => $request->{reservedate},
402
                    reservedate => $request->{reservedate},
394
                    reservenotes => $request->{reservenotes},
403
                    reservenotes => $request->{reservenotes},
404
                    print_status => $request->{print_status},
395
                };
405
                };
396
                $allocated_items{$request->{itemnumber}}++;
406
                $allocated_items{$request->{itemnumber}}++;
397
                $num_items_remaining--;
407
                $num_items_remaining--;
Lines 491-496 sub MapItemsToHoldRequests { Link Here
491
            delete $items_by_branch{$holdingbranch} unless @$holding_branch_items;
501
            delete $items_by_branch{$holdingbranch} unless @$holding_branch_items;
492
502
493
            $item_map{$itemnumber} = {
503
            $item_map{$itemnumber} = {
504
                reserve_id => $request->{reserve_id},
494
                borrowernumber => $request->{borrowernumber},
505
                borrowernumber => $request->{borrowernumber},
495
                biblionumber => $request->{biblionumber},
506
                biblionumber => $request->{biblionumber},
496
                holdingbranch => $holdingbranch,
507
                holdingbranch => $holdingbranch,
Lines 498-503 sub MapItemsToHoldRequests { Link Here
498
                item_level => 0,
509
                item_level => 0,
499
                reservedate => $request->{reservedate},
510
                reservedate => $request->{reservedate},
500
                reservenotes => $request->{reservenotes},
511
                reservenotes => $request->{reservenotes},
512
                print_status => $request->{print_status},
501
            };
513
            };
502
            $num_items_remaining--;
514
            $num_items_remaining--;
503
        }
515
        }
Lines 515-528 sub CreatePicklistFromItemMap { Link Here
515
    my $dbh = C4::Context->dbh;
527
    my $dbh = C4::Context->dbh;
516
528
517
    my $sth_load=$dbh->prepare("
529
    my $sth_load=$dbh->prepare("
518
        INSERT INTO tmp_holdsqueue (biblionumber,itemnumber,barcode,surname,firstname,phone,borrowernumber,
530
        INSERT INTO tmp_holdsqueue (reserve_id,biblionumber,itemnumber,barcode,surname,firstname,phone,borrowernumber,
519
                                    cardnumber,reservedate,title, itemcallnumber,
531
                                    cardnumber,reservedate,title, itemcallnumber,
520
                                    holdingbranch,pickbranch,notes, item_level_request)
532
                                    holdingbranch,pickbranch,notes, item_level_request,print_status)
521
        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
533
        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
522
    ");
534
    ");
523
535
524
    foreach my $itemnumber  (sort keys %$item_map) {
536
    foreach my $itemnumber  (sort keys %$item_map) {
525
        my $mapped_item = $item_map->{$itemnumber};
537
        my $mapped_item = $item_map->{$itemnumber};
538
        my $reserve_id = $mapped_item->{reserve_id};
526
        my $biblionumber = $mapped_item->{biblionumber};
539
        my $biblionumber = $mapped_item->{biblionumber};
527
        my $borrowernumber = $mapped_item->{borrowernumber};
540
        my $borrowernumber = $mapped_item->{borrowernumber};
528
        my $pickbranch = $mapped_item->{pickup_branch};
541
        my $pickbranch = $mapped_item->{pickup_branch};
Lines 530-535 sub CreatePicklistFromItemMap { Link Here
530
        my $reservedate = $mapped_item->{reservedate};
543
        my $reservedate = $mapped_item->{reservedate};
531
        my $reservenotes = $mapped_item->{reservenotes};
544
        my $reservenotes = $mapped_item->{reservenotes};
532
        my $item_level = $mapped_item->{item_level};
545
        my $item_level = $mapped_item->{item_level};
546
        my $print_status = $mapped_item->{print_status};
533
547
534
        my $item = GetItem($itemnumber);
548
        my $item = GetItem($itemnumber);
535
        my $barcode = $item->{barcode};
549
        my $barcode = $item->{barcode};
Lines 544-552 sub CreatePicklistFromItemMap { Link Here
544
        my $bib = GetBiblioData($biblionumber);
558
        my $bib = GetBiblioData($biblionumber);
545
        my $title = $bib->{title};
559
        my $title = $bib->{title};
546
560
547
        $sth_load->execute($biblionumber, $itemnumber, $barcode, $surname, $firstname, $phone, $borrowernumber,
561
        $sth_load->execute($reserve_id,$biblionumber, $itemnumber, $barcode, $surname, $firstname, $phone, $borrowernumber,
548
                           $cardnumber, $reservedate, $title, $itemcallnumber,
562
                           $cardnumber, $reservedate, $title, $itemcallnumber,
549
                           $holdingbranch, $pickbranch, $reservenotes, $item_level);
563
                           $holdingbranch, $pickbranch, $reservenotes, $item_level,$print_status);
550
    }
564
    }
551
}
565
}
552
566
Lines 635-640 sub least_cost_branch { Link Here
635
    # XXX return a random @branch with minimum cost instead of the first one;
649
    # XXX return a random @branch with minimum cost instead of the first one;
636
    # return $branch[0] if @branch == 1;
650
    # return $branch[0] if @branch == 1;
637
}
651
}
652
=head2 MarkHoldPrinted
653
    MarkHoldPrinted($reserve_id)
654
    Change print status as printed.
655
=cut
656
657
sub MarkHoldPrinted {
658
   my ( $reserve_id ) = @_;
659
   my $dbh = C4::Context->dbh;
660
   my $strsth="UPDATE reserves INNER JOIN tmp_holdsqueue USING (reserve_id)
661
                SET reserves.print_status = 1 , tmp_holdsqueue.print_status = 1
662
                WHERE reserve_id = ?
663
		";
664
    my $sth = $dbh->prepare($strsth);
665
	$sth->execute($reserve_id);
666
667
    return 1;
668
}
638
669
670
=head2 GetItemNumberFromTmpHold
671
    $itemnumber = GetItemNumberFromTmpHold($reserve_id)
672
    Returns itemnumber associated with hold.
673
    Item number is taken from tmp_holdsqueue table, which is
674
    populated by bulid_holds_queue.pl script.
675
676
=cut
677
sub	GetItemNumberFromTmpHold{
678
	my ( $reserve_id ) = @_;
679
	my $dbh = C4::Context->dbh;
680
	my $strsth="SELECT itemnumber
681
                  FROM tmp_holdsqueue
682
                WHERE reserve_id = ?
683
		";
684
	my $sth = $dbh->prepare($strsth);
685
	$sth->execute($reserve_id);
686
687
	my $data = $sth->fetchrow;
688
	return $data;
689
}
639
690
640
1;
691
1;
(-)a/C4/Reserves.pm (+26 lines)
Lines 132-137 BEGIN { Link Here
132
        &ToggleLowestPriority
132
        &ToggleLowestPriority
133
133
134
        &ReserveSlip
134
        &ReserveSlip
135
        &HoldSlip
135
        &ToggleSuspend
136
        &ToggleSuspend
136
        &SuspendAll
137
        &SuspendAll
137
138
Lines 2290-2295 sub ReserveSlip { Link Here
2290
    );
2291
    );
2291
}
2292
}
2292
2293
2294
=head2 HoldSlip
2295
    HoldSlip($branch, $reserve_id, $itemnumber)
2296
2297
    Returns letter hash ( see C4::Letters::GetPreparedLetter ) or undef
2298
2299
=cut
2300
2301
sub HoldSlip {
2302
    my ($branch, $reserve_id, $itemnumber) = @_;
2303
2304
    my $reserve = GetReserveInfo($reserve_id) or return;
2305
2306
    return  C4::Letters::GetPreparedLetter (
2307
        module => 'circulation',
2308
        letter_code => 'RESERVESLIP',
2309
        branchcode => $branch,
2310
        tables => {
2311
            'reserves'    => $reserve,
2312
            'branches'    => $reserve->{branchcode},
2313
            'borrowers'   => $reserve->{borrowernumber},
2314
            'biblio'      => $reserve->{biblionumber},
2315
            'items'       => $itemnumber,
2316
        },
2317
    );
2318
}
2293
=head2 GetReservesControlBranch
2319
=head2 GetReservesControlBranch
2294
2320
2295
  my $reserves_control_branch = GetReservesControlBranch($item, $borrower);
2321
  my $reserves_control_branch = GetReservesControlBranch($item, $borrower);
(-)a/circ/hold-pull-print.pl (+74 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 2 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use strict;
19
#use warnings; #FIXME - Bug 2505
20
use C4::Context;
21
use C4::Output;
22
use CGI;
23
use C4::Auth qw/:DEFAULT get_session/;
24
use C4::Reserves qw/HoldSlip/;
25
use C4::HoldsQueue qw/GetItemNumberFromTmpHold MarkHoldPrinted/;
26
27
use vars qw($debug);
28
29
BEGIN {
30
    $debug = $ENV{DEBUG} || 0;
31
}
32
33
my $input = new CGI;
34
my $sessionID = $input->cookie("CGISESSID");
35
my $session = get_session($sessionID);
36
37
my @reservations = $input->param('reserve_id');
38
39
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
40
    {
41
        template_name   => "circ/printslip.tmpl",
42
        query           => $input,
43
        type            => "intranet",
44
        authnotrequired => 0,
45
        flagsrequired   => { circulate => "circulate_remaining_permissions" },
46
        debug           => $debug,
47
    }
48
);
49
50
my $userenv = C4::Context->userenv;
51
my $branch = $session->param('branch') || $userenv->{branch} || '';
52
my ($slip, $is_html);
53
54
foreach my $reserve_id (@reservations){
55
        my $itemnumber = GetItemNumberFromTmpHold($reserve_id);
56
57
        if ( my $letter = HoldSlip ($branch, $reserve_id, $itemnumber) ) {
58
            $slip .= $letter->{content};
59
            $is_html = $letter->{is_html};
60
        }
61
        else {
62
            $slip .= "Reserve not found";
63
        }
64
        MarkHoldPrinted($reserve_id);
65
}
66
67
$template->param(
68
    slip => $slip,
69
    plain => !$is_html,
70
    title => "Koha -- Circulation: Hold print",
71
    stylesheet => C4::Context->preference("SlipCSS"),
72
);
73
74
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/circ/view_holdsqueue.pl (-2 / +5 lines)
Lines 49-63 my $params = $query->Vars; Link Here
49
my $run_report     = $params->{'run_report'};
49
my $run_report     = $params->{'run_report'};
50
my $branchlimit    = $params->{'branchlimit'};
50
my $branchlimit    = $params->{'branchlimit'};
51
my $itemtypeslimit = $params->{'itemtypeslimit'};
51
my $itemtypeslimit = $params->{'itemtypeslimit'};
52
my $showprinted    = $params->{'showprinted'} ? 1 : 0;
53
52
54
53
if ( $run_report ) {
55
if ( $run_report ) {
54
    # XXX GetHoldsQueueItems() does not support $itemtypeslimit!
56
    # XXX GetHoldsQueueItems() does not support $itemtypeslimit!
55
    my $items = GetHoldsQueueItems($branchlimit, $itemtypeslimit);
57
    my $items = GetHoldsQueueItems( $branchlimit, $showprinted, $itemtypeslimit);
56
    $template->param(
58
    $template->param(
57
        branchlimit     => $branchlimit,
59
        branchlimit     => $branchlimit,
58
        total      => scalar @$items,
60
        total      => scalar @$items,
59
        itemsloop  => $items,
61
        itemsloop  => $items,
60
        run_report => $run_report,
62
        run_report => $run_report,
63
        showprinted => $showprinted,
61
    );
64
    );
62
}
65
}
63
66
Lines 70-79 foreach my $thisitemtype ( sort keys %$itemtypes ) { Link Here
70
        description => $itemtypes->{$thisitemtype}->{'description'},
73
        description => $itemtypes->{$thisitemtype}->{'description'},
71
    };
74
    };
72
}
75
}
73
74
$template->param(
76
$template->param(
75
     branchloop => GetBranchesLoop(C4::Context->userenv->{'branch'}),
77
     branchloop => GetBranchesLoop(C4::Context->userenv->{'branch'}),
76
   itemtypeloop => \@itemtypesloop,
78
   itemtypeloop => \@itemtypesloop,
79
   printenable => C4::Context->preference('printSlipFromHoldsQueue'),
77
);
80
);
78
81
79
# writing the template
82
# writing the template
(-)a/installer/data/mysql/kohastructure.sql (-1 / +5 lines)
Lines 1634-1639 CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b Link Here
1634
  `lowestPriority` tinyint(1) NOT NULL, -- has this hold been pinned to the lowest priority in the holds queue (1 for yes, 0 for no)
1634
  `lowestPriority` tinyint(1) NOT NULL, -- has this hold been pinned to the lowest priority in the holds queue (1 for yes, 0 for no)
1635
  `suspend` BOOLEAN NOT NULL DEFAULT 0, -- in this hold suspended (1 for yes, 0 for no)
1635
  `suspend` BOOLEAN NOT NULL DEFAULT 0, -- in this hold suspended (1 for yes, 0 for no)
1636
  `suspend_until` DATETIME NULL DEFAULT NULL, -- the date this hold is suspended until (NULL for infinitely)
1636
  `suspend_until` DATETIME NULL DEFAULT NULL, -- the date this hold is suspended until (NULL for infinitely)
1637
  `print_status` BOOLEAN NOT NULL DEFAULT 0, -- is this hold printed (1 - yes, 0 - no)
1637
  PRIMARY KEY (`reserve_id`),
1638
  PRIMARY KEY (`reserve_id`),
1638
  KEY `old_reserves_borrowernumber` (`borrowernumber`),
1639
  KEY `old_reserves_borrowernumber` (`borrowernumber`),
1639
  KEY `old_reserves_biblionumber` (`biblionumber`),
1640
  KEY `old_reserves_biblionumber` (`biblionumber`),
Lines 1836-1841 CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha Link Here
1836
  `lowestPriority` tinyint(1) NOT NULL,
1837
  `lowestPriority` tinyint(1) NOT NULL,
1837
  `suspend` BOOLEAN NOT NULL DEFAULT 0,
1838
  `suspend` BOOLEAN NOT NULL DEFAULT 0,
1838
  `suspend_until` DATETIME NULL DEFAULT NULL,
1839
  `suspend_until` DATETIME NULL DEFAULT NULL,
1840
  `print_status` BOOLEAN NOT NULL DEFAULT 0, -- is this hold printed (1 - yes, 0 - no)
1839
  PRIMARY KEY (`reserve_id`),
1841
  PRIMARY KEY (`reserve_id`),
1840
  KEY priorityfoundidx (priority,found),
1842
  KEY priorityfoundidx (priority,found),
1841
  KEY `borrowernumber` (`borrowernumber`),
1843
  KEY `borrowernumber` (`borrowernumber`),
Lines 2507-2512 CREATE TABLE `user_permissions` ( Link Here
2507
2509
2508
DROP TABLE IF EXISTS `tmp_holdsqueue`;
2510
DROP TABLE IF EXISTS `tmp_holdsqueue`;
2509
CREATE TABLE `tmp_holdsqueue` (
2511
CREATE TABLE `tmp_holdsqueue` (
2512
  `reserve_id` int(11) NOT NULL,
2510
  `biblionumber` int(11) default NULL,
2513
  `biblionumber` int(11) default NULL,
2511
  `itemnumber` int(11) default NULL,
2514
  `itemnumber` int(11) default NULL,
2512
  `barcode` varchar(20) default NULL,
2515
  `barcode` varchar(20) default NULL,
Lines 2521-2527 CREATE TABLE `tmp_holdsqueue` ( Link Here
2521
  `holdingbranch` varchar(10) default NULL,
2524
  `holdingbranch` varchar(10) default NULL,
2522
  `pickbranch` varchar(10) default NULL,
2525
  `pickbranch` varchar(10) default NULL,
2523
  `notes` text,
2526
  `notes` text,
2524
  `item_level_request` tinyint(4) NOT NULL default 0
2527
  `item_level_request` tinyint(4) NOT NULL default 0,
2528
  `print_status` BOOLEAN NOT NULL DEFAULT 0
2525
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2529
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2526
2530
2527
--
2531
--
(-)a/installer/data/mysql/updatedatabase.pl (+12 lines)
Lines 8074-8079 if ( CheckVersion($DBversion) ) { Link Here
8074
    SetVersion($DBversion);
8074
    SetVersion($DBversion);
8075
}
8075
}
8076
8076
8077
<<<<<<< HEAD
8077
$DBversion = "3.15.00.025";
8078
$DBversion = "3.15.00.025";
8078
if ( CheckVersion($DBversion) ) {
8079
if ( CheckVersion($DBversion) ) {
8079
    $dbh->do(q{
8080
    $dbh->do(q{
Lines 8780-8785 if ( CheckVersion($DBversion) ) { Link Here
8780
    SetVersion($DBversion);
8781
    SetVersion($DBversion);
8781
}
8782
}
8782
8783
8784
$DBversion = "3.17.00.XXX";
8785
if (CheckVersion($DBversion)) {
8786
    $dbh->do("ALTER TABLE reserves ADD print_status BOOLEAN NOT NULL DEFAULT '0'");
8787
    $dbh->do("ALTER TABLE old_reserves ADD print_status BOOLEAN NOT NULL DEFAULT '0'");
8788
    $dbh->do("ALTER TABLE tmp_holdsqueue ADD print_status BOOLEAN NOT NULL DEFAULT '0'");
8789
    $dbh->do("ALTER TABLE tmp_holdsqueue ADD reserve_id INT ( 11 ) FIRST");
8790
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('printSlipFromHoldsQueue', '0', 'NULL', 'If enabled reserve slips can be printed from Holds Queue screen,', 'YesNo');");
8791
    print "Upgrade to $DBversion done (Bug 11651: Add possibility to print holds from holds queue) \n";
8792
    SetVersion($DBversion);
8793
}
8794
8783
=head1 FUNCTIONS
8795
=head1 FUNCTIONS
8784
8796
8785
=head2 TableExists($table)
8797
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 112-117 Circulation: Link Here
112
                  slip: "open a print slip window"
112
                  slip: "open a print slip window"
113
            - .
113
            - .
114
        -
114
        -
115
            - pref: printSlipFromHoldsQueue
116
              choices:
117
                    yes: Enable
118
                    no: "Don't enable"
119
            - print reserve slip from holds queue.
120
        -
115
            - Include the stylesheet at
121
            - Include the stylesheet at
116
            - pref: NoticeCSS
122
            - pref: NoticeCSS
117
              class: url
123
              class: url
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt (-1 / +49 lines)
Lines 22-27 $(document).ready(function() { Link Here
22
        "bPaginate": false
22
        "bPaginate": false
23
    });
23
    });
24
});
24
});
25
26
function printReservations() {
27
    document.hold_print.submit();
28
}
29
function selectAll () {
30
    if(document.hold_print.reserve_id.length == undefined ){
31
        document.hold_print.reserve_id.checked=true;
32
    }else if(document.hold_print.reserve_id.length > 0) {
33
        for (var i=0; i < document.hold_print.reserve_id.length; i++) {
34
            document.hold_print.reserve_id[i].checked=true;
35
        }
36
    }
37
}
38
function clearAll () {
39
    if(document.hold_print.reserve_id.length == undefined ){
40
        document.hold_print.reserve_id.checked=false;
41
    }else if(document.hold_print.reserve_id.length > 0) {
42
        for (var i=0; i < document.hold_print.reserve_id.length; i++) {
43
            document.hold_print.reserve_id[i].checked=false;
44
        }
45
    }
46
}
25
//]]>
47
//]]>
26
</script>
48
</script>
27
49
Lines 47-56 $(document).ready(function() { Link Here
47
    [% ELSE %]
69
    [% ELSE %]
48
        <div class="dialog message">No items found.</div>
70
        <div class="dialog message">No items found.</div>
49
    [% END %]
71
    [% END %]
72
    [% IF ( printenable ) %]
73
        <p>
74
        <input id="printhold" type="submit" class="submit" onclick="printReservations()" value="Print checked holds"/>
75
        <a href="#" onclick="selectAll(); return false;">Select all</a> |
76
        <a href="#" onclick="clearAll(); return false;">Clear all</a>
77
        <br/>
78
        </p>
79
        <form id="showprinted" name="showprinted" method="get" action="/cgi-bin/koha/circ/view_holdsqueue.pl">
80
            <input type="hidden" name="run_report" value="1"/>
81
            <input type="hidden" name="branchlimit" value="[% branchlimit %]"/>
82
            [% IF ( showprinted ) %]
83
                <input type="hidden" name="showprinted" value="0"/>
84
                <input id="submit_printed" type="submit" class="submit" value="Hide printed holds"/>
85
            [% ELSE %]
86
                <input type="hidden" name="showprinted" value="1"/>
87
                <input id="submit_printed" type="submit" class="submit" value="Show printed holds"/>
88
            [% END %]
89
        </form>
90
    [% END %]
50
    [% IF ( itemsloop ) %]
91
    [% IF ( itemsloop ) %]
92
        <form id="hold_print" name="hold_print" method="get" action="/cgi-bin/koha/circ/hold-pull-print.pl" target="_blank">
51
<table id="holdst">
93
<table id="holdst">
52
	<thead>
94
	<thead>
53
	<tr>
95
	<tr>
96
       [% IF (printenable) %]<th class="hq-check">Check</th>[% END %]
54
        <th class="hq-title">Title</th>
97
        <th class="hq-title">Title</th>
55
        <th class="hq-collection">Collection</th>
98
        <th class="hq-collection">Collection</th>
56
        <th class="hq-itemtype">Item type</th>
99
        <th class="hq-itemtype">Item type</th>
Lines 66-71 $(document).ready(function() { Link Here
66
	</thead>
109
	</thead>
67
     <tbody>[% FOREACH itemsloo IN itemsloop %]
110
     <tbody>[% FOREACH itemsloo IN itemsloop %]
68
        <tr>
111
        <tr>
112
        [% IF ( printenable ) %]
113
			<td class="hq-print"><input type="checkbox" id="res[% itemsloo.reserve_id %]" name="reserve_id" value="[% itemsloo.reserve_id %]"/></td>
114
        [% END %]
69
            <td class="hq-title"><p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itemsloo.biblionumber %]"><strong>[% itemsloo.title |html %]</strong> [% IF ( itemsloo.subtitle ) %][% itemsloo.subtitle %][% END %]</a></p>
115
            <td class="hq-title"><p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itemsloo.biblionumber %]"><strong>[% itemsloo.title |html %]</strong> [% IF ( itemsloo.subtitle ) %][% itemsloo.subtitle %][% END %]</a></p>
70
                         <p><strong>[% itemsloo.author %]</strong>
116
                         <p><strong>[% itemsloo.author %]</strong>
71
                       <div class="hq-pubdata">  [% IF ( itemsloo.publishercode ) %][% itemsloo.publishercode %][% END %]
117
                       <div class="hq-pubdata">  [% IF ( itemsloo.publishercode ) %][% itemsloo.publishercode %][% END %]
Lines 94-99 $(document).ready(function() { Link Here
94
        </tr>
140
        </tr>
95
    [% END %]</tbody>
141
    [% END %]</tbody>
96
    </table>
142
    </table>
143
        [% IF ( printenable ) %]
144
        </form>
145
        [% END %]
97
	[% END %] 
146
	[% END %] 
98
	[% END %]
147
	[% END %]
99
148
100
- 

Return to bug 11651