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

(-)a/C4/Reserves.pm (-1 / +78 lines)
Lines 23-28 package C4::Reserves; Link Here
23
23
24
use strict;
24
use strict;
25
#use warnings; FIXME - Bug 2505
25
#use warnings; FIXME - Bug 2505
26
use Date::Calc qw( Add_Delta_Days );
26
use C4::Context;
27
use C4::Context;
27
use C4::Biblio;
28
use C4::Biblio;
28
use C4::Members;
29
use C4::Members;
Lines 116-122 BEGIN { Link Here
116
        
117
        
117
        &CheckReserves
118
        &CheckReserves
118
        &CanBookBeReserved
119
        &CanBookBeReserved
119
	&CanItemBeReserved
120
        &CanItemBeReserved
120
        &CancelReserve
121
        &CancelReserve
121
        &CancelExpiredReserves
122
        &CancelExpiredReserves
122
123
Lines 130-135 BEGIN { Link Here
130
        &ReserveSlip
131
        &ReserveSlip
131
        &ToggleSuspend
132
        &ToggleSuspend
132
        &SuspendAll
133
        &SuspendAll
134
        &GetMaxPickupDelay
135
        &GetMaxPickupDate
136
        &GetReservesControlBranch
133
    );
137
    );
134
    @EXPORT_OK = qw( MergeHolds );
138
    @EXPORT_OK = qw( MergeHolds );
135
}    
139
}    
Lines 497-502 sub CanItemBeReserved{ Link Here
497
        return 0;
501
        return 0;
498
    }
502
    }
499
}
503
}
504
505
=item GetMaxPickupDelay
506
507
$resallowed = &GetMaxPickupDelay($borrowernumber, $item)
508
509
this function return the max delay for an hold
510
511
=cut
512
513
sub GetMaxPickupDelay {
514
    my ( $borrowernumber, $item ) = @_;
515
516
    my $dbh             = C4::Context->dbh;
517
    my $allowedreserves = 0;
518
519
    my $borrower        = C4::Members::GetMember( 'borrowernumber' => $borrowernumber );
520
521
    my $controlbranch   = GetReservesControlBranch( $borrower, $item );
522
523
    my $issuingrule     = C4::Circulation::GetIssuingRule( $borrower->{categorycode}, $item->{itype}, $controlbranch );
524
525
    return $issuingrule->{holdspickupdelay}
526
        if defined($issuingrule)
527
            and $issuingrule->{holdspickupdelay} ne 'NULL';
528
529
    # if nothing found, return no rights
530
    return 0;
531
}
532
533
=item GetMaxPickupDate
534
535
$maxpickupdate = &GetMaxPickupDate($item, $borrowernumber);
536
$item->{waitingdate} is a string or a DateTime.
537
538
this function returns the max pickup date (DateTime format).
539
(e.g. : the date after which the hold will be considered cancelled)
540
541
=cut
542
543
sub GetMaxPickupDate {
544
    my ( $item, $borrowernumber ) = @_;
545
    return unless $item->{waitingdate};
546
547
    my $date = ref $item->{waitingdate} eq 'DateTime'
548
        ? $item->{waitingdate}
549
        : dt_from_string $item->{waitingdate};
550
551
    my $delay  = GetMaxPickupDelay( $borrowernumber, $item );
552
    $date->add( days => $delay );
553
    return $date;
554
}
555
556
=item GetReservesControlBranch
557
558
$branchcode = &GetReservesControlBranch($borrower, $item)
559
560
Returns the branchcode to consider to check hold rules against
561
562
=cut
563
564
sub GetReservesControlBranch {
565
    my ( $borrower, $item ) = @_;
566
    my $controlbranch = C4::Context->preference('ReservesControlBranch');
567
    my $hbr           = C4::Context->preference('HomeOrHoldingBranch') || "homebranch";
568
    my $branchcode    = "*";
569
    if ( $controlbranch eq "ItemHomeLibrary" ) {
570
        $branchcode = $item->{$hbr};
571
    } elsif ( $controlbranch eq "PatronLibrary" ) {
572
        $branchcode = $borrower->{branchcode};
573
    }
574
    return $branchcode;
575
}
576
500
#--------------------------------------------------------------------------------
577
#--------------------------------------------------------------------------------
501
=head2 GetReserveCount
578
=head2 GetReserveCount
502
579
(-)a/admin/smart-rules.pl (-4 / +5 lines)
Lines 101-108 elsif ($op eq 'delete-branch-item') { Link Here
101
# save the values entered
101
# save the values entered
102
elsif ($op eq 'add') {
102
elsif ($op eq 'add') {
103
    my $sth_search = $dbh->prepare('SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?');
103
    my $sth_search = $dbh->prepare('SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?');
104
    my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, issuelength, lengthunit, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount, overduefinescap) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)');
104
    my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, holdspickupdelay, issuelength, lengthunit, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount, overduefinescap) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)');
