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

(-)a/C4/Circulation.pm (-3 / +7 lines)
Lines 1909-1914 sub AddReturn { Link Here
1909
        $doreturn = 0 if C4::Context->preference("BlockReturnOfWithdrawnItems");
1909
        $doreturn = 0 if C4::Context->preference("BlockReturnOfWithdrawnItems");
1910
    }
1910
    }
1911
1911
1912
    if ( $item->{itemlost} and C4::Context->preference("BlockReturnOfLostItems") ) {
1913
        $doreturn = 0;
1914
    }
1915
1912
    # case of a return of document (deal with issues and holdingbranch)
1916
    # case of a return of document (deal with issues and holdingbranch)
1913
    my $today = DateTime->now( time_zone => C4::Context->tz() );
1917
    my $today = DateTime->now( time_zone => C4::Context->tz() );
1914
1918
Lines 1986-1993 sub AddReturn { Link Here
1986
    # fix up the accounts.....
1990
    # fix up the accounts.....
1987
    if ( $item->{'itemlost'} ) {
1991
    if ( $item->{'itemlost'} ) {
1988
        $messages->{'WasLost'} = 1;
1992
        $messages->{'WasLost'} = 1;
1989
1993
        unless ( C4::Context->preference("BlockReturnOfLostItems") ) {
1990
        if ( $item->{'itemlost'} ) {
1991
            if (
1994
            if (
1992
                Koha::RefundLostItemFeeRules->should_refund(
1995
                Koha::RefundLostItemFeeRules->should_refund(
1993
                    {
1996
                    {
Lines 1998-2004 sub AddReturn { Link Here
1998
                )
2001
                )
1999
              )
2002
              )
2000
            {
2003
            {
2001
                _FixAccountForLostAndReturned( $item->{'itemnumber'}, $borrowernumber, $barcode );
2004
                _FixAccountForLostAndReturned( $item->{'itemnumber'},
2005
                    $borrowernumber, $barcode );
2002
                $messages->{'LostItemFeeRefunded'} = 1;
2006
                $messages->{'LostItemFeeRefunded'} = 1;
2003
            }
2007
            }
2004
        }
2008
        }
(-)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 467-472 Circulation: Link Here
467
                  no: "Don't block"
467
                  no: "Don't block"
468
            - returning of items that have been withdrawn.
468
            - returning of items that have been withdrawn.
469
        -
469
        -
470
            - pref: BlockReturnOfLostItems
471
              choices:
472
                  yes: Block
473
                  no: "Don't block"
474
            - returning of items that have been lost.
475
        -
470
            - pref: CalculateFinesOnReturn
476
            - pref: CalculateFinesOnReturn
471
              choices:
477
              choices:
472
                  yes: Do
478
                  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