Bug 9206 - Only allow place holds in records that the patron don't have in his posses...
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 14 Dec 2012 14:13:49 +0000 (09:13 -0500)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Thu, 27 Dec 2012 14:48:03 +0000 (09:48 -0500)
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
C4/Circulation.pm
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
reserve/request.pl

index 36aff3e..55b89f9 100644 (file)
@@ -83,6 +83,7 @@ BEGIN {
                &GetBiblioIssues
                &GetOpenIssue
                &AnonymiseIssueHistory
+               &CheckIfIssuedToPatron
        );
 
        # subs to deal with returns
index 07fce82..8c9aa13 100755 (executable)
@@ -6111,14 +6111,6 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
     print "Upgrade to $DBversion done (Bug 8782: Add field subscription.closed)\n";
     SetVersion($DBversion);
 }
-$DBversion = "XXX";
-if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
-    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowHoldsOnPatronsPossessions', '1', 'Allow holds on records that patron have items of it',NULL,'YesNo')"
-    print "Upgrade to $DBversion done (Bug 9206: Only allow place holds in records that the patron don't have in his possession)\n";
-    SetVersion($DBversion);
-}
-
-
 
 $DBversion = "3.11.00.005";
 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
@@ -6325,6 +6317,13 @@ if ( CheckVersion($DBversion) ) {
    SetVersion ($DBversion);
 }
 
+$DBversion = "3.11.00.XXX";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowHoldsOnPatronsPossessions', '1', 'Allow holds on records that patron have items of it',NULL,'YesNo')");
+    print "Upgrade to $DBversion done (Bug 9206: Only allow place holds in records that the patron don't have in his possession)\n";
+    SetVersion($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 TableExists($table)
index af3f565..50d808c 100644 (file)
@@ -446,7 +446,7 @@ Circulation:
               choices:
                   yes: Allow
                   no: "Don't allow"
-            - patrons to place holds on records that he already have any item of it in his possession.
+            - a patron to place a hold on a record where the patron already has one or more items attached to that record checked out.
     Fines Policy:
         -
             - Calculate fines based on days overdue
index d8c99d7..f12e0ac 100755 (executable)
@@ -247,6 +247,8 @@ foreach my $biblionumber (@biblionumbers) {
                $warnings = 1;
         $maxreserves = 1;
     }
+
+    my $alreadypossession;
     if (not C4::Context->preference('AllowHoldsOnPatronsPossessions') and CheckIfIssuedToPatron($borrowerinfo->{borrowernumber},$biblionumber)) {
         $warnings = 1;
         $alreadypossession = 1;