105
    my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, issuelength=?, lengthunit = ?, hardduedate=?, hardduedatecompare=?, rentaldiscount=?, overduefinescap=?  WHERE branchcode=? AND categorycode=? AND itemtype=?");
105
    my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, holdspickupdelay=?, issuelength=?, lengthunit = ?, hardduedate=?, hardduedatecompare=?, rentaldiscount=?, overduefinescap=?  WHERE branchcode=? AND categorycode=? AND itemtype=?");
106
    
106
    
107
    my $br = $branch; # branch
107
    my $br = $branch; # branch
108
    my $bor  = $input->param('categorycode'); # borrower category
108
    my $bor  = $input->param('categorycode'); # borrower category
Lines 114-119 elsif ($op eq 'add') { Link Here
114
    my $maxissueqty  = $input->param('maxissueqty');
114
    my $maxissueqty  = $input->param('maxissueqty');
115
    my $renewalsallowed  = $input->param('renewalsallowed');
115
    my $renewalsallowed  = $input->param('renewalsallowed');
116
    my $reservesallowed  = $input->param('reservesallowed');
116
    my $reservesallowed  = $input->param('reservesallowed');
117
    my $holdspickupdelay = $input->param('holdspickupdelay');
117
    $maxissueqty =~ s/\s//g;
118
    $maxissueqty =~ s/\s//g;
118
    $maxissueqty = undef if $maxissueqty !~ /^\d+/;
119
    $maxissueqty = undef if $maxissueqty !~ /^\d+/;
119
    my $issuelength  = $input->param('issuelength');
120
    my $issuelength  = $input->param('issuelength');
Lines 128-136 elsif ($op eq 'add') { Link Here
128
    $sth_search->execute($br,$bor,$cat);
129
    $sth_search->execute($br,$bor,$cat);
129
    my $res = $sth_search->fetchrow_hashref();
130
    my $res = $sth_search->fetchrow_hashref();
130
    if ($res->{total}) {
131
    if ($res->{total}) {
131
        $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount,$overduefinescap, $br,$bor,$cat);
132
        $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $holdspickupdelay, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount,$overduefinescap, $br,$bor,$cat);
132
    } else {
133
    } else {
133
        $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount,$overduefinescap);
134
        $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed, $holdspickupdelay, $issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount,$overduefinescap);
134
    }
135
    }
