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

(-)a/C4/Circulation.pm (-3 / +7 lines)
Lines 1911-1916 sub AddReturn { Link Here
1911
        $doreturn = 0 if C4::Context->preference("BlockReturnOfWithdrawnItems");
1911
        $doreturn = 0 if C4::Context->preference("BlockReturnOfWithdrawnItems");
1912
    }
1912
    }
1913
1913
1914
    if ( $item->{itemlost} and C4::Context->preference("BlockReturnOfLostItems") ) {
1915
        $doreturn = 0;
1916
    }
1917
1914
    # case of a return of document (deal with issues and holdingbranch)
1918
    # case of a return of document (deal with issues and holdingbranch)
1915
    my $today = DateTime->now( time_zone => C4::Context->tz() );
1919
    my $today = DateTime->now( time_zone => C4::Context->tz() );
1916
1920
Lines 1988-1995 sub AddReturn { Link Here
1988
    # fix up the accounts.....
1992
    # fix up the accounts.....
1989
    if ( $item->{'itemlost'} ) {
1993
    if ( $item->{'itemlost'} ) {
1990
        $messages->{'WasLost'} = 1;
1994
        $messages->{'WasLost'} = 1;
1991
1995
        unless ( C4::Context->preference("BlockReturnOfLostItems") ) {
1992
        if ( $item->{'itemlost'} ) {
1993
            if (
1996
            if (
1994
                Koha::RefundLostItemFeeRules->should_refund(
1997
                Koha::RefundLostItemFeeRules->should_refund(
1995
                    {
1998
                    {
Lines 2000-2006 sub AddReturn { Link Here
2000
                )
2003
                )
2001
              )
2004
              )
2002
            {
2005
            {
2003
                _FixAccountForLostAndReturned( $item->{'itemnumber'}, $borrowernumber, $barcode );
2006
                _FixAccountForLostAndReturned( $item->{'itemnumber'},
2007
                    $borrowernumber, $barcode );
2004
                $messages->{'LostItemFeeRefunded'} = 1;
2008
                $messages->{'LostItemFeeRefunded'} = 1;
2005
            }
2009
            }
2006
        }
2010
        }
(-)a/C4/UsageStats.pm (+1 lines)
Lines 128-133 sub BuildReport { Link Here
128
        z3950NormalizeAuthor
128
        z3950NormalizeAuthor
129
        SpineLabelAutoPrint
129
        SpineLabelAutoPrint
130
        SpineLabelShowPrintOnBibDetails
130
        SpineLabelShowPrintOnBibDetails
131
        BlockReturnOfLostItems
131
        BlockReturnOfWithdrawnItems
132
        BlockReturnOfWithdrawnItems
132
        CalculateFinesOnReturn
133
        CalculateFinesOnReturn
133
        AgeRestrictionOverride
134
        AgeRestrictionOverride
(-)a/circ/returns.pl (-1 / +1 lines)
Lines 505-510 foreach my $code ( keys %$messages ) { Link Here
505
    }
505
    }
506
    elsif ( $code eq 'WasLost' ) {
506
    elsif ( $code eq 'WasLost' ) {
507
        $err{waslost} = 1;
507
        $err{waslost} = 1;
508
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfLostItems");
508
    }
509
    }
509
    elsif ( $code eq 'LostItemFeeRefunded' ) {
510
    elsif ( $code eq 'LostItemFeeRefunded' ) {
510
        $template->param( LostItemFeeRefunded => 1 );
511
        $template->param( LostItemFeeRefunded => 1 );
Lines 643-649 $template->param( Link Here
643
    forgivemanualholdsexpire => $forgivemanualholdsexpire,
644
    forgivemanualholdsexpire => $forgivemanualholdsexpire,
644
    overduecharges => $overduecharges,
645
    overduecharges => $overduecharges,
645
    AudioAlerts        => C4::Context->preference("AudioAlerts"),
646
    AudioAlerts        => C4::Context->preference("AudioAlerts"),
646
    BlockReturnOfWithdrawnItems => C4::Context->preference("BlockReturnOfWithdrawnItems"),
647
);
647
);
648
648
649
$itemnumber = GetItemnumberFromBarcode( $barcode );
649
$itemnumber = GetItemnumberFromBarcode( $barcode );
(-)a/installer/data/mysql/atomicupdate/bug_10748_BlockReturnOfLostItems.sql (+3 lines)
Line 0 Link Here
1
2
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
3
('BlockReturnOfLostItems','0','0','If enabled, items that are marked as lost cannot be returned.','YesNo');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 82-87 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
82
('BiblioDefaultView','normal','normal|marc|isbd','Choose the default detail view in the catalog; choose between normal, marc or isbd','Choice'),
82
('BiblioDefaultView','normal','normal|marc|isbd','Choose the default detail view in the catalog; choose between normal, marc or isbd','Choice'),
83
('BibtexExportAdditionalFields',  '', NULL ,  'Define additional BibTex tags to export from MARC records in YAML format as an associative array with either a marc tag/subfield combination as the value, or a list of tag/subfield combinations.',  'textarea'),
83
('BibtexExportAdditionalFields',  '', NULL ,  'Define additional BibTex tags to export from MARC records in YAML format as an associative array with either a marc tag/subfield combination as the value, or a list of tag/subfield combinations.',  'textarea'),
84
('BlockExpiredPatronOpacActions','1',NULL,'Set whether an expired patron can perform opac actions such as placing holds or renew books, can be overridden on a per patron-type basis','YesNo'),
84
('BlockExpiredPatronOpacActions','1',NULL,'Set whether an expired patron can perform opac actions such as placing holds or renew books, can be overridden on a per patron-type basis','YesNo'),
85
('BlockReturnOfLostItems','0','0','If enabled, items that are marked as lost cannot be returned.','YesNo'),
85
('BlockReturnOfWithdrawnItems','1','0','If enabled, items that are marked as withdrawn cannot be returned.','YesNo'),
86
('BlockReturnOfWithdrawnItems','1','0','If enabled, items that are marked as withdrawn cannot be returned.','YesNo'),
86
('BorrowerMandatoryField','surname|cardnumber',NULL,'Choose the mandatory fields for a patron\'s account','free'),
87
('BorrowerMandatoryField','surname|cardnumber',NULL,'Choose the mandatory fields for a patron\'s account','free'),
87
('borrowerRelationship','father|mother','','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','free'),
88
('borrowerRelationship','father|mother','','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 473-478 Circulation: Link Here
473
                  no: "Don't block"
473
                  no: "Don't block"
474
            - returning of items that have been withdrawn.
474
            - returning of items that have been withdrawn.
475
        -
475
        -
476
            - pref: BlockReturnOfLostItems
477
              choices:
478
                  yes: Block
479
                  no: "Don't block"
480
            - returning of items that have been lost.
481
        -
476
            - pref: CalculateFinesOnReturn
482
            - pref: CalculateFinesOnReturn
477
              choices:
483
              choices:
478
                  yes: Do
484
                  yes: Do
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-5 / +6 lines)
Lines 617-636 $(document).ready(function () { Link Here
617
            [% END %]
617
            [% END %]
618
            [% IF ( errmsgloo.waslost ) %]
618
            [% IF ( errmsgloo.waslost ) %]
619
                <p class="problem">Item was lost, now found.</p>
619
                <p class="problem">Item was lost, now found.</p>
620
                [% IF ( LostItemFeeRefunded ) %]
620
                [% IF LostItemFeeRefunded and not Koha.Preference('BlockReturnOfLostItems') %]
621
                    <p class="problem">A refund has been applied to the borrowing patron's account.</p>
621
                    <p class="problem">A refund has been applied to the borrowing patron's account.</p>
622
                [% ELSIF Koha.Preference('BlockReturnOfLostItems') %]
623
                   <h5>Cannot check in</h5>
624
                   <p><strong>NOT CHECKED IN</strong></p>
622
                [% ELSE %]
625
                [% ELSE %]
623
                    <p class="problem">Any lost item fees for this item will remain on the patron's account.</p>
626
                    <p class="problem">Any lost item fees for this item will remain on the patron's account.</p>
624
                [% END %]
627
                [% END %]
625
            [% END %]
628
            [% END %]
626
            [% IF ( errmsgloo.withdrawn ) %]
629
            [% IF ( errmsgloo.withdrawn ) %]
627
                [% IF BlockReturnOfWithdrawnItems %]
630
                [% IF Koha.Preference('BlockReturnOfWithdrawnItems') %]
628
                   <h5>Cannot check in</h5>
631
                   <h5>Cannot check in</h5>
629
                   <p><strong>NOT CHECKED IN</strong></p>
632
                   <p><strong>NOT CHECKED IN</strong></p>
630
                   <p class="problem">Item is withdrawn.</p>
631
                [% ELSE %]
632
                   <p class="problem">Item is withdrawn.</p>
633
                [% END %]
633
                [% END %]
634
               <p class="problem">Item is withdrawn.</p>
634
            [% END %]
635
            [% END %]
635
            [% IF ( errmsgloo.debarred ) %]
636
            [% IF ( errmsgloo.debarred ) %]
636
                <p class="problem"><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% errmsgloo.debarborrowernumber %]">[% errmsgloo.debarname %]([% errmsgloo.debarcardnumber %])</a> is now debarred until [% errmsgloo.debarred | $KohaDates %].</p>
637
                <p class="problem"><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% errmsgloo.debarborrowernumber %]">[% errmsgloo.debarname %]([% errmsgloo.debarcardnumber %])</a> is now debarred until [% errmsgloo.debarred | $KohaDates %].</p>
(-)a/t/db_dependent/UsageStats.t (-1 / +1 lines)
Lines 380-385 sub mocking_systempreferences_to_a_set_value { Link Here
380
        z3950NormalizeAuthor
380
        z3950NormalizeAuthor
381
        SpineLabelAutoPrint
381
        SpineLabelAutoPrint
382
        SpineLabelShowPrintOnBibDetails
382
        SpineLabelShowPrintOnBibDetails
383
        BlockReturnOfLostItems
383
        BlockReturnOfWithdrawnItems
384
        BlockReturnOfWithdrawnItems
384
        CalculateFinesOnReturn
385
        CalculateFinesOnReturn
385
        AgeRestrictionOverride
386
        AgeRestrictionOverride
386
- 

Return to bug 10748