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

(-)a/C4/Reserves.pm (-27 / +116 lines)
Lines 459-465 sub CanItemBeReserved{ Link Here
459
    my $dbh             = C4::Context->dbh;
459
    my $dbh             = C4::Context->dbh;
460
    my $ruleitemtype; # itemtype of the matching issuing rule
460
    my $ruleitemtype; # itemtype of the matching issuing rule
461
    my $allowedreserves = 0;
461
    my $allowedreserves = 0;
462
            
462
463
    # we retrieve borrowers and items informations #
463
    # we retrieve borrowers and items informations #
464
    # item->{itype} will come for biblioitems if necessery
464
    # item->{itype} will come for biblioitems if necessery
465
    my $item = GetItem($itemnumber);
465
    my $item = GetItem($itemnumber);
Lines 495-502 sub CanItemBeReserved{ Link Here
495
                                LEFT JOIN borrowers USING (borrowernumber)
495
                                LEFT JOIN borrowers USING (borrowernumber)
496
                            WHERE borrowernumber = ?
496
                            WHERE borrowernumber = ?
497
                                ";
497
                                ";
498
    
498
499
    
499
500
    my $branchcode   = "";
500
    my $branchcode   = "";
501
    my $branchfield  = "reserves.branchcode";
501
    my $branchfield  = "reserves.branchcode";
502
502
Lines 507-518 sub CanItemBeReserved{ Link Here
507
        $branchfield = "borrowers.branchcode";
507
        $branchfield = "borrowers.branchcode";
508
        $branchcode = $borrower->{branchcode};
508
        $branchcode = $borrower->{branchcode};
509
    }
509
    }
510
    
510
511
    # we retrieve rights 
511
    # we retrieve rights
512
    $sth->execute($borrower->{'categorycode'}, $item->{'itype'}, $branchcode);
512
    $sth->execute($borrower->{'categorycode'}, $item->{'itype'}, $branchcode);
513
    if(my $rights = $sth->fetchrow_hashref()){
513
    if(my $rights = $sth->fetchrow_hashref()){
514
        $ruleitemtype    = $rights->{itemtype};
514
        $ruleitemtype    = $rights->{itemtype};
515
        $allowedreserves = $rights->{reservesallowed}; 
515
        $allowedreserves = $rights->{reservesallowed};
516
    }else{
516
    }else{
517
        $ruleitemtype = '*';
517
        $ruleitemtype = '*';
518
    }
518
    }
Lines 520-526 sub CanItemBeReserved{ Link Here
520
    # we retrieve count
520
    # we retrieve count
521
521
522
    $querycount .= "AND $branchfield = ?";
522
    $querycount .= "AND $branchfield = ?";
523
    
523
524
    # If using item-level itypes, fall back to the record
524
    # If using item-level itypes, fall back to the record
525
    # level itemtype if the hold has no associated item
525
    # level itemtype if the hold has no associated item
526
    $querycount .=
526
    $querycount .=
Lines 530-536 sub CanItemBeReserved{ Link Here
530
      if ( $ruleitemtype ne "*" );
530
      if ( $ruleitemtype ne "*" );
531
531
532
    my $sthcount = $dbh->prepare($querycount);
532
    my $sthcount = $dbh->prepare($querycount);
533
    
533
534
    if($ruleitemtype eq "*"){
534
    if($ruleitemtype eq "*"){
535
        $sthcount->execute($borrowernumber, $branchcode);
535
        $sthcount->execute($borrowernumber, $branchcode);
536
    }else{
536
    }else{
Lines 744-751 sub GetReservesToBranch { Link Here
744
    my $dbh = C4::Context->dbh;
744
    my $dbh = C4::Context->dbh;
745
    my $sth = $dbh->prepare(
745
    my $sth = $dbh->prepare(
746
        "SELECT reserve_id,borrowernumber,reservedate,itemnumber,timestamp
746
        "SELECT reserve_id,borrowernumber,reservedate,itemnumber,timestamp
747
         FROM reserves 
747
         FROM reserves
748
         WHERE priority='0' 
748
         WHERE priority='0'
749
           AND branchcode=?"
749
           AND branchcode=?"
750
    );
750
    );
751
    $sth->execute( $frombranch );
751
    $sth->execute( $frombranch );
Lines 770-776 sub GetReservesForBranch { Link Here
770
770
771
    my $query = "
771
    my $query = "
772
        SELECT reserve_id,borrowernumber,reservedate,itemnumber,waitingdate
772
        SELECT reserve_id,borrowernumber,reservedate,itemnumber,waitingdate
773
        FROM   reserves 
773
        FROM   reserves
774
        WHERE   priority='0'
774
        WHERE   priority='0'
775
        AND found='W'
775
        AND found='W'
776
    ";
776
    ";
Lines 1025-1031 sub CancelExpiredReserves { Link Here
1025
            }
1025
            }
1026
1026
1027
            if ( $do_cancel ) {
1027
            if ( $do_cancel ) {
1028
                CancelReserve({ reserve_id => $res->{'reserve_id'}, charge_cancel_fee => 1 });
1028
                CancelReserve(
1029
                    {
1030
                        reserve_id => $res->{'reserve_id'},
1031
                        autofill   => C4::Context->preference('ExpireReservesAutoFill'),
1032
                        charge_cancel_fee => 1,
1033
                    }
1034
                );
1029
            }
1035
            }
1030
        }
1036
        }
1031
    }
1037
    }
Lines 1050-1056 sub AutoUnsuspendReserves { Link Here
1050
1056
1051
=head2 CancelReserve
1057
=head2 CancelReserve
1052
1058
1053
  CancelReserve({ reserve_id => $reserve_id, [ biblionumber => $biblionumber, borrowernumber => $borrrowernumber, itemnumber => $itemnumber, ] [ charge_cancel_fee => 1 ] });
1059
  CancelReserve({ reserve_id => $reserve_id, [ biblionumber => $biblionumber, borrowernumber => $borrrowernumber, itemnumber => $itemnumber, charge_cancel_fee => 1, autofill => $autofill ] });
1054
1060
1055
Cancels a reserve. If C<charge_cancel_fee> is passed and the C<ExpireReservesMaxPickUpDelayCharge> syspref is set, charge that fee to the patron's account.
1061
Cancels a reserve. If C<charge_cancel_fee> is passed and the C<ExpireReservesMaxPickUpDelayCharge> syspref is set, charge that fee to the patron's account.
1056
1062
Lines 1060-1069 sub CancelReserve { Link Here
1060
    my ( $params ) = @_;
1066
    my ( $params ) = @_;
1061
1067
1062
    my $reserve_id = $params->{'reserve_id'};
1068
    my $reserve_id = $params->{'reserve_id'};
1069
    my $autofill   = $params->{autofill};
1070
1063
    # Filter out only the desired keys; this will insert undefined values for elements missing in
1071
    # Filter out only the desired keys; this will insert undefined values for elements missing in
1064
    # \%params, but GetReserveId filters them out anyway.
1072
    # \%params, but GetReserveId filters them out anyway.
1065
    $reserve_id = GetReserveId( { biblionumber => $params->{'biblionumber'}, borrowernumber => $params->{'borrowernumber'}, itemnumber => $params->{'itemnumber'} } ) unless ( $reserve_id );
1073
    $reserve_id = GetReserveId( { biblionumber => $params->{'biblionumber'}, borrowernumber => $params->{'borrowernumber'}, itemnumber => $params->{'itemnumber'} } ) unless ( $reserve_id );
1066
1074
1075
1067
    return unless ( $reserve_id );
1076
    return unless ( $reserve_id );
1068
1077
1069
    my $dbh = C4::Context->dbh;
1078
    my $dbh = C4::Context->dbh;
Lines 1103-1108 sub CancelReserve { Link Here
1103
        if ( $charge && $params->{'charge_cancel_fee'} ) {
1112
        if ( $charge && $params->{'charge_cancel_fee'} ) {
1104
            manualinvoice($reserve->{'borrowernumber'}, $reserve->{'itemnumber'}, '', 'HE', $charge);
1113
            manualinvoice($reserve->{'borrowernumber'}, $reserve->{'itemnumber'}, '', 'HE', $charge);
1105
        }
1114
        }
1115
1116
        # only attempt to autofill canceled holds that were found and waiting
1117
        if ( $autofill && $reserve->{itemnumber} && $reserve->{found} && $reserve->{found} eq 'W' ) {
1118
            my ( undef, $next_hold ) = CheckReserves( $reserve->{'itemnumber'} );
1119
            if ($next_hold) {
1120
                my $is_transfer = $reserve->{branchcode} ne $next_hold->{branchcode};
1121
1122
                ModReserveAffect(
1123
                    {
1124
                        itemnumber     => $reserve->{itemnumber},
1125
                        borrowernumber => $next_hold->{borrowernumber},
1126
                        is_transfer    => $is_transfer,
1127
                        notify_library => 1,
1128
                    }
1129
                );
1130
1131
                ModItemTransfer( $reserve->{itemnumber}, $reserve->{branchcode}, $next_hold->{branchcode} )
1132
                  if $is_transfer;
1133
            }
1134
        }
1106
    }
1135
    }
1107
1136
1108
    return $reserve;
1137
    return $reserve;
Lines 1303-1309 take care of the waiting status Link Here
1303
=cut
1332
=cut
1304
1333
1305
sub ModReserveAffect {
1334
sub ModReserveAffect {
1306
    my ( $itemnumber, $borrowernumber,$transferToDo ) = @_;
1335
    my ( $params ) = @_;
1336
1337
    my $itemnumber     = $params->{itemnumber};
1338
    my $borrowernumber = $params->{borrowernumber};
1339
    my $transferToDo   = $params->{is_transfer};
1340
    my $notify_library = $params->{notify_library};
1341
1307
    my $dbh = C4::Context->dbh;
1342
    my $dbh = C4::Context->dbh;
1308
1343
1309
    # we want to attach $itemnumber to $borrowernumber, find the biblionumber
1344
    # we want to attach $itemnumber to $borrowernumber, find the biblionumber
Lines 1348-1355 sub ModReserveAffect { Link Here
1348
    }
1383
    }
1349
    $sth = $dbh->prepare($query);
1384
    $sth = $dbh->prepare($query);
1350
    $sth->execute( $itemnumber, $borrowernumber,$biblionumber);
1385
    $sth->execute( $itemnumber, $borrowernumber,$biblionumber);
1351
    _koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber ) if ( !$transferToDo && !$already_on_shelf );
1386
1387
    _koha_notify_reserve(
1388
        {
1389
            itemnumber     => $itemnumber,
1390
            borrowernumber => $borrowernumber,
1391
            biblionumber   => $biblionumber,
1392
            notify_library => $notify_library,
1393
        }
1394
    ) if ( !$transferToDo && !$already_on_shelf );
1395
1352
    _FixPriority( { biblionumber => $biblionumber } );
1396
    _FixPriority( { biblionumber => $biblionumber } );
1397
1353
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
1398
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
1354
      CartToShelf( $itemnumber );
1399
      CartToShelf( $itemnumber );
1355
    }
1400
    }
Lines 1394-1400 sub ModReserveMinusPriority { Link Here
1394
    my $dbh   = C4::Context->dbh;
1439
    my $dbh   = C4::Context->dbh;
1395
    my $query = "
1440
    my $query = "
1396
        UPDATE reserves
1441
        UPDATE reserves
1397
        SET    priority = 0 , itemnumber = ? 
1442
        SET    priority = 0 , itemnumber = ?
1398
        WHERE  reserve_id = ?
1443
        WHERE  reserve_id = ?
1399
    ";
1444
    ";
1400
    my $sth_upd = $dbh->prepare($query);
1445
    my $sth_upd = $dbh->prepare($query);
Lines 1631-1637 sub ToggleLowestPriority { Link Here
1631
1676
1632
    my $sth = $dbh->prepare( "UPDATE reserves SET lowestPriority = NOT lowestPriority WHERE reserve_id = ?");
1677
    my $sth = $dbh->prepare( "UPDATE reserves SET lowestPriority = NOT lowestPriority WHERE reserve_id = ?");
1633
    $sth->execute( $reserve_id );
1678
    $sth->execute( $reserve_id );
1634
    
1679
1635
    _FixPriority({ reserve_id => $reserve_id, rank => '999999' });
1680
    _FixPriority({ reserve_id => $reserve_id, rank => '999999' });
1636
}
1681
}
1637
1682
Lines 1815-1821 sub _FixPriority { Link Here
1815
            $priority[$j]->{'reserve_id'}
1860
            $priority[$j]->{'reserve_id'}
1816
        );
1861
        );
