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

(-)a/Koha/Checkouts.pm (-3 / +14 lines)
Lines 28-33 use Koha::DateUtils qw( dt_from_string ); Link Here
28
28
29
use base qw(Koha::Objects);
29
use base qw(Koha::Objects);
30
30
31
31
=head1 NAME
32
=head1 NAME
32
33
33
Koha::Checkouts - Koha Checkout object set class
34
Koha::Checkouts - Koha Checkout object set class
Lines 66-72 sub calculate_dropbox_date { Link Here
66
67
67
my $automatic_checkins = Koha::Checkouts->automatic_checkin()
68
my $automatic_checkins = Koha::Checkouts->automatic_checkin()
68
69
69
Checks in every due issue which itemtype has automatic_checkin enabled
70
Checks in every due issue which itemtype has automatic_checkin enabled. Also if the AutoCheckinAutoFill sys. pref. is enabled, the item is trapped for the next patron.
70
71
71
=cut
72
=cut
72
73
Lines 81-90 sub automatic_checkin { Link Here
81
        { prefetch => 'item'}
82
        { prefetch => 'item'}
82
    );
83
    );
83
84
85
    my $autofill_next = C4::Context->preference('AutoCheckinAutoFill');
86
84
    while ( my $checkout = $due_checkouts->next ) {
87
    while ( my $checkout = $due_checkouts->next ) {
85
        if ( $checkout->item->itemtype->automatic_checkin ) {
88
        if ( $checkout->item->itemtype->automatic_checkin ) {
86
            C4::Circulation::AddReturn( $checkout->item->barcode,
89
            my ( undef, $messages) = C4::Circulation::AddReturn($checkout->item->barcode, $checkout->branchcode, undef, dt_from_string($checkout->date_due) );
87
                $checkout->branchcode, undef, dt_from_string($checkout->date_due) );
90
            my $is_transfer = $checkout->branchcode ne $messages->{ResFound}->{branchcode};
91
            if ( $autofill_next ){
92
                if ( $messages->{ResFound} ){
93
                    C4::Reserves::ModReserveAffect($checkout->item->itemnumber, $checkout->borrowernumber, $is_transfer, $messages->{ResFound}->{reserve_id}, $checkout->{desk_id}, 0);
94
                    if( $is_transfer ){
95
                        C4::Items::ModItemTransfer($checkout->item->itemnumber,$checkout->branchcode, $messages->{ResFound}->{branchcode},"Reserve");
96
                    }
97
                }
98
            }
88
        }
99
        }
89
    }
100
    }
90
}
101
}
(-)a/installer/data/mysql/atomicupdate/skeleton.pl (-13 / +5 lines)
Lines 1-24 Link Here
1
use Modern::Perl;
1
use Modern::Perl;
2
2
3
return {
3
return {
4
    bug_number => "BUG_NUMBER",
4
    bug_number => "33887",
5
    description => "A single line description",
5
    description => "Automatically fill the next hold with a automatic check in.",
6
    up => sub {
6
    up => sub {
7
        my ($args) = @_;
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        # Do you stuffs here
9
        # Do you stuffs here
10
        $dbh->do(q{});
10
        $dbh->do(q{ 
11
                INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('AutoCheckinAutoFill', '0', NULL,'Automatically fill the next hold with an automatic checkin cronjob.', 'YesNo'});
11
        # Print useful stuff here
12
        # Print useful stuff here
12
        # tables
13
        say $out "Added new table 'XXX'";
14
        say $out "Added column 'XXX.YYY'";
15
        # sysprefs
13
        # sysprefs
16
        say $out "Added new system preference 'XXX'";
14
        say $out "Added new system preference 'AutoCheckinAutoFill'";
17
        say $out "Updated system preference 'XXX'";
18
        say $out "Removed system preference 'XXX'";
19
        # permissions
20
        say $out "Added new permission 'XXX'";
21
        # letters
22
        say $out "Added new letter 'XXX' (TRANSPORT)";
23
    },
15
    },
24
};
16
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 77-82 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
77
('AuthorityXSLTResultsDisplay','','','Enable XSL stylesheet control over authority results page display on intranet','Free'),
77
('AuthorityXSLTResultsDisplay','','','Enable XSL stylesheet control over authority results page display on intranet','Free'),
78
('AuthSuccessLog','0',NULL,'If enabled, log successful authentications','YesNo'),
78
('AuthSuccessLog','0',NULL,'If enabled, log successful authentications','YesNo'),
79
('autoBarcode','OFF','incremental|annual|hbyymmincr|EAN13|OFF','Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002; hbyymmincr of the form HB08010001 where HB=Home Branch','Choice'),
79
('autoBarcode','OFF','incremental|annual|hbyymmincr|EAN13|OFF','Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002; hbyymmincr of the form HB08010001 where HB=Home Branch','Choice'),
80
('AutoCheckinAutoFill','0',NULL,'Automatically fill the next hold with an automatic check in.','YesNo'),
80
('autoControlNumber','OFF','biblionumber|OFF','Used to autogenerate a Control Number: biblionumber will be as biblionumber, OFF will leave the field as it is;','Choice'),
81
('autoControlNumber','OFF','biblionumber|OFF','Used to autogenerate a Control Number: biblionumber will be as biblionumber, OFF will leave the field as it is;','Choice'),
81
('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'),
82
('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'),
82
('AutoCreditNumber', '', '', 'Automatically generate a number for account credits', 'Choice'),
83
('AutoCreditNumber', '', '', 'Automatically generate a number for account credits', 'Choice'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +7 lines)
Lines 977-982 Circulation: Link Here
977
                  homebranch: "item's home library"
977
                  homebranch: "item's home library"
978
                  holdingbranch: "item's holding library"
978
                  holdingbranch: "item's holding library"
979
            - "."
979
            - "."
980
        -
981
            - pref: AutoCheckinAutoFill
982
              choices:
983
                  1: "Do"
984
                  0: "Don't"
985
            - allow holds to be automatically filled after being automatically checked in.
980
    Patron restrictions:
986
    Patron restrictions:
981
        -
987
        -
982
            - pref: PatronRestrictionTypes
988
            - pref: PatronRestrictionTypes
Lines 1364-1366 Circulation: Link Here
1364
                  1: Enable
1370
                  1: Enable
1365
                  0: Disable
1371
                  0: Disable
1366
            - "the curbside pickup module."
1372
            - "the curbside pickup module."
1367
- 
1373

Return to bug 33887