severity = 5
-include = ProhibitUnusedVariables
+include = ProhibitUnusedVariables Objects::ProhibitIndirectSyntax
exclude = Miscellanea::RequireRcsKeywords
[Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEval]
sub get_session {
my $sessionID = shift;
my $params = _get_session_params();
- return new CGI::Session( $params->{dsn}, $sessionID, $params->{dsn_args} );
+ return CGI::Session->new( $params->{dsn}, $sessionID, $params->{dsn_args} );
}
my @oAuth;
my $i;
$oAuth[0]=C4::Context->Zconn("authorityserver" , 1);
- my $Anewq= new ZOOM::Query::PQF($query,$oAuth[0]);
+ my $Anewq= ZOOM::Query::PQF->new($query,$oAuth[0]);
my $oAResult;
$oAResult= $oAuth[0]->search($Anewq) ;
while (($i = ZOOM::event(\@oAuth)) != 0) {
$oResult[$s] =
$server->{servertype} eq 'zed'?
$oConnection[$s]->search_pqf( $server_zquery ):
- $oConnection[$s]->search(new ZOOM::Query::CQL(
+ $oConnection[$s]->search(ZOOM::Query::CQL->new(
_translate_query( $server, $squery )));
$s++;
}
sub _create_connection {
my ( $server ) = @_;
- my $option1= new ZOOM::Options();
+ my $option1= ZOOM::Options->new();
$option1->option( 'async' => 1 );
$option1->option( 'elementSetName', 'F' );
$option1->option( 'preferredRecordSyntax', $server->{syntax} );
}
else {
$oResult[$s] = $oConnection[$s]->search(
- new ZOOM::Query::CQL(_translate_query( $server, $squery ))
+ ZOOM::Query::CQL->new(_translate_query( $server, $squery ))
);
}
$encoding[$s] = ($server->{encoding}?$server->{encoding}:"iso-5426");
my $password = $context->{"serverinfo"}->{$server}->{"password"};
eval {
# set options
- my $o = new ZOOM::Options();
+ my $o = ZOOM::Options->new();
$o->option(user => $user) if $user && $password;
$o->option(password => $password) if $user && $password;
$o->option(async => 1) if $async;
if ( $sessionID = $query->cookie("CGISESSID") ) {
C4::Context->_new_userenv($sessionID);
my $session =
- new CGI::Session( "driver:File;serializer:yaml", $sessionID,
+ CGI::Session->new( "driver:File;serializer:yaml", $sessionID,
{ Directory => $sessdir } );
if ( $session->param('cardnumber') ) {
C4::Context->set_userenv(
}
unless ($userid) {
my $session =
- new CGI::Session( "driver:File;serializer:yaml", undef, { Directory => $sessdir } );
+ CGI::Session->new( "driver:File;serializer:yaml", undef, { Directory => $sessdir } );
$sessionID = $session->id;
$userid = $query->param('userid');
C4::Context->_new_userenv($sessionID);
return $cached if $cached;
}
- $cgi //= new CGI;
+ $cgi //= CGI->new;
my $interface = C4::Context->interface;
my $theme = C4::Context->preference( ( $interface eq 'opac' ) ? 'opacthemes' : 'template' );
my $language;
Year => $marc_rec_obj->publication_date,
Abstract => $abstract,
};
- my $style = new Biblio::EndnoteStyle();
+ my $style = Biblio::EndnoteStyle->new();
my $template;
$template.= "DB - DB\n" if C4::Context->preference("LibraryName");
$template.="T1 - Title\n" if $marc_rec_obj->title();
use C4::SIP::Sip qw(siplog);
-my $parser = new XML::Simple(
+my $parser = XML::Simple->new(
KeyAttr => {
login => '+id',
institution => '+id',
$Sip::error_detection = 1;
$/ = "\015\012"; # must use correct record separator
- $sock = new IO::Socket::INET(PeerAddr => $server,
+ $sock = IO::Socket::INET->new(PeerAddr => $server,
Type => SOCK_STREAM);
BAIL_OUT('failed to create connection to server') unless $sock;
use XML::Simple qw(:strict);
use Data::Dumper;
-my $parser = new XML::Simple( KeyAttr => { login => '+id',
+my $parser = XML::Simple->new( KeyAttr => { login => '+id',
institution => '+id',
service => '+port', },
GroupTags => { listeners => 'service',
eval {
$zconns[$i] = C4::Context->Zconn( $servers[$i], 1 );
$query =~ s/:/=/g unless $options{skip_normalize};
- $zoom_queries[$i] = new ZOOM::Query::CCL2RPN( $query, $zconns[$i]);
+ $zoom_queries[$i] = ZOOM::Query::CCL2RPN->new( $query, $zconns[$i]);
$tmpresults[$i] = $zconns[$i]->search( $zoom_queries[$i] );
# error handling
if ($query_type) {
if ($query_type =~ /^ccl/) {
$query_to_use =~ s/\:/\=/g; # change : to = last minute (FIXME)
- $results[$i] = $zconns[$i]->search(new ZOOM::Query::CCL2RPN($query_to_use, $zconns[$i]));
+ $results[$i] = $zconns[$i]->search(ZOOM::Query::CCL2RPN->new($query_to_use, $zconns[$i]));
} elsif ($query_type =~ /^cql/) {
- $results[$i] = $zconns[$i]->search(new ZOOM::Query::CQL($query_to_use, $zconns[$i]));
+ $results[$i] = $zconns[$i]->search(ZOOM::Query::CQL->new($query_to_use, $zconns[$i]));
} elsif ($query_type =~ /^pqf/) {
- $results[$i] = $zconns[$i]->search(new ZOOM::Query::PQF($query_to_use, $zconns[$i]));
+ $results[$i] = $zconns[$i]->search(ZOOM::Query::PQF->new($query_to_use, $zconns[$i]));
} else {
warn "Unknown query_type '$query_type'. Results undetermined.";
}
} elsif ($scan) {
- $results[$i] = $zconns[$i]->scan( new ZOOM::Query::CCL2RPN($query_to_use, $zconns[$i]));
+ $results[$i] = $zconns[$i]->scan( ZOOM::Query::CCL2RPN->new($query_to_use, $zconns[$i]));
} else {
- $results[$i] = $zconns[$i]->search(new ZOOM::Query::CCL2RPN($query_to_use, $zconns[$i]));
+ $results[$i] = $zconns[$i]->search(ZOOM::Query::CCL2RPN->new($query_to_use, $zconns[$i]));
}
};
if ($@) {
sub init {
my ( $class, %needed_flags ) = @_;
- our $query = new CGI;
+ our $query = CGI->new;
my ( $status, $cookie_, $sessionID ) = check_api_auth( $query, \%needed_flags );
$class->return_error( 'auth', $status ) if ( $status ne 'ok' );
- return ( $query, new C4::Output::JSONStream );
+ return ( $query, C4::Output::JSONStream->new );
}
=head2 return_error
sub return_error {
my ( $class, $type, $error, %flags ) = @_;
- my $response = new C4::Output::JSONStream;
+ my $response = C4::Output::JSONStream->new;
$response->param( message => $error ) if ( $error );
$response->param( type => $type, %flags );
sub return_multi {
my ( $class, $responses, @flags ) = @_;
- my $response = new C4::Output::JSONStream;
+ my $response = C4::Output::JSONStream->new;
if ( !@$responses ) {
$class->return_success( $response );
}
};
- my $query = new CGI; # To keep C4::Templates::_get_template_file() from complaining
+ my $query = CGI->new; # To keep C4::Templates::_get_template_file() from complaining
my ( $htdocs, $theme, $lang, $base ) =
C4::Templates::_get_template_file('ill/log/', 'intranet', $query);
my $self = $class->SUPER::new(%args);
$timestamp =~ s/ /T/, $timestamp .= 'Z';
- $self->header( new HTTP::OAI::Header(
+ $self->header( HTTP::OAI::Header->new(
status => 'deleted',
identifier => $args{identifier},
datestamp => $timestamp,
{
return HTTP::OAI::Response->new(
requestURL => $repository->self_url(),
- errors => [ new HTTP::OAI::Error(
+ errors => [ HTTP::OAI::Error->new(
code => 'idDoesNotExist',
message => "There is no biblio record with this identifier",
) ],
sub GetRecords {
my ($class, $self, $repository, $metadata, %args) = @_;
- my $token = new Koha::OAI::Server::ResumptionToken( %args );
+ my $token = Koha::OAI::Server::ResumptionToken->new( %args );
my $dbh = C4::Context->dbh;
my $set;
if ( defined $token->{'set'} ) {
$count++;
if ( $count > $max ) {
$self->resumptionToken(
- new Koha::OAI::Server::ResumptionToken(
+ Koha::OAI::Server::ResumptionToken->new(
metadataPrefix => $token->{metadata_prefix},
from => $token->{from},
until => $token->{until},
} else {
$timestamp =~ s/ /T/;
$timestamp .= 'Z';
- $self->identifier( new HTTP::OAI::Header(
+ $self->identifier( HTTP::OAI::Header->new(
identifier => $repository->{ koha_identifier} . ':' . $biblionumber,
datestamp => $timestamp,
status => $deleted ? 'deleted' : undef
unless ($count) {
return HTTP::OAI::Response->new(
requestURL => $repository->self_url(),
- errors => [ new HTTP::OAI::Error( code => 'noRecordsMatch' ) ],
+ errors => [ HTTP::OAI::Error->new( code => 'noRecordsMatch' ) ],
);
}
unless ($count) {
return HTTP::OAI::Response->new(
requestURL => $repository->self_url(),
- errors => [ new HTTP::OAI::Error( code => 'noRecordsMatch' ) ],
+ errors => [ HTTP::OAI::Error->new( code => 'noRecordsMatch' ) ],
);
}
}
$self->resumptionToken(
- new Koha::OAI::Server::ResumptionToken(
+ Koha::OAI::Server::ResumptionToken->new(
metadataPrefix => $token->{metadata_prefix},
offset => $pos
)
my $self = $class->SUPER::new(%args);
$timestamp =~ s/ /T/, $timestamp .= 'Z';
- $self->header( new HTTP::OAI::Header(
+ $self->header( HTTP::OAI::Header->new(
identifier => $args{identifier},
datestamp => $timestamp,
) );
# Is metadataPrefix supported by the repository?
my $mdp = param('metadataPrefix') || '';
if ( $mdp && !grep { $_ eq $mdp } @{$self->{ koha_metadata_format }} ) {
- push @errs, new HTTP::OAI::Error(
+ push @errs, HTTP::OAI::Error->new(
code => 'cannotDisseminateFormat',
message => "Dissemination as '$mdp' is not supported",
);
$letter->{'title'} =~ s/<<today>>/$today/g;
$letter->{'content'} =~ s/<<today>>/$today/g;
- my $tmpl = C4::Templates::gettemplate('batch/print-notices.tt', 'intranet', new CGI);
+ my $tmpl = C4::Templates::gettemplate('batch/print-notices.tt', 'intranet', CGI->new);
$tmpl->param(
stylesheet => C4::Context->preference("NoticeCSS"),
today => $today,
'su-br',
'su-rl'
);
- my $cgi = new CGI;
+ my $cgi = CGI->new;
my $template = C4::Templates::gettemplate('text/explodedterms.tt', 'opac', $cgi);
my @results;
foreach my $index (@indexes) {
$pdf->mediabox($height/mm, $width/mm);
my $page = $pdf->page();
- my $pdftable = new PDF::Table();
+ my $pdftable = PDF::Table->new();
my $abaskets;
my $arrbasket;
$pdf->mediabox($height/mm, $width/mm);
my $page = $pdf->page();
- my $pdftable = new PDF::Table();
+ my $pdftable = PDF::Table->new();
my $abaskets;
my $arrbasket;
. ( $delivery_library ? "delivery at " . $delivery_library->branchname : "" )
);
- my $pdftable = new PDF::Table();
+ my $pdftable = PDF::Table->new();
my $abaskets;
my $arrbasket;
my @keys = ('Document', 'Qty', 'RRP tax exc.', 'RRP tax inc.', 'Discount', 'Discount price', 'Tax rate', 'Total tax exc.', 'Total tax inc.');
$text->font( $pdf->corefont("Times", -encoding => "utf8"), 6/mm );
$text->translate(30/mm, ($height-28.5)/mm);
$text->text($libraryname);
- my $pdftable = new PDF::Table();
+ my $pdftable = PDF::Table->new();
my $abaskets;
my $arrbasket;
# header of the table
. ( $delivery_library ? "livraison à " . $delivery_library->branchname : "" )
);
- my $pdftable = new PDF::Table();
+ my $pdftable = PDF::Table->new();
my $abaskets;
my $arrbasket;
my @keys = ('Document', 'Qté', 'Prix', 'Prix net', '% Remise', 'Remise', 'Taux TVA', 'Total HT', 'Total TTC');
$text->font( $pdf->corefont("Times", -encoding => "utf8"), 6/mm );
$text->translate(30/mm, ($height-28.5)/mm);
$text->text($libraryname);
- my $pdftable = new PDF::Table();
+ my $pdftable = PDF::Table->new();
my $abaskets;
my $arrbasket;
# header of the table
#use Smart::Comments '####';
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "about.tt",
my @xml_config_warnings;
-my $context = new C4::Context;
+my $context = C4::Context->new;
if ( C4::Context->config('zebra_bib_index_mode')
and C4::Context->config('zebra_bib_index_mode') eq 'grs1' )
use Koha::Patron::Categories;
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh;
# FIXME: This needs to do actual error checking and possibly return user to the same form,
# not just blindly call C4 functions and print a redirect.
-my $input = new CGI;
+my $input = CGI->new;
my $use_ACQ_framework = $input->param('use_ACQ_framework');
# Check if order total amount exceed allowed budget
use Koha::Acquisition::Booksellers;
use Koha::Patrons;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie, $userflags) = get_template_and_user({
template_name => "acqui/addorderiso2709.tt",
query => $input,
exit 0;
}
-my $input = new CGI;
+my $input = CGI->new;
my $name = $input->param('name');
my $category = $input->param('category');
my $default = $input->param('default');
=cut
-our $query = new CGI;
+our $query = CGI->new;
our $basketno = $query->param('basketno');
our $ean = $query->param('ean');
our $booksellerid = $query->param('booksellerid');
use Koha::ItemTypes;
use Koha::Patrons;
-our $input=new CGI;
+our $input=CGI->new;
our ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "acqui/basketgroup.tt",
use Koha::Acquisition::Baskets;
use Koha::AdditionalFields;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "acqui/basketheader.tt",
use C4::Acquisition;
use Koha::Acquisition::Baskets;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
template_name => 'acqui/cancelorder.tt',
query => $input,
=cut
-my $input = new CGI;
+my $input = CGI->new;
my $budget_id = $input->param('budget_id');
my $total = $input->param('total');
use C4::Output;
use C4::Items;
-my $input = new CGI;
+my $input = CGI->new;
my @field = $input->multi_param('field[]');
my @value = $input->multi_param('value[]');
use Koha::Acquisition::Orders;
use Koha::DateUtils qw(dt_from_string output_pref);
-my $input = new CGI;
+my $input = CGI->new;
my $basketno = $input->param('basketno');
my $op = $input->param('op') || 'search'; # search, select, batch_edit
use List::MoreUtils qw/any/;
-my $input=new CGI;
+my $input=CGI->new;
my $flagsrequired = {acquisition => 'order_receive'};
checkauth($input, 0, $flagsrequired, 'intranet');
use Koha::AdditionalFields;
use Koha::DateUtils;
-my $input = new CGI;
+my $input = CGI->new;
my $do_search = $input->param('do_search') || 0;
my $dbh = C4::Context->dbh;
use C4::Acquisition;
use Koha::Misc::Files;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
{
template_name => 'acqui/invoice-files.tt',
use Koha::Misc::Files;
use Koha::Acquisition::Invoice::Adjustments;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
{
template_name => 'acqui/invoice.tt',
use C4::Output;
use C4::Context;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie) = get_template_and_user({
template_name => "acqui/csv/lateorders.tt",
query => $input,
use Koha::Acquisition::Orders;
use Koha::CsvProfiles;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie) = get_template_and_user(
{
template_name => "acqui/lateorders.tt",
use Koha::Acquisition::Booksellers;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
template_name => 'acqui/modordernotes.tt',
query => $input,
use Koha::RecordProcessor;
use Koha::Subscriptions;
-our $input = new CGI;
+our $input = CGI->new;
my $booksellerid = $input->param('booksellerid'); # FIXME: else ERROR!
my $budget_id = $input->param('budget_id') || 0;
my $title = $input->param('title');
use Koha::Acquisition::Booksellers;
-my $query = new CGI;
+my $query = CGI->new;
my $title = $query->param('title_filter');
my $ISSN = $query->param('ISSN_filter');
my $EAN = $query->param('EAN_filter');
use Koha::Acquisition::Booksellers;
-my $input = new CGI;
+my $input = CGI->new;
# getting the CGI params
my $basketno = $input->param('basketno');
use C4::Acquisition;
my $dbh = C4::Context->dbh;
-my $input = new CGI;
+my $input = CGI->new;
my $fund_id = $input->param('fund');
my $fund_code = $input->param('fund_code');
use Koha::ItemTypes;
use Koha::Patrons;
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh;
my $invoiceid = $input->param('invoiceid');
use JSON;
-my $input=new CGI;
+my $input=CGI->new;
my $sticky_filters = $input->param('sticky_filters') || 0;
my ($template, $loggedinuser, $cookie)
use Koha::Acquisition::Orders;
use Koha::Patrons;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
template_name => "acqui/showorder.tt",
query => $cgi,
use Koha::Acquisition::Invoice::Adjustments;
my $dbh = C4::Context->dbh;
-my $input = new CGI;
+my $input = CGI->new;
my $bookfund = $input->param('fund');
my $fund_code = $input->param('fund_code');
use C4::Acquisition;
use Koha::Acquisition::Booksellers;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "acqui/transferorder.tt",
query => $input,
use Koha::Acquisition::Booksellers;
use Koha::Acquisition::Baskets;
-my $input=new CGI;
+my $input=CGI->new;
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "acqui/uncertainprice.tt",
use Koha::Acquisition::Booksellers;
use CGI qw ( -utf8 );
-my $input=new CGI;
+my $input=CGI->new;
checkauth( $input, 0, { acquisition => 'vendors_manage' }, 'intranet' );
use Koha::Acquisition::Booksellers;
use Koha::BiblioFrameworks;
-my $input = new CGI;
+my $input = CGI->new;
my $biblionumber = $input->param('biblionumber')||0;
my $frameworkcode = $input->param('frameworkcode') || q{};
my $title = $input->param('title');
use Koha::Patron::Categories;
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh;
use C4::Output;
use Koha::AdditionalFields;
-my $input = new CGI;
+my $input = CGI->new;
my %flagsrequired;
$flagsrequired{parameters} = 'manage_additional_fields';
use C4::Output;
use Koha::Plugins;
-my $query = new CGI;
+my $query = CGI->new;
my $plugins_enabled = C4::Context->config("enable_plugins");
my $mana_url = C4::Context->config('mana_config');
use C4::Koha;
use Koha::KeyboardShortcuts;
-my $input = new CGI;
+my $input = CGI->new;
my $op = $input->param('op') || 'list';
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
my $dbh = C4::Context->dbh;
-my $input = new CGI;
+my $input = CGI->new;
my $searchfield = $input->param('searchfield') // '';
my $budget_period_id = $input->param('budget_period_id');
use Koha::Acquisition::Currencies;
use Koha::Patrons;
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh;
my ($template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user(
use Koha::Acquisition::Booksellers;
-my $input = new CGI;
+my $input = CGI->new;
my $contractnumber = $input->param('contractnumber');
my $booksellerid = $input->param('booksellerid');
my $op = $input->param('op') || 'list';
use C4::Debug;
use Koha::Acquisition::Currencies;
-our $input = new CGI;
+our $input = CGI->new;
#### $input
my $dbh = C4::Context->dbh;
use Koha::AudioAlert;
use Koha::AudioAlerts;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $selector = $cgi->param('selector');
my $sound = $cgi->param('sound');
return @$rows > 0;
}
-my $input = new CGI;
+my $input = CGI->new;
my $tagfield = $input->param('tagfield');
my $tagsubfield = $input->param('tagsubfield');
my $authtypecode = $input->param('authtypecode');
use Koha::Authority::Types;
# retrieve parameters
-my $input = new CGI;
+my $input = CGI->new;
my $authtypecode = $input->param('authtypecode') || ''; # set to select framework
my $existingauthtypecode = $input->param('existingauthtypecode') || ''; # set when we have to create a new framework (in authtype) by copying an old one (in existingauthtype)
use Koha::AuthorisedValueCategories;
use Koha::Libraries;
-my $input = new CGI;
+my $input = CGI->new;
my $id = $input->param('id');
my $op = $input->param('op') || 'list';
my $searchfield = $input->param('searchfield');
use Koha::Authorities;
use Koha::Authority::Types;
-my $input = new CGI;
+my $input = CGI->new;
my $authtypecode = $input->param('authtypecode');
my $op = $input->param('op') || 'list';
my @messages;
use Koha::BiblioFrameworks;
use Koha::Caches;
-my $input = new CGI;
+my $input = CGI->new;
my $frameworkcode = $input->param('frameworkcode') || q||;
my $op = $input->param('op') || q|list|;
my $cache = Koha::Caches->get_instance();
use C4::Koha;
use C4::Circulation qw{ IsBranchTransferAllowed DeleteBranchTransferLimits CreateBranchTransferLimit };
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "admin/branch_transfer_limits.tt",
use Koha::Patron::Categories;
use Koha::Libraries;
-my $input = new CGI;
+my $input = CGI->new;
my $searchfield = $input->param('description') // q||;
my $categorycode = $input->param('categorycode');
my $op = $input->param('op') // 'list';
=cut
-my $input = new CGI;
+my $input = CGI->new;
my $budget_id = $input->param('budget_id');
my $new_parent_id = $input->param('new_parent');
=cut
my $dbh = C4::Context->dbh;
-my $input = new CGI;
+my $input = CGI->new;
my $total = $input->param('total');
my $budget_id = $input->param('budget_id');
use C4::Biblio;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $borrowernumber, $cookie)
= get_template_and_user({template_name => "admin/checkmarc.tt",
use Koha::Cities;
-my $input = new CGI;
+my $input = CGI->new;
my $city_name_filter = $input->param('city_name_filter') // q||;
my $cityid = $input->param('cityid');
my $op = $input->param('op') || 'list';
my $script_name = "/cgi-bin/koha/admin/classsources.pl";
-my $input = new CGI;
+my $input = CGI->new;
my $op = $input->param('op') || 'list';
my $cn_source = $input->param('cn_source');
my $class_sort_rule = $input->param('class_sort_rule');
use C4::Debug;
use Koha::CirculationRules;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "admin/clone-rules.tt",
use C4::Context;
use C4::Output;
use C4::Utils::DataTables::TablesSettings qw( get_modules );
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use Koha::Account::CreditType;
use Koha::Account::CreditTypes;
-my $input = new CGI;
+my $input = CGI->new;
my $code = $input->param('code');
my $op = $input->param('op') || 'list';
my @messages;
use Koha::Account::DebitType;
use Koha::Account::DebitTypes;
-my $input = new CGI;
+my $input = CGI->new;
my $code = $input->param('code');
my $op = $input->param('op') || 'list';
my @messages;
use Koha::Desks;
-my $input = new CGI;
+my $input = CGI->new;
my $searchfield = $input->param('desk_name') // q||;
my $desk_id = $input->param('desk_id') || '';
my $op = $input->param('op') || 'list';
use Module::Load::Conditional qw(can_load);
use JSON;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "admin/didyoumean.tt",
$authenticated = 1;
}
-my $input = new CGI;
+my $input = CGI->new;
unless ($authenticated) {
print $input->header(-type => 'text/plain', -status => '403 Forbidden');
show => \&show,
toggle => \&toggle,
);
- my $input = new CGI;
+ my $input = CGI->new;
my $action = $input->param('action') || 'show';
if (not exists $handler{$action}) {
my $status = 400;
use Koha::Item::Search::Field qw(GetItemSearchField ModItemSearchField);
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ($template, $borrowernumber, $cookie) = get_template_and_user({
template_name => 'admin/items_search_field.tt',
use Koha::Item::Search::Field qw(AddItemSearchField GetItemSearchFields DelItemSearchField);
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ($template, $borrowernumber, $cookie) = get_template_and_user({
template_name => 'admin/items_search_fields.tt',
use Koha::ItemType;
use Koha::Localizations;
-my $input = new CGI;
+my $input = CGI->new;
my $searchfield = $input->param('description');
my $itemtype_code = $input->param('itemtype');
my $op = $input->param('op') // 'list';
use Koha::Caches;
use Koha::MarcSubfieldStructures;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
{
use Koha::Library::Group;
use Koha::Library::Groups;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use CGI qw( -utf8 );
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{ template_name => "admin/localization.tt",
return @$rows > 0;
}
-my $input = new CGI;
+my $input = CGI->new;
my $tagfield = $input->param('tagfield');
my $tagsubfield = $input->param('tagsubfield');
my $frameworkcode = $input->param('frameworkcode');
use Koha::BiblioFrameworks;
# retrieve parameters
-my $input = new CGI;
+my $input = CGI->new;
my $frameworkcode = $input->param('frameworkcode') || ''; # set to select framework
my $existingframeworkcode = $input->param('existingframeworkcode') || '';
my $searchfield = $input->param('searchfield') || 0;
my $script_name = "/cgi-bin/koha/admin/matching-rules.pl";
-our $input = new CGI;
+our $input = CGI->new;
my $op = $input->param('op') || '';
use Data::Dumper;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
template_name => 'admin/oai_set_mappings.tt',
query => $input,
use Data::Dumper;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
template_name => 'admin/oai_sets.tt',
query => $input,
my $script_name = "/cgi-bin/koha/admin/patron-attr-types.pl";
-our $input = new CGI;
+our $input = CGI->new;
my $op = $input->param('op') || '';
foreach my $file ( glob( "$htdocs/$theme/$lang/modules/admin/preferences/*.pref" ) ) {
my ( $tab ) = ( $file =~ /([a-z0-9_-]+)\.pref$/ );
- $results{$tab} = $open_files ? new IO::File( $file, 'r' ) : '';
+ $results{$tab} = $open_files ? IO::File->new( $file, 'r' ) : '';
}
return %results;
}
my $dbh = C4::Context->dbh;
-our $input = new CGI;
+our $input = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{ template_name => "admin/preferences.tt",
use Module::Load::Conditional qw(can_load);
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => 'admin/searchengine/elasticsearch/mappings.tt',
use Koha::SharedContent;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "admin/share_content.tt",
use Koha::SMS::Provider;
use Koha::SMS::Providers;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
# Initialize CGI, template
-my $input = new CGI;
+my $input = CGI->new;
my $mapstr = $input->param('mapping')//'';
my $type = $input->param('type')//'';
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( {
return $params;
}
-my $input = new CGI;
+my $input = CGI->new;
my $searchfield = $input->param('searchfield') || '';
my $Tvalue = $input->param('Tvalue');
my $offset = $input->param('offset') || 0;
use Data::Dumper;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "admin/transport-cost-matrix.tt",
use Koha::DateUtils qw( dt_from_string output_pref );
use Koha::Libraries;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "admin/usage_statistics.tt",
# Initialize CGI, template, database
-my $input = new CGI;
+my $input = CGI->new;
my $op = $input->param('op') || 'list';
my $id = $input->param('id') || 0;
my $type = $input->param('type') || '';
use Koha::Authority::Types;
-my $query = new CGI;
+my $query = CGI->new;
my $op = $query->param('op') || '';
my $authtypecode = $query->param('authtypecode') || '';
my $index = $query->param('index') || '';
use Koha::Token;
use Koha::Z3950Servers;
-my $query = new CGI;
+my $query = CGI->new;
my $dbh = C4::Context->dbh;
my $op = $query->param('op') || '';
my $authtypecode = $query->param('authtypecode') || '';
# ========================
# MAIN
#=========================
-my $input = new CGI;
+my $input = CGI->new;
my $z3950 = $input->param('z3950');
my $error = $input->param('error');
my $authid=$input->param('authid'); # if authid exists, it's a modif, not a new authority.
use Koha::Authorities;
use Koha::Authority::Types;
-my $query = new CGI;
+my $query = CGI->new;
my $dbh = C4::Context->dbh;
use Koha::Authorities;
use Koha::Authority::Types;
-my $query=new CGI;
+my $query=CGI->new;
my $dbh=C4::Context->dbh;
#
-my $query=new CGI;
+my $query=CGI->new;
my $dbh=C4::Context->dbh;
use C4::AuthoritiesMarc;
use CGI qw ( -utf8 );
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "tools/export.tt",
use Koha::Authority::Types;
use Koha::MetadataRecord::Authority;
-my $input = new CGI;
+my $input = CGI->new;
my @authid = $input->multi_param('authid');
my $merge = $input->param('merge');
use Koha::SearchEngine::Search;
use Koha::SearchEngine::QueryBuilder;
-my $query = new CGI;
+my $query = CGI->new;
my ( $auth_status, $sessionID ) = check_cookie_auth( $query->cookie('CGISESSID'), { catalogue => 1 } );
use Koha::AuthorisedValues;
use Koha::CsvProfiles;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
{
use Koha::CsvProfiles;
use utf8;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
{
use Koha::RecordProcessor;
-my $query = new CGI;
+my $query = CGI->new;
my $dbh = C4::Context->dbh;
my $biblionumber = $query->param('biblionumber');
use List::MoreUtils qw( uniq );
-my $query = new CGI;
+my $query = CGI->new;
my $dbh = C4::Context->dbh;
my $biblionumber = $query->param('biblionumber');
$biblionumber = HTML::Entities::encode($biblionumber);
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
template_name => "tools/export.tt",
query => $query,
use Koha::Items;
use Koha::ItemTypes;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $status, $cookie, $sessionID ) = C4::Auth::check_api_auth( $cgi, { acquisition => 'order_receive' } );
unless ($status eq "ok") {
$| = 1;
my $DEBUG = 0;
-my $data = new CGI;
+my $data = CGI->new;
my $imagenumber;
=head1 NAME
use Koha::Items;
use Koha::Patrons;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => "catalogue/imageviewer.tt",
use Koha::Biblios;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => "catalogue/issuehistory.tt",
use C4::Auth;
use C4::Output;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ($template, $borrowernumber, $cookie) = get_template_and_user({
template_name => 'catalogue/itemsearch_csv.tt',
use Koha::ItemTypes;
use Koha::Libraries;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my %params = $cgi->Vars;
my $format = $cgi->param('format');
use Koha::BiblioFrameworks;
use Koha::Patrons;
-my $query = new CGI;
+my $query = CGI->new;
my $dbh = C4::Context->dbh;
my $biblionumber = $query->param('biblionumber');
$biblionumber = HTML::Entities::encode($biblionumber);
use Koha::Items;
use Koha::Patrons;
-my $query=new CGI;
+my $query=CGI->new;
my ($template, $loggedinuser, $cookie) = get_template_and_user(
{
use C4::Search::History;
use C4::Output;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ($template, $loggedinuser, $cookie) = get_template_and_user({
template_name => 'catalogue/search-history.tt',
# create a new CGI object
# FIXME: no_undef_params needs to be tested
use CGI qw('-no_undef_params' -utf8 );
-my $cgi = new CGI;
+my $cgi = CGI->new;
# decide which template to use
my $template_name;
use C4::ImportBatch;
use C4::XSLT ();
-my $input= new CGI;
+my $input= CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "catalogue/showmarc.tt",
use Koha::StockRotationStages;
use Koha::Util::StockRotation qw(:ALL);
-my $input = new CGI;
+my $input = CGI->new;
unless (C4::Context->preference('StockRotation')) {
# redirect to Intranet home if self-check is not enabled
use C4::Circulation;
use C4::Reserves;
-my $cgi= new CGI;
+my $cgi= CGI->new;
checkauth($cgi, 0, {circulate => 'circulate_remaining_permissions'}, 'intranet');
# ========================
# MAIN
#=========================
-my $input = new CGI;
+my $input = CGI->new;
my $error = $input->param('error');
my $biblionumber = $input->param('biblionumber'); # if biblionumber exists, it's a modif, not a new biblio.
my $parentbiblio = $input->param('parentbiblionumber');
use Koha::SearchEngine::QueryBuilder;
use Koha::Z3950Servers;
-my $input = new CGI;
+my $input = CGI->new;
my $success = $input->param('biblioitem');
my $query = $input->param('q');
}
if ($frameworkcode eq 'FA' && $subfieldlib->{kohafield} eq 'items.barcode' && !$value){
- my $input = new CGI;
+ my $input = CGI->new;
$value = $input->param('barcode');
}
}
-my $input = new CGI;
+my $input = CGI->new;
my $error = $input->param('error');
my $biblionumber;
use Koha::Items;
use Koha::MetadataRecord;
-my $input = new CGI;
+my $input = CGI->new;
my @biblionumbers = $input->multi_param('biblionumber');
my $merge = $input->param('merge');
foreach my $biblionumber (@biblionumbers) {
my $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
my $frameworkcode = GetFrameworkCode($biblionumber);
- my $recordObj = new Koha::MetadataRecord({'record' => $marcrecord, schema => $marcflavour});
+ my $recordObj = Koha::MetadataRecord->new({'record' => $marcrecord, schema => $marcflavour});
my $record = {
recordid => $biblionumber,
record => $marcrecord,
use Koha::FrameworkPlugin;
-my $input = new CGI;
+my $input = CGI->new;
my $plugin= Koha::FrameworkPlugin->new( {
name => scalar $input->param("plugin_name"),
});
sub plugin {
my ($input) = @_;
- my $query=new CGI;
+ my $query=CGI->new;
my $op = $query->param('op');
my $authtypecode = $query->param('authtypecode');
my $index = $query->param('index');
sub plugin {
my ($input) = @_;
my $dbh = C4::Context->dbh;
- my $query = new CGI;
+ my $query = CGI->new;
my $op = $query->param('op');
my $type = $query->param('type');
my $startfrom = $query->param('startfrom');
use C4::Auth qw/check_cookie_auth/;
use JSON qw/ to_json /;
-my $input = new CGI;
+my $input = CGI->new;
my $query = $input->param('term');
my $table = $input->param('table');
my $field = $input->param('field');
use C4::Breeding;
use C4::Koha;
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh;
my $error = $input->param('error');
my $authid = $input->param('authid') || 0;
use C4::Breeding;
use C4::Koha;
-my $input = new CGI;
+my $input = CGI->new;
my $error = $input->param('error');
my $biblionumber = $input->param('biblionumber') || 0;
my $frameworkcode = $input->param('frameworkcode');
use C4::Templates;
use Koha::Util::Navigation;
-my $query = new CGI;
+my $query = CGI->new;
my $language = $query->param('language');
my $url = Koha::Util::Navigation::local_referer($query, {remove_language => 1, staff => 1});
use C4::Output;
use Koha::Patron::Message;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "circ/circulation.tt",
use Koha::ArticleRequests;
use Koha::Patrons;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $id = $cgi->param('id');
use C4::Output;
use Koha::ArticleRequests;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "circ/article-requests.tt",
use Koha::DateUtils;
use Koha::Libraries;
-my $input = new CGI;
+my $input = CGI->new;
my $itm = $input->param('itm');
my $biblionumber = $input->param('biblionumber');
=cut
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh;
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user({
###############################################
# Getting state
-my $query = new CGI;
+my $query = CGI->new;
if (!C4::Context->userenv){
my $sessionID = $query->cookie("CGISESSID");
use C4::Auth;
use Koha::Checkouts;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use Koha::BiblioFrameworks;
use Koha::Checkouts;
-my $query = new CGI;
+my $query = CGI->new;
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user(
{
template_name => "circ/circulation-home.tt",
#
# PARAMETERS READING
#
-my $query = new CGI;
+my $query = CGI->new;
my $override_high_holds = $query->param('override_high_holds');
my $override_high_holds_tmp = $query->param('override_high_holds_tmp');
use C4::Output;
use Koha::Patron::Messages;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "circ/circulation.tt",
$debug = $ENV{DEBUG} || 0;
}
-my $input = new CGI;
+my $input = CGI->new;
my $sessionID = $input->cookie("CGISESSID");
my $session = get_session($sessionID);
use CGI qw ( -utf8 );
use C4::Auth;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
{
template_name => "circ/offline-mf.tt",
use C4::Output;
use C4::Context;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
{
template_name => "circ/offline.tt",
use C4::Koha;
use Koha::BiblioFrameworks;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
{
use DateTime;
use DateTime::Format::MySQL;
-my $input = new CGI;
+my $input = CGI->new;
my $showall = $input->param('showall');
my $bornamefilter = $input->param('borname') || '';
my $borcatfilter = $input->param('borcat') || '';
use Koha::Holds;
use DateTime::Duration;
-my $input = new CGI;
+my $input = CGI->new;
my $startdate = $input->param('from');
my $enddate = $input->param('to');
my $theme = $input->param('theme'); # only used if allowthemeoverride is set
use Koha::Database;
use Koha::BiblioFrameworks;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $librarian, $cookie, $flags ) = get_template_and_user(
{
use Koha::Patrons;
use Koha::ArticleRequests;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
{
use Koha::DateUtils;
use Koha::Acquisition::Baskets;
-my $input = new CGI;
+my $input = CGI->new;
my $startdate = $input->param('from');
my $enddate = $input->param('to');
my $ratio = $input->param('ratio');
use Koha::Items;
use Koha::Patrons;
-my $query = new CGI;
+my $query = CGI->new;
#getting the template
my ( $template, $librarian, $cookie, $flags ) = get_template_and_user(
$debug = $ENV{DEBUG} || 0;
}
-my $input = new CGI;
+my $input = CGI->new;
my $sessionID = $input->cookie("CGISESSID");
my $session = get_session($sessionID);
use Koha::BiblioFrameworks;
use Koha::Patrons;
-my $input = new CGI;
+my $input = CGI->new;
my $itemnumber = $input->param('itemnumber');
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
use Koha::BiblioFrameworks;
use Koha::ItemTypes;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
{
template_name => "circ/view_holdsqueue.tt",
use Koha::ItemTypes;
use Koha::Patrons;
-my $input = new CGI;
+my $input = CGI->new;
my $item = $input->param('itemnumber');
my $borrowernumber = $input->param('borrowernumber');
use C4::Auth qw/check_cookie_auth/;
use C4::Debug;
-my $input = new CGI;
+my $input = CGI->new;
my $query = $input->param('term');
my $attrcode = $input->path_info || '';
$attrcode =~ s|^/||;
use JSON qw( to_json );
-my $input = new CGI;
+my $input = CGI->new;
my $query = $input->param('term');
binmode STDOUT, ":encoding(UTF-8)";
use C4::Output;
use Koha::Clubs;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use Koha::Clubs;
use Koha::Club::Fields;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use Koha::Clubs;
use Koha::Club::Templates;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use Koha::Patrons;
use Koha::Club::Enrollments;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use C4::Output;
use Koha::Clubs;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use Koha::Database;
my $schema = Koha::Database->new()->schema();
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use Koha::Items;
use Koha::ItemTypes;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $action = $cgi->param('action') || '';
my $course_id = $cgi->param('course_id') || '';
use Koha::Items;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $action = $cgi->param('action') || q{};
my $course_id = $cgi->param('course_id') || q{};
use C4::CourseReserves qw(DelCourseReserve GetCourse GetCourseReserves);
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $action = $cgi->param('action') || '';
my $course_id = $cgi->param('course_id');
use C4::CourseReserves qw(GetCourses);
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use C4::CourseReserves qw(GetCourse);
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "course_reserves/course.tt",
use C4::CourseReserves qw(DelCourse ModCourse ModCourseInstructors);
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "about.tt",
query => $cgi,
use C4::Context;
use CGI qw ( -utf8 );
-my $cgi = new CGI;
+my $cgi = CGI->new;
print CGI::header('-type'=>'text/plain', '-charset'=>'utf-8');
# URL Of the CAS Server
my $casServerUrl = 'https://localhost:8443/cas/';
my $cas = Authen::CAS::Client->new($casServerUrl);
-my $cgi = new CGI;
+my $cgi = CGI->new;
# URL of the service we're requesting a Service Ticket for (typically this very same page)
my $proxy_service = $cgi->url;
my $casServerUrl = 'https://localhost:8443/cas/';
my $cas = Authen::CAS::Client->new($casServerUrl);
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $proxy_service = $cgi->url;
# URL of the service we'd like to be proxy for (typically the Koha webservice we want to query)
my $target_service = "https://.../koha_webservice.pl";
-my $cgi = new CGI;
+my $cgi = CGI->new;
print $cgi->header({-type => 'text/html'});
print $cgi->start_html("proxy cas");
use C4::Context;
use Koha::Manual;
-my $query = new CGI;
+my $query = CGI->new;
# We need to call get_template_and_user to let it does the job correctly
# for the language
use Koha;
-my $query = new CGI;
+my $query = CGI->new;
my $step = $query->param('step');
my $language = $query->param('language');
use Koha::CirculationRules;
#Setting variables
-my $input = new CGI;
+my $input = CGI->new;
unless ( C4::Context->preference('Version') ) {
print $input->redirect("/cgi-bin/koha/installer/install.pl");
use C4::Creators;
use C4::Labels;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $batch_id;
my @label_ids;
use C4::Creators;
use C4::Labels;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( undef, $loggedinuser, $cookie ) = get_template_and_user({
template_name => "labels/label-home.tt",
use C4::Creators;
use C4::Labels;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $batch_id;
my @label_ids;
use Koha::Items;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "labels/label-edit-batch.tt",
use C4::Creators;
use C4::Labels;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "labels/label-edit-layout.tt",
use C4::Creators;
use C4::Labels;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "labels/label-edit-profile.tt",
use C4::Auth qw(get_template_and_user);
use C4::Output qw(output_html_with_http_headers);
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "labels/label-edit-range.tt",
use C4::Creators;
use C4::Labels;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "labels/label-edit-template.tt",
use C4::Auth qw(get_template_and_user);
use C4::Output qw(output_html_with_http_headers);
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "labels/label-home.tt",
}
}
-my $query = new CGI;
+my $query = CGI->new;
my $type = $query->param('type');
my $op = $query->param('op') || '';
use C4::Creators;
use C4::Labels;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "labels/label-manage.tt",
use C4::Creators::Lib qw(get_all_templates get_all_layouts get_output_formats);
use C4::Labels::Batch;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "labels/label-print.tt",
# use Smart::Comments;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "labels/spinelabel-home.tt",
query => $query,
use C4::Output;
my $scheme = C4::Context->preference('SpineLabelFormat');
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "labels/spinelabel-print.tt",
query => $query,
use Koha::Quotes;
use Koha::Suggestions;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
{
use Koha::Patrons;
use Koha::Account::Lines;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use Koha::Patrons;
use Koha::Token;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => 'members/apikeys.tt',
use Koha::Patron::Categories;
use Koha::Items;
-my $input=new CGI;
+my $input=CGI->new;
my ($template, $loggedinuser, $cookie) = get_template_and_user(
use Koha::Token;
use Koha::Patron::Categories;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "members/deletemem.tt",
use Koha::DateUtils;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user({
template_name => 'members/discharge.tt',
use C4::Context;
use Koha::Patron::Discharge;
-my $input = new CGI;
+my $input = CGI->new;
my $op = $input->param('op') // 'list';
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user({
use Koha::Patron::Categories;
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh;
use C4::Output;
use Koha::Patrons;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use Koha::Token;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "members/mancredit.tt",
use Koha::Patron::Categories;
use Koha::Account::DebitTypes;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "members/maninvoice.tt",
use C4::Output;
use Koha::Token;
-my $input = new CGI;
+my $input = CGI->new;
my $flagsrequired = { permissions => 1 };
my $member=$input->param('member');
use Try::Tiny;
-my $input = new CGI;
+my $input = CGI->new;
my $theme = $input->param('theme') || "default";
use Koha::List::Patron;
use Koha::Patrons;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "members/member.tt",
$debug = $ENV{DEBUG} || 0;
}
-my $input = new CGI;
+my $input = CGI->new;
($debug) or $debug = $input->param('debug') || 0;
my %data;
use Koha::List::Patron;
use Koha::Patron::Categories;
-my $query = new CGI;
+my $query = CGI->new;
my ($template, $loggedinuser, $cookie, $flags)
= get_template_and_user({template_name => "members/member.tt",
use Koha::Patrons;
use Koha::Patron::Modifications;
-my $query = new CGI;
+my $query = CGI->new;
# FIXME Should be a checkauth call
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
use List::MoreUtils qw( uniq );
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
{ template_name => "members/members-update.tt",
use C4::Context;
use Koha::Patrons;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
{
use Koha::DateUtils;
use Koha::Patron::Debarments;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $loggedinuserid, $cookie, $sessionID ) = checkauth( $cgi, 0, { borrowers => 'edit_borrowers' }, 'intranet' );
use Koha::Patrons;
use Koha::Patron::Categories;
-my $input=new CGI;
+my $input=CGI->new;
my $borrowernumber = $input->param('borrowernumber');
$|=1;
my $DEBUG = 0;
-my $query = new CGI;
+my $query = CGI->new;
my $borrowernumber;
=head1 NAME
use Koha::Patrons;
-my $input = new CGI;
+my $input = CGI->new;
my $flagsrequired = { circulate => "circulate_remaining_permissions" };
use Koha::Patrons;
use Koha::Patron::Categories;
-my $input=new CGI;
+my $input=CGI->new;
my ($template, $loggedinuser, $cookie)
use Koha::Patrons;
use Koha::Patron::Categories;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "members/printinvoice.tt",
$debug = $ENV{DEBUG} || 0;
}
-my $input = new CGI;
+my $input = CGI->new;
my $sessionID = $input->cookie("CGISESSID");
my $session = get_session($sessionID);
use C4::Suggestions;
use Koha::Patrons;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "members/purchase-suggestions.tt",
use Koha::Patrons;
use CGI::Session;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
{
use Koha::Patrons;
-my $input = new CGI;
+my $input = CGI->new;
my ( $loggedinuserid ) = checkauth($input, 0, { borrowers => 'edit_borrowers' }, 'intranet');
use Koha::Patrons;
use Koha::Patron::Categories;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "members/statistics.tt",
# use Smart::Comments;
my $dbh = C4::Context->dbh;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
return("error",undef);
}
my $oAResult;
- my $Anewq= new ZOOM::Query::PQF($nquery);
+ my $Anewq= ZOOM::Query::PQF->new($nquery);
eval {
$oAResult= $oAuth->search_pqf($nquery) ;
};
my $self = {};
my ($class, $timeout, $agent) = @_;
- my $uagent = new LWP::UserAgent;
+ my $uagent = LWP::UserAgent->new;
$uagent->agent( $agent ) if $agent;
$uagent->timeout( $timeout) if $timeout;
$self->{ user_agent } = $uagent;
my $checker = C4::URL::Checker->new($timeout,$agent);
$checker->{ host_default } = $host;
- my $context = new C4::Context( );
+ my $context = C4::Context->new( );
my $dbh = $context->dbh;
my $sth = $dbh->prepare(
"SELECT biblionumber FROM biblioitems WHERE url <> ''" );
}
}
- my $index = new ZebraIndex( $cloud->{ZebraIndex} );
+ my $index = ZebraIndex->new( $cloud->{ZebraIndex} );
$index->scan( $cloud->{Count} );
open my $fh, ">", $cloud->{Output}
my $template =
C4::Templates::gettemplate( 'batch/print-notices.tt', 'intranet',
- new CGI );
+ CGI->new );
$template->param(
stylesheet => C4::Context->preference("NoticeCSS"),
unless ($c_marc_field) {
if ( defined $c_subfield ) {
$biblio->add_fields(
- new MARC::Field(
+ MARC::Field->new(
$c_field, ' ', ' ', $c_subfield => $c_db_value
)
);
}
else {
- $biblio->add_fields( new MARC::Field( $c_field, $c_db_value ) );
+ $biblio->add_fields( MARC::Field->new( $c_field, $c_db_value ) );
}
$debug and warn "[WARN] $c_field did not exist.";
$c_marc_field = $biblio->field($c_field);
unless ($m_marc_field) {
if ( defined $m_subfield ) {
$biblio->add_fields(
- new MARC::Field(
+ MARC::Field->new(
$m_field, ' ', ' ', $m_subfield => $m_db_value
)
);
}
else {
- $biblio->add_fields( new MARC::Field( $m_field, $m_db_value ) );
+ $biblio->add_fields( MARC::Field->new( $m_field, $m_db_value ) );
}
$debug and warn "[WARN] $m_field did not exist.";
my $translations = {};
if ($dump_pot) {
- $translations->{''} = new Locale::PO(
+ $translations->{''} = Locale::PO->new(
-msgid => '',
-msgstr => "Project-Id-Version: Koha\n" .
"POT-Creation-Date: " . time2str('%Y-%m-%d %R%z', time) . "\n" .
);
while (my ($category, $values) = each %$authorised_values) {
foreach my $authorised_value (@$values) {
- $translations->{$authorised_value->{lib}} = new Locale::PO(
+ $translations->{$authorised_value->{lib}} = Locale::PO->new(
-msgid => $authorised_value->{lib},
-msgstr => '',
);
}
}
for my $tag (@tags) {
- $translations->{$tag->{liblibrarian}} = new Locale::PO(
+ $translations->{$tag->{liblibrarian}} = Locale::PO->new(
-msgid => $tag->{liblibrarian},
-msgstr => '',
);
}
for my $subfield (@subfields) {
- $translations->{$subfield->{liblibrarian}} = new Locale::PO(
+ $translations->{$subfield->{liblibrarian}} = Locale::PO->new(
-msgid => $subfield->{liblibrarian},
-msgstr => '',
);
}
for my $authtype (@$authtypes) {
- $translations->{$authtype->{authtypetext}} = new Locale::PO(
+ $translations->{$authtype->{authtypetext}} = Locale::PO->new(
-msgid => $authtype->{authtypetext},
-msgstr => '',
);
}
for my $authtag (@authtags) {
- $translations->{$authtag->{liblibrarian}} = new Locale::PO(
+ $translations->{$authtag->{liblibrarian}} = Locale::PO->new(
-msgid => $authtag->{liblibrarian},
-msgstr => '',
);
}
for my $authsubfield (@authsubfields) {
- $translations->{$authsubfield->{liblibrarian}} = new Locale::PO(
+ $translations->{$authsubfield->{liblibrarian}} = Locale::PO->new(
-msgid => $authsubfield->{liblibrarian},
-msgstr => '',
);;
my $target = shift;
my $po;
- my $po_head = new Locale::PO;
+ my $po_head = Locale::PO->new;
$po_head->{msgid} = "\"\"";
$po_head->{msgstr} = "".
"Project-Id-Version: Koha Project - Installation files\\n" .
$line =~ s/(<<.*?>>|\[\%.*?\%\]|<.*?>)/\%s/g; # put placeholders
next if ( $line =~ /^(\s|%s|-|[[:punct:]]|\(|\))*$/ or length($line) < 2 ); # discard non strings
if ( not $po->{ $line } ) {
- my $msg = new Locale::PO(
+ my $msg = Locale::PO->new(
-msgid => $line, -msgstr => '',
-reference => "$dir/$file:$table_name:$tablec:row:$rowc:mul:$mulc" );
$po->{ $line } = $msg;
} else {
if ( defined $row->{$field} and length($row->{$field}) > 1 # discard null values and small strings
and not $po->{ $row->{$field} } ) {
- my $msg = new Locale::PO(
+ my $msg = Locale::PO->new(
-msgid => $row->{$field}, -msgstr => '',
-reference => "$dir/$file:$table_name:$tablec:row:$rowc" );
$po->{ $row->{$field} } = $msg;
for my $description ( @{ $yaml->{'description'} } ) {
$desccount++;
if ( length($description) > 1 and not $po->{ $description } ) {
- my $msg = new Locale::PO(
+ my $msg = Locale::PO->new(
-msgid => $description, -msgstr => '',
-reference => "$dir/$file:description:$desccount" );
$po->{ $description } = $msg;
}
- my $jsonobj = new JSON;
+ my $jsonobj = JSON->new;
my $basename = basename($src);
$basename =~ s/\.pot?$//;
if ($pretty)
use C4::Context;
use C4::Koha;
-my $query = new CGI;
+my $query = CGI->new;
checkauth( $query, undef, { circulate => "circulate_remaining_permissions" },
"intranet" );
use C4::Output;
use Koha::Patrons;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use C4::Output;
use Koha::Clubs;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use C4::Output;
use C4::Context;
-my $query = new CGI;
+my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use C4::Output;
use C4::Context;
-my $query = new CGI;
+my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use C4::Output;
use C4::Context;
-my $query = new CGI;
+my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use C4::Output;
use C4::Context;
-my $query = new CGI;
+my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use C4::Output;
use C4::Context;
-my $query = new CGI;
+my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use C4::Output;
use C4::Context;
-my $query = new CGI;
+my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use Koha::ExternalContent::OverDrive;
my $logger = Koha::Logger->get({ interface => 'opac' });
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $user, $cookie, $sessionID, $flags ) = checkauth( $cgi, 1, {}, 'opac' );
my ($redirect_page, $error);
=cut
# Instanciate the CGI request
-my $cgi = new CGI;
+my $cgi = CGI->new;
# List of available services, sorted by level
my @services = (
use Koha;
-my $query = new CGI;
+my $query = CGI->new;
my $template = C4::Templates::gettemplate( 'maintenance.tt', 'opac', $query );
my $koha_db_version = C4::Context->preference('Version');
use Koha::Database;
use Koha::Patrons;
-my $cgi = new CGI;
+my $cgi = CGI->new;
unless ( C4::Context->preference('EnablePayPalOpacPayments') ) {
print $cgi->redirect("/cgi-bin/koha/errors/404.pl");
use C4::Auth;
use Koha::Plugins::Handler;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $userid, $cookie, $sessionID, $flags ) = checkauth( $cgi, 0, {}, 'opac' );
use Koha::Database;
use Koha::Plugins::Handler;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $payment_method = $cgi->param('payment_method');
my @accountlines = $cgi->multi_param('accountline');
use Koha::Patrons;
use Koha::Plugins;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => "opac-account.tt",
use Koha::Biblios;
use Koha::Virtualshelves;
-my $query = new CGI;
+my $query = CGI->new;
my @biblionumbers = $query->multi_param('biblionumber');
my $selectedshelf = $query->param('selectedshelf');
my $newshelf = $query->param('newshelf');
use C4::Serials;
-my $query = new CGI;
+my $query = CGI->new;
my $op = $query->param('op') || '';
my $dbh = C4::Context->dbh;
use C4::Auth;
use Koha::ArticleRequests;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
use Koha::SearchEngine::Search;
use Koha::SearchEngine::QueryBuilder;
-my $query = new CGI;
+my $query = CGI->new;
my $op = $query->param('op') || '';
my $authtypecode = $query->param('authtypecode') || '';
my $dbh = C4::Context->dbh;
use Koha::Authorities;
use Koha::Authority::Types;
-my $query = new CGI;
+my $query = CGI->new;
my $dbh = C4::Context->dbh;
use Koha::CsvProfiles;
use Koha::AuthorisedValues;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
{
use C4::Output;
use C4::Context;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => "opac-blocked.tt",
use JSON;
use Unicode::Collate;
-my $query = new CGI;
+my $query = CGI->new;
binmode STDOUT, ':encoding(UTF-8)';
# If calling via JS, 'api' is used to route to correct step in process
use CGI qw ( -utf8 );
use C4::Biblio;
-my $query = new CGI;
+my $query = CGI->new;
my $dbh = C4::Context->dbh;
use C4::Templates;
use Koha::Util::Navigation;
-my $query = new CGI;
+my $query = CGI->new;
my $language = $query->param('language');
my $url = Koha::Util::Navigation::local_referer($query, { remove_language => 1 });
use C4::CourseReserves qw(GetCourse GetCourseReserves);
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{ template_name => "opac-course-details.tt",
use C4::CourseReserves qw(SearchCourses);
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{ template_name => "opac-course-reserves.tt",
use Koha::Patron::Discharge;
use Koha::DateUtils;
-my $input = new CGI;
+my $input = CGI->new;
unless ( C4::Context->preference('useDischarge') ) {
print $input->redirect("/cgi-bin/koha/errors/404.pl");
use Koha::Virtualshelves;
use utf8;
-my $query = new CGI;
+my $query = CGI->new;
# if virtualshelves is disabled, leave immediately
if ( ! C4::Context->preference('virtualshelves') ) {
use C4::Members;
use Koha::DateUtils;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => "opac-ics.tt",
use C4::Search;
use C4::Output;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => "opac-idref.tt",
use Koha::Patrons;
use Koha::Illrequest::Availability;
-my $query = new CGI;
+my $query = CGI->new;
# Grab all passed data
# 'our' since Plack changes the scoping
$| = 1;
my $DEBUG = 0;
-my $data = new CGI;
+my $data = CGI->new;
my $imagenumber;
=head1 NAME
use Koha::CoverImages;
use Koha::Items;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => "opac-imageviewer.tt",
use Koha::DateUtils;
use Koha::Patrons;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
use Koha::Holds;
use Koha::News;
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
use Koha::Patron::Categories;
use Koha::Token;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $dbh = C4::Context->dbh;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
use C4::Output;
use C4::Reserves;
use C4::Auth;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => "opac-account.tt",
use C4::Reserves;
use C4::Auth;
use Koha::Holds;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
use C4::NewsChannels; # GetNewsToDisplay
use C4::Languages qw(getTranslatedLanguages accept_language);
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
use C4::Auth qw(:DEFAULT get_session);
use C4::Output;
-my $cgi = new CGI;
+my $cgi = CGI->new;
# Getting the template and auth
my ($template, $loggedinuser, $cookie)
use Try::Tiny;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
qw(SendPasswordRecoveryEmail ValidateBorrowernumber GetValidLinkInfo CompletePasswordRecovery DeleteExpiredPasswordRecovery);
use Koha::Patrons;
use Koha::Patrons;
-my $query = new CGI;
+my $query = CGI->new;
use HTML::Entities;
use Try::Tiny;
use List::Util qw/any/;
use constant GDPR_PROCESSING => 'GDPR_PROCESSING';
-my $query = new CGI;
+my $query = CGI->new;
my $op = $query->param('op') // q{};
my $gdpr_check = $query->param('gdpr_processing') // q{};
use C4::Auth qw(:DEFAULT check_cookie_auth);
use Koha::Patron::Images;
-my $query = new CGI;
+my $query = CGI->new;
unless (C4::Context->preference('OPACpatronimages')) {
print $query->header(status => '403 Forbidden - displaying patron images in the OPAC not enabled');
use C4::Output;
use Koha::Patrons;
-my $query = new CGI;
+my $query = CGI->new;
# if OPACPrivacy is disabled, leave immediately
if ( ! C4::Context->preference('OPACPrivacy') || ! C4::Context->preference('opacreadinghistory') ) {
use Koha::ItemTypes;
use Koha::Ratings;
-my $query = new CGI;
+my $query = CGI->new;
# if opacreadinghistory is disabled, leave immediately
if ( ! C4::Context->preference('opacreadinghistory') ) {
use C4::Auth;
use C4::Output;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use Koha::Patron::Modifications;
use Koha::Patron::Categories;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $dbh = C4::Context->dbh;
unless ( C4::Context->preference('PatronSelfRegistration') ) {
use Koha::Items;
use Koha::Patrons;
use Date::Calc qw( Today Date_to_Days );
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
use URI::Escape;
use Encode;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
use Koha::Biblios;
use Koha::Patrons;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
my $maxreserves = C4::Context->preference("maxreserves");
-my $query = new CGI;
+my $query = CGI->new;
# if RequestOnOpac (for placing holds) is disabled, leave immediately
if ( ! C4::Context->preference('RequestOnOpac') ) {
last if $withinNetwork;
}
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => "opac-restrictedpage.tt",
use Koha::Review;
use Koha::Reviews;
-my $query = new CGI;
+my $query = CGI->new;
my $biblionumber = $query->param('biblionumber');
my $review = $query->param('review');
my $reviewid = $query->param('reviewid');
use C4::Output;
use Koha::Patrons;
-my $query = new CGI;
+my $query = CGI->new;
unless ( C4::Context->preference('RoutingSerials') ) {
print $query->redirect("/cgi-bin/koha/errors/404.pl");
use POSIX qw(strftime);
-my $cgi = new CGI;
+my $cgi = CGI->new;
# Getting the template and auth
my ($template, $loggedinuser, $cookie) = get_template_and_user(
# create a new CGI object
# FIXME: no_undef_params needs to be tested
use CGI qw('-no_undef_params' -utf8);
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $branch_group_limit = $cgi->param("branch_group_limit");
if ( $branch_group_limit ) {
use Koha::Patrons;
use Koha::Virtualshelves;
-my $query = new CGI;
+my $query = CGI->new;
# if virtualshelves is disabled, leave immediately
if ( ! C4::Context->preference('virtualshelves') ) {
use C4::Output;
use C4::Context;
-my $query = new CGI;
+my $query = CGI->new;
my $op = $query->param('op');
my $dbh = C4::Context->dbh;
my $selectview = $query->param('selectview');
# if virtualshelves is disabled, leave immediately
if ( ! C4::Context->preference('virtualshelves') ) {
- my $query = new CGI;
+ my $query = CGI->new;
print $query->redirect("/cgi-bin/koha/errors/404.pl");
exit;
}
sub _init {
my ($param) = @_;
- my $query = new CGI;
+ my $query = CGI->new;
$param->{query} = $query;
$param->{shelfnumber} = $query->param('shelfnumber') || 0;
$param->{op} = $query->param('op') || '';
use constant ANYONE => 2;
-my $query = new CGI;
+my $query = CGI->new;
my $template_name = $query->param('rss') ? "opac-shelves-rss.tt" : "opac-shelves.tt";
use C4::Templates;
use Koha::RecordProcessor;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
template_name => "opac-showmarc.tt",
query => $input,
use POSIX qw(ceil floor strftime);
my $template_name;
-my $query = new CGI;
+my $query = CGI->new;
my $format = $query->param("format") || '';
my $count = C4::Context->preference('OPACnumSearchResults') || 20;
my $results_per_page = $query->param('count') || $count;
use Koha::DateUtils;
-my $input = new CGI;
+my $input = CGI->new;
my $op = $input->param('op') || 'else';
my $biblionumber = $input->param('biblionumber');
my $suggestion = $input->Vars;
use CGI qw ( -utf8 );
use C4::Biblio;
-my $query = new CGI;
+my $query = CGI->new;
my $dbh = C4::Context->dbh;
=cut
-my $input = new CGI;
+my $input = CGI->new;
# if OpacTopissue is disabled, leave immediately
if ( ! C4::Context->preference('OpacTopissue') ) {
Date_to_Days
);
-my $query = new CGI;
+my $query = CGI->new;
# CAS single logout handling
# Will print header and exit
use List::MoreUtils qw( uniq );
use Try::Tiny;
-my $cgi = new CGI;
+my $cgi = CGI->new;
# 404 if feature is disabled
unless ( C4::Context->preference('SelfCheckInModule') ) {
use C4::Auth qw(get_template_and_user in_iprange);
use C4::Output qw(output_html_with_http_headers);
-my $query = new CGI;
+my $query = CGI->new;
unless ( in_iprange(C4::Context->preference('SelfCheckAllowByIPRanges')) ) {
print $query->redirect("/cgi-bin/koha/opac-main.pl");
exit;
use C4::Members;
use C4::Koha;
-my $input = new CGI;
+my $input = CGI->new;
unless ( in_iprange(C4::Context->preference('SelfCheckAllowByIPRanges')) ) {
print $input->header(status => '403 Forbidden - functionality not available from your location');
exit;
use Koha::Patron::Messages;
use Koha::Token;
-my $query = new CGI;
+my $query = CGI->new;
unless (C4::Context->preference('WebBasedSelfCheck')) {
# redirect to OPAC home if self-check is not enabled
# AJAX requests
my $is_ajax = is_ajax();
-my $query = new CGI;
+my $query = CGI->new;
my ( $auth_status, $sessionID ) = check_cookie_auth( $query->cookie('CGISESSID'), {} );
if ( $auth_status ne "ok" ) {
exit 0;
use C4::Auth qw(check_cookie_auth);
use Koha::Club::Enrollments;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $auth_status, $sessionID ) =
check_cookie_auth( $cgi->cookie('CGISESSID') );
use Koha::Club::Enrollment;
use Koha::Clubs;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $auth_status, $sessionID ) =
check_cookie_auth( $cgi->cookie('CGISESSID') );
use Koha::ExternalContent::OverDrive;
my $logger = Koha::Logger->get({ interface => 'opac' });
-our $cgi = new CGI;
+our $cgi = CGI->new;
my $page_url = $cgi->referer();
my ( $user, $cookie, $sessionID, $flags ) = checkauth( $cgi, 1, {}, 'opac' );
use Koha;
-my $query = new CGI;
+my $query = CGI->new;
my $token;
use Koha::Logger;
use Koha::ExternalContent::RecordedBooks;
-our $cgi = new CGI;
+our $cgi = CGI->new;
my $logger = Koha::Logger->get({ interface => 'opac' });
my $page_url = $cgi->referer();
use C4::Output;
use C4::ShelfBrowser;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
use JSON;
use Koha::SuggestionEngine;
-my $query = new CGI;
+my $query = CGI->new;
my $dbh = C4::Context->dbh;
use CGI qw ( -utf8 );
use List::MoreUtils qw(any);
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $uri = $cgi->param('uri') || '';
my $biblionumber = $cgi->param('biblionumber') || 0;
my $itemnumber = $cgi->param('itemnumber') || 0;
use C4::Output;
use Koha::List::Patron;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use C4::Output;
use Koha::List::Patron;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use Koha::List::Patron;
use List::MoreUtils qw/uniq/;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $logged_in_user, $cookie ) = get_template_and_user(
{
use C4::Output;
use Koha::List::Patron;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use C4::Output;
use Koha::List::Patron;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use Koha::Patron::Categories;
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh;
use Koha::Patrons;
use Koha::Patron::Images;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
template_name => "labels/label-home.tt",
use C4::Patroncards;
use Koha::Patrons;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "patroncards/edit-batch.tt",
use C4::Creators;
use C4::Patroncards;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "patroncards/edit-layout.tt",
use C4::Creators::Lib qw(get_all_templates get_unit_values);
use C4::Patroncards::Profile;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "patroncards/edit-profile.tt",
use C4::Creators;
use C4::Patroncards;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "patroncards/edit-template.tt",
use C4::Auth qw(get_template_and_user);
use C4::Output qw(output_html_with_http_headers);
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "patroncards/home.tt",
use C4::Labels;
use Koha::List::Patron;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "patroncards/manage.tt",
use C4::Creators;
use C4::Patroncards;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "patroncards/print.tt",
die("Koha plugins are disabled!") unless C4::Context->config("enable_plugins");
-my $input = new CGI;
+my $input = CGI->new;
my ( $auth_status, $sessionID ) =
check_cookie_auth( $input->cookie('CGISESSID'), { plugins => 'manage' } );
my $plugins_enabled = C4::Context->config("enable_plugins");
-my $input = new CGI;
+my $input = CGI->new;
my $method = $input->param('method');
my $plugin_search = $input->param('plugin-search');
die("Koha plugins are disabled!") unless C4::Context->config("enable_plugins");
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "plugins/plugins-upload.tt",
my $plugins_enabled = C4::Context->config("enable_plugins");
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => ($plugins_enabled) ? "plugins/plugins-upload.tt" : "plugins/plugins-disabled.tt",
my $plugins_enabled = C4::Context->config("enable_plugins");
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $class = $cgi->param('class');
my $method = $cgi->param('method');
=cut
-my $input = new CGI;
+my $input = CGI->new;
my $do_it = $input->param('do_it');
my $fullreportname = "reports/acquisitions_stats.tt";
my $line = $input->param("Line");
$debug and open my $debugfh, '>', '/tmp/bor_issues_top.debug.log';
-my $input = new CGI;
+my $input = CGI->new;
my $fullreportname = "reports/bor_issues_top.tt";
my $do_it = $input->param('do_it');
my $limit = $input->param("Limit");
=cut
-my $input = new CGI;
+my $input = CGI->new;
my $do_it=$input->param('do_it');
my $fullreportname = "reports/borrowers_out.tt";
my $limit = $input->param("Limit");
=cut
-my $input = new CGI;
+my $input = CGI->new;
my $do_it=$input->param('do_it');
my $fullreportname = "reports/borrowers_stats.tt";
my $line = $input->param("Line");
use Koha::Account::CreditTypes;
use Koha::Account::DebitTypes;
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh;
my ($template, $borrowernumber, $cookie) = get_template_and_user({
=cut
-my $input = new CGI;
+my $input = CGI->new;
my $do_it=$input->param('do_it');
my $fullreportname = "reports/cat_issues_top.tt";
my $limit = $input->param("Limit");
=cut
-my $input = new CGI;
+my $input = CGI->new;
my $do_it = $input->param('do_it');
my $limit = $input->param("Limit") || 10;
my $column = $input->param("Criteria");
=cut
our $debug = 0;
-my $input = new CGI;
+my $input = CGI->new;
my $fullreportname = "reports/catalogue_stats.tt";
my $do_it = $input->param('do_it');
my $line = $input->param("Line");
=cut
-my $input = new CGI;
+my $input = CGI->new;
my $referer = $input->referer();
my $phase = $input->param('phase') || 'View Dictionary';
=cut
-my $input = new CGI;
+my $input = CGI->new;
my $usecache = Koha::Caches->get_instance->memcached_cache;
my $phase = $input->param('phase') // '';
=cut
-my $input = new CGI;
+my $input = CGI->new;
my $do_it=$input->param('do_it');
my $fullreportname = "reports/issues_avg_stats.tt";
my $line = $input->param("Line");
use Koha::CsvProfiles;
use Koha::DateUtils;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "reports/itemslost.tt",
use C4::Circulation;
-my $input = new CGI;
+my $input = CGI->new;
my $report_name=$input->param("report_name");
my $do_it=$input->param('do_it');
my $fullreportname = "reports/".$report_name.".tt";
use Koha::Biblios;
use Koha::DateUtils;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "reports/orders_by_budget.tt",
use C4::Context;
-my $query = new CGI;
+my $query = CGI->new;
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "reports/reports-home.tt",
query => $query,
=cut
# my $debug = 1; # override for now.
-my $input = new CGI;
+my $input = CGI->new;
my $fullreportname = "reports/reserves_stats.tt";
my $do_it = $input->param('do_it');
my $line = $input->param("Line");
=cut
-my $input = new CGI;
+my $input = CGI->new;
my $templatename = "reports/serials_stats.tt";
my $do_it = $input->param("do_it");
my $bookseller = $input->param("bookseller");
use C4::Auth;
use Koha::DateUtils qw( dt_from_string );
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "about.tt",
use C4::Reserves;
use C4::Auth;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "about.tt",
use Koha::Clubs;
my $dbh = C4::Context->dbh;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
{
template_name => "reserve/request.tt",
use Koha::Patrons;
use Koha::Reviews;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "reviews/reviewswaiting.tt",
use CGI qw ( -utf8 );
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use C4::RotatingCollections;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use C4::Context;
use C4::RotatingCollections;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use CGI qw ( -utf8 );
-my $query = new CGI;
+my $query = CGI->new;
my $colId = $query->param('colId');
my $toBranch = $query->param('toBranch');
use Koha::Acquisition::Booksellers;
-my $query=new CGI;
+my $query=CGI->new;
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "serials/acqui-search-result.tt",
query => $query,
use C4::Auth;
use C4::Output;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use Koha::Patron::Categories;
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh;
use DateTime;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user (
{
use C4::Auth qw/check_cookie_auth/;
use URI::Escape;
-my $input = new CGI;
+my $input = CGI->new;
my ($auth_status, $sessionID) = check_cookie_auth($input->cookie('CGISESSID'), { serials => '*' });
if ($auth_status ne "ok") {
use Text::CSV_XS;
-my $query = new CGI;
+my $query = CGI->new;
my $supplierid = $query->param('supplierid');
my @serialids = $query->multi_param('serialid');
my $op = $query->param('op') || q{};
use Koha::Libraries;
use Koha::Patrons;
-my $query = new CGI;
+my $query = CGI->new;
my $subscriptionid = $query->param('subscriptionid');
my $issue = $query->param('issue');
my $routingid;
use URI::Escape;
-my $query = new CGI;
+my $query = CGI->new;
my $subscriptionid = $query->param('subscriptionid');
my $serialseq = $query->param('serialseq');
my $routingid = $query->param('routingid');
use List::MoreUtils qw/uniq/;
-my $query = new CGI;
+my $query = CGI->new;
my $op = $query->param('op') || q{};
my $nbissues=$query->param('nbissues');
my $date_received_today = $query->param('date_received_today') || 0;
use C4::Output;
use C4::Serials;
-my $query = new CGI;
+my $query = CGI->new;
my $routing = $query->param('routing') || C4::Context->preference("RoutingSerials");
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
use Koha::DateUtils;
use Koha::SharedContent;
-my $query = new CGI;
+my $query = CGI->new;
my $title = $query->param('title_filter') || '';
my $ISSN = $query->param('ISSN_filter') || '';
my $EAN = $query->param('EAN_filter') || '';
use C4::Serials::Frequency;
use Koha::DateUtils;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
template_name => 'serials/showpredictionpattern.tt',
query => $input,
use Koha::AdditionalFields;
use Koha::DateUtils;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ($template, $loggedinuser, $cookie) = get_template_and_user({
template_name => 'serials/subscription-batchedit.tt',
use Koha::SearchEngine;
use Koha::SearchEngine::Search;
-my $input = new CGI;
+my $input = CGI->new;
my $op = $input->param('op') || q{};
my $dbh = C4::Context->dbh;
use Koha::SharedContent;
-my $query = new CGI;
+my $query = CGI->new;
my $op = $query->param('op') || q{};
my $issueconfirmed = $query->param('issueconfirmed');
my $dbh = C4::Context->dbh;
use C4::Serials;
use C4::Serials::Frequency;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
template_name => 'serials/subscription-frequencies.tt',
query => $input,
use C4::Auth qw/check_cookie_auth/;
use JSON qw( to_json );
-my $input=new CGI;
+my $input=CGI->new;
my $frqid=$input->param("frequency_id");
my ($auth_status, $sessionID) = check_cookie_auth($input->cookie('CGISESSID'), { serials => '*' });
if ($auth_status ne "ok") {
use Koha::Biblios;
use Koha::DateUtils;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
template_name => 'serials/subscription-history.tt',
query => $input,
use C4::Auth qw/check_cookie_auth/;
use JSON qw( to_json );
-my $input=new CGI;
+my $input=CGI->new;
my ($auth_status, $sessionID) = check_cookie_auth($input->cookie('CGISESSID'), { serials => '*' });
if ($auth_status ne "ok") {
use C4::Serials::Numberpattern;
use C4::Serials::Frequency;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
template_name => 'serials/subscription-numberpatterns.tt',
query => $input,
use C4::Serials;
use Koha::DateUtils;
-my $query = new CGI;
+my $query = CGI->new;
my $dbh = C4::Context->dbh;
my $mode = $query->param('mode') || q{};
use Koha::Subscriptions;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => 'serials/viewalerts.tt',
use C4::Output;
use C4::Items;
-my $input = new CGI;
+my $input = CGI->new;
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
template_name => 'services/itemrecorddisplay.tt',
query => $input,
use Koha::Patron::Categories;
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh;
use Koha::Patron::Categories;
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh;
use C4::Auth qw(check_cookie_auth);
use Koha::ArticleRequests;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $auth_status, $sessionID ) =
check_cookie_auth( $cgi->cookie('CGISESSID'), { circulate => 'circulate_remaining_permissions' } );
use C4::Auth qw/check_api_auth/;
use XML::Simple;
-my $query = new CGI;
+my $query = CGI->new;
# The authentication strategy for the biblios web
# services is as follows.
=cut
-my $input = new CGI;
+my $input = CGI->new;
my ( $auth_status, $sessionID ) = check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => '*' } );
use C4::Items;
use XML::Simple;
-my $query = new CGI;
+my $query = CGI->new;
binmode STDOUT, ':encoding(UTF-8)';
my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} );
binmode STDOUT, ':encoding(UTF-8)';
-my $query = new CGI;
+my $query = CGI->new;
my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} );
unless ($status eq 'ok') {
print $query->header(-type => 'text/xml', -status => '403 Forbidden');
use Koha::ItemTypes;
use XML::Simple;
-my $query = new CGI;
+my $query = CGI->new;
my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} );
use Koha::Checkouts;
use Koha::Items;
-my $input = new CGI;
+my $input = CGI->new;
my ( $auth_status, $sessionID ) =
check_cookie_auth( $input->cookie('CGISESSID'),
# AJAX requests
my $is_ajax = is_ajax();
-my $query = new CGI;
+my $query = CGI->new;
my ( $auth_status, $sessionID ) = check_cookie_auth( $query->cookie('CGISESSID'), { circulate => 'manage_checkout_notes' } );
if ( $auth_status ne "ok" ) {
exit 0;
use Koha::DateUtils;
use Koha::ItemTypes;
-my $input = new CGI;
+my $input = CGI->new;
my ( $auth_status, $sessionID ) =
check_cookie_auth( $input->cookie('CGISESSID'));
use Koha::Club::Enrollments;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $auth_status, $sessionID ) =
check_cookie_auth( $cgi->cookie('CGISESSID'), { clubs => 'enroll' } );
use C4::Auth qw(check_cookie_auth);
use Koha::Clubs;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $auth_status, $sessionID ) = check_cookie_auth( $cgi->cookie('CGISESSID'), { clubs => 'edit_clubs' } );
if ( $auth_status ne "ok" ) {
use Koha::Club::Enrollments;
use Koha::Clubs;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $auth_status, $sessionID ) =
check_cookie_auth( $cgi->cookie('CGISESSID'), { clubs => 'enroll' } );
use Koha::Club::Templates;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $auth_status, $sessionID ) = check_cookie_auth( $cgi->cookie('CGISESSID'), { clubs => 'edit_templates' } );
if ( $auth_status ne "ok" ) {
use Koha::CoverImages;
use JSON qw/to_json/;
-my $input = new CGI;
+my $input = CGI->new;
my ( $auth_status, $sessionID ) =
check_cookie_auth(
# AJAX requests
my $is_ajax = is_ajax();
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $auth_status, $sessionID ) = check_cookie_auth( $cgi->cookie('CGISESSID'), { catalogue => 1 } );
if ( $auth_status ne "ok" ) {
exit 0;
use Koha::DateUtils qw(dt_from_string);
use Koha::Holds;
-my $input = new CGI;
+my $input = CGI->new;
my ( $auth_status, $sessionID ) =
check_cookie_auth( $input->cookie('CGISESSID'), { circulate => 'circulate_remaining_permissions' } );
use Koha::DateUtils qw(dt_from_string);
use Koha::Holds;
-my $input = new CGI;
+my $input = CGI->new;
my ( $auth_status, $sessionID ) =
check_cookie_auth( $input->cookie('CGISESSID'), { circulate => 'circulate_remaining_permissions' } );
use Koha::ItemTypes;
use Koha::Libraries;
-my $input = new CGI;
+my $input = CGI->new;
my ( $auth_status, $sessionID ) =
check_cookie_auth( $input->cookie('CGISESSID'),
use XML::Simple;
# use Carp::Always;
-my $query = new CGI;
+my $query = CGI->new;
binmode STDOUT, ':encoding(UTF-8)';
my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} );
use Koha::Items;
use Koha::Patrons;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
use JSON;
-my $input = new CGI;
+my $input = CGI->new;
binmode STDOUT, ":encoding(UTF-8)";
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
use CGI;
-my $input = new CGI;
+my $input = CGI->new;
my ( $auth_status, $sessionID ) =
check_cookie_auth( $input->cookie('CGISESSID'),
$template->param( statuscode => $result->{code} );
$template->param( msg => $result->{msg} );
-output_html_with_http_headers $input, $cookie, $template->output;
\ No newline at end of file
+output_html_with_http_headers $input, $cookie, $template->output;
use CGI;
use JSON;
-my $input = new CGI;
+my $input = CGI->new;
binmode STDOUT, ":encoding(UTF-8)";
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
use JSON;
-my $input = new CGI;
+my $input = CGI->new;
binmode STDOUT, ":encoding(UTF-8)";
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
use JSON qw( to_json );
use Koha::List::Patron;
-my $input = new CGI;
+my $input = CGI->new;
my ( $auth_status, $sessionID ) = check_cookie_auth(
$input->cookie('CGISESSID'),
use Koha::DateUtils qw( output_pref dt_from_string );
use Koha::Patrons;
-my $input = new CGI;
+my $input = CGI->new;
exit unless $input->param('template_path');
use XML::Simple;
use C4::Charset;
-my $query = new CGI;
+my $query = CGI->new;
binmode STDOUT, ':encoding(UTF-8)';
my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} );
# AJAX requests
my $is_ajax = is_ajax();
-my $query = new CGI;
+my $query = CGI->new;
my ( $auth_status, $sessionID ) = check_cookie_auth( $query->cookie('CGISESSID'), { problem_reports => 1 } );
if ( $auth_status ne "ok" ) {
exit 0;
use Koha::DateUtils qw(output_pref dt_from_string);
-my $input = new CGI;
+my $input = CGI->new;
my ( $auth_status, $sessionID ) =
check_cookie_auth( $input->cookie('CGISESSID'),
use Koha::DateUtils;
use Koha::Patrons;
-my $input = new CGI;
+my $input = CGI->new;
my ( $auth_status, $sessionID ) =
check_cookie_auth( $input->cookie('CGISESSID') );
use C4::Utils::DataTables qw( dt_get_params );
use C4::Utils::DataTables::VirtualShelves qw( search );
-my $input = new CGI;
+my $input = CGI->new;
exit unless $input->param('template_path');
# Setup Mocks
## Mock Context
-my $context = new Test::MockModule('C4::Context');
+my $context = Test::MockModule->new('C4::Context');
### Mock ->config
$context->mock( 'config', \&mockedConfig );
$context->mock( 'interface', \&mockedInterface );
## Mock Database
-my $database = new Test::MockModule('Koha::Database');
+my $database = Test::MockModule->new('Koha::Database');
### Mock ->schema
$database->mock( 'schema', \&mockedSchema );
# We need to mock the C4::Context->preference method for
# simplicity and re-usability of the session definition. Any
# syspref fits for syspref-agnostic tests.
-my $module_context = new Test::MockModule('C4::Context');
+my $module_context = Test::MockModule->new('C4::Context');
$module_context->mock(
'preference',
sub {
is( C4::Context->needs_install, 1, "->preference(Version) is not defined, need to install" );
};
-my $context = new Test::MockModule('C4::Context');
+my $context = Test::MockModule->new('C4::Context');
my $userenv = {};
$context->mock('userenv', sub {
my $now = DateTime->now;
is( dt_from_string, $now, "Without parameter, dt_from_string should return today" );
-my $module_context = new Test::MockModule('C4::Context');
+my $module_context = Test::MockModule->new('C4::Context');
$module_context->mock(
'tz',
sub {
my $record = MARC::Record->new();
my $metadata_record;
- warning_is { $metadata_record = new Koha::MetadataRecord({
+ warning_is { $metadata_record = Koha::MetadataRecord->new({
record => $record }) }
{ carped => 'No schema passed' },
"Metadata schema is mandatory, raise a carped warning if omitted";
is( $metadata_record, undef, "Metadata schema is mandatory, return undef if omitted");
- $metadata_record = new Koha::MetadataRecord({
+ $metadata_record = Koha::MetadataRecord->new({
record => $record,
schema => 'marc21'
});
my $weird_record = {};
bless $weird_record, 'Weird::Class';
- $metadata_record = new Koha::MetadataRecord({
+ $metadata_record = Koha::MetadataRecord->new({
record => $weird_record,
schema => 'something',
format => 'else',
is( $metadata_record->id, 'an id', 'The id correctly set');
# Having a record object is mandatory
- warning_is { $metadata_record = new Koha::MetadataRecord({
+ warning_is { $metadata_record = Koha::MetadataRecord->new({
record => undef,
schema => 'something',
format => 'else',
my $development;
# Mock Koha::version()
- my $koha = new Test::MockModule('Koha');
+ my $koha = Test::MockModule->new('Koha');
$koha->mock( 'version', sub {
return "$major.$minor.$maintenance.$development";
});
- my $rnd = new String::Random;
+ my $rnd = String::Random->new;
# development version test
$major = $rnd->randregex('\d');
$minor = $rnd->randregex('\d\d');
# for the syspref mock
my $return_undef = 0;
-my $module_context = new Test::MockModule('C4::Context');
+my $module_context = Test::MockModule->new('C4::Context');
$module_context->mock(
preference => sub {
use_ok('C4::Output::JSONStream');
}
-my $json = new C4::Output::JSONStream;
+my $json = C4::Output::JSONStream->new;
is($json->output,'{}',"Making sure JSON output is blank just after its created.");
$json->param( issues => [ 'yes!', 'please', 'no' ] );
is($json->output,'{"issues":["yes!","please","no"]}',"Making sure JSON output has added what we told it to.");
# Create new session and put its id into CGISESSID cookie
my $session = C4::Auth::get_session("");
$session->flush;
-my $input = new CookieSimulator({CGISESSID => $session->id});
+my $input = CookieSimulator->new({CGISESSID => $session->id});
my @recent_searches = C4::Search::History::get_from_session({ cgi => $input });
is_deeply(\@recent_searches, [], 'at start, there is no recent searches');
use_ok('Koha::SuggestionEngine');
-my $module = new Test::MockModule('C4::AuthoritiesMarc');
+my $module = Test::MockModule->new('C4::AuthoritiesMarc');
$module->mock('SearchAuthorities', sub {
return [ { 'authid' => '1234',
'reported_tag' => undef,
print "Using $ncpu CPUs...\n"
if $ENV{DEBUG};
-my $pm = new Parallel::ForkManager($ncpu);
+my $pm = Parallel::ForkManager->new($ncpu);
foreach my $d (@dirs) {
$pm->start and next; # do the fork
my $branchcode = $library->{branchcode};
-my $context = new Test::MockModule('C4::Context');
+my $context = Test::MockModule->new('C4::Context');
$context->mock( 'userenv', sub {
return {
flags => 1,
)->store();
my $manager = $builder->build_object({ class => "Koha::Patrons" });
- my $context = new Test::MockModule('C4::Context');
+ my $context = Test::MockModule->new('C4::Context');
$context->mock( 'userenv', sub {
return {
number => $manager->borrowernumber,
# "Flavoured" tests (tests that required a run for each marc flavour)
# Tests should be added to the run_flavoured_tests sub below
-my $biblio_module = new Test::MockModule('C4::Biblio');
+my $biblio_module = Test::MockModule->new('C4::Biblio');
$biblio_module->mock(
'GetMarcSubfieldStructure',
sub {
}
# Mock checkauth, build the scenario
- my $auth = new Test::MockModule( 'C4::Auth' );
+ my $auth = Test::MockModule->new( 'C4::Auth' );
$auth->mock( 'checkauth', \&MockedCheckauth );
# Make sure 'EnableOpacSearchHistory' is set
$ENV{"SERVER_PORT"} = 80;
$ENV{"HTTP_COOKIE"} = 'CGISESSID=nirvana';
- my $query = new CGI;
+ my $query = CGI->new;
$query->param('language','es-ES');
my ( $template, $loggedinuser, $cookies ) = get_template_and_user(
$ENV{QUERY_STRING} = $query_string;
$ENV{SCRIPT_NAME} = '/cgi-bin/koha/opac-user.pl';
-my $cgi = new CGI($query_string);
+my $cgi = CGI->new($query_string);
$cgi->delete('ticket');
# _url_with_get_params tests
# We are now going to be testing the authorities hierarchy code, and
# therefore need to pretend that we have consistent data in our database
-my $module = new Test::MockModule('C4::AuthoritiesMarc');
+my $module = Test::MockModule->new('C4::AuthoritiesMarc');
$module->mock('GetHeaderAuthority', sub {
return {'authtrees' => ''};
});
BEGIN {
use_ok('C4::BackgroundJob');
}
-my $query = new CGI;
+my $query = CGI->new;
my $schema = Koha::Database->new->schema;
$schema->storage->txn_begin;
# Mocking variables
-my $biblio_module = new Test::MockModule('C4::Biblio');
+my $biblio_module = Test::MockModule->new('C4::Biblio');
$biblio_module->mock(
'GetMarcSubfieldStructure',
sub {
}
);
-my $currency = new Test::MockModule('Koha::Acquisition::Currencies');
+my $currency = Test::MockModule->new('Koha::Acquisition::Currencies');
$currency->mock(
'get_active',
sub {
my $library =
$builder->build_object( { class => 'Koha::Libraries' } )->store;
- my $module = new Test::MockModule('C4::Context');
+ my $module = Test::MockModule->new('C4::Context');
$module->mock( 'userenv', sub { { branch => $library->id } } );
my $patron = $builder->build_object(
my $borrower1 = Koha::Patrons->find( $borrowernumber1 )->unblessed;
my $borrower2 = Koha::Patrons->find( $borrowernumber2 )->unblessed;
-my $module = new Test::MockModule('C4::Context');
+my $module = Test::MockModule->new('C4::Context');
$module->mock('userenv', sub { { branch => $branchcode } });
my $borrower = Koha::Patrons->find( $borrowernumber )->unblessed;
# Need to mock userenv for AddIssue
-my $module = new Test::MockModule('C4::Context');
+my $module = Test::MockModule->new('C4::Context');
$module->mock('userenv', sub { { branch => $branchcode } });
AddIssue($borrower, '0101');
AddIssue($borrower, '0203');
my %preferences;
sub mock_preference {
- my $context = new Test::MockModule('C4::Context');
+ my $context = Test::MockModule->new('C4::Context');
my ( $pref, $value ) = @_;
$preferences{$pref} = $value;
$context->mock(
my ( $incl ) = @_;
#mock to simulate some authorization and eliminate lots of output
my $launched = 0;
- my $mContext = new Test::MockModule('C4::Context');
- my $mAuth = new Test::MockModule('C4::Auth');
- my $mOutput = new Test::MockModule('C4::Output');
+ my $mContext = Test::MockModule->new('C4::Context');
+ my $mAuth = Test::MockModule->new('C4::Auth');
+ my $mOutput = Test::MockModule->new('C4::Output');
$mContext->mock( 'userenv', \&mock_userenv );
$mAuth->mock( 'checkauth', sub { return ( 1, undef, 1, all_perms() ); } );
$mOutput->mock('output_html_with_http_headers', sub { ++$launched; } );
- my $cgi=new CGI;
+ my $cgi=CGI->new;
my ( $plugins, $min ) = selected_plugins( $incl );
# test building them
}
});
- my $query = new CGI;
+ my $query = CGI->new;
$query->param( 'username', $borrower->{userid});
$query->param( 'password', $plain_password);
);
# Prepare and send web request for IL-SDI server:
- my $query = new CGI;
+ my $query = CGI->new;
$query->param( 'service', 'GetPatronInfo' );
$query->param( 'patron_id', $brwr->{'borrowernumber'} );
$query->param( 'show_attributes', '1' );
}
);
- my $query = new CGI;
+ my $query = CGI->new;
$query->param( 'patron_id', $patron->{borrowernumber});
$query->param( 'bib_id', $item->biblionumber);
my $biblio_with_no_item = $builder->build_sample_biblio;
- $query = new CGI;
+ $query = CGI->new;
$query->param( 'patron_id', $patron->{borrowernumber});
$query->param( 'bib_id', $biblio_with_no_item->biblionumber);
}
);
- $query = new CGI;
+ $query = CGI->new;
$query->param( 'patron_id', $patron->{borrowernumber});
$query->param( 'bib_id', $item2->biblionumber);
$query->param( 'item_id', $item2->itemnumber);
}
);
- $query = new CGI;
+ $query = CGI->new;
$query->param( 'patron_id', $patron->{borrowernumber});
$query->param( 'bib_id', $item3->biblionumber);
$query->param( 'item_id', $item4->itemnumber);
itemtype => $item->effective_itemtype,
})->store();
- my $query = new CGI;
+ my $query = CGI->new;
$query->param( 'pickup_location', $pickup_branch->{branchcode} );
$query->param( 'patron_id', $patron->{borrowernumber});
$query->param( 'bib_id', $item->biblionumber);
}
);
- my $query = new CGI;
+ my $query = CGI->new;
$query->param( 'pickup_location', $pickup_library->branchcode );
$query->param( 'patron_id', $patron->borrowernumber);
$query->param( 'bib_id', $item->biblionumber);
ModItemTransfer($item->itemnumber, $branch1->{branchcode}, $branch2->{branchcode});
- my $cgi = new CGI;
+ my $cgi = CGI->new;
$cgi->param(service => 'GetRecords');
$cgi->param(id => $item->biblionumber);
$schema->storage->txn_begin;
- my $cgi = new CGI;
+ my $cgi = CGI->new;
my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
my $item = $builder->build_sample_item;
$cgi->param( patron_id => $patron->borrowernumber );
branchcode => $library->branchcode,
},
});
- my $module = new Test::MockModule('C4::Context');
+ my $module = Test::MockModule->new('C4::Context');
$module->mock('userenv', sub { { branch => $library->branchcode } });
my $date_due = DateTime->now->add(weeks => 2);
my $issue1 = C4::Circulation::AddIssue($patron->unblessed, $item1->barcode, $date_due);
my $issue3 = C4::Circulation::AddIssue($patron->unblessed, $item3->barcode, $date_due);
my $date_due3 = Koha::DateUtils::dt_from_string( $issue3->date_due );
- my $cgi = new CGI;
+ my $cgi = CGI->new;
$cgi->param( 'service', 'GetPatronInfo' );
$cgi->param( 'patron_id', $patron->borrowernumber );
$cache->clear_from_cache("default_value_for_mod_marc-");
$cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
- my $item3_record = new MARC::Record;
+ my $item3_record = MARC::Record->new;
$item3_record->append_fields(
- new MARC::Field(
+ MARC::Field->new(
$itemfield, '', '',
'z' => 'foobar',
'y' => $itemtype->{itemtype}
my $itemtype = $builder->build_object({ class => 'Koha::ItemTypes' });
my $biblio = $builder->build_sample_biblio;
my ( $lost_tag, $lost_sf ) = GetMarcFromKohaField( 'items.itemlost' );
- my $item_record = new MARC::Record;
+ my $item_record = MARC::Record->new;
$item_record->append_fields(
MARC::Field->new(
$itemfield, '', '',
$item->new_status("this is something")->store;
- my $updated_item_record = new MARC::Record;
+ my $updated_item_record = MARC::Record->new;
$updated_item_record->append_fields(
MARC::Field->new(
$itemfield, '', '',
# Enable renewing upon fine payment
t::lib::Mocks::mock_preference( 'RenewAccruingItemWhenPaid', 1 );
my $called = 0;
- my $module = new Test::MockModule('C4::Circulation');
+ my $module = Test::MockModule->new('C4::Circulation');
$module->mock('AddRenewal', sub { $called = 1; });
$module->mock('CanBookBeRenewed', sub { return 1; });
$account->pay(
# Enable renewing upon fine payment
t::lib::Mocks::mock_preference( 'RenewAccruingItemWhenPaid', 1 );
my $called = 0;
- my $module = new Test::MockModule('C4::Circulation');
+ my $module = Test::MockModule->new('C4::Circulation');
$module->mock('AddRenewal', sub { $called = 1; });
$module->mock('CanBookBeRenewed', sub { return 1; });
my $credit_renew = $account->add_credit({ amount => 100, user_id => $patron->id, interface => 'commandline' });
}
);
my $called = 0;
- my $module = new Test::MockModule('C4::Circulation');
+ my $module = Test::MockModule->new('C4::Circulation');
$module->mock('AddRenewal', sub { $called = 1; });
$module->mock('CanBookBeRenewed', sub { return 1; });
$line->renew_item;
)->store;
is( get_nb_of_logactions(), $nb_of_logaction, 'With BorrowersLog off, no new log should have been added' );
-my $context = new Test::MockModule('C4::Context');
+my $context = Test::MockModule->new('C4::Context');
$context->mock( 'userenv', sub {
return {
number => $patron_2->{borrowernumber},
{ # Testing invalid is going to expiry date
t::lib::Mocks::mock_preference('NotifyBorrowerDeparture', 30);
# mock_config does not work here, because of tz vs timezone subroutines
- my $context = new Test::MockModule('C4::Context');
+ my $context = Test::MockModule->new('C4::Context');
$context->mock( 'tz', sub {
'America/Sao_Paulo';
});
MARC::Field->new('999', '', '', c => '1234567'),
);
- my $yaml = new Test::MockModule('YAML');
+ my $yaml = Test::MockModule->new('YAML');
$yaml->mock('LoadFile', sub {
return {
biblios => {
};
});
- my $builder = new Test::MockModule('Koha::SearchEngine::Elasticsearch::QueryBuilder');
+ my $builder = Test::MockModule->new('Koha::SearchEngine::Elasticsearch::QueryBuilder');
$builder->mock('build_query_compat', sub {
my ( $self, $operators, $operands ) = @_;
return (undef, $operands->[0]);
});
- my $search = new Test::MockModule('Koha::SearchEngine::Elasticsearch::Search');
+ my $search = Test::MockModule->new('Koha::SearchEngine::Elasticsearch::Search');
$search->mock('simple_search_compat', sub {
my ( $self, $query ) = @_;
sleep(10); # Just a try to see if it fixes Jenkins
# Z39.50 protocol tests
- my $o = new ZOOM::Options();
+ my $o = ZOOM::Options->new();
$o->option(preferredRecordSyntax => 'xml');
$o->option(elementSetName => 'marcxml');
$o->option(databaseName => 'biblios');
MARC::Field->new('999', '', '', c => '1234567'),
);
- my $context = new Test::MockModule('C4::Context');
+ my $context = Test::MockModule->new('C4::Context');
$context->mock('Zconn', sub {
- my $Zconn = new Test::MockObject();
+ my $Zconn = Test::MockObject->new();
$Zconn->mock('connect', sub {});
$Zconn->mock('err_code', sub {
return 0;
});
$Zconn->mock('search_pqf', sub {
- my $results = new Test::MockObject();
+ my $results = Test::MockObject->new();
$results->mock('size', sub {
return 2;
});
} elsif ($index == 1) {
$record = $marc_record_2;
}
- my $Zrecord = new Test::MockObject();
+ my $Zrecord = Test::MockObject->new();
$Zrecord->mock('raw', sub {
return $record->as_xml();
});
}
sleep(10); # Just a try to see if it fixes Jenkins
- my $o = new ZOOM::Options();
+ my $o = ZOOM::Options->new();
$o->option(preferredRecordSyntax => 'xml');
$o->option(elementSetName => 'marcxml');
$o->option(databaseName => 'biblios');
my $borrower1 = Koha::Patrons->find( $borrowernumber1 )->unblessed;
my $borrower2 = Koha::Patrons->find( $borrowernumber2 )->unblessed;
-my $module = new Test::MockModule('C4::Context');
+my $module = Test::MockModule->new('C4::Context');
$module->mock( 'userenv', sub { { branch => $branchcode } } );
my $issues = C4::Members::GetAllIssues();
Koha::Patron->new({ categorycode => $categorycode, branchcode => $branchcode })->store->borrowernumber;
my $borrower = Koha::Patrons->find( $borrowernumber )->unblessed;
-my $module = new Test::MockModule('C4::Context');
+my $module = Test::MockModule->new('C4::Context');
$module->mock( 'userenv', sub { { branch => $branchcode } } );
my $today = dt_from_string;
my @marcarray=marc2marc;
is ($marcarray[0],"Feature not yet implemented\n","error works");
-my $marc=new MARC::Record;
+my $marc=MARC::Record->new;
my $marcxml=marc2marcxml($marc);
my $testxml=qq(<?xml version="1.0" encoding="UTF-8"?>
<record
use_ok('Koha::RecordProcessor');
}
-my $module = new Test::MockModule('MARC::Record');
+my $module = Test::MockModule->new('MARC::Record');
$module->mock('new_from_xml', sub {
my $record = MARC::Record->new;
);
- my $koha_authority = new Test::MockModule('Koha::MetadataRecord::Authority');
+ my $koha_authority = Test::MockModule->new('Koha::MetadataRecord::Authority');
$koha_authority->mock( 'get_from_authid', sub {
my $auth_record = MARC::Record->new;
my $library = $builder->build({
source => 'Branch',
});
-my $mContext = new Test::MockModule('C4::Context');
+my $mContext = Test::MockModule->new('C4::Context');
$mContext->mock( 'userenv', sub {
return { branch => $library->{branchcode} };
});
$htdocs[-2] = 'koha-tmpl';
$htdocs[-1] = 'opac-tmpl';
$htdocs = join '/', @htdocs;
-our $contextmodule = new Test::MockModule('C4::Context');
+our $contextmodule = Test::MockModule->new('C4::Context');
$contextmodule->mock('preference', sub {
my ($self, $pref) = @_;
if ($pref eq 'marcflavour') {
}
});
-our $bibliomodule = new Test::MockModule('C4::Biblio');
+our $bibliomodule = Test::MockModule->new('C4::Biblio');
sub mock_GetMarcSubfieldStructure {
my $marc_type = shift;
Koha::Caches->get_instance('config')->flush_all;
mock_GetMarcSubfieldStructure('marc21');
- my $context = new C4::Context("$datadir/etc/koha-conf.xml");
+ my $context = C4::Context->new("$datadir/etc/koha-conf.xml");
$context->set_context();
use_ok('C4::Search');
is(scalar(grep(/^arl$/, @$indexes)), 1, "Accelerated reading level index supported");
is(scalar(grep(/^arp$/, @$indexes)), 1, "Accelerated reading point index supported");
- my $bibliomodule = new Test::MockModule('C4::Biblio');
+ my $bibliomodule = Test::MockModule->new('C4::Biblio');
my %branches = (
'CPL' => { 'branchaddress1' => 'Jefferson Summit', 'branchcode' => 'CPL', 'branchname' => 'Centerville', },
## Regression test for Bug 10741
# make one of the test items appear to be in transit
- my $circ_module = new Test::MockModule('C4::Circulation');
+ my $circ_module = Test::MockModule->new('C4::Circulation');
$circ_module->mock('GetTransfers', sub {
my $itemnumber = shift // -1;
if ($itemnumber == 11) {
Koha::Caches->get_instance('config')->flush_all;
mock_GetMarcSubfieldStructure('unimarc');
- my $context = new C4::Context("$datadir/etc/koha-conf.xml");
+ my $context = C4::Context->new("$datadir/etc/koha-conf.xml");
$context->set_context();
use_ok('C4::Search');
subtest 'LoadSearchHistoryToTheFirstLoggedUser working' => sub {
plan tests =>2;
-my $query = new CGI;
+my $query = CGI->new;
my $schema = Koha::Database->schema;
my $builder = t::lib::TestBuilder->new;
}
-my $getfrom = new Test::MockModule( 'C4::Search::History' );
+my $getfrom = Test::MockModule->new( 'C4::Search::History' );
$getfrom->mock( 'get_from_session', \&myMockedget_from_session );
-my $cgi = new Test::MockModule( 'CGI');
+my $cgi = Test::MockModule->new( 'CGI');
$cgi->mock('cookie', sub {
my ($self, $key) = @_;
if (!ref($key) && $key eq 'CGISESSID'){
}
# Mock checkauth
-my $auth = new Test::MockModule( 'C4::Auth' );
+my $auth = Test::MockModule->new( 'C4::Auth' );
$auth->mock( 'checkauth', \&MockedCheckauth );
$query->param('koha_login_context', 'opac');
my $itemtype = $builder->build( { source => 'Itemtype' } )->{itemtype};
my $itemcallnumber = 'XXXmy itemcallnumberXXX';
- my $item_record = new MARC::Record;
+ my $item_record = MARC::Record->new;
$item_record->append_fields(
MARC::Field->new( '080', '', '', "a" => "default" ),
use Test::MockModule;
use Test::Warn;
-my $contextModule = new Test::MockModule('C4::Context');
+my $contextModule = Test::MockModule->new('C4::Context');
$contextModule->mock('preference', sub {
return '';
});
my $langModule;
if (! defined $ENV{KOHA_CONF}) {
- warning_like { $langModule = new Test::MockModule('C4::Languages'); }
+ warning_like { $langModule = Test::MockModule->new('C4::Languages'); }
qr /unable to locate Koha configuration file koha-conf.xml/,
'Expected warning for unset $KOHA_CONF';
}
else {
- $langModule = new Test::MockModule('C4::Languages');
+ $langModule = Test::MockModule->new('C4::Languages');
}
$langModule->mock('regex_lang_subtags', sub {
return {
});
my $tmplModule;
if (! defined $ENV{KOHA_CONF}) {
- warning_like { $tmplModule = new Test::MockModule('C4::Templates'); }
+ warning_like { $tmplModule = Test::MockModule->new('C4::Templates'); }
qr /unable to locate Koha configuration file koha-conf.xml/,
'Expected warning for unset $KOHA_CONF';
}
else {
- $tmplModule = new Test::MockModule('C4::Templates');
+ $tmplModule = Test::MockModule->new('C4::Templates');
}
$tmplModule->mock('_get_template_file', sub {
my ($tmplbase, $interface, $query) = @_;
$dbh->do(q|DELETE FROM columns_settings|);
-my $module = new Test::MockModule('C4::Utils::DataTables::TablesSettings');
+my $module = Test::MockModule->new('C4::Utils::DataTables::TablesSettings');
$module->mock(
'get_yaml',
sub {
use_ok('Koha::Template::Plugin::KohaDates');
}
-my $module_context = new Test::MockModule('C4::Context');
+my $module_context = Test::MockModule->new('C4::Context');
my $date = "1973-05-21";
my $context = C4::Context->new();
$schema->storage->txn_begin;
my $engine = C4::Context->preference("SearchEngine") // 'Zebra';
-my $search_module = new Test::MockModule("Koha::SearchEngine::${engine}::Search");
+my $search_module = Test::MockModule->new("Koha::SearchEngine::${engine}::Search");
$search_module->mock('simple_search_compat', \&Mock_simple_search_compat );
my $patron_id = $patron->borrowernumber;
my $branchcode = $builder->build({ source => 'Branch' })->{ branchcode };
-my $module = new Test::MockModule('C4::Context');
+my $module = Test::MockModule->new('C4::Context');
$module->mock('userenv', sub { { branch => $branchcode } });
$t->get_ok( "//$userid:$password@/api/v1/checkouts?patron_id=$patron_id" )
my %configs;
sub mock_config {
- my $context = new Test::MockModule('C4::Context');
+ my $context = Test::MockModule->new('C4::Context');
my ( $conf, $value ) = @_;
$configs{$conf} = $value;
$context->mock('config', sub {
$preferences{lc($pref)} = $value;
- my $context = new Test::MockModule('C4::Context');
+ my $context = Test::MockModule->new('C4::Context');
$context->mock('preference', sub {
my ( $self, $pref ) = @_;
$pref = lc($pref);
use Digest::MD5 qw(md5_hex);
use Encode;
-my $input = new CGI;
+my $input = CGI->new;
my $file_id = $input->param("id");
my $access_dirs = C4::Context->config('access_dirs');
use C4::Auth;
use C4::Items qw( ModDateLastSeen );
-my $input = new CGI;
+my $input = CGI->new;
# Authentication
my ($status, $cookie, $sessionId) = C4::Auth::check_api_auth($input, { tools => 'inventory' });
use Koha::Items;
use Koha::Biblioitems;
-my $cgi = new CGI;
+my $cgi = CGI->new;
# open template
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
use Koha::Patrons;
use Koha::SearchEngine::Indexer;
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh;
my $error = $input->param('error');
my @itemnumbers = $input->multi_param('itemnumber');
use Koha::Biblios;
use Koha::Items;
-my $input = new CGI;
+my $input = CGI->new;
my $op = $input->param('op') // q|form|;
my $recordtype = $input->param('recordtype') // 'biblio';
use Koha::Checkouts;
use Koha::DateUtils qw( dt_from_string output_pref );
-my $input = new CGI;
+my $input = CGI->new;
my $op = $input->param('op') // q|form|;
my $preview_results = $input->param('preview_results');
use Koha::MetadataRecord::Authority;
use Koha::Virtualshelves;
-my $input = new CGI;
+my $input = CGI->new;
our $dbh = C4::Context->dbh;
my $op = $input->param('op') // q|form|;
my $recordtype = $input->param('recordtype') // 'biblio';
use C4::Auth qw/check_cookie_auth/;
use C4::ImportBatch;
-my $input = new CGI;
+my $input = CGI->new;
my @sort_columns =
qw/import_record_id title status overlay_status overlay_status/;
use Koha::Patrons;
use Koha::List::Patron;
-my $cgi = new CGI;
+my $cgi = CGI->new;
# Fetch the paramater list as a hash in scalar context:
# * returns paramater list as tied hash ref
use C4::Calendar;
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh();
checkauth($input, 0, {tools=> 'edit_calendar'}, 'intranet');
use C4::Koha;
use Koha::CsvProfiles;
-my $input = new CGI;
+my $input = CGI->new;
my $export_format_id = $input->param('export_format_id');
my $op = $input->param('op') || 'list';
my @messages;
use C4::Calendar;
use Koha::DateUtils;
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh();
checkauth($input, 0, {tools=> 'edit_calendar'}, 'intranet');
use Koha::ItemTypes;
use Koha::Libraries;
-my $query = new CGI;
+my $query = CGI->new;
my $dont_export_items = $query->param("dont_export_item") || 0;
my $record_type = $query->param("record_type");
use C4::Calendar;
use Koha::DateUtils;
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh();
# Get the template to use
use Date::Calc qw/Date_to_Days Today/;
use Koha::DateUtils;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $id = $cgi->param('id');
my $title = $cgi->param('title');
return { map { $_->[0] => 1 } @{$codes} };
}
-our $input = new CGI;
+our $input = CGI->new;
my $searchfield = $input->param('searchfield');
my $script_name = '/cgi-bin/koha/tools/letter.pl';
our $branchcode = $input->param('branchcode');
my $script_name = "/cgi-bin/koha/tools/manage-marc-import.pl";
-my $input = new CGI;
+my $input = CGI->new;
my $op = $input->param('op') || '';
my $completedJobID = $input->param('completedJobID');
our $runinbackground = $input->param('runinbackground');
use C4::Output;
use C4::MarcModificationTemplates;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $op = $cgi->param('op') || q{};
my $template_id = $cgi->param('template_id');
use Koha::Patron::Debarments;
use Koha::Patrons;
-my $input = new CGI;
+my $input = CGI->new;
my $op = $input->param('op') || 'show_form';
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "tools/modborrowers.tt",
use DateTime;
use Koha::DateUtils;
-my $input = new CGI;
+my $input = CGI->new;
my $dbh = C4::Context->dbh();
checkauth($input, 0, {tools=> 'edit_calendar'}, 'intranet');
use Koha::Patron::Categories;
-our $input = new CGI;
+our $input = CGI->new;
my $dbh = C4::Context->dbh;
my @patron_categories = Koha::Patron::Categories->search( { overduenoticerequired => { '>' => 0 } } );
use Koha::Patron::Images;
use Koha::Token;
-my $input = new CGI;
+my $input = CGI->new;
unless (C4::Context->preference('patronimages')) {
# redirect to intranet home if patronimages is not enabled
use C4::Auth;
use Koha::ProblemReports;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
use C4::Context;
use C4::Output;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
use C4::Context;
use C4::Output;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
use C4::Context;
use C4::Output;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $dbh = C4::Context->dbh;
my ( $status, $cookie, $sessionID ) = C4::Auth::check_api_auth( $cgi, { tools => 'edit_quotes' } );
$debug = $ENV{DEBUG} || 0;
}
-my $input = new CGI;
+my $input = CGI->new;
my $base;
if ( C4::Context->config('supportdir') ) {
use Koha::Biblios;
# Input params
-my $input = new CGI;
+my $input = CGI->new;
my $recordid = $input->param('id');
my $importid = $input->param('importid');
my $batchid = $input->param('batchid');
use C4::MarcModificationTemplates;
use Koha::Plugins;
-my $input = new CGI;
+my $input = CGI->new;
my $fileID = $input->param('uploadedfileid');
my $runinbackground = $input->param('runinbackground');
use Koha::Item;
use Koha::Util::StockRotation qw(:ALL);
-my $input = new CGI;
+my $input = CGI->new;
unless (C4::Context->preference('StockRotation')) {
# redirect to Intranet home if self-check is not enabled
use C4::Tags qw/get_count_by_tag_status/;
use Koha::Reviews;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "tools/tools-home.tt",
my $debug = 1;
-my $input = new CGI;
+my $input = CGI->new;
my $fileID = $input->param('uploadedfileid');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
=cut
-my $input = new CGI;
+my $input = CGI->new;
$debug or $debug = $cgi_debug;
my $do_it = $input->param('do_it');
use Koha::Biblios;
use Koha::Virtualshelves;
-my $query = new CGI;
+my $query = CGI->new;
my $shelfnumber = $query->param('shelfnumber');
my $newvirtualshelf = $query->param('newvirtualshelf');
my $newshelf = $query->param('newshelf');
use Koha::Virtualshelves;
use utf8;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
{
use constant ANYONE => 2;
-my $query = new CGI;
+my $query = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "virtualshelves/shelves.tt",
$ncpu = Sys::CPU::cpu_count();
}
-my $pm = new Parallel::ForkManager($ncpu);
+my $pm = Parallel::ForkManager->new($ncpu);
# Tests
foreach my $theme ( @themes ) {