1817
    }
1862
    }
1818
    
1863
1819
    $sth = $dbh->prepare( "SELECT reserve_id FROM reserves WHERE lowestPriority = 1 ORDER BY priority" );
1864
    $sth = $dbh->prepare( "SELECT reserve_id FROM reserves WHERE lowestPriority = 1 ORDER BY priority" );
1820
    $sth->execute();
1865
    $sth->execute();
1821
1866
Lines 1953-1959 sub _Findgroupreserve { Link Here
1953
1998
1954
=head2 _koha_notify_reserve
1999
=head2 _koha_notify_reserve
1955
2000
1956
  _koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber );
2001
_koha_notify_reserve(
2002
    {
2003
        itemnumber     => $itemnumber,
2004
        borrowernumber => $borrowernumber,
2005
        biblionumber   => $biblionumber,
2006
        notify_library => $notify_library
2007
    }
2008
);
1957
2009
1958
Sends a notification to the patron that their hold has been filled (through
2010
Sends a notification to the patron that their hold has been filled (through
1959
ModReserveAffect, _not_ ModReserveFill)
2011
ModReserveAffect, _not_ ModReserveFill)
Lines 1980-1986 The following tables are availalbe witin the notice: Link Here
1980
=cut
2032
=cut
1981
2033
1982
sub _koha_notify_reserve {
2034
sub _koha_notify_reserve {
1983
    my ($itemnumber, $borrowernumber, $biblionumber) = @_;
2035
    my ( $params ) = @_;
2036
2037
    my $itemnumber     = $params->{itemnumber};
2038
    my $borrowernumber = $params->{borrowernumber};
2039
    my $biblionumber   = $params->{biblionumber};
2040
    my $notify_library = $params->{notify_library};
1984
2041
1985
    my $dbh = C4::Context->dbh;
2042
    my $dbh = C4::Context->dbh;
1986
    my $borrower = C4::Members::GetMember(borrowernumber => $borrowernumber);
2043
    my $borrower = C4::Members::GetMember(borrowernumber => $borrowernumber);
Lines 2031-2042 sub _koha_notify_reserve { Link Here
2031
            return;
2088
            return;
2032
        }
2089
        }
2033
2090
2034
        C4::Letters::EnqueueLetter( {
2091
        C4::Letters::EnqueueLetter(
2035
            letter => $letter,
2092
            {
2036
            borrowernumber => $borrowernumber,
2093
                letter                 => $letter,
2037
            from_address => $admin_email_address,
2094
                borrowernumber         => $borrowernumber,
2038
            message_transport_type => $mtt,
2095
                from_address           => $admin_email_address,
2039
        } );
2096
                message_transport_type => $mtt,
2097
            }
2098
        );
2040
    };
