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

(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 64-70 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
64
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MARCOrgCode','OSt','Define MARC Organization Code - http://www.loc.gov/marc/organizations/orgshome.html','','free');
64
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MARCOrgCode','OSt','Define MARC Organization Code - http://www.loc.gov/marc/organizations/orgshome.html','','free');
65
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MaxFine',9999,'Maximum fine a patron can have for a single late return','','Integer');
65
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MaxFine',9999,'Maximum fine a patron can have for a single late return','','Integer');
66
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxoutstanding',5,'maximum amount withstanding to be able make holds','','Integer');
66
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxoutstanding',5,'maximum amount withstanding to be able make holds','','Integer');
67
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxreserves',50,'Define maximum number of holds a patron can place','','Integer');
67
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxreserves',50,'System-wide maximum number of holds a patron can place','','Integer');
68
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxItemsInSearchResults',20,'Specify the maximum number of items to display for each result on a page of results',NULL,'free');
68
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxItemsInSearchResults',20,'Specify the maximum number of items to display for each result on a page of results',NULL,'free');
69
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('memberofinstitution',0,'If ON, patrons can be linked to institutions',NULL,'YesNo');
69
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('memberofinstitution',0,'If ON, patrons can be linked to institutions',NULL,'YesNo');
70
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('noissuescharge',5,'Define maximum amount withstanding before check outs are blocked','','Integer');
70
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('noissuescharge',5,'Define maximum amount withstanding before check outs are blocked','','Integer');
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 4994-4999 if ( C4::Context->preference("Version") lt TransformToNum($DBversion) ) { Link Here
4994
    SetVersion($DBversion);
4994
    SetVersion($DBversion);
4995
}
4995
}
4996
4996
4997
$DBversion = "3.07.00.XXX";
4998
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4999
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('maxreserves',50,'System-wide maximum number of holds a patron can place','','Integer')");
5000
    print "Upgrade to $DBversion done (Re-add system preference maxreserves)\n";
5001
    SetVersion($DBversion);
5002
}
5003
4997
=head1 FUNCTIONS
5004
=head1 FUNCTIONS
4998
5005
4999
=head2 DropAllForeignKeys($table)
5006
=head2 DropAllForeignKeys($table)
(-)a/reserve/request.pl (-11 / +9 lines)
Lines 135-148 if ($borrowernumber_hold && !$action) { Link Here
135
    my $count_reserv = 0;
135
    my $count_reserv = 0;
136
    my $maxreserves;
136
    my $maxreserves;
137
137
138
#   we check the reserves of the borrower, and if he can reserv a document
138
    # we check the reserves of the borrower, and if he can reserv a document
139
# FIXME At this time we have a simple count of reservs, but, later, we could improve the infos "title" ...
139
    # FIXME At this time we have a simple count of reservs, but, later, we could improve the infos "title" ...
140
140
141
    my $number_reserves =
141
    my $number_reserves =
142
      GetReserveCount( $borrowerinfo->{'borrowernumber'} );
142
      GetReserveCount( $borrowerinfo->{'borrowernumber'} );
143
143
144
    if ( C4::Context->preference('maxreserves') && ($number_reserves >= C4::Context->preference('maxreserves')) ) {
144
    if ( C4::Context->preference('maxreserves') && ($number_reserves >= C4::Context->preference('maxreserves')) ) {
145
		$warnings = 1;
145
	$warnings = 1;
146
        $maxreserves = 1;
146
        $maxreserves = 1;
147
    }
147
    }
148
148
Lines 150-162 if ($borrowernumber_hold && !$action) { Link Here
150
    my $expiry_date = $borrowerinfo->{dateexpiry};
150
    my $expiry_date = $borrowerinfo->{dateexpiry};
151
    my $expiry = 0; # flag set if patron account has expired
151
    my $expiry = 0; # flag set if patron account has expired
152
    if ($expiry_date and $expiry_date ne '0000-00-00' and
152
    if ($expiry_date and $expiry_date ne '0000-00-00' and
153
            Date_to_Days(split /-/,$date) > Date_to_Days(split /-/,$expiry_date)) {
153
        Date_to_Days(split /-/,$date) > Date_to_Days(split /-/,$expiry_date)) {
154
		$messages = $expiry = 1;
154
        $messages = $expiry = 1;
155
    }
155
    }
156
156
157
    # check if the borrower make the reserv in a different branch
157
    # check if the borrower make the reserv in a different branch
158
    if ( $borrowerinfo->{'branchcode'} ne C4::Context->userenv->{'branch'} ) {
158
    if ( $borrowerinfo->{'branchcode'} ne C4::Context->userenv->{'branch'} ) {
159
		$messages = 1;
159
        $messages = 1;
160
        $diffbranch = 1;
160
        $diffbranch = 1;
161
    }
161
    }
162
162
Lines 178-185 if ($borrowernumber_hold && !$action) { Link Here
178
                maxreserves         => $maxreserves,
178
                maxreserves         => $maxreserves,
179
                expiry              => $expiry,
179
                expiry              => $expiry,
180
                diffbranch          => $diffbranch,
180
                diffbranch          => $diffbranch,
181
				messages            => $messages,
181
                messages            => $messages,
182
				warnings            => $warnings
182
                warnings            => $warnings
183
    );
183
    );
184
}
184
}
185
185
Lines 460-467 foreach my $biblionumber (@biblionumbers) { Link Here
460
                $num_available++;
460
                $num_available++;
461
            }
461
            }
462
            elsif ( C4::Context->preference('AllowHoldPolicyOverride') ) {
462
            elsif ( C4::Context->preference('AllowHoldPolicyOverride') ) {
463
463
                # If AllowHoldPolicyOverride is set, it should override EVERY restriction, not just branch item rules
464
# If AllowHoldPolicyOverride is set, it should override EVERY restriction, not just branch item rules
465
                $item->{override} = 1;
464
                $item->{override} = 1;
466
                $num_override++;
465
                $num_override++;
467
            }
466
            }
468
- 

Return to bug 4045