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

(-)a/C4/Reserves.pm (+7 lines)
Lines 504-509 sub CanItemBeReserved{ Link Here
504
    my $biblioData = C4::Biblio::GetBiblioData( $item->{biblionumber} );
504
    my $biblioData = C4::Biblio::GetBiblioData( $item->{biblionumber} );
505
    my $borrower = C4::Members::GetMember('borrowernumber'=>$borrowernumber);
505
    my $borrower = C4::Members::GetMember('borrowernumber'=>$borrowernumber);
506
506
507
    if ((my $PreventHolds = C4::Context->preference('PreventItemHoldsFieldvalues'))) {
508
        foreach my $part (split(/\|/, $PreventHolds)) {
509
            my ($field, $val) = split(/=/, $part);
510
            return 0 if (defined $item->{$field} && $item->{$field} eq $val);
511
        }
512
    }
513
507
    # If an item is damaged and we don't allow holds on damaged items, we can stop right here
514
    # If an item is damaged and we don't allow holds on damaged items, we can stop right here
508
    return 'damaged' if ( $item->{damaged} && !C4::Context->preference('AllowHoldsOnDamagedItems') );
515
    return 'damaged' if ( $item->{damaged} && !C4::Context->preference('AllowHoldsOnDamagedItems') );
509
516
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 338-343 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
338
('PatronsPerPage','20','20','Number of Patrons Per Page displayed by default','Integer'),
338
('PatronsPerPage','20','20','Number of Patrons Per Page displayed by default','Integer'),
339
('Persona','0','','Use Mozilla Persona for login','YesNo'),
339
('Persona','0','','Use Mozilla Persona for login','YesNo'),
340
('PrefillItem','0','','When a new item is added, should it be prefilled with last created item values?','YesNo'),
340
('PrefillItem','0','','When a new item is added, should it be prefilled with last created item values?','YesNo'),
341
('PreventItemHoldsFieldvalues', '', NULL, 'This is a pipe-delimited list of \"fieldname=value\", where fieldname is one of the fields from items -table in the database. If the field has the exact value, the item cannot be reserved. For example, \"ccode=PILA|location=OHE\" would prevent reserving the item if it\'s collection code is \'PILA\' or if it\'s location is \'OHE\'.', 'free')
341
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
342
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
342
('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'),
343
('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'),
343
('PrintNoticesMaxLines','0','','If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.','Integer'),
344
('PrintNoticesMaxLines','0','','If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.','Integer'),
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 9971-9976 if ( CheckVersion($DBversion) ) { Link Here
9971
    SetVersion($DBversion);
9971
    SetVersion($DBversion);
9972
}
9972
}
9973
9973
9974
$DBversion = "3.19.00.XXX";
9975
if (CheckVersion($DBversion)) {
9976
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('PreventItemHoldsFieldvalues', '', NULL, 'This is a pipe-delimited list of \"fieldname=value\", where fieldname is one of the fields from items -table in the database. If the field has the exact value, the item cannot be reserved. For example, \"ccode=PILA|location=OHE\" would prevent reserving the item if it''s collection code is ''PILA'' or if it''s location is ''OHE''.', 'free');");
9977
    print "Upgrade to $DBversion done (Bug 12354 - Prevent reserving items based on item field values)\n";
9978
    SetVersion($DBversion);
9979
}
9980
9974
9981
9975
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
9982
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
9976
# SEE bug 13068
9983
# SEE bug 13068
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +5 lines)
Lines 387-392 OPAC: Link Here
387
                  no: "Don't allow"
387
                  no: "Don't allow"
388
            - patrons to access a list of the most checked out items on the OPAC. Note that this is somewhat experimental, and should be avoided if your collection has a large number of items.
388
            - patrons to access a list of the most checked out items on the OPAC. Note that this is somewhat experimental, and should be avoided if your collection has a large number of items.
389
        -
389
        -
390
            - Prevent reserving items with the following field values:
391
            - pref: PreventItemHoldsFieldvalues
392
            - . This is a pipe-delimited list of "fieldname=value", where fieldname is one of the fields from items -table in the database. If the field has the exact value, the item cannot be reserved.
393
            - For example, "ccode=PILA|location=OHE" would prevent reserving the item if it's collection code is 'PILA' or if it's location is 'OHE'.
394
        -
390
            - pref: suggestion
395
            - pref: suggestion
391
              choices:
396
              choices:
392
                  yes: Allow
397
                  yes: Allow
393
- 

Return to bug 12354