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

(-)a/C4/Circulation.pm (-2 / +2 lines)
Lines 3286-3292 sub ReturnLostItem{ Link Here
3286
3286
3287
3287
3288
sub LostItem{
3288
sub LostItem{
3289
    my ($itemnumber, $mark_returned, $charge_fee) = @_;
3289
    my ( $itemnumber, $charge_fee ) = @_;
3290
3290
3291
    my $dbh = C4::Context->dbh();
3291
    my $dbh = C4::Context->dbh();
3292
    my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title 
3292
    my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title 
Lines 3306-3312 sub LostItem{ Link Here
3306
          if $charge_fee;
3306
          if $charge_fee;
3307
        #FIXME : Should probably have a way to distinguish this from an item that really was returned.
3307
        #FIXME : Should probably have a way to distinguish this from an item that really was returned.
3308
        #warn " $issues->{'borrowernumber'}  /  $itemnumber ";
3308
        #warn " $issues->{'borrowernumber'}  /  $itemnumber ";
3309
        MarkIssueReturned($borrowernumber,$itemnumber,undef,undef,$borrower->{'privacy'}) if $mark_returned;
3309
        MarkIssueReturned( $borrowernumber, $itemnumber, undef, undef, $borrower->{'privacy'} ) if C4::Context->preference("WhenLostReturnItems");
3310
    }
3310
    }
3311
}
3311
}
3312
3312
(-)a/catalogue/updateitem.pl (-1 / +1 lines)
Lines 74-79 if (defined $itemnotes) { # i.e., itemnotes parameter passed from form Link Here
74
74
75
ModItem($item_changes, $biblionumber, $itemnumber);
75
ModItem($item_changes, $biblionumber, $itemnumber);
76
76
77
LostItem($itemnumber, C4::Context->preference("ReturnLostItems"), 'CHARGE FEE') if $itemlost;
77
LostItem($itemnumber, 'CHARGE FEE') if $itemlost;
78
78
79
print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber");
79
print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber");
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 411-414 INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( Link Here
411
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksReviews','0','Display book review snippets from IDreamBooks.com','','YesNo');
411
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksReviews','0','Display book review snippets from IDreamBooks.com','','YesNo');
412
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksReadometer','0','Display Readometer from IDreamBooks.com','','YesNo');
412
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksReadometer','0','Display Readometer from IDreamBooks.com','','YesNo');
413
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksResults','0','Display IDreamBooks.com rating in search results','','YesNo');
413
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksResults','0','Display IDreamBooks.com rating in search results','','YesNo');
414
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ReturnLostItems',  '1', 'If enabled, items marked as lost via the librarian intranet will be automatically returned. Note, the cronjob for marking items as lost has its own command line switch and is not affected by this system preference.','', 'YesNo');
414
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('WhenLostReturnItems',  '1', 'If enabled, items marked as lost will be automatically returned.','', 'YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (-2 / +2 lines)
Lines 6401-6408 if ( CheckVersion($DBversion) ) { Link Here
6401
6401
6402
$DBversion ="3.11.00.XXX";
6402
$DBversion ="3.11.00.XXX";
6403
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
6403
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
6404
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('ReturnLostItems', '1', '','If enabled, items marked as lost via the librarian intranet will be automatically returned. Note, the cronjob for marking items as lost has its own command line switch and is not affected by this system preference.', 'YesNo')");
6404
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('WhenLostReturnItems', '1', '','If enabled, items marked as lost will be automatically returned.', 'YesNo')");
6405
    print "Upgrade to $DBversion done (Add system preference ReturnLostItems)\n";
6405
    print "Upgrade to $DBversion done (Add system preference WhenLostReturnItems)\n";
6406
    SetVersion($DBversion);
6406
    SetVersion($DBversion);
6407
}
6407
}
6408
6408
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +1 lines)
Lines 539-545 Circulation: Link Here
539
            - .
539
            - .
540
    Lost Items Policy:
540
    Lost Items Policy:
541
        -
541
        -
542
            - pref: ReturnLostItems
542
            - pref: WhenLostReturnItems
543
              type: choice
543
              type: choice
544
              choices:
544
              choices:
545
                  yes: "Check in"
545
                  yes: "Check in"
(-)a/misc/cronjobs/longoverdue.pl (-4 / +1 lines)
Lines 50-56 GetOptions( Link Here
50
    'verbose'       => \$verbose,
50
    'verbose'       => \$verbose,
51
    'quiet'         => \$quiet,
51
    'quiet'         => \$quiet,
52
    'maxdays=s'     => \$endrange,
52
    'maxdays=s'     => \$endrange,
53
    'mark-returned' => \$mark_returned,
54
);
53
);
55
54
56
my $usage = << 'ENDUSAGE';
55
my $usage = << 'ENDUSAGE';
Lines 77-84 This script takes the following parameters : Link Here
77
    --maxdays           Specifies the end of the range of overdue days to deal with (defaults to 366).  This
76
    --maxdays           Specifies the end of the range of overdue days to deal with (defaults to 366).  This
78
                        value is universal to all lost num days overdue passed.
77
                        value is universal to all lost num days overdue passed.
79
78
80
    --mark-returned     When an item is marked lost, remove it from the borrowers issued items.
81
82
  examples :
79
  examples :
83
  $PERL5LIB/misc/cronjobs/longoverdue.pl --lost 30=1
80
  $PERL5LIB/misc/cronjobs/longoverdue.pl --lost 30=1
84
    Would set LOST=1 after 30 days (up to one year), but not charge the account.
81
    Would set LOST=1 after 30 days (up to one year), but not charge the account.
Lines 165-171 foreach my $startrange (sort keys %$lost) { Link Here
165
            printf ("Due %s: item %5s from borrower %5s to lost: %s\n", $row->{date_due}, $row->{itemnumber}, $row->{borrowernumber}, $lostvalue) if($verbose);
162
            printf ("Due %s: item %5s from borrower %5s to lost: %s\n", $row->{date_due}, $row->{itemnumber}, $row->{borrowernumber}, $lostvalue) if($verbose);
166
            if($confirm) {
163
            if($confirm) {
167
                ModItem({ itemlost => $lostvalue }, $row->{'biblionumber'}, $row->{'itemnumber'});
164
                ModItem({ itemlost => $lostvalue }, $row->{'biblionumber'}, $row->{'itemnumber'});
168
                LostItem($row->{'itemnumber'}, $mark_returned, 'CHARGE FEE') if( $charge && $charge eq $lostvalue);
165
                LostItem($row->{'itemnumber'}, 'CHARGE FEE') if( $charge && $charge eq $lostvalue);
169
            }
166
            }
170
            $count++;
167
            $count++;
171
        }
168
        }
(-)a/tools/batchMod.pl (-2 / +1 lines)
Lines 190-196 if ($op eq "action") { Link Here
190
			UpdateMarcWith( $marcitem, $localmarcitem );
190
			UpdateMarcWith( $marcitem, $localmarcitem );
191
			eval{
191
			eval{
192
                            if ( my $item = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) ) {
192
                            if ( my $item = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) ) {
193
                                LostItem($itemnumber, C4::Context->preference("ReturnLostItems"), 'CHARGE FEE') if $item->{itemlost};
193
                                LostItem($itemnumber, 'CHARGE FEE') if $item->{itemlost};
194
                            }
194
                            }
195
                        };
195
                        };
196
		    }
196
		    }
197
- 

Return to bug 8484