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

(-)a/.perlcriticrc (-1 / +1 lines)
Lines 1-5 Link Here
1
severity = 5
1
severity = 5
2
include = ProhibitUnusedVariables
2
include = ProhibitUnusedVariables Objects::ProhibitIndirectSyntax
3
exclude = Miscellanea::RequireRcsKeywords
3
exclude = Miscellanea::RequireRcsKeywords
4
4
5
[Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEval]
5
[Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEval]
(-)a/C4/Auth.pm (-1 / +1 lines)
Lines 1794-1800 sub _get_session_params { Link Here
1794
sub get_session {
1794
sub get_session {
1795
    my $sessionID      = shift;
1795
    my $sessionID      = shift;
1796
    my $params = _get_session_params();
1796
    my $params = _get_session_params();
1797
    return new CGI::Session( $params->{dsn}, $sessionID, $params->{dsn_args} );
1797
    return CGI::Session->new( $params->{dsn}, $sessionID, $params->{dsn_args} );
1798
}
1798
}
1799
1799
1800
1800
(-)a/C4/AuthoritiesMarc.pm (-1 / +1 lines)
Lines 227-233 sub SearchAuthorities { Link Here
227
    my @oAuth;
227
    my @oAuth;
228
    my $i;
228
    my $i;
229
    $oAuth[0]=C4::Context->Zconn("authorityserver" , 1);
229
    $oAuth[0]=C4::Context->Zconn("authorityserver" , 1);
230
    my $Anewq= new ZOOM::Query::PQF($query,$oAuth[0]);
230
    my $Anewq= ZOOM::Query::PQF->new($query,$oAuth[0]);
231
    my $oAResult;
231
    my $oAResult;
232
    $oAResult= $oAuth[0]->search($Anewq) ;
232
    $oAResult= $oAuth[0]->search($Anewq) ;
233
    while (($i = ZOOM::event(\@oAuth)) != 0) {
233
    while (($i = ZOOM::event(\@oAuth)) != 0) {
(-)a/C4/Breeding.pm (-3 / +3 lines)
Lines 159-165 sub Z3950Search { Link Here
159
        $oResult[$s] =
159
        $oResult[$s] =
160
            $server->{servertype} eq 'zed'?
160
            $server->{servertype} eq 'zed'?
161
                $oConnection[$s]->search_pqf( $server_zquery ):
161
                $oConnection[$s]->search_pqf( $server_zquery ):
162
                $oConnection[$s]->search(new ZOOM::Query::CQL(
162
                $oConnection[$s]->search(ZOOM::Query::CQL->new(
163
                    _translate_query( $server, $squery )));
163
                    _translate_query( $server, $squery )));
164
        $s++;
164
        $s++;
165
    }
165
    }
Lines 430-436 sub _isbn_replace { Link Here
430
430
431
sub _create_connection {
431
sub _create_connection {
432
    my ( $server ) = @_;
432
    my ( $server ) = @_;
433
    my $option1= new ZOOM::Options();
433
    my $option1= ZOOM::Options->new();
434
    $option1->option( 'async' => 1 );
434
    $option1->option( 'async' => 1 );
435
    $option1->option( 'elementSetName', 'F' );
435
    $option1->option( 'elementSetName', 'F' );
436
    $option1->option( 'preferredRecordSyntax', $server->{syntax} );
436
    $option1->option( 'preferredRecordSyntax', $server->{syntax} );
Lines 568-574 sub Z3950SearchAuth { Link Here
568
            }
568
            }
569
            else {
569
            else {
570
                $oResult[$s] = $oConnection[$s]->search(
570
                $oResult[$s] = $oConnection[$s]->search(
571
                    new ZOOM::Query::CQL(_translate_query( $server, $squery ))
571
                    ZOOM::Query::CQL->new(_translate_query( $server, $squery ))
572
                );
572
                );
573
            }
573
            }
574
            $encoding[$s]   = ($server->{encoding}?$server->{encoding}:"iso-5426");
574
            $encoding[$s]   = ($server->{encoding}?$server->{encoding}:"iso-5426");
(-)a/C4/Context.pm (-1 / +1 lines)
Lines 637-643 sub _new_Zconn { Link Here
637
    my $password = $context->{"serverinfo"}->{$server}->{"password"};
637
    my $password = $context->{"serverinfo"}->{$server}->{"password"};
638
    eval {
638
    eval {
639
        # set options
639
        # set options
640
        my $o = new ZOOM::Options();
640
        my $o = ZOOM::Options->new();
641
        $o->option(user => $user) if $user && $password;
641
        $o->option(user => $user) if $user && $password;
642
        $o->option(password => $password) if $user && $password;
642
        $o->option(password => $password) if $user && $password;
643
        $o->option(async => 1) if $async;
643
        $o->option(async => 1) if $async;
(-)a/C4/InstallAuth.pm (-2 / +2 lines)
Lines 243-249 sub checkauth { Link Here
243
    if ( $sessionID = $query->cookie("CGISESSID") ) {
243
    if ( $sessionID = $query->cookie("CGISESSID") ) {
244
        C4::Context->_new_userenv($sessionID);
244
        C4::Context->_new_userenv($sessionID);
245
        my $session =
245
        my $session =
246
          new CGI::Session( "driver:File;serializer:yaml", $sessionID,
246
          CGI::Session->new( "driver:File;serializer:yaml", $sessionID,
247
            { Directory => $sessdir } );
247
            { Directory => $sessdir } );
248
        if ( $session->param('cardnumber') ) {
248
        if ( $session->param('cardnumber') ) {
249
            C4::Context->set_userenv(
249
            C4::Context->set_userenv(
Lines 283-289 sub checkauth { Link Here
283
    }
283
    }
284
    unless ($userid) {
284
    unless ($userid) {
285
        my $session =
285
        my $session =
286
          new CGI::Session( "driver:File;serializer:yaml", undef, { Directory => $sessdir } );
286
          CGI::Session->new( "driver:File;serializer:yaml", undef, { Directory => $sessdir } );
287
        $sessionID = $session->id;
287
        $sessionID = $session->id;
288
        $userid    = $query->param('userid');
288
        $userid    = $query->param('userid');
289
        C4::Context->_new_userenv($sessionID);
289
        C4::Context->_new_userenv($sessionID);
(-)a/C4/Languages.pm (-1 / +1 lines)
Lines 603-609 sub getlanguage { Link Here
603
        return $cached if $cached;
603
        return $cached if $cached;
604
    }
604
    }
605
605
606
    $cgi //= new CGI;
606
    $cgi //= CGI->new;
607
    my $interface = C4::Context->interface;
607
    my $interface = C4::Context->interface;
608
    my $theme = C4::Context->preference( ( $interface eq 'opac' ) ? 'opacthemes' : 'template' );
608
    my $theme = C4::Context->preference( ( $interface eq 'opac' ) ? 'opacthemes' : 'template' );
609
    my $language;
609
    my $language;
(-)a/C4/Record.pm (-1 / +1 lines)
Lines 375-381 sub marc2endnote { Link Here
375
        Year => $marc_rec_obj->publication_date,
375
        Year => $marc_rec_obj->publication_date,
376
        Abstract => $abstract,
376
        Abstract => $abstract,
377
    };
377
    };
378
    my $style = new Biblio::EndnoteStyle();
378
    my $style = Biblio::EndnoteStyle->new();
379
    my $template;
379
    my $template;
380
    $template.= "DB - DB\n" if C4::Context->preference("LibraryName");
380
    $template.= "DB - DB\n" if C4::Context->preference("LibraryName");
381
    $template.="T1 - Title\n" if $marc_rec_obj->title();
381
    $template.="T1 - Title\n" if $marc_rec_obj->title();
(-)a/C4/SIP/Sip/Configuration.pm (-1 / +1 lines)
Lines 12-18 use XML::Simple qw(:strict); Link Here
12
12
13
use C4::SIP::Sip qw(siplog);
13
use C4::SIP::Sip qw(siplog);
14
14
15
my $parser = new XML::Simple(
15
my $parser = XML::Simple->new(
16
    KeyAttr => {
16
    KeyAttr => {
17
        login       => '+id',
17
        login       => '+id',
18
        institution => '+id',
18
        institution => '+id',
(-)a/C4/SIP/t/SIPtest.pm (-1 / +1 lines)
Lines 263-269 sub run_sip_tests { Link Here
263
    $Sip::error_detection = 1;
263
    $Sip::error_detection = 1;
264
    $/ = "\015\012";	# must use correct record separator
264
    $/ = "\015\012";	# must use correct record separator
265
265
266
    $sock = new IO::Socket::INET(PeerAddr => $server,
266
    $sock = IO::Socket::INET->new(PeerAddr => $server,
267
				 Type     => SOCK_STREAM);
267
				 Type     => SOCK_STREAM);
268
268
269
    BAIL_OUT('failed to create connection to server') unless $sock;
269
    BAIL_OUT('failed to create connection to server') unless $sock;
(-)a/C4/SIP/xmlparse.pl (-1 / +1 lines)
Lines 13-19 use English; Link Here
13
use XML::Simple qw(:strict);
13
use XML::Simple qw(:strict);
14
use Data::Dumper;
14
use Data::Dumper;
15
15
16
my $parser = new XML::Simple( KeyAttr   => { login => '+id',
16
my $parser = XML::Simple->new( KeyAttr   => { login => '+id',
17
					     institution => '+id',
17
					     institution => '+id',
18
					     service => '+port', },
18
					     service => '+port', },
19
			      GroupTags =>  { listeners => 'service',
19
			      GroupTags =>  { listeners => 'service',
(-)a/C4/Search.pm (-6 / +6 lines)
Lines 224-230 sub SimpleSearch { Link Here
224
        eval {
224
        eval {
225
            $zconns[$i] = C4::Context->Zconn( $servers[$i], 1 );
225
            $zconns[$i] = C4::Context->Zconn( $servers[$i], 1 );
226
            $query =~ s/:/=/g unless $options{skip_normalize};
226
            $query =~ s/:/=/g unless $options{skip_normalize};
227
            $zoom_queries[$i] = new ZOOM::Query::CCL2RPN( $query, $zconns[$i]);
227
            $zoom_queries[$i] = ZOOM::Query::CCL2RPN->new( $query, $zconns[$i]);
228
            $tmpresults[$i] = $zconns[$i]->search( $zoom_queries[$i] );
228
            $tmpresults[$i] = $zconns[$i]->search( $zoom_queries[$i] );
229
229
230
            # error handling
230
            # error handling
Lines 337-354 sub getRecords { Link Here
337
            if ($query_type) {
337
            if ($query_type) {
338
                if ($query_type =~ /^ccl/) {
338
                if ($query_type =~ /^ccl/) {
339
                    $query_to_use =~ s/\:/\=/g;    # change : to = last minute (FIXME)
339
                    $query_to_use =~ s/\:/\=/g;    # change : to = last minute (FIXME)
340
                    $results[$i] = $zconns[$i]->search(new ZOOM::Query::CCL2RPN($query_to_use, $zconns[$i]));
340
                    $results[$i] = $zconns[$i]->search(ZOOM::Query::CCL2RPN->new($query_to_use, $zconns[$i]));
341
                } elsif ($query_type =~ /^cql/) {
341
                } elsif ($query_type =~ /^cql/) {
342
                    $results[$i] = $zconns[$i]->search(new ZOOM::Query::CQL($query_to_use, $zconns[$i]));
342
                    $results[$i] = $zconns[$i]->search(ZOOM::Query::CQL->new($query_to_use, $zconns[$i]));
343
                } elsif ($query_type =~ /^pqf/) {
343
                } elsif ($query_type =~ /^pqf/) {
344
                    $results[$i] = $zconns[$i]->search(new ZOOM::Query::PQF($query_to_use, $zconns[$i]));
344
                    $results[$i] = $zconns[$i]->search(ZOOM::Query::PQF->new($query_to_use, $zconns[$i]));
345
                } else {
345
                } else {
346
                    warn "Unknown query_type '$query_type'.  Results undetermined.";
346
                    warn "Unknown query_type '$query_type'.  Results undetermined.";
347
                }
347
                }
348
            } elsif ($scan) {
348
            } elsif ($scan) {
349
                    $results[$i] = $zconns[$i]->scan(  new ZOOM::Query::CCL2RPN($query_to_use, $zconns[$i]));
349
                    $results[$i] = $zconns[$i]->scan(  ZOOM::Query::CCL2RPN->new($query_to_use, $zconns[$i]));
350
            } else {
350
            } else {
351
                    $results[$i] = $zconns[$i]->search(new ZOOM::Query::CCL2RPN($query_to_use, $zconns[$i]));
351
                    $results[$i] = $zconns[$i]->search(ZOOM::Query::CCL2RPN->new($query_to_use, $zconns[$i]));
352
            }
352
            }
353
        };
353
        };
354
        if ($@) {
354
        if ($@) {
(-)a/C4/Service.pm (-4 / +4 lines)
Lines 86-92 passed to C<return_success()>. Link Here
86
sub init {
86
sub init {
87
    my ( $class, %needed_flags ) = @_;
87
    my ( $class, %needed_flags ) = @_;
88
88
89
    our $query = new CGI;
89
    our $query = CGI->new;
90
90
91
    my ( $status, $cookie_, $sessionID ) = check_api_auth( $query, \%needed_flags );
91
    my ( $status, $cookie_, $sessionID ) = check_api_auth( $query, \%needed_flags );
92
92
Lines 94-100 sub init { Link Here
94
94
95
    $class->return_error( 'auth', $status ) if ( $status ne 'ok' );
95
    $class->return_error( 'auth', $status ) if ( $status ne 'ok' );
96
96
97
    return ( $query, new C4::Output::JSONStream );
97
    return ( $query, C4::Output::JSONStream->new );
98
}
98
}
99
99
100
=head2 return_error
100
=head2 return_error
Lines 119-125 param => value pairs. Link Here
119
sub return_error {
119
sub return_error {
120
    my ( $class, $type, $error, %flags ) = @_;
120
    my ( $class, $type, $error, %flags ) = @_;
121
121
122
    my $response = new C4::Output::JSONStream;
122
    my $response = C4::Output::JSONStream->new;
123
123
124
    $response->param( message => $error ) if ( $error );
124
    $response->param( message => $error ) if ( $error );
125
    $response->param( type => $type, %flags );
125
    $response->param( type => $type, %flags );
Lines 152-158 structure verbatim. Link Here
152
sub return_multi {
152
sub return_multi {
153
    my ( $class, $responses, @flags ) = @_;
153
    my ( $class, $responses, @flags ) = @_;
154
154
155
    my $response = new C4::Output::JSONStream;
155
    my $response = C4::Output::JSONStream->new;
156
156
157
    if ( !@$responses ) {
157
    if ( !@$responses ) {
158
        $class->return_success( $response );
158
        $class->return_success( $response );
(-)a/Koha/Illrequest/Logger.pm (-1 / +1 lines)
Lines 65-71 sub new { Link Here
65
        }
65
        }
66
    };
66
    };
67
67
68
    my $query = new CGI; # To keep C4::Templates::_get_template_file() from complaining
68
    my $query = CGI->new; # To keep C4::Templates::_get_template_file() from complaining
69
    my ( $htdocs, $theme, $lang, $base ) =
69
    my ( $htdocs, $theme, $lang, $base ) =
70
        C4::Templates::_get_template_file('ill/log/', 'intranet', $query);
70
        C4::Templates::_get_template_file('ill/log/', 'intranet', $query);
71
71
(-)a/Koha/OAI/Server/DeletedRecord.pm (-1 / +1 lines)
Lines 30-36 sub new { Link Here
30
    my $self = $class->SUPER::new(%args);
30
    my $self = $class->SUPER::new(%args);
31
31
32
    $timestamp =~ s/ /T/, $timestamp .= 'Z';
32
    $timestamp =~ s/ /T/, $timestamp .= 'Z';
33
    $self->header( new HTTP::OAI::Header(
33
    $self->header( HTTP::OAI::Header->new(
34
        status      => 'deleted',
34
        status      => 'deleted',
35
        identifier  => $args{identifier},
35
        identifier  => $args{identifier},
36
        datestamp   => $timestamp,
36
        datestamp   => $timestamp,
(-)a/Koha/OAI/Server/GetRecord.pm (-1 / +1 lines)
Lines 92-98 sub new { Link Here
92
        {
92
        {
93
            return HTTP::OAI::Response->new(
93
            return HTTP::OAI::Response->new(
94
             requestURL  => $repository->self_url(),
94
             requestURL  => $repository->self_url(),
95
             errors      => [ new HTTP::OAI::Error(
95
             errors      => [ HTTP::OAI::Error->new(
96
                code    => 'idDoesNotExist',
96
                code    => 'idDoesNotExist',
97
                message => "There is no biblio record with this identifier",
97
                message => "There is no biblio record with this identifier",
98
                ) ],
98
                ) ],
(-)a/Koha/OAI/Server/ListBase.pm (-3 / +3 lines)
Lines 39-45 use MARC::File::XML; Link Here
39
sub GetRecords {
39
sub GetRecords {
40
    my ($class, $self, $repository, $metadata, %args) = @_;
40
    my ($class, $self, $repository, $metadata, %args) = @_;
41
41
42
    my $token = new Koha::OAI::Server::ResumptionToken( %args );
42
    my $token = Koha::OAI::Server::ResumptionToken->new( %args );
43
    my $dbh = C4::Context->dbh;
43
    my $dbh = C4::Context->dbh;
44
    my $set;
44
    my $set;
45
    if ( defined $token->{'set'} ) {
45
    if ( defined $token->{'set'} ) {
Lines 127-133 sub GetRecords { Link Here
127
            $count++;
127
            $count++;
128
            if ( $count > $max ) {
128
            if ( $count > $max ) {
129
                $self->resumptionToken(
129
                $self->resumptionToken(
130
                    new Koha::OAI::Server::ResumptionToken(
130
                    Koha::OAI::Server::ResumptionToken->new(
131
                        metadataPrefix  => $token->{metadata_prefix},
131
                        metadataPrefix  => $token->{metadata_prefix},
132
                        from            => $token->{from},
132
                        from            => $token->{from},
133
                        until           => $token->{until},
133
                        until           => $token->{until},
Lines 165-171 sub GetRecords { Link Here
165
            } else {
165
            } else {
166
                $timestamp =~ s/ /T/;
166
                $timestamp =~ s/ /T/;
167
                $timestamp .= 'Z';
167
                $timestamp .= 'Z';
168
                $self->identifier( new HTTP::OAI::Header(
168
                $self->identifier( HTTP::OAI::Header->new(
169
                    identifier => $repository->{ koha_identifier} . ':' . $biblionumber,
169
                    identifier => $repository->{ koha_identifier} . ':' . $biblionumber,
170
                    datestamp  => $timestamp,
170
                    datestamp  => $timestamp,
171
                    status     => $deleted ? 'deleted' : undef
171
                    status     => $deleted ? 'deleted' : undef
(-)a/Koha/OAI/Server/ListIdentifiers.pm (-1 / +1 lines)
Lines 35-41 sub new { Link Here
35
    unless ($count) {
35
    unless ($count) {
36
        return HTTP::OAI::Response->new(
36
        return HTTP::OAI::Response->new(
37
            requestURL => $repository->self_url(),
37
            requestURL => $repository->self_url(),
38
            errors     => [ new HTTP::OAI::Error( code => 'noRecordsMatch' ) ],
38
            errors     => [ HTTP::OAI::Error->new( code => 'noRecordsMatch' ) ],
39
        );
39
        );
40
    }
40
    }
41
41
(-)a/Koha/OAI/Server/ListRecords.pm (-1 / +1 lines)
Lines 35-41 sub new { Link Here
35
    unless ($count) {
35
    unless ($count) {
36
        return HTTP::OAI::Response->new(
36
        return HTTP::OAI::Response->new(
37
            requestURL => $repository->self_url(),
37
            requestURL => $repository->self_url(),
38
            errors     => [ new HTTP::OAI::Error( code => 'noRecordsMatch' ) ],
38
            errors     => [ HTTP::OAI::Error->new( code => 'noRecordsMatch' ) ],
39
        );
39
        );
40
    }
40
    }
41
41
(-)a/Koha/OAI/Server/ListSets.pm (-1 / +1 lines)
Lines 54-60 sub new { Link Here
54
    }
54
    }
55
55
56
    $self->resumptionToken(
56
    $self->resumptionToken(
57
        new Koha::OAI::Server::ResumptionToken(
57
        Koha::OAI::Server::ResumptionToken->new(
58
            metadataPrefix => $token->{metadata_prefix},
58
            metadataPrefix => $token->{metadata_prefix},
59
            offset         => $pos
59
            offset         => $pos
60
        )
60
        )
(-)a/Koha/OAI/Server/Record.pm (-1 / +1 lines)
Lines 32-38 sub new { Link Here
32
    my $self = $class->SUPER::new(%args);
32
    my $self = $class->SUPER::new(%args);
33
33
34
    $timestamp =~ s/ /T/, $timestamp .= 'Z';
34
    $timestamp =~ s/ /T/, $timestamp .= 'Z';
35
    $self->header( new HTTP::OAI::Header(
35
    $self->header( HTTP::OAI::Header->new(
36
        identifier  => $args{identifier},
36
        identifier  => $args{identifier},
37
        datestamp   => $timestamp,
37
        datestamp   => $timestamp,
38
    ) );
38
    ) );
(-)a/Koha/OAI/Server/Repository.pm (-1 / +1 lines)
Lines 127-133 sub new { Link Here
127
    # Is metadataPrefix supported by the repository?
127
    # Is metadataPrefix supported by the repository?
128
    my $mdp = param('metadataPrefix') || '';
128
    my $mdp = param('metadataPrefix') || '';
129
    if ( $mdp && !grep { $_ eq $mdp } @{$self->{ koha_metadata_format }} ) {
129
    if ( $mdp && !grep { $_ eq $mdp } @{$self->{ koha_metadata_format }} ) {
130
        push @errs, new HTTP::OAI::Error(
130
        push @errs, HTTP::OAI::Error->new(
131
            code    => 'cannotDisseminateFormat',
131
            code    => 'cannotDisseminateFormat',
132
            message => "Dissemination as '$mdp' is not supported",
132
            message => "Dissemination as '$mdp' is not supported",
133
        );
133
        );
(-)a/Koha/Patron/Discharge.pm (-1 / +1 lines)
Lines 118-124 sub generate_as_pdf { Link Here
118
    $letter->{'title'}   =~ s/<<today>>/$today/g;
118
    $letter->{'title'}   =~ s/<<today>>/$today/g;
119
    $letter->{'content'} =~ s/<<today>>/$today/g;
119
    $letter->{'content'} =~ s/<<today>>/$today/g;
120
120
121
    my $tmpl = C4::Templates::gettemplate('batch/print-notices.tt', 'intranet', new CGI);
121
    my $tmpl = C4::Templates::gettemplate('batch/print-notices.tt', 'intranet', CGI->new);
122
    $tmpl->param(
122
    $tmpl->param(
123
        stylesheet => C4::Context->preference("NoticeCSS"),
123
        stylesheet => C4::Context->preference("NoticeCSS"),
124
        today      => $today,
124
        today      => $today,
(-)a/Koha/SuggestionEngine/Plugin/ExplodedTerms.pm (-1 / +1 lines)
Lines 79-85 sub get_suggestions { Link Here
79
        'su-br',
79
        'su-br',
80
        'su-rl'
80
        'su-rl'
81
    );
81
    );
82
    my $cgi = new CGI;
82
    my $cgi = CGI->new;
83
    my $template = C4::Templates::gettemplate('text/explodedterms.tt', 'opac', $cgi);
83
    my $template = C4::Templates::gettemplate('text/explodedterms.tt', 'opac', $cgi);
84
    my @results;
84
    my @results;
85
    foreach my $index (@indexes) {
85
    foreach my $index (@indexes) {
(-)a/Koha/pdfformat/layout2pages.pm (-1 / +1 lines)
Lines 57-63 sub printorders { Link Here
57
    $pdf->mediabox($height/mm, $width/mm);
57
    $pdf->mediabox($height/mm, $width/mm);
58
    my $page = $pdf->page();
58
    my $page = $pdf->page();
59
    
59
    
60
    my $pdftable = new PDF::Table();
60
    my $pdftable = PDF::Table->new();
61
    
61
    
62
    my $abaskets;
62
    my $abaskets;
63
    my $arrbasket;
63
    my $arrbasket;
(-)a/Koha/pdfformat/layout2pagesde.pm (-1 / +1 lines)
Lines 57-63 sub printorders { Link Here
57
    $pdf->mediabox($height/mm, $width/mm);
57
    $pdf->mediabox($height/mm, $width/mm);
58
    my $page = $pdf->page();
58
    my $page = $pdf->page();
59
    
59
    
60
    my $pdftable = new PDF::Table();
60
    my $pdftable = PDF::Table->new();
61
    
61
    
62
    my $abaskets;
62
    my $abaskets;
63
    my $arrbasket;
63
    my $arrbasket;
(-)a/Koha/pdfformat/layout3pages.pm (-2 / +2 lines)
Lines 82-88 sub printorders { Link Here
82
            . ( $delivery_library ? "delivery at " . $delivery_library->branchname : "" )
82
            . ( $delivery_library ? "delivery at " . $delivery_library->branchname : "" )
83
        );
83
        );
84
84
85
        my $pdftable = new PDF::Table();
85
        my $pdftable = PDF::Table->new();
86
        my $abaskets;
86
        my $abaskets;
87
        my $arrbasket;
87
        my $arrbasket;
88
        my @keys = ('Document', 'Qty', 'RRP tax exc.', 'RRP tax inc.', 'Discount', 'Discount price', 'Tax rate', 'Total tax exc.', 'Total tax inc.');
88
        my @keys = ('Document', 'Qty', 'RRP tax exc.', 'RRP tax inc.', 'Discount', 'Discount price', 'Tax rate', 'Total tax exc.', 'Total tax inc.');
Lines 200-206 sub printbaskets { Link Here
200
    $text->font( $pdf->corefont("Times", -encoding => "utf8"), 6/mm );
200
    $text->font( $pdf->corefont("Times", -encoding => "utf8"), 6/mm );
201
    $text->translate(30/mm,  ($height-28.5)/mm);
201
    $text->translate(30/mm,  ($height-28.5)/mm);
202
    $text->text($libraryname);
202
    $text->text($libraryname);
203
    my $pdftable = new PDF::Table();
203
    my $pdftable = PDF::Table->new();
204
    my $abaskets;
204
    my $abaskets;
205
    my $arrbasket;
205
    my $arrbasket;
206
    # header of the table
206
    # header of the table
(-)a/Koha/pdfformat/layout3pagesfr.pm (-2 / +2 lines)
Lines 82-88 sub printorders { Link Here
82
            . ( $delivery_library ? "livraison à " . $delivery_library->branchname : "" )
82
            . ( $delivery_library ? "livraison à " . $delivery_library->branchname : "" )
83
        );
83
        );
84
84
85
        my $pdftable = new PDF::Table();
85
        my $pdftable = PDF::Table->new();
86
        my $abaskets;
86
        my $abaskets;
87
        my $arrbasket;
87
        my $arrbasket;
88
        my @keys = ('Document', 'Qté', 'Prix', 'Prix net', '% Remise', 'Remise', 'Taux TVA', 'Total HT', 'Total TTC');
88
        my @keys = ('Document', 'Qté', 'Prix', 'Prix net', '% Remise', 'Remise', 'Taux TVA', 'Total HT', 'Total TTC');
Lines 201-207 sub printbaskets { Link Here
201
    $text->font( $pdf->corefont("Times", -encoding => "utf8"), 6/mm );
201
    $text->font( $pdf->corefont("Times", -encoding => "utf8"), 6/mm );
202
    $text->translate(30/mm,  ($height-28.5)/mm);
202
    $text->translate(30/mm,  ($height-28.5)/mm);
203
    $text->text($libraryname);
203
    $text->text($libraryname);
204
    my $pdftable = new PDF::Table();
204
    my $pdftable = PDF::Table->new();
205
    my $abaskets;
205
    my $abaskets;
206
    my $arrbasket;
206
    my $arrbasket;
207
    # header of the table
207
    # header of the table
(-)a/about.pl (-2 / +2 lines)
Lines 60-66 use C4::Members::Statistics; Link Here
60
60
61
#use Smart::Comments '####';
61
#use Smart::Comments '####';
62
62
63
my $query = new CGI;
63
my $query = CGI->new;
64
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
64
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
65
    {
65
    {
66
        template_name   => "about.tt",
66
        template_name   => "about.tt",
Lines 208-214 my $warnNoActiveCurrency = (! defined Koha::Acquisition::Currencies->get_active) Link Here
208
208
209
my @xml_config_warnings;
209
my @xml_config_warnings;
210
210
211
my $context = new C4::Context;
211
my $context = C4::Context->new;
212
212
213
if (    C4::Context->config('zebra_bib_index_mode')
213
if (    C4::Context->config('zebra_bib_index_mode')
214
    and C4::Context->config('zebra_bib_index_mode') eq 'grs1' )
214
    and C4::Context->config('zebra_bib_index_mode') eq 'grs1' )
(-)a/acqui/add_user_search.pl (-1 / +1 lines)
Lines 26-32 use C4::Members; Link Here
26
26
27
use Koha::Patron::Categories;
27
use Koha::Patron::Categories;
28
28
29
my $input = new CGI;
29
my $input = CGI->new;
30
30
31
my $dbh = C4::Context->dbh;
31
my $dbh = C4::Context->dbh;
32
32
(-)a/acqui/addorder.pl (-1 / +1 lines)
Lines 135-141 use C4::Barcodes; Link Here
135
# FIXME: This needs to do actual error checking and possibly return user to the same form,
135
# FIXME: This needs to do actual error checking and possibly return user to the same form,
136
# not just blindly call C4 functions and print a redirect.  
136
# not just blindly call C4 functions and print a redirect.  
137
137
138
my $input = new CGI;
138
my $input = CGI->new;
139
my $use_ACQ_framework = $input->param('use_ACQ_framework');
139
my $use_ACQ_framework = $input->param('use_ACQ_framework');
140
140
141
# Check if order total amount exceed allowed budget
141
# Check if order total amount exceed allowed budget
(-)a/acqui/addorderiso2709.pl (-1 / +1 lines)
Lines 50-56 use Koha::Acquisition::Orders; Link Here
50
use Koha::Acquisition::Booksellers;
50
use Koha::Acquisition::Booksellers;
51
use Koha::Patrons;
51
use Koha::Patrons;
52
52
53
my $input = new CGI;
53
my $input = CGI->new;
54
my ($template, $loggedinuser, $cookie, $userflags) = get_template_and_user({
54
my ($template, $loggedinuser, $cookie, $userflags) = get_template_and_user({
55
    template_name => "acqui/addorderiso2709.tt",
55
    template_name => "acqui/addorderiso2709.tt",
56
    query => $input,
56
    query => $input,
(-)a/acqui/ajax-getauthvaluedropbox.pl (-1 / +1 lines)
Lines 62-68 unless ($status eq "ok") { Link Here
62
    exit 0;
62
    exit 0;
63
}
63
}
64
64
65
my $input = new CGI;
65
my $input = CGI->new;
66
my $name = $input->param('name');
66
my $name = $input->param('name');
67
my $category = $input->param('category');
67
my $category = $input->param('category');
68
my $default = $input->param('default');
68
my $default = $input->param('default');
(-)a/acqui/basket.pl (-1 / +1 lines)
Lines 74-80 the supplier this script have to display the basket. Link Here
74
74
75
=cut
75
=cut
76
76
77
our $query        = new CGI;
77
our $query        = CGI->new;
78
our $basketno     = $query->param('basketno');
78
our $basketno     = $query->param('basketno');
79
our $ean          = $query->param('ean');
79
our $ean          = $query->param('ean');
80
our $booksellerid = $query->param('booksellerid');
80
our $booksellerid = $query->param('booksellerid');
(-)a/acqui/basketgroup.pl (-1 / +1 lines)
Lines 59-65 use Koha::Acquisition::Booksellers; Link Here
59
use Koha::ItemTypes;
59
use Koha::ItemTypes;
60
use Koha::Patrons;
60
use Koha::Patrons;
61
61
62
our $input=new CGI;
62
our $input=CGI->new;
63
63
64
our ($template, $loggedinuser, $cookie)
64
our ($template, $loggedinuser, $cookie)
65
    = get_template_and_user({template_name => "acqui/basketgroup.tt",
65
    = get_template_and_user({template_name => "acqui/basketgroup.tt",
(-)a/acqui/basketheader.pl (-1 / +1 lines)
Lines 57-63 use Koha::Acquisition::Booksellers; Link Here
57
use Koha::Acquisition::Baskets;
57
use Koha::Acquisition::Baskets;
58
use Koha::AdditionalFields;
58
use Koha::AdditionalFields;
59
59
60
my $input = new CGI;
60
my $input = CGI->new;
61
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
61
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
62
    {
62
    {
63
        template_name   => "acqui/basketheader.tt",
63
        template_name   => "acqui/basketheader.tt",
(-)a/acqui/cancelorder.pl (-1 / +1 lines)
Lines 37-43 use C4::Output; Link Here
37
use C4::Acquisition;
37
use C4::Acquisition;
38
use Koha::Acquisition::Baskets;
38
use Koha::Acquisition::Baskets;
39
39
40
my $input = new CGI;
40
my $input = CGI->new;
41
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
41
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
42
    template_name   => 'acqui/cancelorder.tt',
42
    template_name   => 'acqui/cancelorder.tt',
43
    query           => $input,
43
    query           => $input,
(-)a/acqui/check_budget_total.pl (-1 / +1 lines)
Lines 30-36 fetches the budget amount fron the DB Link Here
30
30
31
=cut
31
=cut
32
32
33
my $input = new CGI;
33
my $input = CGI->new;
34
my $budget_id = $input->param('budget_id');
34
my $budget_id = $input->param('budget_id');
35
my $total   = $input->param('total');
35
my $total   = $input->param('total');
36
36
(-)a/acqui/check_uniqueness.pl (-1 / +1 lines)
Lines 36-42 use JSON; Link Here
36
use C4::Output;
36
use C4::Output;
37
use C4::Items;
37
use C4::Items;
38
38
39
my $input = new CGI;
39
my $input = CGI->new;
40
my @field = $input->multi_param('field[]');
40
my @field = $input->multi_param('field[]');
41
my @value = $input->multi_param('value[]');
41
my @value = $input->multi_param('value[]');
42
42
(-)a/acqui/duplicate_orders.pl (-1 / +1 lines)
Lines 30-36 use Koha::Acquisition::Currencies; Link Here
30
use Koha::Acquisition::Orders;
30
use Koha::Acquisition::Orders;
31
use Koha::DateUtils qw(dt_from_string output_pref);
31
use Koha::DateUtils qw(dt_from_string output_pref);
32
32
33
my $input    = new CGI;
33
my $input    = CGI->new;
34
my $basketno = $input->param('basketno');
34
my $basketno = $input->param('basketno');
35
my $op       = $input->param('op') || 'search';    # search, select, batch_edit
35
my $op       = $input->param('op') || 'search';    # search, select, batch_edit
36
36
(-)a/acqui/finishreceive.pl (-1 / +1 lines)
Lines 36-42 use Koha::Acquisition::Orders; Link Here
36
36
37
use List::MoreUtils qw/any/;
37
use List::MoreUtils qw/any/;
38
38
39
my $input=new CGI;
39
my $input=CGI->new;
40
my $flagsrequired = {acquisition => 'order_receive'};
40
my $flagsrequired = {acquisition => 'order_receive'};
41
41
42
checkauth($input, 0, $flagsrequired, 'intranet');
42
checkauth($input, 0, $flagsrequired, 'intranet');
(-)a/acqui/histsearch.pl (-1 / +1 lines)
Lines 59-65 use C4::Koha; Link Here
59
use Koha::AdditionalFields;
59
use Koha::AdditionalFields;
60
use Koha::DateUtils;
60
use Koha::DateUtils;
61
61
62
my $input = new CGI;
62
my $input = CGI->new;
63
my $do_search               = $input->param('do_search') || 0;
63
my $do_search               = $input->param('do_search') || 0;
64
64
65
my $dbh = C4::Context->dbh;
65
my $dbh = C4::Context->dbh;
(-)a/acqui/invoice-files.pl (-1 / +1 lines)
Lines 35-41 use C4::Output; Link Here
35
use C4::Acquisition;
35
use C4::Acquisition;
36
use Koha::Misc::Files;
36
use Koha::Misc::Files;
37
37
38
my $input = new CGI;
38
my $input = CGI->new;
39
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
39
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
40
    {
40
    {
41
        template_name   => 'acqui/invoice-files.tt',
41
        template_name   => 'acqui/invoice-files.tt',
(-)a/acqui/invoice.pl (-1 / +1 lines)
Lines 40-46 use Koha::DateUtils; Link Here
40
use Koha::Misc::Files;
40
use Koha::Misc::Files;
41
use Koha::Acquisition::Invoice::Adjustments;
41
use Koha::Acquisition::Invoice::Adjustments;
42
42
43
my $input = new CGI;
43
my $input = CGI->new;
44
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
44
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
45
    {
45
    {
46
        template_name   => 'acqui/invoice.tt',
46
        template_name   => 'acqui/invoice.tt',
(-)a/acqui/lateorders-export.pl (-1 / +1 lines)
Lines 24-30 use C4::Acquisition; Link Here
24
use C4::Output;
24
use C4::Output;
25
use C4::Context;
25
use C4::Context;
26
26
27
my $input = new CGI;
27
my $input = CGI->new;
28
my ($template, $loggedinuser, $cookie) = get_template_and_user({
28
my ($template, $loggedinuser, $cookie) = get_template_and_user({
29
    template_name => "acqui/csv/lateorders.tt",
29
    template_name => "acqui/csv/lateorders.tt",
30
    query => $input,
30
    query => $input,
(-)a/acqui/lateorders.pl (-1 / +1 lines)
Lines 55-61 use Koha::DateUtils; Link Here
55
use Koha::Acquisition::Orders;
55
use Koha::Acquisition::Orders;
56
use Koha::CsvProfiles;
56
use Koha::CsvProfiles;
57
57
58
my $input = new CGI;
58
my $input = CGI->new;
59
my ($template, $loggedinuser, $cookie) = get_template_and_user(
59
my ($template, $loggedinuser, $cookie) = get_template_and_user(
60
    {
60
    {
61
        template_name   => "acqui/lateorders.tt",
61
        template_name   => "acqui/lateorders.tt",
(-)a/acqui/modordernotes.pl (-1 / +1 lines)
Lines 35-41 use C4::Acquisition; Link Here
35
35
36
use Koha::Acquisition::Booksellers;
36
use Koha::Acquisition::Booksellers;
37
37
38
my $input = new CGI;
38
my $input = CGI->new;
39
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
39
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
40
    template_name   => 'acqui/modordernotes.tt',
40
    template_name   => 'acqui/modordernotes.tt',
41
    query           => $input,
41
    query           => $input,
(-)a/acqui/neworderempty.pl (-1 / +1 lines)
Lines 94-100 use Koha::Patrons; Link Here
94
use Koha::RecordProcessor;
94
use Koha::RecordProcessor;
95
use Koha::Subscriptions;
95
use Koha::Subscriptions;
96
96
97
our $input           = new CGI;
97
our $input           = CGI->new;
98
my $booksellerid    = $input->param('booksellerid');	# FIXME: else ERROR!
98
my $booksellerid    = $input->param('booksellerid');	# FIXME: else ERROR!
99
my $budget_id       = $input->param('budget_id') || 0;
99
my $budget_id       = $input->param('budget_id') || 0;
100
my $title           = $input->param('title');
100
my $title           = $input->param('title');
(-)a/acqui/newordersubscription.pl (-1 / +1 lines)
Lines 27-33 use C4::Serials; Link Here
27
27
28
use Koha::Acquisition::Booksellers;
28
use Koha::Acquisition::Booksellers;
29
29
30
my $query        = new CGI;
30
my $query        = CGI->new;
31
my $title        = $query->param('title_filter');
31
my $title        = $query->param('title_filter');
32
my $ISSN         = $query->param('ISSN_filter');
32
my $ISSN         = $query->param('ISSN_filter');
33
my $EAN          = $query->param('EAN_filter');
33
my $EAN          = $query->param('EAN_filter');
(-)a/acqui/newordersuggestion.pl (-1 / +1 lines)
Lines 99-105 use C4::Budgets; Link Here
99
99
100
use Koha::Acquisition::Booksellers;
100
use Koha::Acquisition::Booksellers;
101
101
102
my $input = new CGI;
102
my $input = CGI->new;
103
103
104
# getting the CGI params
104
# getting the CGI params
105
my $basketno        = $input->param('basketno');
105
my $basketno        = $input->param('basketno');
(-)a/acqui/ordered.pl (-1 / +1 lines)
Lines 36-42 use Koha::Acquisition::Invoice::Adjustments; Link Here
36
use C4::Acquisition;
36
use C4::Acquisition;
37
37
38
my $dbh     = C4::Context->dbh;
38
my $dbh     = C4::Context->dbh;
39
my $input   = new CGI;
39
my $input   = CGI->new;
40
my $fund_id = $input->param('fund');
40
my $fund_id = $input->param('fund');
41
my $fund_code = $input->param('fund_code');
41
my $fund_code = $input->param('fund_code');
42
42
(-)a/acqui/orderreceive.pl (-1 / +1 lines)
Lines 79-85 use Koha::DateUtils qw( dt_from_string ); Link Here
79
use Koha::ItemTypes;
79
use Koha::ItemTypes;
80
use Koha::Patrons;
80
use Koha::Patrons;
81
81
82
my $input      = new CGI;
82
my $input      = CGI->new;
83
83
84
my $dbh          = C4::Context->dbh;
84
my $dbh          = C4::Context->dbh;
85
my $invoiceid    = $input->param('invoiceid');
85
my $invoiceid    = $input->param('invoiceid');
(-)a/acqui/parcel.pl (-1 / +1 lines)
Lines 74-80 use Koha::Biblios; Link Here
74
74
75
use JSON;
75
use JSON;
76
76
77
my $input=new CGI;
77
my $input=CGI->new;
78
my $sticky_filters = $input->param('sticky_filters') || 0;
78
my $sticky_filters = $input->param('sticky_filters') || 0;
79
79
80
my ($template, $loggedinuser, $cookie)
80
my ($template, $loggedinuser, $cookie)
(-)a/acqui/showorder.pl (-1 / +1 lines)
Lines 24-30 use C4::Output; Link Here
24
use Koha::Acquisition::Orders;
24
use Koha::Acquisition::Orders;
25
use Koha::Patrons;
25
use Koha::Patrons;
26
26
27
my $cgi = new CGI;
27
my $cgi = CGI->new;
28
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
28
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
29
    template_name   => "acqui/showorder.tt",
29
    template_name   => "acqui/showorder.tt",
30
    query           => $cgi,
30
    query           => $cgi,
(-)a/acqui/spent.pl (-1 / +1 lines)
Lines 38-44 use C4::Acquisition; Link Here
38
use Koha::Acquisition::Invoice::Adjustments;
38
use Koha::Acquisition::Invoice::Adjustments;
39
39
40
my $dbh      = C4::Context->dbh;
40
my $dbh      = C4::Context->dbh;
41
my $input    = new CGI;
41
my $input    = CGI->new;
42
my $bookfund = $input->param('fund');
42
my $bookfund = $input->param('fund');
43
my $fund_code = $input->param('fund_code');
43
my $fund_code = $input->param('fund_code');
44
44
(-)a/acqui/transferorder.pl (-1 / +1 lines)
Lines 28-34 use C4::Context; Link Here
28
use C4::Acquisition;
28
use C4::Acquisition;
29
use Koha::Acquisition::Booksellers;
29
use Koha::Acquisition::Booksellers;
30
30
31
my $input = new CGI;
31
my $input = CGI->new;
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
    {   template_name   => "acqui/transferorder.tt",
33
    {   template_name   => "acqui/transferorder.tt",
34
        query           => $input,
34
        query           => $input,
(-)a/acqui/uncertainprice.pl (-1 / +1 lines)
Lines 55-61 use C4::Biblio qw/GetBiblioData/; Link Here
55
use Koha::Acquisition::Booksellers;
55
use Koha::Acquisition::Booksellers;
56
use Koha::Acquisition::Baskets;
56
use Koha::Acquisition::Baskets;
57
57
58
my $input=new CGI;
58
my $input=CGI->new;
59
59
60
my ($template, $loggedinuser, $cookie)
60
my ($template, $loggedinuser, $cookie)
61
    = get_template_and_user({template_name => "acqui/uncertainprice.tt",
61
    = get_template_and_user({template_name => "acqui/uncertainprice.tt",
(-)a/acqui/updatesupplier.pl (-1 / +1 lines)
Lines 58-64 use Koha::Acquisition::Bookseller::Contacts; Link Here
58
use Koha::Acquisition::Booksellers;
58
use Koha::Acquisition::Booksellers;
59
use CGI qw ( -utf8 );
59
use CGI qw ( -utf8 );
60
60
61
my $input=new CGI;
61
my $input=CGI->new;
62
62
63
checkauth( $input, 0, { acquisition => 'vendors_manage' }, 'intranet' );
63
checkauth( $input, 0, { acquisition => 'vendors_manage' }, 'intranet' );
64
64
(-)a/acqui/z3950_search.pl (-1 / +1 lines)
Lines 31-37 use C4::Koha; Link Here
31
use Koha::Acquisition::Booksellers;
31
use Koha::Acquisition::Booksellers;
32
use Koha::BiblioFrameworks;
32
use Koha::BiblioFrameworks;
33
33
34
my $input           = new CGI;
34
my $input           = CGI->new;
35
my $biblionumber    = $input->param('biblionumber')||0;
35
my $biblionumber    = $input->param('biblionumber')||0;
36
my $frameworkcode   = $input->param('frameworkcode') || q{};
36
my $frameworkcode   = $input->param('frameworkcode') || q{};
37
my $title           = $input->param('title');
37
my $title           = $input->param('title');
(-)a/admin/add_user_search.pl (-1 / +1 lines)
Lines 26-32 use C4::Members; Link Here
26
26
27
use Koha::Patron::Categories;
27
use Koha::Patron::Categories;
28
28
29
my $input = new CGI;
29
my $input = CGI->new;
30
30
31
my $dbh = C4::Context->dbh;
31
my $dbh = C4::Context->dbh;
32
32
(-)a/admin/additional-fields.pl (-1 / +1 lines)
Lines 23-29 use C4::Koha; Link Here
23
use C4::Output;
23
use C4::Output;
24
use Koha::AdditionalFields;
24
use Koha::AdditionalFields;
25
25
26
my $input = new CGI;
26
my $input = CGI->new;
27
27
28
my %flagsrequired;
28
my %flagsrequired;
29
$flagsrequired{parameters} = 'manage_additional_fields';
29
$flagsrequired{parameters} = 'manage_additional_fields';
(-)a/admin/admin-home.pl (-1 / +1 lines)
Lines 22-28 use C4::Auth; Link Here
22
use C4::Output;
22
use C4::Output;
23
use Koha::Plugins;
23
use Koha::Plugins;
24
24
25
my $query = new CGI;
25
my $query = CGI->new;
26
26
27
my $plugins_enabled = C4::Context->config("enable_plugins");
27
my $plugins_enabled = C4::Context->config("enable_plugins");
28
my $mana_url        = C4::Context->config('mana_config');
28
my $mana_url        = C4::Context->config('mana_config');
(-)a/admin/adveditorshortcuts.pl (-1 / +1 lines)
Lines 43-49 use CGI qw ( -utf8 ); Link Here
43
use C4::Koha;
43
use C4::Koha;
44
use Koha::KeyboardShortcuts;
44
use Koha::KeyboardShortcuts;
45
45
46
my $input            = new CGI;
46
my $input            = CGI->new;
47
my $op               = $input->param('op') || 'list';
47
my $op               = $input->param('op') || 'list';
48
48
49
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
49
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
(-)a/admin/aqbudgetperiods.pl (-1 / +1 lines)
Lines 61-67 use Koha::Acquisition::Currencies; Link Here
61
61
62
my $dbh = C4::Context->dbh;
62
my $dbh = C4::Context->dbh;
63
63
64
my $input       = new CGI;
64
my $input       = CGI->new;
65
65
66
my $searchfield          = $input->param('searchfield') // '';
66
my $searchfield          = $input->param('searchfield') // '';
67
my $budget_period_id     = $input->param('budget_period_id');
67
my $budget_period_id     = $input->param('budget_period_id');
(-)a/admin/aqbudgets.pl (-1 / +1 lines)
Lines 36-42 use C4::Debug; Link Here
36
use Koha::Acquisition::Currencies;
36
use Koha::Acquisition::Currencies;
37
use Koha::Patrons;
37
use Koha::Patrons;
38
38
39
my $input = new CGI;
39
my $input = CGI->new;
40
my $dbh     = C4::Context->dbh;
40
my $dbh     = C4::Context->dbh;
41
41
42
my ($template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user(
42
my ($template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user(
(-)a/admin/aqcontract.pl (-1 / +1 lines)
Lines 30-36 use Koha::DateUtils; Link Here
30
30
31
use Koha::Acquisition::Booksellers;
31
use Koha::Acquisition::Booksellers;
32
32
33
my $input          = new CGI;
33
my $input          = CGI->new;
34
my $contractnumber = $input->param('contractnumber');
34
my $contractnumber = $input->param('contractnumber');
35
my $booksellerid   = $input->param('booksellerid');
35
my $booksellerid   = $input->param('booksellerid');
36
my $op             = $input->param('op') || 'list';
36
my $op             = $input->param('op') || 'list';
(-)a/admin/aqplan.pl (-1 / +1 lines)
Lines 36-42 use C4::Auth; Link Here
36
use C4::Debug;
36
use C4::Debug;
37
use Koha::Acquisition::Currencies;
37
use Koha::Acquisition::Currencies;
38
38
39
our $input = new CGI;
39
our $input = CGI->new;
40
####  $input
40
####  $input
41
41
42
my $dbh = C4::Context->dbh;
42
my $dbh = C4::Context->dbh;
(-)a/admin/audio_alerts.pl (-1 / +1 lines)
Lines 25-31 use C4::Output; Link Here
25
use Koha::AudioAlert;
25
use Koha::AudioAlert;
26
use Koha::AudioAlerts;
26
use Koha::AudioAlerts;
27
27
28
my $cgi = new CGI;
28
my $cgi = CGI->new;
29
29
30
my $selector = $cgi->param('selector');
30
my $selector = $cgi->param('selector');
31
my $sound    = $cgi->param('sound');
31
my $sound    = $cgi->param('sound');
(-)a/admin/auth_subfields_structure.pl (-1 / +1 lines)
Lines 48-54 sub auth_subfield_structure_exists { Link Here
48
	return @$rows > 0;
48
	return @$rows > 0;
49
}
49
}
50
50
51
my $input        = new CGI;
51
my $input        = CGI->new;
52
my $tagfield     = $input->param('tagfield');
52
my $tagfield     = $input->param('tagfield');
53
my $tagsubfield  = $input->param('tagsubfield');
53
my $tagsubfield  = $input->param('tagsubfield');
54
my $authtypecode = $input->param('authtypecode');
54
my $authtypecode = $input->param('authtypecode');
(-)a/admin/auth_tag_structure.pl (-1 / +1 lines)
Lines 29-35 use C4::Context; Link Here
29
use Koha::Authority::Types;
29
use Koha::Authority::Types;
30
30
31
# retrieve parameters
31
# retrieve parameters
32
my $input = new CGI;
32
my $input = CGI->new;
33
my $authtypecode         = $input->param('authtypecode')         || '';    # set to select framework
33
my $authtypecode         = $input->param('authtypecode')         || '';    # set to select framework
34
my $existingauthtypecode = $input->param('existingauthtypecode') || '';    # set when we have to create a new framework (in authtype) by copying an old one (in existingauthtype)
34
my $existingauthtypecode = $input->param('existingauthtypecode') || '';    # set when we have to create a new framework (in authtype) by copying an old one (in existingauthtype)
35
35
(-)a/admin/authorised_values.pl (-1 / +1 lines)
Lines 31-37 use Koha::AuthorisedValues; Link Here
31
use Koha::AuthorisedValueCategories;
31
use Koha::AuthorisedValueCategories;
32
use Koha::Libraries;
32
use Koha::Libraries;
33
33
34
my $input = new CGI;
34
my $input = CGI->new;
35
my $id          = $input->param('id');
35
my $id          = $input->param('id');
36
my $op          = $input->param('op') || 'list';
36
my $op          = $input->param('op') || 'list';
37
my $searchfield = $input->param('searchfield');
37
my $searchfield = $input->param('searchfield');
(-)a/admin/authtypes.pl (-1 / +1 lines)
Lines 28-34 use C4::Output; Link Here
28
use Koha::Authorities;
28
use Koha::Authorities;
29
use Koha::Authority::Types;
29
use Koha::Authority::Types;
30
30
31
my $input        = new CGI;
31
my $input        = CGI->new;
32
my $authtypecode = $input->param('authtypecode');
32
my $authtypecode = $input->param('authtypecode');
33
my $op           = $input->param('op') || 'list';
33
my $op           = $input->param('op') || 'list';
34
my @messages;
34
my @messages;
(-)a/admin/biblio_framework.pl (-1 / +1 lines)
Lines 28-34 use Koha::BiblioFramework; Link Here
28
use Koha::BiblioFrameworks;
28
use Koha::BiblioFrameworks;
29
use Koha::Caches;
29
use Koha::Caches;
30
30
31
my $input         = new CGI;
31
my $input         = CGI->new;
32
my $frameworkcode = $input->param('frameworkcode') || q||;
32
my $frameworkcode = $input->param('frameworkcode') || q||;
33
my $op            = $input->param('op') || q|list|;
33
my $op            = $input->param('op') || q|list|;
34
my $cache         = Koha::Caches->get_instance();
34
my $cache         = Koha::Caches->get_instance();
(-)a/admin/branch_transfer_limits.pl (-1 / +1 lines)
Lines 27-33 use C4::Output; Link Here
27
use C4::Koha;
27
use C4::Koha;
28
use C4::Circulation qw{ IsBranchTransferAllowed DeleteBranchTransferLimits CreateBranchTransferLimit };
28
use C4::Circulation qw{ IsBranchTransferAllowed DeleteBranchTransferLimits CreateBranchTransferLimit };
29
29
30
my $input = new CGI;
30
my $input = CGI->new;
31
31
32
my ($template, $loggedinuser, $cookie)
32
my ($template, $loggedinuser, $cookie)
33
    = get_template_and_user({template_name => "admin/branch_transfer_limits.tt",
33
    = get_template_and_user({template_name => "admin/branch_transfer_limits.tt",
(-)a/admin/categories.pl (-1 / +1 lines)
Lines 31-37 use Koha::DateUtils; Link Here
31
use Koha::Patron::Categories;
31
use Koha::Patron::Categories;
32
use Koha::Libraries;
32
use Koha::Libraries;
33
33
34
my $input         = new CGI;
34
my $input         = CGI->new;
35
my $searchfield   = $input->param('description') // q||;
35
my $searchfield   = $input->param('description') // q||;
36
my $categorycode  = $input->param('categorycode');
36
my $categorycode  = $input->param('categorycode');
37
my $op            = $input->param('op') // 'list';
37
my $op            = $input->param('op') // 'list';
(-)a/admin/check_budget_parent.pl (-1 / +1 lines)
Lines 31-37 called by aqbudgets.pl and neworderempty.pl Link Here
31
31
32
=cut
32
=cut
33
33
34
my $input = new CGI;
34
my $input = CGI->new;
35
35
36
my $budget_id     = $input->param('budget_id');
36
my $budget_id     = $input->param('budget_id');
37
my $new_parent_id = $input->param('new_parent');
37
my $new_parent_id = $input->param('new_parent');
(-)a/admin/check_parent_total.pl (-1 / +1 lines)
Lines 34-40 to determine whether the new parent budget (or period) has enough unallocated fu Link Here
34
=cut
34
=cut
35
35
36
my $dbh = C4::Context->dbh;
36
my $dbh = C4::Context->dbh;
37
my $input = new CGI;
37
my $input = CGI->new;
38
38
39
my $total     = $input->param('total');
39
my $total     = $input->param('total');
40
my $budget_id = $input->param('budget_id');
40
my $budget_id = $input->param('budget_id');
(-)a/admin/checkmarc.pl (-1 / +1 lines)
Lines 26-32 use C4::Context; Link Here
26
use C4::Biblio;
26
use C4::Biblio;
27
27
28
28
29
my $input = new CGI;
29
my $input = CGI->new;
30
30
31
my ($template, $borrowernumber, $cookie)
31
my ($template, $borrowernumber, $cookie)
32
    = get_template_and_user({template_name => "admin/checkmarc.tt",
32
    = get_template_and_user({template_name => "admin/checkmarc.tt",
(-)a/admin/cities.pl (-1 / +1 lines)
Lines 26-32 use C4::Output; Link Here
26
26
27
use Koha::Cities;
27
use Koha::Cities;
28
28
29
my $input       = new CGI;
29
my $input       = CGI->new;
30
my $city_name_filter = $input->param('city_name_filter') // q||;
30
my $city_name_filter = $input->param('city_name_filter') // q||;
31
my $cityid      = $input->param('cityid');
31
my $cityid      = $input->param('cityid');
32
my $op          = $input->param('op') || 'list';
32
my $op          = $input->param('op') || 'list';
(-)a/admin/classsources.pl (-1 / +1 lines)
Lines 33-39 use Koha::ClassSplitRules; Link Here
33
33
34
my $script_name = "/cgi-bin/koha/admin/classsources.pl";
34
my $script_name = "/cgi-bin/koha/admin/classsources.pl";
35
35
36
my $input            = new CGI;
36
my $input            = CGI->new;
37
my $op               = $input->param('op') || 'list';
37
my $op               = $input->param('op') || 'list';
38
my $cn_source        = $input->param('cn_source');
38
my $cn_source        = $input->param('cn_source');
39
my $class_sort_rule  = $input->param('class_sort_rule');
39
my $class_sort_rule  = $input->param('class_sort_rule');
(-)a/admin/clone-rules.pl (-1 / +1 lines)
Lines 34-40 use C4::Koha; Link Here
34
use C4::Debug;
34
use C4::Debug;
35
use Koha::CirculationRules;
35
use Koha::CirculationRules;
36
36
37
my $input = new CGI;
37
my $input = CGI->new;
38
38
39
my ($template, $loggedinuser, $cookie)
39
my ($template, $loggedinuser, $cookie)
40
    = get_template_and_user({template_name => "admin/clone-rules.tt",
40
    = get_template_and_user({template_name => "admin/clone-rules.tt",
(-)a/admin/columns_settings.pl (-1 / +1 lines)
Lines 7-13 use C4::Auth; Link Here
7
use C4::Context;
7
use C4::Context;
8
use C4::Output;
8
use C4::Output;
9
use C4::Utils::DataTables::TablesSettings qw( get_modules );
9
use C4::Utils::DataTables::TablesSettings qw( get_modules );
10
my $input = new CGI;
10
my $input = CGI->new;
11
11
12
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
12
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
13
    {
13
    {
(-)a/admin/credit_types.pl (-1 / +1 lines)
Lines 28-34 use C4::Output; Link Here
28
use Koha::Account::CreditType;
28
use Koha::Account::CreditType;
29
use Koha::Account::CreditTypes;
29
use Koha::Account::CreditTypes;
30
30
31
my $input = new CGI;
31
my $input = CGI->new;
32
my $code  = $input->param('code');
32
my $code  = $input->param('code');
33
my $op    = $input->param('op') || 'list';
33
my $op    = $input->param('op') || 'list';
34
my @messages;
34
my @messages;
(-)a/admin/debit_types.pl (-1 / +1 lines)
Lines 28-34 use C4::Output; Link Here
28
use Koha::Account::DebitType;
28
use Koha::Account::DebitType;
29
use Koha::Account::DebitTypes;
29
use Koha::Account::DebitTypes;
30
30
31
my $input = new CGI;
31
my $input = CGI->new;
32
my $code  = $input->param('code');
32
my $code  = $input->param('code');
33
my $op    = $input->param('op') || 'list';
33
my $op    = $input->param('op') || 'list';
34
my @messages;
34
my @messages;
(-)a/admin/desks.pl (-1 / +1 lines)
Lines 26-32 use C4::Output; Link Here
26
26
27
use Koha::Desks;
27
use Koha::Desks;
28
28
29
my $input       = new CGI;
29
my $input       = CGI->new;
30
my $searchfield = $input->param('desk_name') // q||;
30
my $searchfield = $input->param('desk_name') // q||;
31
my $desk_id      = $input->param('desk_id') || '';
31
my $desk_id      = $input->param('desk_id') || '';
32
my $op          = $input->param('op') || 'list';
32
my $op          = $input->param('op') || 'list';
(-)a/admin/didyoumean.pl (-1 / +1 lines)
Lines 9-15 use Koha::SuggestionEngine; Link Here
9
use Module::Load::Conditional qw(can_load);
9
use Module::Load::Conditional qw(can_load);
10
use JSON;
10
use JSON;
11
11
12
my $input = new CGI;
12
my $input = CGI->new;
13
13
14
my ($template, $loggedinuser, $cookie)
14
my ($template, $loggedinuser, $cookie)
15
    = get_template_and_user({template_name => "admin/didyoumean.tt",
15
    = get_template_and_user({template_name => "admin/didyoumean.tt",
(-)a/admin/import_export_framework.pl (-1 / +1 lines)
Lines 38-44 if ($auth_status eq 'ok') { Link Here
38
    $authenticated = 1;
38
    $authenticated = 1;
39
}
39
}
40
40
41
my $input = new CGI;
41
my $input = CGI->new;
42
42
43
unless ($authenticated) {
43
unless ($authenticated) {
44
    print $input->header(-type => 'text/plain', -status => '403 Forbidden');
44
    print $input->header(-type => 'text/plain', -status => '403 Forbidden');
(-)a/admin/item_circulation_alerts.pl (-1 / +1 lines)
Lines 111-117 sub dispatch { Link Here
111
        show   => \&show,
111
        show   => \&show,
112
        toggle => \&toggle,
112
        toggle => \&toggle,
113
    );
113
    );
114
    my $input  = new CGI;
114
    my $input  = CGI->new;
115
    my $action = $input->param('action') || 'show';
115
    my $action = $input->param('action') || 'show';
116
    if (not exists $handler{$action}) {
116
    if (not exists $handler{$action}) {
117
        my $status = 400;
117
        my $status = 400;
(-)a/admin/items_search_field.pl (-1 / +1 lines)
Lines 24-30 use C4::Output; Link Here
24
24
25
use Koha::Item::Search::Field qw(GetItemSearchField ModItemSearchField);
25
use Koha::Item::Search::Field qw(GetItemSearchField ModItemSearchField);
26
26
27
my $cgi = new CGI;
27
my $cgi = CGI->new;
28
28
29
my ($template, $borrowernumber, $cookie) = get_template_and_user({
29
my ($template, $borrowernumber, $cookie) = get_template_and_user({
30
    template_name => 'admin/items_search_field.tt',
30
    template_name => 'admin/items_search_field.tt',
(-)a/admin/items_search_fields.pl (-1 / +1 lines)
Lines 24-30 use C4::Output; Link Here
24
24
25
use Koha::Item::Search::Field qw(AddItemSearchField GetItemSearchFields DelItemSearchField);
25
use Koha::Item::Search::Field qw(AddItemSearchField GetItemSearchFields DelItemSearchField);
26
26
27
my $cgi = new CGI;
27
my $cgi = CGI->new;
28
28
29
my ($template, $borrowernumber, $cookie) = get_template_and_user({
29
my ($template, $borrowernumber, $cookie) = get_template_and_user({
30
    template_name => 'admin/items_search_fields.tt',
30
    template_name => 'admin/items_search_fields.tt',
(-)a/admin/itemtypes.pl (-1 / +1 lines)
Lines 35-41 use Koha::ItemTypes; Link Here
35
use Koha::ItemType;
35
use Koha::ItemType;
36
use Koha::Localizations;
36
use Koha::Localizations;
37
37
38
my $input         = new CGI;
38
my $input         = CGI->new;
39
my $searchfield   = $input->param('description');
39
my $searchfield   = $input->param('description');
40
my $itemtype_code = $input->param('itemtype');
40
my $itemtype_code = $input->param('itemtype');
41
my $op            = $input->param('op') // 'list';
41
my $op            = $input->param('op') // 'list';
(-)a/admin/koha2marclinks.pl (-1 / +1 lines)
Lines 29-35 use Koha::BiblioFrameworks; Link Here
29
use Koha::Caches;
29
use Koha::Caches;
30
use Koha::MarcSubfieldStructures;
30
use Koha::MarcSubfieldStructures;
31
31
32
my $input       = new CGI;
32
my $input       = CGI->new;
33
33
34
my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
34
my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
35
    {
35
    {
(-)a/admin/library_groups.pl (-1 / +1 lines)
Lines 27-33 use Koha::Libraries; Link Here
27
use Koha::Library::Group;
27
use Koha::Library::Group;
28
use Koha::Library::Groups;
28
use Koha::Library::Groups;
29
29
30
my $cgi = new CGI;
30
my $cgi = CGI->new;
31
31
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
    {
33
    {
(-)a/admin/localization.pl (-1 / +1 lines)
Lines 26-32 use Koha::Localizations; Link Here
26
26
27
use CGI qw( -utf8 );
27
use CGI qw( -utf8 );
28
28
29
my $query = new CGI;
29
my $query = CGI->new;
30
30
31
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
31
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
32
    {   template_name   => "admin/localization.tt",
32
    {   template_name   => "admin/localization.tt",
(-)a/admin/marc_subfields_structure.pl (-1 / +1 lines)
Lines 61-67 sub marc_subfield_structure_exists { Link Here
61
    return @$rows > 0;
61
    return @$rows > 0;
62
}
62
}
63
63
64
my $input         = new CGI;
64
my $input         = CGI->new;
65
my $tagfield      = $input->param('tagfield');
65
my $tagfield      = $input->param('tagfield');
66
my $tagsubfield   = $input->param('tagsubfield');
66
my $tagsubfield   = $input->param('tagsubfield');
67
my $frameworkcode = $input->param('frameworkcode');
67
my $frameworkcode = $input->param('frameworkcode');
(-)a/admin/marctagstructure.pl (-1 / +1 lines)
Lines 31-37 use Koha::AuthorisedValues; Link Here
31
use Koha::BiblioFrameworks;
31
use Koha::BiblioFrameworks;
32
32
33
# retrieve parameters
33
# retrieve parameters
34
my $input = new CGI;
34
my $input = CGI->new;
35
my $frameworkcode         = $input->param('frameworkcode')         || ''; # set to select framework
35
my $frameworkcode         = $input->param('frameworkcode')         || ''; # set to select framework
36
my $existingframeworkcode = $input->param('existingframeworkcode') || '';
36
my $existingframeworkcode = $input->param('existingframeworkcode') || '';
37
my $searchfield           = $input->param('searchfield') || 0;
37
my $searchfield           = $input->param('searchfield') || 0;
(-)a/admin/matching-rules.pl (-1 / +1 lines)
Lines 29-35 use C4::Matcher qw/valid_normalization_routines/; Link Here
29
29
30
my $script_name = "/cgi-bin/koha/admin/matching-rules.pl";
30
my $script_name = "/cgi-bin/koha/admin/matching-rules.pl";
31
31
32
our $input = new CGI;
32
our $input = CGI->new;
33
my $op = $input->param('op') || '';
33
my $op = $input->param('op') || '';
34
34
35
35
(-)a/admin/oai_set_mappings.pl (-1 / +1 lines)
Lines 39-45 use C4::OAI::Sets; Link Here
39
39
40
use Data::Dumper;
40
use Data::Dumper;
41
41
42
my $input = new CGI;
42
my $input = CGI->new;
43
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
43
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
44
    template_name   => 'admin/oai_set_mappings.tt',
44
    template_name   => 'admin/oai_set_mappings.tt',
45
    query           => $input,
45
    query           => $input,
(-)a/admin/oai_sets.pl (-1 / +1 lines)
Lines 35-41 use C4::OAI::Sets; Link Here
35
35
36
use Data::Dumper;
36
use Data::Dumper;
37
37
38
my $input = new CGI;
38
my $input = CGI->new;
39
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
39
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
40
    template_name   => 'admin/oai_sets.tt',
40
    template_name   => 'admin/oai_sets.tt',
41
    query           => $input,
41
    query           => $input,
(-)a/admin/patron-attr-types.pl (-1 / +1 lines)
Lines 36-42 use Koha::Patron::Categories; Link Here
36
36
37
my $script_name = "/cgi-bin/koha/admin/patron-attr-types.pl";
37
my $script_name = "/cgi-bin/koha/admin/patron-attr-types.pl";
38
38
39
our $input = new CGI;
39
our $input = CGI->new;
40
my $op = $input->param('op') || '';
40
my $op = $input->param('op') || '';
41
41
42
42
(-)a/admin/preferences.pl (-2 / +2 lines)
Lines 222-228 sub _get_pref_files { Link Here
222
    foreach my $file ( glob( "$htdocs/$theme/$lang/modules/admin/preferences/*.pref" ) ) {
222
    foreach my $file ( glob( "$htdocs/$theme/$lang/modules/admin/preferences/*.pref" ) ) {
223
        my ( $tab ) = ( $file =~ /([a-z0-9_-]+)\.pref$/ );
223
        my ( $tab ) = ( $file =~ /([a-z0-9_-]+)\.pref$/ );
224
224
225
        $results{$tab} = $open_files ? new IO::File( $file, 'r' ) : '';
225
        $results{$tab} = $open_files ? IO::File->new( $file, 'r' ) : '';
226
    }
226
    }
227
227
228
    return %results;
228
    return %results;
Lines 301-307 sub matches { Link Here
301
}
301
}
302
302
303
my $dbh = C4::Context->dbh;
303
my $dbh = C4::Context->dbh;
304
our $input = new CGI;
304
our $input = CGI->new;
305
305
306
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
306
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
307
    {   template_name   => "admin/preferences.tt",
307
    {   template_name   => "admin/preferences.tt",
(-)a/admin/searchengine/elasticsearch/mappings.pl (-1 / +1 lines)
Lines 32-38 use Try::Tiny; Link Here
32
use Module::Load::Conditional qw(can_load);
32
use Module::Load::Conditional qw(can_load);
33
33
34
34
35
my $input = new CGI;
35
my $input = CGI->new;
36
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
36
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
37
    {
37
    {
38
        template_name   => 'admin/searchengine/elasticsearch/mappings.tt',
38
        template_name   => 'admin/searchengine/elasticsearch/mappings.tt',
(-)a/admin/share_content.pl (-1 / +1 lines)
Lines 26-32 use C4::Output; Link Here
26
26
27
use Koha::SharedContent;
27
use Koha::SharedContent;
28
28
29
my $query = new CGI;
29
my $query = CGI->new;
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {
31
    {
32
        template_name   => "admin/share_content.tt",
32
        template_name   => "admin/share_content.tt",
(-)a/admin/sms_providers.pl (-1 / +1 lines)
Lines 28-34 use C4::Output; Link Here
28
use Koha::SMS::Provider;
28
use Koha::SMS::Provider;
29
use Koha::SMS::Providers;
29
use Koha::SMS::Providers;
30
30
31
my $cgi = new CGI;
31
my $cgi = CGI->new;
32
32
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
34
    {
34
    {
(-)a/admin/sru_modmapping.pl (-1 / +1 lines)
Lines 24-30 use C4::Output; Link Here
24
24
25
# Initialize CGI, template
25
# Initialize CGI, template
26
26
27
my $input = new CGI;
27
my $input = CGI->new;
28
my $mapstr = $input->param('mapping')//'';
28
my $mapstr = $input->param('mapping')//'';
29
my $type = $input->param('type')//'';
29
my $type = $input->param('type')//'';
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( {
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( {
(-)a/admin/systempreferences.pl (-1 / +1 lines)
Lines 205-211 sub GetPrefParams { Link Here
205
    return $params;
205
    return $params;
206
}
206
}
207
207
208
my $input       = new CGI;
208
my $input       = CGI->new;
209
my $searchfield = $input->param('searchfield') || '';
209
my $searchfield = $input->param('searchfield') || '';
210
my $Tvalue      = $input->param('Tvalue');
210
my $Tvalue      = $input->param('Tvalue');
211
my $offset      = $input->param('offset') || 0;
211
my $offset      = $input->param('offset') || 0;
(-)a/admin/transport-cost-matrix.pl (-1 / +1 lines)
Lines 30-36 use Koha::Libraries; Link Here
30
30
31
use Data::Dumper;
31
use Data::Dumper;
32
32
33
my $input = new CGI;
33
my $input = CGI->new;
34
34
35
my ($template, $loggedinuser, $cookie)
35
my ($template, $loggedinuser, $cookie)
36
    = get_template_and_user({template_name => "admin/transport-cost-matrix.tt",
36
    = get_template_and_user({template_name => "admin/transport-cost-matrix.tt",
(-)a/admin/usage_statistics.pl (-1 / +1 lines)
Lines 23-29 use C4::Output; Link Here
23
use Koha::DateUtils qw( dt_from_string output_pref );
23
use Koha::DateUtils qw( dt_from_string output_pref );
24
use Koha::Libraries;
24
use Koha::Libraries;
25
25
26
my $query = new CGI;
26
my $query = CGI->new;
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
28
    {
28
    {
29
        template_name   => "admin/usage_statistics.tt",
29
        template_name   => "admin/usage_statistics.tt",
(-)a/admin/z3950servers.pl (-1 / +1 lines)
Lines 34-40 use Koha::Z3950Servers; Link Here
34
34
35
# Initialize CGI, template, database
35
# Initialize CGI, template, database
36
36
37
my $input = new CGI;
37
my $input = CGI->new;
38
my $op = $input->param('op') || 'list';
38
my $op = $input->param('op') || 'list';
39
my $id = $input->param('id') || 0;
39
my $id = $input->param('id') || 0;
40
my $type = $input->param('type') || '';
40
my $type = $input->param('type') || '';
(-)a/authorities/auth_finder.pl (-1 / +1 lines)
Lines 31-37 use Koha::SearchEngine::QueryBuilder; Link Here
31
31
32
use Koha::Authority::Types;
32
use Koha::Authority::Types;
33
33
34
my $query        = new CGI;
34
my $query        = CGI->new;
35
my $op           = $query->param('op') || '';
35
my $op           = $query->param('op') || '';
36
my $authtypecode = $query->param('authtypecode') || '';
36
my $authtypecode = $query->param('authtypecode') || '';
37
my $index        = $query->param('index') || '';
37
my $index        = $query->param('index') || '';
(-)a/authorities/authorities-home.pl (-1 / +1 lines)
Lines 38-44 use Koha::SearchEngine::QueryBuilder; Link Here
38
use Koha::Token;
38
use Koha::Token;
39
use Koha::Z3950Servers;
39
use Koha::Z3950Servers;
40
40
41
my $query = new CGI;
41
my $query = CGI->new;
42
my $dbh   = C4::Context->dbh;
42
my $dbh   = C4::Context->dbh;
43
my $op           = $query->param('op')           || '';
43
my $op           = $query->param('op')           || '';
44
my $authtypecode = $query->param('authtypecode') || '';
44
my $authtypecode = $query->param('authtypecode') || '';
(-)a/authorities/authorities.pl (-1 / +1 lines)
Lines 553-559 sub build_hidden_data { Link Here
553
# ======================== 
553
# ======================== 
554
#          MAIN 
554
#          MAIN 
555
#=========================
555
#=========================
556
my $input = new CGI;
556
my $input = CGI->new;
557
my $z3950 = $input->param('z3950');
557
my $z3950 = $input->param('z3950');
558
my $error = $input->param('error');
558
my $error = $input->param('error');
559
my $authid=$input->param('authid'); # if authid exists, it's a modif, not a new authority.
559
my $authid=$input->param('authid'); # if authid exists, it's a modif, not a new authority.
(-)a/authorities/blinddetail-biblio-search.pl (-1 / +1 lines)
Lines 49-55 use C4::Koha; Link Here
49
use Koha::Authorities;
49
use Koha::Authorities;
50
use Koha::Authority::Types;
50
use Koha::Authority::Types;
51
51
52
my $query = new CGI;
52
my $query = CGI->new;
53
53
54
my $dbh = C4::Context->dbh;
54
my $dbh = C4::Context->dbh;
55
55
(-)a/authorities/detail-biblio-search.pl (-1 / +1 lines)
Lines 51-57 use C4::Koha; Link Here
51
use Koha::Authorities;
51
use Koha::Authorities;
52
use Koha::Authority::Types;
52
use Koha::Authority::Types;
53
53
54
my $query=new CGI;
54
my $query=CGI->new;
55
55
56
my $dbh=C4::Context->dbh;
56
my $dbh=C4::Context->dbh;
57
57
(-)a/authorities/detail.pl (-1 / +1 lines)
Lines 164-170 sub build_tabs { Link Here
164
164
165
165
166
# 
166
# 
167
my $query=new CGI;
167
my $query=CGI->new;
168
168
169
my $dbh=C4::Context->dbh;
169
my $dbh=C4::Context->dbh;
170
170
(-)a/authorities/export.pl (-1 / +1 lines)
Lines 7-13 use C4::Output; Link Here
7
use C4::AuthoritiesMarc;
7
use C4::AuthoritiesMarc;
8
use CGI qw ( -utf8 );
8
use CGI qw ( -utf8 );
9
9
10
my $query = new CGI;
10
my $query = CGI->new;
11
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
11
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
12
    {
12
    {
13
        template_name   => "tools/export.tt",
13
        template_name   => "tools/export.tt",
(-)a/authorities/merge.pl (-1 / +1 lines)
Lines 29-35 use Koha::Authority::MergeRequests; Link Here
29
use Koha::Authority::Types;
29
use Koha::Authority::Types;
30
use Koha::MetadataRecord::Authority;
30
use Koha::MetadataRecord::Authority;
31
31
32
my $input  = new CGI;
32
my $input  = CGI->new;
33
my @authid = $input->multi_param('authid');
33
my @authid = $input->multi_param('authid');
34
my $merge  = $input->param('merge');
34
my $merge  = $input->param('merge');
35
35
(-)a/authorities/ysearch.pl (-1 / +1 lines)
Lines 38-44 use C4::Output; Link Here
38
use Koha::SearchEngine::Search;
38
use Koha::SearchEngine::Search;
39
use Koha::SearchEngine::QueryBuilder;
39
use Koha::SearchEngine::QueryBuilder;
40
40
41
my $query = new CGI;
41
my $query = CGI->new;
42
42
43
my ( $auth_status, $sessionID ) = check_cookie_auth( $query->cookie('CGISESSID'), { catalogue => 1 } );
43
my ( $auth_status, $sessionID ) = check_cookie_auth( $query->cookie('CGISESSID'), { catalogue => 1 } );
44
44
(-)a/basket/basket.pl (-1 / +1 lines)
Lines 27-33 use C4::Output; Link Here
27
use Koha::AuthorisedValues;
27
use Koha::AuthorisedValues;
28
use Koha::CsvProfiles;
28
use Koha::CsvProfiles;
29
29
30
my $query = new CGI;
30
my $query = CGI->new;
31
31
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
33
    {
33
    {
(-)a/basket/downloadcart.pl (-1 / +1 lines)
Lines 32-38 use C4::Ris; Link Here
32
use Koha::CsvProfiles;
32
use Koha::CsvProfiles;
33
33
34
use utf8;
34
use utf8;
35
my $query = new CGI;
35
my $query = CGI->new;
36
36
37
my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
37
my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
38
    {
38
    {
(-)a/catalogue/ISBDdetail.pl (-1 / +1 lines)
Lines 51-57 use Koha::Patrons; Link Here
51
use Koha::RecordProcessor;
51
use Koha::RecordProcessor;
52
52
53
53
54
my $query = new CGI;
54
my $query = CGI->new;
55
my $dbh = C4::Context->dbh;
55
my $dbh = C4::Context->dbh;
56
56
57
my $biblionumber = $query->param('biblionumber');
57
my $biblionumber = $query->param('biblionumber');
(-)a/catalogue/MARCdetail.pl (-1 / +1 lines)
Lines 65-71 use Koha::DateUtils; Link Here
65
65
66
use List::MoreUtils qw( uniq );
66
use List::MoreUtils qw( uniq );
67
67
68
my $query        = new CGI;
68
my $query        = CGI->new;
69
my $dbh          = C4::Context->dbh;
69
my $dbh          = C4::Context->dbh;
70
my $biblionumber = $query->param('biblionumber');
70
my $biblionumber = $query->param('biblionumber');
71
$biblionumber = HTML::Entities::encode($biblionumber);
71
$biblionumber = HTML::Entities::encode($biblionumber);
(-)a/catalogue/export.pl (-1 / +1 lines)
Lines 10-16 use C4::Ris; Link Here
10
10
11
11
12
12
13
my $query = new CGI;
13
my $query = CGI->new;
14
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
14
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
15
    template_name   => "tools/export.tt",
15
    template_name   => "tools/export.tt",
16
    query           => $query,
16
    query           => $query,
(-)a/catalogue/getitem-ajax.pl (-1 / +1 lines)
Lines 32-38 use Koha::AuthorisedValues; Link Here
32
use Koha::Items;
32
use Koha::Items;
33
use Koha::ItemTypes;
33
use Koha::ItemTypes;
34
34
35
my $cgi = new CGI;
35
my $cgi = CGI->new;
36
36
37
my ( $status, $cookie, $sessionID ) = C4::Auth::check_api_auth( $cgi, { acquisition => 'order_receive' } );
37
my ( $status, $cookie, $sessionID ) = C4::Auth::check_api_auth( $cgi, { acquisition => 'order_receive' } );
38
unless ($status eq "ok") {
38
unless ($status eq "ok") {
(-)a/catalogue/image.pl (-1 / +1 lines)
Lines 32-38 use C4::Images; Link Here
32
$| = 1;
32
$| = 1;
33
33
34
my $DEBUG = 0;
34
my $DEBUG = 0;
35
my $data  = new CGI;
35
my $data  = CGI->new;
36
my $imagenumber;
36
my $imagenumber;
37
37
38
=head1 NAME
38
=head1 NAME
(-)a/catalogue/imageviewer.pl (-1 / +1 lines)
Lines 30-36 use C4::Search; Link Here
30
use Koha::Biblios;
30
use Koha::Biblios;
31
use Koha::Patrons;
31
use Koha::Patrons;
32
32
33
my $query = new CGI;
33
my $query = CGI->new;
34
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
34
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
35
    {
35
    {
36
        template_name   => "catalogue/imageviewer.tt",
36
        template_name   => "catalogue/imageviewer.tt",
(-)a/catalogue/issuehistory.pl (-1 / +1 lines)
Lines 30-36 use Koha::Old::Checkouts; Link Here
30
30
31
use Koha::Biblios;
31
use Koha::Biblios;
32
32
33
my $query = new CGI;
33
my $query = CGI->new;
34
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
34
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
35
    {
35
    {
36
        template_name   => "catalogue/issuehistory.tt",
36
        template_name   => "catalogue/issuehistory.tt",
(-)a/catalogue/item-export.pl (-1 / +1 lines)
Lines 24-30 use CGI; Link Here
24
use C4::Auth;
24
use C4::Auth;
25
use C4::Output;
25
use C4::Output;
26
26
27
my $cgi = new CGI;
27
my $cgi = CGI->new;
28
28
29
my ($template, $borrowernumber, $cookie) = get_template_and_user({
29
my ($template, $borrowernumber, $cookie) = get_template_and_user({
30
    template_name => 'catalogue/itemsearch_csv.tt',
30
    template_name => 'catalogue/itemsearch_csv.tt',
(-)a/catalogue/itemsearch.pl (-1 / +1 lines)
Lines 33-39 use Koha::Item::Search::Field qw(GetItemSearchFields); Link Here
33
use Koha::ItemTypes;
33
use Koha::ItemTypes;
34
use Koha::Libraries;
34
use Koha::Libraries;
35
35
36
my $cgi = new CGI;
36
my $cgi = CGI->new;
37
my %params = $cgi->Vars;
37
my %params = $cgi->Vars;
38
38
39
my $format = $cgi->param('format');
39
my $format = $cgi->param('format');
(-)a/catalogue/labeledMARCdetail.pl (-1 / +1 lines)
Lines 33-39 use Koha::Biblios; Link Here
33
use Koha::BiblioFrameworks;
33
use Koha::BiblioFrameworks;
34
use Koha::Patrons;
34
use Koha::Patrons;
35
35
36
my $query        = new CGI;
36
my $query        = CGI->new;
37
my $dbh          = C4::Context->dbh;
37
my $dbh          = C4::Context->dbh;
38
my $biblionumber = $query->param('biblionumber');
38
my $biblionumber = $query->param('biblionumber');
39
$biblionumber = HTML::Entities::encode($biblionumber);
39
$biblionumber = HTML::Entities::encode($biblionumber);
(-)a/catalogue/moredetail.pl (-1 / +1 lines)
Lines 38-44 use Koha::DateUtils; Link Here
38
use Koha::Items;
38
use Koha::Items;
39
use Koha::Patrons;
39
use Koha::Patrons;
40
40
41
my $query=new CGI;
41
my $query=CGI->new;
42
42
43
my ($template, $loggedinuser, $cookie) = get_template_and_user(
43
my ($template, $loggedinuser, $cookie) = get_template_and_user(
44
    {
44
    {
(-)a/catalogue/search-history.pl (-1 / +1 lines)
Lines 25-31 use C4::Auth; Link Here
25
use C4::Search::History;
25
use C4::Search::History;
26
use C4::Output;
26
use C4::Output;
27
27
28
my $cgi = new CGI;
28
my $cgi = CGI->new;
29
29
30
my ($template, $loggedinuser, $cookie) = get_template_and_user({
30
my ($template, $loggedinuser, $cookie) = get_template_and_user({
31
    template_name   => 'catalogue/search-history.tt',
31
    template_name   => 'catalogue/search-history.tt',
(-)a/catalogue/search.pl (-1 / +1 lines)
Lines 163-169 my $DisplayMultiPlaceHold = C4::Context->preference("DisplayMultiPlaceHold"); Link Here
163
# create a new CGI object
163
# create a new CGI object
164
# FIXME: no_undef_params needs to be tested
164
# FIXME: no_undef_params needs to be tested
165
use CGI qw('-no_undef_params' -utf8 );
165
use CGI qw('-no_undef_params' -utf8 );
166
my $cgi = new CGI;
166
my $cgi = CGI->new;
167
167
168
# decide which template to use
168
# decide which template to use
169
my $template_name;
169
my $template_name;
(-)a/catalogue/showmarc.pl (-1 / +1 lines)
Lines 35-41 use C4::Biblio; Link Here
35
use C4::ImportBatch;
35
use C4::ImportBatch;
36
use C4::XSLT ();
36
use C4::XSLT ();
37
37
38
my $input= new CGI;
38
my $input= CGI->new;
39
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
39
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
40
  {
40
  {
41
    template_name   => "catalogue/showmarc.tt",
41
    template_name   => "catalogue/showmarc.tt",
(-)a/catalogue/stockrotation.pl (-1 / +1 lines)
Lines 38-44 use Koha::StockRotationRotas; Link Here
38
use Koha::StockRotationStages;
38
use Koha::StockRotationStages;
39
use Koha::Util::StockRotation qw(:ALL);
39
use Koha::Util::StockRotation qw(:ALL);
40
40
41
my $input = new CGI;
41
my $input = CGI->new;
42
42
43
unless (C4::Context->preference('StockRotation')) {
43
unless (C4::Context->preference('StockRotation')) {
44
    # redirect to Intranet home if self-check is not enabled
44
    # redirect to Intranet home if self-check is not enabled
(-)a/catalogue/updateitem.pl (-1 / +1 lines)
Lines 27-33 use C4::Output; Link Here
27
use C4::Circulation;
27
use C4::Circulation;
28
use C4::Reserves;
28
use C4::Reserves;
29
29
30
my $cgi= new CGI;
30
my $cgi= CGI->new;
31
31
32
checkauth($cgi, 0, {circulate => 'circulate_remaining_permissions'}, 'intranet');
32
checkauth($cgi, 0, {circulate => 'circulate_remaining_permissions'}, 'intranet');
33
33
(-)a/cataloguing/addbiblio.pl (-1 / +1 lines)
Lines 689-695 sub build_tabs { Link Here
689
# ========================
689
# ========================
690
#          MAIN
690
#          MAIN
691
#=========================
691
#=========================
692
my $input = new CGI;
692
my $input = CGI->new;
693
my $error = $input->param('error');
693
my $error = $input->param('error');
694
my $biblionumber  = $input->param('biblionumber'); # if biblionumber exists, it's a modif, not a new biblio.
694
my $biblionumber  = $input->param('biblionumber'); # if biblionumber exists, it's a modif, not a new biblio.
695
my $parentbiblio  = $input->param('parentbiblionumber');
695
my $parentbiblio  = $input->param('parentbiblionumber');
(-)a/cataloguing/addbooks.pl (-1 / +1 lines)
Lines 41-47 use Koha::SearchEngine::Search; Link Here
41
use Koha::SearchEngine::QueryBuilder;
41
use Koha::SearchEngine::QueryBuilder;
42
use Koha::Z3950Servers;
42
use Koha::Z3950Servers;
43
43
44
my $input = new CGI;
44
my $input = CGI->new;
45
45
46
my $success = $input->param('biblioitem');
46
my $success = $input->param('biblioitem');
47
my $query   = $input->param('q');
47
my $query   = $input->param('q');
(-)a/cataloguing/additem.pl (-2 / +2 lines)
Lines 165-171 sub generate_subfield_form { Link Here
165
        }
165
        }
166
166
167
        if ($frameworkcode eq 'FA' && $subfieldlib->{kohafield} eq 'items.barcode' && !$value){
167
        if ($frameworkcode eq 'FA' && $subfieldlib->{kohafield} eq 'items.barcode' && !$value){
168
	    my $input = new CGI;
168
	    my $input = CGI->new;
169
	    $value = $input->param('barcode');
169
	    $value = $input->param('barcode');
170
	}
170
	}
171
171
Lines 395-401 sub removeFieldsForPrefill { Link Here
395
395
396
}
396
}
397
397
398
my $input        = new CGI;
398
my $input        = CGI->new;
399
my $error        = $input->param('error');
399
my $error        = $input->param('error');
400
400
401
my $biblionumber;
401
my $biblionumber;
(-)a/cataloguing/merge.pl (-2 / +2 lines)
Lines 34-40 use Koha::BiblioFrameworks; Link Here
34
use Koha::Items;
34
use Koha::Items;
35
use Koha::MetadataRecord;
35
use Koha::MetadataRecord;
36
36
37
my $input = new CGI;
37
my $input = CGI->new;
38
my @biblionumbers = $input->multi_param('biblionumber');
38
my @biblionumbers = $input->multi_param('biblionumber');
39
my $merge = $input->param('merge');
39
my $merge = $input->param('merge');
40
40
Lines 207-213 if ($merge) { Link Here
207
        foreach my $biblionumber (@biblionumbers) {
207
        foreach my $biblionumber (@biblionumbers) {
208
            my $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
208
            my $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
209
            my $frameworkcode = GetFrameworkCode($biblionumber);
209
            my $frameworkcode = GetFrameworkCode($biblionumber);
210
            my $recordObj = new Koha::MetadataRecord({'record' => $marcrecord, schema => $marcflavour});
210
            my $recordObj = Koha::MetadataRecord->new({'record' => $marcrecord, schema => $marcflavour});
211
            my $record = {
211
            my $record = {
212
                recordid => $biblionumber,
212
                recordid => $biblionumber,
213
                record => $marcrecord,
213
                record => $marcrecord,
(-)a/cataloguing/plugin_launcher.pl (-1 / +1 lines)
Lines 22-28 use CGI qw ( -utf8 ); Link Here
22
22
23
use Koha::FrameworkPlugin;
23
use Koha::FrameworkPlugin;
24
24
25
my $input = new CGI;
25
my $input = CGI->new;
26
my $plugin= Koha::FrameworkPlugin->new( {
26
my $plugin= Koha::FrameworkPlugin->new( {
27
    name => scalar $input->param("plugin_name"),
27
    name => scalar $input->param("plugin_name"),
28
});
28
});
(-)a/cataloguing/value_builder/unimarc_field_210c.pl (-1 / +1 lines)
Lines 54-60 return ($function_name,$res); Link Here
54
54
55
sub plugin {
55
sub plugin {
56
my ($input) = @_;
56
my ($input) = @_;
57
    my $query=new CGI;
57
    my $query=CGI->new;
58
    my $op = $query->param('op');
58
    my $op = $query->param('op');
59
    my $authtypecode = $query->param('authtypecode');
59
    my $authtypecode = $query->param('authtypecode');
60
    my $index = $query->param('index');
60
    my $index = $query->param('index');
(-)a/cataloguing/value_builder/unimarc_field_4XX.pl (-1 / +1 lines)
Lines 69-75 sub plugin_javascript { Link Here
69
sub plugin {
69
sub plugin {
70
    my ($input)   = @_;
70
    my ($input)   = @_;
71
    my $dbh       = C4::Context->dbh;
71
    my $dbh       = C4::Context->dbh;
72
    my $query     = new CGI;
72
    my $query     = CGI->new;
73
    my $op        = $query->param('op');
73
    my $op        = $query->param('op');
74
    my $type      = $query->param('type');
74
    my $type      = $query->param('type');
75
    my $startfrom = $query->param('startfrom');
75
    my $startfrom = $query->param('startfrom');
(-)a/cataloguing/ysearch.pl (-1 / +1 lines)
Lines 31-37 use C4::Charset; Link Here
31
use C4::Auth qw/check_cookie_auth/;
31
use C4::Auth qw/check_cookie_auth/;
32
use JSON qw/ to_json /;
32
use JSON qw/ to_json /;
33
33
34
my $input = new CGI;
34
my $input = CGI->new;
35
my $query = $input->param('term');
35
my $query = $input->param('term');
36
my $table = $input->param('table');
36
my $table = $input->param('table');
37
my $field = $input->param('field');
37
my $field = $input->param('field');
(-)a/cataloguing/z3950_auth_search.pl (-1 / +1 lines)
Lines 26-32 use C4::Context; Link Here
26
use C4::Breeding;
26
use C4::Breeding;
27
use C4::Koha;
27
use C4::Koha;
28
28
29
my $input        = new CGI;
29
my $input        = CGI->new;
30
my $dbh          = C4::Context->dbh;
30
my $dbh          = C4::Context->dbh;
31
my $error         = $input->param('error');
31
my $error         = $input->param('error');
32
my $authid  = $input->param('authid') || 0;
32
my $authid  = $input->param('authid') || 0;
(-)a/cataloguing/z3950_search.pl (-1 / +1 lines)
Lines 27-33 use C4::Context; Link Here
27
use C4::Breeding;
27
use C4::Breeding;
28
use C4::Koha;
28
use C4::Koha;
29
29
30
my $input        = new CGI;
30
my $input        = CGI->new;
31
my $error         = $input->param('error');
31
my $error         = $input->param('error');
32
my $biblionumber  = $input->param('biblionumber') || 0;
32
my $biblionumber  = $input->param('biblionumber') || 0;
33
my $frameworkcode = $input->param('frameworkcode');
33
my $frameworkcode = $input->param('frameworkcode');
(-)a/changelanguage.pl (-1 / +1 lines)
Lines 20-26 use CGI qw ( -utf8 ); Link Here
20
use C4::Templates;
20
use C4::Templates;
21
use Koha::Util::Navigation;
21
use Koha::Util::Navigation;
22
22
23
my $query = new CGI;
23
my $query = CGI->new;
24
my $language = $query->param('language');
24
my $language = $query->param('language');
25
my $url = Koha::Util::Navigation::local_referer($query, {remove_language => 1, staff => 1});
25
my $url = Koha::Util::Navigation::local_referer($query, {remove_language => 1, staff => 1});
26
26
(-)a/circ/add_message.pl (-1 / +1 lines)
Lines 25-31 use C4::Auth; Link Here
25
use C4::Output;
25
use C4::Output;
26
use Koha::Patron::Message;
26
use Koha::Patron::Message;
27
27
28
my $input = new CGI;
28
my $input = CGI->new;
29
29
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {   template_name   => "circ/circulation.tt",
31
    {   template_name   => "circ/circulation.tt",
(-)a/circ/article-request-slip.pl (-1 / +1 lines)
Lines 28-34 use C4::Letters; Link Here
28
use Koha::ArticleRequests;
28
use Koha::ArticleRequests;
29
use Koha::Patrons;
29
use Koha::Patrons;
30
30
31
my $cgi = new CGI;
31
my $cgi = CGI->new;
32
32
33
my $id = $cgi->param('id');
33
my $id = $cgi->param('id');
34
34
(-)a/circ/article-requests.pl (-1 / +1 lines)
Lines 25-31 use C4::Auth; Link Here
25
use C4::Output;
25
use C4::Output;
26
use Koha::ArticleRequests;
26
use Koha::ArticleRequests;
27
27
28
my $query = new CGI;
28
my $query = CGI->new;
29
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
29
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
    {
30
    {
31
        template_name   => "circ/article-requests.tt",
31
        template_name   => "circ/article-requests.tt",
(-)a/circ/bookcount.pl (-1 / +1 lines)
Lines 32-38 use Koha::Biblios; Link Here
32
use Koha::DateUtils;
32
use Koha::DateUtils;
33
use Koha::Libraries;
33
use Koha::Libraries;
34
34
35
my $input        = new CGI;
35
my $input        = CGI->new;
36
my $itm          = $input->param('itm');
36
my $itm          = $input->param('itm');
37
my $biblionumber = $input->param('biblionumber');
37
my $biblionumber = $input->param('biblionumber');
38
38
(-)a/circ/branchoverdues.pl (-1 / +1 lines)
Lines 38-44 by item location. Link Here
38
38
39
=cut
39
=cut
40
40
41
my $input       = new CGI;
41
my $input       = CGI->new;
42
my $dbh = C4::Context->dbh;
42
my $dbh = C4::Context->dbh;
43
43
44
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user({
44
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user({
(-)a/circ/branchtransfers.pl (-1 / +1 lines)
Lines 39-45 use Koha::Patrons; Link Here
39
###############################################
39
###############################################
40
#  Getting state
40
#  Getting state
41
41
42
my $query = new CGI;
42
my $query = CGI->new;
43
43
44
if (!C4::Context->userenv){
44
if (!C4::Context->userenv){
45
	my $sessionID = $query->cookie("CGISESSID");
45
	my $sessionID = $query->cookie("CGISESSID");
(-)a/circ/checkout-notes.pl (-1 / +1 lines)
Lines 25-31 use C4::Output; Link Here
25
use C4::Auth;
25
use C4::Auth;
26
use Koha::Checkouts;
26
use Koha::Checkouts;
27
27
28
my $query = new CGI;
28
my $query = CGI->new;
29
29
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {
31
    {
(-)a/circ/circulation-home.pl (-1 / +1 lines)
Lines 24-30 use C4::Context; Link Here
24
use Koha::BiblioFrameworks;
24
use Koha::BiblioFrameworks;
25
use Koha::Checkouts;
25
use Koha::Checkouts;
26
26
27
my $query = new CGI;
27
my $query = CGI->new;
28
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user(
28
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user(
29
    {
29
    {
30
        template_name   => "circ/circulation-home.tt",
30
        template_name   => "circ/circulation-home.tt",
(-)a/circ/circulation.pl (-1 / +1 lines)
Lines 65-71 use List::MoreUtils qw/uniq/; Link Here
65
#
65
#
66
# PARAMETERS READING
66
# PARAMETERS READING
67
#
67
#
68
my $query = new CGI;
68
my $query = CGI->new;
69
69
70
my $override_high_holds     = $query->param('override_high_holds');
70
my $override_high_holds     = $query->param('override_high_holds');
71
my $override_high_holds_tmp = $query->param('override_high_holds_tmp');
71
my $override_high_holds_tmp = $query->param('override_high_holds_tmp');
(-)a/circ/del_message.pl (-1 / +1 lines)
Lines 25-31 use C4::Auth; Link Here
25
use C4::Output;
25
use C4::Output;
26
use Koha::Patron::Messages;
26
use Koha::Patron::Messages;
27
27
28
my $input = new CGI;
28
my $input = CGI->new;
29
29
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {   template_name   => "circ/circulation.tt",
31
    {   template_name   => "circ/circulation.tt",
(-)a/circ/hold-transfer-slip.pl (-1 / +1 lines)
Lines 31-37 BEGIN { Link Here
31
    $debug = $ENV{DEBUG} || 0;
31
    $debug = $ENV{DEBUG} || 0;
32
}
32
}
33
33
34
my $input = new CGI;
34
my $input = CGI->new;
35
my $sessionID = $input->cookie("CGISESSID");
35
my $sessionID = $input->cookie("CGISESSID");
36
my $session = get_session($sessionID);
36
my $session = get_session($sessionID);
37
37
(-)a/circ/offline-mf.pl (-1 / +1 lines)
Lines 20-26 use Modern::Perl; Link Here
20
use CGI qw ( -utf8 );
20
use CGI qw ( -utf8 );
21
use C4::Auth;
21
use C4::Auth;
22
22
23
my $query = new CGI;
23
my $query = CGI->new;
24
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
24
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
25
    {
25
    {
26
        template_name   => "circ/offline-mf.tt",
26
        template_name   => "circ/offline-mf.tt",
(-)a/circ/offline.pl (-1 / +1 lines)
Lines 22-28 use C4::Auth; Link Here
22
use C4::Output;
22
use C4::Output;
23
use C4::Context;
23
use C4::Context;
24
24
25
my $query = new CGI;
25
my $query = CGI->new;
26
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
26
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
27
    {
27
    {
28
        template_name   => "circ/offline.tt",
28
        template_name   => "circ/offline.tt",
(-)a/circ/on-site_checkouts.pl (-1 / +1 lines)
Lines 24-30 use C4::Output; Link Here
24
use C4::Koha;
24
use C4::Koha;
25
use Koha::BiblioFrameworks;
25
use Koha::BiblioFrameworks;
26
26
27
my $cgi = new CGI;
27
my $cgi = CGI->new;
28
28
29
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
29
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
30
    {
30
    {
(-)a/circ/overdue.pl (-1 / +1 lines)
Lines 30-36 use Koha::DateUtils; Link Here
30
use DateTime;
30
use DateTime;
31
use DateTime::Format::MySQL;
31
use DateTime::Format::MySQL;
32
32
33
my $input = new CGI;
33
my $input = CGI->new;
34
my $showall         = $input->param('showall');
34
my $showall         = $input->param('showall');
35
my $bornamefilter   = $input->param('borname') || '';
35
my $bornamefilter   = $input->param('borname') || '';
36
my $borcatfilter    = $input->param('borcat') || '';
36
my $borcatfilter    = $input->param('borcat') || '';
(-)a/circ/pendingreserves.pl (-1 / +1 lines)
Lines 33-39 use Koha::DateUtils; Link Here
33
use Koha::Holds;
33
use Koha::Holds;
34
use DateTime::Duration;
34
use DateTime::Duration;
35
35
36
my $input = new CGI;
36
my $input = CGI->new;
37
my $startdate = $input->param('from');
37
my $startdate = $input->param('from');
38
my $enddate = $input->param('to');
38
my $enddate = $input->param('to');
39
my $theme = $input->param('theme');    # only used if allowthemeoverride is set
39
my $theme = $input->param('theme');    # only used if allowthemeoverride is set
(-)a/circ/renew.pl (-1 / +1 lines)
Lines 29-35 use Koha::DateUtils; Link Here
29
use Koha::Database;
29
use Koha::Database;
30
use Koha::BiblioFrameworks;
30
use Koha::BiblioFrameworks;
31
31
32
my $cgi = new CGI;
32
my $cgi = CGI->new;
33
33
34
my ( $template, $librarian, $cookie, $flags ) = get_template_and_user(
34
my ( $template, $librarian, $cookie, $flags ) = get_template_and_user(
35
    {
35
    {
(-)a/circ/request-article.pl (-1 / +1 lines)
Lines 28-34 use Koha::Biblios; Link Here
28
use Koha::Patrons;
28
use Koha::Patrons;
29
use Koha::ArticleRequests;
29
use Koha::ArticleRequests;
30
30
31
my $cgi = new CGI;
31
my $cgi = CGI->new;
32
32
33
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
33
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
34
    {
34
    {
(-)a/circ/reserveratios.pl (-1 / +1 lines)
Lines 32-38 use C4::Acquisition qw/GetOrdersByBiblionumber/; Link Here
32
use Koha::DateUtils;
32
use Koha::DateUtils;
33
use Koha::Acquisition::Baskets;
33
use Koha::Acquisition::Baskets;
34
34
35
my $input = new CGI;
35
my $input = CGI->new;
36
my $startdate       = $input->param('from');
36
my $startdate       = $input->param('from');
37
my $enddate         = $input->param('to');
37
my $enddate         = $input->param('to');
38
my $ratio           = $input->param('ratio');
38
my $ratio           = $input->param('ratio');
(-)a/circ/returns.pl (-1 / +1 lines)
Lines 57-63 use Koha::Holds; Link Here
57
use Koha::Items;
57
use Koha::Items;
58
use Koha::Patrons;
58
use Koha::Patrons;
59
59
60
my $query = new CGI;
60
my $query = CGI->new;
61
61
62
#getting the template
62
#getting the template
63
my ( $template, $librarian, $cookie, $flags ) = get_template_and_user(
63
my ( $template, $librarian, $cookie, $flags ) = get_template_and_user(
(-)a/circ/transfer-slip.pl (-1 / +1 lines)
Lines 32-38 BEGIN { Link Here
32
    $debug = $ENV{DEBUG} || 0;
32
    $debug = $ENV{DEBUG} || 0;
33
}
33
}
34
34
35
my $input = new CGI;
35
my $input = CGI->new;
36
my $sessionID = $input->cookie("CGISESSID");
36
my $sessionID = $input->cookie("CGISESSID");
37
my $session = get_session($sessionID);
37
my $session = get_session($sessionID);
38
38
(-)a/circ/transferstoreceive.pl (-1 / +1 lines)
Lines 41-47 use Koha::DateUtils; Link Here
41
use Koha::BiblioFrameworks;
41
use Koha::BiblioFrameworks;
42
use Koha::Patrons;
42
use Koha::Patrons;
43
43
44
my $input = new CGI;
44
my $input = CGI->new;
45
my $itemnumber = $input->param('itemnumber');
45
my $itemnumber = $input->param('itemnumber');
46
46
47
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
47
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
(-)a/circ/view_holdsqueue.pl (-1 / +1 lines)
Lines 32-38 use C4::HoldsQueue qw(GetHoldsQueueItems); Link Here
32
use Koha::BiblioFrameworks;
32
use Koha::BiblioFrameworks;
33
use Koha::ItemTypes;
33
use Koha::ItemTypes;
34
34
35
my $query = new CGI;
35
my $query = CGI->new;
36
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
36
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
37
    {
37
    {
38
        template_name   => "circ/view_holdsqueue.tt",
38
        template_name   => "circ/view_holdsqueue.tt",
(-)a/circ/waitingreserves.pl (-1 / +1 lines)
Lines 40-46 use Koha::Items; Link Here
40
use Koha::ItemTypes;
40
use Koha::ItemTypes;
41
use Koha::Patrons;
41
use Koha::Patrons;
42
42
43
my $input = new CGI;
43
my $input = CGI->new;
44
44
45
my $item           = $input->param('itemnumber');
45
my $item           = $input->param('itemnumber');
46
my $borrowernumber = $input->param('borrowernumber');
46
my $borrowernumber = $input->param('borrowernumber');
(-)a/circ/ypattrodue-attr-search-authvalue.pl (-1 / +1 lines)
Lines 24-30 use C4::Context; Link Here
24
use C4::Auth qw/check_cookie_auth/;
24
use C4::Auth qw/check_cookie_auth/;
25
use C4::Debug;
25
use C4::Debug;
26
26
27
my $input    = new CGI;
27
my $input    = CGI->new;
28
my $query    = $input->param('term');
28
my $query    = $input->param('term');
29
my $attrcode = $input->path_info || '';
29
my $attrcode = $input->path_info || '';
30
$attrcode =~ s|^/||;
30
$attrcode =~ s|^/||;
(-)a/circ/ysearch.pl (-1 / +1 lines)
Lines 33-39 use Koha::DateUtils qw/format_sqldatetime/; Link Here
33
33
34
use JSON qw( to_json );
34
use JSON qw( to_json );
35
35
36
my $input = new CGI;
36
my $input = CGI->new;
37
my $query = $input->param('term');
37
my $query = $input->param('term');
38
38
39
binmode STDOUT, ":encoding(UTF-8)";
39
binmode STDOUT, ":encoding(UTF-8)";
(-)a/clubs/club-enrollments.pl (-1 / +1 lines)
Lines 25-31 use C4::Auth; Link Here
25
use C4::Output;
25
use C4::Output;
26
use Koha::Clubs;
26
use Koha::Clubs;
27
27
28
my $cgi = new CGI;
28
my $cgi = CGI->new;
29
29
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {
31
    {
(-)a/clubs/clubs-add-modify.pl (-1 / +1 lines)
Lines 28-34 use Koha::DateUtils qw(dt_from_string); Link Here
28
use Koha::Clubs;
28
use Koha::Clubs;
29
use Koha::Club::Fields;
29
use Koha::Club::Fields;
30
30
31
my $cgi = new CGI;
31
my $cgi = CGI->new;
32
32
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
34
    {
34
    {
(-)a/clubs/clubs.pl (-1 / +1 lines)
Lines 27-33 use C4::Output; Link Here
27
use Koha::Clubs;
27
use Koha::Clubs;
28
use Koha::Club::Templates;
28
use Koha::Club::Templates;
29
29
30
my $cgi = new CGI;
30
my $cgi = CGI->new;
31
31
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
    {
33
    {
(-)a/clubs/patron-clubs-tab.pl (-1 / +1 lines)
Lines 27-33 use C4::Output; Link Here
27
use Koha::Patrons;
27
use Koha::Patrons;
28
use Koha::Club::Enrollments;
28
use Koha::Club::Enrollments;
29
29
30
my $cgi = new CGI;
30
my $cgi = CGI->new;
31
31
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
    {
33
    {
(-)a/clubs/patron-enroll.pl (-1 / +1 lines)
Lines 25-31 use C4::Auth; Link Here
25
use C4::Output;
25
use C4::Output;
26
use Koha::Clubs;
26
use Koha::Clubs;
27
27
28
my $cgi = new CGI;
28
my $cgi = CGI->new;
29
29
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {
31
    {
(-)a/clubs/templates-add-modify.pl (-1 / +1 lines)
Lines 32-38 use Koha::Club::Template::EnrollmentFields; Link Here
32
use Koha::Database;
32
use Koha::Database;
33
my $schema = Koha::Database->new()->schema();
33
my $schema = Koha::Database->new()->schema();
34
34
35
my $cgi = new CGI;
35
my $cgi = CGI->new;
36
36
37
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
37
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
38
    {
38
    {
(-)a/course_reserves/add_items.pl (-1 / +1 lines)
Lines 33-39 use C4::CourseReserves qw(GetCourse GetCourseItem GetCourseReserve ModCourseItem Link Here
33
use Koha::Items;
33
use Koha::Items;
34
use Koha::ItemTypes;
34
use Koha::ItemTypes;
35
35
36
my $cgi = new CGI;
36
my $cgi = CGI->new;
37
37
38
my $action       = $cgi->param('action')       || '';
38
my $action       = $cgi->param('action')       || '';
39
my $course_id    = $cgi->param('course_id')    || '';
39
my $course_id    = $cgi->param('course_id')    || '';
(-)a/course_reserves/batch_add_items.pl (-1 / +1 lines)
Lines 29-35 use C4::CourseReserves qw(ModCourseItem ModCourseReserve GetCourse); Link Here
29
29
30
use Koha::Items;
30
use Koha::Items;
31
31
32
my $cgi = new CGI;
32
my $cgi = CGI->new;
33
33
34
my $action    = $cgi->param('action')    || q{};
34
my $action    = $cgi->param('action')    || q{};
35
my $course_id = $cgi->param('course_id') || q{};
35
my $course_id = $cgi->param('course_id') || q{};
(-)a/course_reserves/course-details.pl (-1 / +1 lines)
Lines 28-34 use C4::Koha; Link Here
28
28
29
use C4::CourseReserves qw(DelCourseReserve GetCourse GetCourseReserves);
29
use C4::CourseReserves qw(DelCourseReserve GetCourse GetCourseReserves);
30
30
31
my $cgi = new CGI;
31
my $cgi = CGI->new;
32
32
33
my $action = $cgi->param('action') || '';
33
my $action = $cgi->param('action') || '';
34
my $course_id = $cgi->param('course_id');
34
my $course_id = $cgi->param('course_id');
(-)a/course_reserves/course-reserves.pl (-1 / +1 lines)
Lines 27-33 use C4::Output; Link Here
27
27
28
use C4::CourseReserves qw(GetCourses);
28
use C4::CourseReserves qw(GetCourses);
29
29
30
my $cgi = new CGI;
30
my $cgi = CGI->new;
31
31
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
    {
33
    {
(-)a/course_reserves/course.pl (-1 / +1 lines)
Lines 28-34 use C4::Koha; Link Here
28
28
29
use C4::CourseReserves qw(GetCourse);
29
use C4::CourseReserves qw(GetCourse);
30
30
31
my $cgi = new CGI;
31
my $cgi = CGI->new;
32
32
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
34
    {   template_name   => "course_reserves/course.tt",
34
    {   template_name   => "course_reserves/course.tt",
(-)a/course_reserves/mod_course.pl (-1 / +1 lines)
Lines 27-33 use C4::Auth; Link Here
27
27
28
use C4::CourseReserves qw(DelCourse ModCourse ModCourseInstructors);
28
use C4::CourseReserves qw(DelCourse ModCourse ModCourseInstructors);
29
29
30
my $cgi = new CGI;
30
my $cgi = CGI->new;
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
    {   template_name   => "about.tt",
32
    {   template_name   => "about.tt",
33
        query           => $cgi,
33
        query           => $cgi,
(-)a/docs/CAS/CASProxy/examples/koha_webservice.pl (-1 / +1 lines)
Lines 44-50 use C4::Output; Link Here
44
use C4::Context;
44
use C4::Context;
45
use CGI qw ( -utf8 );
45
use CGI qw ( -utf8 );
46
46
47
my $cgi = new CGI;
47
my $cgi = CGI->new;
48
48
49
print CGI::header('-type'=>'text/plain', '-charset'=>'utf-8');
49
print CGI::header('-type'=>'text/plain', '-charset'=>'utf-8');
50
50
(-)a/docs/CAS/CASProxy/examples/proxy_cas.pl (-1 / +1 lines)
Lines 35-41 use Authen::CAS::Client; Link Here
35
# URL Of the CAS Server
35
# URL Of the CAS Server
36
my $casServerUrl = 'https://localhost:8443/cas/';
36
my $casServerUrl = 'https://localhost:8443/cas/';
37
my $cas = Authen::CAS::Client->new($casServerUrl);
37
my $cas = Authen::CAS::Client->new($casServerUrl);
38
my $cgi = new CGI;
38
my $cgi = CGI->new;
39
39
40
# URL of the service we're requesting a Service Ticket for (typically this very same page)
40
# URL of the service we're requesting a Service Ticket for (typically this very same page)
41
my $proxy_service = $cgi->url;
41
my $proxy_service = $cgi->url;
(-)a/docs/CAS/CASProxy/examples/proxy_cas_callback.pl (-1 / +1 lines)
Lines 33-39 use Storable qw(nstore_fd); Link Here
33
my $casServerUrl = 'https://localhost:8443/cas/';
33
my $casServerUrl = 'https://localhost:8443/cas/';
34
my $cas = Authen::CAS::Client->new($casServerUrl);
34
my $cas = Authen::CAS::Client->new($casServerUrl);
35
35
36
my $cgi = new CGI;
36
my $cgi = CGI->new;
37
37
38
my $proxy_service = $cgi->url;
38
my $proxy_service = $cgi->url;
39
39
(-)a/docs/CAS/CASProxy/examples/proxy_cas_data.pl (-1 / +1 lines)
Lines 43-49 my $cas = Authen::CAS::Client->new($casServerUrl); Link Here
43
# URL of the service we'd like to be proxy for (typically the Koha webservice we want to query)
43
# URL of the service we'd like to be proxy for (typically the Koha webservice we want to query)
44
my $target_service = "https://.../koha_webservice.pl";
44
my $target_service = "https://.../koha_webservice.pl";
45
45
46
my $cgi = new CGI;
46
my $cgi = CGI->new;
47
47
48
print $cgi->header({-type  =>  'text/html'});
48
print $cgi->header({-type  =>  'text/html'});
49
print $cgi->start_html("proxy cas");
49
print $cgi->start_html("proxy cas");
(-)a/help.pl (-1 / +1 lines)
Lines 24-30 use C4::Auth; Link Here
24
use C4::Context;
24
use C4::Context;
25
use Koha::Manual;
25
use Koha::Manual;
26
26
27
my $query = new CGI;
27
my $query = CGI->new;
28
28
29
# We need to call get_template_and_user to let it does the job correctly
29
# We need to call get_template_and_user to let it does the job correctly
30
# for the language
30
# for the language
(-)a/installer/install.pl (-1 / +1 lines)
Lines 33-39 use C4::Installer::PerlModules; Link Here
33
33
34
use Koha;
34
use Koha;
35
35
36
my $query = new CGI;
36
my $query = CGI->new;
37
my $step  = $query->param('step');
37
my $step  = $query->param('step');
38
38
39
my $language = $query->param('language');
39
my $language = $query->param('language');
(-)a/installer/onboarding.pl (-1 / +1 lines)
Lines 33-39 use Koha::ItemTypes; Link Here
33
use Koha::CirculationRules;
33
use Koha::CirculationRules;
34
34
35
#Setting variables
35
#Setting variables
36
my $input = new CGI;
36
my $input = CGI->new;
37
37
38
unless ( C4::Context->preference('Version') ) {
38
unless ( C4::Context->preference('Version') ) {
39
    print $input->redirect("/cgi-bin/koha/installer/install.pl");
39
    print $input->redirect("/cgi-bin/koha/installer/install.pl");
(-)a/labels/label-create-csv.pl (-1 / +1 lines)
Lines 28-34 use C4::Debug; Link Here
28
use C4::Creators;
28
use C4::Creators;
29
use C4::Labels;
29
use C4::Labels;
30
30
31
my $cgi = new CGI;
31
my $cgi = CGI->new;
32
32
33
my $batch_id;
33
my $batch_id;
34
my @label_ids;
34
my @label_ids;
(-)a/labels/label-create-pdf.pl (-1 / +1 lines)
Lines 26-32 use C4::Debug; Link Here
26
use C4::Creators;
26
use C4::Creators;
27
use C4::Labels;
27
use C4::Labels;
28
28
29
my $cgi = new CGI;
29
my $cgi = CGI->new;
30
30
31
my ( undef, $loggedinuser, $cookie ) = get_template_and_user({
31
my ( undef, $loggedinuser, $cookie ) = get_template_and_user({
32
								     template_name   => "labels/label-home.tt",
32
								     template_name   => "labels/label-home.tt",
(-)a/labels/label-create-xml.pl (-1 / +1 lines)
Lines 28-34 use C4::Debug; Link Here
28
use C4::Creators;
28
use C4::Creators;
29
use C4::Labels;
29
use C4::Labels;
30
30
31
my $cgi = new CGI;
31
my $cgi = CGI->new;
32
32
33
my $batch_id;
33
my $batch_id;
34
my @label_ids;
34
my @label_ids;
(-)a/labels/label-edit-batch.pl (-1 / +1 lines)
Lines 30-36 use C4::Labels; Link Here
30
30
31
use Koha::Items;
31
use Koha::Items;
32
32
33
my $cgi = new CGI;
33
my $cgi = CGI->new;
34
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
34
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
35
    {
35
    {
36
        template_name   => "labels/label-edit-batch.tt",
36
        template_name   => "labels/label-edit-batch.tt",
(-)a/labels/label-edit-layout.pl (-1 / +1 lines)
Lines 28-34 use C4::Output qw(output_html_with_http_headers); Link Here
28
use C4::Creators;
28
use C4::Creators;
29
use C4::Labels;
29
use C4::Labels;
30
30
31
my $cgi = new CGI;
31
my $cgi = CGI->new;
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
    {
33
    {
34
        template_name   => "labels/label-edit-layout.tt",
34
        template_name   => "labels/label-edit-layout.tt",
(-)a/labels/label-edit-profile.pl (-1 / +1 lines)
Lines 27-33 use C4::Output qw(output_html_with_http_headers); Link Here
27
use C4::Creators;
27
use C4::Creators;
28
use C4::Labels;
28
use C4::Labels;
29
29
30
my $cgi = new CGI;
30
my $cgi = CGI->new;
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
    {
32
    {
33
        template_name   => "labels/label-edit-profile.tt",
33
        template_name   => "labels/label-edit-profile.tt",
(-)a/labels/label-edit-range.pl (-1 / +1 lines)
Lines 24-30 use CGI qw ( -utf8 ); Link Here
24
use C4::Auth qw(get_template_and_user);
24
use C4::Auth qw(get_template_and_user);
25
use C4::Output qw(output_html_with_http_headers);
25
use C4::Output qw(output_html_with_http_headers);
26
26
27
my $cgi = new CGI;
27
my $cgi = CGI->new;
28
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
28
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
29
    {
29
    {
30
        template_name   => "labels/label-edit-range.tt",
30
        template_name   => "labels/label-edit-range.tt",
(-)a/labels/label-edit-template.pl (-1 / +1 lines)
Lines 27-33 use C4::Output qw(output_html_with_http_headers); Link Here
27
use C4::Creators;
27
use C4::Creators;
28
use C4::Labels;
28
use C4::Labels;
29
29
30
my $cgi = new CGI;
30
my $cgi = CGI->new;
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
    {
32
    {
33
        template_name   => "labels/label-edit-template.tt",
33
        template_name   => "labels/label-edit-template.tt",
(-)a/labels/label-home.pl (-1 / +1 lines)
Lines 25-31 use CGI qw ( -utf8 ); Link Here
25
use C4::Auth qw(get_template_and_user);
25
use C4::Auth qw(get_template_and_user);
26
use C4::Output qw(output_html_with_http_headers);
26
use C4::Output qw(output_html_with_http_headers);
27
27
28
my $cgi = new CGI;
28
my $cgi = CGI->new;
29
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
29
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
    {
30
    {
31
        template_name   => "labels/label-home.tt",
31
        template_name   => "labels/label-home.tt",
(-)a/labels/label-item-search.pl (-1 / +1 lines)
Lines 45-51 BEGIN { Link Here
45
    }
45
    }
46
}
46
}
47
47
48
my $query = new CGI;
48
my $query = CGI->new;
49
49
50
my $type      = $query->param('type');
50
my $type      = $query->param('type');
51
my $op        = $query->param('op') || '';
51
my $op        = $query->param('op') || '';
(-)a/labels/label-manage.pl (-1 / +1 lines)
Lines 30-36 use C4::Output qw(output_html_with_http_headers); Link Here
30
use C4::Creators;
30
use C4::Creators;
31
use C4::Labels;
31
use C4::Labels;
32
32
33
my $cgi = new CGI;
33
my $cgi = CGI->new;
34
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
34
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
35
    {
35
    {
36
        template_name   => "labels/label-manage.tt",
36
        template_name   => "labels/label-manage.tt",
(-)a/labels/label-print.pl (-1 / +1 lines)
Lines 28-34 use C4::Output qw(output_html_with_http_headers); Link Here
28
use C4::Creators::Lib qw(get_all_templates get_all_layouts get_output_formats);
28
use C4::Creators::Lib qw(get_all_templates get_all_layouts get_output_formats);
29
use C4::Labels::Batch;
29
use C4::Labels::Batch;
30
30
31
my $cgi = new CGI;
31
my $cgi = CGI->new;
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
    {
33
    {
34
        template_name   => "labels/label-print.tt",
34
        template_name   => "labels/label-print.tt",
(-)a/labels/spinelabel-home.pl (-1 / +1 lines)
Lines 23-29 use C4::Context; Link Here
23
23
24
# use Smart::Comments;
24
# use Smart::Comments;
25
25
26
my $query = new CGI;
26
my $query = CGI->new;
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
28
    {   template_name   => "labels/spinelabel-home.tt",
28
    {   template_name   => "labels/spinelabel-home.tt",
29
        query           => $query,
29
        query           => $query,
(-)a/labels/spinelabel-print.pl (-1 / +1 lines)
Lines 21-27 use C4::Auth; Link Here
21
use C4::Output;
21
use C4::Output;
22
22
23
my $scheme = C4::Context->preference('SpineLabelFormat');
23
my $scheme = C4::Context->preference('SpineLabelFormat');
24
my $query  = new CGI;
24
my $query  = CGI->new;
25
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
25
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
26
    {   template_name   => "labels/spinelabel-print.tt",
26
    {   template_name   => "labels/spinelabel-print.tt",
27
        query           => $query,
27
        query           => $query,
(-)a/mainpage.pl (-1 / +1 lines)
Lines 34-40 use Koha::ProblemReports; Link Here
34
use Koha::Quotes;
34
use Koha::Quotes;
35
use Koha::Suggestions;
35
use Koha::Suggestions;
36
36
37
my $query = new CGI;
37
my $query = CGI->new;
38
38
39
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
39
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
40
    {
40
    {
(-)a/members/accountline-details.pl (-1 / +1 lines)
Lines 26-32 use C4::Context; Link Here
26
use Koha::Patrons;
26
use Koha::Patrons;
27
use Koha::Account::Lines;
27
use Koha::Account::Lines;
28
28
29
my $input = new CGI;
29
my $input = CGI->new;
30
30
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
    {
32
    {
(-)a/members/apikeys.pl (-1 / +1 lines)
Lines 28-34 use Koha::ApiKeys; Link Here
28
use Koha::Patrons;
28
use Koha::Patrons;
29
use Koha::Token;
29
use Koha::Token;
30
30
31
my $cgi = new CGI;
31
my $cgi = CGI->new;
32
32
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
34
    {   template_name   => 'members/apikeys.tt',
34
    {   template_name   => 'members/apikeys.tt',
(-)a/members/boraccount.pl (-1 / +1 lines)
Lines 35-41 use Koha::Patrons; Link Here
35
use Koha::Patron::Categories;
35
use Koha::Patron::Categories;
36
use Koha::Items;
36
use Koha::Items;
37
37
38
my $input=new CGI;
38
my $input=CGI->new;
39
39
40
40
41
my ($template, $loggedinuser, $cookie) = get_template_and_user(
41
my ($template, $loggedinuser, $cookie) = get_template_and_user(
(-)a/members/deletemem.pl (-1 / +1 lines)
Lines 33-39 use Koha::Patrons; Link Here
33
use Koha::Token;
33
use Koha::Token;
34
use Koha::Patron::Categories;
34
use Koha::Patron::Categories;
35
35
36
my $input = new CGI;
36
my $input = CGI->new;
37
37
38
my ($template, $loggedinuser, $cookie)
38
my ($template, $loggedinuser, $cookie)
39
                = get_template_and_user({template_name => "members/deletemem.tt",
39
                = get_template_and_user({template_name => "members/deletemem.tt",
(-)a/members/discharge.pl (-1 / +1 lines)
Lines 41-47 use Koha::Patrons; Link Here
41
41
42
use Koha::DateUtils;
42
use Koha::DateUtils;
43
43
44
my $input = new CGI;
44
my $input = CGI->new;
45
45
46
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user({
46
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user({
47
    template_name   => 'members/discharge.tt',
47
    template_name   => 'members/discharge.tt',
(-)a/members/discharges.pl (-1 / +1 lines)
Lines 25-31 use C4::Output; Link Here
25
use C4::Context;
25
use C4::Context;
26
use Koha::Patron::Discharge;
26
use Koha::Patron::Discharge;
27
27
28
my $input = new CGI;
28
my $input = CGI->new;
29
my $op = $input->param('op') // 'list';
29
my $op = $input->param('op') // 'list';
30
30
31
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user({
31
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user({
(-)a/members/guarantor_search.pl (-1 / +1 lines)
Lines 26-32 use C4::Members; Link Here
26
26
27
use Koha::Patron::Categories;
27
use Koha::Patron::Categories;
28
28
29
my $input = new CGI;
29
my $input = CGI->new;
30
30
31
my $dbh = C4::Context->dbh;
31
my $dbh = C4::Context->dbh;
32
32
(-)a/members/ill-requests.pl (-1 / +1 lines)
Lines 24-30 use C4::Auth; Link Here
24
use C4::Output;
24
use C4::Output;
25
use Koha::Patrons;
25
use Koha::Patrons;
26
26
27
my $input = new CGI;
27
my $input = CGI->new;
28
28
29
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
29
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
    {
30
    {
(-)a/members/mancredit.pl (-1 / +1 lines)
Lines 38-44 use Koha::Account::CreditTypes; Link Here
38
38
39
use Koha::Token;
39
use Koha::Token;
40
40
41
my $input = new CGI;
41
my $input = CGI->new;
42
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
42
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
43
    {
43
    {
44
        template_name   => "members/mancredit.tt",
44
        template_name   => "members/mancredit.tt",
(-)a/members/maninvoice.pl (-1 / +1 lines)
Lines 42-48 use Koha::Old::Checkouts; Link Here
42
use Koha::Patron::Categories;
42
use Koha::Patron::Categories;
43
use Koha::Account::DebitTypes;
43
use Koha::Account::DebitTypes;
44
44
45
my $input = new CGI;
45
my $input = CGI->new;
46
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
46
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
47
    {
47
    {
48
        template_name   => "members/maninvoice.tt",
48
        template_name   => "members/maninvoice.tt",
(-)a/members/member-flags.pl (-1 / +1 lines)
Lines 19-25 use Koha::Patrons; Link Here
19
use C4::Output;
19
use C4::Output;
20
use Koha::Token;
20
use Koha::Token;
21
21
22
my $input = new CGI;
22
my $input = CGI->new;
23
23
24
my $flagsrequired = { permissions => 1 };
24
my $flagsrequired = { permissions => 1 };
25
my $member=$input->param('member');
25
my $member=$input->param('member');
(-)a/members/member-password.pl (-1 / +1 lines)
Lines 21-27 use Koha::Patron::Categories; Link Here
21
21
22
use Try::Tiny;
22
use Try::Tiny;
23
23
24
my $input = new CGI;
24
my $input = CGI->new;
25
25
26
my $theme = $input->param('theme') || "default";
26
my $theme = $input->param('theme') || "default";
27
27
(-)a/members/member.pl (-1 / +1 lines)
Lines 31-37 use Koha::DateUtils; Link Here
31
use Koha::List::Patron;
31
use Koha::List::Patron;
32
use Koha::Patrons;
32
use Koha::Patrons;
33
33
34
my $input = new CGI;
34
my $input = CGI->new;
35
35
36
my ($template, $loggedinuser, $cookie)
36
my ($template, $loggedinuser, $cookie)
37
    = get_template_and_user({template_name => "members/member.tt",
37
    = get_template_and_user({template_name => "members/member.tt",
(-)a/members/memberentry.pl (-1 / +1 lines)
Lines 55-61 BEGIN { Link Here
55
	$debug = $ENV{DEBUG} || 0;
55
	$debug = $ENV{DEBUG} || 0;
56
}
56
}
57
	
57
	
58
my $input = new CGI;
58
my $input = CGI->new;
59
($debug) or $debug = $input->param('debug') || 0;
59
($debug) or $debug = $input->param('debug') || 0;
60
my %data;
60
my %data;
61
61
(-)a/members/members-home.pl (-1 / +1 lines)
Lines 28-34 use Koha::Libraries; Link Here
28
use Koha::List::Patron;
28
use Koha::List::Patron;
29
use Koha::Patron::Categories;
29
use Koha::Patron::Categories;
30
30
31
my $query = new CGI;
31
my $query = CGI->new;
32
32
33
my ($template, $loggedinuser, $cookie, $flags)
33
my ($template, $loggedinuser, $cookie, $flags)
34
    = get_template_and_user({template_name => "members/member.tt",
34
    = get_template_and_user({template_name => "members/member.tt",
(-)a/members/members-update-do.pl (-1 / +1 lines)
Lines 25-31 use C4::Context; Link Here
25
use Koha::Patrons;
25
use Koha::Patrons;
26
use Koha::Patron::Modifications;
26
use Koha::Patron::Modifications;
27
27
28
my $query = new CGI;
28
my $query = CGI->new;
29
29
30
# FIXME Should be a checkauth call
30
# FIXME Should be a checkauth call
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
(-)a/members/members-update.pl (-1 / +1 lines)
Lines 31-37 use Koha::Patrons; Link Here
31
31
32
use List::MoreUtils qw( uniq );
32
use List::MoreUtils qw( uniq );
33
33
34
my $query = new CGI;
34
my $query = CGI->new;
35
35
36
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
36
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
37
    {   template_name   => "members/members-update.tt",
37
    {   template_name   => "members/members-update.tt",
(-)a/members/merge-patrons.pl (-1 / +1 lines)
Lines 26-32 use C4::Output; Link Here
26
use C4::Context;
26
use C4::Context;
27
use Koha::Patrons;
27
use Koha::Patrons;
28
28
29
my $cgi = new CGI;
29
my $cgi = CGI->new;
30
30
31
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
31
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
32
    {
32
    {
(-)a/members/mod_debarment.pl (-1 / +1 lines)
Lines 25-31 use C4::Auth; Link Here
25
use Koha::DateUtils;
25
use Koha::DateUtils;
26
use Koha::Patron::Debarments;
26
use Koha::Patron::Debarments;
27
27
28
my $cgi = new CGI;
28
my $cgi = CGI->new;
29
29
30
my ( $loggedinuserid, $cookie, $sessionID ) = checkauth( $cgi, 0, { borrowers => 'edit_borrowers' }, 'intranet' );
30
my ( $loggedinuserid, $cookie, $sessionID ) = checkauth( $cgi, 0, { borrowers => 'edit_borrowers' }, 'intranet' );
31
31
(-)a/members/notices.pl (-1 / +1 lines)
Lines 28-34 use C4::Letters; Link Here
28
use Koha::Patrons;
28
use Koha::Patrons;
29
use Koha::Patron::Categories;
29
use Koha::Patron::Categories;
30
30
31
my $input=new CGI;
31
my $input=CGI->new;
32
32
33
33
34
my $borrowernumber = $input->param('borrowernumber');
34
my $borrowernumber = $input->param('borrowernumber');
(-)a/members/patronimage.pl (-1 / +1 lines)
Lines 31-37 use Koha::Patron::Images; Link Here
31
$|=1;
31
$|=1;
32
32
33
my $DEBUG = 0;
33
my $DEBUG = 0;
34
my $query = new CGI;
34
my $query = CGI->new;
35
my $borrowernumber;
35
my $borrowernumber;
36
36
37
=head1 NAME
37
=head1 NAME
(-)a/members/print_overdues.pl (-1 / +1 lines)
Lines 28-34 use C4::Overdues qw(parse_overdues_letter); Link Here
28
28
29
use Koha::Patrons;
29
use Koha::Patrons;
30
30
31
my $input = new CGI;
31
my $input = CGI->new;
32
32
33
my $flagsrequired = { circulate => "circulate_remaining_permissions" };
33
my $flagsrequired = { circulate => "circulate_remaining_permissions" };
34
34
(-)a/members/printfeercpt.pl (-1 / +1 lines)
Lines 35-41 use Koha::DateUtils; Link Here
35
use Koha::Patrons;
35
use Koha::Patrons;
36
use Koha::Patron::Categories;
36
use Koha::Patron::Categories;
37
37
38
my $input=new CGI;
38
my $input=CGI->new;
39
39
40
40
41
my ($template, $loggedinuser, $cookie)
41
my ($template, $loggedinuser, $cookie)
(-)a/members/printinvoice.pl (-1 / +1 lines)
Lines 33-39 use Koha::Account::Lines; Link Here
33
use Koha::Patrons;
33
use Koha::Patrons;
34
use Koha::Patron::Categories;
34
use Koha::Patron::Categories;
35
35
36
my $input = new CGI;
36
my $input = CGI->new;
37
37
38
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
38
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
39
    {   template_name   => "members/printinvoice.tt",
39
    {   template_name   => "members/printinvoice.tt",
(-)a/members/printslip.pl (-1 / +1 lines)
Lines 49-55 BEGIN { Link Here
49
	$debug = $ENV{DEBUG} || 0;
49
	$debug = $ENV{DEBUG} || 0;
50
}
50
}
51
51
52
my $input = new CGI;
52
my $input = CGI->new;
53
my $sessionID = $input->cookie("CGISESSID");
53
my $sessionID = $input->cookie("CGISESSID");
54
my $session = get_session($sessionID);
54
my $session = get_session($sessionID);
55
55
(-)a/members/purchase-suggestions.pl (-1 / +1 lines)
Lines 27-33 use C4::Members; Link Here
27
use C4::Suggestions;
27
use C4::Suggestions;
28
use Koha::Patrons;
28
use Koha::Patrons;
29
29
30
my $input = new CGI;
30
my $input = CGI->new;
31
31
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
    {   template_name   => "members/purchase-suggestions.tt",
33
    {   template_name   => "members/purchase-suggestions.tt",
(-)a/members/routing-lists.pl (-1 / +1 lines)
Lines 27-33 use C4::Serials; Link Here
27
use Koha::Patrons;
27
use Koha::Patrons;
28
use CGI::Session;
28
use CGI::Session;
29
29
30
my $query = new CGI;
30
my $query = CGI->new;
31
31
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
33
    {
33
    {
(-)a/members/setstatus.pl (-1 / +1 lines)
Lines 32-38 use C4::Auth; Link Here
32
use Koha::Patrons;
32
use Koha::Patrons;
33
33
34
34
35
my $input = new CGI;
35
my $input = CGI->new;
36
36
37
my ( $loggedinuserid ) = checkauth($input, 0, { borrowers => 'edit_borrowers' }, 'intranet');
37
my ( $loggedinuserid ) = checkauth($input, 0, { borrowers => 'edit_borrowers' }, 'intranet');
38
38
(-)a/members/statistics.pl (-1 / +1 lines)
Lines 33-39 use C4::Output; Link Here
33
use Koha::Patrons;
33
use Koha::Patrons;
34
use Koha::Patron::Categories;
34
use Koha::Patron::Categories;
35
35
36
my $input = new CGI;
36
my $input = CGI->new;
37
37
38
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
38
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
39
    {   template_name   => "members/statistics.tt",
39
    {   template_name   => "members/statistics.tt",
(-)a/members/update-child.pl (-1 / +1 lines)
Lines 38-44 use Koha::Patrons; Link Here
38
# use Smart::Comments;
38
# use Smart::Comments;
39
39
40
my $dbh   = C4::Context->dbh;
40
my $dbh   = C4::Context->dbh;
41
my $input = new CGI;
41
my $input = CGI->new;
42
42
43
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
43
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
44
    {
44
    {
(-)a/misc/batchImportMARCWithBiblionumbers.pl (-1 / +1 lines)
Lines 78-84 sub search { Link Here
78
		return("error",undef);
78
		return("error",undef);
79
	}
79
	}
80
	my $oAResult;
80
	my $oAResult;
81
	my $Anewq= new ZOOM::Query::PQF($nquery);
81
	my $Anewq= ZOOM::Query::PQF->new($nquery);
82
	eval {
82
	eval {
83
	$oAResult= $oAuth->search_pqf($nquery) ; 
83
	$oAResult= $oAuth->search_pqf($nquery) ; 
84
	};
84
	};
(-)a/misc/cronjobs/check-url.pl (-2 / +2 lines)
Lines 88-94 sub new { Link Here
88
    my $self = {};
88
    my $self = {};
89
    my ($class, $timeout, $agent) = @_;
89
    my ($class, $timeout, $agent) = @_;
90
    
90
    
91
    my $uagent = new LWP::UserAgent;
91
    my $uagent = LWP::UserAgent->new;
92
    $uagent->agent( $agent ) if $agent;
92
    $uagent->agent( $agent ) if $agent;
93
    $uagent->timeout( $timeout) if $timeout;
93
    $uagent->timeout( $timeout) if $timeout;
94
    $self->{ user_agent } = $uagent;
94
    $self->{ user_agent } = $uagent;
Lines 192-198 sub check_all_url { Link Here
192
    my $checker = C4::URL::Checker->new($timeout,$agent);
192
    my $checker = C4::URL::Checker->new($timeout,$agent);
193
    $checker->{ host_default }  = $host;
193
    $checker->{ host_default }  = $host;
194
    
194
    
195
    my $context = new C4::Context(  );  
195
    my $context = C4::Context->new(  );
196
    my $dbh = $context->dbh;
196
    my $dbh = $context->dbh;
197
    my $sth = $dbh->prepare( 
197
    my $sth = $dbh->prepare( 
198
        "SELECT biblionumber FROM biblioitems WHERE url <> ''" );
198
        "SELECT biblionumber FROM biblioitems WHERE url <> ''" );
(-)a/misc/cronjobs/cloud-kw.pl (-1 / +1 lines)
Lines 78-84 for my $cloud ( @clouds ) { Link Here
78
        }
78
        }
79
    }
79
    }
80
80
81
    my $index = new ZebraIndex( $cloud->{ZebraIndex} );
81
    my $index = ZebraIndex->new( $cloud->{ZebraIndex} );
82
    $index->scan( $cloud->{Count} );
82
    $index->scan( $cloud->{Count} );
83
83
84
    open my $fh, ">", $cloud->{Output}
84
    open my $fh, ">", $cloud->{Output}
(-)a/misc/cronjobs/gather_print_notices.pl (-1 / +1 lines)
Lines 209-215 sub generate_html { Link Here
209
209
210
    my $template =
210
    my $template =
211
      C4::Templates::gettemplate( 'batch/print-notices.tt', 'intranet',
211
      C4::Templates::gettemplate( 'batch/print-notices.tt', 'intranet',
212
        new CGI );
212
        CGI->new );
213
213
214
    $template->param(
214
    $template->param(
215
        stylesheet => C4::Context->preference("NoticeCSS"),
215
        stylesheet => C4::Context->preference("NoticeCSS"),
(-)a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl (-4 / +4 lines)
Lines 144-156 sub updateMarc { Link Here
144
    unless ($c_marc_field) {
144
    unless ($c_marc_field) {
145
        if ( defined $c_subfield ) {
145
        if ( defined $c_subfield ) {
146
            $biblio->add_fields(
146
            $biblio->add_fields(
147
                new MARC::Field(
147
                MARC::Field->new(
148
                    $c_field, ' ', ' ', $c_subfield => $c_db_value
148
                    $c_field, ' ', ' ', $c_subfield => $c_db_value
149
                )
149
                )
150
            );
150
            );
151
        }
151
        }
152
        else {
152
        else {
153
            $biblio->add_fields( new MARC::Field( $c_field, $c_db_value ) );
153
            $biblio->add_fields( MARC::Field->new( $c_field, $c_db_value ) );
154
        }
154
        }
155
        $debug and warn "[WARN] $c_field did not exist.";
155
        $debug and warn "[WARN] $c_field did not exist.";
156
        $c_marc_field = $biblio->field($c_field);
156
        $c_marc_field = $biblio->field($c_field);
Lines 173-185 sub updateMarc { Link Here
173
    unless ($m_marc_field) {
173
    unless ($m_marc_field) {
174
        if ( defined $m_subfield ) {
174
        if ( defined $m_subfield ) {
175
            $biblio->add_fields(
175
            $biblio->add_fields(
176
                new MARC::Field(
176
                MARC::Field->new(
177
                    $m_field, ' ', ' ', $m_subfield => $m_db_value
177
                    $m_field, ' ', ' ', $m_subfield => $m_db_value
178
                )
178
                )
179
            );
179
            );
180
        }
180
        }
181
        else {
181
        else {
182
            $biblio->add_fields( new MARC::Field( $m_field, $m_db_value ) );
182
            $biblio->add_fields( MARC::Field->new( $m_field, $m_db_value ) );
183
        }
183
        }
184
184
185
        $debug and warn "[WARN] $m_field did not exist.";
185
        $debug and warn "[WARN] $m_field did not exist.";
(-)a/misc/migration_tools/ifla/update.pl (-7 / +7 lines)
Lines 84-90 my @subfields = @{ $biblio->{subfields} }; Link Here
84
84
85
my $translations = {};
85
my $translations = {};
86
if ($dump_pot) {
86
if ($dump_pot) {
87
    $translations->{''} = new Locale::PO(
87
    $translations->{''} = Locale::PO->new(
88
        -msgid => '',
88
        -msgid => '',
89
        -msgstr => "Project-Id-Version: Koha\n" .
89
        -msgstr => "Project-Id-Version: Koha\n" .
90
            "POT-Creation-Date: " . time2str('%Y-%m-%d %R%z', time) . "\n" .
90
            "POT-Creation-Date: " . time2str('%Y-%m-%d %R%z', time) . "\n" .
Lines 94-131 if ($dump_pot) { Link Here
94
    );
94
    );
95
    while (my ($category, $values) = each %$authorised_values) {
95
    while (my ($category, $values) = each %$authorised_values) {
96
        foreach my $authorised_value (@$values) {
96
        foreach my $authorised_value (@$values) {
97
            $translations->{$authorised_value->{lib}} = new Locale::PO(
97
            $translations->{$authorised_value->{lib}} = Locale::PO->new(
98
                -msgid => $authorised_value->{lib},
98
                -msgid => $authorised_value->{lib},
99
                -msgstr => '',
99
                -msgstr => '',
100
            );
100
            );
101
        }
101
        }
102
    }
102
    }
103
    for my $tag (@tags) {
103
    for my $tag (@tags) {
104
        $translations->{$tag->{liblibrarian}} = new Locale::PO(
104
        $translations->{$tag->{liblibrarian}} = Locale::PO->new(
105
            -msgid => $tag->{liblibrarian},
105
            -msgid => $tag->{liblibrarian},
106
            -msgstr => '',
106
            -msgstr => '',
107
        );
107
        );
108
    }
108
    }
109
    for my $subfield (@subfields) {
109
    for my $subfield (@subfields) {
110
        $translations->{$subfield->{liblibrarian}} = new Locale::PO(
110
        $translations->{$subfield->{liblibrarian}} = Locale::PO->new(
111
            -msgid => $subfield->{liblibrarian},
111
            -msgid => $subfield->{liblibrarian},
112
            -msgstr => '',
112
            -msgstr => '',
113
        );
113
        );
114
    }
114
    }
115
    for my $authtype (@$authtypes) {
115
    for my $authtype (@$authtypes) {
116
        $translations->{$authtype->{authtypetext}} = new Locale::PO(
116
        $translations->{$authtype->{authtypetext}} = Locale::PO->new(
117
            -msgid => $authtype->{authtypetext},
117
            -msgid => $authtype->{authtypetext},
118
            -msgstr => '',
118
            -msgstr => '',
119
        );
119
        );
120
    }
120
    }
121
    for my $authtag (@authtags) {
121
    for my $authtag (@authtags) {
122
        $translations->{$authtag->{liblibrarian}} = new Locale::PO(
122
        $translations->{$authtag->{liblibrarian}} = Locale::PO->new(
123
            -msgid => $authtag->{liblibrarian},
123
            -msgid => $authtag->{liblibrarian},
124
            -msgstr => '',
124
            -msgstr => '',
125
        );
125
        );
126
    }
126
    }
127
    for my $authsubfield (@authsubfields) {
127
    for my $authsubfield (@authsubfields) {
128
        $translations->{$authsubfield->{liblibrarian}} = new Locale::PO(
128
        $translations->{$authsubfield->{liblibrarian}} = Locale::PO->new(
129
            -msgid => $authsubfield->{liblibrarian},
129
            -msgid => $authsubfield->{liblibrarian},
130
            -msgstr => '',
130
            -msgstr => '',
131
        );;
131
        );;
(-)a/misc/translator/LangInstaller.pm (-4 / +4 lines)
Lines 476-482 sub get_po_from_target { Link Here
476
    my $target = shift;
476
    my $target = shift;
477
477
478
    my $po;
478
    my $po;
479
    my $po_head = new Locale::PO;
479
    my $po_head = Locale::PO->new;
480
    $po_head->{msgid}  = "\"\"";
480
    $po_head->{msgid}  = "\"\"";
481
    $po_head->{msgstr} = "".
481
    $po_head->{msgstr} = "".
482
        "Project-Id-Version: Koha Project - Installation files\\n" .
482
        "Project-Id-Version: Koha Project - Installation files\\n" .
Lines 516-522 sub get_po_from_target { Link Here
516
                                $line =~ s/(<<.*?>>|\[\%.*?\%\]|<.*?>)/\%s/g;                                   # put placeholders
516
                                $line =~ s/(<<.*?>>|\[\%.*?\%\]|<.*?>)/\%s/g;                                   # put placeholders
517
                                next if ( $line =~ /^(\s|%s|-|[[:punct:]]|\(|\))*$/ or length($line) < 2 );     # discard non strings
517
                                next if ( $line =~ /^(\s|%s|-|[[:punct:]]|\(|\))*$/ or length($line) < 2 );     # discard non strings
518
                                if ( not $po->{ $line } ) {
518
                                if ( not $po->{ $line } ) {
519
                                    my $msg = new Locale::PO(
519
                                    my $msg = Locale::PO->new(
520
                                                -msgid => $line, -msgstr => '',
520
                                                -msgid => $line, -msgstr => '',
521
                                                -reference => "$dir/$file:$table_name:$tablec:row:$rowc:mul:$mulc" );
521
                                                -reference => "$dir/$file:$table_name:$tablec:row:$rowc:mul:$mulc" );
522
                                    $po->{ $line } = $msg;
522
                                    $po->{ $line } = $msg;
Lines 525-531 sub get_po_from_target { Link Here
525
                        } else {
525
                        } else {
526
                            if ( defined $row->{$field} and length($row->{$field}) > 1                         # discard null values and small strings
526
                            if ( defined $row->{$field} and length($row->{$field}) > 1                         # discard null values and small strings
527
                                 and not $po->{ $row->{$field} } ) {
527
                                 and not $po->{ $row->{$field} } ) {
528
                                my $msg = new Locale::PO(
528
                                my $msg = Locale::PO->new(
529
                                            -msgid => $row->{$field}, -msgstr => '',
529
                                            -msgid => $row->{$field}, -msgstr => '',
530
                                            -reference => "$dir/$file:$table_name:$tablec:row:$rowc" );
530
                                            -reference => "$dir/$file:$table_name:$tablec:row:$rowc" );
531
                                $po->{ $row->{$field} } = $msg;
531
                                $po->{ $row->{$field} } = $msg;
Lines 538-544 sub get_po_from_target { Link Here
538
            for my $description ( @{ $yaml->{'description'} } ) {
538
            for my $description ( @{ $yaml->{'description'} } ) {
539
                $desccount++;
539
                $desccount++;
540
                if ( length($description) > 1 and not $po->{ $description } ) {
540
                if ( length($description) > 1 and not $po->{ $description } ) {
541
                    my $msg = new Locale::PO(
541
                    my $msg = Locale::PO->new(
542
                                -msgid => $description, -msgstr => '',
542
                                -msgid => $description, -msgstr => '',
543
                                -reference => "$dir/$file:description:$desccount" );
543
                                -reference => "$dir/$file:description:$desccount" );
544
                    $po->{ $description } = $msg;
544
                    $po->{ $description } = $msg;
(-)a/misc/translator/po2json (-1 / +1 lines)
Lines 165-171 sub main Link Here
165
    }
165
    }
166
166
167
167
168
    my $jsonobj = new JSON;
168
    my $jsonobj = JSON->new;
169
    my $basename = basename($src);
169
    my $basename = basename($src);
170
    $basename =~ s/\.pot?$//;
170
    $basename =~ s/\.pot?$//;
171
    if ($pretty)
171
    if ($pretty)
(-)a/offline_circ/download.pl (-1 / +1 lines)
Lines 25-31 use C4::Output; Link Here
25
use C4::Context;
25
use C4::Context;
26
use C4::Koha;
26
use C4::Koha;
27
27
28
my $query = new CGI;
28
my $query = CGI->new;
29
checkauth( $query, undef, { circulate => "circulate_remaining_permissions" },
29
checkauth( $query, undef, { circulate => "circulate_remaining_permissions" },
30
    "intranet" );
30
    "intranet" );
31
31
(-)a/opac/clubs/clubs-tab.pl (-1 / +1 lines)
Lines 25-31 use C4::Auth; Link Here
25
use C4::Output;
25
use C4::Output;
26
use Koha::Patrons;
26
use Koha::Patrons;
27
27
28
my $cgi = new CGI;
28
my $cgi = CGI->new;
29
29
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {
31
    {
(-)a/opac/clubs/enroll.pl (-1 / +1 lines)
Lines 25-31 use C4::Auth; Link Here
25
use C4::Output;
25
use C4::Output;
26
use Koha::Clubs;
26
use Koha::Clubs;
27
27
28
my $cgi = new CGI;
28
my $cgi = CGI->new;
29
29
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {
31
    {
(-)a/opac/errors/400.pl (-1 / +1 lines)
Lines 22-28 use C4::Auth; Link Here
22
use C4::Output;
22
use C4::Output;
23
use C4::Context;
23
use C4::Context;
24
24
25
my $query = new CGI;
25
my $query = CGI->new;
26
my $admin = C4::Context->preference('KohaAdminEmailAddress');
26
my $admin = C4::Context->preference('KohaAdminEmailAddress');
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
28
    {
28
    {
(-)a/opac/errors/401.pl (-1 / +1 lines)
Lines 22-28 use C4::Auth; Link Here
22
use C4::Output;
22
use C4::Output;
23
use C4::Context;
23
use C4::Context;
24
24
25
my $query = new CGI;
25
my $query = CGI->new;
26
my $admin = C4::Context->preference('KohaAdminEmailAddress');
26
my $admin = C4::Context->preference('KohaAdminEmailAddress');
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
28
    {
28
    {
(-)a/opac/errors/402.pl (-1 / +1 lines)
Lines 22-28 use C4::Auth; Link Here
22
use C4::Output;
22
use C4::Output;
23
use C4::Context;
23
use C4::Context;
24
24
25
my $query = new CGI;
25
my $query = CGI->new;
26
my $admin = C4::Context->preference('KohaAdminEmailAddress');
26
my $admin = C4::Context->preference('KohaAdminEmailAddress');
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
28
    {
28
    {
(-)a/opac/errors/403.pl (-1 / +1 lines)
Lines 22-28 use C4::Auth; Link Here
22
use C4::Output;
22
use C4::Output;
23
use C4::Context;
23
use C4::Context;
24
24
25
my $query = new CGI;
25
my $query = CGI->new;
26
my $admin = C4::Context->preference('KohaAdminEmailAddress');
26
my $admin = C4::Context->preference('KohaAdminEmailAddress');
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
28
    {
28
    {
(-)a/opac/errors/404.pl (-1 / +1 lines)
Lines 22-28 use C4::Auth; Link Here
22
use C4::Output;
22
use C4::Output;
23
use C4::Context;
23
use C4::Context;
24
24
25
my $query = new CGI;
25
my $query = CGI->new;
26
my $admin = C4::Context->preference('KohaAdminEmailAddress');
26
my $admin = C4::Context->preference('KohaAdminEmailAddress');
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
28
    {
28
    {
(-)a/opac/errors/500.pl (-1 / +1 lines)
Lines 22-28 use C4::Auth; Link Here
22
use C4::Output;
22
use C4::Output;
23
use C4::Context;
23
use C4::Context;
24
24
25
my $query = new CGI;
25
my $query = CGI->new;
26
my $admin = C4::Context->preference('KohaAdminEmailAddress');
26
my $admin = C4::Context->preference('KohaAdminEmailAddress');
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
28
    {
28
    {
(-)a/opac/external/overdrive/auth.pl (-1 / +1 lines)
Lines 27-33 use Koha::Logger; Link Here
27
use Koha::ExternalContent::OverDrive;
27
use Koha::ExternalContent::OverDrive;
28
28
29
my $logger = Koha::Logger->get({ interface => 'opac' });
29
my $logger = Koha::Logger->get({ interface => 'opac' });
30
my $cgi = new CGI;
30
my $cgi = CGI->new;
31
31
32
my ( $user, $cookie, $sessionID, $flags ) = checkauth( $cgi, 1, {}, 'opac' );
32
my ( $user, $cookie, $sessionID, $flags ) = checkauth( $cgi, 1, {}, 'opac' );
33
my ($redirect_page, $error);
33
my ($redirect_page, $error);
(-)a/opac/ilsdi.pl (-1 / +1 lines)
Lines 39-45 outputs the returned hashref as XML. Link Here
39
=cut
39
=cut
40
40
41
# Instanciate the CGI request
41
# Instanciate the CGI request
42
my $cgi = new CGI;
42
my $cgi = CGI->new;
43
43
44
# List of available services, sorted by level
44
# List of available services, sorted by level
45
my @services = (
45
my @services = (
(-)a/opac/maintenance.pl (-1 / +1 lines)
Lines 24-30 use C4::Templates qw/gettemplate/; Link Here
24
24
25
use Koha;
25
use Koha;
26
26
27
my $query = new CGI;
27
my $query = CGI->new;
28
my $template = C4::Templates::gettemplate( 'maintenance.tt', 'opac', $query );
28
my $template = C4::Templates::gettemplate( 'maintenance.tt', 'opac', $query );
29
29
30
my $koha_db_version = C4::Context->preference('Version');
30
my $koha_db_version = C4::Context->preference('Version');
(-)a/opac/opac-account-pay-paypal-return.pl (-1 / +1 lines)
Lines 32-38 use Koha::Acquisition::Currencies; Link Here
32
use Koha::Database;
32
use Koha::Database;
33
use Koha::Patrons;
33
use Koha::Patrons;
34
34
35
my $cgi = new CGI;
35
my $cgi = CGI->new;
36
36
37
unless ( C4::Context->preference('EnablePayPalOpacPayments') ) {
37
unless ( C4::Context->preference('EnablePayPalOpacPayments') ) {
38
    print $cgi->redirect("/cgi-bin/koha/errors/404.pl");
38
    print $cgi->redirect("/cgi-bin/koha/errors/404.pl");
(-)a/opac/opac-account-pay-return.pl (-1 / +1 lines)
Lines 24-30 use CGI; Link Here
24
use C4::Auth;
24
use C4::Auth;
25
use Koha::Plugins::Handler;
25
use Koha::Plugins::Handler;
26
26
27
my $cgi = new CGI;
27
my $cgi = CGI->new;
28
28
29
my ( $userid, $cookie, $sessionID, $flags ) = checkauth( $cgi, 0, {}, 'opac' );
29
my ( $userid, $cookie, $sessionID, $flags ) = checkauth( $cgi, 0, {}, 'opac' );
30
30
(-)a/opac/opac-account-pay.pl (-1 / +1 lines)
Lines 33-39 use Koha::Acquisition::Currencies; Link Here
33
use Koha::Database;
33
use Koha::Database;
34
use Koha::Plugins::Handler;
34
use Koha::Plugins::Handler;
35
35
36
my $cgi = new CGI;
36
my $cgi = CGI->new;
37
my $payment_method = $cgi->param('payment_method');
37
my $payment_method = $cgi->param('payment_method');
38
my @accountlines   = $cgi->multi_param('accountline');
38
my @accountlines   = $cgi->multi_param('accountline');
39
39
(-)a/opac/opac-account.pl (-1 / +1 lines)
Lines 28-34 use Koha::Account::Lines; Link Here
28
use Koha::Patrons;
28
use Koha::Patrons;
29
use Koha::Plugins;
29
use Koha::Plugins;
30
30
31
my $query = new CGI;
31
my $query = CGI->new;
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
33
    {
33
    {
34
        template_name   => "opac-account.tt",
34
        template_name   => "opac-account.tt",
(-)a/opac/opac-addbybiblionumber.pl (-1 / +1 lines)
Lines 28-34 use C4::Auth; Link Here
28
use Koha::Biblios;
28
use Koha::Biblios;
29
use Koha::Virtualshelves;
29
use Koha::Virtualshelves;
30
30
31
my $query           = new CGI;
31
my $query           = CGI->new;
32
my @biblionumbers   = $query->multi_param('biblionumber');
32
my @biblionumbers   = $query->multi_param('biblionumber');
33
my $selectedshelf   = $query->param('selectedshelf');
33
my $selectedshelf   = $query->param('selectedshelf');
34
my $newshelf        = $query->param('newshelf');
34
my $newshelf        = $query->param('newshelf');
(-)a/opac/opac-alert-subscribe.pl (-1 / +1 lines)
Lines 28-34 use C4::Letters; Link Here
28
use C4::Serials;
28
use C4::Serials;
29
29
30
30
31
my $query = new CGI;
31
my $query = CGI->new;
32
my $op    = $query->param('op') || '';
32
my $op    = $query->param('op') || '';
33
my $dbh   = C4::Context->dbh;
33
my $dbh   = C4::Context->dbh;
34
34
(-)a/opac/opac-article-request-cancel.pl (-1 / +1 lines)
Lines 25-31 use C4::Output; Link Here
25
use C4::Auth;
25
use C4::Auth;
26
use Koha::ArticleRequests;
26
use Koha::ArticleRequests;
27
27
28
my $query = new CGI;
28
my $query = CGI->new;
29
29
30
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
30
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
31
    {
31
    {
(-)a/opac/opac-authorities-home.pl (-1 / +1 lines)
Lines 35-41 use Koha::Authority::Types; Link Here
35
use Koha::SearchEngine::Search;
35
use Koha::SearchEngine::Search;
36
use Koha::SearchEngine::QueryBuilder;
36
use Koha::SearchEngine::QueryBuilder;
37
37
38
my $query        = new CGI;
38
my $query        = CGI->new;
39
my $op           = $query->param('op') || '';
39
my $op           = $query->param('op') || '';
40
my $authtypecode = $query->param('authtypecode') || '';
40
my $authtypecode = $query->param('authtypecode') || '';
41
my $dbh          = C4::Context->dbh;
41
my $dbh          = C4::Context->dbh;
(-)a/opac/opac-authoritiesdetail.pl (-1 / +1 lines)
Lines 50-56 use C4::Koha; Link Here
50
use Koha::Authorities;
50
use Koha::Authorities;
51
use Koha::Authority::Types;
51
use Koha::Authority::Types;
52
52
53
my $query = new CGI;
53
my $query = CGI->new;
54
54
55
my $dbh = C4::Context->dbh;
55
my $dbh = C4::Context->dbh;
56
56
(-)a/opac/opac-basket.pl (-1 / +1 lines)
Lines 29-35 use Koha::RecordProcessor; Link Here
29
use Koha::CsvProfiles;
29
use Koha::CsvProfiles;
30
use Koha::AuthorisedValues;
30
use Koha::AuthorisedValues;
31
31
32
my $query = new CGI;
32
my $query = CGI->new;
33
33
34
my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
34
my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
35
    {
35
    {
(-)a/opac/opac-blocked.pl (-1 / +1 lines)
Lines 23-29 use C4::Auth; Link Here
23
use C4::Output;
23
use C4::Output;
24
use C4::Context;
24
use C4::Context;
25
25
26
my $query = new CGI;
26
my $query = CGI->new;
27
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
27
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
28
    {
28
    {
29
        template_name   => "opac-blocked.tt",
29
        template_name   => "opac-blocked.tt",
(-)a/opac/opac-browse.pl (-1 / +1 lines)
Lines 34-40 use Koha::SearchEngine::Elasticsearch::Search; Link Here
34
use JSON;
34
use JSON;
35
use Unicode::Collate;
35
use Unicode::Collate;
36
36
37
my $query = new CGI;
37
my $query = CGI->new;
38
binmode STDOUT, ':encoding(UTF-8)';
38
binmode STDOUT, ':encoding(UTF-8)';
39
39
40
# If calling via JS, 'api' is used to route to correct step in process
40
# If calling via JS, 'api' is used to route to correct step in process
(-)a/opac/opac-browser.pl (-1 / +1 lines)
Lines 32-38 use C4::Output; Link Here
32
use CGI qw ( -utf8 );
32
use CGI qw ( -utf8 );
33
use C4::Biblio;
33
use C4::Biblio;
34
34
35
my $query = new CGI;
35
my $query = CGI->new;
36
36
37
my $dbh = C4::Context->dbh;
37
my $dbh = C4::Context->dbh;
38
38
(-)a/opac/opac-changelanguage.pl (-1 / +1 lines)
Lines 20-26 use CGI qw ( -utf8 ); Link Here
20
use C4::Templates;
20
use C4::Templates;
21
use Koha::Util::Navigation;
21
use Koha::Util::Navigation;
22
22
23
my $query = new CGI;
23
my $query = CGI->new;
24
my $language = $query->param('language');
24
my $language = $query->param('language');
25
my $url = Koha::Util::Navigation::local_referer($query, { remove_language => 1 });
25
my $url = Koha::Util::Navigation::local_referer($query, { remove_language => 1 });
26
26
(-)a/opac/opac-course-details.pl (-1 / +1 lines)
Lines 28-34 use C4::Koha; Link Here
28
28
29
use C4::CourseReserves qw(GetCourse GetCourseReserves);
29
use C4::CourseReserves qw(GetCourse GetCourseReserves);
30
30
31
my $cgi = new CGI;
31
my $cgi = CGI->new;
32
32
33
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
33
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
34
    {   template_name   => "opac-course-details.tt",
34
    {   template_name   => "opac-course-details.tt",
(-)a/opac/opac-course-reserves.pl (-1 / +1 lines)
Lines 27-33 use C4::Output; Link Here
27
27
28
use C4::CourseReserves qw(SearchCourses);
28
use C4::CourseReserves qw(SearchCourses);
29
29
30
my $cgi = new CGI;
30
my $cgi = CGI->new;
31
31
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
33
    {   template_name   => "opac-course-reserves.tt",
33
    {   template_name   => "opac-course-reserves.tt",
(-)a/opac/opac-discharge.pl (-1 / +1 lines)
Lines 30-36 use Koha::Patrons; Link Here
30
use Koha::Patron::Discharge;
30
use Koha::Patron::Discharge;
31
use Koha::DateUtils;
31
use Koha::DateUtils;
32
32
33
my $input = new CGI;
33
my $input = CGI->new;
34
34
35
unless ( C4::Context->preference('useDischarge') ) {
35
unless ( C4::Context->preference('useDischarge') ) {
36
    print $input->redirect("/cgi-bin/koha/errors/404.pl");
36
    print $input->redirect("/cgi-bin/koha/errors/404.pl");
(-)a/opac/opac-downloadshelf.pl (-1 / +1 lines)
Lines 33-39 use Koha::RecordProcessor; Link Here
33
use Koha::Virtualshelves;
33
use Koha::Virtualshelves;
34
34
35
use utf8;
35
use utf8;
36
my $query = new CGI;
36
my $query = CGI->new;
37
37
38
# if virtualshelves is disabled, leave immediately
38
# if virtualshelves is disabled, leave immediately
39
if ( ! C4::Context->preference('virtualshelves') ) {
39
if ( ! C4::Context->preference('virtualshelves') ) {
(-)a/opac/opac-ics.pl (-1 / +1 lines)
Lines 35-41 use C4::Circulation; Link Here
35
use C4::Members;
35
use C4::Members;
36
use Koha::DateUtils;
36
use Koha::DateUtils;
37
37
38
my $query = new CGI;
38
my $query = CGI->new;
39
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
39
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
40
    {
40
    {
41
        template_name   => "opac-ics.tt",
41
        template_name   => "opac-ics.tt",
(-)a/opac/opac-idref.pl (-1 / +1 lines)
Lines 30-36 use C4::Context; Link Here
30
use C4::Search;
30
use C4::Search;
31
use C4::Output;
31
use C4::Output;
32
32
33
my $cgi = new CGI;
33
my $cgi = CGI->new;
34
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
34
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
35
    {
35
    {
36
        template_name   => "opac-idref.tt",
36
        template_name   => "opac-idref.tt",
(-)a/opac/opac-illrequests.pl (-1 / +1 lines)
Lines 32-38 use Koha::Libraries; Link Here
32
use Koha::Patrons;
32
use Koha::Patrons;
33
use Koha::Illrequest::Availability;
33
use Koha::Illrequest::Availability;
34
34
35
my $query = new CGI;
35
my $query = CGI->new;
36
36
37
# Grab all passed data
37
# Grab all passed data
38
# 'our' since Plack changes the scoping
38
# 'our' since Plack changes the scoping
(-)a/opac/opac-image.pl (-1 / +1 lines)
Lines 32-38 use C4::Images; Link Here
32
$| = 1;
32
$| = 1;
33
33
34
my $DEBUG = 0;
34
my $DEBUG = 0;
35
my $data  = new CGI;
35
my $data  = CGI->new;
36
my $imagenumber;
36
my $imagenumber;
37
37
38
=head1 NAME
38
=head1 NAME
(-)a/opac/opac-imageviewer.pl (-1 / +1 lines)
Lines 27-33 use C4::Images; Link Here
27
27
28
use Koha::Biblios;
28
use Koha::Biblios;
29
29
30
my $query = new CGI;
30
my $query = CGI->new;
31
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
31
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
32
    {
32
    {
33
        template_name   => "opac-imageviewer.tt",
33
        template_name   => "opac-imageviewer.tt",
(-)a/opac/opac-issue-note.pl (-1 / +1 lines)
Lines 31-37 use Koha::Checkouts; Link Here
31
use Koha::DateUtils;
31
use Koha::DateUtils;
32
use Koha::Patrons;
32
use Koha::Patrons;
33
33
34
my $query = new CGI;
34
my $query = CGI->new;
35
35
36
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
36
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
37
    {
37
    {
(-)a/opac/opac-main.pl (-1 / +1 lines)
Lines 31-37 use Koha::Checkouts; Link Here
31
use Koha::Holds;
31
use Koha::Holds;
32
use Koha::News;
32
use Koha::News;
33
33
34
my $input = new CGI;
34
my $input = CGI->new;
35
my $dbh   = C4::Context->dbh;
35
my $dbh   = C4::Context->dbh;
36
36
37
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
37
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
(-)a/opac/opac-memberentry.pl (-1 / +1 lines)
Lines 45-51 use Koha::Patron::Modifications; Link Here
45
use Koha::Patron::Categories;
45
use Koha::Patron::Categories;
46
use Koha::Token;
46
use Koha::Token;
47
47
48
my $cgi = new CGI;
48
my $cgi = CGI->new;
49
my $dbh = C4::Context->dbh;
49
my $dbh = C4::Context->dbh;
50
50
51
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
51
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
(-)a/opac/opac-modrequest-suspend.pl (-1 / +1 lines)
Lines 21-27 use CGI qw ( -utf8 ); Link Here
21
use C4::Output;
21
use C4::Output;
22
use C4::Reserves;
22
use C4::Reserves;
23
use C4::Auth;
23
use C4::Auth;
24
my $query = new CGI;
24
my $query = CGI->new;
25
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
25
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
26
    {
26
    {
27
        template_name   => "opac-account.tt",
27
        template_name   => "opac-account.tt",
(-)a/opac/opac-modrequest.pl (-1 / +1 lines)
Lines 29-35 use C4::Output; Link Here
29
use C4::Reserves;
29
use C4::Reserves;
30
use C4::Auth;
30
use C4::Auth;
31
use Koha::Holds;
31
use Koha::Holds;
32
my $query = new CGI;
32
my $query = CGI->new;
33
33
34
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
34
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
35
    {   
35
    {   
(-)a/opac/opac-news-rss.pl (-1 / +1 lines)
Lines 25-31 use C4::Output; Link Here
25
use C4::NewsChannels;    # GetNewsToDisplay
25
use C4::NewsChannels;    # GetNewsToDisplay
26
use C4::Languages qw(getTranslatedLanguages accept_language);
26
use C4::Languages qw(getTranslatedLanguages accept_language);
27
27
28
my $input = new CGI;
28
my $input = CGI->new;
29
my $dbh   = C4::Context->dbh;
29
my $dbh   = C4::Context->dbh;
30
30
31
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
31
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
(-)a/opac/opac-overdrive-search.pl (-1 / +1 lines)
Lines 24-30 use CGI qw ( -utf8 ); Link Here
24
use C4::Auth qw(:DEFAULT get_session);
24
use C4::Auth qw(:DEFAULT get_session);
25
use C4::Output;
25
use C4::Output;
26
26
27
my $cgi = new CGI;
27
my $cgi = CGI->new;
28
28
29
# Getting the template and auth
29
# Getting the template and auth
30
my ($template, $loggedinuser, $cookie)
30
my ($template, $loggedinuser, $cookie)
(-)a/opac/opac-passwd.pl (-1 / +1 lines)
Lines 31-37 use Koha::Patrons; Link Here
31
31
32
use Try::Tiny;
32
use Try::Tiny;
33
33
34
my $query = new CGI;
34
my $query = CGI->new;
35
35
36
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
36
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
37
    {
37
    {
(-)a/opac/opac-password-recovery.pl (-1 / +1 lines)
Lines 11-17 use Koha::Patron::Password::Recovery Link Here
11
  qw(SendPasswordRecoveryEmail ValidateBorrowernumber GetValidLinkInfo CompletePasswordRecovery DeleteExpiredPasswordRecovery);
11
  qw(SendPasswordRecoveryEmail ValidateBorrowernumber GetValidLinkInfo CompletePasswordRecovery DeleteExpiredPasswordRecovery);
12
use Koha::Patrons;
12
use Koha::Patrons;
13
use Koha::Patrons;
13
use Koha::Patrons;
14
my $query = new CGI;
14
my $query = CGI->new;
15
use HTML::Entities;
15
use HTML::Entities;
16
use Try::Tiny;
16
use Try::Tiny;
17
use List::Util qw/any/;
17
use List::Util qw/any/;
(-)a/opac/opac-patron-consent.pl (-1 / +1 lines)
Lines 28-34 use Koha::Patrons; Link Here
28
28
29
use constant GDPR_PROCESSING => 'GDPR_PROCESSING';
29
use constant GDPR_PROCESSING => 'GDPR_PROCESSING';
30
30
31
my $query = new CGI;
31
my $query = CGI->new;
32
my $op = $query->param('op') // q{};
32
my $op = $query->param('op') // q{};
33
my $gdpr_check = $query->param('gdpr_processing') // q{};
33
my $gdpr_check = $query->param('gdpr_processing') // q{};
34
34
(-)a/opac/opac-patron-image.pl (-1 / +1 lines)
Lines 25-31 use CGI::Cookie; # need to check cookies before having CGI parse the POST reque Link Here
25
use C4::Auth qw(:DEFAULT check_cookie_auth);
25
use C4::Auth qw(:DEFAULT check_cookie_auth);
26
use Koha::Patron::Images;
26
use Koha::Patron::Images;
27
27
28
my $query = new CGI;
28
my $query = CGI->new;
29
29
30
unless (C4::Context->preference('OPACpatronimages')) {
30
unless (C4::Context->preference('OPACpatronimages')) {
31
    print $query->header(status => '403 Forbidden - displaying patron images in the OPAC not enabled');
31
    print $query->header(status => '403 Forbidden - displaying patron images in the OPAC not enabled');
(-)a/opac/opac-privacy.pl (-1 / +1 lines)
Lines 24-30 use C4::Context; Link Here
24
use C4::Output;
24
use C4::Output;
25
use Koha::Patrons;
25
use Koha::Patrons;
26
26
27
my $query = new CGI;
27
my $query = CGI->new;
28
28
29
# if OPACPrivacy is disabled, leave immediately
29
# if OPACPrivacy is disabled, leave immediately
30
if ( ! C4::Context->preference('OPACPrivacy') || ! C4::Context->preference('opacreadinghistory') ) {
30
if ( ! C4::Context->preference('OPACPrivacy') || ! C4::Context->preference('opacreadinghistory') ) {
(-)a/opac/opac-readingrecord.pl (-1 / +1 lines)
Lines 36-42 use Koha::Patrons; Link Here
36
use Koha::ItemTypes;
36
use Koha::ItemTypes;
37
use Koha::Ratings;
37
use Koha::Ratings;
38
38
39
my $query = new CGI;
39
my $query = CGI->new;
40
40
41
# if opacreadinghistory is disabled, leave immediately
41
# if opacreadinghistory is disabled, leave immediately
42
if ( ! C4::Context->preference('opacreadinghistory') ) {
42
if ( ! C4::Context->preference('opacreadinghistory') ) {
(-)a/opac/opac-recordedbooks-search.pl (-1 / +1 lines)
Lines 24-30 use CGI qw( -utf8 ); Link Here
24
use C4::Auth;
24
use C4::Auth;
25
use C4::Output;
25
use C4::Output;
26
26
27
my $cgi = new CGI;
27
my $cgi = CGI->new;
28
28
29
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
29
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
    {
30
    {
(-)a/opac/opac-registration-verify.pl (-1 / +1 lines)
Lines 29-35 use Koha::Patron::Consent; Link Here
29
use Koha::Patron::Modifications;
29
use Koha::Patron::Modifications;
30
use Koha::Patron::Categories;
30
use Koha::Patron::Categories;
31
31
32
my $cgi = new CGI;
32
my $cgi = CGI->new;
33
my $dbh = C4::Context->dbh;
33
my $dbh = C4::Context->dbh;
34
34
35
unless ( C4::Context->preference('PatronSelfRegistration') ) {
35
unless ( C4::Context->preference('PatronSelfRegistration') ) {
(-)a/opac/opac-renew.pl (-1 / +1 lines)
Lines 32-38 use C4::Members; Link Here
32
use Koha::Items;
32
use Koha::Items;
33
use Koha::Patrons;
33
use Koha::Patrons;
34
use Date::Calc qw( Today Date_to_Days );
34
use Date::Calc qw( Today Date_to_Days );
35
my $query = new CGI;
35
my $query = CGI->new;
36
36
37
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
37
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
38
	{
38
	{
(-)a/opac/opac-reportproblem.pl (-1 / +1 lines)
Lines 31-37 use Koha::Util::Navigation; Link Here
31
use URI::Escape;
31
use URI::Escape;
32
use Encode;
32
use Encode;
33
33
34
my $input = new CGI;
34
my $input = CGI->new;
35
35
36
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
36
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
37
    {
37
    {
(-)a/opac/opac-request-article.pl (-1 / +1 lines)
Lines 27-33 use C4::Output; Link Here
27
use Koha::Biblios;
27
use Koha::Biblios;
28
use Koha::Patrons;
28
use Koha::Patrons;
29
29
30
my $cgi = new CGI;
30
my $cgi = CGI->new;
31
31
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
33
    {
33
    {
(-)a/opac/opac-reserve.pl (-1 / +1 lines)
Lines 47-53 use List::MoreUtils qw/uniq/; Link Here
47
47
48
my $maxreserves = C4::Context->preference("maxreserves");
48
my $maxreserves = C4::Context->preference("maxreserves");
49
49
50
my $query = new CGI;
50
my $query = CGI->new;
51
51
52
# if RequestOnOpac (for placing holds) is disabled, leave immediately
52
# if RequestOnOpac (for placing holds) is disabled, leave immediately
53
if ( ! C4::Context->preference('RequestOnOpac') ) {
53
if ( ! C4::Context->preference('RequestOnOpac') ) {
(-)a/opac/opac-restrictedpage.pl (-1 / +1 lines)
Lines 33-39 foreach my $IPRange ( split( ',', $localNetwork ) ) Link Here
33
    last if $withinNetwork;
33
    last if $withinNetwork;
34
}
34
}
35
35
36
my $query = new CGI;
36
my $query = CGI->new;
37
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
37
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
38
    {
38
    {
39
        template_name   => "opac-restrictedpage.tt",
39
        template_name   => "opac-restrictedpage.tt",
(-)a/opac/opac-review.pl (-1 / +1 lines)
Lines 31-37 use Koha::DateUtils; Link Here
31
use Koha::Review;
31
use Koha::Review;
32
use Koha::Reviews;
32
use Koha::Reviews;
33
33
34
my $query        = new CGI;
34
my $query        = CGI->new;
35
my $biblionumber = $query->param('biblionumber');
35
my $biblionumber = $query->param('biblionumber');
36
my $review       = $query->param('review');
36
my $review       = $query->param('review');
37
my $reviewid     = $query->param('reviewid');
37
my $reviewid     = $query->param('reviewid');
(-)a/opac/opac-routing-lists.pl (-1 / +1 lines)
Lines 23-29 use C4::Auth; Link Here
23
use C4::Output;
23
use C4::Output;
24
use Koha::Patrons;
24
use Koha::Patrons;
25
25
26
my $query = new CGI;
26
my $query = CGI->new;
27
27
28
unless ( C4::Context->preference('RoutingSerials') ) {
28
unless ( C4::Context->preference('RoutingSerials') ) {
29
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
29
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
(-)a/opac/opac-search-history.pl (-1 / +1 lines)
Lines 32-38 use URI::Escape; Link Here
32
use POSIX qw(strftime);
32
use POSIX qw(strftime);
33
33
34
34
35
my $cgi = new CGI;
35
my $cgi = CGI->new;
36
36
37
# Getting the template and auth
37
# Getting the template and auth
38
my ($template, $loggedinuser, $cookie) = get_template_and_user(
38
my ($template, $loggedinuser, $cookie) = get_template_and_user(
(-)a/opac/opac-search.pl (-1 / +1 lines)
Lines 73-79 my $DisplayMultiPlaceHold = C4::Context->preference("DisplayMultiPlaceHold"); Link Here
73
# create a new CGI object
73
# create a new CGI object
74
# FIXME: no_undef_params needs to be tested
74
# FIXME: no_undef_params needs to be tested
75
use CGI qw('-no_undef_params' -utf8);
75
use CGI qw('-no_undef_params' -utf8);
76
my $cgi = new CGI;
76
my $cgi = CGI->new;
77
77
78
my $branch_group_limit = $cgi->param("branch_group_limit");
78
my $branch_group_limit = $cgi->param("branch_group_limit");
79
if ( $branch_group_limit ) {
79
if ( $branch_group_limit ) {
(-)a/opac/opac-sendshelf.pl (-1 / +1 lines)
Lines 33-39 use Koha::Email; Link Here
33
use Koha::Patrons;
33
use Koha::Patrons;
34
use Koha::Virtualshelves;
34
use Koha::Virtualshelves;
35
35
36
my $query = new CGI;
36
my $query = CGI->new;
37
37
38
# if virtualshelves is disabled, leave immediately
38
# if virtualshelves is disabled, leave immediately
39
if ( ! C4::Context->preference('virtualshelves') ) {
39
if ( ! C4::Context->preference('virtualshelves') ) {
(-)a/opac/opac-serial-issues.pl (-1 / +1 lines)
Lines 28-34 use C4::Letters; Link Here
28
use C4::Output;
28
use C4::Output;
29
use C4::Context;
29
use C4::Context;
30
30
31
my $query      = new CGI;
31
my $query      = CGI->new;
32
my $op         = $query->param('op');
32
my $op         = $query->param('op');
33
my $dbh        = C4::Context->dbh;
33
my $dbh        = C4::Context->dbh;
34
my $selectview = $query->param('selectview');
34
my $selectview = $query->param('selectview');
(-)a/opac/opac-shareshelf.pl (-2 / +2 lines)
Lines 40-46 use Koha::Virtualshelfshares; Link Here
40
40
41
# if virtualshelves is disabled, leave immediately
41
# if virtualshelves is disabled, leave immediately
42
if ( ! C4::Context->preference('virtualshelves') ) {
42
if ( ! C4::Context->preference('virtualshelves') ) {
43
    my $query = new CGI;
43
    my $query = CGI->new;
44
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
44
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
45
    exit;
45
    exit;
46
}
46
}
Lines 60-66 output_html_with_http_headers $pvar->{query}, $pvar->{cookie}, $pvar->{template} Link Here
60
60
61
sub _init {
61
sub _init {
62
    my ($param) = @_;
62
    my ($param) = @_;
63
    my $query = new CGI;
63
    my $query = CGI->new;
64
    $param->{query}       = $query;
64
    $param->{query}       = $query;
65
    $param->{shelfnumber} = $query->param('shelfnumber') || 0;
65
    $param->{shelfnumber} = $query->param('shelfnumber') || 0;
66
    $param->{op}          = $query->param('op') || '';
66
    $param->{op}          = $query->param('op') || '';
(-)a/opac/opac-shelves.pl (-1 / +1 lines)
Lines 41-47 use Koha::RecordProcessor; Link Here
41
41
42
use constant ANYONE => 2;
42
use constant ANYONE => 2;
43
43
44
my $query = new CGI;
44
my $query = CGI->new;
45
45
46
my $template_name = $query->param('rss') ? "opac-shelves-rss.tt" : "opac-shelves.tt";
46
my $template_name = $query->param('rss') ? "opac-shelves-rss.tt" : "opac-shelves.tt";
47
47
(-)a/opac/opac-showmarc.pl (-1 / +1 lines)
Lines 33-39 use C4::XSLT (); Link Here
33
use C4::Templates;
33
use C4::Templates;
34
use Koha::RecordProcessor;
34
use Koha::RecordProcessor;
35
35
36
my $input       = new CGI;
36
my $input       = CGI->new;
37
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
37
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
38
    template_name   => "opac-showmarc.tt",
38
    template_name   => "opac-showmarc.tt",
39
    query           => $input,
39
    query           => $input,
(-)a/opac/opac-showreviews.pl (-1 / +1 lines)
Lines 32-38 use Koha::Reviews; Link Here
32
use POSIX qw(ceil floor strftime);
32
use POSIX qw(ceil floor strftime);
33
33
34
my $template_name;
34
my $template_name;
35
my $query = new CGI;
35
my $query = CGI->new;
36
my $format = $query->param("format") || '';
36
my $format = $query->param("format") || '';
37
my $count = C4::Context->preference('OPACnumSearchResults') || 20;
37
my $count = C4::Context->preference('OPACnumSearchResults') || 20;
38
my $results_per_page = $query->param('count') || $count;
38
my $results_per_page = $query->param('count') || $count;
(-)a/opac/opac-suggestions.pl (-1 / +1 lines)
Lines 35-41 use Koha::Patrons; Link Here
35
35
36
use Koha::DateUtils;
36
use Koha::DateUtils;
37
37
38
my $input           = new CGI;
38
my $input           = CGI->new;
39
my $op              = $input->param('op') || 'else';
39
my $op              = $input->param('op') || 'else';
40
my $biblionumber    = $input->param('biblionumber');
40
my $biblionumber    = $input->param('biblionumber');
41
my $suggestion      = $input->Vars;
41
my $suggestion      = $input->Vars;
(-)a/opac/opac-tags_subject.pl (-1 / +1 lines)
Lines 32-38 use C4::Output; Link Here
32
use CGI qw ( -utf8 );
32
use CGI qw ( -utf8 );
33
use C4::Biblio;
33
use C4::Biblio;
34
34
35
my $query = new CGI;
35
my $query = CGI->new;
36
36
37
my $dbh = C4::Context->dbh;
37
my $dbh = C4::Context->dbh;
38
38
(-)a/opac/opac-topissues.pl (-1 / +1 lines)
Lines 39-45 plugin that shows a stats on borrowers Link Here
39
39
40
=cut
40
=cut
41
41
42
my $input = new CGI;
42
my $input = CGI->new;
43
43
44
# if OpacTopissue is disabled, leave immediately
44
# if OpacTopissue is disabled, leave immediately
45
if ( ! C4::Context->preference('OpacTopissue') ) {
45
if ( ! C4::Context->preference('OpacTopissue') ) {
(-)a/opac/opac-user.pl (-1 / +1 lines)
Lines 55-61 use Date::Calc qw( Link Here
55
  Date_to_Days
55
  Date_to_Days
56
);
56
);
57
57
58
my $query = new CGI;
58
my $query = CGI->new;
59
59
60
# CAS single logout handling
60
# CAS single logout handling
61
# Will print header and exit
61
# Will print header and exit
(-)a/opac/sci/sci-main.pl (-1 / +1 lines)
Lines 27-33 use Koha::Items; Link Here
27
use List::MoreUtils qw( uniq );
27
use List::MoreUtils qw( uniq );
28
use Try::Tiny;
28
use Try::Tiny;
29
29
30
my $cgi = new CGI;
30
my $cgi = CGI->new;
31
31
32
# 404 if feature is disabled
32
# 404 if feature is disabled
33
unless ( C4::Context->preference('SelfCheckInModule') ) {
33
unless ( C4::Context->preference('SelfCheckInModule') ) {
(-)a/opac/sco/help.pl (-1 / +1 lines)
Lines 27-33 use CGI qw ( -utf8 ); Link Here
27
use C4::Auth   qw(get_template_and_user in_iprange);
27
use C4::Auth   qw(get_template_and_user in_iprange);
28
use C4::Output qw(output_html_with_http_headers);
28
use C4::Output qw(output_html_with_http_headers);
29
29
30
my $query = new CGI;
30
my $query = CGI->new;
31
unless ( in_iprange(C4::Context->preference('SelfCheckAllowByIPRanges')) ) {
31
unless ( in_iprange(C4::Context->preference('SelfCheckAllowByIPRanges')) ) {
32
    print $query->redirect("/cgi-bin/koha/opac-main.pl");
32
    print $query->redirect("/cgi-bin/koha/opac-main.pl");
33
    exit;
33
    exit;
(-)a/opac/sco/printslip.pl (-1 / +1 lines)
Lines 34-40 use C4::Output; Link Here
34
use C4::Members;
34
use C4::Members;
35
use C4::Koha;
35
use C4::Koha;
36
36
37
my $input = new CGI;
37
my $input = CGI->new;
38
unless ( in_iprange(C4::Context->preference('SelfCheckAllowByIPRanges')) ) {
38
unless ( in_iprange(C4::Context->preference('SelfCheckAllowByIPRanges')) ) {
39
    print $input->header(status => '403 Forbidden - functionality not available from your location');
39
    print $input->header(status => '403 Forbidden - functionality not available from your location');
40
    exit;
40
    exit;
(-)a/opac/sco/sco-main.pl (-1 / +1 lines)
Lines 51-57 use Koha::Patron::Images; Link Here
51
use Koha::Patron::Messages;
51
use Koha::Patron::Messages;
52
use Koha::Token;
52
use Koha::Token;
53
53
54
my $query = new CGI;
54
my $query = CGI->new;
55
55
56
unless (C4::Context->preference('WebBasedSelfCheck')) {
56
unless (C4::Context->preference('WebBasedSelfCheck')) {
57
    # redirect to OPAC home if self-check is not enabled
57
    # redirect to OPAC home if self-check is not enabled
(-)a/opac/svc/checkout_notes (-1 / +1 lines)
Lines 42-48 svc/checkout_notes - Web service for setting patron notes on items Link Here
42
42
43
# AJAX requests
43
# AJAX requests
44
my $is_ajax = is_ajax();
44
my $is_ajax = is_ajax();
45
my $query = new CGI;
45
my $query = CGI->new;
46
my ( $auth_status, $sessionID ) = check_cookie_auth( $query->cookie('CGISESSID'), {} );
46
my ( $auth_status, $sessionID ) = check_cookie_auth( $query->cookie('CGISESSID'), {} );
47
if ( $auth_status ne "ok" ) {
47
if ( $auth_status ne "ok" ) {
48
    exit 0;
48
    exit 0;
(-)a/opac/svc/club/cancel_enrollment (-1 / +1 lines)
Lines 26-32 use JSON qw(to_json); Link Here
26
use C4::Auth qw(check_cookie_auth);
26
use C4::Auth qw(check_cookie_auth);
27
use Koha::Club::Enrollments;
27
use Koha::Club::Enrollments;
28
28
29
my $cgi = new CGI;
29
my $cgi = CGI->new;
30
30
31
my ( $auth_status, $sessionID ) =
31
my ( $auth_status, $sessionID ) =
32
  check_cookie_auth( $cgi->cookie('CGISESSID') );
32
  check_cookie_auth( $cgi->cookie('CGISESSID') );
(-)a/opac/svc/club/enroll (-1 / +1 lines)
Lines 28-34 use Koha::Club::Enrollment::Field; Link Here
28
use Koha::Club::Enrollment;
28
use Koha::Club::Enrollment;
29
use Koha::Clubs;
29
use Koha::Clubs;
30
30
31
my $cgi = new CGI;
31
my $cgi = CGI->new;
32
32
33
my ( $auth_status, $sessionID ) =
33
my ( $auth_status, $sessionID ) =
34
  check_cookie_auth( $cgi->cookie('CGISESSID') );
34
  check_cookie_auth( $cgi->cookie('CGISESSID') );
(-)a/opac/svc/overdrive (-1 / +1 lines)
Lines 29-35 use Koha::Library::OverDriveInfos; Link Here
29
use Koha::ExternalContent::OverDrive;
29
use Koha::ExternalContent::OverDrive;
30
30
31
my $logger = Koha::Logger->get({ interface => 'opac' });
31
my $logger = Koha::Logger->get({ interface => 'opac' });
32
our $cgi = new CGI;
32
our $cgi = CGI->new;
33
my $page_url = $cgi->referer();
33
my $page_url = $cgi->referer();
34
34
35
my ( $user, $cookie, $sessionID, $flags ) = checkauth( $cgi, 1, {}, 'opac' );
35
my ( $user, $cookie, $sessionID, $flags ) = checkauth( $cgi, 1, {}, 'opac' );
(-)a/opac/svc/overdrive_proxy (-1 / +1 lines)
Lines 43-49 use C4::Output; Link Here
43
43
44
use Koha;
44
use Koha;
45
45
46
my $query = new CGI;
46
my $query = CGI->new;
47
47
48
my $token;
48
my $token;
49
49
(-)a/opac/svc/recordedbooks (-1 / +1 lines)
Lines 24-30 use C4::Output; Link Here
24
use Koha::Logger;
24
use Koha::Logger;
25
use Koha::ExternalContent::RecordedBooks;
25
use Koha::ExternalContent::RecordedBooks;
26
26
27
our $cgi = new CGI;
27
our $cgi = CGI->new;
28
my $logger = Koha::Logger->get({ interface => 'opac' });
28
my $logger = Koha::Logger->get({ interface => 'opac' });
29
my $page_url = $cgi->referer();
29
my $page_url = $cgi->referer();
30
30
(-)a/opac/svc/shelfbrowser.pl (-1 / +1 lines)
Lines 8-14 use C4::Context; Link Here
8
use C4::Output;
8
use C4::Output;
9
use C4::ShelfBrowser;
9
use C4::ShelfBrowser;
10
10
11
my $cgi = new CGI;
11
my $cgi = CGI->new;
12
12
13
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
13
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
14
    {
14
    {
(-)a/opac/svc/suggestion (-1 / +1 lines)
Lines 60-66 use CGI qw ( -utf8 ); Link Here
60
use JSON;
60
use JSON;
61
use Koha::SuggestionEngine;
61
use Koha::SuggestionEngine;
62
62
63
my $query = new CGI;
63
my $query = CGI->new;
64
64
65
my $dbh = C4::Context->dbh;
65
my $dbh = C4::Context->dbh;
66
66
(-)a/opac/tracklinks.pl (-1 / +1 lines)
Lines 28-34 use Koha::Linktracker; Link Here
28
use CGI qw ( -utf8 );
28
use CGI qw ( -utf8 );
29
use List::MoreUtils qw(any);
29
use List::MoreUtils qw(any);
30
30
31
my $cgi = new CGI;
31
my $cgi = CGI->new;
32
my $uri = $cgi->param('uri') || '';
32
my $uri = $cgi->param('uri') || '';
33
my $biblionumber = $cgi->param('biblionumber') || 0;
33
my $biblionumber = $cgi->param('biblionumber') || 0;
34
my $itemnumber   = $cgi->param('itemnumber')   || 0;
34
my $itemnumber   = $cgi->param('itemnumber')   || 0;
(-)a/patron_lists/add-modify.pl (-1 / +1 lines)
Lines 25-31 use C4::Auth; Link Here
25
use C4::Output;
25
use C4::Output;
26
use Koha::List::Patron;
26
use Koha::List::Patron;
27
27
28
my $cgi = new CGI;
28
my $cgi = CGI->new;
29
29
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {
31
    {
(-)a/patron_lists/delete.pl (-1 / +1 lines)
Lines 25-31 use C4::Auth; Link Here
25
use C4::Output;
25
use C4::Output;
26
use Koha::List::Patron;
26
use Koha::List::Patron;
27
27
28
my $cgi = new CGI;
28
my $cgi = CGI->new;
29
29
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {
31
    {
(-)a/patron_lists/list.pl (-1 / +1 lines)
Lines 26-32 use C4::Output; Link Here
26
use Koha::List::Patron;
26
use Koha::List::Patron;
27
use List::MoreUtils qw/uniq/;
27
use List::MoreUtils qw/uniq/;
28
28
29
my $cgi = new CGI;
29
my $cgi = CGI->new;
30
30
31
my ( $template, $logged_in_user, $cookie ) = get_template_and_user(
31
my ( $template, $logged_in_user, $cookie ) = get_template_and_user(
32
    {
32
    {
(-)a/patron_lists/lists.pl (-1 / +1 lines)
Lines 25-31 use C4::Auth; Link Here
25
use C4::Output;
25
use C4::Output;
26
use Koha::List::Patron;
26
use Koha::List::Patron;
27
27
28
my $cgi = new CGI;
28
my $cgi = CGI->new;
29
29
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {
31
    {
(-)a/patron_lists/patrons.pl (-1 / +1 lines)
Lines 25-31 use C4::Auth; Link Here
25
use C4::Output;
25
use C4::Output;
26
use Koha::List::Patron;
26
use Koha::List::Patron;
27
27
28
my $cgi = new CGI;
28
my $cgi = CGI->new;
29
29
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {
31
    {
(-)a/patroncards/add_user_search.pl (-1 / +1 lines)
Lines 26-32 use C4::Members; Link Here
26
26
27
use Koha::Patron::Categories;
27
use Koha::Patron::Categories;
28
28
29
my $input = new CGI;
29
my $input = CGI->new;
30
30
31
my $dbh = C4::Context->dbh;
31
my $dbh = C4::Context->dbh;
32
32
(-)a/patroncards/create-pdf.pl (-1 / +1 lines)
Lines 34-40 use Koha::List::Patron; Link Here
34
use Koha::Patrons;
34
use Koha::Patrons;
35
use Koha::Patron::Images;
35
use Koha::Patron::Images;
36
36
37
my $cgi = new CGI;
37
my $cgi = CGI->new;
38
38
39
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
39
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
40
                                                                     template_name   => "labels/label-home.tt",
40
                                                                     template_name   => "labels/label-home.tt",
(-)a/patroncards/edit-batch.pl (-1 / +1 lines)
Lines 31-37 use C4::Creators; Link Here
31
use C4::Patroncards;
31
use C4::Patroncards;
32
use Koha::Patrons;
32
use Koha::Patrons;
33
33
34
my $cgi = new CGI;
34
my $cgi = CGI->new;
35
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
35
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
36
    {
36
    {
37
        template_name   => "patroncards/edit-batch.tt",
37
        template_name   => "patroncards/edit-batch.tt",
(-)a/patroncards/edit-layout.pl (-1 / +1 lines)
Lines 30-36 use C4::Output qw(output_html_with_http_headers); Link Here
30
use C4::Creators;
30
use C4::Creators;
31
use C4::Patroncards;
31
use C4::Patroncards;
32
32
33
my $cgi = new CGI;
33
my $cgi = CGI->new;
34
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
34
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
35
    {
35
    {
36
        template_name   => "patroncards/edit-layout.tt",
36
        template_name   => "patroncards/edit-layout.tt",
(-)a/patroncards/edit-profile.pl (-1 / +1 lines)
Lines 27-33 use C4::Output qw(output_html_with_http_headers); Link Here
27
use C4::Creators::Lib qw(get_all_templates get_unit_values);
27
use C4::Creators::Lib qw(get_all_templates get_unit_values);
28
use C4::Patroncards::Profile;
28
use C4::Patroncards::Profile;
29
29
30
my $cgi = new CGI;
30
my $cgi = CGI->new;
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
    {
32
    {
33
        template_name   => "patroncards/edit-profile.tt",
33
        template_name   => "patroncards/edit-profile.tt",
(-)a/patroncards/edit-template.pl (-1 / +1 lines)
Lines 28-34 use C4::Output qw(output_html_with_http_headers); Link Here
28
use C4::Creators;
28
use C4::Creators;
29
use C4::Patroncards;
29
use C4::Patroncards;
30
30
31
my $cgi = new CGI;
31
my $cgi = CGI->new;
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
    {
33
    {
34
        template_name   => "patroncards/edit-template.tt",
34
        template_name   => "patroncards/edit-template.tt",
(-)a/patroncards/home.pl (-1 / +1 lines)
Lines 25-31 use CGI qw ( -utf8 ); Link Here
25
use C4::Auth qw(get_template_and_user);
25
use C4::Auth qw(get_template_and_user);
26
use C4::Output qw(output_html_with_http_headers);
26
use C4::Output qw(output_html_with_http_headers);
27
27
28
my $cgi = new CGI;
28
my $cgi = CGI->new;
29
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
29
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
    {
30
    {
31
        template_name   => "patroncards/home.tt",
31
        template_name   => "patroncards/home.tt",
(-)a/patroncards/manage.pl (-1 / +1 lines)
Lines 31-37 use C4::Patroncards; Link Here
31
use C4::Labels;
31
use C4::Labels;
32
use Koha::List::Patron;
32
use Koha::List::Patron;
33
33
34
my $cgi = new CGI;
34
my $cgi = CGI->new;
35
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
35
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
36
    {
36
    {
37
        template_name   => "patroncards/manage.tt",
37
        template_name   => "patroncards/manage.tt",
(-)a/patroncards/print.pl (-1 / +1 lines)
Lines 27-33 use C4::Output qw(output_html_with_http_headers); Link Here
27
use C4::Creators;
27
use C4::Creators;
28
use C4::Patroncards;
28
use C4::Patroncards;
29
29
30
my $cgi = new CGI;
30
my $cgi = CGI->new;
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
    {
32
    {
33
        template_name   => "patroncards/print.tt",
33
        template_name   => "patroncards/print.tt",
(-)a/plugins/plugins-enable.pl (-1 / +1 lines)
Lines 25-31 use Koha::Plugins::Handler; Link Here
25
25
26
die("Koha plugins are disabled!") unless C4::Context->config("enable_plugins");
26
die("Koha plugins are disabled!") unless C4::Context->config("enable_plugins");
27
27
28
my $input = new CGI;
28
my $input = CGI->new;
29
29
30
my ( $auth_status, $sessionID ) =
30
my ( $auth_status, $sessionID ) =
31
  check_cookie_auth( $input->cookie('CGISESSID'), { plugins => 'manage' } );
31
  check_cookie_auth( $input->cookie('CGISESSID'), { plugins => 'manage' } );
(-)a/plugins/plugins-home.pl (-1 / +1 lines)
Lines 32-38 use C4::Context; Link Here
32
32
33
my $plugins_enabled = C4::Context->config("enable_plugins");
33
my $plugins_enabled = C4::Context->config("enable_plugins");
34
34
35
my $input  = new CGI;
35
my $input  = CGI->new;
36
my $method = $input->param('method');
36
my $method = $input->param('method');
37
my $plugin_search = $input->param('plugin-search');
37
my $plugin_search = $input->param('plugin-search');
38
38
(-)a/plugins/plugins-uninstall.pl (-1 / +1 lines)
Lines 31-37 use Koha::Plugins::Handler; Link Here
31
31
32
die("Koha plugins are disabled!") unless C4::Context->config("enable_plugins");
32
die("Koha plugins are disabled!") unless C4::Context->config("enable_plugins");
33
33
34
my $input = new CGI;
34
my $input = CGI->new;
35
35
36
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
36
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
37
    {   template_name   => "plugins/plugins-upload.tt",
37
    {   template_name   => "plugins/plugins-upload.tt",
(-)a/plugins/plugins-upload.pl (-1 / +1 lines)
Lines 33-39 use Koha::Plugins; Link Here
33
33
34
my $plugins_enabled = C4::Context->config("enable_plugins");
34
my $plugins_enabled = C4::Context->config("enable_plugins");
35
35
36
my $input = new CGI;
36
my $input = CGI->new;
37
37
38
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
38
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
39
    {   template_name => ($plugins_enabled) ? "plugins/plugins-upload.tt" : "plugins/plugins-disabled.tt",
39
    {   template_name => ($plugins_enabled) ? "plugins/plugins-upload.tt" : "plugins/plugins-disabled.tt",
(-)a/plugins/run.pl (-1 / +1 lines)
Lines 29-35 use C4::Context; Link Here
29
29
30
my $plugins_enabled = C4::Context->config("enable_plugins");
30
my $plugins_enabled = C4::Context->config("enable_plugins");
31
31
32
my $cgi = new CGI;
32
my $cgi = CGI->new;
33
33
34
my $class  = $cgi->param('class');
34
my $class  = $cgi->param('class');
35
my $method = $cgi->param('method');
35
my $method = $cgi->param('method');
(-)a/reports/acquisitions_stats.pl (-1 / +1 lines)
Lines 41-47 Plugin that shows a stats on borrowers Link Here
41
41
42
=cut
42
=cut
43
43
44
my $input          = new CGI;
44
my $input          = CGI->new;
45
my $do_it          = $input->param('do_it');
45
my $do_it          = $input->param('do_it');
46
my $fullreportname = "reports/acquisitions_stats.tt";
46
my $fullreportname = "reports/acquisitions_stats.tt";
47
my $line           = $input->param("Line");
47
my $line           = $input->param("Line");
(-)a/reports/bor_issues_top.pl (-1 / +1 lines)
Lines 43-49 plugin that shows a stats on borrowers Link Here
43
43
44
$debug and open my $debugfh, '>', '/tmp/bor_issues_top.debug.log';
44
$debug and open my $debugfh, '>', '/tmp/bor_issues_top.debug.log';
45
45
46
my $input = new CGI;
46
my $input = CGI->new;
47
my $fullreportname = "reports/bor_issues_top.tt";
47
my $fullreportname = "reports/bor_issues_top.tt";
48
my $do_it   = $input->param('do_it');
48
my $do_it   = $input->param('do_it');
49
my $limit   = $input->param("Limit");
49
my $limit   = $input->param("Limit");
(-)a/reports/borrowers_out.pl (-1 / +1 lines)
Lines 41-47 Plugin that shows a stats on borrowers Link Here
41
41
42
=cut
42
=cut
43
43
44
my $input = new CGI;
44
my $input = CGI->new;
45
my $do_it=$input->param('do_it');
45
my $do_it=$input->param('do_it');
46
my $fullreportname = "reports/borrowers_out.tt";
46
my $fullreportname = "reports/borrowers_out.tt";
47
my $limit = $input->param("Limit");
47
my $limit = $input->param("Limit");
(-)a/reports/borrowers_stats.pl (-1 / +1 lines)
Lines 48-54 plugin that shows a stats on borrowers Link Here
48
48
49
=cut
49
=cut
50
50
51
my $input = new CGI;
51
my $input = CGI->new;
52
my $do_it=$input->param('do_it');
52
my $do_it=$input->param('do_it');
53
my $fullreportname = "reports/borrowers_stats.tt";
53
my $fullreportname = "reports/borrowers_stats.tt";
54
my $line = $input->param("Line");
54
my $line = $input->param("Line");
(-)a/reports/cash_register_stats.pl (-1 / +1 lines)
Lines 31-37 use List::Util qw/any/; Link Here
31
use Koha::Account::CreditTypes;
31
use Koha::Account::CreditTypes;
32
use Koha::Account::DebitTypes;
32
use Koha::Account::DebitTypes;
33
33
34
my $input            = new CGI;
34
my $input            = CGI->new;
35
my $dbh              = C4::Context->dbh;
35
my $dbh              = C4::Context->dbh;
36
36
37
my ($template, $borrowernumber, $cookie) = get_template_and_user({
37
my ($template, $borrowernumber, $cookie) = get_template_and_user({
(-)a/reports/cat_issues_top.pl (-1 / +1 lines)
Lines 38-44 plugin that shows a stats on borrowers Link Here
38
38
39
=cut
39
=cut
40
40
41
my $input = new CGI;
41
my $input = CGI->new;
42
my $do_it=$input->param('do_it');
42
my $do_it=$input->param('do_it');
43
my $fullreportname = "reports/cat_issues_top.tt";
43
my $fullreportname = "reports/cat_issues_top.tt";
44
my $limit = $input->param("Limit");
44
my $limit = $input->param("Limit");
(-)a/reports/catalogue_out.pl (-1 / +1 lines)
Lines 33-39 Report that shows unborrowed items. Link Here
33
33
34
=cut
34
=cut
35
35
36
my $input   = new CGI;
36
my $input   = CGI->new;
37
my $do_it   = $input->param('do_it');
37
my $do_it   = $input->param('do_it');
38
my $limit   = $input->param("Limit") || 10;
38
my $limit   = $input->param("Limit") || 10;
39
my $column  = $input->param("Criteria");
39
my $column  = $input->param("Criteria");
(-)a/reports/catalogue_stats.pl (-1 / +1 lines)
Lines 41-47 plugin that shows a stats on borrowers Link Here
41
=cut
41
=cut
42
42
43
our $debug = 0;
43
our $debug = 0;
44
my $input = new CGI;
44
my $input = CGI->new;
45
my $fullreportname = "reports/catalogue_stats.tt";
45
my $fullreportname = "reports/catalogue_stats.tt";
46
my $do_it       = $input->param('do_it');
46
my $do_it       = $input->param('do_it');
47
my $line        = $input->param("Line");
47
my $line        = $input->param("Line");
(-)a/reports/dictionary.pl (-1 / +1 lines)
Lines 32-38 Script to control the guided report creation Link Here
32
32
33
=cut
33
=cut
34
34
35
my $input = new CGI;
35
my $input = CGI->new;
36
my $referer = $input->referer();
36
my $referer = $input->referer();
37
37
38
my $phase = $input->param('phase') || 'View Dictionary';
38
my $phase = $input->param('phase') || 'View Dictionary';
(-)a/reports/guided_reports.pl (-1 / +1 lines)
Lines 50-56 Script to control the guided report creation Link Here
50
50
51
=cut
51
=cut
52
52
53
my $input = new CGI;
53
my $input = CGI->new;
54
my $usecache = Koha::Caches->get_instance->memcached_cache;
54
my $usecache = Koha::Caches->get_instance->memcached_cache;
55
55
56
my $phase = $input->param('phase') // '';
56
my $phase = $input->param('phase') // '';
(-)a/reports/issues_avg_stats.pl (-1 / +1 lines)
Lines 39-45 plugin that shows a stats on borrowers Link Here
39
39
40
=cut
40
=cut
41
41
42
my $input = new CGI;
42
my $input = CGI->new;
43
my $do_it=$input->param('do_it');
43
my $do_it=$input->param('do_it');
44
my $fullreportname = "reports/issues_avg_stats.tt";
44
my $fullreportname = "reports/issues_avg_stats.tt";
45
my $line = $input->param("Line");
45
my $line = $input->param("Line");
(-)a/reports/itemslost.pl (-1 / +1 lines)
Lines 38-44 use Koha::AuthorisedValues; Link Here
38
use Koha::CsvProfiles;
38
use Koha::CsvProfiles;
39
use Koha::DateUtils;
39
use Koha::DateUtils;
40
40
41
my $query = new CGI;
41
my $query = CGI->new;
42
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
42
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
43
    {
43
    {
44
        template_name   => "reports/itemslost.tt",
44
        template_name   => "reports/itemslost.tt",
(-)a/reports/manager.pl (-1 / +1 lines)
Lines 25-31 use C4::Output; Link Here
25
use C4::Circulation;
25
use C4::Circulation;
26
26
27
27
28
my $input = new CGI;
28
my $input = CGI->new;
29
my $report_name=$input->param("report_name");
29
my $report_name=$input->param("report_name");
30
my $do_it=$input->param('do_it');
30
my $do_it=$input->param('do_it');
31
my $fullreportname = "reports/".$report_name.".tt";
31
my $fullreportname = "reports/".$report_name.".tt";
(-)a/reports/orders_by_fund.pl (-1 / +1 lines)
Lines 37-43 use C4::Acquisition; #GetBasket() Link Here
37
use Koha::Biblios;
37
use Koha::Biblios;
38
use Koha::DateUtils;
38
use Koha::DateUtils;
39
39
40
my $query = new CGI;
40
my $query = CGI->new;
41
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
41
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
42
    {
42
    {
43
        template_name   => "reports/orders_by_budget.tt",
43
        template_name   => "reports/orders_by_budget.tt",
(-)a/reports/reports-home.pl (-1 / +1 lines)
Lines 25-31 use C4::Output; Link Here
25
use C4::Context;
25
use C4::Context;
26
26
27
27
28
my $query = new CGI;
28
my $query = CGI->new;
29
my ($template, $loggedinuser, $cookie)
29
my ($template, $loggedinuser, $cookie)
30
= get_template_and_user({template_name => "reports/reports-home.tt",
30
= get_template_and_user({template_name => "reports/reports-home.tt",
31
				query => $query,
31
				query => $query,
(-)a/reports/reserves_stats.pl (-1 / +1 lines)
Lines 47-53 Plugin that shows reserve stats Link Here
47
=cut
47
=cut
48
48
49
# my $debug = 1;	# override for now.
49
# my $debug = 1;	# override for now.
50
my $input = new CGI;
50
my $input = CGI->new;
51
my $fullreportname = "reports/reserves_stats.tt";
51
my $fullreportname = "reports/reserves_stats.tt";
52
my $do_it    = $input->param('do_it');
52
my $do_it    = $input->param('do_it');
53
my $line     = $input->param("Line");
53
my $line     = $input->param("Line");
(-)a/reports/serials_stats.pl (-1 / +1 lines)
Lines 34-40 plugin that shows a stats on serials Link Here
34
34
35
=cut
35
=cut
36
36
37
my $input      = new CGI;
37
my $input      = CGI->new;
38
my $templatename   = "reports/serials_stats.tt";
38
my $templatename   = "reports/serials_stats.tt";
39
my $do_it      = $input->param("do_it");
39
my $do_it      = $input->param("do_it");
40
my $bookseller = $input->param("bookseller");
40
my $bookseller = $input->param("bookseller");
(-)a/reserve/modrequest.pl (-1 / +1 lines)
Lines 30-36 use C4::Reserves; Link Here
30
use C4::Auth;
30
use C4::Auth;
31
use Koha::DateUtils qw( dt_from_string );
31
use Koha::DateUtils qw( dt_from_string );
32
32
33
my $query = new CGI;
33
my $query = CGI->new;
34
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
34
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
35
    {   
35
    {   
36
        template_name   => "about.tt",
36
        template_name   => "about.tt",
(-)a/reserve/modrequest_suspendall.pl (-1 / +1 lines)
Lines 28-34 use C4::Output; Link Here
28
use C4::Reserves;
28
use C4::Reserves;
29
use C4::Auth;
29
use C4::Auth;
30
30
31
my $query = new CGI;
31
my $query = CGI->new;
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
    {
33
    {
34
        template_name   => "about.tt",
34
        template_name   => "about.tt",
(-)a/reserve/request.pl (-1 / +1 lines)
Lines 56-62 use Koha::Patrons; Link Here
56
use Koha::Clubs;
56
use Koha::Clubs;
57
57
58
my $dbh = C4::Context->dbh;
58
my $dbh = C4::Context->dbh;
59
my $input = new CGI;
59
my $input = CGI->new;
60
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
60
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
61
    {
61
    {
62
        template_name   => "reserve/request.tt",
62
        template_name   => "reserve/request.tt",
(-)a/reviews/reviewswaiting.pl (-1 / +1 lines)
Lines 26-32 use Koha::Biblios; Link Here
26
use Koha::Patrons;
26
use Koha::Patrons;
27
use Koha::Reviews;
27
use Koha::Reviews;
28
28
29
my $query = new CGI;
29
my $query = CGI->new;
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {
31
    {
32
        template_name   => "reviews/reviewswaiting.tt",
32
        template_name   => "reviews/reviewswaiting.tt",
(-)a/rotating_collections/addItems.pl (-1 / +1 lines)
Lines 28-34 use Koha::Items; Link Here
28
28
29
use CGI qw ( -utf8 );
29
use CGI qw ( -utf8 );
30
30
31
my $query = new CGI;
31
my $query = CGI->new;
32
32
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
34
    {
34
    {
(-)a/rotating_collections/editCollections.pl (-1 / +1 lines)
Lines 26-32 use C4::Context; Link Here
26
26
27
use C4::RotatingCollections;
27
use C4::RotatingCollections;
28
28
29
my $query = new CGI;
29
my $query = CGI->new;
30
30
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
    {
32
    {
(-)a/rotating_collections/rotatingCollections.pl (-1 / +1 lines)
Lines 25-31 use C4::Auth; Link Here
25
use C4::Context;
25
use C4::Context;
26
use C4::RotatingCollections;
26
use C4::RotatingCollections;
27
27
28
my $query = new CGI;
28
my $query = CGI->new;
29
29
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {
31
    {
(-)a/rotating_collections/transferCollection.pl (-1 / +1 lines)
Lines 25-31 use C4::RotatingCollections; Link Here
25
25
26
use CGI qw ( -utf8 );
26
use CGI qw ( -utf8 );
27
27
28
my $query = new CGI;
28
my $query = CGI->new;
29
29
30
my $colId    = $query->param('colId');
30
my $colId    = $query->param('colId');
31
my $toBranch = $query->param('toBranch');
31
my $toBranch = $query->param('toBranch');
(-)a/serials/acqui-search-result.pl (-1 / +1 lines)
Lines 50-56 use Koha::DateUtils; Link Here
50
50
51
use Koha::Acquisition::Booksellers;
51
use Koha::Acquisition::Booksellers;
52
52
53
my $query=new CGI;
53
my $query=CGI->new;
54
my ($template, $loggedinuser, $cookie)
54
my ($template, $loggedinuser, $cookie)
55
    = get_template_and_user({template_name => "serials/acqui-search-result.tt",
55
    = get_template_and_user({template_name => "serials/acqui-search-result.tt",
56
                 query => $query,
56
                 query => $query,
(-)a/serials/acqui-search.pl (-1 / +1 lines)
Lines 23-29 use CGI qw ( -utf8 ); Link Here
23
use C4::Auth;
23
use C4::Auth;
24
use C4::Output;
24
use C4::Output;
25
25
26
my $query = new CGI;
26
my $query = CGI->new;
27
27
28
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
28
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
29
    {
29
    {
(-)a/serials/add_user_search.pl (-1 / +1 lines)
Lines 26-32 use C4::Members; Link Here
26
26
27
use Koha::Patron::Categories;
27
use Koha::Patron::Categories;
28
28
29
my $input = new CGI;
29
my $input = CGI->new;
30
30
31
my $dbh = C4::Context->dbh;
31
my $dbh = C4::Context->dbh;
32
32
(-)a/serials/checkexpiration.pl (-1 / +1 lines)
Lines 52-58 use Koha::DateUtils; Link Here
52
52
53
use DateTime;
53
use DateTime;
54
54
55
my $query = new CGI;
55
my $query = CGI->new;
56
56
57
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user (
57
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user (
58
    {
58
    {
(-)a/serials/create-numberpattern.pl (-1 / +1 lines)
Lines 24-30 use C4::Serials::Numberpattern; Link Here
24
use C4::Auth qw/check_cookie_auth/;
24
use C4::Auth qw/check_cookie_auth/;
25
use URI::Escape;
25
use URI::Escape;
26
26
27
my $input = new CGI;
27
my $input = CGI->new;
28
28
29
my ($auth_status, $sessionID) = check_cookie_auth($input->cookie('CGISESSID'), { serials => '*' });
29
my ($auth_status, $sessionID) = check_cookie_auth($input->cookie('CGISESSID'), { serials => '*' });
30
if ($auth_status ne "ok") {
30
if ($auth_status ne "ok") {
(-)a/serials/lateissues-export.pl (-1 / +1 lines)
Lines 27-33 use Koha::CsvProfiles; Link Here
27
27
28
use Text::CSV_XS;
28
use Text::CSV_XS;
29
29
30
my $query = new CGI;
30
my $query = CGI->new;
31
my $supplierid = $query->param('supplierid');
31
my $supplierid = $query->param('supplierid');
32
my @serialids = $query->multi_param('serialid');
32
my @serialids = $query->multi_param('serialid');
33
my $op = $query->param('op') || q{};
33
my $op = $query->param('op') || q{};
(-)a/serials/routing-preview.pl (-1 / +1 lines)
Lines 37-43 use Koha::Biblios; Link Here
37
use Koha::Libraries;
37
use Koha::Libraries;
38
use Koha::Patrons;
38
use Koha::Patrons;
39
39
40
my $query = new CGI;
40
my $query = CGI->new;
41
my $subscriptionid = $query->param('subscriptionid');
41
my $subscriptionid = $query->param('subscriptionid');
42
my $issue = $query->param('issue');
42
my $issue = $query->param('issue');
43
my $routingid;
43
my $routingid;
(-)a/serials/routing.pl (-1 / +1 lines)
Lines 40-46 use Koha::Patrons; Link Here
40
40
41
use URI::Escape;
41
use URI::Escape;
42
42
43
my $query = new CGI;
43
my $query = CGI->new;
44
my $subscriptionid = $query->param('subscriptionid');
44
my $subscriptionid = $query->param('subscriptionid');
45
my $serialseq = $query->param('serialseq');
45
my $serialseq = $query->param('serialseq');
46
my $routingid = $query->param('routingid');
46
my $routingid = $query->param('routingid');
(-)a/serials/serials-collection.pl (-1 / +1 lines)
Lines 34-40 use Koha::DateUtils qw( dt_from_string ); Link Here
34
use List::MoreUtils qw/uniq/;
34
use List::MoreUtils qw/uniq/;
35
35
36
36
37
my $query = new CGI;
37
my $query = CGI->new;
38
my $op = $query->param('op') || q{};
38
my $op = $query->param('op') || q{};
39
my $nbissues=$query->param('nbissues');
39
my $nbissues=$query->param('nbissues');
40
my $date_received_today = $query->param('date_received_today') || 0;
40
my $date_received_today = $query->param('date_received_today') || 0;
(-)a/serials/serials-home.pl (-1 / +1 lines)
Lines 35-41 use C4::Context; Link Here
35
use C4::Output;
35
use C4::Output;
36
use C4::Serials;
36
use C4::Serials;
37
37
38
my $query   = new CGI;
38
my $query   = CGI->new;
39
my $routing = $query->param('routing') || C4::Context->preference("RoutingSerials");
39
my $routing = $query->param('routing') || C4::Context->preference("RoutingSerials");
40
40
41
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
41
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
(-)a/serials/serials-search.pl (-1 / +1 lines)
Lines 40-46 use Koha::AdditionalFields; Link Here
40
use Koha::DateUtils;
40
use Koha::DateUtils;
41
use Koha::SharedContent;
41
use Koha::SharedContent;
42
42
43
my $query         = new CGI;
43
my $query         = CGI->new;
44
my $title         = $query->param('title_filter') || '';
44
my $title         = $query->param('title_filter') || '';
45
my $ISSN          = $query->param('ISSN_filter') || '';
45
my $ISSN          = $query->param('ISSN_filter') || '';
46
my $EAN           = $query->param('EAN_filter') || '';
46
my $EAN           = $query->param('EAN_filter') || '';
(-)a/serials/showpredictionpattern.pl (-1 / +1 lines)
Lines 38-44 use C4::Serials; Link Here
38
use C4::Serials::Frequency;
38
use C4::Serials::Frequency;
39
use Koha::DateUtils;
39
use Koha::DateUtils;
40
40
41
my $input = new CGI;
41
my $input = CGI->new;
42
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
42
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
43
    template_name   => 'serials/showpredictionpattern.tt',
43
    template_name   => 'serials/showpredictionpattern.tt',
44
    query           => $input,
44
    query           => $input,
(-)a/serials/subscription-batchedit.pl (-1 / +1 lines)
Lines 29-35 use Koha::Acquisition::Booksellers; Link Here
29
use Koha::AdditionalFields;
29
use Koha::AdditionalFields;
30
use Koha::DateUtils;
30
use Koha::DateUtils;
31
31
32
my $cgi = new CGI;
32
my $cgi = CGI->new;
33
33
34
my ($template, $loggedinuser, $cookie) = get_template_and_user({
34
my ($template, $loggedinuser, $cookie) = get_template_and_user({
35
    template_name => 'serials/subscription-batchedit.tt',
35
    template_name => 'serials/subscription-batchedit.tt',
(-)a/serials/subscription-bib-search.pl (-1 / +1 lines)
Lines 61-67 use Koha::ItemTypes; Link Here
61
use Koha::SearchEngine;
61
use Koha::SearchEngine;
62
use Koha::SearchEngine::Search;
62
use Koha::SearchEngine::Search;
63
63
64
my $input = new CGI;
64
my $input = CGI->new;
65
my $op = $input->param('op') || q{};
65
my $op = $input->param('op') || q{};
66
my $dbh = C4::Context->dbh;
66
my $dbh = C4::Context->dbh;
67
67
(-)a/serials/subscription-detail.pl (-1 / +1 lines)
Lines 37-43 use Carp; Link Here
37
37
38
use Koha::SharedContent;
38
use Koha::SharedContent;
39
39
40
my $query = new CGI;
40
my $query = CGI->new;
41
my $op = $query->param('op') || q{};
41
my $op = $query->param('op') || q{};
42
my $issueconfirmed = $query->param('issueconfirmed');
42
my $issueconfirmed = $query->param('issueconfirmed');
43
my $dbh = C4::Context->dbh;
43
my $dbh = C4::Context->dbh;
(-)a/serials/subscription-frequencies.pl (-1 / +1 lines)
Lines 36-42 use C4::Output; Link Here
36
use C4::Serials;
36
use C4::Serials;
37
use C4::Serials::Frequency;
37
use C4::Serials::Frequency;
38
38
39
my $input = new CGI;
39
my $input = CGI->new;
40
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
40
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
41
    template_name   => 'serials/subscription-frequencies.tt',
41
    template_name   => 'serials/subscription-frequencies.tt',
42
    query           => $input,
42
    query           => $input,
(-)a/serials/subscription-frequency.pl (-1 / +1 lines)
Lines 24-30 use C4::Serials::Frequency; Link Here
24
use C4::Auth qw/check_cookie_auth/;
24
use C4::Auth qw/check_cookie_auth/;
25
use JSON qw( to_json );
25
use JSON qw( to_json );
26
26
27
my $input=new CGI;
27
my $input=CGI->new;
28
my $frqid=$input->param("frequency_id");
28
my $frqid=$input->param("frequency_id");
29
my ($auth_status, $sessionID) = check_cookie_auth($input->cookie('CGISESSID'), { serials => '*' });
29
my ($auth_status, $sessionID) = check_cookie_auth($input->cookie('CGISESSID'), { serials => '*' });
30
if ($auth_status ne "ok") {
30
if ($auth_status ne "ok") {
(-)a/serials/subscription-history.pl (-1 / +1 lines)
Lines 38-44 use C4::Serials; Link Here
38
use Koha::Biblios;
38
use Koha::Biblios;
39
use Koha::DateUtils;
39
use Koha::DateUtils;
40
40
41
my $input = new CGI;
41
my $input = CGI->new;
42
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
42
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
43
    template_name   => 'serials/subscription-history.tt',
43
    template_name   => 'serials/subscription-history.tt',
44
    query           => $input,
44
    query           => $input,
(-)a/serials/subscription-numberpattern.pl (-1 / +1 lines)
Lines 23-29 use C4::Serials::Numberpattern; Link Here
23
use C4::Auth qw/check_cookie_auth/;
23
use C4::Auth qw/check_cookie_auth/;
24
use JSON qw( to_json );
24
use JSON qw( to_json );
25
25
26
my $input=new CGI;
26
my $input=CGI->new;
27
27
28
my ($auth_status, $sessionID) = check_cookie_auth($input->cookie('CGISESSID'), { serials => '*' });
28
my ($auth_status, $sessionID) = check_cookie_auth($input->cookie('CGISESSID'), { serials => '*' });
29
if ($auth_status ne "ok") {
29
if ($auth_status ne "ok") {
(-)a/serials/subscription-numberpatterns.pl (-1 / +1 lines)
Lines 35-41 use C4::Output; Link Here
35
use C4::Serials::Numberpattern;
35
use C4::Serials::Numberpattern;
36
use C4::Serials::Frequency;
36
use C4::Serials::Frequency;
37
37
38
my $input = new CGI;
38
my $input = CGI->new;
39
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
39
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
40
    template_name   => 'serials/subscription-numberpatterns.tt',
40
    template_name   => 'serials/subscription-numberpatterns.tt',
41
    query           => $input,
41
    query           => $input,
(-)a/serials/subscription-renew.pl (-1 / +1 lines)
Lines 55-61 use C4::Output; Link Here
55
use C4::Serials;
55
use C4::Serials;
56
use Koha::DateUtils;
56
use Koha::DateUtils;
57
57
58
my $query = new CGI;
58
my $query = CGI->new;
59
my $dbh   = C4::Context->dbh;
59
my $dbh   = C4::Context->dbh;
60
60
61
my $mode           = $query->param('mode') || q{};
61
my $mode           = $query->param('mode') || q{};
(-)a/serials/viewalerts.pl (-1 / +1 lines)
Lines 26-32 use C4::Output; Link Here
26
26
27
use Koha::Subscriptions;
27
use Koha::Subscriptions;
28
28
29
my $input = new CGI;
29
my $input = CGI->new;
30
30
31
my ($template, $loggedinuser, $cookie)
31
my ($template, $loggedinuser, $cookie)
32
    = get_template_and_user({template_name => 'serials/viewalerts.tt',
32
    = get_template_and_user({template_name => 'serials/viewalerts.tt',
(-)a/services/itemrecorddisplay.pl (-1 / +1 lines)
Lines 34-40 use C4::Auth; Link Here
34
use C4::Output;
34
use C4::Output;
35
use C4::Items;
35
use C4::Items;
36
36
37
my $input = new CGI;
37
my $input = CGI->new;
38
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
38
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
39
    template_name   => 'services/itemrecorddisplay.tt',
39
    template_name   => 'services/itemrecorddisplay.tt',
40
    query           => $input,
40
    query           => $input,
(-)a/suggestion/add_user_search.pl (-1 / +1 lines)
Lines 24-30 use C4::Members; Link Here
24
24
25
use Koha::Patron::Categories;
25
use Koha::Patron::Categories;
26
26
27
my $input = new CGI;
27
my $input = CGI->new;
28
28
29
my $dbh = C4::Context->dbh;
29
my $dbh = C4::Context->dbh;
30
30
(-)a/suggestion/suggester_search.pl (-1 / +1 lines)
Lines 26-32 use C4::Members; Link Here
26
26
27
use Koha::Patron::Categories;
27
use Koha::Patron::Categories;
28
28
29
my $input = new CGI;
29
my $input = CGI->new;
30
30
31
my $dbh = C4::Context->dbh;
31
my $dbh = C4::Context->dbh;
32
32
(-)a/svc/article_request (-1 / +1 lines)
Lines 26-32 use JSON qw(to_json); Link Here
26
use C4::Auth qw(check_cookie_auth);
26
use C4::Auth qw(check_cookie_auth);
27
use Koha::ArticleRequests;
27
use Koha::ArticleRequests;
28
28
29
my $cgi = new CGI;
29
my $cgi = CGI->new;
30
30
31
my ( $auth_status, $sessionID ) =
31
my ( $auth_status, $sessionID ) =
32
  check_cookie_auth( $cgi->cookie('CGISESSID'), { circulate => 'circulate_remaining_permissions' } );
32
  check_cookie_auth( $cgi->cookie('CGISESSID'), { circulate => 'circulate_remaining_permissions' } );
(-)a/svc/authentication (-1 / +1 lines)
Lines 24-30 use CGI qw ( -utf8 ); Link Here
24
use C4::Auth qw/check_api_auth/;
24
use C4::Auth qw/check_api_auth/;
25
use XML::Simple;
25
use XML::Simple;
26
26
27
my $query = new CGI;
27
my $query = CGI->new;
28
28
29
# The authentication strategy for the biblios web 
29
# The authentication strategy for the biblios web 
30
# services is as follows.
30
# services is as follows.
(-)a/svc/barcode (-1 / +1 lines)
Lines 89-95 below the scannable barcode. Link Here
89
89
90
=cut
90
=cut
91
91
92
my $input = new CGI;
92
my $input = CGI->new;
93
93
94
my ( $auth_status, $sessionID ) = check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => '*' } );
94
my ( $auth_status, $sessionID ) = check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => '*' } );
95
95
(-)a/svc/bib (-1 / +1 lines)
Lines 27-33 use C4::Biblio; Link Here
27
use C4::Items;
27
use C4::Items;
28
use XML::Simple;
28
use XML::Simple;
29
29
30
my $query = new CGI;
30
my $query = CGI->new;
31
binmode STDOUT, ':encoding(UTF-8)';
31
binmode STDOUT, ':encoding(UTF-8)';
32
32
33
my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} );
33
my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} );
(-)a/svc/bib_framework (-1 / +1 lines)
Lines 26-32 use XML::Simple; Link Here
26
26
27
binmode STDOUT, ':encoding(UTF-8)';
27
binmode STDOUT, ':encoding(UTF-8)';
28
28
29
my $query = new CGI;
29
my $query = CGI->new;
30
my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} );
30
my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} );
31
unless ($status eq 'ok') {
31
unless ($status eq 'ok') {
32
    print $query->header(-type => 'text/xml', -status => '403 Forbidden');
32
    print $query->header(-type => 'text/xml', -status => '403 Forbidden');
(-)a/svc/bib_profile (-1 / +1 lines)
Lines 27-33 use C4::Koha; Link Here
27
use Koha::ItemTypes;
27
use Koha::ItemTypes;
28
use XML::Simple;
28
use XML::Simple;
29
29
30
my $query = new CGI;
30
my $query = CGI->new;
31
31
32
my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} );
32
my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} );
33
33
(-)a/svc/checkin (-1 / +1 lines)
Lines 29-35 use C4::Auth qw(check_cookie_auth); Link Here
29
use Koha::Checkouts;
29
use Koha::Checkouts;
30
use Koha::Items;
30
use Koha::Items;
31
31
32
my $input = new CGI;
32
my $input = CGI->new;
33
33
34
my ( $auth_status, $sessionID ) =
34
my ( $auth_status, $sessionID ) =
35
  check_cookie_auth( $input->cookie('CGISESSID'),
35
  check_cookie_auth( $input->cookie('CGISESSID'),
(-)a/svc/checkout_notes (-1 / +1 lines)
Lines 36-42 svc/checkout_notes - Web service for managing patron notes set on issues Link Here
36
36
37
# AJAX requests
37
# AJAX requests
38
my $is_ajax = is_ajax();
38
my $is_ajax = is_ajax();
39
my $query = new CGI;
39
my $query = CGI->new;
40
my ( $auth_status, $sessionID ) = check_cookie_auth( $query->cookie('CGISESSID'), { circulate => 'manage_checkout_notes' } );
40
my ( $auth_status, $sessionID ) = check_cookie_auth( $query->cookie('CGISESSID'), { circulate => 'manage_checkout_notes' } );
41
if ( $auth_status ne "ok" ) {
41
if ( $auth_status ne "ok" ) {
42
    exit 0;
42
    exit 0;
(-)a/svc/checkouts (-1 / +1 lines)
Lines 31-37 use Koha::AuthorisedValues; Link Here
31
use Koha::DateUtils;
31
use Koha::DateUtils;
32
use Koha::ItemTypes;
32
use Koha::ItemTypes;
33
33
34
my $input = new CGI;
34
my $input = CGI->new;
35
35
36
my ( $auth_status, $sessionID ) =
36
my ( $auth_status, $sessionID ) =
37
  check_cookie_auth( $input->cookie('CGISESSID'));
37
  check_cookie_auth( $input->cookie('CGISESSID'));
(-)a/svc/club/cancel_enrollment (-1 / +1 lines)
Lines 27-33 use C4::Auth qw(check_cookie_auth); Link Here
27
27
28
use Koha::Club::Enrollments;
28
use Koha::Club::Enrollments;
29
29
30
my $cgi = new CGI;
30
my $cgi = CGI->new;
31
31
32
my ( $auth_status, $sessionID ) =
32
my ( $auth_status, $sessionID ) =
33
  check_cookie_auth( $cgi->cookie('CGISESSID'), { clubs => 'enroll' } );
33
  check_cookie_auth( $cgi->cookie('CGISESSID'), { clubs => 'enroll' } );
(-)a/svc/club/delete (-1 / +1 lines)
Lines 26-32 use JSON qw(to_json); Link Here
26
use C4::Auth qw(check_cookie_auth);
26
use C4::Auth qw(check_cookie_auth);
27
use Koha::Clubs;
27
use Koha::Clubs;
28
28
29
my $cgi = new CGI;
29
my $cgi = CGI->new;
30
30
31
my ( $auth_status, $sessionID ) = check_cookie_auth( $cgi->cookie('CGISESSID'), { clubs => 'edit_clubs' } );
31
my ( $auth_status, $sessionID ) = check_cookie_auth( $cgi->cookie('CGISESSID'), { clubs => 'edit_clubs' } );
32
if ( $auth_status ne "ok" ) {
32
if ( $auth_status ne "ok" ) {
(-)a/svc/club/enroll (-1 / +1 lines)
Lines 28-34 use Koha::Club::Enrollment::Fields; Link Here
28
use Koha::Club::Enrollments;
28
use Koha::Club::Enrollments;
29
use Koha::Clubs;
29
use Koha::Clubs;
30
30
31
my $cgi = new CGI;
31
my $cgi = CGI->new;
32
32
33
my ( $auth_status, $sessionID ) =
33
my ( $auth_status, $sessionID ) =
34
  check_cookie_auth( $cgi->cookie('CGISESSID'), { clubs => 'enroll' } );
34
  check_cookie_auth( $cgi->cookie('CGISESSID'), { clubs => 'enroll' } );
(-)a/svc/club/template/delete (-1 / +1 lines)
Lines 27-33 use C4::Auth qw(check_cookie_auth); Link Here
27
27
28
use Koha::Club::Templates;
28
use Koha::Club::Templates;
29
29
30
my $cgi = new CGI;
30
my $cgi = CGI->new;
31
31
32
my ( $auth_status, $sessionID ) = check_cookie_auth( $cgi->cookie('CGISESSID'), { clubs => 'edit_templates' } );
32
my ( $auth_status, $sessionID ) = check_cookie_auth( $cgi->cookie('CGISESSID'), { clubs => 'edit_templates' } );
33
if ( $auth_status ne "ok" ) {
33
if ( $auth_status ne "ok" ) {
(-)a/svc/cover_images (-1 / +1 lines)
Lines 25-31 use C4::Auth qw/check_cookie_auth/; Link Here
25
use C4::Images;
25
use C4::Images;
26
use JSON qw/to_json/;
26
use JSON qw/to_json/;
27
27
28
my $input = new CGI;
28
my $input = CGI->new;
29
29
30
my ( $auth_status, $sessionID ) =
30
my ( $auth_status, $sessionID ) =
31
        check_cookie_auth(
31
        check_cookie_auth(
(-)a/svc/creator_batches (-1 / +1 lines)
Lines 38-44 svc/creator_batches - Web service for managing AJAX functionality for patroncard Link Here
38
38
39
# AJAX requests
39
# AJAX requests
40
my $is_ajax = is_ajax();
40
my $is_ajax = is_ajax();
41
my $cgi = new CGI;
41
my $cgi = CGI->new;
42
my ( $auth_status, $sessionID ) = check_cookie_auth( $cgi->cookie('CGISESSID'), { catalogue => 1 } );
42
my ( $auth_status, $sessionID ) = check_cookie_auth( $cgi->cookie('CGISESSID'), { catalogue => 1 } );
43
if ( $auth_status ne "ok" ) {
43
if ( $auth_status ne "ok" ) {
44
    exit 0;
44
    exit 0;
(-)a/svc/hold/resume (-1 / +1 lines)
Lines 28-34 use C4::Auth qw(check_cookie_auth); Link Here
28
use Koha::DateUtils qw(dt_from_string);
28
use Koha::DateUtils qw(dt_from_string);
29
use Koha::Holds;
29
use Koha::Holds;
30
30
31
my $input = new CGI;
31
my $input = CGI->new;
32
32
33
my ( $auth_status, $sessionID ) =
33
my ( $auth_status, $sessionID ) =
34
  check_cookie_auth( $input->cookie('CGISESSID'), { circulate => 'circulate_remaining_permissions' } );
34
  check_cookie_auth( $input->cookie('CGISESSID'), { circulate => 'circulate_remaining_permissions' } );
(-)a/svc/hold/suspend (-1 / +1 lines)
Lines 28-34 use C4::Auth qw(check_cookie_auth); Link Here
28
use Koha::DateUtils qw(dt_from_string);
28
use Koha::DateUtils qw(dt_from_string);
29
use Koha::Holds;
29
use Koha::Holds;
30
30
31
my $input = new CGI;
31
my $input = CGI->new;
32
32
33
my ( $auth_status, $sessionID ) =
33
my ( $auth_status, $sessionID ) =
34
  check_cookie_auth( $input->cookie('CGISESSID'), { circulate => 'circulate_remaining_permissions' } );
34
  check_cookie_auth( $input->cookie('CGISESSID'), { circulate => 'circulate_remaining_permissions' } );
(-)a/svc/holds (-1 / +1 lines)
Lines 32-38 use Koha::Holds; Link Here
32
use Koha::ItemTypes;
32
use Koha::ItemTypes;
33
use Koha::Libraries;
33
use Koha::Libraries;
34
34
35
my $input = new CGI;
35
my $input = CGI->new;
36
36
37
my ( $auth_status, $sessionID ) =
37
my ( $auth_status, $sessionID ) =
38
  check_cookie_auth( $input->cookie('CGISESSID'),
38
  check_cookie_auth( $input->cookie('CGISESSID'),
(-)a/svc/import_bib (-1 / +1 lines)
Lines 28-34 use C4::Matcher; Link Here
28
use XML::Simple;
28
use XML::Simple;
29
# use Carp::Always;
29
# use Carp::Always;
30
30
31
my $query = new CGI;
31
my $query = CGI->new;
32
binmode STDOUT, ':encoding(UTF-8)';
32
binmode STDOUT, ':encoding(UTF-8)';
33
33
34
my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} );
34
my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} );
(-)a/svc/letters/preview (-1 / +1 lines)
Lines 28-34 use Koha::Checkouts; Link Here
28
use Koha::Items;
28
use Koha::Items;
29
use Koha::Patrons;
29
use Koha::Patrons;
30
30
31
my $input = new CGI;
31
my $input = CGI->new;
32
32
33
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
33
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
34
    {
34
    {
(-)a/svc/mana/increment (-1 / +1 lines)
Lines 27-33 use CGI; Link Here
27
use JSON;
27
use JSON;
28
28
29
29
30
my $input = new CGI;
30
my $input = CGI->new;
31
binmode STDOUT, ":encoding(UTF-8)";
31
binmode STDOUT, ":encoding(UTF-8)";
32
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
32
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
33
33
(-)a/svc/mana/search (-2 / +2 lines)
Lines 27-33 use C4::Output qw( output_html_with_http_headers ); Link Here
27
27
28
use CGI;
28
use CGI;
29
29
30
my $input = new CGI;
30
my $input = CGI->new;
31
31
32
my ( $auth_status, $sessionID ) =
32
my ( $auth_status, $sessionID ) =
33
  check_cookie_auth( $input->cookie('CGISESSID'),
33
  check_cookie_auth( $input->cookie('CGISESSID'),
Lines 78-81 $template->param( $input->param('resource')."s" => $result->{data} ); Link Here
78
$template->param( statuscode => $result->{code} );
78
$template->param( statuscode => $result->{code} );
79
$template->param( msg => $result->{msg} );
79
$template->param( msg => $result->{msg} );
80
80
81
output_html_with_http_headers $input, $cookie, $template->output;
81
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/svc/mana/share (-1 / +1 lines)
Lines 26-32 use C4::Auth qw(check_cookie_auth); Link Here
26
use CGI;
26
use CGI;
27
use JSON;
27
use JSON;
28
28
29
my $input = new CGI;
29
my $input = CGI->new;
30
binmode STDOUT, ":encoding(UTF-8)";
30
binmode STDOUT, ":encoding(UTF-8)";
31
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
31
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
32
32
(-)a/svc/mana/use (-1 / +1 lines)
Lines 28-34 use CGI; Link Here
28
use JSON;
28
use JSON;
29
29
30
30
31
my $input = new CGI;
31
my $input = CGI->new;
32
binmode STDOUT, ":encoding(UTF-8)";
32
binmode STDOUT, ":encoding(UTF-8)";
33
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
33
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
34
34
(-)a/svc/members/add_to_list (-1 / +1 lines)
Lines 24-30 use C4::Auth qw( check_cookie_auth ); Link Here
24
use JSON qw( to_json );
24
use JSON qw( to_json );
25
use Koha::List::Patron;
25
use Koha::List::Patron;
26
26
27
my $input = new CGI;
27
my $input = CGI->new;
28
28
29
my ( $auth_status, $sessionID ) = check_cookie_auth(
29
my ( $auth_status, $sessionID ) = check_cookie_auth(
30
    $input->cookie('CGISESSID'),
30
    $input->cookie('CGISESSID'),
(-)a/svc/members/search (-1 / +1 lines)
Lines 27-33 use C4::Utils::DataTables::Members qw( search ); Link Here
27
use Koha::DateUtils qw( output_pref dt_from_string );
27
use Koha::DateUtils qw( output_pref dt_from_string );
28
use Koha::Patrons;
28
use Koha::Patrons;
29
29
30
my $input = new CGI;
30
my $input = CGI->new;
31
31
32
exit unless $input->param('template_path');
32
exit unless $input->param('template_path');
33
33
(-)a/svc/new_bib (-1 / +1 lines)
Lines 27-33 use C4::Items; Link Here
27
use XML::Simple;
27
use XML::Simple;
28
use C4::Charset;
28
use C4::Charset;
29
29
30
my $query = new CGI;
30
my $query = CGI->new;
31
binmode STDOUT, ':encoding(UTF-8)';
31
binmode STDOUT, ':encoding(UTF-8)';
32
32
33
my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} );
33
my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} );
(-)a/svc/problem_reports (-1 / +1 lines)
Lines 36-42 svc/problem_reports - Web service for managing OPAC problem reports Link Here
36
36
37
# AJAX requests
37
# AJAX requests
38
my $is_ajax = is_ajax();
38
my $is_ajax = is_ajax();
39
my $query = new CGI;
39
my $query = CGI->new;
40
my ( $auth_status, $sessionID ) = check_cookie_auth( $query->cookie('CGISESSID'), { problem_reports => 1 } );
40
my ( $auth_status, $sessionID ) = check_cookie_auth( $query->cookie('CGISESSID'), { problem_reports => 1 } );
41
if ( $auth_status ne "ok" ) {
41
if ( $auth_status ne "ok" ) {
42
    exit 0;
42
    exit 0;
(-)a/svc/renew (-1 / +1 lines)
Lines 28-34 use C4::Auth qw(check_cookie_auth); Link Here
28
28
29
use Koha::DateUtils qw(output_pref dt_from_string);
29
use Koha::DateUtils qw(output_pref dt_from_string);
30
30
31
my $input = new CGI;
31
my $input = CGI->new;
32
32
33
my ( $auth_status, $sessionID ) =
33
my ( $auth_status, $sessionID ) =
34
  check_cookie_auth( $input->cookie('CGISESSID'),
34
  check_cookie_auth( $input->cookie('CGISESSID'),
(-)a/svc/return_claims (-1 / +1 lines)
Lines 29-35 use Koha::AuthorisedValues; Link Here
29
use Koha::DateUtils;
29
use Koha::DateUtils;
30
use Koha::Patrons;
30
use Koha::Patrons;
31
31
32
my $input = new CGI;
32
my $input = CGI->new;
33
33
34
my ( $auth_status, $sessionID ) =
34
my ( $auth_status, $sessionID ) =
35
  check_cookie_auth( $input->cookie('CGISESSID') );
35
  check_cookie_auth( $input->cookie('CGISESSID') );
(-)a/svc/virtualshelves/search (-1 / +1 lines)
Lines 8-14 use C4::Output qw( output_with_http_headers ); Link Here
8
use C4::Utils::DataTables qw( dt_get_params );
8
use C4::Utils::DataTables qw( dt_get_params );
9
use C4::Utils::DataTables::VirtualShelves qw( search );
9
use C4::Utils::DataTables::VirtualShelves qw( search );
10
10
11
my $input = new CGI;
11
my $input = CGI->new;
12
12
13
exit unless $input->param('template_path');
13
exit unless $input->param('template_path');
14
14
(-)a/t/Auth_with_shibboleth.t (-2 / +2 lines)
Lines 63-69 $ENV{'city'} = undef; Link Here
63
63
64
# Setup Mocks
64
# Setup Mocks
65
## Mock Context
65
## Mock Context
66
my $context = new Test::MockModule('C4::Context');
66
my $context = Test::MockModule->new('C4::Context');
67
67
68
### Mock ->config
68
### Mock ->config
69
$context->mock( 'config', \&mockedConfig );
69
$context->mock( 'config', \&mockedConfig );
Lines 81-87 my $interface = 'opac'; Link Here
81
$context->mock( 'interface', \&mockedInterface );
81
$context->mock( 'interface', \&mockedInterface );
82
82
83
## Mock Database
83
## Mock Database
84
my $database = new Test::MockModule('Koha::Database');
84
my $database = Test::MockModule->new('Koha::Database');
85
85
86
### Mock ->schema
86
### Mock ->schema
87
$database->mock( 'schema', \&mockedSchema );
87
$database->mock( 'schema', \&mockedSchema );
(-)a/t/Calendar.t (-1 / +1 lines)
Lines 49-55 $db->mock( Link Here
49
# We need to mock the C4::Context->preference method for
49
# We need to mock the C4::Context->preference method for
50
# simplicity and re-usability of the session definition. Any
50
# simplicity and re-usability of the session definition. Any
51
# syspref fits for syspref-agnostic tests.
51
# syspref fits for syspref-agnostic tests.
52
my $module_context = new Test::MockModule('C4::Context');
52
my $module_context = Test::MockModule->new('C4::Context');
53
$module_context->mock(
53
$module_context->mock(
54
    'preference',
54
    'preference',
55
    sub {
55
    sub {
(-)a/t/Context.t (-1 / +1 lines)
Lines 63-69 subtest 'needs_install() tests' => sub { Link Here
63
    is( C4::Context->needs_install, 1, "->preference(Version) is not defined, need to install" );
63
    is( C4::Context->needs_install, 1, "->preference(Version) is not defined, need to install" );
64
};
64
};
65
65
66
my $context = new Test::MockModule('C4::Context');
66
my $context = Test::MockModule->new('C4::Context');
67
my $userenv = {};
67
my $userenv = {};
68
68
69
$context->mock('userenv', sub {
69
$context->mock('userenv', sub {
(-)a/t/DateUtils.t (-1 / +1 lines)
Lines 188-194 cmp_ok $date_string, 'eq', '12/11/2013 06:35 PM', 'as_due_date with hours and ti Link Here
188
my $now = DateTime->now;
188
my $now = DateTime->now;
189
is( dt_from_string, $now, "Without parameter, dt_from_string should return today" );
189
is( dt_from_string, $now, "Without parameter, dt_from_string should return today" );
190
190
191
my $module_context = new Test::MockModule('C4::Context');
191
my $module_context = Test::MockModule->new('C4::Context');
192
$module_context->mock(
192
$module_context->mock(
193
    'tz',
193
    'tz',
194
    sub {
194
    sub {
(-)a/t/Koha_MetadataRecord.t (-4 / +4 lines)
Lines 94-106 subtest "new() tests" => sub { Link Here
94
    my $record = MARC::Record->new();
94
    my $record = MARC::Record->new();
95
    my $metadata_record;
95
    my $metadata_record;
96
96
97
    warning_is { $metadata_record = new Koha::MetadataRecord({
97
    warning_is { $metadata_record = Koha::MetadataRecord->new({
98
                        record => $record }) }
98
                        record => $record }) }
99
               { carped => 'No schema passed' },
99
               { carped => 'No schema passed' },
100
        "Metadata schema is mandatory, raise a carped warning if omitted";
100
        "Metadata schema is mandatory, raise a carped warning if omitted";
101
    is( $metadata_record, undef, "Metadata schema is mandatory, return undef if omitted");
101
    is( $metadata_record, undef, "Metadata schema is mandatory, return undef if omitted");
102
102
103
    $metadata_record = new Koha::MetadataRecord({
103
    $metadata_record = Koha::MetadataRecord->new({
104
        record => $record,
104
        record => $record,
105
        schema => 'marc21'
105
        schema => 'marc21'
106
    });
106
    });
Lines 115-121 subtest "new() tests" => sub { Link Here
115
    my $weird_record = {};
115
    my $weird_record = {};
116
    bless $weird_record, 'Weird::Class';
116
    bless $weird_record, 'Weird::Class';
117
117
118
    $metadata_record = new Koha::MetadataRecord({
118
    $metadata_record = Koha::MetadataRecord->new({
119
        record => $weird_record,
119
        record => $weird_record,
120
        schema => 'something',
120
        schema => 'something',
121
        format => 'else',
121
        format => 'else',
Lines 129-135 subtest "new() tests" => sub { Link Here
129
    is( $metadata_record->id, 'an id', 'The id correctly set');
129
    is( $metadata_record->id, 'an id', 'The id correctly set');
130
130
131
    # Having a record object is mandatory
131
    # Having a record object is mandatory
132
    warning_is { $metadata_record = new Koha::MetadataRecord({
132
    warning_is { $metadata_record = Koha::MetadataRecord->new({
133
                                        record => undef,
133
                                        record => undef,
134
                                        schema => 'something',
134
                                        schema => 'something',
135
                                        format => 'else',
135
                                        format => 'else',
(-)a/t/Koha_Template_Plugin_Koha.t (-2 / +2 lines)
Lines 38-49 subtest "Koha::Template::Plugin::Koha::Version tests" => sub { Link Here
38
    my $development;
38
    my $development;
39
39
40
    # Mock Koha::version()
40
    # Mock Koha::version()
41
    my $koha = new Test::MockModule('Koha');
41
    my $koha = Test::MockModule->new('Koha');
42
    $koha->mock( 'version', sub {
42
    $koha->mock( 'version', sub {
43
        return "$major.$minor.$maintenance.$development";
43
        return "$major.$minor.$maintenance.$development";
44
    });
44
    });
45
45
46
    my $rnd = new String::Random;
46
    my $rnd = String::Random->new;
47
    # development version test
47
    # development version test
48
    $major       = $rnd->randregex('\d');
48
    $major       = $rnd->randregex('\d');
49
    $minor       = $rnd->randregex('\d\d');
49
    $minor       = $rnd->randregex('\d\d');
(-)a/t/Languages.t (-1 / +1 lines)
Lines 31-37 my @languages = (); # stores the list of active languages Link Here
31
                    # for the syspref mock
31
                    # for the syspref mock
32
my $return_undef = 0;
32
my $return_undef = 0;
33
33
34
my $module_context = new Test::MockModule('C4::Context');
34
my $module_context = Test::MockModule->new('C4::Context');
35
35
36
$module_context->mock(
36
$module_context->mock(
37
    preference => sub {
37
    preference => sub {
(-)a/t/Output_JSONStream.t (-1 / +1 lines)
Lines 12-18 BEGIN { Link Here
12
        use_ok('C4::Output::JSONStream');
12
        use_ok('C4::Output::JSONStream');
13
}
13
}
14
14
15
my $json = new C4::Output::JSONStream;
15
my $json = C4::Output::JSONStream->new;
16
is($json->output,'{}',"Making sure JSON output is blank just after its created.");
16
is($json->output,'{}',"Making sure JSON output is blank just after its created.");
17
$json->param( issues => [ 'yes!', 'please', 'no' ] );
17
$json->param( issues => [ 'yes!', 'please', 'no' ] );
18
is($json->output,'{"issues":["yes!","please","no"]}',"Making sure JSON output has added what we told it to.");
18
is($json->output,'{"issues":["yes!","please","no"]}',"Making sure JSON output has added what we told it to.");
(-)a/t/Search/History.t (-1 / +1 lines)
Lines 23-29 my $expected_recent_searches = [ Link Here
23
# Create new session and put its id into CGISESSID cookie
23
# Create new session and put its id into CGISESSID cookie
24
my $session = C4::Auth::get_session("");
24
my $session = C4::Auth::get_session("");
25
$session->flush;
25
$session->flush;
26
my $input = new CookieSimulator({CGISESSID => $session->id});
26
my $input = CookieSimulator->new({CGISESSID => $session->id});
27
27
28
my @recent_searches = C4::Search::History::get_from_session({ cgi => $input });
28
my @recent_searches = C4::Search::History::get_from_session({ cgi => $input });
29
is_deeply(\@recent_searches, [], 'at start, there is no recent searches');
29
is_deeply(\@recent_searches, [], 'at start, there is no recent searches');
(-)a/t/SuggestionEngine_AuthorityFile.t (-1 / +1 lines)
Lines 45-51 $db->mock( _new_schema => sub { return Schema(); } ); Link Here
45
45
46
use_ok('Koha::SuggestionEngine');
46
use_ok('Koha::SuggestionEngine');
47
47
48
my $module = new Test::MockModule('C4::AuthoritiesMarc');
48
my $module = Test::MockModule->new('C4::AuthoritiesMarc');
49
$module->mock('SearchAuthorities', sub {
49
$module->mock('SearchAuthorities', sub {
50
        return [ { 'authid' => '1234',
50
        return [ { 'authid' => '1234',
51
                    'reported_tag' => undef,
51
                    'reported_tag' => undef,
(-)a/t/db_dependent/00-strict.t (-1 / +1 lines)
Lines 47-53 if ( $ENV{KOHA_PROVE_CPUS} ) { Link Here
47
print "Using $ncpu CPUs...\n"
47
print "Using $ncpu CPUs...\n"
48
    if $ENV{DEBUG};
48
    if $ENV{DEBUG};
49
49
50
my $pm   = new Parallel::ForkManager($ncpu);
50
my $pm   = Parallel::ForkManager->new($ncpu);
51
51
52
foreach my $d (@dirs) {
52
foreach my $d (@dirs) {
53
    $pm->start and next;    # do the fork
53
    $pm->start and next;    # do the fork
(-)a/t/db_dependent/Accounts.t (-2 / +2 lines)
Lines 62-68 $dbh->do(q|DELETE FROM borrowers|); Link Here
62
62
63
my $branchcode = $library->{branchcode};
63
my $branchcode = $library->{branchcode};
64
64
65
my $context = new Test::MockModule('C4::Context');
65
my $context = Test::MockModule->new('C4::Context');
66
$context->mock( 'userenv', sub {
66
$context->mock( 'userenv', sub {
67
    return {
67
    return {
68
        flags  => 1,
68
        flags  => 1,
Lines 1151-1157 subtest "Payment notice tests" => sub { Link Here
1151
    )->store();
1151
    )->store();
1152
1152
1153
    my $manager = $builder->build_object({ class => "Koha::Patrons" });
1153
    my $manager = $builder->build_object({ class => "Koha::Patrons" });
1154
    my $context = new Test::MockModule('C4::Context');
1154
    my $context = Test::MockModule->new('C4::Context');
1155
    $context->mock( 'userenv', sub {
1155
    $context->mock( 'userenv', sub {
1156
        return {
1156
        return {
1157
            number     => $manager->borrowernumber,
1157
            number     => $manager->borrowernumber,
(-)a/t/db_dependent/Acquisition.t (-1 / +1 lines)
Lines 580-586 ok($active_count >= scalar GetBudgetsReport(1), "GetBudgetReport doesn't return Link Here
580
580
581
# "Flavoured" tests (tests that required a run for each marc flavour)
581
# "Flavoured" tests (tests that required a run for each marc flavour)
582
# Tests should be added to the run_flavoured_tests sub below
582
# Tests should be added to the run_flavoured_tests sub below
583
my $biblio_module = new Test::MockModule('C4::Biblio');
583
my $biblio_module = Test::MockModule->new('C4::Biblio');
584
$biblio_module->mock(
584
$biblio_module->mock(
585
    'GetMarcSubfieldStructure',
585
    'GetMarcSubfieldStructure',
586
    sub {
586
    sub {
(-)a/t/db_dependent/Auth.t (-2 / +2 lines)
Lines 201-207 subtest 'checkpw lockout tests' => sub { Link Here
201
    }
201
    }
202
202
203
    # Mock checkauth, build the scenario
203
    # Mock checkauth, build the scenario
204
    my $auth = new Test::MockModule( 'C4::Auth' );
204
    my $auth = Test::MockModule->new( 'C4::Auth' );
205
    $auth->mock( 'checkauth', \&MockedCheckauth );
205
    $auth->mock( 'checkauth', \&MockedCheckauth );
206
206
207
    # Make sure 'EnableOpacSearchHistory' is set
207
    # Make sure 'EnableOpacSearchHistory' is set
Lines 214-220 subtest 'checkpw lockout tests' => sub { Link Here
214
    $ENV{"SERVER_PORT"} = 80;
214
    $ENV{"SERVER_PORT"} = 80;
215
    $ENV{"HTTP_COOKIE"} = 'CGISESSID=nirvana';
215
    $ENV{"HTTP_COOKIE"} = 'CGISESSID=nirvana';
216
216
217
    my $query = new CGI;
217
    my $query = CGI->new;
218
    $query->param('language','es-ES');
218
    $query->param('language','es-ES');
219
219
220
    my ( $template, $loggedinuser, $cookies ) = get_template_and_user(
220
    my ( $template, $loggedinuser, $cookies ) = get_template_and_user(
(-)a/t/db_dependent/Auth_with_cas.t (-1 / +1 lines)
Lines 49-55 my $query_string = 'ticket=foo&bar=baz'; Link Here
49
$ENV{QUERY_STRING} = $query_string;
49
$ENV{QUERY_STRING} = $query_string;
50
$ENV{SCRIPT_NAME} = '/cgi-bin/koha/opac-user.pl';
50
$ENV{SCRIPT_NAME} = '/cgi-bin/koha/opac-user.pl';
51
51
52
my $cgi = new CGI($query_string);
52
my $cgi = CGI->new($query_string);
53
$cgi->delete('ticket');
53
$cgi->delete('ticket');
54
54
55
# _url_with_get_params tests
55
# _url_with_get_params tests
(-)a/t/db_dependent/AuthoritiesMarc.t (-1 / +1 lines)
Lines 21-27 BEGIN { Link Here
21
21
22
# We are now going to be testing the authorities hierarchy code, and
22
# We are now going to be testing the authorities hierarchy code, and
23
# therefore need to pretend that we have consistent data in our database
23
# therefore need to pretend that we have consistent data in our database
24
my $module = new Test::MockModule('C4::AuthoritiesMarc');
24
my $module = Test::MockModule->new('C4::AuthoritiesMarc');
25
$module->mock('GetHeaderAuthority', sub {
25
$module->mock('GetHeaderAuthority', sub {
26
    return {'authtrees' => ''};
26
    return {'authtrees' => ''};
27
});
27
});
(-)a/t/db_dependent/BackgroundJob.t (-1 / +1 lines)
Lines 10-16 use Koha::Database; Link Here
10
BEGIN {
10
BEGIN {
11
    use_ok('C4::BackgroundJob');
11
    use_ok('C4::BackgroundJob');
12
}
12
}
13
my $query = new CGI;
13
my $query = CGI->new;
14
14
15
my $schema = Koha::Database->new->schema;
15
my $schema = Koha::Database->new->schema;
16
$schema->storage->txn_begin;
16
$schema->storage->txn_begin;
(-)a/t/db_dependent/Biblio.t (-2 / +2 lines)
Lines 153-159 subtest "Authority creation with default linker" => sub { Link Here
153
153
154
154
155
# Mocking variables
155
# Mocking variables
156
my $biblio_module = new Test::MockModule('C4::Biblio');
156
my $biblio_module = Test::MockModule->new('C4::Biblio');
157
$biblio_module->mock(
157
$biblio_module->mock(
158
    'GetMarcSubfieldStructure',
158
    'GetMarcSubfieldStructure',
159
    sub {
159
    sub {
Lines 185-191 $biblio_module->mock( Link Here
185
      }
185
      }
186
);
186
);
187
187
188
my $currency = new Test::MockModule('Koha::Acquisition::Currencies');
188
my $currency = Test::MockModule->new('Koha::Acquisition::Currencies');
189
$currency->mock(
189
$currency->mock(
190
    'get_active',
190
    'get_active',
191
    sub {
191
    sub {
(-)a/t/db_dependent/Circulation.t (-1 / +1 lines)
Lines 3313-3319 subtest 'Incremented fee tests' => sub { Link Here
3313
    my $library =
3313
    my $library =
3314
      $builder->build_object( { class => 'Koha::Libraries' } )->store;
3314
      $builder->build_object( { class => 'Koha::Libraries' } )->store;
3315
3315
3316
    my $module = new Test::MockModule('C4::Context');
3316
    my $module = Test::MockModule->new('C4::Context');
3317
    $module->mock( 'userenv', sub { { branch => $library->id } } );
3317
    $module->mock( 'userenv', sub { { branch => $library->id } } );
3318
3318
3319
    my $patron = $builder->build_object(
3319
    my $patron = $builder->build_object(
(-)a/t/db_dependent/Circulation/CheckIfIssuedToPatron.t (-1 / +1 lines)
Lines 72-78 my $borrowernumber2 = Koha::Patron->new({categorycode => $categorycode, branchco Link Here
72
my $borrower1 = Koha::Patrons->find( $borrowernumber1 )->unblessed;
72
my $borrower1 = Koha::Patrons->find( $borrowernumber1 )->unblessed;
73
my $borrower2 = Koha::Patrons->find( $borrowernumber2 )->unblessed;
73
my $borrower2 = Koha::Patrons->find( $borrowernumber2 )->unblessed;
74
74
75
my $module = new Test::MockModule('C4::Context');
75
my $module = Test::MockModule->new('C4::Context');
76
$module->mock('userenv', sub { { branch => $branchcode } });
76
$module->mock('userenv', sub { { branch => $branchcode } });
77
77
78
78
(-)a/t/db_dependent/Circulation/GetPendingOnSiteCheckouts.t (-1 / +1 lines)
Lines 66-72 my $borrowernumber = $builder->build( Link Here
66
my $borrower = Koha::Patrons->find( $borrowernumber )->unblessed;
66
my $borrower = Koha::Patrons->find( $borrowernumber )->unblessed;
67
67
68
# Need to mock userenv for AddIssue
68
# Need to mock userenv for AddIssue
69
my $module = new Test::MockModule('C4::Context');
69
my $module = Test::MockModule->new('C4::Context');
70
$module->mock('userenv', sub { { branch => $branchcode } });
70
$module->mock('userenv', sub { { branch => $branchcode } });
71
AddIssue($borrower, '0101');
71
AddIssue($borrower, '0101');
72
AddIssue($borrower, '0203');
72
AddIssue($borrower, '0203');
(-)a/t/db_dependent/Creators/Lib.t (-1 / +1 lines)
Lines 1456-1462 subtest '_add_backtics' => sub { Link Here
1456
my %preferences;
1456
my %preferences;
1457
1457
1458
sub mock_preference {
1458
sub mock_preference {
1459
    my $context = new Test::MockModule('C4::Context');
1459
    my $context = Test::MockModule->new('C4::Context');
1460
    my ( $pref, $value ) = @_;
1460
    my ( $pref, $value ) = @_;
1461
    $preferences{$pref} = $value;
1461
    $preferences{$pref} = $value;
1462
    $context->mock(
1462
    $context->mock(
(-)a/t/db_dependent/FrameworkPlugin.t (-4 / +4 lines)
Lines 120-133 sub test05 { Link Here
120
    my ( $incl ) = @_;
120
    my ( $incl ) = @_;
121
    #mock to simulate some authorization and eliminate lots of output
121
    #mock to simulate some authorization and eliminate lots of output
122
    my $launched = 0;
122
    my $launched = 0;
123
    my $mContext = new Test::MockModule('C4::Context');
123
    my $mContext = Test::MockModule->new('C4::Context');
124
    my $mAuth = new Test::MockModule('C4::Auth');
124
    my $mAuth = Test::MockModule->new('C4::Auth');
125
    my $mOutput = new Test::MockModule('C4::Output');
125
    my $mOutput = Test::MockModule->new('C4::Output');
126
    $mContext->mock( 'userenv', \&mock_userenv );
126
    $mContext->mock( 'userenv', \&mock_userenv );
127
    $mAuth->mock( 'checkauth', sub { return ( 1, undef, 1, all_perms() ); } );
127
    $mAuth->mock( 'checkauth', sub { return ( 1, undef, 1, all_perms() ); } );
128
    $mOutput->mock('output_html_with_http_headers',  sub { ++$launched; } );
128
    $mOutput->mock('output_html_with_http_headers',  sub { ++$launched; } );
129
129
130
    my $cgi=new CGI;
130
    my $cgi=CGI->new;
131
    my ( $plugins, $min ) = selected_plugins( $incl );
131
    my ( $plugins, $min ) = selected_plugins( $incl );
132
132
133
    # test building them
133
    # test building them
(-)a/t/db_dependent/ILSDI_Services.t (-12 / +12 lines)
Lines 60-66 subtest 'AuthenticatePatron test' => sub { Link Here
60
        }
60
        }
61
    });
61
    });
62
62
63
    my $query = new CGI;
63
    my $query = CGI->new;
64
    $query->param( 'username', $borrower->{userid});
64
    $query->param( 'username', $borrower->{userid});
65
    $query->param( 'password', $plain_password);
65
    $query->param( 'password', $plain_password);
66
66
Lines 207-213 subtest 'GetPatronInfo/GetBorrowerAttributes test for extended patron attributes Link Here
207
    );
207
    );
208
208
209
    # Prepare and send web request for IL-SDI server:
209
    # Prepare and send web request for IL-SDI server:
210
    my $query = new CGI;
210
    my $query = CGI->new;
211
    $query->param( 'service', 'GetPatronInfo' );
211
    $query->param( 'service', 'GetPatronInfo' );
212
    $query->param( 'patron_id', $brwr->{'borrowernumber'} );
212
    $query->param( 'patron_id', $brwr->{'borrowernumber'} );
213
    $query->param( 'show_attributes', '1' );
213
    $query->param( 'show_attributes', '1' );
Lines 316-322 subtest 'Holds test' => sub { Link Here
316
        }
316
        }
317
    );
317
    );
318
318
319
    my $query = new CGI;
319
    my $query = CGI->new;
320
    $query->param( 'patron_id', $patron->{borrowernumber});
320
    $query->param( 'patron_id', $patron->{borrowernumber});
321
    $query->param( 'bib_id', $item->biblionumber);
321
    $query->param( 'bib_id', $item->biblionumber);
322
322
Lines 339-345 subtest 'Holds test' => sub { Link Here
339
339
340
    my $biblio_with_no_item = $builder->build_sample_biblio;
340
    my $biblio_with_no_item = $builder->build_sample_biblio;
341
341
342
    $query = new CGI;
342
    $query = CGI->new;
343
    $query->param( 'patron_id', $patron->{borrowernumber});
343
    $query->param( 'patron_id', $patron->{borrowernumber});
344
    $query->param( 'bib_id', $biblio_with_no_item->biblionumber);
344
    $query->param( 'bib_id', $biblio_with_no_item->biblionumber);
345
345
Lines 363-369 subtest 'Holds test' => sub { Link Here
363
        }
363
        }
364
    );
364
    );
365
365
366
    $query = new CGI;
366
    $query = CGI->new;
367
    $query->param( 'patron_id', $patron->{borrowernumber});
367
    $query->param( 'patron_id', $patron->{borrowernumber});
368
    $query->param( 'bib_id', $item2->biblionumber);
368
    $query->param( 'bib_id', $item2->biblionumber);
369
    $query->param( 'item_id', $item2->itemnumber);
369
    $query->param( 'item_id', $item2->itemnumber);
Lines 395-401 subtest 'Holds test' => sub { Link Here
395
        }
395
        }
396
    );
396
    );
397
397
398
    $query = new CGI;
398
    $query = CGI->new;
399
    $query->param( 'patron_id', $patron->{borrowernumber});
399
    $query->param( 'patron_id', $patron->{borrowernumber});
400
    $query->param( 'bib_id', $item3->biblionumber);
400
    $query->param( 'bib_id', $item3->biblionumber);
401
    $query->param( 'item_id', $item4->itemnumber);
401
    $query->param( 'item_id', $item4->itemnumber);
Lines 459-465 subtest 'Holds test for branch transfer limits' => sub { Link Here
459
        itemtype => $item->effective_itemtype,
459
        itemtype => $item->effective_itemtype,
460
    })->store();
460
    })->store();
461
461
462
    my $query = new CGI;
462
    my $query = CGI->new;
463
    $query->param( 'pickup_location', $pickup_branch->{branchcode} );
463
    $query->param( 'pickup_location', $pickup_branch->{branchcode} );
464
    $query->param( 'patron_id', $patron->{borrowernumber});
464
    $query->param( 'patron_id', $patron->{borrowernumber});
465
    $query->param( 'bib_id', $item->biblionumber);
465
    $query->param( 'bib_id', $item->biblionumber);
Lines 519-525 subtest 'Holds test with start_date and end_date' => sub { Link Here
519
        }
519
        }
520
    );
520
    );
521
521
522
    my $query = new CGI;
522
    my $query = CGI->new;
523
    $query->param( 'pickup_location', $pickup_library->branchcode );
523
    $query->param( 'pickup_location', $pickup_library->branchcode );
524
    $query->param( 'patron_id', $patron->borrowernumber);
524
    $query->param( 'patron_id', $patron->borrowernumber);
525
    $query->param( 'bib_id', $item->biblionumber);
525
    $query->param( 'bib_id', $item->biblionumber);
Lines 569-575 subtest 'GetRecords' => sub { Link Here
569
569
570
    ModItemTransfer($item->itemnumber, $branch1->{branchcode}, $branch2->{branchcode});
570
    ModItemTransfer($item->itemnumber, $branch1->{branchcode}, $branch2->{branchcode});
571
571
572
    my $cgi = new CGI;
572
    my $cgi = CGI->new;
573
    $cgi->param(service => 'GetRecords');
573
    $cgi->param(service => 'GetRecords');
574
    $cgi->param(id => $item->biblionumber);
574
    $cgi->param(id => $item->biblionumber);
575
575
Lines 592-598 subtest 'RenewHold' => sub { Link Here
592
592
593
    $schema->storage->txn_begin;
593
    $schema->storage->txn_begin;
594
594
595
    my $cgi    = new CGI;
595
    my $cgi    = CGI->new;
596
    my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
596
    my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
597
    my $item   = $builder->build_sample_item;
597
    my $item   = $builder->build_sample_item;
598
    $cgi->param( patron_id => $patron->borrowernumber );
598
    $cgi->param( patron_id => $patron->borrowernumber );
Lines 640-646 subtest 'GetPatronInfo paginated loans' => sub { Link Here
640
            branchcode => $library->branchcode,
640
            branchcode => $library->branchcode,
641
        },
641
        },
642
    });
642
    });
643
    my $module = new Test::MockModule('C4::Context');
643
    my $module = Test::MockModule->new('C4::Context');
644
    $module->mock('userenv', sub { { branch => $library->branchcode } });
644
    $module->mock('userenv', sub { { branch => $library->branchcode } });
645
    my $date_due = DateTime->now->add(weeks => 2);
645
    my $date_due = DateTime->now->add(weeks => 2);
646
    my $issue1 = C4::Circulation::AddIssue($patron->unblessed, $item1->barcode, $date_due);
646
    my $issue1 = C4::Circulation::AddIssue($patron->unblessed, $item1->barcode, $date_due);
Lines 650-656 subtest 'GetPatronInfo paginated loans' => sub { Link Here
650
    my $issue3 = C4::Circulation::AddIssue($patron->unblessed, $item3->barcode, $date_due);
650
    my $issue3 = C4::Circulation::AddIssue($patron->unblessed, $item3->barcode, $date_due);
651
    my $date_due3 = Koha::DateUtils::dt_from_string( $issue3->date_due );
651
    my $date_due3 = Koha::DateUtils::dt_from_string( $issue3->date_due );
652
652
653
    my $cgi = new CGI;
653
    my $cgi = CGI->new;
654
654
655
    $cgi->param( 'service', 'GetPatronInfo' );
655
    $cgi->param( 'service', 'GetPatronInfo' );
656
    $cgi->param( 'patron_id', $patron->borrowernumber );
656
    $cgi->param( 'patron_id', $patron->borrowernumber );
(-)a/t/db_dependent/Items.t (-4 / +4 lines)
Lines 541-549 subtest 'SearchItems test' => sub { Link Here
541
    $cache->clear_from_cache("default_value_for_mod_marc-");
541
    $cache->clear_from_cache("default_value_for_mod_marc-");
542
    $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
542
    $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
543
543
544
    my $item3_record = new MARC::Record;
544
    my $item3_record = MARC::Record->new;
545
    $item3_record->append_fields(
545
    $item3_record->append_fields(
546
        new MARC::Field(
546
        MARC::Field->new(
547
            $itemfield, '', '',
547
            $itemfield, '', '',
548
            'z' => 'foobar',
548
            'z' => 'foobar',
549
            'y' => $itemtype->{itemtype}
549
            'y' => $itemtype->{itemtype}
Lines 966-972 subtest 'ModItemFromMarc' => sub { Link Here
966
    my $itemtype = $builder->build_object({ class => 'Koha::ItemTypes' });
966
    my $itemtype = $builder->build_object({ class => 'Koha::ItemTypes' });
967
    my $biblio = $builder->build_sample_biblio;
967
    my $biblio = $builder->build_sample_biblio;
968
    my ( $lost_tag, $lost_sf ) = GetMarcFromKohaField( 'items.itemlost' );
968
    my ( $lost_tag, $lost_sf ) = GetMarcFromKohaField( 'items.itemlost' );
969
    my $item_record = new MARC::Record;
969
    my $item_record = MARC::Record->new;
970
    $item_record->append_fields(
970
    $item_record->append_fields(
971
        MARC::Field->new(
971
        MARC::Field->new(
972
            $itemfield, '', '',
972
            $itemfield, '', '',
Lines 985-991 subtest 'ModItemFromMarc' => sub { Link Here
985
985
986
    $item->new_status("this is something")->store;
986
    $item->new_status("this is something")->store;
987
987
988
    my $updated_item_record = new MARC::Record;
988
    my $updated_item_record = MARC::Record->new;
989
    $updated_item_record->append_fields(
989
    $updated_item_record->append_fields(
990
        MARC::Field->new(
990
        MARC::Field->new(
991
            $itemfield, '', '',
991
            $itemfield, '', '',
(-)a/t/db_dependent/Koha/Account.t (-1 / +1 lines)
Lines 959-965 subtest 'pay() renews items when appropriate' => sub { Link Here
959
    # Enable renewing upon fine payment
959
    # Enable renewing upon fine payment
960
    t::lib::Mocks::mock_preference( 'RenewAccruingItemWhenPaid', 1 );
960
    t::lib::Mocks::mock_preference( 'RenewAccruingItemWhenPaid', 1 );
961
    my $called = 0;
961
    my $called = 0;
962
    my $module = new Test::MockModule('C4::Circulation');
962
    my $module = Test::MockModule->new('C4::Circulation');
963
    $module->mock('AddRenewal', sub { $called = 1; });
963
    $module->mock('AddRenewal', sub { $called = 1; });
964
    $module->mock('CanBookBeRenewed', sub { return 1; });
964
    $module->mock('CanBookBeRenewed', sub { return 1; });
965
    $account->pay(
965
    $account->pay(
(-)a/t/db_dependent/Koha/Account/Line.t (-2 / +2 lines)
Lines 324-330 subtest 'apply() tests' => sub { Link Here
324
    # Enable renewing upon fine payment
324
    # Enable renewing upon fine payment
325
    t::lib::Mocks::mock_preference( 'RenewAccruingItemWhenPaid', 1 );
325
    t::lib::Mocks::mock_preference( 'RenewAccruingItemWhenPaid', 1 );
326
    my $called = 0;
326
    my $called = 0;
327
    my $module = new Test::MockModule('C4::Circulation');
327
    my $module = Test::MockModule->new('C4::Circulation');
328
    $module->mock('AddRenewal', sub { $called = 1; });
328
    $module->mock('AddRenewal', sub { $called = 1; });
329
    $module->mock('CanBookBeRenewed', sub { return 1; });
329
    $module->mock('CanBookBeRenewed', sub { return 1; });
330
    my $credit_renew = $account->add_credit({ amount => 100, user_id => $patron->id, interface => 'commandline' });
330
    my $credit_renew = $account->add_credit({ amount => 100, user_id => $patron->id, interface => 'commandline' });
Lines 452-458 subtest 'Renewal related tests' => sub { Link Here
452
        }
452
        }
453
    );
453
    );
454
    my $called = 0;
454
    my $called = 0;
455
    my $module = new Test::MockModule('C4::Circulation');
455
    my $module = Test::MockModule->new('C4::Circulation');
456
    $module->mock('AddRenewal', sub { $called = 1; });
456
    $module->mock('AddRenewal', sub { $called = 1; });
457
    $module->mock('CanBookBeRenewed', sub { return 1; });
457
    $module->mock('CanBookBeRenewed', sub { return 1; });
458
    $line->renew_item;
458
    $line->renew_item;
(-)a/t/db_dependent/Koha/Patron/Messages.t (-1 / +1 lines)
Lines 52-58 my $new_message_1 = Koha::Patron::Message->new( Link Here
52
)->store;
52
)->store;
53
is( get_nb_of_logactions(), $nb_of_logaction, 'With BorrowersLog off, no new log should have been added' );
53
is( get_nb_of_logactions(), $nb_of_logaction, 'With BorrowersLog off, no new log should have been added' );
54
54
55
my $context = new Test::MockModule('C4::Context');
55
my $context = Test::MockModule->new('C4::Context');
56
$context->mock( 'userenv', sub {
56
$context->mock( 'userenv', sub {
57
    return {
57
    return {
58
        number => $patron_2->{borrowernumber},
58
        number => $patron_2->{borrowernumber},
(-)a/t/db_dependent/Koha/Patrons.t (-1 / +1 lines)
Lines 342-348 subtest 'is_going_to_expire' => sub { Link Here
342
    { # Testing invalid is going to expiry date
342
    { # Testing invalid is going to expiry date
343
        t::lib::Mocks::mock_preference('NotifyBorrowerDeparture', 30);
343
        t::lib::Mocks::mock_preference('NotifyBorrowerDeparture', 30);
344
        # mock_config does not work here, because of tz vs timezone subroutines
344
        # mock_config does not work here, because of tz vs timezone subroutines
345
        my $context = new Test::MockModule('C4::Context');
345
        my $context = Test::MockModule->new('C4::Context');
346
        $context->mock( 'tz', sub {
346
        $context->mock( 'tz', sub {
347
            'America/Sao_Paulo';
347
            'America/Sao_Paulo';
348
        });
348
        });
(-)a/t/db_dependent/Koha/Z3950Responder/GenericSession.t (-4 / +4 lines)
Lines 51-57 subtest 'test_search' => sub { Link Here
51
        MARC::Field->new('999', '', '', c => '1234567'),
51
        MARC::Field->new('999', '', '', c => '1234567'),
52
    );
52
    );
53
53
54
    my $yaml = new Test::MockModule('YAML');
54
    my $yaml = Test::MockModule->new('YAML');
55
    $yaml->mock('LoadFile', sub {
55
    $yaml->mock('LoadFile', sub {
56
        return {
56
        return {
57
            biblios => {
57
            biblios => {
Lines 64-77 subtest 'test_search' => sub { Link Here
64
        };
64
        };
65
    });
65
    });
66
66
67
    my $builder = new Test::MockModule('Koha::SearchEngine::Elasticsearch::QueryBuilder');
67
    my $builder = Test::MockModule->new('Koha::SearchEngine::Elasticsearch::QueryBuilder');
68
    $builder->mock('build_query_compat', sub {
68
    $builder->mock('build_query_compat', sub {
69
        my ( $self, $operators, $operands ) = @_;
69
        my ( $self, $operators, $operands ) = @_;
70
70
71
        return (undef, $operands->[0]);
71
        return (undef, $operands->[0]);
72
    });
72
    });
73
73
74
    my $search = new Test::MockModule('Koha::SearchEngine::Elasticsearch::Search');
74
    my $search = Test::MockModule->new('Koha::SearchEngine::Elasticsearch::Search');
75
    $search->mock('simple_search_compat', sub {
75
    $search->mock('simple_search_compat', sub {
76
        my ( $self, $query ) = @_;
76
        my ( $self, $query ) = @_;
77
77
Lines 93-99 subtest 'test_search' => sub { Link Here
93
    sleep(10); # Just a try to see if it fixes Jenkins
93
    sleep(10); # Just a try to see if it fixes Jenkins
94
94
95
    # Z39.50 protocol tests
95
    # Z39.50 protocol tests
96
    my $o = new ZOOM::Options();
96
    my $o = ZOOM::Options->new();
97
    $o->option(preferredRecordSyntax => 'xml');
97
    $o->option(preferredRecordSyntax => 'xml');
98
    $o->option(elementSetName => 'marcxml');
98
    $o->option(elementSetName => 'marcxml');
99
    $o->option(databaseName => 'biblios');
99
    $o->option(databaseName => 'biblios');
(-)a/t/db_dependent/Koha/Z3950Responder/ZebraSession.t (-5 / +5 lines)
Lines 46-60 subtest 'test_search' => sub { Link Here
46
        MARC::Field->new('999', '', '', c => '1234567'),
46
        MARC::Field->new('999', '', '', c => '1234567'),
47
    );
47
    );
48
48
49
    my $context = new Test::MockModule('C4::Context');
49
    my $context = Test::MockModule->new('C4::Context');
50
    $context->mock('Zconn', sub {
50
    $context->mock('Zconn', sub {
51
        my $Zconn = new Test::MockObject();
51
        my $Zconn = Test::MockObject->new();
52
        $Zconn->mock('connect', sub {});
52
        $Zconn->mock('connect', sub {});
53
        $Zconn->mock('err_code', sub {
53
        $Zconn->mock('err_code', sub {
54
            return 0;
54
            return 0;
55
        });
55
        });
56
        $Zconn->mock('search_pqf', sub {
56
        $Zconn->mock('search_pqf', sub {
57
            my $results = new Test::MockObject();
57
            my $results = Test::MockObject->new();
58
            $results->mock('size', sub {
58
            $results->mock('size', sub {
59
                return 2;
59
                return 2;
60
            });
60
            });
Lines 67-73 subtest 'test_search' => sub { Link Here
67
                } elsif ($index == 1) {
67
                } elsif ($index == 1) {
68
                    $record = $marc_record_2;
68
                    $record = $marc_record_2;
69
                }
69
                }
70
                my $Zrecord = new Test::MockObject();
70
                my $Zrecord = Test::MockObject->new();
71
                $Zrecord->mock('raw', sub {
71
                $Zrecord->mock('raw', sub {
72
                    return $record->as_xml();
72
                    return $record->as_xml();
73
                });
73
                });
Lines 90-96 subtest 'test_search' => sub { Link Here
90
    }
90
    }
91
    sleep(10); # Just a try to see if it fixes Jenkins
91
    sleep(10); # Just a try to see if it fixes Jenkins
92
92
93
    my $o = new ZOOM::Options();
93
    my $o = ZOOM::Options->new();
94
    $o->option(preferredRecordSyntax => 'xml');
94
    $o->option(preferredRecordSyntax => 'xml');
95
    $o->option(elementSetName => 'marcxml');
95
    $o->option(elementSetName => 'marcxml');
96
    $o->option(databaseName => 'biblios');
96
    $o->option(databaseName => 'biblios');
(-)a/t/db_dependent/Members/GetAllIssues.t (-1 / +1 lines)
Lines 69-75 my $borrowernumber2 = Link Here
69
my $borrower1 = Koha::Patrons->find( $borrowernumber1 )->unblessed;
69
my $borrower1 = Koha::Patrons->find( $borrowernumber1 )->unblessed;
70
my $borrower2 = Koha::Patrons->find( $borrowernumber2 )->unblessed;
70
my $borrower2 = Koha::Patrons->find( $borrowernumber2 )->unblessed;
71
71
72
my $module = new Test::MockModule('C4::Context');
72
my $module = Test::MockModule->new('C4::Context');
73
$module->mock( 'userenv', sub { { branch => $branchcode } } );
73
$module->mock( 'userenv', sub { { branch => $branchcode } } );
74
74
75
my $issues = C4::Members::GetAllIssues();
75
my $issues = C4::Members::GetAllIssues();
(-)a/t/db_dependent/Members/IssueSlip.t (-1 / +1 lines)
Lines 120-126 my $borrowernumber = Link Here
120
  Koha::Patron->new({ categorycode => $categorycode, branchcode => $branchcode })->store->borrowernumber;
120
  Koha::Patron->new({ categorycode => $categorycode, branchcode => $branchcode })->store->borrowernumber;
121
my $borrower = Koha::Patrons->find( $borrowernumber )->unblessed;
121
my $borrower = Koha::Patrons->find( $borrowernumber )->unblessed;
122
122
123
my $module = new Test::MockModule('C4::Context');
123
my $module = Test::MockModule->new('C4::Context');
124
$module->mock( 'userenv', sub { { branch => $branchcode } } );
124
$module->mock( 'userenv', sub { { branch => $branchcode } } );
125
125
126
my $today = dt_from_string;
126
my $today = dt_from_string;
(-)a/t/db_dependent/Record.t (-1 / +1 lines)
Lines 21-27 t::lib::Mocks::mock_preference( "BibtexExportAdditionalFields", q{} ); Link Here
21
my @marcarray=marc2marc;
21
my @marcarray=marc2marc;
22
is ($marcarray[0],"Feature not yet implemented\n","error works");
22
is ($marcarray[0],"Feature not yet implemented\n","error works");
23
23
24
my $marc=new MARC::Record;
24
my $marc=MARC::Record->new;
25
my $marcxml=marc2marcxml($marc);
25
my $marcxml=marc2marcxml($marc);
26
my $testxml=qq(<?xml version="1.0" encoding="UTF-8"?>
26
my $testxml=qq(<?xml version="1.0" encoding="UTF-8"?>
27
<record
27
<record
(-)a/t/db_dependent/RecordProcessor_EmbedSeeFromHeadings.t (-2 / +2 lines)
Lines 31-37 BEGIN { Link Here
31
        use_ok('Koha::RecordProcessor');
31
        use_ok('Koha::RecordProcessor');
32
}
32
}
33
33
34
my $module = new Test::MockModule('MARC::Record');
34
my $module = Test::MockModule->new('MARC::Record');
35
$module->mock('new_from_xml', sub {
35
$module->mock('new_from_xml', sub {
36
    my $record = MARC::Record->new;
36
    my $record = MARC::Record->new;
37
37
Lines 82-88 subtest "EmbedSeeFromHeadings should skip holdings fields" => sub { Link Here
82
    );
82
    );
83
83
84
84
85
    my $koha_authority = new Test::MockModule('Koha::MetadataRecord::Authority');
85
    my $koha_authority = Test::MockModule->new('Koha::MetadataRecord::Authority');
86
    $koha_authority->mock( 'get_from_authid', sub {
86
    $koha_authority->mock( 'get_from_authid', sub {
87
87
88
        my $auth_record = MARC::Record->new;
88
        my $auth_record = MARC::Record->new;
(-)a/t/db_dependent/Reserves/GetReserveFee.t (-1 / +1 lines)
Lines 37-43 my $builder = t::lib::TestBuilder->new(); Link Here
37
my $library = $builder->build({
37
my $library = $builder->build({
38
    source => 'Branch',
38
    source => 'Branch',
39
});
39
});
40
my $mContext = new Test::MockModule('C4::Context');
40
my $mContext = Test::MockModule->new('C4::Context');
41
$mContext->mock( 'userenv', sub {
41
$mContext->mock( 'userenv', sub {
42
    return { branch => $library->{branchcode} };
42
    return { branch => $library->{branchcode} };
43
});
43
});
(-)a/t/db_dependent/Search.t (-6 / +6 lines)
Lines 111-117 my @htdocs = split /\//, $htdocs; Link Here
111
$htdocs[-2] = 'koha-tmpl';
111
$htdocs[-2] = 'koha-tmpl';
112
$htdocs[-1] = 'opac-tmpl';
112
$htdocs[-1] = 'opac-tmpl';
113
$htdocs = join '/', @htdocs;
113
$htdocs = join '/', @htdocs;
114
our $contextmodule = new Test::MockModule('C4::Context');
114
our $contextmodule = Test::MockModule->new('C4::Context');
115
$contextmodule->mock('preference', sub {
115
$contextmodule->mock('preference', sub {
116
    my ($self, $pref) = @_;
116
    my ($self, $pref) = @_;
117
    if ($pref eq 'marcflavour') {
117
    if ($pref eq 'marcflavour') {
Lines 201-207 $contextmodule->mock('preference', sub { Link Here
201
    }
201
    }
202
});
202
});
203
203
204
our $bibliomodule = new Test::MockModule('C4::Biblio');
204
our $bibliomodule = Test::MockModule->new('C4::Biblio');
205
205
206
sub mock_GetMarcSubfieldStructure {
206
sub mock_GetMarcSubfieldStructure {
207
    my $marc_type = shift;
207
    my $marc_type = shift;
Lines 258-264 sub run_marc21_search_tests { Link Here
258
    Koha::Caches->get_instance('config')->flush_all;
258
    Koha::Caches->get_instance('config')->flush_all;
259
259
260
    mock_GetMarcSubfieldStructure('marc21');
260
    mock_GetMarcSubfieldStructure('marc21');
261
    my $context = new C4::Context("$datadir/etc/koha-conf.xml");
261
    my $context = C4::Context->new("$datadir/etc/koha-conf.xml");
262
    $context->set_context();
262
    $context->set_context();
263
263
264
    use_ok('C4::Search');
264
    use_ok('C4::Search');
Lines 275-281 sub run_marc21_search_tests { Link Here
275
    is(scalar(grep(/^arl$/, @$indexes)), 1, "Accelerated reading level index supported");
275
    is(scalar(grep(/^arl$/, @$indexes)), 1, "Accelerated reading level index supported");
276
    is(scalar(grep(/^arp$/, @$indexes)), 1, "Accelerated reading point index supported");
276
    is(scalar(grep(/^arp$/, @$indexes)), 1, "Accelerated reading point index supported");
277
277
278
    my $bibliomodule = new Test::MockModule('C4::Biblio');
278
    my $bibliomodule = Test::MockModule->new('C4::Biblio');
279
279
280
    my %branches = (
280
    my %branches = (
281
        'CPL' => { 'branchaddress1' => 'Jefferson Summit', 'branchcode' => 'CPL', 'branchname' => 'Centerville', },
281
        'CPL' => { 'branchaddress1' => 'Jefferson Summit', 'branchcode' => 'CPL', 'branchname' => 'Centerville', },
Lines 700-706 ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' Link Here
700
    ## Regression test for Bug 10741
700
    ## Regression test for Bug 10741
701
701
702
    # make one of the test items appear to be in transit
702
    # make one of the test items appear to be in transit
703
    my $circ_module = new Test::MockModule('C4::Circulation');
703
    my $circ_module = Test::MockModule->new('C4::Circulation');
704
    $circ_module->mock('GetTransfers', sub {
704
    $circ_module->mock('GetTransfers', sub {
705
        my $itemnumber = shift // -1;
705
        my $itemnumber = shift // -1;
706
        if ($itemnumber == 11) {
706
        if ($itemnumber == 11) {
Lines 832-838 sub run_unimarc_search_tests { Link Here
832
    Koha::Caches->get_instance('config')->flush_all;
832
    Koha::Caches->get_instance('config')->flush_all;
833
833
834
    mock_GetMarcSubfieldStructure('unimarc');
834
    mock_GetMarcSubfieldStructure('unimarc');
835
    my $context = new C4::Context("$datadir/etc/koha-conf.xml");
835
    my $context = C4::Context->new("$datadir/etc/koha-conf.xml");
836
    $context->set_context();
836
    $context->set_context();
837
837
838
    use_ok('C4::Search');
838
    use_ok('C4::Search');
(-)a/t/db_dependent/Search/History.t (-4 / +4 lines)
Lines 362-368 sub delete_all { Link Here
362
subtest 'LoadSearchHistoryToTheFirstLoggedUser working' => sub {
362
subtest 'LoadSearchHistoryToTheFirstLoggedUser working' => sub {
363
plan tests =>2;
363
plan tests =>2;
364
364
365
my $query = new CGI;
365
my $query = CGI->new;
366
366
367
my $schema = Koha::Database->schema;
367
my $schema = Koha::Database->schema;
368
my $builder = t::lib::TestBuilder->new;
368
my $builder = t::lib::TestBuilder->new;
Lines 388-397 sub myMockedget_from_session { Link Here
388
388
389
}
389
}
390
390
391
my $getfrom = new Test::MockModule( 'C4::Search::History' );
391
my $getfrom = Test::MockModule->new( 'C4::Search::History' );
392
$getfrom->mock( 'get_from_session', \&myMockedget_from_session );
392
$getfrom->mock( 'get_from_session', \&myMockedget_from_session );
393
393
394
my $cgi = new Test::MockModule( 'CGI');
394
my $cgi = Test::MockModule->new( 'CGI');
395
$cgi->mock('cookie', sub {
395
$cgi->mock('cookie', sub {
396
   my ($self, $key) = @_;
396
   my ($self, $key) = @_;
397
  if (!ref($key) && $key eq 'CGISESSID'){
397
  if (!ref($key) && $key eq 'CGISESSID'){
Lines 425-431 sub MockedCheckauth { Link Here
425
}
425
}
426
426
427
# Mock checkauth
427
# Mock checkauth
428
my $auth = new Test::MockModule( 'C4::Auth' );
428
my $auth = Test::MockModule->new( 'C4::Auth' );
429
$auth->mock( 'checkauth', \&MockedCheckauth );
429
$auth->mock( 'checkauth', \&MockedCheckauth );
430
430
431
$query->param('koha_login_context', 'opac');
431
$query->param('koha_login_context', 'opac');
(-)a/t/db_dependent/Serials.t (-1 / +1 lines)
Lines 150-156 subtest 'Values should not be erased on editing' => sub { Link Here
150
    my $itemtype = $builder->build( { source => 'Itemtype' } )->{itemtype};
150
    my $itemtype = $builder->build( { source => 'Itemtype' } )->{itemtype};
151
    my $itemcallnumber = 'XXXmy itemcallnumberXXX';
151
    my $itemcallnumber = 'XXXmy itemcallnumberXXX';
152
152
153
    my $item_record    = new MARC::Record;
153
    my $item_record    = MARC::Record->new;
154
154
155
    $item_record->append_fields(
155
    $item_record->append_fields(
156
        MARC::Field->new( '080', '', '', "a" => "default" ),
156
        MARC::Field->new( '080', '', '', "a" => "default" ),
(-)a/t/db_dependent/SuggestionEngine_ExplodedTerms.t (-5 / +5 lines)
Lines 10-16 use Test::More; Link Here
10
use Test::MockModule;
10
use Test::MockModule;
11
use Test::Warn;
11
use Test::Warn;
12
12
13
my $contextModule = new Test::MockModule('C4::Context');
13
my $contextModule = Test::MockModule->new('C4::Context');
14
$contextModule->mock('preference', sub {
14
$contextModule->mock('preference', sub {
15
    return '';
15
    return '';
16
});
16
});
Lines 40-51 sub get_where { Link Here
40
40
41
my $langModule;
41
my $langModule;
42
if (! defined $ENV{KOHA_CONF}) {
42
if (! defined $ENV{KOHA_CONF}) {
43
    warning_like { $langModule = new Test::MockModule('C4::Languages'); }
43
    warning_like { $langModule = Test::MockModule->new('C4::Languages'); }
44
        qr /unable to locate Koha configuration file koha-conf.xml/,
44
        qr /unable to locate Koha configuration file koha-conf.xml/,
45
        'Expected warning for unset $KOHA_CONF';
45
        'Expected warning for unset $KOHA_CONF';
46
}
46
}
47
else {
47
else {
48
    $langModule = new Test::MockModule('C4::Languages');
48
    $langModule = Test::MockModule->new('C4::Languages');
49
}
49
}
50
$langModule->mock('regex_lang_subtags', sub {
50
$langModule->mock('regex_lang_subtags', sub {
51
    return {
51
    return {
Lines 89-100 $langModule->mock('getTranslatedLanguages', sub { Link Here
89
});
89
});
90
my $tmplModule;
90
my $tmplModule;
91
if (! defined $ENV{KOHA_CONF}) {
91
if (! defined $ENV{KOHA_CONF}) {
92
    warning_like { $tmplModule = new Test::MockModule('C4::Templates'); }
92
    warning_like { $tmplModule = Test::MockModule->new('C4::Templates'); }
93
        qr /unable to locate Koha configuration file koha-conf.xml/,
93
        qr /unable to locate Koha configuration file koha-conf.xml/,
94
        'Expected warning for unset $KOHA_CONF';
94
        'Expected warning for unset $KOHA_CONF';
95
}
95
}
96
else {
96
else {
97
    $tmplModule = new Test::MockModule('C4::Templates');
97
    $tmplModule = Test::MockModule->new('C4::Templates');
98
}
98
}
99
$tmplModule->mock('_get_template_file', sub {
99
$tmplModule->mock('_get_template_file', sub {
100
    my ($tmplbase, $interface, $query) = @_;
100
    my ($tmplbase, $interface, $query) = @_;
(-)a/t/db_dependent/TablesSettings.t (-1 / +1 lines)
Lines 14-20 my $dbh = C4::Context->dbh; Link Here
14
14
15
$dbh->do(q|DELETE FROM columns_settings|);
15
$dbh->do(q|DELETE FROM columns_settings|);
16
16
17
my $module = new Test::MockModule('C4::Utils::DataTables::TablesSettings');
17
my $module = Test::MockModule->new('C4::Utils::DataTables::TablesSettings');
18
$module->mock(
18
$module->mock(
19
    'get_yaml',
19
    'get_yaml',
20
    sub {
20
    sub {
(-)a/t/db_dependent/Template/Plugin/KohaDates.t (-1 / +1 lines)
Lines 13-19 BEGIN { Link Here
13
        use_ok('Koha::Template::Plugin::KohaDates');
13
        use_ok('Koha::Template::Plugin::KohaDates');
14
}
14
}
15
15
16
my $module_context = new Test::MockModule('C4::Context');
16
my $module_context = Test::MockModule->new('C4::Context');
17
17
18
my $date = "1973-05-21";
18
my $date = "1973-05-21";
19
my $context = C4::Context->new();
19
my $context = C4::Context->new();
(-)a/t/db_dependent/XISBN.t (-1 / +1 lines)
Lines 23-29 my $schema = Koha::Database->new->schema; Link Here
23
$schema->storage->txn_begin;
23
$schema->storage->txn_begin;
24
24
25
my $engine = C4::Context->preference("SearchEngine") // 'Zebra';
25
my $engine = C4::Context->preference("SearchEngine") // 'Zebra';
26
my $search_module = new Test::MockModule("Koha::SearchEngine::${engine}::Search");
26
my $search_module = Test::MockModule->new("Koha::SearchEngine::${engine}::Search");
27
27
28
$search_module->mock('simple_search_compat', \&Mock_simple_search_compat );
28
$search_module->mock('simple_search_compat', \&Mock_simple_search_compat );
29
29
(-)a/t/db_dependent/api/v1/checkouts.t (-1 / +1 lines)
Lines 59-65 my $unauth_userid = $patron->userid; Link Here
59
my $patron_id = $patron->borrowernumber;
59
my $patron_id = $patron->borrowernumber;
60
60
61
my $branchcode = $builder->build({ source => 'Branch' })->{ branchcode };
61
my $branchcode = $builder->build({ source => 'Branch' })->{ branchcode };
62
my $module = new Test::MockModule('C4::Context');
62
my $module = Test::MockModule->new('C4::Context');
63
$module->mock('userenv', sub { { branch => $branchcode } });
63
$module->mock('userenv', sub { { branch => $branchcode } });
64
64
65
$t->get_ok( "//$userid:$password@/api/v1/checkouts?patron_id=$patron_id" )
65
$t->get_ok( "//$userid:$password@/api/v1/checkouts?patron_id=$patron_id" )
(-)a/t/lib/Mocks.pm (-2 / +2 lines)
Lines 7-13 use Test::MockModule; Link Here
7
7
8
my %configs;
8
my %configs;
9
sub mock_config {
9
sub mock_config {
10
    my $context = new Test::MockModule('C4::Context');
10
    my $context = Test::MockModule->new('C4::Context');
11
    my ( $conf, $value ) = @_;
11
    my ( $conf, $value ) = @_;
12
    $configs{$conf} = $value;
12
    $configs{$conf} = $value;
13
    $context->mock('config', sub {
13
    $context->mock('config', sub {
Lines 27-33 sub mock_preference { Link Here
27
27
28
    $preferences{lc($pref)} = $value;
28
    $preferences{lc($pref)} = $value;
29
29
30
    my $context = new Test::MockModule('C4::Context');
30
    my $context = Test::MockModule->new('C4::Context');
31
    $context->mock('preference', sub {
31
    $context->mock('preference', sub {
32
        my ( $self, $pref ) = @_;
32
        my ( $self, $pref ) = @_;
33
        $pref = lc($pref);
33
        $pref = lc($pref);
(-)a/tools/access_files.pl (-1 / +1 lines)
Lines 32-38 use File::stat qw(stat); Link Here
32
use Digest::MD5 qw(md5_hex);
32
use Digest::MD5 qw(md5_hex);
33
use Encode;
33
use Encode;
34
34
35
my $input = new CGI;
35
my $input = CGI->new;
36
my $file_id = $input->param("id");
36
my $file_id = $input->param("id");
37
my $access_dirs = C4::Context->config('access_dirs');
37
my $access_dirs = C4::Context->config('access_dirs');
38
38
(-)a/tools/ajax-inventory.pl (-1 / +1 lines)
Lines 5-11 use CGI qw ( -utf8 ); Link Here
5
use C4::Auth;
5
use C4::Auth;
6
use C4::Items qw( ModDateLastSeen );
6
use C4::Items qw( ModDateLastSeen );
7
7
8
my $input = new CGI;
8
my $input = CGI->new;
9
9
10
# Authentication
10
# Authentication
11
my ($status, $cookie, $sessionId) = C4::Auth::check_api_auth($input, { tools => 'inventory' });
11
my ($status, $cookie, $sessionId) = C4::Auth::check_api_auth($input, { tools => 'inventory' });
(-)a/tools/automatic_item_modification_by_age.pl (-1 / +1 lines)
Lines 43-49 use C4::Koha; Link Here
43
use Koha::Items;
43
use Koha::Items;
44
use Koha::Biblioitems;
44
use Koha::Biblioitems;
45
45
46
my $cgi = new CGI;
46
my $cgi = CGI->new;
47
47
48
# open template
48
# open template
49
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
49
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
(-)a/tools/batchMod.pl (-1 / +1 lines)
Lines 46-52 use Koha::ItemTypes; Link Here
46
use Koha::Patrons;
46
use Koha::Patrons;
47
use Koha::SearchEngine::Indexer;
47
use Koha::SearchEngine::Indexer;
48
48
49
my $input = new CGI;
49
my $input = CGI->new;
50
my $dbh = C4::Context->dbh;
50
my $dbh = C4::Context->dbh;
51
my $error        = $input->param('error');
51
my $error        = $input->param('error');
52
my @itemnumbers  = $input->multi_param('itemnumber');
52
my @itemnumbers  = $input->multi_param('itemnumber');
(-)a/tools/batch_delete_records.pl (-1 / +1 lines)
Lines 33-39 use Koha::Authorities; Link Here
33
use Koha::Biblios;
33
use Koha::Biblios;
34
use Koha::Items;
34
use Koha::Items;
35
35
36
my $input = new CGI;
36
my $input = CGI->new;
37
my $op = $input->param('op') // q|form|;
37
my $op = $input->param('op') // q|form|;
38
my $recordtype = $input->param('recordtype') // 'biblio';
38
my $recordtype = $input->param('recordtype') // 'biblio';
39
39
(-)a/tools/batch_extend_due_dates.pl (-1 / +1 lines)
Lines 27-33 use C4::Output qw( output_html_with_http_headers ); Link Here
27
use Koha::Checkouts;
27
use Koha::Checkouts;
28
use Koha::DateUtils qw( dt_from_string output_pref );
28
use Koha::DateUtils qw( dt_from_string output_pref );
29
29
30
my $input = new CGI;
30
my $input = CGI->new;
31
my $op = $input->param('op') // q|form|;
31
my $op = $input->param('op') // q|form|;
32
my $preview_results = $input->param('preview_results');
32
my $preview_results = $input->param('preview_results');
33
33
(-)a/tools/batch_record_modification.pl (-1 / +1 lines)
Lines 37-43 use Koha::BackgroundJob::BatchUpdateAuthority; Link Here
37
use Koha::MetadataRecord::Authority;
37
use Koha::MetadataRecord::Authority;
38
use Koha::Virtualshelves;
38
use Koha::Virtualshelves;
39
39
40
my $input = new CGI;
40
my $input = CGI->new;
41
our $dbh = C4::Context->dbh;
41
our $dbh = C4::Context->dbh;
42
my $op = $input->param('op') // q|form|;
42
my $op = $input->param('op') // q|form|;
43
my $recordtype = $input->param('recordtype') // 'biblio';
43
my $recordtype = $input->param('recordtype') // 'biblio';
(-)a/tools/batch_records_ajax.pl (-1 / +1 lines)
Lines 39-45 use C4::Charset; Link Here
39
use C4::Auth qw/check_cookie_auth/;
39
use C4::Auth qw/check_cookie_auth/;
40
use C4::ImportBatch;
40
use C4::ImportBatch;
41
41
42
my $input = new CGI;
42
my $input = CGI->new;
43
43
44
my @sort_columns =
44
my @sort_columns =
45
  qw/import_record_id title status overlay_status overlay_status/;
45
  qw/import_record_id title status overlay_status overlay_status/;
(-)a/tools/cleanborrowers.pl (-1 / +1 lines)
Lines 45-51 use Date::Calc qw/Today Add_Delta_YM/; Link Here
45
use Koha::Patrons;
45
use Koha::Patrons;
46
use Koha::List::Patron;
46
use Koha::List::Patron;
47
47
48
my $cgi = new CGI;
48
my $cgi = CGI->new;
49
49
50
# Fetch the paramater list as a hash in scalar context:
50
# Fetch the paramater list as a hash in scalar context:
51
#  * returns paramater list as tied hash ref
51
#  * returns paramater list as tied hash ref
(-)a/tools/copy-holidays.pl (-1 / +1 lines)
Lines 27-33 use C4::Output; Link Here
27
27
28
use C4::Calendar;
28
use C4::Calendar;
29
29
30
my $input               = new CGI;
30
my $input               = CGI->new;
31
my $dbh                 = C4::Context->dbh();
31
my $dbh                 = C4::Context->dbh();
32
32
33
checkauth($input, 0, {tools=> 'edit_calendar'}, 'intranet');
33
checkauth($input, 0, {tools=> 'edit_calendar'}, 'intranet');
(-)a/tools/csv-profiles.pl (-1 / +1 lines)
Lines 44-50 use CGI qw ( -utf8 ); Link Here
44
use C4::Koha;
44
use C4::Koha;
45
use Koha::CsvProfiles;
45
use Koha::CsvProfiles;
46
46
47
my $input            = new CGI;
47
my $input            = CGI->new;
48
my $export_format_id = $input->param('export_format_id');
48
my $export_format_id = $input->param('export_format_id');
49
my $op               = $input->param('op') || 'list';
49
my $op               = $input->param('op') || 'list';
50
my @messages;
50
my @messages;
(-)a/tools/exceptionHolidays.pl (-1 / +1 lines)
Lines 11-17 use DateTime; Link Here
11
use C4::Calendar;
11
use C4::Calendar;
12
use Koha::DateUtils;
12
use Koha::DateUtils;
13
13
14
my $input = new CGI;
14
my $input = CGI->new;
15
my $dbh = C4::Context->dbh();
15
my $dbh = C4::Context->dbh();
16
16
17
checkauth($input, 0, {tools=> 'edit_calendar'}, 'intranet');
17
checkauth($input, 0, {tools=> 'edit_calendar'}, 'intranet');
(-)a/tools/export.pl (-1 / +1 lines)
Lines 32-38 use Koha::Exporter::Record; Link Here
32
use Koha::ItemTypes;
32
use Koha::ItemTypes;
33
use Koha::Libraries;
33
use Koha::Libraries;
34
34
35
my $query = new CGI;
35
my $query = CGI->new;
36
36
37
my $dont_export_items = $query->param("dont_export_item") || 0;
37
my $dont_export_items = $query->param("dont_export_item") || 0;
38
my $record_type       = $query->param("record_type");
38
my $record_type       = $query->param("record_type");
(-)a/tools/holidays.pl (-1 / +1 lines)
Lines 26-32 use C4::Output; Link Here
26
use C4::Calendar;
26
use C4::Calendar;
27
use Koha::DateUtils;
27
use Koha::DateUtils;
28
28
29
my $input = new CGI;
29
my $input = CGI->new;
30
30
31
my $dbh = C4::Context->dbh();
31
my $dbh = C4::Context->dbh();
32
# Get the template to use
32
# Get the template to use
(-)a/tools/koha-news.pl (-1 / +1 lines)
Lines 33-39 use C4::Languages qw(getTranslatedLanguages); Link Here
33
use Date::Calc qw/Date_to_Days Today/;
33
use Date::Calc qw/Date_to_Days Today/;
34
use Koha::DateUtils;
34
use Koha::DateUtils;
35
35
36
my $cgi = new CGI;
36
my $cgi = CGI->new;
37
37
38
my $id             = $cgi->param('id');
38
my $id             = $cgi->param('id');
39
my $title          = $cgi->param('title');
39
my $title          = $cgi->param('title');
(-)a/tools/letter.pl (-1 / +1 lines)
Lines 57-63 sub protected_letters { Link Here
57
    return { map { $_->[0] => 1 } @{$codes} };
57
    return { map { $_->[0] => 1 } @{$codes} };
58
}
58
}
59
59
60
our $input       = new CGI;
60
our $input       = CGI->new;
61
my $searchfield = $input->param('searchfield');
61
my $searchfield = $input->param('searchfield');
62
my $script_name = '/cgi-bin/koha/tools/letter.pl';
62
my $script_name = '/cgi-bin/koha/tools/letter.pl';
63
our $branchcode  = $input->param('branchcode');
63
our $branchcode  = $input->param('branchcode');
(-)a/tools/manage-marc-import.pl (-1 / +1 lines)
Lines 39-45 use Koha::BiblioFrameworks; Link Here
39
39
40
my $script_name = "/cgi-bin/koha/tools/manage-marc-import.pl";
40
my $script_name = "/cgi-bin/koha/tools/manage-marc-import.pl";
41
41
42
my $input = new CGI;
42
my $input = CGI->new;
43
my $op = $input->param('op') || '';
43
my $op = $input->param('op') || '';
44
my $completedJobID = $input->param('completedJobID');
44
my $completedJobID = $input->param('completedJobID');
45
our $runinbackground = $input->param('runinbackground');
45
our $runinbackground = $input->param('runinbackground');
(-)a/tools/marc_modification_templates.pl (-1 / +1 lines)
Lines 25-31 use C4::Koha; Link Here
25
use C4::Output;
25
use C4::Output;
26
use C4::MarcModificationTemplates;
26
use C4::MarcModificationTemplates;
27
27
28
my $cgi = new CGI;
28
my $cgi = CGI->new;
29
29
30
my $op = $cgi->param('op') || q{};
30
my $op = $cgi->param('op') || q{};
31
my $template_id = $cgi->param('template_id');
31
my $template_id = $cgi->param('template_id');
(-)a/tools/modborrowers.pl (-1 / +1 lines)
Lines 39-45 use Koha::Patron::Categories; Link Here
39
use Koha::Patron::Debarments;
39
use Koha::Patron::Debarments;
40
use Koha::Patrons;
40
use Koha::Patrons;
41
41
42
my $input = new CGI;
42
my $input = CGI->new;
43
my $op = $input->param('op') || 'show_form';
43
my $op = $input->param('op') || 'show_form';
44
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
44
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
45
    {   template_name   => "tools/modborrowers.tt",
45
    {   template_name   => "tools/modborrowers.tt",
(-)a/tools/newHolidays.pl (-1 / +1 lines)
Lines 28-34 use C4::Calendar; Link Here
28
use DateTime;
28
use DateTime;
29
use Koha::DateUtils;
29
use Koha::DateUtils;
30
30
31
my $input               = new CGI;
31
my $input               = CGI->new;
32
my $dbh                 = C4::Context->dbh();
32
my $dbh                 = C4::Context->dbh();
33
33
34
checkauth($input, 0, {tools=> 'edit_calendar'}, 'intranet');
34
checkauth($input, 0, {tools=> 'edit_calendar'}, 'intranet');
(-)a/tools/overduerules.pl (-1 / +1 lines)
Lines 30-36 use Koha::Libraries; Link Here
30
30
31
use Koha::Patron::Categories;
31
use Koha::Patron::Categories;
32
32
33
our $input = new CGI;
33
our $input = CGI->new;
34
my $dbh = C4::Context->dbh;
34
my $dbh = C4::Context->dbh;
35
35
36
my @patron_categories = Koha::Patron::Categories->search( { overduenoticerequired => { '>' => 0 } } );
36
my @patron_categories = Koha::Patron::Categories->search( { overduenoticerequired => { '>' => 0 } } );
(-)a/tools/picture-upload.pl (-1 / +1 lines)
Lines 35-41 use Koha::Patrons; Link Here
35
use Koha::Patron::Images;
35
use Koha::Patron::Images;
36
use Koha::Token;
36
use Koha::Token;
37
37
38
my $input = new CGI;
38
my $input = CGI->new;
39
39
40
unless (C4::Context->preference('patronimages')) {
40
unless (C4::Context->preference('patronimages')) {
41
    # redirect to intranet home if patronimages is not enabled
41
    # redirect to intranet home if patronimages is not enabled
(-)a/tools/problem-reports.pl (-1 / +1 lines)
Lines 25-31 use C4::Output; Link Here
25
use C4::Auth;
25
use C4::Auth;
26
use Koha::ProblemReports;
26
use Koha::ProblemReports;
27
27
28
my $query = new CGI;
28
my $query = CGI->new;
29
29
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {
31
    {
(-)a/tools/quotes-upload.pl (-1 / +1 lines)
Lines 27-33 use C4::Koha; Link Here
27
use C4::Context;
27
use C4::Context;
28
use C4::Output;
28
use C4::Output;
29
29
30
my $cgi = new CGI;
30
my $cgi = CGI->new;
31
31
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
33
    {
33
    {
(-)a/tools/quotes.pl (-1 / +1 lines)
Lines 27-33 use C4::Koha; Link Here
27
use C4::Context;
27
use C4::Context;
28
use C4::Output;
28
use C4::Output;
29
29
30
my $cgi = new CGI;
30
my $cgi = CGI->new;
31
31
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
33
    {
33
    {
(-)a/tools/quotes/quotes-upload_ajax.pl (-1 / +1 lines)
Lines 29-35 use C4::Koha; Link Here
29
use C4::Context;
29
use C4::Context;
30
use C4::Output;
30
use C4::Output;
31
31
32
my $cgi = new CGI;
32
my $cgi = CGI->new;
33
my $dbh = C4::Context->dbh;
33
my $dbh = C4::Context->dbh;
34
34
35
my ( $status, $cookie, $sessionID ) = C4::Auth::check_api_auth( $cgi, { tools => 'edit_quotes' } );
35
my ( $status, $cookie, $sessionID ) = C4::Auth::check_api_auth( $cgi, { tools => 'edit_quotes' } );
(-)a/tools/scheduler.pl (-1 / +1 lines)
Lines 32-38 BEGIN { Link Here
32
    $debug = $ENV{DEBUG} || 0;
32
    $debug = $ENV{DEBUG} || 0;
33
}
33
}
34
34
35
my $input = new CGI;
35
my $input = CGI->new;
36
my $base;
36
my $base;
37
37
38
if ( C4::Context->config('supportdir') ) {
38
if ( C4::Context->config('supportdir') ) {
(-)a/tools/showdiffmarc.pl (-1 / +1 lines)
Lines 35-41 use C4::ImportBatch; Link Here
35
use Koha::Biblios;
35
use Koha::Biblios;
36
36
37
# Input params
37
# Input params
38
my $input        = new CGI;
38
my $input        = CGI->new;
39
my $recordid = $input->param('id');
39
my $recordid = $input->param('id');
40
my $importid     = $input->param('importid');
40
my $importid     = $input->param('importid');
41
my $batchid      = $input->param('batchid');
41
my $batchid      = $input->param('batchid');
(-)a/tools/stage-marc-import.pl (-1 / +1 lines)
Lines 43-49 use C4::BackgroundJob; Link Here
43
use C4::MarcModificationTemplates;
43
use C4::MarcModificationTemplates;
44
use Koha::Plugins;
44
use Koha::Plugins;
45
45
46
my $input = new CGI;
46
my $input = CGI->new;
47
47
48
my $fileID                     = $input->param('uploadedfileid');
48
my $fileID                     = $input->param('uploadedfileid');
49
my $runinbackground            = $input->param('runinbackground');
49
my $runinbackground            = $input->param('runinbackground');
(-)a/tools/stockrotation.pl (-1 / +1 lines)
Lines 38-44 use Koha::StockRotationStages; Link Here
38
use Koha::Item;
38
use Koha::Item;
39
use Koha::Util::StockRotation qw(:ALL);
39
use Koha::Util::StockRotation qw(:ALL);
40
40
41
my $input = new CGI;
41
my $input = CGI->new;
42
42
43
unless (C4::Context->preference('StockRotation')) {
43
unless (C4::Context->preference('StockRotation')) {
44
    # redirect to Intranet home if self-check is not enabled
44
    # redirect to Intranet home if self-check is not enabled
(-)a/tools/tools-home.pl (-1 / +1 lines)
Lines 23-29 use C4::Output; Link Here
23
use C4::Tags qw/get_count_by_tag_status/;
23
use C4::Tags qw/get_count_by_tag_status/;
24
use Koha::Reviews;
24
use Koha::Reviews;
25
25
26
my $query = new CGI;
26
my $query = CGI->new;
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
28
    {
28
    {
29
        template_name   => "tools/tools-home.tt",
29
        template_name   => "tools/tools-home.tt",
(-)a/tools/upload-cover-image.pl (-1 / +1 lines)
Lines 51-57 use C4::Log; Link Here
51
51
52
my $debug = 1;
52
my $debug = 1;
53
53
54
my $input = new CGI;
54
my $input = CGI->new;
55
55
56
my $fileID = $input->param('uploadedfileid');
56
my $fileID = $input->param('uploadedfileid');
57
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
57
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
(-)a/tools/viewlog.pl (-1 / +1 lines)
Lines 45-51 plugin that shows stats Link Here
45
45
46
=cut
46
=cut
47
47
48
my $input = new CGI;
48
my $input = CGI->new;
49
49
50
$debug or $debug = $cgi_debug;
50
$debug or $debug = $cgi_debug;
51
my $do_it    = $input->param('do_it');
51
my $do_it    = $input->param('do_it');
(-)a/virtualshelves/addbybiblionumber.pl (-1 / +1 lines)
Lines 66-72 use C4::Auth; Link Here
66
use Koha::Biblios;
66
use Koha::Biblios;
67
use Koha::Virtualshelves;
67
use Koha::Virtualshelves;
68
68
69
my $query           = new CGI;
69
my $query           = CGI->new;
70
my $shelfnumber     = $query->param('shelfnumber');
70
my $shelfnumber     = $query->param('shelfnumber');
71
my $newvirtualshelf = $query->param('newvirtualshelf');
71
my $newvirtualshelf = $query->param('newvirtualshelf');
72
my $newshelf        = $query->param('newshelf');
72
my $newshelf        = $query->param('newshelf');
(-)a/virtualshelves/downloadshelf.pl (-1 / +1 lines)
Lines 33-39 use Koha::CsvProfiles; Link Here
33
use Koha::Virtualshelves;
33
use Koha::Virtualshelves;
34
34
35
use utf8;
35
use utf8;
36
my $query = new CGI;
36
my $query = CGI->new;
37
37
38
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
38
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
39
    {
39
    {
(-)a/virtualshelves/shelves.pl (-1 / +1 lines)
Lines 37-43 use Koha::Virtualshelves; Link Here
37
37
38
use constant ANYONE => 2;
38
use constant ANYONE => 2;
39
39
40
my $query = new CGI;
40
my $query = CGI->new;
41
41
42
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
42
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
43
    {   template_name   => "virtualshelves/shelves.tt",
43
    {   template_name   => "virtualshelves/shelves.tt",
(-)a/xt/author/valid-templates.t (-2 / +1 lines)
Lines 74-80 if ( $ENV{KOHA_PROVE_CPUS} ) { Link Here
74
    $ncpu = Sys::CPU::cpu_count();
74
    $ncpu = Sys::CPU::cpu_count();
75
}
75
}
76
76
77
my $pm   = new Parallel::ForkManager($ncpu);
77
my $pm   = Parallel::ForkManager->new($ncpu);
78
78
79
# Tests
79
# Tests
80
foreach my $theme ( @themes ) {
80
foreach my $theme ( @themes ) {
81
- 

Return to bug 25898