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

(-)a/C4/Reserves.pm (-112 / +87 lines)
Lines 187-193 sub AddReserve { Link Here
187
            "Reserve Charge - $title", $fee );
187
            "Reserve Charge - $title", $fee );
188
    }
188
    }
189
189
190
    #if ($const eq 'a'){
191
    my $query = qq/
190
    my $query = qq/
192
        INSERT INTO reserves
191
        INSERT INTO reserves
193
            (borrowernumber,biblionumber,reservedate,branchcode,constrainttype,
192
            (borrowernumber,biblionumber,reservedate,branchcode,constrainttype,
Lines 232-250 sub AddReserve { Link Here
232
        }
231
        }
233
    }
232
    }
234
233
235
    #}
236
    ($const eq "o" || $const eq "e") or return;   # FIXME: why not have a useful return value?
237
    $query = qq/
238
        INSERT INTO reserveconstraints
239
            (borrowernumber,biblionumber,reservedate,biblioitemnumber)
240
        VALUES
241
            (?,?,?,?)
242
    /;
243
    $sth = $dbh->prepare($query);    # keep prepare outside the loop!
244
    foreach (@$bibitems) {
245
        $sth->execute($borrowernumber, $biblionumber, $resdate, $_);
246
    }
247
        
248
    return;     # FIXME: why not have a useful return value?
234
    return;     # FIXME: why not have a useful return value?
