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

(-)a/C4/Reserves.pm (-6 / +43 lines)
Lines 38-43 use C4::Branch qw( GetBranchDetail ); Link Here
38
use C4::Dates qw( format_date_in_iso );
38
use C4::Dates qw( format_date_in_iso );
39
39
40
use Koha::DateUtils;
40
use Koha::DateUtils;
41
use Koha::Calendar;
42
43
use DateTime;
41
44
42
use List::MoreUtils qw( firstidx );
45
use List::MoreUtils qw( firstidx );
43
46
Lines 132-137 BEGIN { Link Here
132
        &ToggleSuspend
135
        &ToggleSuspend
133
        &SuspendAll
136
        &SuspendAll
134
137
138
        &_reserve_last_pickup_date
139
135
        &GetReservesControlBranch
140
        &GetReservesControlBranch
136
    );
141
    );
137
    @EXPORT_OK = qw( MergeHolds );
142
    @EXPORT_OK = qw( MergeHolds );
Lines 719-725 sub GetReservesForBranch { Link Here
719
    my $dbh = C4::Context->dbh;
724
    my $dbh = C4::Context->dbh;
720
725
721
    my $query = "
726
    my $query = "
722
        SELECT reserve_id,borrowernumber,reservedate,itemnumber,waitingdate
727
        SELECT reserve_id,borrowernumber,reservedate,itemnumber,waitingdate,branchcode
723
        FROM   reserves 
728
        FROM   reserves 
724
        WHERE   priority='0'
729
        WHERE   priority='0'
725
        AND found='W'
730
        AND found='W'
Lines 935-946 sub CancelExpiredReserves { Link Here
935
        $sth = $dbh->prepare( $query );
940
        $sth = $dbh->prepare( $query );
936
        $sth->execute( $max_pickup_delay );
941
        $sth->execute( $max_pickup_delay );
937
942
943
        my $today = DateTime->now( time_zone => C4::Context->tz() );
944
938
        while (my $res = $sth->fetchrow_hashref ) {
945
        while (my $res = $sth->fetchrow_hashref ) {
939
            if ( $charge ) {
946
            my $expiration = _reserve_last_pickup_date( $res );
940
                manualinvoice($res->{'borrowernumber'}, $res->{'itemnumber'}, 'Hold waiting too long', 'F', $charge);
947
            if ( $today > $expiration ) {
948
                if ( $charge ) {
949
                    manualinvoice($res->{'borrowernumber'}, $res->{'itemnumber'}, 'Hold waiting too long', 'F', $charge);
950
                }
951
                CancelReserve({ reserve_id => $res->{'reserve_id'} });
941
            }
952
            }
942
943
            CancelReserve({ reserve_id => $res->{'reserve_id'} });
944
        }
953
        }
945
    }
954
    }
946
955
Lines 1815-1820 sub _Findgroupreserve { Link Here
1815
    return @results;
1824
    return @results;
1816
}
1825
}
1817
1826
1827
=head2 _reserve_last_pickup_date
1828
1829
 my $last_dt = _reserve_last_pickup_date($reserve);
1830
1831
Returns the DateTime for the last pickup date for reserve.
1832
1833
=cut
1834
1835
sub _reserve_last_pickup_date {
1836
    my ($reserve) = @_;
1837
1838
    my $startdate = $reserve->{waitingdate} ? dt_from_string($reserve->{waitingdate}) : DateTime->now( time_zone => C4::Context->tz() );
1839
    my $calendar = Koha::Calendar->new( branchcode => $reserve->{branchcode} );
1840
    my $expiration = $calendar->days_forward( $startdate, C4::Context->preference('ReservesMaxPickUpDelay') );
1841
1842
    return $expiration;
1843
}
1844
1818
=head2 _koha_notify_reserve
1845
=head2 _koha_notify_reserve
1819
1846
1820
  _koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber, $reserve_id );
1847
  _koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber, $reserve_id );
