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

(-)a/Koha/Cron.pm (-13 / +34 lines)
Lines 1-4 Link Here
1
package Koha::Cron;
1
package Koha::Script;
2
2
3
# Copyright PTFS Europe 2019
3
# Copyright PTFS Europe 2019
4
# Copyright 2019 Koha Development Team
4
# Copyright 2019 Koha Development Team
Lines 22-50 use Modern::Perl; Link Here
22
22
23
=head1 NAME
23
=head1 NAME
24
24
25
Koha::Cron - Koha Cron scripts base class
25
Koha::Script - Koha scripts base class
26
26
27
=head1 SYNOPSIS
27
=head1 SYNOPSIS
28
28
29
    use Koha::Cron;
29
    use Koha::Script
30
    use Koha::Script -cron;
30
31
31
=head1 DESCRIPTION
32
=head1 DESCRIPTION
32
33
33
This class should be used in all cronscripts. It sets the interface and userenv appropriately.
34
This class should be used in all scripts. It sets the interface and userenv appropriately.
34
35
35
=cut
36
=cut
36
37
37
use C4::Context;
38
use C4::Context;
38
39
39
# Set userenv
40
sub import {
40
C4::Context->_new_userenv(1);
41
    my $class = shift;
41
C4::Context->set_userenv(
42
    my @flags = @_;
42
    undef, undef, undef, 'CRON', 'CRON', undef,
43
43
    undef, undef, undef, undef,  undef
44
    C4::Context->_new_userenv(1);
44
);
45
    if ( ( $flags[0] || '' ) eq '-cron' ) {
45
46
46
# Set interface
47
        # Set userenv
47
C4::Context->interface('cron');
48
        C4::Context->_new_userenv(1);
49
        C4::Context->set_userenv(
50
            undef, undef, undef, 'CRON', 'CRON', undef,
51
            undef, undef, undef, undef,  undef
52
        );
53
54
        # Set interface
55
        C4::Context->interface('cron');
56
57
    }
58
    else {
59
        # Set userenv
60
        C4::Context->set_userenv(
61
            undef, undef, undef, 'CLI', 'CLI', undef,
62
            undef, undef, undef, undef,  undef
63
        );
64
65
        # Set interface
66
        C4::Context->interface('commandline');
67
    }
68
}
48
69
49
=head1 AUTHOR
70
=head1 AUTHOR
50
71
(-)a/misc/admin/koha-preferences (+1 lines)
Lines 18-23 Link Here
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
#
19
#
20
20
21
use Koha::Script;
21
use C4::Boolean;
22
use C4::Boolean;
22
use C4::Context;
23
use C4::Context;
23
use C4::Debug;
24
use C4::Debug;
(-)a/misc/batchCompareMARCvsFrameworks.pl (+1 lines)
Lines 12-17 BEGIN { Link Here
12
}
12
}
13
13
14
# Koha modules used
14
# Koha modules used
15
use Koha::Script;
15
use C4::Context;
16
use C4::Context;
16
use MARC::File::USMARC;
17
use MARC::File::USMARC;
17
use MARC::Record;
18
use MARC::Record;
(-)a/misc/batchDeleteUnusedSubfields.pl (+1 lines)
Lines 11-16 BEGIN { Link Here
11
}
11
}
12
12
13
# Koha modules used
13
# Koha modules used
14
use Koha::Script;
14
use MARC::Record;
15
use MARC::Record;
15
use C4::Context;
16
use C4::Context;
16
use C4::Biblio;
17
use C4::Biblio;
(-)a/misc/batchImportMARCWithBiblionumbers.pl (+1 lines)
Lines 12-17 BEGIN { Link Here
12
12
13
# Koha modules used
13
# Koha modules used
14
14
15
use Koha::Script;
15
use C4::Context;
16
use C4::Context;
16
use C4::Biblio;
17
use C4::Biblio;
17
use MARC::Record;
18
use MARC::Record;
(-)a/misc/batchRebuildBiblioTables.pl (+1 lines)
Lines 13-18 BEGIN { Link Here
13
}
13
}
14
14
15
# Koha modules used
15
# Koha modules used
16
use Koha::Script;
16
use MARC::Record;
17
use MARC::Record;
17
use C4::Context;
18
use C4::Context;
18
use C4::Biblio;
19
use C4::Biblio;
(-)a/misc/batchRebuildItemsTables.pl (+1 lines)
Lines 8-13 use MARC::Record; Link Here
8
use Pod::Usage;
8
use Pod::Usage;
9
use Time::HiRes qw(gettimeofday);
9
use Time::HiRes qw(gettimeofday);
10
10
11
use Koha::Script;
11
use C4::Context;
12
use C4::Context;
12
use C4::Biblio;
13
use C4::Biblio;
13
use C4::Items;
14
use C4::Items;
(-)a/misc/batchRepairMissingBiblionumbers.pl (-1 / +1 lines)
Lines 12-18 BEGIN { Link Here
12
}
12
}
13
13
14
# Koha modules used
14
# Koha modules used
15
15
use Koha::Script;
16
use C4::Context;
16
use C4::Context;
17
use C4::Biblio;
17
use C4::Biblio;
18
18
(-)a/misc/batchdeletebiblios.pl (+1 lines)
Lines 5-10 use Getopt::Long; Link Here
5
use Pod::Usage;
5
use Pod::Usage;
6
use IO::File;
6
use IO::File;
7
7
8
use Koha::Script;
8
use C4::Biblio;
9
use C4::Biblio;
9
10
10
my ($help, $files);
11
my ($help, $files);
(-)a/misc/check_sysprefs.pl (+1 lines)
Lines 10-15 use warnings; Link Here
10
10
11
use File::Find;
11
use File::Find;
12
12
13
use Koha::Script;
13
use C4::Context;
14
use C4::Context;
14
15
15
@ARGV = qw(.) unless @ARGV;
16
@ARGV = qw(.) unless @ARGV;
(-)a/misc/commit_file.pl (+1 lines)
Lines 9-14 BEGIN { Link Here
9
    eval { require "$FindBin::Bin/kohalib.pl" };
9
    eval { require "$FindBin::Bin/kohalib.pl" };
10
}
10
}
11
11
12
use Koha::Script;
12
use C4::Context;
13
use C4::Context;
13
use C4::ImportBatch;
14
use C4::ImportBatch;
14
use Getopt::Long;
15
use Getopt::Long;
(-)a/misc/cronjobs/advance_notices.pl (-1 / +1 lines)
Lines 49-55 BEGIN { Link Here
49
    use FindBin;
49
    use FindBin;
50
    eval { require "$FindBin::Bin/../kohalib.pl" };
50
    eval { require "$FindBin::Bin/../kohalib.pl" };
51
}
51
}
52
use Koha::Cron;
52
use Koha::Script -cron;
53
use C4::Biblio;
53
use C4::Biblio;
54
use C4::Context;
54
use C4::Context;
55
use C4::Letters;
55
use C4::Letters;
(-)a/misc/cronjobs/automatic_item_modification_by_age.pl (-1 / +1 lines)
Lines 6-12 use Getopt::Long; Link Here
6
use Pod::Usage;
6
use Pod::Usage;
7
use JSON;
7
use JSON;
8
8
9
use Koha::Cron;
9
use Koha::Script -cron;
10
use C4::Context;
10
use C4::Context;
11
use C4::Items;
11
use C4::Items;
12
12
(-)a/misc/cronjobs/automatic_renewals.pl (-1 / +1 lines)
Lines 52-58 use Modern::Perl; Link Here
52
use Pod::Usage;
52
use Pod::Usage;
53
use Getopt::Long;
53
use Getopt::Long;
54
54
55
use Koha::Cron;
55
use Koha::Script -cron;
56
use C4::Circulation;
56
use C4::Circulation;
57
use C4::Context;
57
use C4::Context;
58
use C4::Log;
58
use C4::Log;
(-)a/misc/cronjobs/batch_anonymise.pl (-1 / +1 lines)
Lines 29-35 BEGIN { Link Here
29
    eval { require "$FindBin::Bin/../kohalib.pl" };
29
    eval { require "$FindBin::Bin/../kohalib.pl" };
30
}
30
}
31
31
32
use Koha::Cron;
32
use Koha::Script -cron;
33
use C4::Context;
33
use C4::Context;
34
use Koha::Patrons;
34
use Koha::Patrons;
35
use Date::Calc qw(
35
use Date::Calc qw(
(-)a/misc/cronjobs/build_browser_and_cloud.pl (-1 / +1 lines)
Lines 10-16 BEGIN { Link Here
10
    eval { require "$FindBin::Bin/../kohalib.pl" };
10
    eval { require "$FindBin::Bin/../kohalib.pl" };
11
}
11
}
12
12
13
use Koha::Cron;
13
use Koha::Script -cron;
14
use C4::Koha;
14
use C4::Koha;
15
use C4::Context;
15
use C4::Context;
16
use C4::Biblio;
16
use C4::Biblio;
(-)a/misc/cronjobs/cart_to_shelf.pl (-1 / +1 lines)
Lines 28-34 cart_to_shelf.pl cron script to set items with location of CART to original she Link Here
28
use strict;
28
use strict;
29
use warnings;
29
use warnings;
30
30
31
use Koha::Cron;
31
use Koha::Script -cron;
32
use C4::Items qw/ CartToShelf /;
32
use C4::Items qw/ CartToShelf /;
33
use C4::Log;
33
use C4::Log;
34
34
(-)a/misc/cronjobs/check-url-quick.pl (-1 / +1 lines)
Lines 21-27 use Modern::Perl; Link Here
21
use Pod::Usage;
21
use Pod::Usage;
22
use Getopt::Long;
22
use Getopt::Long;
23
23
24
use Koha::Cron;
24
use Koha::Script -cron;
25
use C4::Context;
25
use C4::Context;
26
use C4::Biblio;
26
use C4::Biblio;
27
use AnyEvent;
27
use AnyEvent;
(-)a/misc/cronjobs/check-url.pl (-2 / +2 lines)
Lines 78-84 use strict; Link Here
78
use warnings;
78
use warnings;
79
use LWP::UserAgent;
79
use LWP::UserAgent;
80
use HTTP::Request;
80
use HTTP::Request;
81
use Koha::Cron;
81
use Koha::Script -cron;
82
use C4::Biblio;
82
use C4::Biblio;
83
83
84
84
Lines 148-154 use Carp; Link Here
148
148
149
use Pod::Usage;
149
use Pod::Usage;
150
use Getopt::Long;
150
use Getopt::Long;
151
use Koha::Cron;
151
use Koha::Script -cron;
152
use C4::Context;
152
use C4::Context;
153
153
154
154
(-)a/misc/cronjobs/cleanup_database.pl (-1 / +1 lines)
Lines 34-40 BEGIN { Link Here
34
    eval { require "$FindBin::Bin/../kohalib.pl" };
34
    eval { require "$FindBin::Bin/../kohalib.pl" };
35
}
35
}
36
36
37
use Koha::Cron;
37
use Koha::Script -cron;
38
use C4::Context;
38
use C4::Context;
39
use C4::Search;
39
use C4::Search;
40
use C4::Search::History;
40
use C4::Search::History;
(-)a/misc/cronjobs/cloud-kw.pl (-1 / +1 lines)
Lines 26-32 use YAML::Syck; Link Here
26
use Pod::Usage;
26
use Pod::Usage;
27
use Getopt::Long;
27
use Getopt::Long;
28
28
29
use Koha::Cron;
29
use Koha::Script -cron;
30
use C4::Context;
30
use C4::Context;
31
use C4::Log;
31
use C4::Log;
32
32
(-)a/misc/cronjobs/create_koc_db.pl (-1 / +1 lines)
Lines 95-101 use DBI; Link Here
95
use Getopt::Long;
95
use Getopt::Long;
96
use Pod::Usage;
96
use Pod::Usage;
97
97
98
use Koha::Cron;
98
use Koha::Script -cron;
99
use C4::Context;
99
use C4::Context;
100
use English qw(-no_match_vars);
100
use English qw(-no_match_vars);
101
101
(-)a/misc/cronjobs/delete_expired_opac_registrations.pl (-1 / +1 lines)
Lines 28-34 BEGIN { Link Here
28
    eval { my $lib = "$FindBin::Bin/../kohalib.pl"; require $lib };
28
    eval { my $lib = "$FindBin::Bin/../kohalib.pl"; require $lib };
29
}
29
}
30
30
31
use Koha::Cron;
31
use Koha::Script -cron;
32
use C4::Context;
32
use C4::Context;
33
33
34
my $help;
34
my $help;
(-)a/misc/cronjobs/delete_items.pl (-1 / +1 lines)
Lines 2-8 Link Here
2
2
3
use Getopt::Long;
3
use Getopt::Long;
4
4
5
use Koha::Cron;
5
use Koha::Script -cron;
6
use C4::Context;
6
use C4::Context;
7
use C4::Items;
7
use C4::Items;
8
use C4::Circulation;
8
use C4::Circulation;
(-)a/misc/cronjobs/delete_patrons.pl (-1 / +1 lines)
Lines 5-11 use Modern::Perl; Link Here
5
use Pod::Usage;
5
use Pod::Usage;
6
use Getopt::Long;
6
use Getopt::Long;
7
7
8
use Koha::Cron;
8
use Koha::Script -cron;
9
use C4::Members;
9
use C4::Members;
10
use Koha::DateUtils;
10
use Koha::DateUtils;
11
use Koha::Patrons;
11
use Koha::Patrons;
(-)a/misc/cronjobs/delete_records_via_leader.pl (-1 / +1 lines)
Lines 33-39 BEGIN { Link Here
33
33
34
use Getopt::Long;
34
use Getopt::Long;
35
use Pod::Usage;
35
use Pod::Usage;
36
use Koha::Cron;
36
use Koha::Script -cron;
37
use C4::Biblio;
37
use C4::Biblio;
38
use C4::Items;
38
use C4::Items;
39
use Koha::Database;
39
use Koha::Database;
(-)a/misc/cronjobs/edi_cron.pl (-1 / +1 lines)
Lines 29-35 use utf8; Link Here
29
# can be run as frequently as required
29
# can be run as frequently as required
30
# log messages are appended to logdir/editrace.log
30
# log messages are appended to logdir/editrace.log
31
31
32
use Koha::Cron;
32
use Koha::Script -cron;
33
use C4::Context;
33
use C4::Context;
34
use Log::Log4perl qw(:easy);
34
use Log::Log4perl qw(:easy);
35
use Koha::Database;
35
use Koha::Database;
(-)a/misc/cronjobs/fines.pl (-1 / +1 lines)
Lines 30-36 use strict; Link Here
30
use warnings;
30
use warnings;
31
use 5.010;
31
use 5.010;
32
32
33
use Koha::Cron;
33
use Koha::Script -cron;
34
use C4::Context;
34
use C4::Context;
35
use C4::Overdues;
35
use C4::Overdues;
36
use Getopt::Long;
36
use Getopt::Long;
(-)a/misc/cronjobs/gather_print_notices.pl (-1 / +1 lines)
Lines 10-16 BEGIN { Link Here
10
}
10
}
11
11
12
use CGI qw( utf8 ); # NOT a CGI script, this is just to keep C4::Templates::gettemplate happy
12
use CGI qw( utf8 ); # NOT a CGI script, this is just to keep C4::Templates::gettemplate happy
13
use Koha::Cron;
13
use Koha::Script -cron;
14
use C4::Context;
14
use C4::Context;
15
use C4::Debug;
15
use C4::Debug;
16
use C4::Letters;
16
use C4::Letters;
(-)a/misc/cronjobs/holds/auto_unsuspend_holds.pl (-1 / +1 lines)
Lines 29-35 BEGIN { Link Here
29
29
30
# cancel all expired hold requests
30
# cancel all expired hold requests
31
31
32
use Koha::Cron;
32
use Koha::Script -cron;
33
use C4::Reserves;
33
use C4::Reserves;
34
use C4::Log;
34
use C4::Log;
35
35
(-)a/misc/cronjobs/holds/build_holds_queue.pl (-1 / +1 lines)
Lines 15-21 BEGIN { Link Here
15
    eval { require "$FindBin::Bin/../kohalib.pl" };
15
    eval { require "$FindBin::Bin/../kohalib.pl" };
16
}
16
}
17
17
18
use Koha::Cron;
18
use Koha::Script -cron;
19
use C4::HoldsQueue qw(CreateQueue);
19
use C4::HoldsQueue qw(CreateQueue);
20
use C4::Log;
20
use C4::Log;
21
21
(-)a/misc/cronjobs/holds/cancel_expired_holds.pl (-1 / +1 lines)
Lines 29-35 BEGIN { Link Here
29
29
30
# cancel all expired hold requests
30
# cancel all expired hold requests
31
31
32
use Koha::Cron;
32
use Koha::Script -cron;
33
use C4::Reserves;
33
use C4::Reserves;
34
use C4::Log;
34
use C4::Log;
35
35
(-)a/misc/cronjobs/holds/cancel_unfilled_holds.pl (-1 / +1 lines)
Lines 28-34 BEGIN { Link Here
28
use Getopt::Long;
28
use Getopt::Long;
29
use Pod::Usage;
29
use Pod::Usage;
30
30
31
use Koha::Cron;
31
use Koha::Script -cron;
32
use C4::Reserves;
32
use C4::Reserves;
33
use C4::Log;
33
use C4::Log;
34
use Koha::Holds;
34
use Koha::Holds;
(-)a/misc/cronjobs/import_webservice_batch.pl (-1 / +1 lines)
Lines 31-37 BEGIN { Link Here
31
31
32
use Getopt::Long;
32
use Getopt::Long;
33
use Pod::Usage;
33
use Pod::Usage;
34
use Koha::Cron;
34
use Koha::Script -cron;
35
use C4::ImportBatch;
35
use C4::ImportBatch;
36
36
37
my ($help, $framework);
37
my ($help, $framework);
(-)a/misc/cronjobs/j2a.pl (-1 / +1 lines)
Lines 26-32 BEGIN { Link Here
26
    eval { require "$FindBin::Bin/../kohalib.pl" };
26
    eval { require "$FindBin::Bin/../kohalib.pl" };
27
}
27
}
28
28
29
use Koha::Cron;
29
use Koha::Script -cron;
30
use C4::Context;
30
use C4::Context;
31
use C4::Members;
31
use C4::Members;
32
use Getopt::Long;
32
use Getopt::Long;
(-)a/misc/cronjobs/longoverdue.pl (-1 / +1 lines)
Lines 34-40 BEGIN { Link Here
34
    eval { require "$FindBin::Bin/../kohalib.pl" };
34
    eval { require "$FindBin::Bin/../kohalib.pl" };
35
}
35
}
36
36
37
use Koha::Cron;
37
use Koha::Script -cron;
38
use C4::Context;
38
use C4::Context;
39
use C4::Items;
39
use C4::Items;
40
use C4::Circulation qw/LostItem MarkIssueReturned/;
40
use C4::Circulation qw/LostItem MarkIssueReturned/;
(-)a/misc/cronjobs/membership_expiry.pl (-1 / +1 lines)
Lines 126-132 BEGIN { Link Here
126
    eval { require "$FindBin::Bin/../kohalib.pl" };
126
    eval { require "$FindBin::Bin/../kohalib.pl" };
127
}
127
}
128
128
129
use Koha::Cron;
129
use Koha::Script -cron;
130
use C4::Context;
130
use C4::Context;
131
use C4::Letters;
131
use C4::Letters;
132
use C4::Log;
132
use C4::Log;
(-)a/misc/cronjobs/merge_authorities.pl (-1 / +1 lines)
Lines 5-11 use Getopt::Long; Link Here
5
use Pod::Usage;
5
use Pod::Usage;
6
use Time::HiRes qw(gettimeofday);
6
use Time::HiRes qw(gettimeofday);
7
7
8
use Koha::Cron;
8
use Koha::Script -cron;
9
use C4::AuthoritiesMarc;
9
use C4::AuthoritiesMarc;
10
use Koha::Authority::MergeRequests;
10
use Koha::Authority::MergeRequests;
11
11
(-)a/misc/cronjobs/notice_unprocessed_suggestions.pl (-1 / +1 lines)
Lines 5-11 use Modern::Perl; Link Here
5
use Pod::Usage;
5
use Pod::Usage;
6
use Getopt::Long;
6
use Getopt::Long;
7
7
8
use Koha::Cron;
8
use Koha::Script -cron;
9
use C4::Budgets qw( GetBudget );
9
use C4::Budgets qw( GetBudget );
10
use C4::Suggestions qw( GetUnprocessedSuggestions );
10
use C4::Suggestions qw( GetUnprocessedSuggestions );
11
use Koha::Libraries;
11
use Koha::Libraries;
(-)a/misc/cronjobs/overdue_notices.pl (-1 / +1 lines)
Lines 34-40 use Text::CSV_XS; Link Here
34
use DateTime;
34
use DateTime;
35
use DateTime::Duration;
35
use DateTime::Duration;
36
36
37
use Koha::Cron;
37
use Koha::Script -cron;
38
use C4::Context;
38
use C4::Context;
39
use C4::Letters;
39
use C4::Letters;
40
use C4::Overdues qw(GetFine GetOverdueMessageTransportTypes parse_overdues_letter);
40
use C4::Overdues qw(GetFine GetOverdueMessageTransportTypes parse_overdues_letter);
(-)a/misc/cronjobs/process_message_queue.pl (-1 / +1 lines)
Lines 26-32 BEGIN { Link Here
26
    eval { require "$FindBin::Bin/../kohalib.pl" };
26
    eval { require "$FindBin::Bin/../kohalib.pl" };
27
}
27
}
28
28
29
use Koha::Cron;
29
use Koha::Script -cron;
30
use C4::Letters;
30
use C4::Letters;
31
use C4::Log;
31
use C4::Log;
32
use Getopt::Long;
32
use Getopt::Long;
(-)a/misc/cronjobs/purge_suggestions.pl (-1 / +1 lines)
Lines 29-35 BEGIN { Link Here
29
use Getopt::Long;
29
use Getopt::Long;
30
use Pod::Usage;
30
use Pod::Usage;
31
31
32
use Koha::Cron;
32
use Koha::Script -cron;
33
use C4::Suggestions;
33
use C4::Suggestions;
34
use C4::Log;
34
use C4::Log;
35
use C4::Context;
35
use C4::Context;
(-)a/misc/cronjobs/reconcile_balances.pl (-1 / +1 lines)
Lines 62-68 BEGIN { Link Here
62
    eval { require "$FindBin::Bin/../kohalib.pl" };
62
    eval { require "$FindBin::Bin/../kohalib.pl" };
63
}
63
}
64
64
65
use Koha::Cron;
65
use Koha::Script -cron;
66
use C4::Log;
66
use C4::Log;
67
67
68
use Koha::Account::Lines;
68
use Koha::Account::Lines;
(-)a/misc/cronjobs/remove_temporary_edifiles.pl (-1 / +1 lines)
Lines 2-8 Link Here
2
use strict;
2
use strict;
3
use warnings;
3
use warnings;
4
4
5
use Koha::Cron;
5
use Koha::Script -cron;
6
use C4::Context;
6
use C4::Context;
7
7
8
# this script will remove those older than 5 days
8
# this script will remove those older than 5 days
(-)a/misc/cronjobs/rss/rss.pl (-1 / +1 lines)
Lines 29-35 use Modern::Perl; Link Here
29
29
30
use Template;
30
use Template;
31
31
32
use Koha::Cron;
32
use Koha::Script -cron;
33
use C4::Context;
33
use C4::Context;
34
use Time::Local;
34
use Time::Local;
35
use POSIX;
35
use POSIX;
(-)a/misc/cronjobs/runreport.pl (-1 / +1 lines)
Lines 20-26 Link Here
20
20
21
use Modern::Perl;
21
use Modern::Perl;
22
22
23
use Koha::Cron;
23
use Koha::Script -cron;
24
use C4::Reports::Guided; # 0.12
24
use C4::Reports::Guided; # 0.12
25
use Koha::Reports;
25
use Koha::Reports;
26
use C4::Context;
26
use C4::Context;
(-)a/misc/cronjobs/serialsUpdate.pl (-1 / +1 lines)
Lines 28-34 BEGIN { Link Here
28
    eval { require "$FindBin::Bin/../kohalib.pl" };
28
    eval { require "$FindBin::Bin/../kohalib.pl" };
29
}
29
}
30
30
31
use Koha::Cron;
31
use Koha::Script -cron;
32
use C4::Context;
32
use C4::Context;
33
use C4::Debug;
33
use C4::Debug;
34
use C4::Serials;
34
use C4::Serials;
(-)a/misc/cronjobs/share_usage_with_koha_community.pl (-1 / +1 lines)
Lines 5-11 use Modern::Perl; Link Here
5
use Pod::Usage;
5
use Pod::Usage;
6
use Getopt::Long;
6
use Getopt::Long;
7
7
8
use Koha::Cron;
8
use Koha::Script -cron;
9
use C4::Context;
9
use C4::Context;
10
use C4::UsageStats;
10
use C4::UsageStats;
11
use C4::Log;
11
use C4::Log;
(-)a/misc/cronjobs/sitemap.pl (-1 / +1 lines)
Lines 24-30 use utf8; Link Here
24
use Pod::Usage;
24
use Pod::Usage;
25
use Getopt::Long;
25
use Getopt::Long;
26
26
27
use Koha::Cron;
27
use Koha::Script -cron;
28
use C4::Biblio;
28
use C4::Biblio;
29
use Koha::Sitemapper;
29
use Koha::Sitemapper;
30
30
(-)a/misc/cronjobs/social_data/get_report_social_data.pl (-1 / +1 lines)
Lines 2-8 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Koha::Cron;
5
use Koha::Script -cron;
6
use C4::SocialData;
6
use C4::SocialData;
7
7
8
my $results = C4::SocialData::get_report;
8
my $results = C4::SocialData::get_report;
(-)a/misc/cronjobs/social_data/update_social_data.pl (-1 / +1 lines)
Lines 2-8 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Koha::Cron;
5
use Koha::Script -cron;
6
use C4::Context;
6
use C4::Context;
7
use C4::SocialData;
7
use C4::SocialData;
8
8
(-)a/misc/cronjobs/staticfines.pl (-1 / +1 lines)
Lines 37-43 BEGIN { Link Here
37
37
38
use Date::Calc qw/Date_to_Days/;
38
use Date::Calc qw/Date_to_Days/;
39
39
40
use Koha::Cron;
40
use Koha::Script -cron;
41
use C4::Context;
41
use C4::Context;
42
use C4::Circulation;
42
use C4::Circulation;
43
use C4::Overdues;
43
use C4::Overdues;
(-)a/misc/cronjobs/stockrotation.pl (-1 / +1 lines)
Lines 110-116 database updates have been performed."). Link Here
110
use Modern::Perl;
110
use Modern::Perl;
111
use Getopt::Long qw/HelpMessage :config gnu_getopt/;
111
use Getopt::Long qw/HelpMessage :config gnu_getopt/;
112
112
113
use Koha::Cron;
113
use Koha::Script -cron;
114
use C4::Context;
114
use C4::Context;
115
use C4::Letters;
115
use C4::Letters;
116
use Koha::StockRotationRotas;
116
use Koha::StockRotationRotas;
(-)a/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl (-1 / +1 lines)
Lines 31-37 BEGIN { Link Here
31
use Getopt::Long;
31
use Getopt::Long;
32
use Pod::Usage;
32
use Pod::Usage;
33
33
34
use Koha::Cron;
34
use Koha::Script -cron;
35
use C4::Context;
35
use C4::Context;
36
36
37
sub usage {
37
sub usage {
(-)a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl (-1 / +1 lines)
Lines 31-37 BEGIN { Link Here
31
use Getopt::Long;
31
use Getopt::Long;
32
use Pod::Usage;
32
use Pod::Usage;
33
33
34
use Koha::Cron;
34
use Koha::Script -cron;
35
use C4::Context;
35
use C4::Context;
36
use C4::Items;
36
use C4::Items;
37
use C4::Letters;
37
use C4::Letters;
(-)a/misc/cronjobs/update_totalissues.pl (-1 / +1 lines)
Lines 31-37 BEGIN { Link Here
31
use Getopt::Long;
31
use Getopt::Long;
32
use Pod::Usage;
32
use Pod::Usage;
33
33
34
use Koha::Cron;
34
use Koha::Script -cron;
35
use C4::Context;
35
use C4::Context;
36
use C4::Biblio;
36
use C4::Biblio;
37
use C4::Log;
37
use C4::Log;
(-)a/misc/devel/create_superlibrarian.pl (+1 lines)
Lines 21-26 use Modern::Perl; Link Here
21
use Getopt::Long;
21
use Getopt::Long;
22
use Pod::Usage;
22
use Pod::Usage;
23
23
24
use Koha::Script;
24
use Koha::Patrons;
25
use Koha::Patrons;
25
26
26
my ( $help, $surname, $userid, $password, $branchcode, $categorycode, $cardnumber );
27
my ( $help, $surname, $userid, $password, $branchcode, $categorycode, $cardnumber );
(-)a/misc/devel/populate_db.pl (+1 lines)
Lines 22-27 use Modern::Perl; Link Here
22
use Getopt::Long;
22
use Getopt::Long;
23
use Pod::Usage;
23
use Pod::Usage;
24
24
25
use Koha::Script;
25
use C4::Installer;
26
use C4::Installer;
26
use C4::Context;
27
use C4::Context;
27
28
(-)a/misc/export_borrowers.pl (+1 lines)
Lines 23-28 use Modern::Perl; Link Here
23
use Text::CSV;
23
use Text::CSV;
24
use Getopt::Long qw(:config no_ignore_case);
24
use Getopt::Long qw(:config no_ignore_case);
25
25
26
use Koha::Script;
26
use C4::Context;
27
use C4::Context;
27
use Koha::Patrons;
28
use Koha::Patrons;
28
29
(-)a/misc/export_records.pl (+1 lines)
Lines 22-27 use List::MoreUtils qw(uniq); Link Here
22
use Getopt::Long;
22
use Getopt::Long;
23
use Pod::Usage;
23
use Pod::Usage;
24
24
25
use Koha::Script;
25
use C4::Auth;
26
use C4::Auth;
26
use C4::Context;
27
use C4::Context;
27
use C4::Record;
28
use C4::Record;
(-)a/misc/exportauth.pl (+1 lines)
Lines 12-17 BEGIN { Link Here
12
    eval { require "$FindBin::Bin/kohalib.pl" };
12
    eval { require "$FindBin::Bin/kohalib.pl" };
13
}
13
}
14
14
15
use Koha::Script;
15
use C4::Context;
16
use C4::Context;
16
use C4::Biblio;
17
use C4::Biblio;
17
use C4::Auth;
18
use C4::Auth;
(-)a/misc/import_patrons.pl (+1 lines)
Lines 22-27 use Modern::Perl; Link Here
22
use Getopt::Long;
22
use Getopt::Long;
23
use Pod::Usage;
23
use Pod::Usage;
24
24
25
use Koha::Script;
25
use Koha::Patrons::Import;
26
use Koha::Patrons::Import;
26
my $Import = Koha::Patrons::Import->new();
27
my $Import = Koha::Patrons::Import->new();
27
28
(-)a/misc/link_bibs_to_authorities.pl (+1 lines)
Lines 11-16 BEGIN { Link Here
11
    eval { require "$FindBin::Bin/kohalib.pl" };
11
    eval { require "$FindBin::Bin/kohalib.pl" };
12
}
12
}
13
13
14
use Koha::Script;
14
use C4::Context;
15
use C4::Context;
15
use C4::Biblio;
16
use C4::Biblio;
16
use Getopt::Long;
17
use Getopt::Long;
(-)a/misc/maintenance/UNIMARC_fix_collectiontitle.pl (+1 lines)
Lines 12-17 BEGIN { Link Here
12
    eval { require "$FindBin::Bin/../kohalib.pl" };
12
    eval { require "$FindBin::Bin/../kohalib.pl" };
13
}
13
}
14
14
15
use Koha::Script;
15
use C4::Biblio;
16
use C4::Biblio;
16
17
17
sub process {
18
sub process {
(-)a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl (+1 lines)
Lines 12-17 BEGIN { Link Here
12
    eval { require "$FindBin::Bin/../kohalib.pl" };
12
    eval { require "$FindBin::Bin/../kohalib.pl" };
13
}
13
}
14
14
15
use Koha::Script;
15
use C4::Biblio;
16
use C4::Biblio;
16
use Getopt::Long;
17
use Getopt::Long;
17
18
(-)a/misc/maintenance/auth_show_hidden_data.pl (+1 lines)
Lines 25-30 use Modern::Perl; Link Here
25
use Getopt::Long;
25
use Getopt::Long;
26
use Pod::Usage;
26
use Pod::Usage;
27
27
28
use Koha::Script;
28
use Koha::Authorities;
29
use Koha::Authorities;
29
use Koha::Authority::Subfields;
30
use Koha::Authority::Subfields;
30
use Koha::MetadataRecord::Authority;
31
use Koha::MetadataRecord::Authority;
(-)a/misc/maintenance/borrowers-force-messaging-defaults.pl (+1 lines)
Lines 26-31 BEGIN { Link Here
26
    eval { require "$FindBin::Bin/../kohalib.pl" };
26
    eval { require "$FindBin::Bin/../kohalib.pl" };
27
}
27
}
28
28
29
use Koha::Script;
29
use C4::Context;
30
use C4::Context;
30
use C4::Members::Messaging;
31
use C4::Members::Messaging;
31
use Getopt::Long;
32
use Getopt::Long;
(-)a/misc/maintenance/cmp_sysprefs.pl (+1 lines)
Lines 30-35 use open OUT => ':encoding(UTF-8)', ':std'; Link Here
30
use Getopt::Long;
30
use Getopt::Long;
31
use Pod::Usage;
31
use Pod::Usage;
32
32
33
use Koha::Script;
33
use C4::Context;
34
use C4::Context;
34
my $dbh = C4::Context->dbh;
35
my $dbh = C4::Context->dbh;
35
36
(-)a/misc/maintenance/fix_accountlines_date.pl (+1 lines)
Lines 26-31 BEGIN { Link Here
26
    eval { require "$FindBin::Bin/../kohalib.pl" };
26
    eval { require "$FindBin::Bin/../kohalib.pl" };
27
}
27
}
28
28
29
use Koha::Script;
29
use C4::Context;
30
use C4::Context;
30
use Getopt::Long;
31
use Getopt::Long;
31
use Pod::Usage;
32
use Pod::Usage;
(-)a/misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl (+1 lines)
Lines 27-32 BEGIN { Link Here
27
    eval { require "$FindBin::Bin/../kohalib.pl" };
27
    eval { require "$FindBin::Bin/../kohalib.pl" };
28
}
28
}
29
29
30
use Koha::Script;
30
use C4::Context;
31
use C4::Context;
31
use C4::Installer;
32
use C4::Installer;
32
33
(-)a/misc/maintenance/fix_mysql_constraints.pl (+1 lines)
Lines 30-35 use Getopt::Long; Link Here
30
use Pod::Usage;
30
use Pod::Usage;
31
use YAML;
31
use YAML;
32
use Try::Tiny;
32
use Try::Tiny;
33
use Koha::Script;
33
use C4::Context;
34
use C4::Context;
34
35
35
36
(-)a/misc/maintenance/fix_tags_weight.pl (+1 lines)
Lines 22-27 use Modern::Perl; Link Here
22
use C4::Context;
22
use C4::Context;
23
use C4::Tags;
23
use C4::Tags;
24
24
25
use Koha::Script;
25
use Koha::Database;
26
use Koha::Database;
26
use Koha::Tags;
27
use Koha::Tags;
27
use Koha::Tags::Approvals;
28
use Koha::Tags::Approvals;
(-)a/misc/maintenance/make_zebra_dom_cfg_from_record_abs (+1 lines)
Lines 20-25 use strict; Link Here
20
use warnings;
20
use warnings;
21
use 5.010;
21
use 5.010;
22
22
23
use Koha::Script;
23
use Koha::Indexer::Utils;
24
use Koha::Indexer::Utils;
24
25
25
use Getopt::Long;
26
use Getopt::Long;
(-)a/misc/maintenance/process_record_through_filter.pl (+2 lines)
Lines 6-11 Link Here
6
6
7
use strict;
7
use strict;
8
use warnings;
8
use warnings;
9
10
use Koha::Script;
9
use Koha::RecordProcessor;
11
use Koha::RecordProcessor;
10
use Data::Dumper;
12
use Data::Dumper;
11
use C4::Biblio;
13
use C4::Biblio;
(-)a/misc/maintenance/remove_items_from_biblioitems.pl (+1 lines)
Lines 22-27 use strict; Link Here
22
use warnings;
22
use warnings;
23
$|=1;
23
$|=1;
24
24
25
use Koha::Script;
25
use C4::Context;
26
use C4::Context;
26
use C4::Biblio;
27
use C4::Biblio;
27
use Getopt::Long;
28
use Getopt::Long;
(-)a/misc/maintenance/sanitize_records.pl (+2 lines)
Lines 18-23 Link Here
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
22
use Koha::Script;
21
use C4::Charset qw( SanitizeRecord );
23
use C4::Charset qw( SanitizeRecord );
22
use C4::Context;
24
use C4::Context;
23
use DBI;
25
use DBI;
(-)a/misc/maintenance/search_for_data_inconsistencies.pl (+1 lines)
Lines 17-22 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Script;
20
use Koha::Items;
21
use Koha::Items;
21
use Koha::Biblioitems;
22
use Koha::Biblioitems;
22
use Koha::ItemTypes;
23
use Koha::ItemTypes;
(-)a/misc/maintenance/touch_all_biblios.pl (+2 lines)
Lines 28-33 BEGIN { Link Here
28
28
29
# possible modules to use
29
# possible modules to use
30
use Getopt::Long;
30
use Getopt::Long;
31
32
use Koha::Script;
31
use C4::Context;
33
use C4::Context;
32
use C4::Biblio;
34
use C4::Biblio;
33
use Pod::Usage;
35
use Pod::Usage;
(-)a/misc/maintenance/touch_all_items.pl (+2 lines)
Lines 28-33 BEGIN { Link Here
28
28
29
# possible modules to use
29
# possible modules to use
30
use Getopt::Long;
30
use Getopt::Long;
31
32
use Koha::Script;
31
use C4::Context;
33
use C4::Context;
32
use C4::Items;
34
use C4::Items;
33
use Pod::Usage;
35
use Pod::Usage;
(-)a/misc/maintenance/update_authorities.pl (+1 lines)
Lines 23-28 use Getopt::Long; Link Here
23
use List::MoreUtils qw/uniq/;
23
use List::MoreUtils qw/uniq/;
24
use Pod::Usage;
24
use Pod::Usage;
25
25
26
use Koha::Script;
26
use C4::AuthoritiesMarc qw/AddAuthority DelAuthority GetAuthority merge/;
27
use C4::AuthoritiesMarc qw/AddAuthority DelAuthority GetAuthority merge/;
27
28
28
my ( @authid, $confirm, $delete, $help, $merge, $reference, $renumber, $verbose );
29
my ( @authid, $confirm, $delete, $help, $merge, $reference, $renumber, $verbose );
(-)a/misc/migration_tools/buildCOUNTRY.pl (+1 lines)
Lines 6-11 use strict; Link Here
6
#use warnings; FIXME - Bug 2505
6
#use warnings; FIXME - Bug 2505
7
7
8
# Koha modules used
8
# Koha modules used
9
use Koha::Script;
9
use C4::Context;
10
use C4::Context;
10
use C4::Biblio;
11
use C4::Biblio;
11
use C4::AuthoritiesMarc;
12
use C4::AuthoritiesMarc;
(-)a/misc/migration_tools/buildEDITORS.pl (+1 lines)
Lines 8-13 use strict; Link Here
8
use MARC::File::USMARC;
8
use MARC::File::USMARC;
9
use MARC::Record;
9
use MARC::Record;
10
use MARC::Batch;
10
use MARC::Batch;
11
use Koha::Script;
11
use C4::Context;
12
use C4::Context;
12
use C4::Biblio;
13
use C4::Biblio;
13
use C4::AuthoritiesMarc;
14
use C4::AuthoritiesMarc;
(-)a/misc/migration_tools/buildLANG.pl (+1 lines)
Lines 6-11 use strict; Link Here
6
#use warnings; FIXME - Bug 2505
6
#use warnings; FIXME - Bug 2505
7
7
8
# Koha modules used
8
# Koha modules used
9
use Koha::Script;
9
use C4::Context;
10
use C4::Context;
10
use C4::Biblio;
11
use C4::Biblio;
11
use C4::AuthoritiesMarc;
12
use C4::AuthoritiesMarc;
(-)a/misc/migration_tools/build_oai_sets.pl (+1 lines)
Lines 42-47 use MARC::File::XML; Link Here
42
use List::MoreUtils qw/uniq/;
42
use List::MoreUtils qw/uniq/;
43
use Getopt::Std;
43
use Getopt::Std;
44
44
45
use Koha::Script;
45
use C4::Context;
46
use C4::Context;
46
use C4::Charset qw/StripNonXmlChars/;
47
use C4::Charset qw/StripNonXmlChars/;
47
use C4::Biblio;
48
use C4::Biblio;
(-)a/misc/migration_tools/bulkmarcimport.pl (+1 lines)
Lines 17-22 use MARC::Record; Link Here
17
use MARC::Batch;
17
use MARC::Batch;
18
use MARC::Charset;
18
use MARC::Charset;
19
19
20
use Koha::Script;
20
use C4::Context;
21
use C4::Context;
21
use C4::Biblio;
22
use C4::Biblio;
22
use C4::Koha;
23
use C4::Koha;
(-)a/misc/migration_tools/checkNonIndexedBiblios.pl (+1 lines)
Lines 33-38 BEGIN { Link Here
33
33
34
# Koha modules used
34
# Koha modules used
35
use MARC::Record;
35
use MARC::Record;
36
use Koha::Script;
36
use C4::Context;
37
use C4::Context;
37
use Getopt::Long;
38
use Getopt::Long;
38
39
(-)a/misc/migration_tools/create_analytical_rel.pl (+1 lines)
Lines 9-14 BEGIN { Link Here
9
    eval { require "$FindBin::Bin/../kohalib.pl" };
9
    eval { require "$FindBin::Bin/../kohalib.pl" };
10
}
10
}
11
11
12
use Koha::Script;
12
use C4::Context;
13
use C4::Context;
13
use C4::Biblio;
14
use C4::Biblio;
14
use C4::Items;
15
use C4::Items;
(-)a/misc/migration_tools/fix_onloan.pl (-1 / +3 lines)
Lines 2-8 Link Here
2
2
3
use strict;
3
use strict;
4
#use warnings; FIXME - Bug 2505
4
#use warnings; FIXME - Bug 2505
5
use  C4::Context;
5
6
use Koha::Script;
7
use C4::Context;
6
use C4::Items;
8
use C4::Items;
7
use C4::Biblio;
9
use C4::Biblio;
8
10
(-)a/misc/migration_tools/import_lexile.pl (+1 lines)
Lines 31-36 use Modern::Perl; Link Here
31
use Getopt::Long;
31
use Getopt::Long;
32
use Text::CSV;
32
use Text::CSV;
33
33
34
use Koha::Script;
34
use C4::Context;
35
use C4::Context;
35
use C4::Biblio;
36
use C4::Biblio;
36
use C4::Koha qw( GetVariationsOfISBN );
37
use C4::Koha qw( GetVariationsOfISBN );
(-)a/misc/migration_tools/rebuild_zebra.pl (+1 lines)
Lines 17-22 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Script;
20
use C4::Context;
21
use C4::Context;
21
use Getopt::Long;
22
use Getopt::Long;
22
use Fcntl qw(:flock);
23
use Fcntl qw(:flock);
(-)a/misc/migration_tools/remove_unused_authorities.pl (+1 lines)
Lines 23-28 Link Here
23
use strict;
23
use strict;
24
use warnings;
24
use warnings;
25
25
26
use Koha::Script;
26
use C4::Context;
27
use C4::Context;
27
use C4::AuthoritiesMarc;
28
use C4::AuthoritiesMarc;
28
use Getopt::Long;
29
use Getopt::Long;
(-)a/misc/migration_tools/switch_marc21_series_info.pl (+1 lines)
Lines 29-34 BEGIN { Link Here
29
    eval { require "$FindBin::Bin/../kohalib.pl" };
29
    eval { require "$FindBin::Bin/../kohalib.pl" };
30
}
30
}
31
31
32
use Koha::Script;
32
use C4::Biblio;
33
use C4::Biblio;
33
use C4::Context;
34
use C4::Context;
34
use Getopt::Long;
35
use Getopt::Long;
(-)a/misc/migration_tools/upgradeitems.pl (-1 / +3 lines)
Lines 2-8 Link Here
2
2
3
use strict;
3
use strict;
4
#use warnings; FIXME - Bug 2505
4
#use warnings; FIXME - Bug 2505
5
use  C4::Context;
5
6
use Koha::Script;
7
use C4::Context;
6
use C4::Items;
8
use C4::Items;
7
use C4::Biblio;
9
use C4::Biblio;
8
10
(-)a/misc/mod_zebraqueue.pl (+1 lines)
Lines 23-28 use Modern::Perl; Link Here
23
use Getopt::Long;
23
use Getopt::Long;
24
use Pod::Usage;
24
use Pod::Usage;
25
25
26
use Koha::Script;
26
use C4::Biblio;
27
use C4::Biblio;
27
28
28
my @biblios;
29
my @biblios;
(-)a/misc/recreateIssueStatistics.pl (+2 lines)
Lines 22-27 Link Here
22
22
23
use strict;
23
use strict;
24
use warnings;
24
use warnings;
25
26
use Koha::Script;
25
use C4::Context;
27
use C4::Context;
26
use C4::Items;
28
use C4::Items;
27
use Data::Dumper;
29
use Data::Dumper;
(-)a/misc/search_tools/rebuild_elastic_search.pl (+1 lines)
Lines 83-88 Full documentation. Link Here
83
83
84
use autodie;
84
use autodie;
85
use Getopt::Long;
85
use Getopt::Long;
86
use Koha::Script;
86
use C4::Context;
87
use C4::Context;
87
use Koha::MetadataRecord::Authority;
88
use Koha::MetadataRecord::Authority;
88
use Koha::BiblioUtils;
89
use Koha::BiblioUtils;
(-)a/misc/stage_file.pl (+1 lines)
Lines 27-32 BEGIN { Link Here
27
    eval { require "$FindBin::Bin/kohalib.pl" };
27
    eval { require "$FindBin::Bin/kohalib.pl" };
28
}
28
}
29
29
30
use Koha::Script;
30
use C4::Context;
31
use C4::Context;
31
use C4::ImportBatch;
32
use C4::ImportBatch;
32
use C4::Matcher;
33
use C4::Matcher;
(-)a/t/Koha/Script.t (+48 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use Test::More tests => 3;
21
22
BEGIN { use_ok('Koha::Script') }
23
24
use C4::Context;
25
26
my $userenv = C4::Context->userenv;
27
is_deeply(
28
    $userenv,
29
    {
30
        'surname'       => 'CLI',
31
        'id'            => undef,
32
        'flags'         => undef,
33
        'cardnumber'    => undef,
34
        'firstname'     => 'CLI',
35
        'branchname'    => undef,
36
        'branchprinter' => undef,
37
        'emailaddress'  => undef,
38
        'number'        => undef,
39
        'shibboleth'    => undef,
40
        'branch'        => undef
41
    },
42
    "Context userenv set correctly with no flags"
43
);
44
45
my $interface = C4::Context->interface;
46
is( $interface, 'commandline', "Context interface set correctly with no flags" );
47
48
1;
(-)a/t/Koha/Cron.t (-4 / +3 lines)
Lines 19-25 use Modern::Perl; Link Here
19
19
20
use Test::More tests => 3;
20
use Test::More tests => 3;
21
21
22
BEGIN { use_ok('Koha::Cron') }
22
BEGIN { use_ok( "Koha::Script", '-cron' ) }
23
23
24
use C4::Context;
24
use C4::Context;
25
25
Lines 39-48 is_deeply( Link Here
39
        'shibboleth'    => undef,
39
        'shibboleth'    => undef,
40
        'branch'        => undef
40
        'branch'        => undef
41
    },
41
    },
42
    "Context userenv set correctly"
42
    "Context userenv set correctly with -cron"
43
);
43
);
44
44
45
my $interface = C4::Context->interface;
45
my $interface = C4::Context->interface;
46
is($interface, 'cron', "Context interface set correctly");
46
is( $interface, 'cron', "Context interface set correctly with -cron" );
47
47
48
1;
48
1;
49
- 

Return to bug 22600