135
} 
136
} 
136
elsif ($op eq "set-branch-defaults") {
137
elsif ($op eq "set-branch-defaults") {
(-)a/circ/circulation.pl (+4 lines)
Lines 364-369 if ($borrowernumber) { Link Here
364
        if ( $num_res->{'found'} eq 'W' ) {
364
        if ( $num_res->{'found'} eq 'W' ) {
365
            $getreserv{color}   = 'reserved';
365
            $getreserv{color}   = 'reserved';
366
            $getreserv{waiting} = 1;
366
            $getreserv{waiting} = 1;
367
            my $maxpickupdate = GetMaxPickupDate( $num_res, $borrowernumber );
368
            $getWaitingReserveInfo{maxpickupdate} = $maxpickupdate;
369
            $getreserv{maxpickupdate} = $maxpickupdate;
370
367
#     genarate information displaying only waiting reserves
371
#     genarate information displaying only waiting reserves
368
        $getWaitingReserveInfo{title}        = $getiteminfo->{'title'};
372
        $getWaitingReserveInfo{title}        = $getiteminfo->{'title'};
369
        $getWaitingReserveInfo{biblionumber} = $getiteminfo->{'biblionumber'};
373
        $getWaitingReserveInfo{biblionumber} = $getiteminfo->{'biblionumber'};
(-)a/circ/waitingreserves.pl (-22 / +17 lines)
Lines 21-43 Link Here
21
use strict;
21
use strict;
22
use warnings;
22
use warnings;
23
use CGI;
23
use CGI;
24
use DateTime;
24
use C4::Context;
25
use C4::Context;
25
use C4::Output;
26
use C4::Output;
26
use C4::Branch; # GetBranchName
27
use C4::Branch; # GetBranchName
27
use C4::Auth;
28
use C4::Auth;
28
use C4::Dates qw/format_date/;
29
use C4::Dates qw/format_date/;
29
use C4::Circulation;
30
use C4::Circulation;
31
use C4::Reserves;
30
use C4::Members;
32
use C4::Members;
31
use C4::Biblio;
33
use C4::Biblio;
32
use C4::Items;
34
use C4::Items;
33
34
use Date::Calc qw(
35
  Today
36
  Add_Delta_Days
37
  Date_to_Days
38
);
39
use C4::Reserves;
35
use C4::Reserves;
40
use C4::Koha;
36
use C4::Koha;
37
use Koha::DateUtils;
41
38
42
my $input = new CGI;
39
my $input = new CGI;
43
40
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 = dt_from_string;
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 111-122 foreach my $num (@getreserves) { Link Here
111
    $gettitle->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $gettitle->{'itype'} : $gettitle->{'itemtype'};
108
    $gettitle->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $gettitle->{'itype'} : $gettitle->{'itemtype'};
112
    my $getborrower = GetMember(borrowernumber => $num->{'borrowernumber'});
109
    my $getborrower = GetMember(borrowernumber => $num->{'borrowernumber'});
113
    my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} );  # using the fixed up itype/itemtype
110
    my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} );  # using the fixed up itype/itemtype
114
    $getreserv{'waitingdate'} = format_date( $num->{'waitingdate'} );
111
115
    my ( $waiting_year, $waiting_month, $waiting_day ) = split (/-/, $num->{'waitingdate'});
112
    if ( $num->{waitingdate} ) {
116
    ( $waiting_year, $waiting_month, $waiting_day ) =
113
        my $maxpickupdate = GetMaxPickupDate( $num, $borrowernumber );
117
      Add_Delta_Days( $waiting_year, $waiting_month, $waiting_day,
114
        $getreserv{waitingdate} = $num->{waitingdate};
118
        C4::Context->preference('ReservesMaxPickUpDelay'));
115
        $getreserv{maxpickupdate} = $maxpickupdate;
119
    my $calcDate = Date_to_Days( $waiting_year, $waiting_month, $waiting_day );
116
        if ( DateTime->compare( $today, $maxpickupdate ) == 1 ) {
117
            push @overloop,   \%getreserv;
118
            $overcount++;
119
        }else{
120
            push @reservloop, \%getreserv;
121
            $reservcount++;
122
        }
123
    }
120
124
121
    $getreserv{'itemtype'}       = $itemtypeinfo->{'description'};
125
    $getreserv{'itemtype'}       = $itemtypeinfo->{'description'};
122
    $getreserv{'title'}          = $gettitle->{'title'};
126
    $getreserv{'title'}          = $gettitle->{'title'};
Lines 137-151 foreach my $num (@getreserves) { Link Here
137
    if ( $getborrower->{'emailaddress'} ) {
141
    if ( $getborrower->{'emailaddress'} ) {
138
        $getreserv{'borrowermail'}  = $getborrower->{'emailaddress'};
142
        $getreserv{'borrowermail'}  = $getborrower->{'emailaddress'};
139
    }
143
    }
140
 
141
    if ($today > $calcDate) {
142
        push @overloop,   \%getreserv;
143
        $overcount++;
144
    }else{
145
        push @reservloop, \%getreserv;
146
        $reservcount++;
147
    }
148
    
149
}
144
}
150
145
151
$template->param(cancel_result => \@cancel_result) if @cancel_result;
146
$template->param(cancel_result => \@cancel_result) if @cancel_result;
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 999-1004 CREATE TABLE `issuingrules` ( -- circulation and fine rules Link Here
999
  `hardduedatecompare` tinyint NOT NULL default "0", -- type of hard due date (1 = after, 0 = on, -1 = before)
999
  `hardduedatecompare` tinyint NOT NULL default "0", -- type of hard due date (1 = after, 0 = on, -1 = before)
1000
  `renewalsallowed` smallint(6) NOT NULL default "0", -- how many renewals are allowed
1000
  `renewalsallowed` smallint(6) NOT NULL default "0", -- how many renewals are allowed
1001
  `reservesallowed` smallint(6) NOT NULL default "0", -- how many holds are allowed
1001
  `reservesallowed` smallint(6) NOT NULL default "0", -- how many holds are allowed
1002
  `holdspickupdelay` int(11)  default NULL, -- after how many days a hold is problematic (in days)
1002
  `branchcode` varchar(10) NOT NULL default '', -- the branch this rule is for (branches.branchcode)
1003
  `branchcode` varchar(10) NOT NULL default '', -- the branch this rule is for (branches.branchcode)
1003
  overduefinescap decimal default NULL, -- the maximum amount of an overdue fine
1004
  overduefinescap decimal default NULL, -- the maximum amount of an overdue fine
1004
  PRIMARY KEY  (`branchcode`,`categorycode`,`itemtype`),
1005
  PRIMARY KEY  (`branchcode`,`categorycode`,`itemtype`),
(-)a/installer/data/mysql/updatedatabase.pl (+12 lines)
Lines 5696-5701 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
5696
    SetVersion($DBversion);
5696
    SetVersion($DBversion);
5697
}
5697
}
5698
5698
5699
$DBversion = "3.09.00.XXX";
5700
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5701
    # biblioitems changes