Lines 1851-1856 sub _koha_notify_reserve { Link Here
1851
1878
1852
    my $admin_email_address = $branch_details->{'branchemail'} || C4::Context->preference('KohaAdminEmailAddress');
1879
    my $admin_email_address = $branch_details->{'branchemail'} || C4::Context->preference('KohaAdminEmailAddress');
1853
1880
1881
    my $expiration = _reserve_last_pickup_date($reserve);
1882
1854
    my %letter_params = (
1883
    my %letter_params = (
1855
        module => 'reserves',
1884
        module => 'reserves',
1856
        branchcode => $reserve->{branchcode},
1885
        branchcode => $reserve->{branchcode},
Lines 1861-1867 sub _koha_notify_reserve { Link Here
1861
            'reserves'  => $reserve,
1890
            'reserves'  => $reserve,
1862
            'items', $reserve->{'itemnumber'},
1891
            'items', $reserve->{'itemnumber'},
1863
        },
1892
        },
1864
        substitute => { today => C4::Dates->new()->output() },
1893
        substitute => {
1894
	    'lastpickupdate' => C4::Dates->new($expiration->ymd(), 'iso')->output()
1895
	},
1896
1865
    );
1897
    );
1866
1898
1867
    my $notification_sent = 0; #Keeping track if a Hold_filled message is sent. If no message can be sent, then default to a print message.
1899
    my $notification_sent = 0; #Keeping track if a Hold_filled message is sent. If no message can be sent, then default to a print message.
Lines 2195-2200 sub ReserveSlip { Link Here
2195
    }) or return;
2227
    }) or return;
2196
    my $reserve = GetReserveInfo($reserve_id) or return;
2228
    my $reserve = GetReserveInfo($reserve_id) or return;
2197
2229
2230
    my $expiration = _reserve_last_pickup_date($reserve);
2231
2198
    return  C4::Letters::GetPreparedLetter (
2232
    return  C4::Letters::GetPreparedLetter (
2199
        module => 'circulation',
2233
        module => 'circulation',
2200
        letter_code => $transfer ? 'TRANSFERSLIP' : 'RESERVESLIP',
2234
        letter_code => $transfer ? 'TRANSFERSLIP' : 'RESERVESLIP',
Lines 2206-2211 sub ReserveSlip { Link Here
2206
            'biblio'      => $reserve->{biblionumber},
2240
            'biblio'      => $reserve->{biblionumber},
2207
            'items'       => $reserve->{itemnumber},
2241
            'items'       => $reserve->{itemnumber},
2208
        },
2242
        },
2243
        substitute => {
2244
	    'lastpickupdate' => C4::Dates->new($expiration->ymd(), 'iso')->output()
2245
	},
2209
    );
2246
    );
