Bug 16154: CGI->multi_param - Force scalar context

This patch replaces the occurrences of
  $template->param( foo => $cgi->param('foo') );
with
  $template->param( foo => scalar $cgi->param('foo') );

perl -p -i -e 's/(\s*=>\s*)\$(cgi|input|query)\->param\(/$1scalar
\$$2\->param\(/xms' **/*.pl

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2016-03-29 09:51:07 +01:00 committed by Brendan Gallagher
parent ac5a1bfece
commit f3e4b5bbb6
57 changed files with 215 additions and 215 deletions

View file

@ -102,7 +102,7 @@ else {
name => $filename,
type => $mimetype,
content => $file_content,
description => $input->param('description')
description => scalar $input->param('description')
);
}
}
@ -110,7 +110,7 @@ else {
$errors{'no_file'} = 1;
}
} elsif ( $op eq 'delete' ) {
$mf->DelFile( id => $input->param('file_id') );
$mf->DelFile( id => scalar $input->param('file_id') );
}
$template->param(

View file

@ -82,8 +82,8 @@ elsif ( $op && $op eq 'mod' ) {
my $shipment_budget_id = $input->param('shipment_budget_id');
ModInvoice(
invoiceid => $invoiceid,
shipmentdate => output_pref( { str => $input->param('shipmentdate'), dateformat => 'iso', dateonly => 1 } ),
billingdate => output_pref( { str => $input->param('billingdate'), dateformat => 'iso', dateonly => 1 } ),
shipmentdate => output_pref( { str => scalar $input->param('shipmentdate'), dateformat => 'iso', dateonly => 1 } ),
billingdate => output_pref( { str => scalar $input->param('billingdate'), dateformat => 'iso', dateonly => 1 } ),
shipmentcost => $shipmentcost,
shipmentcost_budgetid => $shipment_budget_id
);

View file

@ -71,7 +71,7 @@ my $op = $input->param('op')||"else";
# get only the columns of aqbudgetperiods in budget_period_hashref
my @columns = Koha::Database->new()->schema->source('Aqbudgetperiod')->columns;
my $budget_period_hashref = { map { join(' ',@columns) =~ /$_/ ? ( $_ => $input->param($_) ) : () } keys( %{$input->Vars()} ) } ;
my $budget_period_hashref = { map { join(' ',@columns) =~ /$_/ ? ( $_ => scalar $input->param($_) ) : () } keys( %{$input->Vars()} ) } ;
$budget_period_hashref->{budget_period_startdate} = dt_from_string( $input->param('budget_period_startdate') );
$budget_period_hashref->{budget_period_enddate} = dt_from_string( $input->param('budget_period_enddate') );

View file

@ -69,7 +69,7 @@ if (not defined $template->{VARS}->{'CAN_user_acquisition_budget_add_del'}
# get only the columns of aqbudgets in budget_hash
my @columns = Koha::Database->new()->schema->source('Aqbudget')->columns;
my $budget_hash = { map { join(' ',@columns) =~ /$_/ ? ( $_ => $input->param($_) ) : () } keys( %{$input->Vars()}) } ;
my $budget_hash = { map { join(' ',@columns) =~ /$_/ ? ( $_ => scalar $input->param($_) ) : () } keys( %{$input->Vars()}) } ;
my $budget_id = $input->param('budget_id');
my $budget_period_id = $input->param('budget_period_id');

View file

@ -105,16 +105,16 @@ elsif ( $op eq 'add_validate' ) {
ModContract({
contractstartdate => eval { output_pref({ dt => dt_from_string( $contractstart_dt ), dateformat => 'iso', dateonly => 1 } ); },
contractenddate => eval { output_pref({ dt => dt_from_string( $contractend_dt ), dateformat => 'iso', dateonly => 1 } ); },
contractname => $input->param('contractname'),
contractdescription => $input->param('contractdescription'),
booksellerid => $input->param('booksellerid'),
contractnumber => $input->param('contractnumber'),
contractname => scalar $input->param('contractname'),
contractdescription => scalar $input->param('contractdescription'),
booksellerid => scalar $input->param('booksellerid'),
contractnumber => scalar $input->param('contractnumber'),
});
} else {
AddContract({
contractname => $input->param('contractname'),
contractdescription => $input->param('contractdescription'),
booksellerid => $input->param('booksellerid'),
contractname => scalar $input->param('contractname'),
contractdescription => scalar $input->param('contractdescription'),
booksellerid => scalar $input->param('booksellerid'),
contractstartdate => eval { output_pref({ dt => dt_from_string( $input->param('contractstartdate') ), dateformat => 'iso', dateonly => 1 } ); },
contractenddate => eval { output_pref({ dt => dt_from_string( $input->param('contractenddate') ), dateformat => 'iso', dateonly => 1 } ); },
});

View file

@ -135,8 +135,8 @@ if ($op eq 'add_form') {
my $av = Koha::AuthorisedValue->new( {
category => $new_category,
authorised_value => $new_authorised_value,
lib => $input->param('lib') || undef,
lib_opac => $input->param('lib_opac') || undef,
lib => scalar $input->param('lib') || undef,
lib_opac => scalar $input->param('lib_opac') || undef,
imageurl => $imageurl,
} );

View file

@ -101,7 +101,7 @@ if ( $op eq 'add_form' ) {
$branchcode =~ s|\s||g;
my $library = Koha::Library->new(
{ branchcode => $branchcode,
( map { $_ => $input->param($_) || undef } @fields )
( map { $_ => scalar $input->param($_) || undef } @fields )
}
);
eval { $library->store; };
@ -180,7 +180,7 @@ if ( $op eq 'add_form' ) {
} else {
my $category = Koha::LibraryCategory->new(
{ categorycode => $categorycode,
( map { $_ => $input->param($_) || undef } @fields )
( map { $_ => scalar $input->param($_) || undef } @fields )
}
);
$category->show_in_pulldown( $input->param('show_in_pulldown') eq 'on' );

View file

@ -154,7 +154,7 @@ elsif ( $op eq 'add_validate' ) {
if ( C4::Context->preference('EnhancedMessagingPreferences') ) {
C4::Form::MessagingPreferences::handle_form_action( $input,
{ categorycode => $input->param('categorycode') }, $template );
{ categorycode => scalar $input->param('categorycode') }, $template );
}
$searchfield = q||;

View file

@ -105,7 +105,7 @@ sub add_attribute_type_form {
sub error_add_attribute_type_form {
my $template = shift;
$template->param(description => $input->param('description'));
$template->param(description => scalar $input->param('description'));
if ($input->param('repeatable')) {
$template->param(repeatable_checked => 1);
@ -123,8 +123,8 @@ sub error_add_attribute_type_form {
$template->param(display_checkout_checked => 'checked="checked"');
}
$template->param( category_code => $input->param('category_code') );
$template->param( class => $input->param('class') );
$template->param( category_code => scalar $input->param('category_code') );
$template->param( class => scalar $input->param('class') );
$template->param(
attribute_type_form => 1,

View file

@ -115,5 +115,5 @@ sub ServerSearch { #find server(s) by id or name
sub _form_data_hashref {
my ( $input, $fieldref ) = @_;
return { map { ( $_ => $input->param($_)//'' ) } @$fieldref };
return { map { ( $_ => scalar $input->param($_)//'' ) } @$fieldref };
}

View file

@ -93,13 +93,13 @@ if ( $op eq "do_search" ) {
}
push @field_data,
{ term => "value_mainstr", val => $query->param('value_mainstr') || "" };
{ term => "value_mainstr", val => scalar $query->param('value_mainstr') || "" };
push @field_data,
{ term => "value_main", val => $query->param('value_main') || "" };
{ term => "value_main", val => scalar $query->param('value_main') || "" };
push @field_data,
{ term => "value_any", val => $query->param('value_any') || "" };
{ term => "value_any", val => scalar $query->param('value_any') || "" };
push @field_data,
{ term => "value_match", val => $query->param('value_match') || "" };
{ term => "value_match", val => scalar $query->param('value_match') || "" };
my @numbers = ();
if ( $total > $resultsperpage ) {
@ -158,10 +158,10 @@ else {
$template->param(
op => $op,
value_mainstr => $query->param('value_mainstr') || '',
value_main => $query->param('value_main') || '',
value_any => $query->param('value_any') || '',
value_match => $query->param('value_match') || '',
value_mainstr => scalar $query->param('value_mainstr') || '',
value_main => scalar $query->param('value_main') || '',
value_any => scalar $query->param('value_any') || '',
value_match => scalar $query->param('value_match') || '',
tagid => $tagid,
index => $index,
authority_types => $authority_types,

View file

@ -110,7 +110,7 @@ $template->param (
z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)),
ocoins => GetCOinSBiblio($record),
C4::Search::enabled_staff_search_views,
searchid => $query->param('searchid'),
searchid => scalar $query->param('searchid'),
);
my @allorders_using_biblio = GetOrdersByBiblionumber ($biblionumber);

View file

@ -316,7 +316,7 @@ $template->param (
marcview => 1,
z3950_search_params => C4::Search::z3950_search_args($biblio),
C4::Search::enabled_staff_search_views,
searchid => $query->param('searchid'),
searchid => scalar $query->param('searchid'),
);
my @allorders_using_biblio = GetOrdersByBiblionumber ($biblionumber);

View file

@ -392,7 +392,7 @@ $template->param(
subscriptions => \@subs,
subscriptionsnumber => $subscriptionsnumber,
subscriptiontitle => $dat->{title},
searchid => $query->param('searchid'),
searchid => scalar $query->param('searchid'),
);
# $debug and $template->param(debug_display => 1);

View file

@ -189,10 +189,10 @@ if (scalar keys %params > 0) {
$sortby = 'copyrightdate';
}
my $search_params = {
rows => $cgi->param('rows') // 20,
page => $cgi->param('page') || 1,
rows => scalar $cgi->param('rows') // 20,
page => scalar $cgi->param('page') || 1,
sortby => $sortby,
sortorder => $cgi->param('sortorder') || 'asc',
sortorder => scalar $cgi->param('sortorder') || 'asc',
};
my ($results, $total_rows) = SearchItems($filter, $search_params);

View file

@ -114,7 +114,7 @@ $template->param (
labeledmarcview => 1,
z3950_search_params => C4::Search::z3950_search_args($biblio),
C4::Search::enabled_staff_search_views,
searchid => $query->param('searchid'),
searchid => scalar $query->param('searchid'),
);
my @allorders_using_biblio = GetOrdersByBiblionumber ($biblionumber);

View file

@ -982,7 +982,7 @@ $template->param(
frameworkcode => $frameworkcode,
itemtype => $frameworkcode,
borrowernumber => $loggedinuser,
tab => $input->param('tab')
tab => scalar $input->param('tab')
);
$template->{'VARS'}->{'searchid'} = $searchid;

View file

@ -919,7 +919,7 @@ $template->param(
itemtagsubfield => $itemtagsubfield,
op => $nextop,
opisadd => ($nextop eq "saveitem") ? 0 : 1,
popup => $input->param('popup') ? 1: 0,
popup => scalar $input->param('popup') ? 1: 0,
C4::Search::enabled_staff_search_views,
);
$template->{'VARS'}->{'searchid'} = $searchid;

View file

@ -178,7 +178,7 @@ if ($merge) {
result => 1,
report_records => \@report_records,
report_header => $report_header,
ref_biblionumber => $input->param('ref_biblionumber')
ref_biblionumber => scalar $input->param('ref_biblionumber')
);
#-------------------------

View file

@ -24,6 +24,6 @@ use Koha::FrameworkPlugin;
my $input = new CGI;
my $plugin= Koha::FrameworkPlugin->new( {
name => $input->param("plugin_name"),
name => scalar $input->param("plugin_name"),
});
$plugin->launch({ cgi => $input });

View file

@ -120,8 +120,8 @@ my $launcher= sub {
flagsrequired => {editcatalogue => '*'},
});
$template->param(
index => $cgi->param('index'),
result => $cgi->param('result'),
index => scalar $cgi->param('index'),
result => scalar $cgi->param('result'),
);
output_html_with_http_headers $cgi, $cookie, $template->output;
};

View file

@ -147,7 +147,7 @@ my $launcher = sub {
$subfield_value_z =~ s/'/\\'/g;
$template->param(
fillinput => 1,
index => $query->param('index') . "",
index => scalar $query->param('index') . "",
biblionumber => $biblionumber ? $biblionumber : "",
subfield_value_9 => "$subfield_value_9",
subfield_value_0 => "$subfield_value_0",
@ -285,7 +285,7 @@ my $launcher = sub {
# );
$template->param(
result => \@arrayresults,
index => $query->param('index') . "",
index => scalar $query->param('index') . "",
startfrom => $startfrom,
displaynext => $displaynext,
displayprev => $displayprev,
@ -316,7 +316,7 @@ my $launcher = sub {
$template->param(
itypeloop => \@itemtypes,
index => $query->param('index'),
index => scalar $query->param('index'),
Search => 1,
);
}

View file

@ -136,7 +136,7 @@ my ($input) = @_;
my $link="../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_210c.pl&amp;authtypecode=EDITORS&amp;".join("&amp;",map {"value=".$_} @value)."&amp;op=do_search&amp;type=intranet&amp;index=$index";
$template->param(result => $results) if $results;
$template->param('index' => $query->param('index'));
$template->param('index' => scalar $query->param('index'));
$template->param(startfrom=> $startfrom,
displaynext=> $displaynext,
displayprev=> $displayprev,

View file

@ -332,7 +332,7 @@ sub plugin {
$subfield_value_y =~ s/'/\\'/g;
$template->param(
fillinput => 1,
index => $query->param('index') . "",
index => scalar $query->param('index') . "",
biblionumber => $biblionumber ? $biblionumber : "",
subfield_value_9 => "$subfield_value_9",
subfield_value_0 => "$subfield_value_0",
@ -487,7 +487,7 @@ sub plugin {
# );
$template->param(
result => \@arrayresults,
index => $query->param('index') . "",
index => scalar $query->param('index') . "",
startfrom => $startfrom,
displaynext => $displaynext,
displayprev => $displayprev,
@ -521,7 +521,7 @@ sub plugin {
$template->param( #classlist => $classlist,
itypeloop => \@itemtypes,
index => $query->param('index'),
index => scalar $query->param('index'),
Search => 1,
);
}

View file

@ -86,7 +86,7 @@ if ( @id==0 ) {
}
my $pars= {
random => $input->param('random') || rand(1000000000),
random => scalar $input->param('random') || rand(1000000000),
page => $page,
id => \@id,
nameany => $nameany,

View file

@ -624,7 +624,7 @@ $template->param(
branchname => GetBranchName($borrower->{'branchcode'}),
printer => $printer,
printername => $printer,
was_renewed => $query->param('was_renewed') ? 1 : 0,
was_renewed => scalar $query->param('was_renewed') ? 1 : 0,
expiry => $borrower->{'dateexpiry'},
roadtype => $roadtype,
amountold => $amountold,

View file

@ -75,8 +75,8 @@ if ($session->param('branch') eq 'NO_LIBRARY_SET'){
if ( $query->param('print_slip') ) {
$template->param(
print_slip => 1,
borrowernumber => $query->param('borrowernumber'),
biblionumber => $query->param('biblionumber'),
borrowernumber => scalar $query->param('borrowernumber'),
biblionumber => scalar $query->param('biblionumber'),
);
}

View file

@ -119,7 +119,7 @@ foreach ($query->param()) {
$_ eq "oldreferer" and next; # disclude oldreferer
push @recycle_loop, {
param => $_,
value => $query->param($_),
value => scalar $query->param($_),
};
}

View file

@ -79,18 +79,18 @@ if ( $action eq 'lookup' ) {
} elsif ( $action eq 'add' ) {
my $ci_id = ModCourseItem(
itemnumber => $cgi->param('itemnumber'),
itype => $cgi->param('itype'),
ccode => $cgi->param('ccode'),
holdingbranch => $cgi->param('holdingbranch'),
location => $cgi->param('location'),
itemnumber => scalar $cgi->param('itemnumber'),
itype => scalar $cgi->param('itype'),
ccode => scalar $cgi->param('ccode'),
holdingbranch => scalar $cgi->param('holdingbranch'),
location => scalar $cgi->param('location'),
);
my $cr_id = ModCourseReserve(
course_id => $course_id,
ci_id => $ci_id,
staff_note => $cgi->param('staff_note'),
public_note => $cgi->param('public_note'),
staff_note => scalar $cgi->param('staff_note'),
public_note => scalar $cgi->param('public_note'),
);
if ( $return ) {

View file

@ -47,7 +47,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
);
if ( $action eq 'del_reserve' ) {
DelCourseReserve( cr_id => $cgi->param('cr_id') );
DelCourseReserve( cr_id => scalar $cgi->param('cr_id') );
}
my $course = GetCourse($course_id);

View file

@ -103,16 +103,16 @@ elsif ($op eq 'save') {
$cgi->param('format_string', $format_string);
}
my @params = (
barcode_type => $cgi->param('barcode_type') || 'CODE39',
printing_type => $cgi->param('printing_type') || 'BAR',
layout_name => $cgi->param('layout_name') || 'DEFAULT',
barcode_type => scalar $cgi->param('barcode_type') || 'CODE39',
printing_type => scalar $cgi->param('printing_type') || 'BAR',
layout_name => scalar $cgi->param('layout_name') || 'DEFAULT',
guidebox => ($cgi->param('guidebox') ? 1 : 0),
oblique_title => ($cgi->param('oblique_title') ? 1 : 0),
font => $cgi->param('font') || 'TR',
font_size => $cgi->param('font_size') || 3,
font => scalar $cgi->param('font') || 'TR',
font_size => scalar $cgi->param('font_size') || 3,
callnum_split => ($cgi->param('callnum_split') ? 1 : 0),
text_justify => $cgi->param('text_justify') || 'L',
format_string => $cgi->param('format_string') || 'title, author, isbn, issn, itemtype, barcode, itemcallnumber',
text_justify => scalar $cgi->param('text_justify') || 'L',
format_string => scalar $cgi->param('format_string') || 'title, author, isbn, issn, itemtype, barcode, itemcallnumber',
);
if ($layout_id) { # if a label_id was passed in, this is an update to an existing layout
$layout = C4::Labels::Layout->retrieve(layout_id => $layout_id);

View file

@ -54,13 +54,13 @@ if ($op eq 'edit') {
}
elsif ($op eq 'save') {
my @params = (
printer_name => $cgi->param('printer_name') || 'DEFAULT PRINTER',
paper_bin => $cgi->param('paper_bin') || 'Tray 1',
offset_horz => $cgi->param('offset_horz') || 0,
offset_vert => $cgi->param('offset_vert') || 0,
creep_horz => $cgi->param('creep_horz') || 0,
creep_vert => $cgi->param('creep_vert') || 0,
units => $cgi->param('units') || 'POINT',
printer_name => scalar $cgi->param('printer_name') || 'DEFAULT PRINTER',
paper_bin => scalar $cgi->param('paper_bin') || 'Tray 1',
offset_horz => scalar $cgi->param('offset_horz') || 0,
offset_vert => scalar $cgi->param('offset_vert') || 0,
creep_horz => scalar $cgi->param('creep_horz') || 0,
creep_vert => scalar $cgi->param('creep_vert') || 0,
units => scalar $cgi->param('units') || 'POINT',
);
if ($profile_id) { # if a label_id was passed in, this is an update to an existing layout
$profile = C4::Labels::Profile->retrieve(profile_id => $profile_id);

View file

@ -61,22 +61,22 @@ if ($op eq 'edit') {
}
}
elsif ($op eq 'save') {
my @params = ( profile_id => $cgi->param('profile_id'),
template_code => $cgi->param('template_code') || 'DEFAULT_TEMPLATE',
template_desc => $cgi->param('template_desc') || 'Default description',
page_width => $cgi->param('page_width') || 0,
page_height => $cgi->param('page_height') || 0,
label_width => $cgi->param('label_width') || 0,
label_height => $cgi->param('label_height') || 0,
top_text_margin => $cgi->param('top_text_margin') || 0,
left_text_margin=> $cgi->param('left_text_margin') || 0,
top_margin => $cgi->param('top_margin') || 0,
left_margin => $cgi->param('left_margin') || 0,
cols => $cgi->param('cols') || 0,
rows => $cgi->param('rows') || 0,
col_gap => $cgi->param('col_gap') || 0,
row_gap => $cgi->param('row_gap') || 0,
units => $cgi->param('units') || 'POINT',
my @params = ( profile_id => scalar $cgi->param('profile_id'),
template_code => scalar $cgi->param('template_code') || 'DEFAULT_TEMPLATE',
template_desc => scalar $cgi->param('template_desc') || 'Default description',
page_width => scalar $cgi->param('page_width') || 0,
page_height => scalar $cgi->param('page_height') || 0,
label_width => scalar $cgi->param('label_width') || 0,
label_height => scalar $cgi->param('label_height') || 0,
top_text_margin => scalar $cgi->param('top_text_margin') || 0,
left_text_margin=> scalar $cgi->param('left_text_margin') || 0,
top_margin => scalar $cgi->param('top_margin') || 0,
left_margin => scalar $cgi->param('left_margin') || 0,
cols => scalar $cgi->param('cols') || 0,
rows => scalar $cgi->param('rows') || 0,
col_gap => scalar $cgi->param('col_gap') || 0,
row_gap => scalar $cgi->param('row_gap') || 0,
units => scalar $cgi->param('units') || 'POINT',
);
if ($template_id) { # if a template_id was passed in, this is an update to an existing template
$label_template = C4::Labels::Template->retrieve(template_id => $template_id);
@ -87,7 +87,7 @@ elsif ($op eq 'save') {
$old_profile->set_attr(template_id => 0);
$old_profile->save();
}
my $new_profile = C4::Labels::Profile->retrieve(profile_id => $cgi->param('profile_id'));
my $new_profile = C4::Labels::Profile->retrieve(profile_id => scalar $cgi->param('profile_id'));
$new_profile->set_attr(template_id => $label_template->get_attr('template_id'));
$new_profile->save();
}
@ -106,7 +106,7 @@ elsif ($op eq 'save') {
$label_template = C4::Labels::Template->new(@params);
my $template_id = $label_template->save();
if ($cgi->param('profile_id')) {
my $profile = C4::Labels::Profile->retrieve(profile_id => $cgi->param('profile_id'));
my $profile = C4::Labels::Profile->retrieve(profile_id => scalar $cgi->param('profile_id'));
$profile->set_attr(template_id => $template_id) if $template_id != $profile->get_attr('template_id');
$profile->save();
}

View file

@ -91,7 +91,7 @@ else {
name => $filename,
type => $mimetype,
content => $file_content,
description => $cgi->param('description'),
description => scalar $cgi->param('description'),
);
}
}
@ -99,7 +99,7 @@ else {
$errors{'no_file'} = 1;
}
} elsif ( $op eq 'delete' ) {
$bf->DelFile( id => $cgi->param('file_id') );
$bf->DelFile( id => scalar $cgi->param('file_id') );
}
$template->param(

View file

@ -77,9 +77,9 @@ my $view = $input->request_method() eq "GET" ? "show_form" : "show_results";
$template->param(
patron_lists => [ GetPatronLists() ],
searchmember => $searchmember,
branchcode_filter => $input->param('branchcode_filter'),
categorycode_filter => $input->param('categorycode_filter'),
searchtype => $input->param('searchtype') || 'contain',
branchcode_filter => scalar $input->param('branchcode_filter'),
categorycode_filter => scalar $input->param('categorycode_filter'),
searchtype => scalar $input->param('searchtype') || 'contain',
searchfieldstype => $searchfieldstype,
PatronsPerPage => C4::Context->preference("PatronsPerPage") || 20,
view => $view,

View file

@ -119,7 +119,7 @@ if ( $input->param('add_debarment') ) {
{
borrowernumber => $borrowernumber,
type => 'MANUAL',
comment => $input->param('debarred_comment'),
comment => scalar $input->param('debarred_comment'),
expiration => $expiration,
}
);

View file

@ -44,7 +44,7 @@ if ( $action eq 'del' ) {
AddDebarment(
{ borrowernumber => $borrowernumber,
type => 'MANUAL',
comment => $cgi->param('comment'),
comment => scalar $cgi->param('comment'),
expiration => $expiration,
}
);

View file

@ -324,7 +324,7 @@ $template->param(
borrowernumber => $borrowernumber,
othernames => $data->{'othernames'},
categoryname => $data->{'description'},
was_renewed => $input->param('was_renewed') ? 1 : 0,
was_renewed => scalar $input->param('was_renewed') ? 1 : 0,
branch => $branch,
todaysdate => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }),
totalprice => sprintf("%.2f", $totalprice),

View file

@ -111,35 +111,35 @@ if ( $op && $op eq 'search' ) {
my %borrower = (
'surname' => NLGetSurname( $cgi->param('navn') ),
'firstname' => NLGetFirstname( $cgi->param('navn') ),
'sex' => $cgi->param('kjonn'),
'dateofbirth' => $cgi->param('fdato'),
'cardnumber' => $cgi->param('lnr'),
'userid' => $cgi->param('lnr'),
'address' => $cgi->param('p_adresse1'),
'address2' => $cgi->param('p_adresse2'),
'zipcode' => $cgi->param('p_postnr'),
'city' => $cgi->param('p_sted'),
'country' => $cgi->param('p_land'),
'B_address' => $cgi->param('m_adresse1'),
'B_address2' => $cgi->param('m_adresse2'),
'B_zipcode' => $cgi->param('m_postnr'),
'B_city' => $cgi->param('m_sted'),
'B_country' => $cgi->param('m_land'),
'sex' => scalar $cgi->param('kjonn'),
'dateofbirth' => scalar $cgi->param('fdato'),
'cardnumber' => scalar $cgi->param('lnr'),
'userid' => scalar $cgi->param('lnr'),
'address' => scalar $cgi->param('p_adresse1'),
'address2' => scalar $cgi->param('p_adresse2'),
'zipcode' => scalar $cgi->param('p_postnr'),
'city' => scalar $cgi->param('p_sted'),
'country' => scalar $cgi->param('p_land'),
'B_address' => scalar $cgi->param('m_adresse1'),
'B_address2' => scalar $cgi->param('m_adresse2'),
'B_zipcode' => scalar $cgi->param('m_postnr'),
'B_city' => scalar $cgi->param('m_sted'),
'B_country' => scalar $cgi->param('m_land'),
'password' => NLDecodePin( $cgi->param('pin') ),
'dateexpiry' => $cgi->param('gyldig_til'),
'email' => $cgi->param('epost'),
'mobile' => $cgi->param('tlf_mobil'),
'phone' => $cgi->param('tlf_hjemme'),
'phonepro' => $cgi->param('tlf_jobb'),
'dateexpiry' => scalar $cgi->param('gyldig_til'),
'email' => scalar $cgi->param('epost'),
'mobile' => scalar $cgi->param('tlf_mobil'),
'phone' => scalar $cgi->param('tlf_hjemme'),
'phonepro' => scalar $cgi->param('tlf_jobb'),
'branchcode' => $userenv->{'branch'},
'categorycode' => $cgi->param('categorycode'),
'categorycode' => scalar $cgi->param('categorycode'),
);
# Add the new patron
my $borrowernumber = &AddMember(%borrower);
if ( $borrowernumber ) {
# Add extended patron attributes
SetBorrowerAttributes($borrowernumber, [
{ code => 'fnr', value => $cgi->param('fnr_hash') },
{ code => 'fnr', value => scalar $cgi->param('fnr_hash') },
], 'no_branch_limit' );
# Override the default sync data created by AddMember
my $borrowersync = Koha::Database->new->schema->resultset('BorrowerSync')->find({

View file

@ -96,7 +96,7 @@ if ( $individual || $writeoff ) {
$template->param(
selected_accts => $select_lines,
amt => $total_due,
selected_accts_notes => $input->param('notes'),
selected_accts_notes => scalar $input->param('notes'),
);
}

View file

@ -67,10 +67,10 @@ $template->param(
ACCOUNT_LINES => $accts,
total => sprintf( "%.2f", $total ),
accountview => 1,
message => $query->param('message') || q{},
message_value => $query->param('message_value') || q{},
payment => $query->param('payment') || q{},
payment_error => $query->param('payment-error') || q{},
message => scalar $query->param('message') || q{},
message_value => scalar $query->param('message_value') || q{},
payment => scalar $query->param('payment') || q{},
payment_error => scalar $query->param('payment-error') || q{},
);
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };

View file

@ -74,7 +74,7 @@ $template->param(
'biblionumber' => $biblionumber,
'borrowernumber' => $borrowernumber,
'review' => $clean || $savedreview->{'review'},
'reviewid' => $query->param('reviewid') || 0,
'reviewid' => scalar $query->param('reviewid') || 0,
'title' => $biblio->{'title'},
);

View file

@ -374,7 +374,7 @@ if ( $template_type && $template_type eq 'advsearch' ) {
# but let the user override it
if (defined $cgi->param('expanded_options')) {
if ( ($cgi->param('expanded_options') == 0) || ($cgi->param('expanded_options') == 1 ) ) {
$template->param( expanded_options => $cgi->param('expanded_options'));
$template->param( expanded_options => scalar $cgi->param('expanded_options'));
}
}

View file

@ -78,7 +78,7 @@ if ( $selectview eq "full" ) {
# $subscription->{opacnote} =~ s/\n/\<br\/\>/g;
$template->param(
biblionumber => $query->param('biblionumber'),
biblionumber => scalar $query->param('biblionumber'),
years => $subscriptioninformation,
yearmin => $yearmin,
yearmax => $yearmax,
@ -114,7 +114,7 @@ else {
# $subscription->{opacnote} =~ s/\n/\<br\/\>/g;
$template->param(
biblionumber => $query->param('biblionumber'),
biblionumber => scalar $query->param('biblionumber'),
subscription_LOOP => $subscriptions,
);
}

View file

@ -355,7 +355,7 @@ $template->param(
shelf => $shelf,
messages => \@messages,
category => $category,
print => $query->param('print') || 0,
print => scalar $query->param('print') || 0,
listsview => 1,
);

View file

@ -88,7 +88,7 @@ foreach my $type (@advanced_search_types) {
$type = 'itemtype';
}
$params->{$type} = $input->param($type);
$template->param('selected_' . $type => $input->param($type));
$template->param('selected_' . $type => scalar $input->param($type));
}
my @results = GetTopIssues($params);

View file

@ -353,7 +353,7 @@ $template->param(
SuspendHoldsOpac => C4::Context->preference('SuspendHoldsOpac'),
AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
OpacHoldNotes => C4::Context->preference('OpacHoldNotes'),
failed_holds => $query->param('failed_holds'),
failed_holds => scalar $query->param('failed_holds'),
);
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };

View file

@ -38,7 +38,7 @@ my ( $template, $logged_in_user, $cookie ) = get_template_and_user(
);
my ($list) =
GetPatronLists( { patron_list_id => $cgi->param('patron_list_id') } );
GetPatronLists( { patron_list_id => scalar $cgi->param('patron_list_id') } );
my @patrons_to_add = $cgi->multi_param('patrons_to_add');
if (@patrons_to_add) {

View file

@ -54,13 +54,13 @@ if ($op eq 'edit') {
}
elsif ($op eq 'save') {
my @params = (
printer_name => $cgi->param('printer_name'),
paper_bin => $cgi->param('paper_bin'),
offset_horz => $cgi->param('offset_horz'),
offset_vert => $cgi->param('offset_vert'),
creep_horz => $cgi->param('creep_horz'),
creep_vert => $cgi->param('creep_vert'),
units => $cgi->param('units'),
printer_name => scalar $cgi->param('printer_name'),
paper_bin => scalar $cgi->param('paper_bin'),
offset_horz => scalar $cgi->param('offset_horz'),
offset_vert => scalar $cgi->param('offset_vert'),
creep_horz => scalar $cgi->param('creep_horz'),
creep_vert => scalar $cgi->param('creep_vert'),
units => scalar $cgi->param('units'),
);
if ($profile_id) { # if a label_id was passed in, this is an update to an existing layout
$profile = C4::Patroncards::Profile->retrieve(profile_id => $profile_id);

View file

@ -53,20 +53,20 @@ if ($op eq 'edit') {
$profile_list = get_all_profiles(field_list => 'profile_id,printer_name,paper_bin', filter => "template_id=$template_id OR template_id=''");
}
elsif ($op eq 'save') {
my @params = ( profile_id => $cgi->param('profile_id') || '',
template_code => $cgi->param('template_code'),
template_desc => $cgi->param('template_desc'),
page_width => $cgi->param('page_width'),
page_height => $cgi->param('page_height'),
label_width => $cgi->param('card_width'),
label_height => $cgi->param('card_height'),
top_margin => $cgi->param('top_margin'),
left_margin => $cgi->param('left_margin'),
cols => $cgi->param('cols'),
rows => $cgi->param('rows'),
col_gap => $cgi->param('col_gap'),
row_gap => $cgi->param('row_gap'),
units => $cgi->param('units'),
my @params = ( profile_id => scalar $cgi->param('profile_id') || '',
template_code => scalar $cgi->param('template_code'),
template_desc => scalar $cgi->param('template_desc'),
page_width => scalar $cgi->param('page_width'),
page_height => scalar $cgi->param('page_height'),
label_width => scalar $cgi->param('card_width'),
label_height => scalar $cgi->param('card_height'),
top_margin => scalar $cgi->param('top_margin'),
left_margin => scalar $cgi->param('left_margin'),
cols => scalar $cgi->param('cols'),
rows => scalar $cgi->param('rows'),
col_gap => scalar $cgi->param('col_gap'),
row_gap => scalar $cgi->param('row_gap'),
units => scalar $cgi->param('units'),
);
if ($template_id) { # if a template_id was passed in, this is an update to an existing template
$card_template = C4::Patroncards::Template->retrieve(template_id => $template_id);
@ -76,7 +76,7 @@ elsif ($op eq 'save') {
$old_profile->set_attr(template_id => 0);
$old_profile->save();
}
my $new_profile = C4::Patroncards::Profile->retrieve(profile_id => $cgi->param('profile_id'));
my $new_profile = C4::Patroncards::Profile->retrieve(profile_id => scalar $cgi->param('profile_id'));
$new_profile->set_attr(template_id => $card_template->get_attr('template_id'));
$new_profile->save();
}
@ -88,7 +88,7 @@ elsif ($op eq 'save') {
die "Error: $card_template\n" if !ref($card_template);
my $template_id = $card_template->save();
if ($cgi->param('profile_id')) {
my $profile = C4::Patroncards::Profile->retrieve(profile_id => $cgi->param('profile_id'));
my $profile = C4::Patroncards::Profile->retrieve(profile_id => scalar $cgi->param('profile_id'));
$profile->set_attr(template_id => $template_id) if $template_id != $profile->get_attr('template_id');
$profile->save();
}

View file

@ -286,16 +286,16 @@ elsif ( $phase eq 'Report on this Area' ) {
'areas' => get_report_areas(),
'cache_expiry' => $cache_expiry,
'usecache' => $usecache,
'public' => $input->param('public'),
'public' => scalar $input->param('public'),
);
} else {
# they have choosen a new report and the area to report on
$template->param(
'build2' => 1,
'area' => $input->param('area'),
'area' => scalar $input->param('area'),
'types' => get_report_types(),
'cache_expiry' => $cache_expiry,
'public' => $input->param('public'),
'public' => scalar $input->param('public'),
);
}
}
@ -310,8 +310,8 @@ elsif ( $phase eq 'Choose this type' ) {
'area' => $area,
'type' => $type,
columns => get_columns($area,$input),
'cache_expiry' => $input->param('cache_expiry'),
'public' => $input->param('public'),
'cache_expiry' => scalar $input->param('cache_expiry'),
'public' => scalar $input->param('public'),
);
}
@ -330,12 +330,12 @@ elsif ( $phase eq 'Choose these columns' ) {
'column' => $column,
definitions => get_from_dictionary($area),
criteria => get_criteria($area,$input),
'public' => $input->param('public'),
'public' => scalar $input->param('public'),
);
if ( $usecache ) {
$template->param(
cache_expiry => $input->param('cache_expiry'),
cache_expiry_units => $input->param('cache_expiry_units'),
cache_expiry => scalar $input->param('cache_expiry'),
cache_expiry_units => scalar $input->param('cache_expiry_units'),
);
}
@ -395,12 +395,12 @@ elsif ( $phase eq 'Choose these criteria' ) {
'column' => $column,
'definition' => $definition,
'criteriastring' => $query_criteria,
'public' => $input->param('public'),
'public' => scalar $input->param('public'),
);
if ( $usecache ) {
$template->param(
cache_expiry => $input->param('cache_expiry'),
cache_expiry_units => $input->param('cache_expiry_units'),
cache_expiry => scalar $input->param('cache_expiry'),
cache_expiry_units => scalar $input->param('cache_expiry_units'),
);
}
@ -442,8 +442,8 @@ elsif ( $phase eq 'Choose these operations' ) {
'criteriastring' => $criteria,
'totals' => $totals,
'definition' => $definition,
'cache_expiry' => $input->param('cache_expiry'),
'public' => $input->param('public'),
'cache_expiry' => scalar $input->param('cache_expiry'),
'public' => scalar $input->param('public'),
);
# get columns
@ -495,8 +495,8 @@ elsif ( $phase eq 'Build report' ) {
'area' => $area,
'sql' => $sql,
'type' => $type,
'cache_expiry' => $input->param('cache_expiry'),
'public' => $input->param('public'),
'cache_expiry' => scalar $input->param('cache_expiry'),
'public' => scalar $input->param('public'),
);
}
@ -510,8 +510,8 @@ elsif ( $phase eq 'Save' ) {
'area' => $area,
'sql' => $sql,
'type' => $type,
'cache_expiry' => $input->param('cache_expiry'),
'public' => $input->param('public'),
'cache_expiry' => scalar $input->param('cache_expiry'),
'public' => scalar $input->param('public'),
'groups_with_subgroups' => groups_with_subgroups($area), # in case we have a report group that matches area
);
}
@ -912,9 +912,9 @@ elsif ( $phase eq 'Create report from SQL' ) {
$group = $input->param('report_group');
$subgroup = $input->param('report_subgroup');
$template->param(
'sql' => $input->param('sql') // '',
'reportname' => $input->param('reportname') // '',
'notes' => $input->param('notes') // '',
'sql' => scalar $input->param('sql') // '',
'reportname' => scalar $input->param('reportname') // '',
'notes' => scalar $input->param('notes') // '',
);
}
$template->param(

View file

@ -76,7 +76,7 @@ if ($selectview eq "full"){
# $subscription->{opacnote} =~ s/\n/\<br\/\>/g;
$template->param(
biblionumber => $query->param('biblionumber'),
biblionumber => scalar $query->param('biblionumber'),
years => $subscriptions,
yearmin => $yearmin,
yearmax =>$yearmax,

View file

@ -160,7 +160,7 @@ $template->param(
suggestion => C4::Context->preference("suggestion"),
virtualshelves => C4::Context->preference("virtualshelves"),
routing => C4::Context->preference("RoutingSerials"),
subscr=>$query->param('subscriptionid'),
subscr=>scalar $query->param('subscriptionid'),
subscriptioncount => $subscriptioncount,
location => $location,
callnumber => $callnumber,

View file

@ -59,22 +59,22 @@ my $custompattern = $input->param('custompattern');
my $frequency = GetSubscriptionFrequency($frequencyid);
my %pattern = (
numberingmethod => $input->param('numberingmethod') // '',
numbering1 => $input->param('numbering1') // '',
numbering2 => $input->param('numbering2') // '',
numbering3 => $input->param('numbering3') // '',
add1 => $input->param('add1') // '',
add2 => $input->param('add2') // '',
add3 => $input->param('add3') // '',
whenmorethan1 => $input->param('whenmorethan1') // '',
whenmorethan2 => $input->param('whenmorethan2') // '',
whenmorethan3 => $input->param('whenmorethan3') // '',
setto1 => $input->param('setto1') // '',
setto2 => $input->param('setto2') // '',
setto3 => $input->param('setto3') // '',
every1 => $input->param('every1') // '',
every2 => $input->param('every2') // '',
every3 => $input->param('every3') // '',
numberingmethod => scalar $input->param('numberingmethod') // '',
numbering1 => scalar $input->param('numbering1') // '',
numbering2 => scalar $input->param('numbering2') // '',
numbering3 => scalar $input->param('numbering3') // '',
add1 => scalar $input->param('add1') // '',
add2 => scalar $input->param('add2') // '',
add3 => scalar $input->param('add3') // '',
whenmorethan1 => scalar $input->param('whenmorethan1') // '',
whenmorethan2 => scalar $input->param('whenmorethan2') // '',
whenmorethan3 => scalar $input->param('whenmorethan3') // '',
setto1 => scalar $input->param('setto1') // '',
setto2 => scalar $input->param('setto2') // '',
setto3 => scalar $input->param('setto3') // '',
every1 => scalar $input->param('every1') // '',
every2 => scalar $input->param('every2') // '',
every3 => scalar $input->param('every3') // '',
);
$firstacquidate = eval { output_pref( { str => $firstacquidate, dateonly => 1, dateformat => 'iso' } ); }
@ -90,13 +90,13 @@ if($nextacquidate) {
my $date = $nextacquidate;
my %subscription = (
locale => $input->param('locale') // '',
lastvalue1 => $input->param('lastvalue1') // '',
lastvalue2 => $input->param('lastvalue2') // '',
lastvalue3 => $input->param('lastvalue3') // '',
innerloop1 => $input->param('innerloop1') // '',
innerloop2 => $input->param('innerloop2') // '',
innerloop3 => $input->param('innerloop3') // '',
locale => scalar $input->param('locale') // '',
lastvalue1 => scalar $input->param('lastvalue1') // '',
lastvalue2 => scalar $input->param('lastvalue2') // '',
lastvalue3 => scalar $input->param('lastvalue3') // '',
innerloop1 => scalar $input->param('innerloop1') // '',
innerloop2 => scalar $input->param('innerloop2') // '',
innerloop3 => scalar $input->param('innerloop3') // '',
irregularity => '',
periodicity => $frequencyid,
countissuesperunit => 1,

View file

@ -323,9 +323,9 @@ sub redirect_add_subscription {
my $location = $query->param('location');
my $skip_serialseq = $query->param('skip_serialseq');
my $startdate = output_pref( { str => $query->param('startdate'), dateonly => 1, dateformat => 'iso' } );
my $enddate = output_pref( { str => $query->param('enddate'), dateonly => 1, dateformat => 'iso' } );
my $firstacquidate = output_pref( { str => $query->param('firstacquidate'), dateonly => 1, dateformat => 'iso' } );
my $startdate = output_pref( { str => scalar $query->param('startdate'), dateonly => 1, dateformat => 'iso' } );
my $enddate = output_pref( { str => scalar $query->param('enddate'), dateonly => 1, dateformat => 'iso' } );
my $firstacquidate = output_pref( { str => scalar $query->param('firstacquidate'), dateonly => 1, dateformat => 'iso' } );
if(!defined $enddate || $enddate eq '') {
if($subtype eq "issues") {
@ -357,16 +357,16 @@ sub redirect_mod_subscription {
my $subscriptionid = $query->param('subscriptionid');
my @irregularity = $query->multi_param('irregularity');
my $auser = $query->param('user');
my $librarian => $query->param('librarian'),
my $librarian => scalar $query->param('librarian'),
my $branchcode = $query->param('branchcode');
my $cost = $query->param('cost');
my $aqbooksellerid = $query->param('aqbooksellerid');
my $biblionumber = $query->param('biblionumber');
my $aqbudgetid = $query->param('aqbudgetid');
my $startdate = output_pref( { str => $query->param('startdate'), dateonly => 1, dateformat => 'iso' } );
my $enddate = output_pref( { str => $query->param('enddate'), dateonly => 1, dateformat => 'iso' } );
my $firstacquidate = output_pref( { str => $query->param('firstacquidate'), dateonly => 1, dateformat => 'iso' } );
my $startdate = output_pref( { str => scalar $query->param('startdate'), dateonly => 1, dateformat => 'iso' } );
my $enddate = output_pref( { str => scalar $query->param('enddate'), dateonly => 1, dateformat => 'iso' } );
my $firstacquidate = output_pref( { str => scalar $query->param('firstacquidate'), dateonly => 1, dateformat => 'iso' } );
my $nextacquidate = $query->param('nextacquidate');
$nextacquidate = $nextacquidate
@ -451,7 +451,7 @@ sub insert_additional_fields {
}
} else {
$af->{values} = {
$subscriptionid => $query->param('additional_field_' . $field->{id})
$subscriptionid => scalar $query->param('additional_field_' . $field->{id})
} if defined $query->param('additional_field_' . $field->{id});
}
$af->insert_values;

View file

@ -74,7 +74,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
}
);
if ( $op eq "renew" ) {
my $startdate = output_pref( { str => $query->param('startdate'), dateonly => 1, dateformat => 'iso' } );
my $startdate = output_pref( { str => scalar $query->param('startdate'), dateonly => 1, dateformat => 'iso' } );
ReNewSubscription(
$subscriptionid, $loggedinuser,
$startdate, $query->param('numberlength'),

View file

@ -302,7 +302,7 @@ $template->param(
shelf => $shelf,
messages => \@messages,
category => $category,
print => $query->param('print') || 0,
print => scalar $query->param('print') || 0,
csv_profiles => GetCsvProfilesLoop('marc'),
);