5702
    $dbh->do(qq{
5703
        ALTER TABLE issuingrules ADD COLUMN holdspickupdelay INT(11) NULL default NULL AFTER reservesallowed;
5704
    });
5705
5706
    print "Upgrade to $DBversion done (Add colum issuingrules.holdspickupdelay)\n";
5707
    SetVersion($DBversion);
5708
}
5709
5710
5699
=head1 FUNCTIONS
5711
=head1 FUNCTIONS
5700
5712
5701
=head2 TableExists($table)
5713
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-3 / +6 lines)
Lines 76-83 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
76
                <th>Suspension in days (day)</th>
76
                <th>Suspension in days (day)</th>
77
                <th>Renewals allowed (count)</th>
77
                <th>Renewals allowed (count)</th>
78
                <th>Holds allowed (count)</th>
78
                <th>Holds allowed (count)</th>
79
		<th>Rental discount (%)</th>
79
                <th>Holds pickup delay (day)</th>
80
				<th>&nbsp;</th>
80
                <th>Rental discount (%)</th>
81
                <th>&nbsp;</th>
81
            </tr>
82
            </tr>
82
				[% FOREACH rule IN rules %]
83
				[% FOREACH rule IN rules %]
83
					[% UNLESS ( loop.odd ) %]
84
					[% UNLESS ( loop.odd ) %]
Lines 121-126 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
121
							<td>[% rule.finedays %]</td>
122
							<td>[% rule.finedays %]</td>
122
							<td>[% rule.renewalsallowed %]</td>
123
							<td>[% rule.renewalsallowed %]</td>
123
							<td>[% rule.reservesallowed %]</td>
124
							<td>[% rule.reservesallowed %]</td>
125
                            <td>[% rule.holdspickupdelay %]</td>
124
							<td>[% rule.rentaldiscount %]</td>
126
							<td>[% rule.rentaldiscount %]</td>
125
							<td>
127
							<td>
