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

(-)a/C4/Circulation.pm (-3 / +7 lines)
Lines 667-672 sub CanBookBeIssued { Link Here
667
    my ( $borrower, $barcode, $duedate, $inprocess, $ignore_reserves ) = @_;
667
    my ( $borrower, $barcode, $duedate, $inprocess, $ignore_reserves ) = @_;
668
    my %needsconfirmation;    # filled with problems that needs confirmations
668
    my %needsconfirmation;    # filled with problems that needs confirmations
669
    my %issuingimpossible;    # filled with problems that causes the issue to be IMPOSSIBLE
669
    my %issuingimpossible;    # filled with problems that causes the issue to be IMPOSSIBLE
670
    my %alerts;               # filled with messages that shouldn't stop issuing, but the librarian should be aware of.
671
    
670
    my $item = GetItem(GetItemnumberFromBarcode( $barcode ));
672
    my $item = GetItem(GetItemnumberFromBarcode( $barcode ));
671
    my $issue = GetItemIssue($item->{itemnumber});
673
    my $issue = GetItemIssue($item->{itemnumber});
672
	my $biblioitem = GetBiblioItemData($item->{biblioitemnumber});
674
	my $biblioitem = GetBiblioItemData($item->{biblioitemnumber});
Lines 848-855 sub CanBookBeIssued { Link Here
848
    {
850
    {
849
        $issuingimpossible{RESTRICTED} = 1;
851
        $issuingimpossible{RESTRICTED} = 1;
850
    }
852
    }
851
    if ( $item->{'itemlost'} ) {
853
    if ( $item->{'itemlost'} && C4::Context->preference("IssueLostItem") ne 'nothing' ) {
852
        $needsconfirmation{ITEM_LOST} = GetAuthorisedValueByCode( 'LOST', $item->{'itemlost'} );
854
        my $code = GetAuthorisedValueByCode( 'LOST', $item->{'itemlost'} );
855
        $needsconfirmation{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'confirm' );
856
        $alerts{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'alert' );
853
    }
857
    }
854
    if ( C4::Context->preference("IndependantBranches") ) {
858
    if ( C4::Context->preference("IndependantBranches") ) {
855
        my $userenv = C4::Context->userenv;
859
        my $userenv = C4::Context->userenv;
Lines 926-932 sub CanBookBeIssued { Link Here
926
            }
930
            }
927
        }
931
        }
928
    }
932
    }
929
    return ( \%issuingimpossible, \%needsconfirmation );
933
    return ( \%issuingimpossible, \%needsconfirmation, \%alerts );
930
}
934
}
931
935
932
=head2 AddIssue
936
=head2 AddIssue
(-)a/circ/circulation.pl (-1 / +3 lines)
Lines 275-284 if ($borrowernumber) { Link Here
275
#
275
#
276
if ($barcode) {
276
if ($barcode) {
277
    # always check for blockers on issuing
277
    # always check for blockers on issuing
278
    my ( $error, $question ) =
278
    my ( $error, $question, $alerts ) =
279
    CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess );
279
    CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess );
280
    my $blocker = $invalidduedate ? 1 : 0;
280
    my $blocker = $invalidduedate ? 1 : 0;
281
281
282
    $template->param( alert => $alerts );
283
282
    delete $question->{'DEBT'} if ($debt_confirmed);
284
    delete $question->{'DEBT'} if ($debt_confirmed);
283
    foreach my $impossible ( keys %$error ) {
285
    foreach my $impossible ( keys %$error ) {
284
        $template->param(
286
        $template->param(
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 362-364 INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES(' Link Here
362
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('AutoResumeSuspendedHolds',  '1', NULL ,  'Allow suspended holds to be automatically resumed by a set date.',  'YesNo');
362
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('AutoResumeSuspendedHolds',  '1', NULL ,  'Allow suspended holds to be automatically resumed by a set date.',  'YesNo');
363
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacStarRatings','all',NULL,'disable|all|details','Choice');
363
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacStarRatings','all',NULL,'disable|all|details','Choice');
364
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacBrowseResults','1','Disable/enable browsing and paging search results from the OPAC detail page.',NULL,'YesNo');
364
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacBrowseResults','1','Disable/enable browsing and paging search results from the OPAC detail page.',NULL,'YesNo');
365
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IssueLostItem', 'alert', 'alert|confirm|nothing', 'Defines what should be done when an attempt is made to issue an item that has been marked as lost.', 'Choice');
(-)a/installer/data/mysql/updatedatabase.pl (+6 lines)
Lines 5196-5201 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5196
    SetVersion($DBversion);
5196
    SetVersion($DBversion);
5197
}
5197
}
5198
5198
5199
$DBversion = "3.07.00.XXX";
5200
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5201
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IssueLostItem', 'alert', 'alert|confirm|nothing', 'Defines what should be done when an attempt is made to issue an item that has been marked as lost.', 'Choice')");
5202
    print "Upgrade to $DBversion done (Add system preference issuelostitem ))\n";
5203
    SetVersion($DBversion);
5204
}
5199
5205
5200
=head1 FUNCTIONS
5206
=head1 FUNCTIONS
5201
5207
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+8 lines)
Lines 240-245 Circulation: Link Here
240
              choices:
240
              choices:
241
                  homebranch: the library the item is from.
241
                  homebranch: the library the item is from.
242
                  holdingbranch: the library the item was checked out from.
242
                  holdingbranch: the library the item was checked out from.
243
        -
244
            - "When issuing an item that has been marked as lost, "
245
            - pref: IssueLostItem
246
              choices:
247
                  confirm: "require confirmation"
248
                  alert: "display a message"
249
                  nothing : "do nothing"
250
            - .      
243
    Holds Policy:
251
    Holds Policy:
244
        -
252
        -
245
            - pref: AllowHoldPolicyOverride
253
            - pref: AllowHoldPolicyOverride
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-1 / +4 lines)
Lines 233-238 function refocus(calendar) { Link Here
233
    </div>
233
    </div>
234
[% END %]
234
[% END %]
235
235
236
[% IF ( alert.ITEM_LOST ) %]
237
    <div class="dialog message">This item has been lost with a status of "[% alert.ITEM_LOST %]".</div>
238
[% END %]
239
236
[% IF ( NEEDSCONFIRMATION ) %]
240
[% IF ( NEEDSCONFIRMATION ) %]
237
<div class="yui-g">
241
<div class="yui-g">
238
242
239
- 

Return to bug 7758