Bug 12363: Add a switch to mark|do not mark items as returned when lost

There are several ways to mark an item an lost:
- item list view (catalogue/moredetail.pl, "Items" tab)
- cataloguing (cataloguing/additem.pl)
- Batch item modification tools (tools/batchMod.pl)
- The long overdue cronjob (misc/cronjobs/longoverdue.pl)

So far only the cronjob is configurable, the others mark the item as
returned (does the checkin).

This behaviour should be controlable using a syspref, to let libraries
choose what fit best for them.

Test plan:
Use the 2 options of the pref, mark checked out items as lost using the
different possibilities, and confirm that the behaviours make sense to
you

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2017-10-17 10:55:09 -03:00
parent 264432f701
commit 58b6e95763
5 changed files with 7 additions and 4 deletions

View File

@ -3624,6 +3624,8 @@ sub ReturnLostItem{
sub LostItem{
my ($itemnumber, $mark_returned) = @_;
$mark_returned //= C4::Context->preference('MarkLostItemsAsReturned');
my $dbh = C4::Context->dbh();
my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title
FROM issues

View File

@ -81,6 +81,6 @@ elsif (defined $itemnotes) { # i.e., itemnotes parameter passed from form
ModItem($item_changes, $biblionumber, $itemnumber);
LostItem($itemnumber, 'MARK RETURNED') if $itemlost;
LostItem($itemnumber) if $itemlost;
print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber");

View File

@ -700,7 +700,7 @@ if ($op eq "additem") {
my $newitemlost = $itemtosave->subfield( $lost_tag, $lost_subfield );
if (($olditemlost eq '0' or $olditemlost eq '' ) and $newitemlost ge '1'){
LostItem($itemnumber,'MARK RETURNED');
LostItem($itemnumber);
}
$nextop="additem";
} elsif ($op eq "delinkitem"){

View File

@ -44,7 +44,7 @@ use Koha::Patrons;
my $lost; # key=lost value, value=num days.
my ($charge, $verbose, $confirm, $quiet);
my $endrange = 366;
my $mark_returned = 0;
my $mark_returned;
my $borrower_category = [];
my $skip_borrower_category = [];
my $help=0;
@ -142,6 +142,7 @@ Specifies the end of the range of overdue days to deal with (defaults to 366).
=item B<--mark-returned>
When an item is marked lost, remove it from the borrowers issued items.
If not provided, the value of the system preference 'MarkLostItemsAsReturned' will be used.
=item B<--category>

View File

@ -208,7 +208,7 @@ if ($op eq "action") {
if ( $modified ) {
eval {
if ( my $item = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) ) {
LostItem($itemnumber, 'MARK RETURNED') if $item->{itemlost} and not $itemdata->{itemlost};
LostItem($itemnumber) if $item->{itemlost} and not $itemdata->{itemlost};
}
};
}