249
}
235
}
250
236
Lines 325-372 sub GetReservesFromBiblionumber { Link Here
325
    $query .= "ORDER BY priority";
311
    $query .= "ORDER BY priority";
326
    my $sth = $dbh->prepare($query);
312
    my $sth = $dbh->prepare($query);
327
    $sth->execute( @params );
313
    $sth->execute( @params );
328
    my @results;
314
    my $results = $sth->fetchall_arrayref({});
329
    my $i = 0;
315
    return $results;
330
    while ( my $data = $sth->fetchrow_hashref ) {
331
332
        # FIXME - What is this doing? How do constraints work?
333
        if ($data->{constrainttype} eq 'o') {
334
            $query = '
335
                SELECT biblioitemnumber
336
                FROM  reserveconstraints
337
                WHERE  biblionumber   = ?
338
                AND   borrowernumber = ?
339
                AND   reservedate    = ?
340
            ';
341
            my $csth = $dbh->prepare($query);
342
            $csth->execute($data->{biblionumber}, $data->{borrowernumber}, $data->{reservedate});
343
            my @bibitemno;
344
            while ( my $bibitemnos = $csth->fetchrow_array ) {
345
                push( @bibitemno, $bibitemnos );    # FIXME: inefficient: use fetchall_arrayref
346
            }
347
            my $count = scalar @bibitemno;
348
    
349
            # if we have two or more different specific itemtypes
350
            # reserved by same person on same day
351
            my $bdata;
352
            if ( $count > 1 ) {
353
                $bdata = GetBiblioItemData( $bibitemno[$i] );   # FIXME: This doesn't make sense.
354
                $i++; #  $i can increase each pass, but the next @bibitemno might be smaller?
355
            }
356
            else {
357
                # Look up the book we just found.
358
                $bdata = GetBiblioItemData( $bibitemno[0] );
359
            }
360
            # Add the results of this latest search to the current
361
            # results.
362
            # FIXME - An 'each' would probably be more efficient.
363
            foreach my $key ( keys %$bdata ) {
364
                $data->{$key} = $bdata->{$key};
365
            }
366
        }
367
        push @results, $data;
368
    }
369
    return \@results;
370
}
316
}
371
317
372
=head2 GetReservesFromItemnumber
318
=head2 GetReservesFromItemnumber
Lines 1161-1205 sub ModReserveFill { Link Here
1161
    my $borrowernumber    = $res->{'borrowernumber'};
1107
    my $borrowernumber    = $res->{'borrowernumber'};
1162
    my $resdate = $res->{'reservedate'};
1108
    my $resdate = $res->{'reservedate'};
1163
1109
1110
    $reserve_id = GetReserveId({biblionumber   => $biblionumber,
1111
			        borrowernumber => $borrowernumber,
1112
			        reservedate    => $resdate}) if (!$reserve_id);
1113
    return if (!$reserve_id);
1114
1164
    # get the priority on this record....
1115
    # get the priority on this record....
1165
    my $priority;
1116
    my $priority;
1166
    my $query = "SELECT priority
1117
    my $query = "SELECT priority
1167
                 FROM   reserves
1118
                 FROM   reserves
1168
                 WHERE  biblionumber   = ?
1119
                 WHERE  reserve_id = ?";
1169
                  AND   borrowernumber = ?
1170
                  AND   reservedate    = ?";
1171
    my $sth = $dbh->prepare($query);
1120
    my $sth = $dbh->prepare($query);
1172
    $sth->execute( $biblionumber, $borrowernumber, $resdate );
1121
    $sth->execute( $reserve_id );
1173
    ($priority) = $sth->fetchrow_array;
1122
    ($priority) = $sth->fetchrow_array;
1174
1123
1175
    # update the database...
1124
    # update the database...
1176
    $query = "UPDATE reserves
1125
    $query = "UPDATE reserves
1177
                  SET    found            = 'F',
1126
                  SET    found            = 'F',
1178
                         priority         = 0
1127
                         priority         = 0
1179
                 WHERE  biblionumber     = ?
1128
                 WHERE  reserve_id        = ?";
1180
                    AND reservedate      = ?
1181
                    AND borrowernumber   = ?
1182
                ";
1183
    $sth = $dbh->prepare($query);
1129
    $sth = $dbh->prepare($query);
1184
    $sth->execute( $biblionumber, $resdate, $borrowernumber );
1130
    $sth->execute( $reserve_id );
1185
1131
1186
    # move to old_reserves
1132
    # move to old_reserves
1187
    $query = "INSERT INTO old_reserves
1133
    $query = "INSERT INTO old_reserves
1188
                 SELECT * FROM reserves
1134
                 SELECT * FROM reserves
1189
                 WHERE  biblionumber     = ?
1135
                 WHERE  reserve_id  = ?";
1190
                    AND reservedate      = ?
1191
                    AND borrowernumber   = ?
1192
                ";
1193
    $sth = $dbh->prepare($query);
1136
    $sth = $dbh->prepare($query);
1194
    $sth->execute( $biblionumber, $resdate, $borrowernumber );
1137
    $sth->execute( $reserve_id );
1195
    $query = "DELETE FROM reserves
1138
    $query = "DELETE FROM reserves
1196
                 WHERE  biblionumber     = ?
1139
                 WHERE  reserve_id = ?";
1197
                    AND reservedate      = ?
1198
                    AND borrowernumber   = ?
1199
                ";
1200
    $sth = $dbh->prepare($query);
1140
    $sth = $dbh->prepare($query);
1201
    $sth->execute( $biblionumber, $resdate, $borrowernumber );
1141
    $sth->execute( $reserve_id );
1202
    
1142
1203
    # now fix the priority on the others (if the priority wasn't
1143
    # now fix the priority on the others (if the priority wasn't
1204
    # already sorted!)....
1144
    # already sorted!)....
1205
    unless ( $priority == 0 ) {
1145
    unless ( $priority == 0 ) {
Lines 1259-1273 sub ModReserveAffect { Link Here
1259
    $sth->execute($itemnumber);
1199
    $sth->execute($itemnumber);
1260
    my ($biblionumber) = $sth->fetchrow;
1200
    my ($biblionumber) = $sth->fetchrow;
1261
1201
1262
    # get request - need to find out if item is already
1202
    my $reserve_id = GetReserveNextEligible({
1263
    # waiting in order to not send duplicate hold filled notifications
1203
	    borrowernumber => $borrowernumber,
1264
    my $reserve_id = GetReserveId({
1204
	    biblionumber   => $biblionumber,
1265
        borrowernumber => $borrowernumber,
1205
	    itemnumber     => $itemnumber
1266
        biblionumber   => $biblionumber,
1206
					    });
1267
    });
1207
1268
    return unless defined $reserve_id;
1208
    return unless defined $reserve_id;
1269
    my $request = GetReserveInfo($reserve_id);
1209
    my $request = GetReserveInfo($reserve_id);
1270
    my $already_on_shelf = ($request && $request->{found} eq 'W') ? 1 : 0;
1271
1210
1272
    # If we affect a reserve that has to be transfered, don't set to Waiting
1211
    # If we affect a reserve that has to be transfered, don't set to Waiting
1273
    my $query;
1212
    my $query;
Lines 1277-1284 sub ModReserveAffect { Link Here
1277
        SET    priority = 0,
1216
        SET    priority = 0,
1278
               itemnumber = ?,
1217
               itemnumber = ?,
1279
               found = 'T'
1218
               found = 'T'
1280
        WHERE borrowernumber = ?
1219
        WHERE reserve_id = ?
1281
          AND biblionumber = ?
1282
    ";
1220
    ";
1283
    }
1221
    }
1284
    else {
1222
    else {
Lines 1289-1301 sub ModReserveAffect { Link Here
1289
                    found = 'W',
1227
                    found = 'W',
1290
                    waitingdate = NOW(),
1228
                    waitingdate = NOW(),
1291
                    itemnumber = ?
1229
                    itemnumber = ?
1292
            WHERE borrowernumber = ?
1230
            WHERE reserve_id = ?
1293
              AND biblionumber = ?
1294
        ";
1231
        ";
1295
    }
1232
    }
1296
    $sth = $dbh->prepare($query);
1233
    $sth = $dbh->prepare($query);
1297
    $sth->execute( $itemnumber, $borrowernumber,$biblionumber);
1234
    $sth->execute( $itemnumber, $reserve_id );
1298
    _koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber ) if ( !$transferToDo && !$already_on_shelf );
1235
    _koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber, $reserve_id ) if ( !$transferToDo );
1236
1237
    if ( $request && $request->{priority} != 0 ) {
1238
        _FixPriority({ reserve_id => $reserve_id });
1239
    }
1299
1240
1300
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
1241
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
1301
      CartToShelf( $itemnumber );
1242
      CartToShelf( $itemnumber );
Lines 1515-1521 sub AlterPriority { Link Here
1515
1456
1516
=head2 ToggleLowestPriority
1457
=head2 ToggleLowestPriority
1517
1458
1518
  ToggleLowestPriority( $borrowernumber, $biblionumber );
1459
  ToggleLowestPriority( $reserve_id );
1519
1460
1520
This function sets the lowestPriority field to true if is false, and false if it is true.
1461
This function sets the lowestPriority field to true if is false, and false if it is true.
1521
1462
Lines 1819-1825 sub _Findgroupreserve { Link Here
1819
               reserves.priority            AS priority,
1760
               reserves.priority            AS priority,
1820
               reserves.timestamp           AS timestamp,
1761
               reserves.timestamp           AS timestamp,
1821
               biblioitems.biblioitemnumber AS biblioitemnumber,
1762
               biblioitems.biblioitemnumber AS biblioitemnumber,
1822
               reserves.itemnumber          AS itemnumber
1763
               reserves.itemnumber          AS itemnumber,
1764
               reserves.reserve_id          AS reserve_id
1823
        FROM reserves
1765
        FROM reserves
1824
        JOIN biblioitems USING (biblionumber)
1766
        JOIN biblioitems USING (biblionumber)
1825
        JOIN hold_fill_targets USING (biblionumber, borrowernumber)
1767
        JOIN hold_fill_targets USING (biblionumber, borrowernumber)
Lines 1849-1869 sub _Findgroupreserve { Link Here
1849
               reserves.reservenotes               AS reservenotes,
1791
               reserves.reservenotes               AS reservenotes,
1850
               reserves.priority                   AS priority,
1792
               reserves.priority                   AS priority,
1851
               reserves.timestamp                  AS timestamp,
1793
               reserves.timestamp                  AS timestamp,
1852
               reserveconstraints.biblioitemnumber AS biblioitemnumber,
1794
               biblioitems.biblioitemnumber        AS biblioitemnumber,
1853
               reserves.itemnumber                 AS itemnumber
1795
               reserves.itemnumber                 AS itemnumber
1854
        FROM reserves
1796
        FROM reserves
1855
          LEFT JOIN reserveconstraints ON reserves.biblionumber = reserveconstraints.biblionumber
1797
        JOIN biblioitems USING (biblionumber)
1856
        WHERE reserves.biblionumber = ?
1798
        WHERE reserves.biblionumber = ?
1857
          AND ( ( reserveconstraints.biblioitemnumber = ?
1799
          AND (reserves.constrainttype='a')
1858
          AND reserves.borrowernumber = reserveconstraints.borrowernumber
1859
          AND reserves.reservedate    = reserveconstraints.reservedate )
1860
          OR  reserves.constrainttype='a' )
1861
          AND (reserves.itemnumber IS NULL OR reserves.itemnumber = ?)
1800
          AND (reserves.itemnumber IS NULL OR reserves.itemnumber = ?)
1862
          AND reserves.reservedate <= DATE_ADD(NOW(),INTERVAL ? DAY)
1801
          AND reserves.reservedate <= DATE_ADD(NOW(),INTERVAL ? DAY)
1863
          AND suspend = 0
1802
          AND suspend = 0
1864
    /;
1803
    /;
1865
    $sth = $dbh->prepare($query);
1804
    $sth = $dbh->prepare($query);
1866
    $sth->execute( $biblio, $bibitem, $itemnumber, $lookahead||0);
1805
    $sth->execute( $biblio, $itemnumber, $lookahead||0);
1867
    @results = ();
1806
    @results = ();
1868
    while ( my $data = $sth->fetchrow_hashref ) {
1807
    while ( my $data = $sth->fetchrow_hashref ) {
1869
        push( @results, $data );
1808
        push( @results, $data );
Lines 1873-1879 sub _Findgroupreserve { Link Here
1873
1812
1874
=head2 _koha_notify_reserve
1813
=head2 _koha_notify_reserve
1875
1814
1876
  _koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber );
1815
  _koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber, $reserve_id );
1877
1816
1878
Sends a notification to the patron that their hold has been filled (through
1817
Sends a notification to the patron that their hold has been filled (through
1879
ModReserveAffect, _not_ ModReserveFill)
1818
ModReserveAffect, _not_ ModReserveFill)
Lines 1881-1887 ModReserveAffect, _not_ ModReserveFill) Link Here
1881
=cut
1820
=cut
1882
1821
1883
sub _koha_notify_reserve {
1822
sub _koha_notify_reserve {
1884
    my ($itemnumber, $borrowernumber, $biblionumber) = @_;
1823
    my ($itemnumber, $borrowernumber, $biblionumber, $reserve_id) = @_;
1885
1824
1886
    my $dbh = C4::Context->dbh;
1825
    my $dbh = C4::Context->dbh;
1887
    my $borrower = C4::Members::GetMember(borrowernumber => $borrowernumber);
1826
    my $borrower = C4::Members::GetMember(borrowernumber => $borrowernumber);
Lines 1903-1910 sub _koha_notify_reserve { Link Here
1903
        FROM   reserves
1842
        FROM   reserves
1904
        WHERE  borrowernumber = ?
1843
        WHERE  borrowernumber = ?
1905
            AND biblionumber = ?
1844
            AND biblionumber = ?
1845
            AND reserve_id = ?
1906
    ");
1846
    ");
1907
    $sth->execute( $borrowernumber, $biblionumber );
1847
    $sth->execute( $borrowernumber, $biblionumber, $reserve_id );
1908
    my $reserve = $sth->fetchrow_hashref;
1848
    my $reserve = $sth->fetchrow_hashref;
1909
    my $branch_details = GetBranchDetail( $reserve->{'branchcode'} );
1849
    my $branch_details = GetBranchDetail( $reserve->{'branchcode'} );
1910
1850
Lines 1995-2012 sub _ShiftPriorityByDateAndPriority { Link Here
1995
    # Shift the priority up by one; works in conjunction with the next SQL statement
1935
    # Shift the priority up by one; works in conjunction with the next SQL statement
1996
    $query = "UPDATE reserves
1936
    $query = "UPDATE reserves
1997
              SET priority = priority+1
1937
              SET priority = priority+1
1998
              WHERE biblionumber = ?
1938
              WHERE reserve_id = ?
1999
              AND borrowernumber = ?
2000
              AND reservedate = ?
2001
              AND found IS NULL";
1939
              AND found IS NULL";
2002
    my $sth_update = $dbh->prepare( $query );
1940
    my $sth_update = $dbh->prepare( $query );
2003
1941
2004
    # Select all reserves for the biblio with priority greater than $new_priority, and order greatest to least
1942
    # Select all reserves for the biblio with priority greater than $new_priority, and order greatest to least
2005
    $query = "SELECT borrowernumber, reservedate FROM reserves WHERE priority >= ? AND biblionumber = ? ORDER BY priority DESC";
1943
    $query = "SELECT reserve_id FROM reserves WHERE priority >= ? AND biblionumber = ? ORDER BY priority DESC";
2006
    $sth = $dbh->prepare( $query );
1944
    $sth = $dbh->prepare( $query );
2007
    $sth->execute( $new_priority, $biblio );
1945
    $sth->execute( $new_priority, $biblio );
2008
    while ( my $row = $sth->fetchrow_hashref ) {
1946
    while ( my $row = $sth->fetchrow_hashref ) {
2009
	$sth_update->execute( $biblio, $row->{borrowernumber}, $row->{reservedate} );
1947
	$sth_update->execute( $row->{reserve_id} );
2010
    }
1948
    }
2011
1949
2012
    return $new_priority;  # so the caller knows what priority they wind up receiving
1950
    return $new_priority;  # so the caller knows what priority they wind up receiving
Lines 2056-2066 sub MoveReserve { Link Here
2056
            RevertWaitingStatus({ itemnumber => $itemnumber });
1994
            RevertWaitingStatus({ itemnumber => $itemnumber });
2057
        }
1995
        }
2058
        elsif ( $cancelreserve eq 'cancel' || $cancelreserve ) { # cancel reserves on this item
1996
        elsif ( $cancelreserve eq 'cancel' || $cancelreserve ) { # cancel reserves on this item
2059
            CancelReserve({
1997
            CancelReserve({ reserve_id => $res->{'reserve_id'} });
2060
                biblionumber   => $res->{'biblionumber'},
2061
                itemnumber     => $res->{'itemnumber'},
2062
                borrowernumber => $res->{'borrowernumber'}
2063
            });
2064
        }
1998
        }
2065
    }
1999
    }
2066
}
2000
}
Lines 2136-2141 sub RevertWaitingStatus { Link Here
2136
        SELECT * FROM reserves
2070
        SELECT * FROM reserves
2137
        WHERE itemnumber = ?
2071
        WHERE itemnumber = ?
2138
        AND found IS NOT NULL
2072
        AND found IS NOT NULL
2073
        ORDER BY priority
2139
    ";
2074
    ";
2140
    my $sth = $dbh->prepare( $query );
2075
    my $sth = $dbh->prepare( $query );
2141
    $sth->execute( $itemnumber );
2076
    $sth->execute( $itemnumber );
Lines 2171-2177 sub RevertWaitingStatus { Link Here
2171
2106
2172
=head2 GetReserveId
2107
=head2 GetReserveId
2173
2108
2174
  $reserve_id = GetReserveId({ biblionumber => $biblionumber, borrowernumber => $borrowernumber [, itemnumber => $itemnumber ] });
2109
  $reserve_id = GetReserveId({ biblionumber => $biblionumber, borrowernumber => $borrowernumber [, itemnumber => $itemnumber ] } );
2175
2110
2176
  Returnes the first reserve id that matches the given criteria
2111
  Returnes the first reserve id that matches the given criteria
2177
2112
Lines 2197-2202 sub GetReserveId { Link Here
2197
2132
2198
    $sql .= join( " AND ", @limits );
2133
    $sql .= join( " AND ", @limits );
2199
2134
2135
    $sql .= " ORDER BY priority";
2136
2200
    my $sth = $dbh->prepare( $sql );
2137
    my $sth = $dbh->prepare( $sql );
2201
    $sth->execute( @params );
2138
    $sth->execute( @params );
2202
    my $row = $sth->fetchrow_hashref();
2139
    my $row = $sth->fetchrow_hashref();
Lines 2204-2209 sub GetReserveId { Link Here
2204
    return $row->{'reserve_id'};
2141
    return $row->{'reserve_id'};
2205
}
2142
}
2206
2143
2144
=head2 GetReserveNextEligible
2145
2146
 GetReserveNextEligible({ biblionumber => $bibnum, borrowernumber => $bornum
2147
                       [, itemnumber => $itemnum ]
2148
                       })
2149
2150
 Returns the next eligible reserve id, or undef.
2151
2152
 If reserve is for a certain item, it is eligible only if it matches the itemnumber.
2153
 If a matching reserve is already waiting, return undef.
2154
2155
=cut
2156
2157
sub GetReserveNextEligible {
2158
    my ( $params ) = @_;
2159
2160
    return unless ( $params->{'biblionumber'} && $params->{'borrowernumber'} );
2161
2162
    my $dbh = C4::Context->dbh();
2163
2164
    my $sql = "SELECT reserve_id, found, itemnumber
2165
                 FROM reserves
2166
                WHERE biblionumber=?
2167
                  AND borrowernumber=?
2168
             ORDER BY priority";
2169
2170
    my $sth = $dbh->prepare( $sql );
2171
    $sth->execute( $params->{'biblionumber'}, $params->{'borrowernumber'} );
2172
2173
    while ( my $row = $sth->fetchrow_hashref() ) {
2174
	next if ($row->{'itemnumber'} && ($row->{'itemnumber'} ne $params->{'itemnumber'}));
2175
	return if ($row->{'found'} =~ /[WF]/); # Waiting or Found(?) are never eligible
2176
	return $row->{'reserve_id'};
2177
    }
2178
2179
    return;
2180
}
2181
2207
=head2 ReserveSlip
2182
=head2 ReserveSlip
2208
2183
2209
  ReserveSlip($branchcode, $borrowernumber, $biblionumber)
2184
  ReserveSlip($branchcode, $borrowernumber, $biblionumber)
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 18-23 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
18
('AllowHoldsOnPatronsPossessions','1',NULL,'Allow holds on records that patron have items of it','YesNo'),
18
('AllowHoldsOnPatronsPossessions','1',NULL,'Allow holds on records that patron have items of it','YesNo'),
19
('AllowItemsOnHoldCheckout','0','','Do not generate RESERVE_WAITING and RESERVED warning when checking out items reserved to someone else. This allows self checkouts for those items.','YesNo'),
19
('AllowItemsOnHoldCheckout','0','','Do not generate RESERVE_WAITING and RESERVED warning when checking out items reserved to someone else. This allows self checkouts for those items.','YesNo'),
20
('AllowMultipleCovers','0','1','Allow multiple cover images to be attached to each bibliographic record.','YesNo'),
20
('AllowMultipleCovers','0','1','Allow multiple cover images to be attached to each bibliographic record.','YesNo'),
21
('AllowMultipleHolds','0','1','Allow staff to place multiple holds for the same item or biblio for the same patron.','YesNo'),
21
('AllowNotForLoanOverride','0','','If ON, Koha will allow the librarian to loan a not for loan item.','YesNo'),
22
('AllowNotForLoanOverride','0','','If ON, Koha will allow the librarian to loan a not for loan item.','YesNo'),
22
('AllowOfflineCirculation','0','','If on, enables HTML5 offline circulation functionality.','YesNo'),
23
('AllowOfflineCirculation','0','','If on, enables HTML5 offline circulation functionality.','YesNo'),
23
('AllowOnShelfHolds','0','','Allow hold requests to be placed on items that are not on loan','YesNo'),
24
('AllowOnShelfHolds','0','','Allow hold requests to be placed on items that are not on loan','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 69-74 Circulation: Link Here
69
                  no: "Don't allow"
69
                  no: "Don't allow"
70
            - staff to delete messages added from other libraries.
70
            - staff to delete messages added from other libraries.
71
        -
71
        -
72
            - pref: AllowMultipleHolds
73
              choices:
74
                  yes: Allow
75
                  no: "Don't allow"
76
            - staff to place multiple holds for the same item or biblio for the same patron.
77
        -
72
            - Show the
78
            - Show the
73
            - pref: numReturnedItemsToShow
79
            - pref: numReturnedItemsToShow
74
              class: integer
80
              class: integer
(-)a/reserve/placerequest.pl (-15 / +1 lines)
Lines 38-48 my $input = CGI->new(); Link Here
38
checkauth($input, 0, { reserveforothers => 'place_holds' }, 'intranet');
38
checkauth($input, 0, { reserveforothers => 'place_holds' }, 'intranet');
39
39
40
my @bibitems=$input->param('biblioitem');
40
my @bibitems=$input->param('biblioitem');
41
# FIXME I think reqbib does not exist anymore, it's used in line 82, to AddReserve of contraint type 'o'
42
#       I bet it's a 2.x feature, reserving a given biblioitem, that is useless in Koha 3.0
43
#       we can remove this line, the AddReserve of constrainttype 'o',
44
#       and probably remove the reserveconstraint table as well, I never could fill anything in this table.
45
my @reqbib=$input->param('reqbib'); 
46
my $biblionumber=$input->param('biblionumber');
41
my $biblionumber=$input->param('biblionumber');
47
my $borrowernumber=$input->param('borrowernumber');
42
my $borrowernumber=$input->param('borrowernumber');
48
my $notes=$input->param('notes');
43
my $notes=$input->param('notes');
Lines 112-127 if ($type eq 'str8' && $borrower){ Link Here
112
            AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',[$biblionumber],
107
            AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',[$biblionumber],
113
                       $bibinfo->{rank},$startdate,$expirationdate,$notes,$bibinfo->{title},$checkitem,$found);
108
                       $bibinfo->{rank},$startdate,$expirationdate,$notes,$bibinfo->{title},$checkitem,$found);
114
        } else {
109
        } else {
115
            if ($input->param('request') eq 'any'){
110
	    AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem,$found);
116
                # place a request on 1st available
117
                AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem,$found);
118
            } elsif ($reqbib[0] ne ''){
119
                # FIXME : elsif probably never reached, (see top of the script)
120
                # place a request on a given item
121
                AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'o',\@reqbib,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem, $found);
122
            } else {
123
                AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem, $found);
124
            }
125
        }
111
        }
126
    }
112
    }
127
113
(-)a/reserve/request.pl (-2 / +1 lines)
Lines 213-219 foreach my $biblionumber (@biblionumbers) { Link Here
213
    }
213
    }
214
214
215
    if ( $holds_count ) {
215
    if ( $holds_count ) {
216
            $alreadyreserved = 1;
216
	    $alreadyreserved = 1 if (!C4::Context->preference('AllowMultipleHolds'));
217
            $biblioloopiter{warn} = 1;
217
            $biblioloopiter{warn} = 1;
218
            $biblioloopiter{alreadyres} = 1;
218
            $biblioloopiter{alreadyres} = 1;
219
    }
219
    }
220
- 

Return to bug 12085