126
								<a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=[% rule.itemtype %]&amp;categorycode=[% rule.categorycode %]&amp;branch=[% rule.current_branch %]">Delete</a>
128
								<a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=[% rule.itemtype %]&amp;categorycode=[% rule.categorycode %]&amp;branch=[% rule.current_branch %]">Delete</a>
Lines 167-173 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
167
                    <td><input name="finedays" size="3" /> </td>
169
                    <td><input name="finedays" size="3" /> </td>
168
                    <td><input name="renewalsallowed" size="2" /></td>
170
                    <td><input name="renewalsallowed" size="2" /></td>
169
                    <td><input name="reservesallowed" size="2" /></td>
171
                    <td><input name="reservesallowed" size="2" /></td>
170
		    <td><input name="rentaldiscount" size="2" /></td>
172
                    <td><input name="holdspickupdelay" size="2" /></td>
173
                    <td><input name="rentaldiscount" size="2" /></td>
171
                    <td><input type="hidden" name="branch" value="[% current_branch %]"/><input type="submit" value="Add" class="submit" /></td>
174
                    <td><input type="hidden" name="branch" value="[% current_branch %]"/><input type="submit" value="Add" class="submit" /></td>
172
                </tr>
175
                </tr>
173
            </table>
176
            </table>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-2 / +2 lines)
Lines 607-613 No patron matched <span class="ex">[% message %]</span> Link Here
607
		    <h4>Holds waiting:</h4>
607
		    <h4>Holds waiting:</h4>
608
			        [% FOREACH WaitingReserveLoo IN WaitingReserveLoop %]
608
			        [% FOREACH WaitingReserveLoo IN WaitingReserveLoop %]
609
			            <ul>
609
			            <ul>
610
			                <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 %] Hold placed on [% WaitingReserveLoo.reservedate %].
610
			                <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 %] Hold placed on [% WaitingReserveLoo.reservedate %] waiting until [% WaitingReserveLoo.maxpickupdate | $KohaDates %].
611
			            [% IF ( WaitingReserveLoo.waitingat ) %]
611
			            [% IF ( WaitingReserveLoo.waitingat ) %]
612
			                <br />[% IF ( WaitingReserveLoo.waitinghere ) %]<strong class="waitinghere">[% ELSE %]<strong>[% END %]Waiting at [% WaitingReserveLoo.waitingat %]</strong>
612
			                <br />[% IF ( WaitingReserveLoo.waitinghere ) %]<strong class="waitinghere">[% ELSE %]<strong>[% END %]Waiting at [% WaitingReserveLoo.waitingat %]</strong>
613
			            [% END %]
613
			            [% END %]
Lines 957-963 No patron matched <span class="ex">[% message %]</span> Link Here
957
                    <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% reservloo.biblionumber %]"><strong>[% reservloo.title |html %]</strong></a>[% IF ( reservloo.author ) %], by [% reservloo.author %][% END %]</td>
957
                    <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% reservloo.biblionumber %]"><strong>[% reservloo.title |html %]</strong></a>[% IF ( reservloo.author ) %], by [% reservloo.author %][% END %]</td>
958
                    <td>[% reservloo.itemcallnumber %]</td>
958
                    <td>[% reservloo.itemcallnumber %]</td>
959
					<td><em>[% IF ( reservloo.barcodereserv ) %]Item [% reservloo.barcodereserv %]
959
					<td><em>[% IF ( reservloo.barcodereserv ) %]Item [% reservloo.barcodereserv %]
960
                        [% END %][% IF ( reservloo.waiting ) %] <strong>waiting at [% reservloo.waitingat %]</strong>
960
                        [% END %][% IF ( reservloo.waiting ) %] <strong>waiting at [% reservloo.waitingat %][% IF reservloo.maxpickupdate %] until [% reservloo.maxpickupdate | $KohaDates %][% END %]</strong>
961
                        [% END %]
961
                        [% END %]
962
                        [% IF ( reservloo.transfered ) %] <strong>in transit</strong> from
962
                        [% IF ( reservloo.transfered ) %] <strong>in transit</strong> from
963
                        [% reservloo.frombranch %] since [% reservloo.datesent %]