2210
}
2247
}
2211
2248
(-)a/Koha/Calendar.pm (+12 lines)
Lines 267-272 sub prev_open_day { Link Here
267
    return $base_date;
267
    return $base_date;
268
}
268
}
269
269
270
sub days_forward {
271
    my $self     = shift;
272
    my $start_dt = shift;
273
    my $num_days = shift;
274
275
    my $base_dt = $start_dt->clone();
276
277
    while ($num_days--) { $base_dt = $self->next_open_day($base_dt); }
278
279
    return $base_dt;
280
}
281
270
sub days_between {
282
sub days_between {
271
    my $self     = shift;
283
    my $self     = shift;
272
    my $start_dt = shift;
284
    my $start_dt = shift;
(-)a/Koha/Reserves.pm (+55 lines)
Line 0 Link Here
1
package Koha::Reserves;
2
3
# Copyright (c) 2014 Vaarakirjastot.fi and everybody else!
4
# This file is part of Koha.
5
#
6
# Koha is free software; you can redistribute it and/or modify it under the
7
# terms of the GNU General Public License as published by the Free Software
8
# Foundation; either version 2 of the License, or (at your option) any later
9
# version.
10
#
11
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
12
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License along with
16
# Koha; if not, write to the Free Software Foundation, Inc.,
17
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
19
use Modern::Perl;
20
binmode STDOUT, ":encoding(UTF-8)";
21
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
22
23
BEGIN {
24
    # set the version for version checking
25
    $VERSION = 3.16.3;
26
    require Exporter;
27
    @ISA = qw(Exporter);
28
    @EXPORT = qw(
29
30
        &GetLastpickupdate
31
32
    );
33
}    
34
35
use C4::Context;
36
use Koha::DateUtils;
37
38
=head2 GetLastpickupdate
39
40
 my $last_dt = GetLastpickupdate($reserve);
41
42
@PARAM1 Koha::Schema::Result::Reserve-object received via DBIx searching
43
@RETURNS the DateTime for the last pickup date for the given reserve.
44
=cut
45
46
sub GetLastpickupdate {
47
    my ($reserve) = @_;
48
49
    my $waitingdate = $reserve->waitingdate();
50
    my $startdate = $waitingdate ? Koha::DateUtils::dt_from_string($waitingdate) : DateTime->now( time_zone => C4::Context->tz() );
51
    my $calendar = Koha::Calendar->new( branchcode => $reserve->branchcode() );
52
    my $expiration = $calendar->days_forward( $startdate, C4::Context->preference('ReservesMaxPickUpDelay') );
53
54
    return $expiration;
55
}
(-)a/circ/waitingreserves.pl (-12 / +7 lines)
Lines 31-41 use C4::Members; Link Here
31
use C4::Biblio;
31
use C4::Biblio;
32
use C4::Items;
32
use C4::Items;
33
33
34
use Date::Calc qw(
34
use DateTime;
35
  Today
35
36
  Add_Delta_Days
37
  Date_to_Days
38
);
39
use C4::Reserves;
36
use C4::Reserves;
40
use C4::Koha;
37
use C4::Koha;
41
38
Lines 86-92 my ($reservcount, $overcount); Link Here
86
my @getreserves = $all_branches ? GetReservesForBranch() : GetReservesForBranch($default);
83
my @getreserves = $all_branches ? GetReservesForBranch() : GetReservesForBranch($default);
87
# get reserves for the branch we are logged into, or for all branches
84
# get reserves for the branch we are logged into, or for all branches
88
85
89
my $today = Date_to_Days(&Today);
86
my $today = DateTime->now();
90
foreach my $num (@getreserves) {
87
foreach my $num (@getreserves) {
91
    next unless ($num->{'waitingdate'} && $num->{'waitingdate'} ne '0000-00-00');
88
    next unless ($num->{'waitingdate'} && $num->{'waitingdate'} ne '0000-00-00');
92
89
Lines 106-118 foreach my $num (@getreserves) { Link Here
106
    my $getborrower = GetMember(borrowernumber => $num->{'borrowernumber'});
103
    my $getborrower = GetMember(borrowernumber => $num->{'borrowernumber'});
107
    my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} );  # using the fixed up itype/itemtype
104
    my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} );  # using the fixed up itype/itemtype
108
    $getreserv{'waitingdate'} = $num->{'waitingdate'};
105
    $getreserv{'waitingdate'} = $num->{'waitingdate'};
109
    my ( $waiting_year, $waiting_month, $waiting_day ) = split (/-/, $num->{'waitingdate'});
106
110
    ( $waiting_year, $waiting_month, $waiting_day ) =
107
    my $lastpickupdate = C4::Reserves::_reserve_last_pickup_date( $num );
111
      Add_Delta_Days( $waiting_year, $waiting_month, $waiting_day,
112
        C4::Context->preference('ReservesMaxPickUpDelay'));
113
    my $calcDate = Date_to_Days( $waiting_year, $waiting_month, $waiting_day );
114
108
115
    $getreserv{'itemtype'}       = $itemtypeinfo->{'description'};
109
    $getreserv{'itemtype'}       = $itemtypeinfo->{'description'};
110
    $getreserv{'lastpickupdate'} = C4::Dates->new($lastpickupdate->ymd(), 'iso')->output();
116
    $getreserv{'title'}          = $gettitle->{'title'};
111
    $getreserv{'title'}          = $gettitle->{'title'};
117
    $getreserv{'biblionumber'}   = $gettitle->{'biblionumber'};
112
    $getreserv{'biblionumber'}   = $gettitle->{'biblionumber'};
118
    $getreserv{'barcode'}        = $gettitle->{'barcode'};
113
    $getreserv{'barcode'}        = $gettitle->{'barcode'};
Lines 132-138 foreach my $num (@getreserves) { Link Here
132
        $getreserv{'borrowermail'}  = $getborrower->{'emailaddress'};
127
        $getreserv{'borrowermail'}  = $getborrower->{'emailaddress'};
133
    }
128
    }
134
 
129
 