2099
    };
2041
2100
2042
    while ( my ( $mtt, $letter_code ) = each %{ $messagingprefs->{transports} } ) {
2101
    while ( my ( $mtt, $letter_code ) = each %{ $messagingprefs->{transports} } ) {
Lines 2053-2059 sub _koha_notify_reserve { Link Here
2053
    if (! $notification_sent) {
2112
    if (! $notification_sent) {
2054
        &$send_notification('print', 'HOLD');
2113
        &$send_notification('print', 'HOLD');
2055
    }
2114
    }
2056
    
2115
2116
    if ($notify_library) {
2117
        my $letter = C4::Letters::GetPreparedLetter(
2118
            module      => 'reserves',
2119
            letter_code => 'HOLD_CHANGED',
2120
            branchcode  => $reserve->{branchcode},
2121
            substitute  => { today => C4::Dates->new()->output() },
2122
            tables      => {
2123
                'branches'  => $branch_details,
2124
                'borrowers' => $borrower,
2125
                'biblio'    => $biblionumber,
2126
                'reserves'  => $reserve,
2127
                'items'     => $reserve->{'itemnumber'},
2128
            },
2129
        );
2130
2131
        my $email =
2132
             C4::Context->preference('ExpireReservesAutoFillEmail')
2133
          || $branch_details->{'branchemail'}
2134
          || C4::Context->preference('KohaAdminEmailAddress');
2135
2136
        C4::Letters::EnqueueLetter(
2137
            {
2138
                letter                 => $letter,
2139
                borrowernumber         => $borrowernumber,
2140
                message_transport_type => 'email',
2141
                from_address           => $email,
2142
                to_address             => $email,
2143
            }
2144
        );
2145
    }
2057
}
2146
}
2058
2147
2059
=head2 _ShiftPriorityByDateAndPriority
2148
=head2 _ShiftPriorityByDateAndPriority
(-)a/C4/SIP/ILS/Transaction/Checkin.pm (-4 / +14 lines)
Lines 99-111 sub do_checkin { Link Here
99
        $self->hold($messages->{ResFound});
99
        $self->hold($messages->{ResFound});
100
        if ($branch eq $messages->{ResFound}->{branchcode}) {
100
        if ($branch eq $messages->{ResFound}->{branchcode}) {
101
            $self->alert_type('01');
101
            $self->alert_type('01');
102
            ModReserveAffect( $messages->{ResFound}->{itemnumber},
102
            ModReserveAffect(
103
                $messages->{ResFound}->{borrowernumber}, 0);
103
                {
104
                    itemnumber     => $messages->{ResFound}->{itemnumber},
105
                    borrowernumber => $messages->{ResFound}->{borrowernumber},
106
                    is_transfer    => 0,
107
                }
108
            );
104
109
105
        } else {
110
        } else {
106
            $self->alert_type('02');
111
            $self->alert_type('02');
107
            ModReserveAffect( $messages->{ResFound}->{itemnumber},
112
            ModReserveAffect(
108
                $messages->{ResFound}->{borrowernumber}, 1);
113
                {
114
                    itemnumber     => $messages->{ResFound}->{itemnumber},
115
                    borrowernumber => $messages->{ResFound}->{borrowernumber},
116
                    is_transfer    => 1,
117
                }
118
            );
109
            ModItemTransfer( $messages->{ResFound}->{itemnumber},
119
            ModItemTransfer( $messages->{ResFound}->{itemnumber},
110
                $branch,
120
                $branch,
111
                $messages->{ResFound}->{branchcode}
121
                $messages->{ResFound}->{branchcode}
(-)a/circ/branchtransfers.pl (-1 / +1 lines)
Lines 89-95 if ( $request eq "KillWaiting" ) { Link Here
89
}
89
}
90
elsif ( $request eq "SetWaiting" ) {
90
elsif ( $request eq "SetWaiting" ) {
91
    my $item = $query->param('itemnumber');
91
    my $item = $query->param('itemnumber');
92
    ModReserveAffect( $item, $borrowernumber );
92
    ModReserveAffect( { itemnumber => $item, borrowernumber => $borrowernumber } );
93
    $ignoreRs    = 1;
93
    $ignoreRs    = 1;
94
    $setwaiting  = 1;
94
    $setwaiting  = 1;
95
    $reqmessage  = 1;
95
    $reqmessage  = 1;
(-)a/circ/returns.pl (-2 / +3 lines)
Lines 159-167 if ( $query->param('resbarcode') ) { Link Here
159
        my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef;
159
        my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef;
160
        # diffBranchSend tells ModReserveAffect whether document is expected in this library or not,
160
        # diffBranchSend tells ModReserveAffect whether document is expected in this library or not,
161
        # i.e., whether to apply waiting status
161
        # i.e., whether to apply waiting status
162
        ModReserveAffect( $item, $borrowernumber, $diffBranchSend);
162
        ModReserveAffect( { itemnumber => $item, borrowernumber => $borrowernumber, is_transfer => $diffBranchSend } );
163
    }
163
    }
164
#   check if we have other reserves for this document, if we have a return send the message of transfer
164
165
    # check if we have other reserves for this document, if we have a return send the message of transfer
165
    my ( $messages, $nextreservinfo ) = GetOtherReserves($item);
166
    my ( $messages, $nextreservinfo ) = GetOtherReserves($item);
166
167
167
    my $borr = GetMember( borrowernumber => $nextreservinfo );
168
    my $borr = GetMember( borrowernumber => $nextreservinfo );
(-)a/installer/data/mysql/atomicupdate/bug_14364.sql (+13 lines)
Line 0 Link Here
1
INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
2
('ExpireReservesAutoFill','0',NULL,'Automatically fill the next hold with a automatically canceled expired waiting hold.','YesNo'),
3
('ExpireReservesAutoFillEmail','', NULL,'If ExpireReservesAutoFill and an email is defined here, the email notification for the change in the hold will be sent to this address.','Free');
4
5
INSERT INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type)
6
VALUES ( 'reserves', 'HOLD_CHANGED', '', 'Canceled Hold Available for Different Patron', '0', 'Canceled Hold Available for Different Patron', 'The patron picking up <<biblio.title>> (<<items.barcode>>) has changed to <<borrowers.firstname>> <<borrowers.surname>> (<<borrowers.cardnumber>>).
7
8
Please update the hold information for this item.
9
10
Title: <<biblio.title>>
11
Author: <<biblio.author>>
12
Copy: <<items.copynumber>>
13
Pickup location: <<branches.branchname>>', 'email');
(-)a/installer/data/mysql/de-DE/mandatory/sample_notices.sql (+9 lines)
Lines 154-156 VALUES ( 'circulation', 'OVERDUES_SLIP', '', 'Ãœberfälligkeiten (Quittung)', '0 Link Here
154
INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type)
154
INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type)
155
VALUES ('members','PASSWORD_RESET','','Neues Passwort',1,'Neues Passwort','<html>\r\n<p>Liebe(r) <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,</p>\r\n\r\n<p>Diese E-Mail wurde verschickt, da Sie ein neues Passwort für Ihr Bibliotheksbenutzerkonto angefordert haben: <strong><<user>></strong>.\r\n</p>\r\n<p>\r\nBitte klicken Sie auf den folgenden Link um Ihr neues Passwort zu erstellen:\r\n<br/><a href=\"<<passwordreseturl>>\"><<passwordreseturl>></a>\r\n</p>\r\n<p>Dieser Link ist von dieser E-Mail an für 2 Tage gültig. Wenn Sie bis dahin Ihr Passwort nicht geändert haben, müssen Sie die E-Mail erneut anfordern.</p>\r\n<p>Vielen Dank</p>\r\n</html>\r\n','email'
155
VALUES ('members','PASSWORD_RESET','','Neues Passwort',1,'Neues Passwort','<html>\r\n<p>Liebe(r) <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,</p>\r\n\r\n<p>Diese E-Mail wurde verschickt, da Sie ein neues Passwort für Ihr Bibliotheksbenutzerkonto angefordert haben: <strong><<user>></strong>.\r\n</p>\r\n<p>\r\nBitte klicken Sie auf den folgenden Link um Ihr neues Passwort zu erstellen:\r\n<br/><a href=\"<<passwordreseturl>>\"><<passwordreseturl>></a>\r\n</p>\r\n<p>Dieser Link ist von dieser E-Mail an für 2 Tage gültig. Wenn Sie bis dahin Ihr Passwort nicht geändert haben, müssen Sie die E-Mail erneut anfordern.</p>\r\n<p>Vielen Dank</p>\r\n</html>\r\n','email'
156
);
156
);
157
INSERT INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type)
158
    VALUES ( 'reserves', 'HOLD_CHANGED', '', 'Canceled Hold Available for Different Patron', '0', 'Canceled Hold Available for Different Patron', 'The patron picking up <<biblio.title>> (<<items.barcode>>) has changed to <<borrowers.firstname>> <<borrowers.surname>> (<<borrowers.cardnumber>>).
159
160
            Please update the hold information for this item.
161
162
            Title: <<biblio.title>>
163
            Author: <<biblio.author>>
164
            Copy: <<items.copynumber>>
165
            Pickup location: <<branches.branchname>>', 'email');
(-)a/installer/data/mysql/en/mandatory/sample_notices.sql (+9 lines)
Lines 166-168 VALUES ( 'circulation', 'OVERDUES_SLIP', '', 'Overdues Slip', '0', 'OVERDUES_SLI Link Here
166
INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type)
166
INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type)
167
VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password recovery','<html>\r\n<p>This email has been sent in response to your password recovery request for the account <strong><<user>></strong>.\r\n</p>\r\n<p>\r\nYou can now create your new password using the following link:\r\n<br/><a href=\"<<passwordreseturl>>\"><<passwordreseturl>></a>\r\n</p>\r\n<p>This link will be valid for 2 days from this email\'s reception, then you must reapply if you do not change your password.</p>\r\n<p>Thank you.</p>\r\n</html>\r\n','email'
167
VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password recovery','<html>\r\n<p>This email has been sent in response to your password recovery request for the account <strong><<user>></strong>.\r\n</p>\r\n<p>\r\nYou can now create your new password using the following link:\r\n<br/><a href=\"<<passwordreseturl>>\"><<passwordreseturl>></a>\r\n</p>\r\n<p>This link will be valid for 2 days from this email\'s reception, then you must reapply if you do not change your password.</p>\r\n<p>Thank you.</p>\r\n</html>\r\n','email'
168
);
168
);
169
INSERT INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type)
170
    VALUES ( 'reserves', 'HOLD_CHANGED', '', 'Canceled Hold Available for Different Patron', '0', 'Canceled Hold Available for Different Patron', 'The patron picking up <<biblio.title>> (<<items.barcode>>) has changed to <<borrowers.firstname>> <<borrowers.surname>> (<<borrowers.cardnumber>>).
171
172
            Please update the hold information for this item.
173
174
            Title: <<biblio.title>>
175
            Author: <<biblio.author>>
176
            Copy: <<items.copynumber>>
177
            Pickup location: <<branches.branchname>>', 'email');
(-)a/installer/data/mysql/es-ES/mandatory/sample_notices.sql (+9 lines)
Lines 161-163 VALUES ( 'circulation', 'OVERDUES_SLIP', '', 'Overdues Slip', '0', 'OVERDUES_SLI Link Here
161
INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type)
161
INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type)
162
VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password recovery','<html>\r\n<p>This email has been sent in response to your password recovery request for the account <strong><<user>></strong>.\r\n</p>\r\n<p>\r\nYou can now create your new password using the following link:\r\n<br/><a href=\"<<passwordreseturl>>\"><<passwordreseturl>></a>\r\n</p>\r\n<p>This link will be valid for 2 days from this email\'s reception, then you must reapply if you do not change your password.</p>\r\n<p>Thank you.</p>\r\n</html>\r\n','email'
162
VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password recovery','<html>\r\n<p>This email has been sent in response to your password recovery request for the account <strong><<user>></strong>.\r\n</p>\r\n<p>\r\nYou can now create your new password using the following link:\r\n<br/><a href=\"<<passwordreseturl>>\"><<passwordreseturl>></a>\r\n</p>\r\n<p>This link will be valid for 2 days from this email\'s reception, then you must reapply if you do not change your password.</p>\r\n<p>Thank you.</p>\r\n</html>\r\n','email'
163
);
163
);
164
INSERT INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type)
165
    VALUES ( 'reserves', 'HOLD_CHANGED', '', 'Canceled Hold Available for Different Patron', '0', 'Canceled Hold Available for Different Patron', 'The patron picking up <<biblio.title>> (<<items.barcode>>) has changed to <<borrowers.firstname>> <<borrowers.surname>> (<<borrowers.cardnumber>>).
166
167
Please update the hold information for this item.
168
169
Title: <<biblio.title>>
170
Author: <<biblio.author>>
171
Copy: <<items.copynumber>>
172
Pickup location: <<branches.branchname>>', 'email');
(-)a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql (+9 lines)
Lines 162-164 VALUES ( 'circulation', 'OVERDUES_SLIP', '', 'Overdues Slip', '0', 'OVERDUES_SLI Link Here
162
INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type)
162
INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type)
163
VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password recovery','<html>\r\n<p>This email has been sent in response to your password recovery request for the account <strong><<user>></strong>.\r\n</p>\r\n<p>\r\nYou can now create your new password using the following link:\r\n<br/><a href=\"<<passwordreseturl>>\"><<passwordreseturl>></a>\r\n</p>\r\n<p>This link will be valid for 2 days from this email\'s reception, then you must reapply if you do not change your password.</p>\r\n<p>Thank you.</p>\r\n</html>\r\n','email'
163
VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password recovery','<html>\r\n<p>This email has been sent in response to your password recovery request for the account <strong><<user>></strong>.\r\n</p>\r\n<p>\r\nYou can now create your new password using the following link:\r\n<br/><a href=\"<<passwordreseturl>>\"><<passwordreseturl>></a>\r\n</p>\r\n<p>This link will be valid for 2 days from this email\'s reception, then you must reapply if you do not change your password.</p>\r\n<p>Thank you.</p>\r\n</html>\r\n','email'
164
);
164
);
165
INSERT INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type)
166
    VALUES ( 'reserves', 'HOLD_CHANGED', '', 'Canceled Hold Available for Different Patron', '0', 'Canceled Hold Available for Different Patron', 'The patron picking up <<biblio.title>> (<<items.barcode>>) has changed to <<borrowers.firstname>> <<borrowers.surname>> (<<borrowers.cardnumber>>).
167
168
Please update the hold information for this item.
169
170
Title: <<biblio.title>>
171
Author: <<biblio.author>>
172
Copy: <<items.copynumber>>
173
Pickup location: <<branches.branchname>>', 'email');
(-)a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql (+9 lines)
Lines 181-183 VALUES ( 'circulation', 'OVERDUES_SLIP', '', 'Overdues Slip', '0', 'OVERDUES_SLI Link Here
181
INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type)
181
INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type)
182
VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password recovery','<html>\r\n<p>This email has been sent in response to your password recovery request for the account <strong><<user>></strong>.\r\n</p>\r\n<p>\r\nYou can now create your new password using the following link:\r\n<br/><a href=\"<<passwordreseturl>>\"><<passwordreseturl>></a>\r\n</p>\r\n<p>This link will be valid for 2 days from this email\'s reception, then you must reapply if you do not change your password.</p>\r\n<p>Thank you.</p>\r\n</html>\r\n','email'
182
VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password recovery','<html>\r\n<p>This email has been sent in response to your password recovery request for the account <strong><<user>></strong>.\r\n</p>\r\n<p>\r\nYou can now create your new password using the following link:\r\n<br/><a href=\"<<passwordreseturl>>\"><<passwordreseturl>></a>\r\n</p>\r\n<p>This link will be valid for 2 days from this email\'s reception, then you must reapply if you do not change your password.</p>\r\n<p>Thank you.</p>\r\n</html>\r\n','email'
183
);
183
);
184
INSERT INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type)
185
    VALUES ( 'reserves', 'HOLD_CHANGED', '', 'Canceled Hold Available for Different Patron', '0', 'Canceled Hold Available for Different Patron', 'The patron picking up <<biblio.title>> (<<items.barcode>>) has changed to <<borrowers.firstname>> <<borrowers.surname>> (<<borrowers.cardnumber>>).
186
187
Please update the hold information for this item.
188
189
Title: <<biblio.title>>
190
Author: <<biblio.author>>
191
Copy: <<items.copynumber>>
192
Pickup location: <<branches.branchname>>', 'email');
(-)a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql (+9 lines)
Lines 159-161 VALUES ( 'circulation', 'OVERDUES_SLIP', '', 'Overdues Slip', '0', 'OVERDUES_SLI Link Here
159
INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type)
159
INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type)
160
VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password recovery','<html>\r\n<p>This email has been sent in response to your password recovery request for the account <strong><<user>></strong>.\r\n</p>\r\n<p>\r\nYou can now create your new password using the following link:\r\n<br/><a href=\"<<passwordreseturl>>\"><<passwordreseturl>></a>\r\n</p>\r\n<p>This link will be valid for 2 days from this email\'s reception, then you must reapply if you do not change your password.</p>\r\n<p>Thank you.</p>\r\n</html>\r\n','email'
160
VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password recovery','<html>\r\n<p>This email has been sent in response to your password recovery request for the account <strong><<user>></strong>.\r\n</p>\r\n<p>\r\nYou can now create your new password using the following link:\r\n<br/><a href=\"<<passwordreseturl>>\"><<passwordreseturl>></a>\r\n</p>\r\n<p>This link will be valid for 2 days from this email\'s reception, then you must reapply if you do not change your password.</p>\r\n<p>Thank you.</p>\r\n</html>\r\n','email'
161
);
161
);
162
INSERT INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type)
163
VALUES ( 'reserves', 'HOLD_CHANGED', '', 'Canceled Hold Available for Different Patron', '0', 'Canceled Hold Available for Different Patron', 'The patron picking up <<biblio.title>> (<<items.barcode>>) has changed to <<borrowers.firstname>> <<borrowers.surname>> (<<borrowers.cardnumber>>).
164
165
Please update the hold information for this item.
166
167
Title: <<biblio.title>>
168
Author: <<biblio.author>>
169
Copy: <<items.copynumber>>
170
Pickup location: <<branches.branchname>>', 'email');
(-)a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql (+9 lines)
Lines 161-163 VALUES ( 'circulation', 'OVERDUES_SLIP', '', 'Overdues Slip', '0', 'OVERDUES_SLI Link Here
161
INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type)
161
INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type)
162
VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password recovery','<html>\r\n<p>This email has been sent in response to your password recovery request for the account <strong><<user>></strong>.\r\n</p>\r\n<p>\r\nYou can now create your new password using the following link:\r\n<br/><a href=\"<<passwordreseturl>>\"><<passwordreseturl>></a>\r\n</p>\r\n<p>This link will be valid for 2 days from this email\'s reception, then you must reapply if you do not change your password.</p>\r\n<p>Thank you.</p>\r\n</html>\r\n','email'
162
VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password recovery','<html>\r\n<p>This email has been sent in response to your password recovery request for the account <strong><<user>></strong>.\r\n</p>\r\n<p>\r\nYou can now create your new password using the following link:\r\n<br/><a href=\"<<passwordreseturl>>\"><<passwordreseturl>></a>\r\n</p>\r\n<p>This link will be valid for 2 days from this email\'s reception, then you must reapply if you do not change your password.</p>\r\n<p>Thank you.</p>\r\n</html>\r\n','email'
163
);
163
);
164
INSERT INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type)
165
VALUES ( 'reserves', 'HOLD_CHANGED', '', 'Canceled Hold Available for Different Patron', '0', 'Canceled Hold Available for Different Patron', 'The patron picking up <<biblio.title>> (<<items.barcode>>) has changed to <<borrowers.firstname>> <<borrowers.surname>> (<<borrowers.cardnumber>>).
166
167
Please update the hold information for this item.
168
169
Title: <<biblio.title>>
170
Author: <<biblio.author>>
171
Copy: <<items.copynumber>>
172
Pickup location: <<branches.branchname>>', 'email');
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 140-145 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
140
('EnhancedMessagingPreferences','0','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
140
('EnhancedMessagingPreferences','0','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
141
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
141
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
142
('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'),
142
('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'),
143
('ExpireReservesAutoFill','0',NULL,'Automatically fill the next hold with a automatically canceled expired waiting hold.','YesNo'),
144
('ExpireReservesAutoFillEmail','', NULL,'If ExpireReservesAutoFill and an email is defined here, the email notification for the change in the hold will be sent to this address.','Free'),
143
('ExpireReservesMaxPickUpDelay','0','','Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay','YesNo'),
145
('ExpireReservesMaxPickUpDelay','0','','Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay','YesNo'),
144
('ExpireReservesMaxPickUpDelayCharge','0',NULL,'If ExpireReservesMaxPickUpDelay is enabled, and this field has a non-zero value, than a borrower whose waiting hold has expired will be charged this amount.','free'),
146
('ExpireReservesMaxPickUpDelayCharge','0',NULL,'If ExpireReservesMaxPickUpDelay is enabled, and this field has a non-zero value, than a borrower whose waiting hold has expired will be charged this amount.','free'),
145
('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo'),
147
('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo'),
(-)a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql (+9 lines)
Lines 160-162 VALUES ( 'circulation', 'OVERDUES_SLIP', '', 'Overdues Slip', '0', 'OVERDUES_SLI Link Here
160
INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type)
160
INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type)
161
VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password recovery','<html>\r\n<p>This email has been sent in response to your password recovery request for the account <strong><<user>></strong>.\r\n</p>\r\n<p>\r\nYou can now create your new password using the following link:\r\n<br/><a href=\"<<passwordreseturl>>\"><<passwordreseturl>></a>\r\n</p>\r\n<p>This link will be valid for 2 days from this email\'s reception, then you must reapply if you do not change your password.</p>\r\n<p>Thank you.</p>\r\n</html>\r\n','email'
161
VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password recovery','<html>\r\n<p>This email has been sent in response to your password recovery request for the account <strong><<user>></strong>.\r\n</p>\r\n<p>\r\nYou can now create your new password using the following link:\r\n<br/><a href=\"<<passwordreseturl>>\"><<passwordreseturl>></a>\r\n</p>\r\n<p>This link will be valid for 2 days from this email\'s reception, then you must reapply if you do not change your password.</p>\r\n<p>Thank you.</p>\r\n</html>\r\n','email'
162
);
162
);
163
INSERT INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type)
164
VALUES ( 'reserves', 'HOLD_CHANGED', '', 'Canceled Hold Available for Different Patron', '0', 'Canceled Hold Available for Different Patron', 'The patron picking up <<biblio.title>> (<<items.barcode>>) has changed to <<borrowers.firstname>> <<borrowers.surname>> (<<borrowers.cardnumber>>).
165
166
Please update the hold information for this item.
167
168
Title: <<biblio.title>>
169
Author: <<biblio.author>>
170
Copy: <<items.copynumber>>
171
Pickup location: <<branches.branchname>>', 'email');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+10 lines)
Lines 508-513 Circulation: Link Here
508
                  no: "Don't allow"
508
                  no: "Don't allow"
509
            - "holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay"
509
            - "holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay"
510
        -
510
        -
511
            - pref: ExpireReservesAutoFill
512
              choices:
513
                  yes: "Do"
514
                  no: "Don't"
515
            - automatically fill the next hold using the item. If enabled, an email notification will be sent to either the email address defined in ExpireReservesAutoFillEmail, the item's holding library's email address, or the email address defined in KohaAdminEmailAddress in that order.
516
        -
517
            - Send email notification of the new hold filled with a canceled item to
518
            - pref: ExpireReservesAutoFillEmail
519
            - . If no address is defined here, the email will be sent to either the item's holding library or the email address defined in KohaAdminEmailAddress in that order.
520
        -
511
            - If using ExpireReservesMaxPickUpDelay, charge a borrower who allows his or her waiting hold to expire a fee of
521
            - If using ExpireReservesMaxPickUpDelay, charge a borrower who allows his or her waiting hold to expire a fee of
512
            - pref: ExpireReservesMaxPickUpDelayCharge
522
            - pref: ExpireReservesMaxPickUpDelayCharge
513
              class: currency
523
              class: currency
(-)a/t/db_dependent/Holds/RevertWaitingStatus.t (-1 / +1 lines)
Lines 81-87 foreach my $borrowernumber (@borrowernumbers) { Link Here
81
    );
81
    );
