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

(-)a/C4/Circulation.pm (-1 / +1 lines)
Lines 1602-1608 sub AddReturn { Link Here
1602
1602
1603
    if ( $item->{'wthdrawn'} ) { # book has been cancelled
1603
    if ( $item->{'wthdrawn'} ) { # book has been cancelled
1604
        $messages->{'wthdrawn'} = 1;
1604
        $messages->{'wthdrawn'} = 1;
1605
        $doreturn = 0;
1605
        $doreturn = 0 if C4::Context->preference("BlockReturnOfWithdrawnItems");
1606
    }
1606
    }
1607
1607
1608
    # case of a return of document (deal with issues and holdingbranch)
1608
    # case of a return of document (deal with issues and holdingbranch)
(-)a/circ/returns.pl (-10 / +1 lines)
Lines 291-305 if ($barcode) { Link Here
291
        $input{duedate}   = 0;
291
        $input{duedate}   = 0;
292
        $returneditems{0} = $barcode;
292
        $returneditems{0} = $barcode;
293
        $riduedate{0}     = 0;
293
        $riduedate{0}     = 0;
294
        if ( $messages->{'wthdrawn'} ) {
295
            $input{withdrawn}      = 1;
296
            $input{borrowernumber} = 'Item Cancelled';  # FIXME: should be in display layer ?
297
            $riborrowernumber{0}   = 'Item Cancelled';
298
        }
299
        else {
300
            $input{borrowernumber} = ' ';  # This seems clearly bogus.
301
            $riborrowernumber{0}   = ' ';
302
        }
303
        push( @inputloop, \%input );
294
        push( @inputloop, \%input );
304
    }
295
    }
305
}
296
}
Lines 444-450 foreach my $code ( keys %$messages ) { Link Here
444
    }
435
    }
445
    elsif ( $code eq 'wthdrawn' ) {
436
    elsif ( $code eq 'wthdrawn' ) {
446
        $err{withdrawn} = 1;
437
        $err{withdrawn} = 1;
447
        $exit_required_p = 1;
438
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
448
    }
439
    }
449
    elsif ( ( $code eq 'IsPermanent' ) && ( not $messages->{'ResFound'} ) ) {
440
    elsif ( ( $code eq 'IsPermanent' ) && ( not $messages->{'ResFound'} ) ) {
450
        if ( $messages->{'IsPermanent'} ne $userenv_branch ) {
441
        if ( $messages->{'IsPermanent'} ne $userenv_branch ) {
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 375-377 INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( Link Here
375
INSERT INTO systempreferences (variable,value,explanation,type) VALUES('EnableBorrowerFiles','0','If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo');
375
INSERT INTO systempreferences (variable,value,explanation,type) VALUES('EnableBorrowerFiles','0','If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo');
376
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UpdateTotalIssuesOnCirc','0','Whether to update the totalissues field in the biblio on each circ.',NULL,'YesNo');
376
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UpdateTotalIssuesOnCirc','0','Whether to update the totalissues field in the biblio on each circ.',NULL,'YesNo');
377
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetSlipPrinterJS','','Use this JavaScript for printing slips. Define at least function printThenClose(). For use e.g. with Firefox PlugIn jsPrintSetup, see http://jsprintsetup.mozdev.org/','','Free');
377
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetSlipPrinterJS','','Use this JavaScript for printing slips. Define at least function printThenClose(). For use e.g. with Firefox PlugIn jsPrintSetup, see http://jsprintsetup.mozdev.org/','','Free');
378
INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 5536-5541 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5536
    SetVersion($DBversion);
5536
    SetVersion($DBversion);
5537
}
5537
}
5538
5538
5539
$DBversion ="3.09.00.XXX";
5540
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5541
    $dbh->do("INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');");
5542
    print "Upgrade to $DBversion done (Add system preference IntranetSlipPrinterJS))\n";
5543
    SetVersion($DBversion);
5544
}
5545
5539
=head1 FUNCTIONS
5546
=head1 FUNCTIONS
5540
5547
5541
=head2 TableExists($table)
5548
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +7 lines)
Lines 254-259 Circulation: Link Here
254
                  alert: "display a message"
254
                  alert: "display a message"
255
                  nothing : "do nothing"
255
                  nothing : "do nothing"
256
            - .
256
            - .
257
    Checkin Policy:
258
        -
259
            - pref: BlockReturnOfWithdrawnItems
260
              choices:
261
                  yes: Block
262
                  no: "Don't block"
263
            - returning of items that have been withdrawn.
257
    Holds Policy:
264
    Holds Policy:
258
        -
265
        -
259
            - pref: AllowHoldPolicyOverride
266
            - pref: AllowHoldPolicyOverride
260
- 

Return to bug 3387