135
    if ($today > $calcDate) {
130
    if (   DateTime->compare( $today,$lastpickupdate ) == 1   ) { #If today is bigger than lastpickupdate, pickup time has expired
136
        if ($cancelall) {
131
        if ($cancelall) {
137
            my $res = cancel( $itemnumber, $borrowernum, $holdingbranch, $homebranch, !$transfer_when_cancel_all );
132
            my $res = cancel( $itemnumber, $borrowernum, $holdingbranch, $homebranch, !$transfer_when_cancel_all );
138
            push @cancel_result, $res if $res;
133
            push @cancel_result, $res if $res;
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/holds.js (+1 lines)
Lines 10-15 $(document).ready(function() { Link Here
10
                    {
10
                    {
11
                        "mDataProp": "reservedate_formatted"
11
                        "mDataProp": "reservedate_formatted"
12
                    },
12
                    },
13
                    { "mDataProp": "lastpickupdate_formatted" },
13
                    {
14
                    {
14
                        "mDataProp": function ( oObj ) {
15
                        "mDataProp": function ( oObj ) {
15
                            title = "<a href='/cgi-bin/koha/reserve/request.pl?biblionumber="
16
                            title = "<a href='/cgi-bin/koha/reserve/request.pl?biblionumber="
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +1 lines)
Lines 404-410 Circulation: Link Here
404
            - Mark a hold as problematic if it has been waiting for more than
404
            - Mark a hold as problematic if it has been waiting for more than
405
            - pref: ReservesMaxPickUpDelay
405
            - pref: ReservesMaxPickUpDelay
406
              class: integer
406
              class: integer
407
            - days.
407
            - non-holiday days.
408
        -
408
        -
409
            - pref: ExpireReservesMaxPickUpDelay
409
            - pref: ExpireReservesMaxPickUpDelay
410
              choices:
410
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+2 lines)
Lines 622-627 No patron matched <span class="ex">[% message %]</span> Link Here
622
			        [% FOREACH WaitingReserveLoo IN WaitingReserveLoop %]
622
			        [% FOREACH WaitingReserveLoo IN WaitingReserveLoop %]
623
			            <ul>
623
			            <ul>
624
			                <li> <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% WaitingReserveLoo.biblionumber %]">[% WaitingReserveLoo.title |html %]</a> ([% WaitingReserveLoo.itemtype %]), [% IF ( WaitingReserveLoo.author ) %]by [% WaitingReserveLoo.author %][% END %] [% IF ( WaitingReserveLoo.itemcallnumber ) %][[% WaitingReserveLoo.itemcallnumber %]] [% END %]Hold placed on [% WaitingReserveLoo.reservedate %].
624
			                <li> <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% WaitingReserveLoo.biblionumber %]">[% WaitingReserveLoo.title |html %]</a> ([% WaitingReserveLoo.itemtype %]), [% IF ( WaitingReserveLoo.author ) %]by [% WaitingReserveLoo.author %][% END %] [% IF ( WaitingReserveLoo.itemcallnumber ) %][[% WaitingReserveLoo.itemcallnumber %]] [% END %]Hold placed on [% WaitingReserveLoo.reservedate %].
625
[% IF ( WaitingReserveLoo.lastpickupdate ) %]Last pickup date: [% WaitingReserveLoo.lastpickupdate %][% END %]
625
			            [% IF ( WaitingReserveLoo.waitingat ) %]
626
			            [% IF ( WaitingReserveLoo.waitingat ) %]
626
			                <br />[% IF ( WaitingReserveLoo.waitinghere ) %]<strong class="waitinghere">[% ELSE %]<strong>[% END %]Waiting at [% WaitingReserveLoo.waitingat %]</strong>
627
			                <br />[% IF ( WaitingReserveLoo.waitinghere ) %]<strong class="waitinghere">[% ELSE %]<strong>[% END %]Waiting at [% WaitingReserveLoo.waitingat %]</strong>
627
			            [% END %]
628
			            [% END %]
Lines 771-776 No patron matched <span class="ex">[% message %]</span> Link Here
771
            <thead>
772
            <thead>
772
                <tr>
773
                <tr>
773
                    <th>Hold date</th>
774
                    <th>Hold date</th>
775
                    <th>Last pickup date</th>
774
                    <th>Title</th>
776
                    <th>Title</th>
775
                    <th>Call number</th>
777
                    <th>Call number</th>
776
                    <th>Barcode</th>
778
                    <th>Barcode</th>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt (+4 lines)
Lines 78-83 Link Here
78
               <table id="holdst">
78
               <table id="holdst">
79
               <thead><tr>
79
               <thead><tr>
80
                    <th class="title-string">Available since</th>
80
                    <th class="title-string">Available since</th>
81
                    <th>Last pickup date</th>
81
                    <th class="anti-the">Title</th>
82
                    <th class="anti-the">Title</th>
82
                    <th>Patron</th>
83
                    <th>Patron</th>
83
                    <th>Location</th>
84
                    <th>Location</th>
Lines 88-93 Link Here
88
               <tbody>[% FOREACH reserveloo IN reserveloop %]
89
               <tbody>[% FOREACH reserveloo IN reserveloop %]
89
                <tr>
90
                <tr>
90
                    <td><span title="[% reserveloo.waitingdate %]">[% reserveloo.waitingdate | $KohaDates %]</span></td>
91
                    <td><span title="[% reserveloo.waitingdate %]">[% reserveloo.waitingdate | $KohaDates %]</span></td>
92
                    <td>[% reserveloo.lastpickupdate | $KohaDates %]</td>
91
                    <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %]
93
                    <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %]
92
                        [% reserveloo.title |html %] [% reserveloo.subtitle |html %]
94
                        [% reserveloo.title |html %] [% reserveloo.subtitle |html %]
93
                        </a>
95
                        </a>
Lines 138-143 Link Here
138
               <table id="holdso">
140
               <table id="holdso">
139
               <thead><tr>
141
               <thead><tr>
140
                    <th class="title-string">Available since</th>
142
                    <th class="title-string">Available since</th>
143
                    <th>Last pickup date</th>
141
                    <th class="anti-the">Title</th>
144
                    <th class="anti-the">Title</th>
142
                    <th>Patron</th>
145
                    <th>Patron</th>
143
                    <th>Location</th>
146
                    <th>Location</th>
Lines 148-153 Link Here
148
               <tbody>[% FOREACH overloo IN overloop %]
151
               <tbody>[% FOREACH overloo IN overloop %]
149
                    <tr>
152
                    <tr>
150
                        <td><p><span title="[% overloo.waitingdate %]">[% overloo.waitingdate | $KohaDates %]</span></p></td>
153
                        <td><p><span title="[% overloo.waitingdate %]">[% overloo.waitingdate | $KohaDates %]</span></p></td>
154
                        <td>[% overloo.lastpickupdate | $KohaDates %]</td>
151
                        <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = overloo.biblionumber %][% overloo.title |html %] [% overloo.subtitle |html %]
155
                        <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = overloo.biblionumber %][% overloo.title |html %] [% overloo.subtitle |html %]
152
                        </a>
156
                        </a>
153
                            [% UNLESS ( item_level_itypes ) %][% IF ( overloo.itemtype ) %]&nbsp; (<b>[% overloo.itemtype %]</b>)[% END %][% END %]
157
                            [% UNLESS ( item_level_itypes ) %][% IF ( overloo.itemtype ) %]&nbsp; (<b>[% overloo.itemtype %]</b>)[% END %][% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+1 lines)
Lines 506-511 function validate1(date) { Link Here
506
            <thead>
506
            <thead>
507
                <tr>
507
                <tr>
508
                    <th>Hold date</th>
508
                    <th>Hold date</th>
509
                    <th>Last pickup date</th>
509
                    <th>Title</th>
510
                    <th>Title</th>
510
                    <th>Call number</th>
511
                    <th>Call number</th>
511
                    <th>Barcode</th>
512
                    <th>Barcode</th>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (+7 lines)
Lines 493-498 Link Here
493
                                        <tr>
493
                                        <tr>
494
                                            <th class="anti-the">Title</th>
494
                                            <th class="anti-the">Title</th>
495
                                            <th class="psort">Placed on</th>
495
                                            <th class="psort">Placed on</th>
496
                                            <th class="psort">Last pickup date</th>
496
                                            <th>Expires on</th>
497
                                            <th>Expires on</th>
497
                                            <th>Pick up location</th>
498
                                            <th>Pick up location</th>
498
                                            [% IF ( showpriority ) %]
499
                                            [% IF ( showpriority ) %]
Lines 530-535 Link Here
530
                                                    [% RESERVE.reservedate | $KohaDates %]
531
                                                    [% RESERVE.reservedate | $KohaDates %]
531
                                                </span>
532
                                                </span>
532
                                            </td>
533
                                            </td>
534
                                            <td class="lastpickupdate">
535
                                                <span title="[% RESERVE.lastpickupdate %]">
536
                                                    <span class="tdlabel">Last pickup date:</span>
537
                                                    [% RESERVE.lastpickupdate | $KohaDates %]
538
                                                </span>
539
                                            </td>
533
                                            <td class="expirationdate">
540
                                            <td class="expirationdate">
534
                                                [% IF ( RESERVE.expirationdate ) %]
541
                                                [% IF ( RESERVE.expirationdate ) %]
535
                                                    <span>
542
                                                    <span>
(-)a/opac/opac-user.pl (+4 lines)
Lines 321-326 foreach my $res (@reserves) { Link Here
321
            }
321
            }
322
            # set found to 1 if reserve is waiting for patron pickup
322
            # set found to 1 if reserve is waiting for patron pickup
323
            $res->{'found'} = 1 if $res->{'found'} eq 'W';
323
            $res->{'found'} = 1 if $res->{'found'} eq 'W';
324
325
            my $lastpickupdate = C4::Reserves::_reserve_last_pickup_date( $res );
326
            $res->{'lastpickupdate'} = $lastpickupdate if $lastpickupdate;
327
324
        } else {
328
        } else {
325
            my ($transfertwhen, $transfertfrom, $transfertto) = GetTransfers( $res->{'itemnumber'} );
329
            my ($transfertwhen, $transfertfrom, $transfertto) = GetTransfers( $res->{'itemnumber'} );
326
            if ($transfertwhen) {
330
            if ($transfertwhen) {
(-)a/svc/holds (-3 / +6 lines)
Lines 31-36 use C4::Context; Link Here
31
31
32
use Koha::Database;
32
use Koha::Database;
33
use Koha::DateUtils;
33
use Koha::DateUtils;
34
use Koha::Reserves;
34
35
35
my $input = new CGI;
36
my $input = new CGI;
36
37
Lines 53-60 my $borrowernumber = $input->param('borrowernumber'); Link Here
53
my $offset            = $input->param('iDisplayStart');
54
my $offset            = $input->param('iDisplayStart');
54
my $results_per_page  = $input->param('iDisplayLength');
55
my $results_per_page  = $input->param('iDisplayLength');
55
my $sorting_direction = $input->param('sSortDir_0') || 'desc';
56
my $sorting_direction = $input->param('sSortDir_0') || 'desc';
56
my $sorting_column    = $sort_columns[ $input->param('iSortCol_0') ]
57
my $sorting_column    = ( $input->param('iSortCol_0') )   ?
57
  || 'reservedate';
58
        $sort_columns[ $input->param('iSortCol_0') ]   :   'reservedate';
58
59
59
binmode STDOUT, ":encoding(UTF-8)";
60
binmode STDOUT, ":encoding(UTF-8)";
60
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
61
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
Lines 73-78 while ( my $h = $holds_rs->next() ) { Link Here
73
    my $item = $h->item();
74
    my $item = $h->item();
74
75
75
    my $biblionumber = $h->biblio()->biblionumber();
76
    my $biblionumber = $h->biblio()->biblionumber();
77
    my $lastpickupdate = Koha::Reserves::GetLastpickupdate( $h );
76
78
77
    my $hold = {
79
    my $hold = {
78
        DT_RowId       => $h->reserve_id(),
80
        DT_RowId       => $h->reserve_id(),
Lines 93-98 while ( my $h = $holds_rs->next() ) { Link Here
93
            'subtitle', GetMarcBiblio($biblionumber),
95
            'subtitle', GetMarcBiblio($biblionumber),
94
            GetFrameworkCode($biblionumber)
96
            GetFrameworkCode($biblionumber)
95
        ),
97
        ),
98
        lastpickupdate => $lastpickupdate->ymd(),
99
        lastpickupdate_formatted => C4::Dates->new($lastpickupdate->ymd(), 'iso')->output(),
96
        reservedate_formatted => $h->reservedate() ? output_pref(
100
        reservedate_formatted => $h->reservedate() ? output_pref(
97
            { dt => dt_from_string( $h->reservedate() ), dateonly => 1 }
101
            { dt => dt_from_string( $h->reservedate() ), dateonly => 1 }
98
          )
102
          )
99
- 

Return to bug 12353