82
}
82
}
83
83
84
ModReserveAffect( $itemnumber, $borrowernumbers[0] );
84
ModReserveAffect( { itemnumber => $itemnumber, borrowernumber => $borrowernumbers[0] } );
85
C4::Circulation::AddIssue( GetMember( borrowernumber => $borrowernumbers[1] ),
85
C4::Circulation::AddIssue( GetMember( borrowernumber => $borrowernumbers[1] ),
86
    $item_barcode, my $datedue, my $cancelreserve = 'revert' );
86
    $item_barcode, my $datedue, my $cancelreserve = 'revert' );
87
87
(-)a/t/db_dependent/Reserves.t (-8 / +7 lines)
Lines 239-245 AddReserve('FPL', $requesters{'FPL'}, $bibnum2, Link Here
239
AddReserve('CPL',  $requesters{'CPL'}, $bibnum2,
239
AddReserve('CPL',  $requesters{'CPL'}, $bibnum2,
240
           $bibitems,  3, $resdate, $expdate, $notes,
240
           $bibitems,  3, $resdate, $expdate, $notes,
241
           $title,      $checkitem, $found);
241
           $title,      $checkitem, $found);
242
ModReserveAffect($itemnum_cpl, $requesters{'RPL'}, 0);
242
ModReserveAffect( { itemnumber => $itemnum_cpl, borrowernumber => $requesters{'RPL'}, is_transfer => 0 } );
243
243
244
# Now it should have different priorities.
244
# Now it should have different priorities.
245
my $title_reserves = GetReservesFromBiblionumber({biblionumber => $bibnum2});
245
my $title_reserves = GetReservesFromBiblionumber({biblionumber => $bibnum2});
Lines 359-370 is(exists $messages->{ResFound}?1:0, 1, 'AddReturn considers future reserve with Link Here
359
359
360
# test marking a hold as captured
360
# test marking a hold as captured
361
my $hold_notice_count = count_hold_print_messages();
361
my $hold_notice_count = count_hold_print_messages();
362
ModReserveAffect($itemnumber, $requesters{'CPL'}, 0);
362
ModReserveAffect( { itemnumber => $itemnumber, borrowernumber => $requesters{'CPL'}, is_transfer => 0 } );
363
my $new_count = count_hold_print_messages();
363
my $new_count = count_hold_print_messages();
364
is($new_count, $hold_notice_count + 1, 'patron notified when item set to waiting');
364
is($new_count, $hold_notice_count + 1, 'patron notified when item set to waiting');
365
365
366
# test that duplicate notices aren't generated
366
# test that duplicate notices aren't generated
367
ModReserveAffect($itemnumber, $requesters{'CPL'}, 0);
367
ModReserveAffect( { itemnumber => $itemnumber, borrowernumber => $requesters{'CPL'}, is_transfer => 0 } );
368
$new_count = count_hold_print_messages();
368
$new_count = count_hold_print_messages();
369
is($new_count, $hold_notice_count + 1, 'patron not notified a second time (bug 11445)');
369
is($new_count, $hold_notice_count + 1, 'patron not notified a second time (bug 11445)');
370
370
Lines 400-406 AddReserve('CPL', $requesters{'CPL'}, $bibnum, Link Here
400
@results= GetReservesFromItemnumber($itemnumber);
400
@results= GetReservesFromItemnumber($itemnumber);
401
is(defined $results[3]?1:0, 0, 'GetReservesFromItemnumber does not return a future item level hold');
401
is(defined $results[3]?1:0, 0, 'GetReservesFromItemnumber does not return a future item level hold');
402
# 9788c: GetReservesFromItemnumber returns future wait (confirmed future hold)
402
# 9788c: GetReservesFromItemnumber returns future wait (confirmed future hold)
403
ModReserveAffect( $itemnumber,  $requesters{'CPL'} , 0); #confirm hold
403
ModReserveAffect( { itemnumber => $itemnumber, borrowernumber => $requesters{'CPL'}, is_transfer => 0 } ); #confirm hold
404
@results= GetReservesFromItemnumber($itemnumber);
404
@results= GetReservesFromItemnumber($itemnumber);
405
is(defined $results[3]?1:0, 1, 'GetReservesFromItemnumber returns a future wait (confirmed future hold)');
405
is(defined $results[3]?1:0, 1, 'GetReservesFromItemnumber returns a future wait (confirmed future hold)');
406
# End of tests for bug 9788
406
# End of tests for bug 9788
Lines 425-431 AddReserve('CPL', $requesters{'CPL'}, $bibnum, Link Here
425
           $title,      $itemnumber, $found);
425
           $title,      $itemnumber, $found);
426
$p = C4::Reserves::CalculatePriority($bibnum);
426
$p = C4::Reserves::CalculatePriority($bibnum);
427
is($p, 2, 'CalculatePriority should now return priority 2');
427
is($p, 2, 'CalculatePriority should now return priority 2');
428
ModReserveAffect( $itemnumber,  $requesters{'CPL'} , 0);
428
ModReserveAffect( { itemnumber => $itemnumber, borrowernumber => $requesters{'CPL'}, is_transfer => 0 } );
429
$p = C4::Reserves::CalculatePriority($bibnum);
429
$p = C4::Reserves::CalculatePriority($bibnum);
430
is($p, 1, 'CalculatePriority should now return priority 1');
430
is($p, 1, 'CalculatePriority should now return priority 1');
431
#add another biblio hold, no resdate
431
#add another biblio hold, no resdate
Lines 483-489 is($cancancel, 1, 'Can user cancel its own reserve'); Link Here
483
$cancancel = CanReserveBeCanceledFromOpac($canres->{reserve_id}, $requesters{'FPL'});
483
$cancancel = CanReserveBeCanceledFromOpac($canres->{reserve_id}, $requesters{'FPL'});
484
is($cancancel, 0, 'Other user cant cancel reserve');
484
is($cancancel, 0, 'Other user cant cancel reserve');
485
485
486
ModReserveAffect($itemnumber, $requesters{'CPL'}, 1);
486
ModReserveAffect( { itemnumber => $itemnumber, borrowernumber => $requesters{'CPL'}, is_transfer => 1 } );
487
$cancancel = CanReserveBeCanceledFromOpac($canres->{reserve_id}, $requesters{'CPL'});
487
$cancancel = CanReserveBeCanceledFromOpac($canres->{reserve_id}, $requesters{'CPL'});
488
is($cancancel, 0, 'Reserve in transfer status cant be canceled');
488
is($cancancel, 0, 'Reserve in transfer status cant be canceled');
489
489
Lines 493-499 AddReserve('CPL', $requesters{'CPL'}, $item_bibnum, Link Here
493
           $title,      $checkitem, '');
493
           $title,      $checkitem, '');
494
(undef, $canres, undef) = CheckReserves($itemnumber);
494
(undef, $canres, undef) = CheckReserves($itemnumber);
495
495
496
ModReserveAffect($itemnumber, $requesters{'CPL'}, 0);
496
ModReserveAffect( { itemnumber => $itemnumber, borrowernumber => $requesters{'CPL'}, is_transfer => 0 } );
497
$cancancel = CanReserveBeCanceledFromOpac($canres->{reserve_id}, $requesters{'CPL'});
497
$cancancel = CanReserveBeCanceledFromOpac($canres->{reserve_id}, $requesters{'CPL'});
498
is($cancancel, 0, 'Reserve in waiting status cant be canceled');
498
is($cancancel, 0, 'Reserve in waiting status cant be canceled');
499
499
500
- 

Return to bug 14364