963
                        [% reservloo.frombranch %] since [% reservloo.datesent %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt (-5 / +6 lines)
Lines 1-3 Link Here
1
[% USE KohaDates %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Circulation &rsaquo; Holds awaiting pickup</title>
3
<title>Koha &rsaquo; Circulation &rsaquo; Holds awaiting pickup</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
Lines 78-84 $.tablesorter.addParser({ Link Here
78
            [% IF ( reserveloop ) %]
79
            [% IF ( reserveloop ) %]
79
               <table id="holdst">
80
               <table id="holdst">
80
               <thead><tr>
81
               <thead><tr>
81
                    <th>Available since</th>
82
                    <th>Available since-until</th>
82
                    <th>Title</th>
83
                    <th>Title</th>
83
                    <th>Patron</th>
84
                    <th>Patron</th>
84
                    <th>Location</th>
85
                    <th>Location</th>
Lines 88-94 $.tablesorter.addParser({ Link Here
88
               </tr></thead>
89
               </tr></thead>
89
               <tbody>[% FOREACH reserveloo IN reserveloop %]
90
               <tbody>[% FOREACH reserveloo IN reserveloop %]
90
                <tr>
91
                <tr>
91
                    <td><p>[% reserveloo.waitingdate %]</p></td>
92
                    <td><p>[% reserveloo.waitingdate | $KohaDates %] - [% reserveloo.maxpickupdate | $KohaDates %]</p></td>
92
                    <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %]
93
                    <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %]
93
                        [% reserveloo.title |html %] [% reserveloo.subtitle |html %]
94
                        [% reserveloo.title |html %] [% reserveloo.subtitle |html %]
94
                        </a>
95
                        </a>
Lines 123-129 $.tablesorter.addParser({ Link Here
123
        [% END %]
124
        [% END %]
124
        </div>
125
        </div>
125
        <div id="holdsover">
126
        <div id="holdsover">
126
                <p>Holds listed here have been awaiting pickup for more than [% ReservesMaxPickUpDelay %] days.</p>
127
                <p>Holds listed here have been awaiting pickup for too many days.</p>
127
               [% IF ( overloop ) %]
128
               [% IF ( overloop ) %]
128
               <p>
129
               <p>
129
               <form name="cancelAllReserve" action="waitingreserves.pl" method="post">
130
               <form name="cancelAllReserve" action="waitingreserves.pl" method="post">
Lines 138-144 $.tablesorter.addParser({ Link Here
138
               <br/>
139
               <br/>
139
               <table id="holdso">
140
               <table id="holdso">
140
               <thead><tr>
141
               <thead><tr>
141
                    <th>Available since</th>
142
                    <th>Available since-until</th>
142
                    <th>Title</th>
143
                    <th>Title</th>
143
                    <th>Patron</th>
144
                    <th>Patron</th>
144
                    <th>Location</th>
145
                    <th>Location</th>
Lines 148-154 $.tablesorter.addParser({ Link Here
148
               </tr></thead>
149
               </tr></thead>
149
               <tbody>[% FOREACH overloo IN overloop %]
150
               <tbody>[% FOREACH overloo IN overloop %]
150
                    <tr>
151
                    <tr>
151
                        <td><p>[% overloo.waitingdate %]</p></td>
152
                        <td><p>[% overloo.waitingdate | $KohaDates %] - [% overloo.maxpickupdate | $KohaDates %]</p></td>
152
                        <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = overloo.biblionumber %][% overloo.title |html %] [% overloo.subtitle |html %]
153
                        <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = overloo.biblionumber %][% overloo.title |html %] [% overloo.subtitle |html %]
153
                        </a>
154
                        </a>
154
                            [% UNLESS ( item_level_itypes ) %][% IF ( overloo.itemtype ) %]&nbsp; (<b>[% overloo.itemtype %]</b>)[% END %][% END %]
155
                            [% 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 / +1 lines)
Lines 610-616 function validate1(date) { Link Here
610
            </td>
610
            </td>
611
            <td>[% reservloo.itemcallnumber %]</td>
611
            <td>[% reservloo.itemcallnumber %]</td>
612
            <td>[% IF ( reservloo.waiting ) %]
612
            <td>[% IF ( reservloo.waiting ) %]
613
                <em>Item is <strong>waiting</strong></em>
613
                <em>Item is <strong>waiting</strong> until [% reservloo.maxpickupdate %]</em>
614
                [% END %]
614
                [% END %]
615
                [% IF ( reservloo.transfered ) %]
615
                [% IF ( reservloo.transfered ) %]
616
                <em>Item <strong>in transit</strong> from
616
                <em>Item <strong>in transit</strong> from
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt (-1 / +1 lines)
Lines 385-391 $.tablesorter.addParser({ Link Here
385
                    [% IF ( RESERVE.wait ) %]
385
                    [% IF ( RESERVE.wait ) %]
386
                        [% IF ( RESERVE.atdestination ) %]
386
                        [% IF ( RESERVE.atdestination ) %]
387
                            [% IF ( RESERVE.found ) %]
387
                            [% IF ( RESERVE.found ) %]
388
                            Item waiting at <b> [% RESERVE.wbrname %]</b>[% IF ( RESERVE.waitingdate ) %] since [% RESERVE.waitingdate | $KohaDates %][% END %]
388
                            Item waiting at <b> [% RESERVE.wbrname %]</b>[% IF ( RESERVE.waitingdate ) %] since [% RESERVE.waitingdate | $KohaDates %] until [% RESERVE.maxpickupdate | $KohaDates %][% END %]
389
                            <input type="hidden" name="pickup" value="[% RESERVE.wbrcd %]" />
389
                            <input type="hidden" name="pickup" value="[% RESERVE.wbrcd %]" />
390
                            [% ELSE %]
390
                            [% ELSE %]
391
                            Item waiting to be pulled from <b> [% RESERVE.wbrname %]</b>
391
                            Item waiting to be pulled from <b> [% RESERVE.wbrname %]</b>
(-)a/members/moremember.pl (+1 lines)
Lines 290-295 if ($borrowernumber) { Link Here
290
        if ( $num_res->{'found'} eq 'W' ) {
290
        if ( $num_res->{'found'} eq 'W' ) {
291
            $getreserv{color}   = 'reserved';
291
            $getreserv{color}   = 'reserved';
292
            $getreserv{waiting} = 1;
292
            $getreserv{waiting} = 1;
293
            $getreserv{maxpickupdate} = GetMaxPickupDate( $num_res, $borrowernumber );
293
        }
294
        }
294
295
295
        # 		check transfers with the itemnumber foud in th reservation loop
296
        # 		check transfers with the itemnumber foud in th reservation loop
(-)a/opac/opac-user.pl (-3 / +5 lines)
Lines 257-266 foreach my $res (@reserves) { Link Here
257
    if ( $res->{'expirationdate'} eq '0000-00-00' ) {
257
    if ( $res->{'expirationdate'} eq '0000-00-00' ) {
258
      $res->{'expirationdate'} = '';
258
      $res->{'expirationdate'} = '';
259
    }
259
    }
260
    
260
261
    my $publictype = $res->{'publictype'};
261
    my $publictype = $res->{'publictype'};
262
    $res->{$publictype} = 1;
262
    $res->{$publictype} = 1;
263
    $res->{'waiting'} = 1 if $res->{'found'} eq 'W';
263
    if ( $res->{found} eq 'W' ) {
264
        $res->{waiting} = 1;
265
        $res->{maxpickupdate} = GetMaxPickupDate( $res, $borrowernumber );
266
    }
264
    $res->{'branch'} = $branches->{ $res->{'branchcode'} }->{'branchname'};
267
    $res->{'branch'} = $branches->{ $res->{'branchcode'} }->{'branchname'};
265
    my $biblioData = GetBiblioData($res->{'biblionumber'});
268
    my $biblioData = GetBiblioData($res->{'biblionumber'});
266
    $res->{'reserves_title'} = $biblioData->{'title'};
269
    $res->{'reserves_title'} = $biblioData->{'title'};
267
- 

Return to bug 8367